authorized_key
Collection: posix
Full Name: parallax.posix.authorized_key
Aliases: ansible.posix.authorized_key, authorized_key
Synopsis
Manage authorized key
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| user | string | yes | The username on the remote host whose authorized_keys file will be modified | |
| key | string | yes | The SSH public key(s), as a string or url (https://github.com/username.keys) | |
| path | string | Alternate path to the authorized_keys file (default: ~user/.ssh/authorized_keys) | ||
| state | string | present | Whether the given key should be in the file or not Choices: present, absent | |
| exclusive | bool | false | Whether to remove all other non-specified keys from the authorized_keys file | |
| manage_dir | bool | true | Whether this module should manage the directory of the authorized_keys file | |
| key_options | string | A string of ssh key options to be prepended to the key in the authorized_keys file | ||
| comment | string | Change the comment on the public key (only supported for keys in the file, not for URLs) | ||
| validate_certs | bool | true | This only applies if using a https url as the source of the keys | |
| follow | bool | false | Follow path symlink instead of replacing it |
Example
- name: Example authorized_key task
authorized_key:
user: <your_user>
key: <your_key>