Files
grm/ansible/roles/gitea-runner/molecule/update/verify.yml
T
Emil Simeonov 129cfe3c79
CI / lint (push) Has been cancelled
CI / unit-tests (push) Has been cancelled
CI / molecule-tests (push) Has been cancelled
GRM-20: fix molecule idempotence with mode-specific systemd templates
2026-06-19 14:12:58 +02:00

75 lines
2.6 KiB
YAML

---
- name: Verify
hosts: all
become: true
pre_tasks:
- name: Load role defaults
ansible.builtin.include_vars:
dir: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') }}/defaults"
tasks:
- name: Check Docker runner image still exists after update
ansible.builtin.command: docker images gitea/runner --format '{{ '{{' }} .Repository {{ '}}' }}:{{ '{{' }} .Tag {{ '}}' }}'
register: image_list
changed_when: false
- name: Assert runner image exists after update
ansible.builtin.assert:
that:
- "'gitea/runner' in image_list.stdout"
fail_msg: "Runner Docker image missing after update"
- name: Check binary runner executable still exists after update
ansible.builtin.stat:
path: "{{ gitea_runner_binary_path }}"
register: binary_stat
- name: Assert binary executable exists after update
ansible.builtin.assert:
that:
- binary_stat.stat.exists
fail_msg: "Binary runner executable missing after update"
- name: Check Docker mode systemd template still exists
ansible.builtin.stat:
path: "/etc/systemd/system/gitea-runner-docker@.service"
register: docker_service_stat
- name: Assert Docker mode systemd template still exists after update
ansible.builtin.assert:
that:
- docker_service_stat.stat.exists
fail_msg: "Docker mode systemd template missing after update"
- name: Check Binary mode systemd template still exists
ansible.builtin.stat:
path: "/etc/systemd/system/gitea-runner-binary@.service"
register: binary_service_stat
- name: Assert Binary mode systemd template still exists after update
ansible.builtin.assert:
that:
- binary_service_stat.stat.exists
fail_msg: "Binary mode systemd template missing after update"
- name: Check Docker mode data directory still exists
ansible.builtin.stat:
path: "/var/lib/gitea-runner/update-docker-runner"
register: docker_data_stat
- name: Assert Docker mode data directory exists after update
ansible.builtin.assert:
that:
- docker_data_stat.stat.exists
fail_msg: "Docker runner data directory missing after update"
- name: Check Binary mode data directory still exists
ansible.builtin.stat:
path: "/var/lib/gitea-runner/update-binary-runner"
register: binary_data_stat
- name: Assert Binary mode data directory exists after update
ansible.builtin.assert:
that:
- binary_data_stat.stat.exists
fail_msg: "Binary runner data directory missing after update"