blob: c3b35c36bd4fbd85e3e10b39b65d52242ec41918 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
---
- name: Check if ssh secret exists
run_once: true
delegate_to: "{{ groups.masters[0] }}"
command: oc -n "{{ openshift_namespace }}" get secret/ands-ssh
register: result
changed_when: result is failed
failed_when: false
- include_tasks: ssh_keygen.yml
args:
apply:
run_once: true
delegate_to: "{{ groups.masters[0] }}"
when: (result is changed)
- name: Read SSH public key
shell: cat "{{ ssh_template_path }}/id_rsa.pub"
changed_when: false
register: result
- name: Distribute public keys
authorized_key: user="root" key="{{result.stdout}}" state=present manage_dir=yes exclusive=no
|