xoxys.vaultwarden_docker/tasks/setup.yml

27 lines
771 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: "{{ vaultwarden_service_directory }}"
2020-06-20 13:31:03 +00:00
state: directory
mode: 0755
2020-01-17 21:00:14 +00:00
- name: Deploy compose file to '{{ vaultwarden_service_directory }}'
2020-06-20 13:31:03 +00:00
template:
src: "services/vaultwarden_compose.yml.j2"
dest: "{{ vaultwarden_service_directory }}/docker-compose.yml"
2020-06-20 13:31:03 +00:00
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: "{{ vaultwarden_service_directory }}"
2020-06-20 13:31:03 +00:00
pull: yes
remove_orphans: yes
stopped: "{{ vaultwarden_service_stopped }}"
2020-06-20 13:31:03 +00:00
state: present
become: True
become_user: root