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)

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 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)."
    # 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

AUTHOR
Brad Olson

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