From 164ec3afc7938b0f4035280085e44fc818099dd9 Mon Sep 17 00:00:00 2001 From: VC Date: Mon, 10 Feb 2025 16:36:18 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F:=20optimize=20key=20deployme?= =?UTF-8?q?nt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- roles/system/files/ssh/stefofficiel.id_rsa.pub | 1 - roles/system/tasks/main.yml | 11 +++-------- 2 files changed, 3 insertions(+), 9 deletions(-) delete mode 100644 roles/system/files/ssh/stefofficiel.id_rsa.pub diff --git a/roles/system/files/ssh/stefofficiel.id_rsa.pub b/roles/system/files/ssh/stefofficiel.id_rsa.pub deleted file mode 100644 index 1ad93af..0000000 --- a/roles/system/files/ssh/stefofficiel.id_rsa.pub +++ /dev/null @@ -1 +0,0 @@ -ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAaugK6NnC9ZPyl8jRrAurAfaQSAQdBLDV81RNHziaD6 fhc@fhc-MacBookPro diff --git a/roles/system/tasks/main.yml b/roles/system/tasks/main.yml index 25b51b3..31140c2 100644 --- a/roles/system/tasks/main.yml +++ b/roles/system/tasks/main.yml @@ -94,17 +94,12 @@ notify: - Restart sshd - - name: Put ssh key home + - name: Put ssh keys ansible.posix.authorized_key: user: root state: present - key: "{{ lookup('file', 'ssh/home.id_ed25519.pub') }}" - - - name: Put ssh key work - ansible.posix.authorized_key: - user: root - state: present - key: "{{ lookup('file', 'ssh/work.id_ed25519.pub') }}" + key: "{{ lookup('file', item) }}" + loop: "{{ query('ansible.builtin.fileglob', 'files/ssh/*.pub') }}" - name: Put cron-apt configuration file ansible.builtin.copy: