️: optimize key deployment

This commit is contained in:
VC
2025-02-10 16:36:18 +01:00
parent ff31ac7cb0
commit 164ec3afc7
2 changed files with 3 additions and 9 deletions

View File

@@ -1 +0,0 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAaugK6NnC9ZPyl8jRrAurAfaQSAQdBLDV81RNHziaD6 fhc@fhc-MacBookPro

View File

@@ -94,17 +94,12 @@
notify: notify:
- Restart sshd - Restart sshd
- name: Put ssh key home - name: Put ssh keys
ansible.posix.authorized_key: ansible.posix.authorized_key:
user: root user: root
state: present state: present
key: "{{ lookup('file', 'ssh/home.id_ed25519.pub') }}" key: "{{ lookup('file', item) }}"
loop: "{{ query('ansible.builtin.fileglob', 'files/ssh/*.pub') }}"
- name: Put ssh key work
ansible.posix.authorized_key:
user: root
state: present
key: "{{ lookup('file', 'ssh/work.id_ed25519.pub') }}"
- name: Put cron-apt configuration file - name: Put cron-apt configuration file
ansible.builtin.copy: ansible.builtin.copy: