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.

Revisions

  1. jas02 created this gist Jan 8, 2018.
    13 changes: 13 additions & 0 deletions ssh_keys.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    - 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']}}"