]> git.ekhem.eu.org Git - turnup.git/commitdiff
Copy SSH public key after the turnup.
authorJakub Czajka <jakub@ekhem.eu.org>
Fri, 1 Dec 2023 01:40:41 +0000 (02:40 +0100)
committerJakub Czajka <jczajka@google.com>
Sun, 24 Dec 2023 18:46:45 +0000 (19:46 +0100)
install/ssh_public_keys.yaml [new file with mode: 0644]
turnup.yaml

diff --git a/install/ssh_public_keys.yaml b/install/ssh_public_keys.yaml
new file mode 100644 (file)
index 0000000..d6400e8
--- /dev/null
@@ -0,0 +1,14 @@
+# Copyright (c) 2023 Jakub Czajka <jakub@ekhem.eu.org>
+# 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 }}"
index 1aafc0ff3a372e761b1471cd304f984e7d2aa79b..11f5d2c33559357cc7c4f969a8539a9eaf65e780 100644 (file)
@@ -26,3 +26,4 @@
       with_items: "{{ post_receive_scripts.files }}"
 
 - import_playbook: install/database_from_save.yaml
+- import_playbook: install/ssh_public_keys.yaml