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: hosts:
gitea-runner02.home.foo.sh: gitea-runner02.home.foo.sh:
vars: vars:
gitea_runner_version: "v0.0.1" gitea_runner_version: "0.1.2"
homeassistant: homeassistant:
hosts: hosts:
homeassistant01.home.foo.sh: homeassistant01.home.foo.sh:

View file

@ -8,7 +8,7 @@ User=act_runner
Group=act_runner Group=act_runner
WorkingDirectory=/var/lib/act_runner WorkingDirectory=/var/lib/act_runner
Environment=HOME=/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] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View file

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