Skip to content

Commit ccfa289

Browse files
committed
fix hostkeys in IPA not matching host when persisting keys
1 parent 406d94b commit ccfa289

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

ansible/extras.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
ansible.builtin.fail:
7272
msg: Reboot handler for stackhpc.linux.vgpu role fired unexpectedly. This was supposed to be unreachable.
7373

74+
<<<<<<< HEAD
7475
- name: Persist hostkeys across rebuilds
7576
# Must be after filesystems.yml (for storage)
7677
# and before portal.yml (where OOD login node hostkeys are scanned)
@@ -81,6 +82,8 @@
8182
- ansible.builtin.import_role:
8283
name: persist_hostkeys
8384

85+
=======
86+
>>>>>>> 31751b79 (fix hostkeys in IPA not matching host when persisting keys)
8487
- name: Install k9s
8588
become: true
8689
hosts: k9s

ansible/iam.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@
1313
tasks_from: addhost.yml
1414
when: groups['freeipa_server'] | length > 0
1515

16+
- name: Persist hostkeys across rebuilds
17+
# Must be:
18+
# - after filesystems.yml (for storage)
19+
# - before ipa (re)enrolment, which updates IPA record to match actual hostkey
20+
# - before portal.yml (where OOD login node hostkeys are scanned)
21+
hosts: persist_hostkeys:!builder
22+
become: true
23+
gather_facts: false
24+
tasks:
25+
- ansible.builtin.import_role:
26+
name: persist_hostkeys
27+
1628
- hosts: freeipa_client
1729
tags:
1830
- freeipa

ansible/roles/freeipa/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,16 @@ Support FreeIPA in the appliance. In production use it is expected the FreeIPA s
3333
- This is implemented when using the site OpenTofu; on the control node `appliances_state_dir` defaults to `/var/lib/state` which is mounted from a volume.
3434
- Nodes are not re-enroled by a [Slurm-driven reimage](../../collections/ansible_collections/stackhpc/slurm_openstack_tools/roles/rebuild/README.md) (as that does not run this role).
3535
- If both a backed-up keytab and `freeipa_host_password` exist, the former is used.
36+
<<<<<<< HEAD
3637

3738
### Role Variables for Clients
39+
=======
40+
- When re-enroling, the host record in FreeIPA host record is updated with the
41+
current hostkey. The `persist_hostkeys` role may be used if rebuilds/reimages
42+
should not change keys.
43+
44+
## Role Variables for Clients
45+
>>>>>>> 31751b79 (fix hostkeys in IPA not matching host when persisting keys)
3846

3947
- `freeipa_host_password`. Required for initial enrolment only, FreeIPA host password as described above.
4048
- `freeipa_setup_dns`: Optional, whether to use the FreeIPA server as the client's nameserver. Defaults to `true` when `freeipa_server` contains a host, otherwise `false`.

0 commit comments

Comments
 (0)