netcup-setup/ansible/roles/services/tasks/create_containers_conf.yml
2025-12-27 19:31:11 +01:00

23 lines
846 B
YAML

---
- name: Remove pasta configuration if setting is off
ansible.builtin.file:
path: "/home/{{ service_name }}/.config/containers/containers.conf"
state: absent
when: enable_pasta_config is not defined or not enable_pasta_config
- name: Ensure configuration path
ansible.builtin.file:
path: "/home/{{ service_name }}/.config/containers"
state: directory
owner: "{{ service_name }}"
group: "{{ service_name }}"
mode: '0755'
when: enable_pasta_config is defined and enable_pasta_config
- name: Create pasta configuration
ansible.builtin.copy:
dest: "/home/{{ service_name }}/.config/containers/containers.conf"
content: |
[network]
pasta_options = ["-a", "10.0.2.0", "-n", "24", "-g", "10.0.2.2", "--dns-forward", "10.0.2.3"]
when: enable_pasta_config is defined and enable_pasta_config