GRM-20: fix molecule idempotence with mode-specific systemd templates
CI / lint (push) Has been cancelled
CI / unit-tests (push) Has been cancelled
CI / molecule-tests (push) Has been cancelled

This commit is contained in:
Emil Simeonov
2026-06-19 14:12:58 +02:00
parent 1a917e7a5d
commit 129cfe3c79
13 changed files with 77 additions and 24 deletions
@@ -7,9 +7,20 @@
ansible.builtin.include_vars:
dir: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') }}/defaults"
tasks:
- name: Check Docker mode systemd template exists
ansible.builtin.stat:
path: "/etc/systemd/system/gitea-runner-docker@.service"
register: docker_template_stat
- name: Assert Docker mode systemd template exists
ansible.builtin.assert:
that:
- docker_template_stat.stat.exists
fail_msg: "Docker systemd template is missing"
- name: Read rendered Docker systemd template
ansible.builtin.slurp:
src: "/etc/systemd/system/gitea-runner@.service"
src: "/etc/systemd/system/gitea-runner-docker@.service"
register: docker_template
- name: Assert Docker mode template contains expected directives
@@ -23,6 +34,30 @@
- "'Restart=on-failure' in docker_template.content | b64decode"
fail_msg: "Docker systemd template is missing expected directives"
- name: Check Binary mode systemd template exists
ansible.builtin.stat:
path: "/etc/systemd/system/gitea-runner-binary@.service"
register: binary_template_stat
- name: Assert Binary mode systemd template exists
ansible.builtin.assert:
that:
- binary_template_stat.stat.exists
fail_msg: "Binary systemd template is missing"
- name: Read rendered Binary systemd template
ansible.builtin.slurp:
src: "/etc/systemd/system/gitea-runner-binary@.service"
register: binary_template
- name: Assert Binary mode template contains expected directives
ansible.builtin.assert:
that:
- "'Type=simple' in binary_template.content | b64decode"
- "'ExecStart={{ gitea_runner_binary_path }}' in binary_template.content | b64decode"
- "'Restart=on-failure' in binary_template.content | b64decode"
fail_msg: "Binary systemd template is missing expected directives"
- name: Read rendered prune service template
ansible.builtin.slurp:
src: "/etc/systemd/system/docker-prune.service"