Skip to content

Commit ca9e48a

Browse files
committed
Debug: temporarily revert most ansible
1 parent ef9147d commit ca9e48a

File tree

2 files changed

+33
-34
lines changed

2 files changed

+33
-34
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
---
21
persist_hostkeys_state_server: "{{ groups['control'] | first }}"
32
persist_hostkeys_state_dir: "{{ hostvars[persist_hostkeys_state_server]['appliances_state_dir'] }}/hostkeys"
Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
11
---
2+
23
- name: Generate persistent hostkeys in state directory
34
delegate_to: "{{ persist_hostkeys_state_server }}"
45
block:
5-
- name: Ensure hostkeys directory exists on persistent storage
6-
ansible.builtin.file:
7-
path: "{{ persist_hostkeys_state_dir }}"
8-
state: directory
9-
owner: root
10-
group: root
11-
mode: "0600"
12-
13-
- name: Check for existing hostkeys
14-
ansible.builtin.find:
15-
paths: "{{ persist_hostkeys_state_dir }}/"
16-
register: _files_found
6+
- name: Ensure hostkeys directory exists on persistent storage
7+
file:
8+
path: "{{ persist_hostkeys_state_dir }}"
9+
state: directory
10+
owner: root
11+
group: root
12+
mode: 0600
1713

18-
- name: Generate hostkeys # noqa: no-changed-when
19-
when: _files_found.matched == 0
20-
ansible.builtin.shell:
21-
# ssh-keygen -A needs a directory with an /etc/ssh suffix to write hostkeys into
22-
cmd: |
23-
mkdir -p {{ persist_hostkeys_state_dir }}/etc/ssh
24-
ssh-keygen -A -N '' -f {{ persist_hostkeys_state_dir }}
25-
mv {{ persist_hostkeys_state_dir }}/etc/ssh/* {{ persist_hostkeys_state_dir }}
26-
rm -rf {{ persist_hostkeys_state_dir }}/etc/ssh
14+
- name: Check for existing hostkeys
15+
find:
16+
paths: "{{ persist_hostkeys_state_dir }}/"
17+
register: _files_found
2718

28-
- name: Get created key names
29-
ansible.builtin.find:
30-
path: "{{ persist_hostkeys_state_dir }}/"
31-
register: _find_ssh_keys
19+
- name: Generate hostkeys
20+
when: _files_found.matched == 0
21+
shell:
22+
# ssh-keygen -A needs a directory with an /etc/ssh suffix to write hostkeys into
23+
cmd: |
24+
mkdir -p {{ persist_hostkeys_state_dir }}/etc/ssh
25+
ssh-keygen -A -N '' -f {{ persist_hostkeys_state_dir }}
26+
mv {{ persist_hostkeys_state_dir }}/etc/ssh/* {{ persist_hostkeys_state_dir }}
27+
rm -rf {{ persist_hostkeys_state_dir }}/etc/ssh
28+
29+
- name: Get created key names
30+
find:
31+
path: "{{ persist_hostkeys_state_dir }}/"
32+
register: _find_ssh_keys
3233

33-
- name: Create in-memory copies of keys
34-
ansible.builtin.slurp:
35-
src: "{{ item.path }}"
36-
loop: "{{ _find_ssh_keys.files }}"
37-
register: _slurp_keys
34+
- name: Create in-memory copies of keys
35+
ansible.builtin.slurp:
36+
src: "{{ item.path }}"
37+
loop: "{{ _find_ssh_keys.files }}"
38+
register: _slurp_keys
3839

3940
- name: Copy keys to hosts
4041
no_log: true
41-
ansible.builtin.copy:
42+
copy:
4243
content: "{{ item.content | b64decode }}"
4344
dest: "/etc/ssh/{{ item.source | regex_search('[^/]+$') }}"
44-
mode: "0644"
4545
loop: "{{ _slurp_keys.results }}"
4646

47-
- ansible.builtin.meta: reset_connection
47+
- meta: reset_connection

0 commit comments

Comments
 (0)