xoxys.vaultwarden_docker/tasks/setup.yml

29 lines
867 B
YAML
Raw Normal View History

2020-01-17 21:00:14 +00:00
---
2020-06-20 13:31:03 +00:00
- block:
- name: Ensure service directory exists
file:
path: "{{ bitwardenrs_service_directory }}"
state: directory
mode: 0755
2020-01-17 21:00:14 +00:00
2020-06-20 13:31:03 +00:00
- name: Deploy compose file to '{{ bitwardenrs_service_directory }}'
template:
2020-06-20 15:00:37 +00:00
src: "services/bitwardenrs_compose.yml.j2"
2020-06-20 13:31:03 +00:00
dest: "{{ bitwardenrs_service_directory }}/docker-compose.yml"
owner: root
group: root
mode: 0640
validate: "docker-compose -f %s config -q"
2020-06-20 13:31:03 +00:00
- name: Ensure service is up and running
docker_compose:
project_src: "{{ bitwardenrs_service_directory }}"
pull: yes
remove_orphans: yes
stopped: "{{ bitwardenrs_service_stopped }}"
state: present
# temp. disable changes; breaks idempotency for whatever reason
changed_when: False
become: True
become_user: root