forked from infra/ansible
36 lines
1.1 KiB
YAML
36 lines
1.1 KiB
YAML
|
---
|
||
|
|
||
|
- name: Create group
|
||
|
group: name={{ actrunner_group }}
|
||
|
|
||
|
- name: Create user
|
||
|
user: name={{ actrunner_user }} home=/var/lib/act_runner group={{ actrunner_group }} groups=docker
|
||
|
|
||
|
- name: Create directories
|
||
|
file: path={{ item }} state=directory owner={{ actrunner_user }} group={{ actrunner_group }}
|
||
|
with_items:
|
||
|
- /etc/act_runner
|
||
|
- /var/lib/act_runner
|
||
|
|
||
|
- name: Download act_runner binary
|
||
|
get_url: url={{ actrunner_url }} dest=/usr/local/bin/act_runner-{{ actrunner_version }} mode=0755
|
||
|
register: runner_download
|
||
|
|
||
|
- name: Symlink act_runner binary
|
||
|
file: src=/usr/local/bin/act_runner-{{ actrunner_version }} dest=/usr/local/bin/act_runner state=link
|
||
|
when: runner_download.changed
|
||
|
notify: Restart act_runner
|
||
|
|
||
|
- name: Configure act_runner
|
||
|
template: src=config.yaml.j2 dest=/etc/act_runner/config.yaml owner={{ actrunner_user }} group={{ actrunner_group }}
|
||
|
notify: Restart act_runner
|
||
|
|
||
|
- name: Install systemd unit
|
||
|
template: src=act_runner.service.j2 dest=/lib/systemd/system/act_runner.service
|
||
|
notify:
|
||
|
- Reload systemd
|
||
|
- Restart act_runner
|
||
|
|
||
|
- name: Enable act_runner
|
||
|
service: name=act_runner state=started enabled=yes
|