Files
Kamino/roles/traefik/molecule/default/tasks/update_and_check.yml
T
Defame1297 ab0ce421cc
Build / build (pull_request) Canceled after 0s
Lint / lint (pull_request) Canceled after 0s
Molecule / molecule (pull_request) Canceled after 0s
feat(traefik): add traefik_release_url for a release mirror
The archive and checksums URLs were hardcoded to the GitHub releases.
traefik_release_url (default: the GitHub release directory of
traefik_version, as before) lets a host download from a mirror.

The Molecule scenario uses it: verify's update path now downloads
stand-in releases that prepare.yml builds under /opt/molecule-download
(a stub binary answering `version`, its archive and a sha256sum
checksums file), so it no longer fetches two more real releases per
host. The converge still downloads the real release from GitHub, which
keeps the default URL proven. traefik_verify_other_version moves to the
scenario's group vars so prepare and verify share it. The update path
leaves the stub installed, which the README and verify now state.

Verify replaces the fixed 15 s pause with a poll (30 x 2 s) for an
"Unable to obtain ACME certificate" log line stamped at or after the
running process's ExecMainStartTimestamp, so a line left by the
process converge restarted does not count. It fails closed on a
missing start time, a missing line or an unparseable stamp. It then
asserts NRestarts
is 0, since Restart=always would hide a crash.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-27 15:36:34 +00:00

43 lines
1.7 KiB
YAML

---
- name: Run the role with the update path to {{ traefik_verify_target }}
ansible.builtin.include_role:
name: mortis.kamino.traefik
vars:
traefik_update: true
traefik_version: "{{ traefik_verify_target }}"
traefik_release_url: "file:///opt/molecule-download/{{ traefik_verify_target }}"
- name: Read the Traefik version after the update to {{ traefik_verify_target }}
ansible.builtin.command: /usr/local/bin/traefik version
register: traefik_verify_bumped
changed_when: false
- name: Read the Traefik unit after the update to {{ traefik_verify_target }}
ansible.builtin.systemd:
name: traefik
register: traefik_verify_bumped_unit
- name: Stat the update leftovers after the update to {{ traefik_verify_target }}
ansible.builtin.stat:
path: "{{ traefik_verify_bump_leftover }}"
loop:
- /usr/local/bin/.traefik-staging
- /usr/local/bin/traefik.bak
- /tmp/traefik.tar.gz
- /tmp/traefik_checksums.txt
loop_control:
loop_var: traefik_verify_bump_leftover
register: traefik_verify_bump_leftovers
- name: Traefik runs the new release and nothing is left behind ({{ traefik_verify_target }})
ansible.builtin.assert:
that:
- traefik_verify_target | regex_replace('^v', '') in traefik_verify_bumped.stdout
- traefik_verify_bumped_unit.status.ActiveState == 'active'
- traefik_verify_bump_leftovers.results | selectattr('stat.exists') | list | length == 0
fail_msg: >-
version output {{ traefik_verify_bumped.stdout }}, unit {{ traefik_verify_bumped_unit.status.ActiveState }},
left behind {{ traefik_verify_bump_leftovers.results | selectattr('stat.exists')
| map(attribute='traefik_verify_bump_leftover') | list }}
quiet: true