supysonic/tasks/database_mysql.yml

26 lines
707 B
YAML
Raw Permalink Normal View History

2020-09-06 20:16:56 +00:00
- name: "Ensure database is present"
become: yes
mysql_db:
name: "{{ supysonic_db_name }}"
collation: utf8_general_ci
encoding: utf8
state: present
register: supysonic_database_creation
- name: import DATA in database in case of creation
become: yes
mysql_db:
name: "{{ supysonic_db_name }}"
state: import
target: "{{supysonic_SQl_target_file}}"
when: supysonic_database_creation.changed == true and supysonic_SQl_target_file is defined
- name: "Ensure db user is present"
become: yes
mysql_user:
name: "{{ supysonic_db_user }}"
host: localhost
password: "{{ supysonic_db_password }}"
priv: "{{ supysonic_db_name }}.*:ALL"
state: present