60 lines
1.7 KiB
YAML
60 lines
1.7 KiB
YAML
---
|
|
# tasks file for drone_runner_exec
|
|
|
|
- name: Create configuration path
|
|
ansible.builtin.file:
|
|
state: directory
|
|
path: "{{ drone_runner_exec_config_base_path }}"
|
|
owner: "{{ drone_runner_exec_user }}"
|
|
group: "{{ drone_runner_exec_user }}"
|
|
mode: u=rwX,g=rX,o=rX
|
|
become: true
|
|
|
|
- name: Create log path
|
|
ansible.builtin.file:
|
|
state: directory
|
|
path: /var/log/drone-runner-exec
|
|
owner: "{{ drone_runner_exec_user }}"
|
|
group: "{{ drone_runner_exec_user }}"
|
|
mode: u=rwX,g=rX,o=rX
|
|
become: true
|
|
|
|
- name: Deploy configuration
|
|
ansible.builtin.template:
|
|
src: config.j2
|
|
dest: "{{ drone_runner_exec_config_base_path }}/config"
|
|
owner: "{{ drone_runner_exec_user }}"
|
|
group: "{{ drone_runner_exec_user }}"
|
|
mode: u=rwX,g=rX,o=rX
|
|
become: true
|
|
notify: Redémarrer drone-runner-exec.service
|
|
|
|
- name: Get service facts
|
|
ansible.builtin.service_facts:
|
|
|
|
- name: Install runner service
|
|
ansible.builtin.command:
|
|
cmd: >-
|
|
/usr/local/bin/drone-runner-exec service install
|
|
--config="{{ drone_runner_exec_config_base_path }}/config"
|
|
when: "'drone-runner-exec.service' not in ansible_facts.services"
|
|
become: true
|
|
notify: Restart drone-runner-exec.service
|
|
|
|
- name: Create systemd override directory
|
|
ansible.builtin.file:
|
|
state: directory
|
|
path: /etc/systemd/system/drone-runner-exec.service.d
|
|
mode: u=rwX,g=rX,o=rX
|
|
become: true
|
|
|
|
- name: Deploy systemd override configuration
|
|
ansible.builtin.template:
|
|
src: override.conf.j2
|
|
dest: /etc/systemd/system/drone-runner-exec.service.d/override.conf
|
|
owner: root
|
|
group: root
|
|
mode: u=rwX,g=rX,o=rX
|
|
become: true
|
|
notify: Redémarrer drone-runner-exec.service
|