ANSIBLE.AUTHORIZED_KEY(3)       ANSIBLE MODULES      ANSIBLE.AUTHORIZED_KEY(3)



NAME
       authorized_key - Adds or removes an SSH authorized key

DESCRIPTION
       Adds or removes authorized keys for particular user accounts

OPTIONS
       key    The SSH public key, as a string(required)

       key_options
              A string of ssh key options to be prepended to the key in the
              authorized_keys file(Added in Ansible version 1.4.)


       manage_dir
              Whether this module should manage the directory of the
              authorized_keys file Choices: yes,no. (default: yes)(Added in
              Ansible version 1.2.)


       path   Alternate path to the authorized_keys file (default:
              (homedir)+/.ssh/authorized_keys)(Added in Ansible version 1.2.)


       state  Whether the given key (with the given key_options) should or
              should not be in the file Choices: present,absent. (default:
              present)

       user   The username on the remote host whose authorized_keys file will
              be modified(required).

EXAMPLES
       # Example using key data from a local file on the management machine
       - authorized_key: user=charlie key="{{ lookup('file', '/home/charlie/.ssh/id_rsa.pub') }}"

       # Using alternate directory locations:
       - authorized_key: user=charlie
                         key="{{ lookup('file', '/home/charlie/.ssh/id_rsa.pub') }}"
                         path='/etc/ssh/authorized_keys/charlie'
                         manage_dir=no

       # Using with_file
       - name: Set up authorized_keys for the deploy user
         authorized_key: user=deploy
                         key="{{ item }}"
         with_file:
           - public_keys/doe-jane
           - public_keys/doe-john

       # Using key_options:
       - authorized_key: user=charlie
                         key="{{ lookup('file', '/home/charlie/.ssh/id_rsa.pub') }}"
                         key_options='no-port-forwarding,host="10.0.1.1"'



AUTHOR
       Brad Olson

SEE ALSO
       ansible(1), http://ansible.github.com/modules.html#authorized-key



1.4.5                             2014-02-12         ANSIBLE.AUTHORIZED_KEY(3)
