GRM-5: feat: parameterize all hardcoded configuration values as Ansible variables

This commit is contained in:
Emil Simeonov
2026-06-18 03:36:20 +02:00
parent 0cea9b9490
commit cc000c226c
13 changed files with 211 additions and 46 deletions
@@ -0,0 +1,56 @@
---
- 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 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 service file exists
ansible.builtin.stat:
path: "/etc/systemd/system/gitea-runner-molecule-test-runner.service"
register: service_stat
- name: Assert service file exists
ansible.builtin.assert:
that:
- service_stat.stat.exists
fail_msg: "Systemd service file 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.toml"
register: config_stat
- name: Assert config file exists
ansible.builtin.assert:
that:
- config_stat.stat.exists
fail_msg: "Config file is missing"