You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
855 B

---
- name: "Ensure db user is present"
become: true
become_user: postgres
postgresql_user:
name: "{{ vaultwarden_db_user }}"
password: "{{ vaultwarden_db_password }}"
state: present
- name: "Ensure database is present"
become: true
become_user: postgres
postgresql_db:
name: "{{ vaultwarden_db_name }}"
lc_collate: fr_FR.UTF-8
encoding: utf8
template: template0
owner: "{{ vaultwarden_db_user }}"
state: present
register: vaultwarden_database_creation
- name: import DATA in database in case of creation
become: true
become_user: postgres
postgresql_db:
name: "{{ vaultwarden_db_name }}"
state: restore
target: "{{ vaultwarden_SQl_target_file }}"
register: vaultwarden_database_import
when: vaultwarden_database_creation.changed == true and vaultwarden_SQl_target_file is defined