Some checks failed
Ansible Lint / Ansible Lint Check (push) Has been cancelled
Automated deployment of act_runner on Ubuntu 20.04+ servers: - Docker CE installation (DEB822 format) - Node.js 24.x via NodeSource - act_runner binary with SHA256 verification - systemd service with security hardening - CI: ansible-lint via Gitea Actions Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
81 lines
3.0 KiB
YAML
81 lines
3.0 KiB
YAML
---
|
|
# =============================================================================
|
|
# Gitea Act Runner - Installation Verification
|
|
# =============================================================================
|
|
#
|
|
# Verifies that all components were installed correctly.
|
|
# Fails the playbook if any critical check doesn't pass.
|
|
#
|
|
# Verification order:
|
|
# 1. Docker daemon is running and accessible
|
|
# 2. Node.js is installed at the expected version
|
|
# 3. act_runner binary is executable and reports version
|
|
# 4. act_runner systemd service is active
|
|
#
|
|
# =============================================================================
|
|
|
|
# Verify Docker daemon is running and accessible.
|
|
- name: Verify Docker daemon is accessible
|
|
ansible.builtin.command: docker info
|
|
changed_when: false
|
|
register: act_runner_docker_info_result
|
|
|
|
- name: Display Docker status
|
|
ansible.builtin.debug:
|
|
msg: "Docker is running: {{ act_runner_docker_info_result.stdout_lines[0] | default('OK') }}"
|
|
|
|
# Verify Node.js is installed at the expected major version.
|
|
- name: Verify Node.js installation
|
|
ansible.builtin.command: node --version
|
|
changed_when: false
|
|
register: act_runner_node_version_result
|
|
|
|
- name: Verify Node.js major version matches expected
|
|
ansible.builtin.assert:
|
|
that:
|
|
- act_runner_node_version_result.stdout is match('^v' ~ act_runner_nodejs_version ~ '\\.')
|
|
fail_msg: >-
|
|
Node.js version mismatch!
|
|
Expected: v{{ act_runner_nodejs_version }}.x
|
|
Actual: {{ act_runner_node_version_result.stdout }}
|
|
success_msg: "Node.js {{ act_runner_node_version_result.stdout }} installed correctly"
|
|
|
|
# Verify act_runner binary is installed and executable.
|
|
- name: Verify act_runner binary
|
|
ansible.builtin.command: "{{ act_runner_bin_path }} --version"
|
|
changed_when: false
|
|
register: act_runner_version_result
|
|
|
|
- name: Display act_runner version
|
|
ansible.builtin.debug:
|
|
msg: "act_runner version: {{ act_runner_version_result.stdout }}"
|
|
|
|
# Verify the systemd service is running.
|
|
- name: Get act_runner service status
|
|
ansible.builtin.systemd:
|
|
name: act_runner
|
|
register: act_runner_service_status
|
|
|
|
- name: Verify act_runner service is active
|
|
ansible.builtin.assert:
|
|
that:
|
|
- act_runner_service_status.status.ActiveState == "active"
|
|
fail_msg: >-
|
|
act_runner service is NOT running!
|
|
State: {{ act_runner_service_status.status.ActiveState }}
|
|
Check logs: journalctl -u act_runner -n 50
|
|
success_msg: "act_runner service is running (PID: {{ act_runner_service_status.status.MainPID }})"
|
|
|
|
# Final summary.
|
|
- name: Verification complete
|
|
ansible.builtin.debug:
|
|
msg:
|
|
- "=========================================="
|
|
- "All verification checks PASSED!"
|
|
- "=========================================="
|
|
- "Docker: running"
|
|
- "Node.js: {{ act_runner_node_version_result.stdout }}"
|
|
- "act_runner: {{ act_runner_version_result.stdout }}"
|
|
- "Service: active (PID {{ act_runner_service_status.status.MainPID }})"
|
|
- "=========================================="
|