Changes LXC deployment role and introduces a new playbook for that

This commit is contained in:
2026-08-09 12:58:32 +05:00
parent ba366a55a2
commit a2a5ba3a5e
3 changed files with 40 additions and 11 deletions
@@ -1,6 +1,6 @@
---
- name: Create new container with minimal options defining network interface with static ip
- name: Create a new container with minimal options defining network interface with static ip
become: false
community.proxmox.proxmox:
validate_certs: false
@@ -11,20 +11,21 @@
api_token_secret: "{{ proxmox_token_secret }}"
cmode: "shell"
vmid: 1040
password: ansible-test
hostname: "ansible-test"
# ostemplate: 'main:vztmpl/debian-13-standard_13.1-2_amd64.tar.zst'
password: "{{ lxc_root_password }}"
hostname: "{{ lxc_hostname }}"
ostemplate: 'main:vztmpl/debian-13-golden-image.tar.gz'
memory: 2048
cores: 5
cores: 2
state: present
disk_volume:
size: 2 # 2GB rootfs
# This is minimal requirement for rootfs
# It might be resized later
size: 4 # 4GB rootfs
# We put rootfs on fast local storage (NVMe SSD)
storage: local
pubkey: "{{ lookup('file', lookup('env', 'HOME') + '/.ssh/ansible_key.pub') }}"
netif:
net0: "name=eth0,gw=192.168.0.1,ip=192.168.0.40/24,bridge=vmbr0"
net0: "name=eth0,gw=192.168.0.1,ip={{ lxc_ip_address }},bridge=vmbr0"
- name: Make sure the container has started
become: false