summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Alessandro Locati <me@fale.io>2016-11-11 19:39:23 +0000
committerRyan Brown <sb@ryansb.com>2016-11-11 14:39:23 -0500
commit1f0d62b36d1e8d905503772d1e5a75926af033de (patch)
treef60123ddb0a7527026cfca5764cc8cd4bca31583
parent8d1fe3b444737b26d6c634fc55010239ad342174 (diff)
downloadansible-modules-core-1f0d62b36d1e8d905503772d1e5a75926af033de.tar.gz
Use native YAML (#5571)
-rw-r--r--system/authorized_key.py25
1 files changed, 19 insertions, 6 deletions
diff --git a/system/authorized_key.py b/system/authorized_key.py
index 084ce95f..0b15d2fd 100644
--- a/system/authorized_key.py
+++ b/system/authorized_key.py
@@ -92,10 +92,14 @@ author: "Ansible Core Team"
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') }}"
+- authorized_key:
+ user: charlie
+ key: "{{ lookup('file', '/home/charlie/.ssh/id_rsa.pub') }}"
# Using github url as key source
-- authorized_key: user=charlie key=https://github.com/charlie.keys
+- authorized_key:
+ user: charlie
+ key: https://github.com/charlie.keys
# Using alternate directory locations:
- authorized_key:
@@ -114,19 +118,28 @@ EXAMPLES = '''
# Using key_options:
- authorized_key:
user: charlie
- key: "{{ lookup('file', '/home/charlie/.ssh/id_rsa.pub') }}"
+ key: "{{ lookup('file', '/home/charlie/.ssh/id_rsa.pub') }}"
key_options: 'no-port-forwarding,from="10.0.1.1"'
# Using validate_certs:
-- authorized_key: user=charlie key=https://github.com/user.keys validate_certs=no
+- authorized_key:
+ user: charlie
+ key: https://github.com/user.keys
+ validate_certs: no
# Set up authorized_keys exclusively with one key
-- authorized_key: user=root key="{{ item }}" state=present exclusive=yes
+- authorized_key:
+ user: root
+ key: '{{ item }}'
+ state: present
+ exclusive: yes
with_file:
- public_keys/doe-jane
# Copies the key from the user who is running ansible to the remote machine user ubuntu
-- authorized_key: user=ubuntu key="{{ lookup('file', lookup('env','HOME') + '/.ssh/id_rsa.pub') }}"
+- authorized_key:
+ user: ubuntu
+ key: "{{ lookup('file', lookup('env','HOME') + '/.ssh/id_rsa.pub') }}"
become: yes
'''