Files
ansible_samba_tasks/tasks/setupacdc.yml
Jose 7f79e3cc99 chore 📦: Update setupacdc.yml to use Ansible shell command
Updated the pct create command to use the new ansible.builtin.shell module, allowing for more flexibility and consistency in container creation.
2025-11-02 07:35:28 +01:00

32 lines
984 B
YAML

- 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
ansible.builtin.shell: |
pct create 200 '/var/lib/vz/template/cache/debian-13-standard_13.1-1_amd64.tar.zst' \
-ostype debian \
-hostname {{ addc_hostname }} \
-password 123456 \
-cores 2 \
-memory 1024 \
-swap 128 \
-net0 name=eth0,bridge=vmbr0,ip={{ addc_ansible_host }}/24,gw={{ location_gateway }},hwaddr={{ mac_address }} \
-storage local-lvm \
-description "default lxc" \
-onboot 1 \
-protection 0 \
-unprivileged 1 \
-tags "ansible_managed,test" \
-features keyctl=1,nesting=1,mount=cifs
become: yes
become_user: root
# -timezone: {{ localization_timezone }} \