The validate.yml had an unconditional 'docker version' check, and service.yml/prune.yml unconditionally enabled services that need Docker running. Added when: docker_rootless_setup to: - validate.yml: Verify rootless Docker connectivity - service.yml: Enable and start gitea-runner service - prune.yml: Enable and start docker-prune timer Also made lifecycle side_effect tolerant of service start failure since Docker daemon isn't available in molecule containers. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
27 lines
885 B
YAML
27 lines
885 B
YAML
---
|
|
- name: Check gitea_runner binary exists
|
|
ansible.builtin.stat:
|
|
path: "{{ gitea_runner_binary_path }}"
|
|
register: gitea_runner_stat
|
|
|
|
- name: Fail if gitea_runner binary is missing
|
|
ansible.builtin.fail:
|
|
msg: "gitea_runner binary not found at {{ gitea_runner_binary_path }}"
|
|
when: not gitea_runner_stat.stat.exists
|
|
|
|
- name: Verify gitea_runner is executable
|
|
ansible.builtin.command: "{{ gitea_runner_binary_path }} --version"
|
|
register: gitea_runner_version_output
|
|
changed_when: false
|
|
|
|
- name: Verify rootless Docker connectivity
|
|
ansible.builtin.command: docker version
|
|
become: true
|
|
become_user: "{{ gitea_runner_service_user }}"
|
|
environment:
|
|
DOCKER_HOST: "unix:///run/user/{{ gitea_runner_uid }}/docker.sock"
|
|
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid }}"
|
|
register: docker_version_output
|
|
changed_when: false
|
|
when: docker_rootless_setup
|