Skip to content

Commit 47ee3fe

Browse files
committed
test: escape the cryptsetup instance name on EL7
systemd 219 rejects the cryptsetup template in systemd-escape. Escape only the mapper name, then use it in the fixed service template. Keep the first-invocation LoadState and SourcePath assertions intact. Assisted-by: OpenCode using model GPT-6.2 Astra Signed-off-by: Bata Roland Krisztián <batarolandkrisztian@gmail.com>
1 parent e9d4d40 commit 47ee3fe

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎tests/tests_luks2.yml‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,25 +107,26 @@
107107
encryption_password: yabbadabbadoo
108108
encryption_luks_version: luks2
109109

110-
# Assisted by OpenCode using model GPT-6.1 Sol
110+
# Assisted by OpenCode using models GPT-6.1 Sol, GPT-6.2 Astra
111111
- name: Verify crypttab was loaded during the first role invocation
112112
when: ansible_facts['service_mgr'] == 'systemd'
113113
block:
114-
- name: Derive the new cryptsetup unit name
114+
# systemd-escape on EL7 rejects --template for this unit.
115+
- name: Escape the new cryptsetup instance name
115116
command:
116117
argv:
117118
- systemd-escape
118-
- --template=systemd-cryptsetup@.service
119+
- --
119120
- "{{ blivet_output.crypts[0].name }}"
120-
register: storage_test_cryptsetup_unit
121+
register: storage_test_cryptsetup_instance
121122
changed_when: false
122123

123124
- name: Inspect the new cryptsetup unit without reloading systemd
124125
command:
125126
argv:
126127
- systemctl
127128
- show
128-
- "{{ storage_test_cryptsetup_unit.stdout }}"
129+
- "systemd-cryptsetup@{{ storage_test_cryptsetup_instance.stdout }}.service"
129130
- --property=LoadState,SourcePath
130131
register: storage_test_cryptsetup_state
131132
changed_when: false

0 commit comments

Comments
 (0)