feat : Add proxmox Debian template to create a new LXC build container

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.
This commit is contained in:
2025-11-08 09:14:57 +01:00
parent 93b886c634
commit 1c6e71ccc3

View File

@@ -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 }}