evaluation did not work

This commit is contained in:
2025-05-07 14:41:06 +02:00
parent 3025b5bc22
commit 3f801419b1

View File

@@ -40,12 +40,21 @@
job: '[[ -f /etc/ssh/ssh_host_* ]] || ssh-keygen -A'
state: absent
- name: correct crontab for reboot | add
- name: correct crontab for reboot | remove
become: true
become_user: root
cron:
name: "generate SSH key on reboot, if missing"
job: "[[ -f /etc/ssh/ssh_host_* ]] || ssh-keygen -A && systemctl restart {{ ssh_service }}"
state: absent
special_time: reboot
- name: correct crontab for reboot | add
become: true
become_user: root
cron:
name: "generate SSH key on reboot, if missing"
job: "KEYS=(/etc/ssh/ssh_host_*_key); (( ${#KEYS[@]} )) || ( ssh-keygen -A && systemctl restart {{ ssh_service }} )"
state: present
special_time: reboot