In an Ansible role I generate the user\'s SSH key. After that I want to print it to the screen and pause so the user can copy and paste it somewhere else. So far I have some
Prints pubkey and avoid the changed status by adding changed_when: False to cat task:
- name: Generate SSH keys for vagrant user
user: name=vagrant generate_ssh_key=yes ssh_key_bits=2048
- name: Check SSH public key
command: /bin/cat $home_directory/.ssh/id_rsa.pub
register: cat
changed_when: False
- name: Print SSH public key
debug: var=cat.stdout
- name: Wait for user to copy SSH public key
pause: prompt="Please add the SSH public key above to your GitHub account"