Files
playbooks/caddy/roles/register/tasks/main.yaml
T
tanshu 476a6d7cd0 Cut the comment bloat from the Podman playbooks
Comment blocks now stay within three lines and explain only the non-obvious. Long histories, include examples, and commented-out code are gone. No task, key, or value changed; the only data change is comment text inside the generated unit files.
2026-10-18 22:10:57 +05:30

31 lines
1.0 KiB
YAML

---
# Include from a service playbook with network_name set. The play must define
# the "Restart Caddy" handler.
- name: "Create the {{ network_name }} network unit"
ansible.builtin.copy:
dest: "{{ quadlet_dir }}/{{ network_name }}.network"
owner: "{{ podman_user }}"
group: "{{ podman_user }}"
mode: '0644'
content: |
# Managed by Ansible. NetworkName pins the Podman name; isolate blocks
# traffic between separate networks.
[Network]
NetworkName={{ network_name }}_net
Options=isolate=true
notify: Restart Caddy
- name: "Register {{ network_name }} with Caddy"
ansible.builtin.copy:
dest: "{{ quadlet_dir }}/{{ caddy_name | default('caddy') }}.container.d/50-{{ network_name }}.conf"
owner: "{{ podman_user }}"
group: "{{ podman_user }}"
mode: '0644'
content: |
# Added by {{ network_name }}. Deleting it detaches the network from
# Caddy on the next daemon-reload.
[Container]
Network={{ network_name }}.network
notify: Restart Caddy