fix: verify SSH key readability before creating Cloud-Init user-data snippet

This commit is contained in:
2025-12-03 21:14:28 +01:00
parent 900d376933
commit 7ae3150ad0

View File

@@ -130,6 +130,12 @@
mode: "0644"
register: vendor_snippet
- name: "[CONFIG] Verify SSH key is readable"
ansible.builtin.stat:
path: "{{ ssh_keys_file | expanduser }}"
register: ssh_key_stat
failed_when: not ssh_key_stat.stat.readable
- name: "[CONFIG] Create Cloud-Init user-data snippet"
ansible.builtin.template:
src: cloudinit_userdata.yaml.j2
@@ -137,12 +143,6 @@
mode: "0644"
register: user_snippet
- name: "[CONFIG] Verify SSH key is readable"
ansible.builtin.stat:
path: "{{ ssh_keys_file | expanduser }}"
register: ssh_key_stat
failed_when: not ssh_key_stat.stat.readable
- name: "[CONFIG] Copy SSH public key to snippets"
ansible.builtin.copy:
src: "{{ ssh_keys_file | expanduser }}"