2025-11-01 18:47:03 +01:00
|
|
|
- hosts: node0
|
|
|
|
|
gather_facts: no
|
|
|
|
|
|
|
|
|
|
vars:
|
|
|
|
|
addc_hostname: "DC1"
|
|
|
|
|
mac_address: "8E:90:31:DE:31:36"
|
|
|
|
|
node_ip: "{{ hostvars['node0']['ansible_host'] }}"
|
|
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
|
|
|
|
|
|
- name: Create LXC container using pct command
|
2025-11-02 07:35:28 +01:00
|
|
|
ansible.builtin.shell: |
|
2025-11-01 22:37:25 +01:00
|
|
|
pct create 200 '/var/lib/vz/template/cache/debian-13-standard_13.1-1_amd64.tar.zst' \
|
2025-11-01 23:20:28 +01:00
|
|
|
-ostype debian \
|
|
|
|
|
-hostname {{ addc_hostname }} \
|
|
|
|
|
-password 123456 \
|
|
|
|
|
-cores 2 \
|
2025-11-01 23:38:31 +01:00
|
|
|
-memory 1024 \
|
|
|
|
|
-swap 128 \
|
2025-11-01 23:20:28 +01:00
|
|
|
-net0 name=eth0,bridge=vmbr0,ip={{ addc_ansible_host }}/24,gw={{ location_gateway }},hwaddr={{ mac_address }} \
|
|
|
|
|
-storage local-lvm \
|
2025-11-01 23:43:15 +01:00
|
|
|
-description "default lxc" \
|
2025-11-01 23:26:11 +01:00
|
|
|
-onboot 1 \
|
2025-11-01 23:55:30 +01:00
|
|
|
-protection 0 \
|
2025-11-01 23:26:11 +01:00
|
|
|
-unprivileged 1 \
|
2025-11-01 23:43:15 +01:00
|
|
|
-tags "ansible_managed,test" \
|
2025-11-01 23:20:28 +01:00
|
|
|
-features keyctl=1,nesting=1,mount=cifs
|
2025-11-01 23:08:40 +01:00
|
|
|
|
2025-11-01 18:47:03 +01:00
|
|
|
become: yes
|
|
|
|
|
become_user: root
|
2025-11-01 23:27:16 +01:00
|
|
|
# -timezone: {{ localization_timezone }} \
|