I'm using ansible os_keypair module towards Openstack, through AWX, to create a new keypair:
- hosts: localhost
tasks:
- name: Create new keypair, ask for the name in survey
os_keypair:
cloud: rhosp
state: present
name: "{{ survey_keypair_name }}"
register: result
- name: Show only private key to copy it in .pem
debug: var=result.key.private_key
When creating a new keypair from Horizon I can download the private_key.pem. How can I retrieve that through ansible module?
Thanks to the register/debug modules I can see output in job execution and copy-paste it manually to a file, but it's a ugly one-line output and it would be nice to have it already in file format.
Any idea?