xoxys.droneci/tasks/setup.yml
2020-06-16 22:08:31 +02:00

42 lines
1.2 KiB
YAML

---
- name: Concat lists for proxy setup
set_fact:
droneci_no_proxy: "{{ __droneci_default_no_proxy }} + {{ droneci_no_proxy | default([]) }}"
- block:
- name: Ensure service directory exists
file:
path: "{{ droneci_service_directory }}"
state: directory
mode: 0755
- name: Deploy compose file to '{{ droneci_service_directory }}'
template:
src: "services/droneci_compose.yml.j2"
dest: "{{ droneci_service_directory }}/droneci.yml"
owner: root
group: root
mode: 0640
validate: "docker-compose -f %s config -q"
- 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
- name: Ensure Drone is up and running
docker_compose:
project_src: "{{ droneci_service_directory }}"
files:
- droneci.yml
pull: yes
remove_orphans: yes
stopped: "{{ droneci_service_stopped }}"
state: present
# temp. disable changes; breaks idempotency for whatever reason
changed_when: False
become: True
become_user: root