Skip to content

Commit e0f5d82

Browse files
committed
fixes ssh key gen idempotency
if all keys are generated, due to the condition, the service tries to start always but isn't because the conditions aren't met
1 parent a42fcf4 commit e0f5d82

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

roles/ssh/tasks/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@
106106
name: '{{ __ssh_genkeys }}'
107107
state: started
108108
become: yes
109+
register: __ssh_keys_generated
110+
changed_when:
111+
- __ssh_keys_generated.changed
112+
- __ssh_keys_generated.status.ConditionResult == 'yes'
109113
when: __ssh_genkeys is defined
110114
tags:
111115
- ssh-host-keys

0 commit comments

Comments
 (0)