xoxys.droneci_runner_docker/tasks/setup.yml

31 lines
979 B
YAML

---
- block:
- name: Ensure service directory exists
file:
path: "{{ droneci_runner_docker_service_directory }}"
state: directory
mode: 0755
- name: Deploy compose file to '{{ droneci_runner_docker_service_directory }}'
template:
src: "services/droneci_runner_compose.yml.j2"
dest: "{{ droneci_runner_docker_service_directory }}/droneci_runner_docker.yml"
owner: root
group: root
mode: 0640
validate: "docker-compose -f %s config -q"
- name: Ensure runner is up and running
docker_compose:
project_src: "{{ droneci_runner_docker_service_directory }}"
files:
- droneci_runner_docker.yml
pull: yes
remove_orphans: yes
stopped: "{{ droneci_runner_docker_service_stopped }}"
state: present
# temp. disable changes; breaks idempotency for whatever reason
changed_when: False
become: True
become_user: root