From f880f5b8d550ed46e68bdc37f5c3b1bd48cdedf5 Mon Sep 17 00:00:00 2001 From: Jose Date: Sun, 2 Nov 2025 10:21:23 +0100 Subject: [PATCH] =?UTF-8?q?chore=20=F0=9F=93=A6:=20Update=20setupacdc.yml?= =?UTF-8?q?=20to=20combine=20SSH=20public=20keys=20into=20one=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated the setupacdc.yml configuration to combine SSH public keys into a single file, improving security and organization. This change simplifies the process of managing SSH keys for LXC containers. --- tasks/setupacdc.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tasks/setupacdc.yml b/tasks/setupacdc.yml index a9057c7..d5868cc 100644 --- a/tasks/setupacdc.yml +++ b/tasks/setupacdc.yml @@ -32,13 +32,22 @@ tasks: + - name: Combine SSH public keys into one file + ansible.builtin.copy: + dest: "{{ ssh_keys_file }}" + content: | + {% for key in ssh_public_keys %} + {{ key }} + {% endfor %} + mode: '0644' + - name: Create LXC container {{ container_hostname }} with id {{ container_id }} using pct command on shell ansible.builtin.shell: | pct create {{ container_id }} {{ container_template }} \ -ostype {{ container_ostype }} \ -hostname {{ container_hostname }} \ -password {{ container_password }} \ - -ssh-public-keys "{{ container_pubkey }}" \ + -ssh-public-keys {{ ssh_keys_file }} \ -cores {{ container_cores }} \ -memory {{ container_memory }} \ -swap {{ container_swap }} \