Skip to content

Instantly share code, notes, and snippets.

@jas02
Created January 8, 2018 07:57
Show Gist options
  • Select an option

  • Save jas02/cb10fd790100e4e026f355833e520aa0 to your computer and use it in GitHub Desktop.

Select an option

Save jas02/cb10fd790100e4e026f355833e520aa0 to your computer and use it in GitHub Desktop.
- name: fetch all servers id_rsa.pub file content
shell: cat ~/.ssh/id_rsa.pub
register: ssh_keys
- name: make sure all ssh keys are in authorized_keys
authorized_key:
user: root
key: "{{ item[0] }}"
delegate_to: "{{ item[1] }}"
with_nested:
- "{{ ssh_keys.stdout }}"
- "{{groups['openshift']}}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment