From cbccbe42c5e876c7eb9759cb803bcf7154ba342e Mon Sep 17 00:00:00 2001 From: Jakub Czajka Date: Fri, 1 Dec 2023 02:40:41 +0100 Subject: [PATCH] Copy SSH public key after the turnup. --- install/ssh_public_keys.yaml | 14 ++++++++++++++ turnup.yaml | 1 + 2 files changed, 15 insertions(+) create mode 100644 install/ssh_public_keys.yaml diff --git a/install/ssh_public_keys.yaml b/install/ssh_public_keys.yaml new file mode 100644 index 0000000..d6400e8 --- /dev/null +++ b/install/ssh_public_keys.yaml @@ -0,0 +1,14 @@ +# Copyright (c) 2023 Jakub Czajka +# License: GPL-3.0 or later. + +- hosts: servers + tasks: + - name: Copy the SSH key for user {{ users }} + authorized_key: + user: "{{ item }}" + state: present + key: "{{ public_key }}" + key_options: > + "no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty" + become: true + with_items: "{{ users }}" diff --git a/turnup.yaml b/turnup.yaml index 1aafc0f..11f5d2c 100644 --- a/turnup.yaml +++ b/turnup.yaml @@ -26,3 +26,4 @@ with_items: "{{ post_receive_scripts.files }}" - import_playbook: install/database_from_save.yaml +- import_playbook: install/ssh_public_keys.yaml -- 2.39.5