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.

27 lines
735 B

---
- name: "Ensure database is present"
become: true
mysql_db:
name: "{{ vaultwarden_db_name }}"
collation: utf8mb4_unicode_ci
encoding: utf8mb4
state: present
register: vaultwarden_database_creation
- name: import DATA in database in case of creation
become: true
mysql_db:
name: "{{ vaultwarden_db_name }}"
state: import
target: "{{vaultwarden_SQl_target_file}}"
when: vaultwarden_database_creation.changed == true and vaultwarden_SQl_target_file is defined
- name: "Ensure db user is present"
become: true
mysql_user:
name: "{{ vaultwarden_db_user }}"
host: localhost
password: "{{ vaultwarden_db_password }}"
priv: "{{ vaultwarden_db_name }}.*:ALL"
state: present