From: Lorin Hochstein Date: Sat, 11 Feb 2017 18:58:53 +0000 (-0800) Subject: make keypair X-Git-Url: https://git.halfball.org/?a=commitdiff_plain;h=1afbd1c3dc0be6194119b8a0baf2bbf35e30a771;p=ansiblebook.git make keypair --- diff --git a/ch12/playbooks/make-keypair.yml b/ch12/playbooks/make-keypair.yml new file mode 100644 index 0000000..151d228 --- /dev/null +++ b/ch12/playbooks/make-keypair.yml @@ -0,0 +1,16 @@ +- name: make a keypair + hosts: localhost + gather_facts: False + tasks: + - name: create mykey + ec2_key: name=mykey region=us-west-1 + register: keypair + - name: write the key to a file + copy: + dest: files/mykey.pem + content: "{{ keypair.key.private_key }}" + mode: 0600 + when: keypair.changed + - name: dump var + debug: var=keypair +