FEATURE: automatic LXC creation added

This commit is contained in:
2026-07-07 11:40:00 +00:00
parent d6cddf13eb
commit e033652d3e
2 changed files with 39 additions and 9 deletions
+15 -9
View File
@@ -1,14 +1,20 @@
--- ---
- name: Basic Proxmox guest deployment - name: Deplot simple test LXC on Proxmox VE
hosts: all hosts: localhost
remote_user: root gather_facts: false
roles: roles:
- ../roles/0_basic_postinstall - ../roles/00_basic_proxmox_lxc
vars_files:
../inventory/group_vars/all/secrets.yaml #- name: Basic Proxmox guest deployment
vars: # hosts: all
ansible_user_passwd_hash: "{{ ansible_password | password_hash('sha512', 's3edscrj45e6r') }}" # remote_user: root
user_passwd_hash: "{{ user_password | password_hash('sha512', 's3ed6123jhgcr') }}" # roles:
# - ../roles/01_basic_postinstall
# vars_files:
# ../inventory/group_vars/all/secrets.yaml
# vars:
# ansible_user_passwd_hash: "{{ ansible_password | password_hash('sha512', 's3edscrj45e6r') }}"
# user_passwd_hash: "{{ user_password | password_hash('sha512', 's3ed6123jhgcr') }}"
handlers: handlers:
- name: restart sshd - name: restart sshd
@@ -0,0 +1,24 @@
---
- name: Create new container with minimal options defining network interface with static ip
become: no
community.proxmox.proxmox:
node: proxmox-server
api_user: root@pam
api_host: 192.168.0.2
api_token_id: ansible
api_token_secret: "{{ proxmox_token_secret }}"
vmid: 1040
password: ansible-test
hostname: "ansible-test"
ostemplate: 'main:vztmpl/debian-13-standard_13.1-2_amd64.tar.zst'
memory: 2048
cores: 5
state: started
disk_volume:
size: 2 # 2GB rootfs
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"