Update act_runner and refactor deployment

This commit is contained in:
Timo Makinen 2023-04-22 16:25:10 +00:00
parent 2548a95678
commit 2a78ac4b8e
3 changed files with 14 additions and 27 deletions

View file

@ -29,7 +29,7 @@ gitearunner:
hosts:
gitea-runner02.home.foo.sh:
vars:
gitea_runner_version: "v0.0.1"
gitea_runner_version: "0.1.2"
homeassistant:
hosts:
homeassistant01.home.foo.sh:

View file

@ -8,7 +8,7 @@ User=act_runner
Group=act_runner
WorkingDirectory=/var/lib/act_runner
Environment=HOME=/var/lib/act_runner
ExecStart=/usr/local/sbin/act_runner daemon
ExecStart=/usr/local/bin/act_runner daemon
[Install]
WantedBy=multi-user.target

View file

@ -18,35 +18,22 @@
- name: Install dependencies
ansible.builtin.package:
name: "{{ item }}"
name: golang
state: installed
with_items:
- golang
- make
- name: Copy act runner packages
ansible.builtin.git:
dest: /usr/local/src/act_runner
repo: https://gitea.com/gitea/act_runner.git
version: "{{ gitea_runner_version }}"
- 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
ansible.builtin.file:
dest: /usr/local/sbin/act_runner
src: /usr/local/src/act_runner/act_runner
state: link
- name: Download binary
ansible.builtin.get_url:
url: >
{{
"https://gitea.com/gitea/act_runner/releases/download/v" +
gitea_runner_version + "/act_runner-" + gitea_runner_version +
"-" + ansible_system | lower + "-amd64"
}}
dest: /usr/local/bin/act_runner
mode: 0755
owner: root
group: "{{ ansible_wheel }}"
follow: false
notify: Restart act_runner
- name: Create config directory
ansible.builtin.file: