- Add runner_name variable to default, binary, and lifecycle verify playbooks - Update molecule target to test all 7 scenarios sequentially - Add molecule-docker and molecule-binary platform matrix targets - Disable checkmake maxbodylength rule to accommodate longer recipes
70 lines
2.0 KiB
YAML
70 lines
2.0 KiB
YAML
---
|
|
- name: Verify
|
|
hosts: all
|
|
become: true
|
|
vars:
|
|
runner_name: "molecule-test-runner"
|
|
pre_tasks:
|
|
- name: Load role defaults
|
|
ansible.builtin.include_vars:
|
|
dir: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') }}/defaults"
|
|
tasks:
|
|
- name: Check gitea_runner binary exists
|
|
ansible.builtin.stat:
|
|
path: "{{ gitea_runner_binary_path }}"
|
|
register: gitea_runner_stat
|
|
|
|
- name: Assert gitea_runner binary exists
|
|
ansible.builtin.assert:
|
|
that:
|
|
- gitea_runner_stat.stat.exists
|
|
fail_msg: "gitea_runner binary is missing at {{ gitea_runner_binary_path }}"
|
|
|
|
- name: Check Docker is installed
|
|
ansible.builtin.command: docker --version
|
|
changed_when: false
|
|
|
|
- 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 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 config file exists
|
|
ansible.builtin.stat:
|
|
path: "{{ gitea_runner_config_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"
|