Build with Podman and deploy as a rootless Quadlet on emily
- Makefile: podman build/push from the committed tree (git archive HEAD), tagged :<commit> + :latest; PLATFORM defaults to linux/arm64 for emily. - deploy.sh: push the commit first, refuse a dirty tracked tree or HEAD != origin/main, then build and deploy that exact commit via -e image_tag (rollback = an older commit). - ansible: target emily with no become. The register role writes hops.network (NetworkName=hops_net) plus the caddy.container.d drop-in; the hops role installs ~/podman-data/hops and hops.container under systemctl --user with a podman healthcheck gate; the caddy role appends the site blocks to the shared Caddyfile and reloads. - Drop the Docker-era network role, community.docker requirements, ansible/files templates and docker-compose.yml. - .containerignore replaces .dockerignore. - README: Podman build, rootless Quadlet deploy on emily.
This commit is contained in:
1 parent
486ed14ee9
commit
843c8ba78a
20 files changed
+618
-235
No files matched your search
@@ -1,5 +1,31 @@
|
||||
---
|
||||
# Caddy is its own playbook (caddy/playbook.yml in the ansible-playbooks repo)
|
||||
# and a rootless Quadlet unit there. These handlers run as the connection user,
|
||||
# so `systemctl --user` and `podman exec` work without any XDG_RUNTIME_DIR
|
||||
# juggling.
|
||||
|
||||
# Notified by roles/caddy when the Caddyfile changes. A reload keeps existing
|
||||
# connections; a restart would briefly drop every hosted site.
|
||||
#
|
||||
# Note the config path: /etc/caddy/Caddyfile is the mount inside the container,
|
||||
# not {{ caddyfile_path }}, which is the host side of it.
|
||||
- name: Reload Caddy configuration
|
||||
ansible.builtin.command: "docker exec -w /etc/caddy {{ caddy_container }} caddy reload"
|
||||
listen: "Reload Caddy"
|
||||
ansible.builtin.command: >-
|
||||
podman exec {{ caddy_name }} caddy reload --config /etc/caddy/Caddyfile
|
||||
changed_when: true
|
||||
listen: "Reload Caddy"
|
||||
|
||||
# Notified by roles/register when this service's network unit, or the drop-in
|
||||
# that attaches Caddy to it, is written. Quadlet has no live equivalent of
|
||||
# `docker network connect`, so the container has to be recreated — a brief
|
||||
# restart of every hosted site, not just this one.
|
||||
#
|
||||
# Defined after the reload above so that when both are notified the cheap config
|
||||
# reload happens first.
|
||||
- name: Restart Caddy
|
||||
ansible.builtin.systemd_service:
|
||||
name: "{{ caddy_name }}.service"
|
||||
scope: user
|
||||
state: restarted
|
||||
daemon_reload: true
|
||||
listen: Restart Caddy
|
||||
Reference in new issue
Block a user