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