From 1c6e71ccc32edee5fafddd841a246eef8775b9f4 Mon Sep 17 00:00:00 2001 From: Jose Date: Sat, 8 Nov 2025 09:14:57 +0100 Subject: [PATCH] =?UTF-8?q?feat=20=E2=9C=A8:=20Add=20proxmox=20Debian=20te?= =?UTF-8?q?mplate=20to=20create=20a=20new=20LXC=20build=20container?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated the tasks/create_proxmox_debian_template.yml file to include a new parameter for combining SSH public keys into one file, allowing for easier management of multiple keys. This change enables more flexibility when creating LXC containers with Proxmox and Debian. --- tasks/create_proxmox_debian_template.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tasks/create_proxmox_debian_template.yml b/tasks/create_proxmox_debian_template.yml index ebc3fef..67efdba 100644 --- a/tasks/create_proxmox_debian_template.yml +++ b/tasks/create_proxmox_debian_template.yml @@ -17,7 +17,7 @@ lxc_memory: 2048 lxc_net: "name=eth0,bridge=vmbr0,ip=dhcp" lxc_rootfs_size: "8G" - lxc_password: "password" + lxc_password: "password" tasks: - block: @@ -31,11 +31,21 @@ state: present update_cache: true + - 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 build container ansible.builtin.command: > pct create {{ lxc_id }} {{ lxc_template }} --hostname {{ lxc_name }} --password '{{ lxc_password }}' + --ssh-public-keys '{{ ssh_keys_file }}' --cores {{ lxc_cores }} --memory {{ lxc_memory }} --ostype {{ lxc_ostype }}