28 lines
748 B
YAML
28 lines
748 B
YAML
|
|
- name: "Ensure database is present"
|
|
become: yes
|
|
mysql_db:
|
|
name: "{{ nextcloud_db_name }}"
|
|
collation: utf8mb4_unicode_ci
|
|
encoding: utf8mb4
|
|
state: present
|
|
register: nextcloud_database_creation
|
|
|
|
- name: import DATA in database in case of creation
|
|
become: yes
|
|
mysql_db:
|
|
name: "{{ nextcloud_db_name }}"
|
|
state: import
|
|
target: "{{gitea_SQl_target_file}}"
|
|
register: nextcloud_database_import
|
|
when: nextcloud_database_creation.changed == true and nextcloud_SQl_target_file is defined
|
|
|
|
- name: "Ensure db user is present"
|
|
become: yes
|
|
mysql_user:
|
|
name: "{{ nextcloud_db_user }}"
|
|
host: localhost
|
|
password: "{{ nextcloud_db_password }}"
|
|
priv: "{{ nextcloud_db_name }}.*:ALL"
|
|
state: present
|