xoxys.droneci/tasks/setup.yml

45 lines
1.3 KiB
YAML
Raw Normal View History

2018-12-13 22:09:22 +00:00
---
- name: Concat lists for proxy setup
set_fact:
droneci_no_proxy: "{{ __droneci_default_no_proxy }} + {{ droneci_no_proxy | default([]) }}"
2018-12-13 22:09:22 +00:00
- block:
2019-11-24 16:29:04 +00:00
- name: Ensure service directory exists
file:
path: "{{ droneci_service_directory }}"
state: directory
mode: 0755
2018-12-13 22:09:22 +00:00
- name: Deploy compose file to '{{ droneci_service_directory }}'
template:
src: "services/droneci-compose.yml.j2"
dest: "{{ droneci_service_directory }}/docker-compose.yml"
owner: root
group: root
mode: 0644
2019-11-24 22:07:26 +00:00
validate: "{{ droneci_docker_compose_bin }} -f %s config -q"
2018-12-13 22:09:22 +00:00
notify: __drone_restart
- name: Create systemd unit files
template:
src: "etc/systemd/system/drone.service.j2"
dest: "/etc/systemd/system/drone.service"
mode: 0644
notify: __drone_restart
2019-01-11 21:40:18 +00:00
- name: Copy license key file is defined
copy:
src: "{{ droneci_license_key }}"
dest: "{{ droneci_service_directory }}/{{ droneci_license_key | basename }}"
mode: 0600
when: droneci_license_key is defined
2019-11-24 16:29:04 +00:00
- name: Ensure drone service is up and running
systemd:
state: started
daemon_reload: yes
enabled: yes
name: drone
2018-12-13 22:09:22 +00:00
become: True
become_user: root