1
0
Fork 0
myserver-configuration/roles/vaultwarden/tasks/base.yml

40 lines
909 B
YAML
Raw Normal View History

2023-06-09 14:02:57 +02:00
---
- name: Check vaultwarden directory exist
ansible.builtin.file:
path: vaultwarden
state: directory
2023-06-09 14:06:12 +02:00
register: first_install
2023-06-09 14:02:57 +02:00
- name: Copy template conf
ansible.builtin.template:
src: "{{ item.src }}"
dest: "vaultwarden/{{ item.dest }}"
loop:
2024-07-14 22:16:35 +02:00
- { src: 'docker-compose.yml', dest: 'docker-compose.yml' }
2023-06-09 14:02:57 +02:00
- name: Copy dotenv as root
ansible.builtin.template:
owner: root
group: root
2024-07-14 22:16:35 +02:00
src: ".env"
2023-06-09 14:02:57 +02:00
dest: "vaultwarden/.env"
mode: 0600
become: true
- name: Prepare volume folder
ansible.builtin.file:
path: "{{ item }}"
state: directory
loop:
- "{{ server.work_dir }}/vaultwarden"
- "{{ server.work_dir }}/vaultwarden/base"
- "{{ server.work_dir }}/vaultwarden/db"
become: true
- name: Update and restart container
2024-07-14 21:39:23 +02:00
community.docker.docker_compose_v2:
2023-06-09 14:02:57 +02:00
project_src: vaultwarden
state: present
2024-07-14 21:39:23 +02:00
pull: always
2023-06-09 14:02:57 +02:00
become: true