Installation of act_runner for automatically building on gitea workflow

This commit is contained in:
2023-12-18 18:07:35 -05:00
parent dadbe171d2
commit aa565bdfce
3 changed files with 56 additions and 1 deletions

43
configure_act_runner.yml Normal file
View File

@@ -0,0 +1,43 @@
---
- name: Configure act_runner for gitea
hosts: bab1.mgmt.toal.ca
vars:
runner_user: ptoal
tasks:
- name: Act Runner is downloaded
ansible.builtin.get_url:
url:
https://dl.gitea.com/act_runner/0.2.6/act_runner-0.2.6-linux-amd64
dest: /home/{{ runner_user }}/act_runner
mode: '0755'
force: true
- name: Ensure act_runner.service file in config directory
ansible.builtin.template:
dest: /home/{{ runner_user }}/.config/systemd/user/act_runner.service
src: act_runner.service
mode: '0644'
notify: daemon-reload
- name: Enable lingering for user
ansible.builtin.command:
argv:
- /usr/bin/loginctl
- enable-linger
- "{{ runner_user }}"
creates: /var/lib/systemd/linger/{{ runner_user }}
- name: Enable act_runner.service user unit to start on boot
ansible.builtin.systemd:
name: act_runner.service
scope: user
enabled: true
state: started
handlers:
- name: Execute daemon-reload when service file changed
ansible.builtin.systemd:
daemon_reload: true
scope: user
listen: "daemon-reload"

View File

@@ -12,7 +12,7 @@
ansible.builtin.include_role: ansible.builtin.include_role:
name: nginxinc.nginx_core.nginx_config name: nginxinc.nginx_core.nginx_config
- name: Ensure python firewall library is installed - name: Ensure python firewall library is installed
ansible.builtin.package: ansible.builtin.package:
name: python3-firewall name: python3-firewall
state: present state: present

View File

@@ -0,0 +1,12 @@
[Unit]
Description=Act Runner for automatic builds from Gitea.
[Service]
Environment="DOCKER_HOST=unix://{{ lookup('ansible.builtin.env','XDG_RUNTIME_DIR') }}/podman/podman.sock"
Type=simple
ExecStart=/home/ptoal/act_runner daemon
Restart=on-failure
StandardOutput=file:%h/log_file
[Install]
WantedBy=default.target