|
|
@ -124,6 +124,14 @@ EXAMPLES = '''
|
|
|
|
- authorized_key: user=root key="{{ item }}" state=present exclusive=yes
|
|
|
|
- authorized_key: user=root key="{{ item }}" state=present exclusive=yes
|
|
|
|
with_file:
|
|
|
|
with_file:
|
|
|
|
- public_keys/doe-jane
|
|
|
|
- public_keys/doe-jane
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Copies the key from the user who is running ansible to the remote machine
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
|
|
|
|
my_ssh_key: "{{ lookup('env','HOME') }}/.ssh/id_rsa.pub"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- authorized_key: user=ubuntu key="{{ lookup('file', my_ssh_key) }}"
|
|
|
|
|
|
|
|
sudo: yes
|
|
|
|
|
|
|
|
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
# Makes sure the public key line is present or absent in the user's .ssh/authorized_keys.
|
|
|
|
# Makes sure the public key line is present or absent in the user's .ssh/authorized_keys.
|
|
|
|