1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_forgeo_runner.git synced 2024-08-16 10:29:50 +02:00

improve forgejo runner configuration and instalaltion

This commit is contained in:
L3D 2024-03-21 19:00:41 +01:00
parent 64cb843527
commit a38bda55ee
Signed by: l3d
GPG key ID: CD08445BFF4313D1
3 changed files with 16 additions and 3 deletions

View file

@ -9,9 +9,22 @@
msg: "Please set forgejo_runner__token"
when: forgejo_runner__token == ''
- name: Check if website is reachable
ansible.builtin.uri:
url: "{{ forgejo_runner__instance_address }}"
method: GET
- name: Register Forgejo runner
become: true
ansible.builtin.command:
chdir: "{{ forgejo_runner__user_home }}"
cmd: "{{ forgejo_runner__full_executable_path }} register --no-interactive --token '{{ forgejo_runner__token }}' --instance '{{ forgejo_runner__instance_address }}' --name '{{ inventory_hostname }}@ansible'"
creates: "{{ forgejo_runner__user_home }}/.runner"
- name: Change Owner of config
become: true
ansible.builtin.file:
path: "{{ forgejo_runner__user_home }}/.runner"
owner: "{{ forgejo_runner__user }}"
group: "{{ forgejo_runner__group }}"
mode: '0644'

View file

@ -58,8 +58,8 @@
src: "{{ _runner_tmp.path }}/{{ forgejo_runner__filename }}"
dest: "{{ forgejo_runner__full_executable_path }}"
mode: "0755"
owner: "{{ forgejo_runner__user }}"
group: "{{ forgejo_runner__group }}"
owner: "root"
group: "root"
remote_src: true
when: not _runner_signature.failed

View file

@ -12,5 +12,5 @@ forgejo_runner__arch: "{{ forgejo_runner__go_arch_map[ansible_architecture] | de
forgejo_runner__git_repo: 'https://code.forgejo.org/forgejo/runner'
# versionscheck
playbook_version_number: 04 # should be a integer
playbook_version_number: 5 # should be a integer
playbook_version_path: 'role-l3d.git-forgejo_runner.version'