role-vaultwarden/tasks/main.yml

36 lines
833 B
YAML
Raw Normal View History

2023-09-19 21:33:32 +00:00
---
- name: Create podman folder
file:
path: /etc/containers/systemd
state: directory
mode: 0775
recurse: yes
- name: Create data folder
file:
path: "/var/vaultwarden/{{ vaultwarden_identifier }}"
state: directory
mode: 0775
recurse: yes
- name: Setup Podman quadlet
block:
- name: Copy vaultwarden.container
ansible.builtin.template:
src: vaultwarden.quadlet.j2
dest: "/etc/containers/systemd/vaultwarden-{{ vaultwarden_identifier }}.container"
- name: "Reload systemd"
ansible.builtin.systemd:
daemon_reload: true
when: ansible_service_mgr == "systemd"
- name: Start Vaultwardne
systemd_service:
enabled: true
name: vaultwarden-{{ vaultwarden_identifier }}
state: started
notify:
- Restart traefik