create a new file with more simpler changes

This commit is contained in:
Lukas Greve
2025-10-24 14:58:36 +02:00
parent a04bb97657
commit 058db5096a

View File

@@ -1,10 +1,7 @@
---
- name: Initial one-time setup
- name: Initial generic setup
hosts: gitrunner
become: yes
vars:
runner_name: "gitea-runner"
gitea_runner_version: "0.2.13"
tasks:
- name: Install required packages
@@ -13,48 +10,12 @@
- git
state: present
- name: Create gitea runner user
user:
name: "{{ runner_name }}"
system: yes
shell: /bin/bash
home: "/var/lib/{{ runner_name }}"
create_home: yes
- name: Check current hostname
command: hostname
register: current_hostname
changed_when: false
- name: Set hostname to rocky10
- name: Set hostname to rocky10 (if needed)
hostname:
name: rocky10
- name: Install Gitea Runner
uri:
url: "https://gitea.com/gitea/act_runner/releases/download/v{{ gitea_runner_version }}/act_runner-{{ gitea_runner_version }}-linux-amd64"
dest: "/usr/local/bin/gitea-runner"
mode: '0755'
status_code: 200
follow_redirects: all
- name: Create Gitea Runner service file
copy:
content: |
[Unit]
Description=Gitea Runner
After=network.target
[Service]
Type=simple
User={{ runner_name }}
ExecStart=/usr/local/bin/gitea-runner
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
dest: /etc/systemd/system/gitea-runner.service
mode: '0644'
- name: Ensure gitea-runner service is enabled and started
systemd:
name: gitea-runner
enabled: yes
state: started
daemon_reload: yes
when: current_hostname.stdout != "rocky10"