- Add multi-instance molecule scenario verifying isolated data/config dirs - Add lifecycle molecule scenario testing stop/disable/enable/start sequence - Update default and binary verify playbooks for template unit assertions - Add integration tests for full CLI lifecycle and multi-instance support - Add pytest integration marker and --no-cov Makefile target - Update README with lifecycle commands, multi-instance examples, and architecture - Update Makefile with start/stop/enable/disable/status/remove targets - Update .env.example with GRM_LANG documentation
68 lines
2.0 KiB
YAML
68 lines
2.0 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 is installed
|
|
ansible.builtin.command: docker --version
|
|
changed_when: false
|
|
|
|
- name: Check runner image was pulled
|
|
ansible.builtin.command: docker images gitea/runner --format '{{ '{{' }} .Repository {{ '}}' }}:{{ '{{' }} .Tag {{ '}}' }}'
|
|
register: image_list
|
|
changed_when: false
|
|
|
|
- name: Assert runner image exists locally
|
|
ansible.builtin.assert:
|
|
that:
|
|
- "'gitea/runner' in image_list.stdout"
|
|
fail_msg: "Runner Docker image was not pulled"
|
|
|
|
- name: Check prune timer exists
|
|
ansible.builtin.stat:
|
|
path: /etc/systemd/system/docker-prune.timer
|
|
register: timer_stat
|
|
|
|
- name: Assert prune timer exists
|
|
ansible.builtin.assert:
|
|
that:
|
|
- timer_stat.stat.exists
|
|
fail_msg: "Docker prune timer is missing"
|
|
|
|
- name: Check systemd template unit exists
|
|
ansible.builtin.stat:
|
|
path: "/etc/systemd/system/gitea-runner@.service"
|
|
register: service_stat
|
|
|
|
- name: Assert template unit exists
|
|
ansible.builtin.assert:
|
|
that:
|
|
- service_stat.stat.exists
|
|
fail_msg: "Systemd template unit is missing"
|
|
|
|
- name: Check instance data directory exists
|
|
ansible.builtin.stat:
|
|
path: "{{ gitea_runner_data_dir }}"
|
|
register: data_dir_stat
|
|
|
|
- name: Assert instance data directory exists
|
|
ansible.builtin.assert:
|
|
that:
|
|
- data_dir_stat.stat.exists
|
|
fail_msg: "Instance data directory is missing"
|
|
|
|
- name: Check config file exists in data directory
|
|
ansible.builtin.stat:
|
|
path: "{{ gitea_runner_data_dir }}/config.yaml"
|
|
register: config_stat
|
|
|
|
- name: Assert config file exists
|
|
ansible.builtin.assert:
|
|
that:
|
|
- config_stat.stat.exists
|
|
fail_msg: "Config file is missing"
|