- Makefile: PLATFORMS, tags :<commit> and :main, build-check with --pull. - deploy.sh: push, guards, git pull --ff-only, optional --prune, image_tag. - Replace .containerignore with .dockerignore. - Add the opt-in image prune to the hops role. - Tag the Caddyfile task so --skip-tags caddy works before DNS cutover. - Trim comments and rewrite build and deploy text in plain prose.
47 lines
1.5 KiB
YAML
47 lines
1.5 KiB
YAML
---
|
|
# Write hops.network and the Caddy drop-in that joins Caddy to it.
|
|
# Run from pre_tasks, before the app unit is generated.
|
|
|
|
- name: Ensure the Quadlet directory exists
|
|
ansible.builtin.file:
|
|
path: "{{ quadlet_dir }}"
|
|
state: directory
|
|
owner: "{{ podman_user }}"
|
|
group: "{{ podman_user }}"
|
|
mode: '0755'
|
|
|
|
- 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: |
|
|
# {{ network_name }} network unit. Managed by Ansible.
|
|
# NetworkName pins the Podman name to {{ network_name }}_net.
|
|
[Network]
|
|
NetworkName={{ network_name }}_net
|
|
Options=isolate=true
|
|
notify: Restart Caddy
|
|
|
|
- name: Ensure the Caddy Quadlet drop-in directory exists
|
|
ansible.builtin.file:
|
|
path: "{{ quadlet_dir }}/{{ caddy_name }}.container.d"
|
|
state: directory
|
|
owner: "{{ podman_user }}"
|
|
group: "{{ podman_user }}"
|
|
mode: '0755'
|
|
|
|
- name: "Register {{ network_name }} with Caddy"
|
|
ansible.builtin.copy:
|
|
dest: "{{ quadlet_dir }}/{{ caddy_name }}.container.d/50-{{ network_name }}.conf"
|
|
owner: "{{ podman_user }}"
|
|
group: "{{ podman_user }}"
|
|
mode: '0644'
|
|
content: |
|
|
# Added by the Hops n Grains playbook. Managed by Ansible.
|
|
# Quadlet merges this into caddy.container.
|
|
[Container]
|
|
Network={{ network_name }}.network
|
|
notify: Restart Caddy
|