ansible-role-drone/handlers/main.yml

40 lines
1.0 KiB
YAML
Raw Normal View History

2020-10-25 00:31:36 +00:00
---
2021-08-26 16:32:20 +00:00
# handlers are executed in the order they are written in the handlers file, not the order they are notified.
2020-10-25 00:31:36 +00:00
2021-08-26 16:32:20 +00:00
- name: "Build drone"
command: 'go build'
become: true
become_user : "{{ drone_user }}"
notify: "Restart drone"
args:
chdir: "{{ drone_home }}/drone/cmd/drone-server"
2021-08-26 13:28:54 +00:00
2021-08-26 16:35:57 +00:00
- name: "Unzip runner"
unarchive:
src: "{{ drone_home }}/drone_runner_exec_linux_amd64.tar.gz"
remote_src: yes
dest: /usr/local/bin/
notify:
- "Install drone runner exec"
- "Stop drone runner exec"
- "Start drone runner exec"
2021-08-26 13:33:47 +00:00
- name: "Stop drone runner exec"
command: "drone-runner-exec service stop"
when: ansible_service_mgr == "systemd"
2021-08-26 16:32:20 +00:00
- name: "Install drone runner exec"
command: "drone-runner-exec service install"
when: ansible_service_mgr == "systemd"
2021-08-26 16:28:11 +00:00
2021-08-26 16:39:08 +00:00
- name: "Start drone runner exec"
command: "drone-runner-exec service start"
when: ansible_service_mgr == "systemd"
2021-09-14 08:12:32 +00:00
- name: "Restart drone"
2021-09-14 08:10:26 +00:00
ansible.builtin.systemd:
state: restarted
daemon_reload: yes
name: drone