gitea_runner: First version of role

This commit is contained in:
Timo Makinen 2023-04-08 10:04:16 +00:00
parent 03ae70d2a5
commit e8f0d3519f
3 changed files with 51 additions and 8 deletions

View file

@ -0,0 +1,14 @@
[Unit]
Description=Act Runner for Gitea
After=syslog.target
After=network.target
[Service]
User=act_runner
Group=act_runner
WorkingDirectory=/var/lib/act_runner
Environment=HOME=/var/lib/act_runner
ExecStart=/usr/local/sbin/act_runner daemon
[Install]
WantedBy=multi-user.target

View file

@ -1,7 +1,5 @@
--- ---
- name: Build act_runner - name: Restart act_runner
ansible.builtin.command: ansible.builtin.service:
argv: name: act_runner
- make state: restarted
- build
chdir: /usr/local/src/act_runner

View file

@ -29,7 +29,15 @@
dest: /usr/local/src/act_runner dest: /usr/local/src/act_runner
repo: https://gitea.com/gitea/act_runner.git repo: https://gitea.com/gitea/act_runner.git
version: "{{ gitea_runner_version }}" version: "{{ gitea_runner_version }}"
notify: Build act_runner
- name: Build act_runner
ansible.builtin.command:
argv:
- make
- build
chdir: /usr/local/src/act_runner
creates: /usr/local/src/act_runner/act_runner
notify: Restart act_runner
- name: Link binary - name: Link binary
ansible.builtin.file: ansible.builtin.file:
@ -44,6 +52,29 @@
ansible.builtin.file: ansible.builtin.file:
path: /var/lib/act_runner path: /var/lib/act_runner
state: directory state: directory
mode: 0770 mode: 0750
owner: root owner: root
group: act_runner group: act_runner
- name: Copy config file
ansible.builtin.copy:
dest: /var/lib/act_runner/.runner
src: "/srv/private/files/act_runner/{{ inventory_hostname }}.conf"
mode: 0640
owner: root
group: act_runner
notify: Restart act_runner
- name: Copy unit file
ansible.builtin.copy:
dest: /etc/systemd/system/act_runner.service
src: act_runner.service
mode: 0644
owner: root
group: root
- name: Enable service
ansible.builtin.service:
name: act_runner
state: started
enabled: true