Compare commits

..

5 Commits

Author SHA1 Message Date
Lukas Greve
bae2419235 Update to Fedora Rawhide, make act_runner name consistent, change file where runner registration data is tored 2025-10-26 20:06:42 +01:00
Lukas Greve
29887948ff update to Fedora Rawhide 2025-10-26 20:04:02 +01:00
Lukas Greve
48f9eef167 remove group 2025-10-26 20:03:12 +01:00
Lukas Greve
2563c429ae remove line 2025-10-26 20:03:00 +01:00
Lukas Greve
98040c59fd rename file and add dependencies 2025-10-26 20:02:50 +01:00
5 changed files with 22 additions and 26 deletions

View File

@@ -18,4 +18,4 @@ become_method = sudo
# -o ControlPersist=60s
# Sets the persistence time for the master connection to 60 seconds
[ssh_connection]
ssh_args = -o ControlMaster=auto -o ControlPersist=60s
ssh_args = -o ControlMaster=auto -o ControlPersist=60s

View File

@@ -1,4 +1,3 @@
---
- name: Initial generic setup
hosts: gitrunner
become: yes
@@ -8,6 +7,8 @@
yum:
name:
- git
- nodejs
- mock
state: present
- name: Check current hostname
@@ -15,7 +16,7 @@
register: current_hostname
changed_when: false
- name: Set hostname to rocky10 (if needed)
- name: Set hostname to configured value (if needed)
hostname:
name: rocky10
when: current_hostname.stdout != "rocky10"
name: fedora-rawhide10
when: current_hostname.stdout != ansible_hostname

View File

@@ -1,6 +1,3 @@
# This file defines targets (hosts, groups, host-specific variables)
[all]
rocky10 ansible_host=10.17.3.215 ansible_user=groot ansible_become=true ansible_python_interpreter=/usr/bin/python3.12
[gitrunner]
rocky10
fedora-rawhide10 ansible_host=10.17.3.179 ansible_user=groot ansible_become=true ansible_python_interpreter=/usr/bin/python3.12

View File

@@ -1,8 +1,8 @@
# Gitea Runner Automation with Ansible
This repository contains an Ansible playbook and configuration files to automate the deployment and configuration of a Gitea Runner on a Rocky Linux 10 VM.
This repository contains an Ansible playbook and configuration files to automate the deployment and configuration of a Gitea Runner on a Fedora Rawhide Cloud VM.
To deploy a Rocky Linux virtual machine, please go to [this repository](https://git.phyllo.me/IaC/advanced-libvirt-terraform-examples).
To deploy a Fedora Rawhide Cloud virtual machine, please go to [this repository](https://git.phyllo.me/IaC/advanced-libvirt-terraform-examples).
## Repository Structure
@@ -17,7 +17,7 @@ To deploy a Rocky Linux virtual machine, please go to [this repository](https://
## Prerequisites
1. Ansible installed on your control machine
2. Access to a Rocky Linux 10 VM with IP `10.17.3.250`
2. Access to a Fedora Rawhide Cloud VM with IP `10.17.3.250`
3. SSH key authentication configured with `~/.ssh/terraform_key`
4. Root privileges or sudo access on the target VM
5. Gitea registration token (to be placed in runner_setup.yml)
@@ -62,10 +62,10 @@ To deploy a Rocky Linux virtual machine, please go to [this repository](https://
This automation will:
- Connect to the specified Rocky Linux VM
- Connect to the specified Fedora Rawhide Cloud VM
- Update the system packages and reboot if required
- Install necessary dependencies
- Set hostname to rocky10
- Set hostname to fedora-rawhide10
- Create a dedicated gitea-runner user
- Download and install Gitea Runner
- Configure systemd service for automatic startup

View File

@@ -29,7 +29,7 @@
- name: Install Act Runner
ansible.builtin.get_url:
url: "https://gitea.com/gitea/act_runner/releases/download/v{{ gitea_runner_version }}/act_runner-{{ gitea_runner_version }}-linux-amd64"
dest: "/usr/local/bin/act-runner"
dest: "/usr/local/bin/act_runner"
mode: '0755'
force: "{{ (ansible_facts['cmdline']['force'] is defined) | default(false) }}"
retries: 3
@@ -44,7 +44,7 @@
runner:
# Where to store the registration result.
file: .runner
file: /var/lib/act_runner/.runner
# Execute how many tasks concurrently at the same time.
capacity: 1
# Extra environment variables to run jobs.
@@ -73,7 +73,7 @@
# If it's empty when registering, it will ask for inputting labels.
# If it's empty when execute `daemon`, will use labels in `.runner` file.
labels:
- "rocky-latest:host:local"
- "fedora-rawhide-latest:host:local"
cache:
# Enable cache server to use actions/cache.
@@ -146,12 +146,12 @@
- name: Register the runner with Gitea (if not already registered)
ansible.builtin.command: >
/usr/local/bin/act-runner register
/usr/local/bin/act_runner register
--no-interactive
--config /etc/act_runner/config.yaml
--instance https://git.phyllo.me
--token {{ registration_token }}
--name rl-bios-0
--name fraw-bios-0
when: not runner_registered.stat.exists
changed_when: true
@@ -160,28 +160,26 @@
content: |
[Unit]
Description=Gitea Actions Runner
Documentation=https://gitea.com/gitea/act_runner
After=network.target
[Service]
Type=simple
User=act_runner
ExecStart=/usr/local/bin/act-runner daemon --config /etc/act_runner/config.yaml
ExecStart=/usr/local/bin/act_runner daemon --config /etc/act_runner/config.yaml
ExecReload=/bin/kill -s HUP $MAINPID
WorkingDirectory=/var/lib/act_runner
TimeoutSec=0
Restart=always
RestartSec=10
User=act_runner
[Install]
WantedBy=multi-user.target
dest: /etc/systemd/system/act-runner.service
dest: /etc/systemd/system/act_runner.service
mode: '0755'
backup: yes
- name: Ensure act-runner service is enabled and started
- name: Ensure act_runner service is enabled and started
ansible.builtin.systemd:
name: act-runner
name: act_runner
enabled: yes
state: started
daemon_reload: yes