xoxys.droneci/tasks/setup.yml
Robert Kaussow 122fbe3a2b
All checks were successful
continuous-integration/drone/pr Build is passing
switch to compose v2.4
2020-06-17 21:20:54 +02:00

36 lines
1.1 KiB
YAML

---
- 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 }}/docker-compose.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 }}"
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