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

28 lines
772 B
YAML

---
- meta: flush_handlers
- name: Create SQL user {{ database_user }}
mysql_user:
state: present
host: localhost
user: "{{ database_user }}"
password: "{{ database_pass }}"
update_password: always
priv: "{{ database_name }}.*:ALL"
login_unix_socket: "{{ global_mysql_socket_path }}"
login_user: root
login_password: "{{ mysql_root_password }}"
- name: Create SQL database {{ database_name }}
mysql_db:
db: "{{ database_name }}"
login_unix_socket: "{{ global_mysql_socket_path }}"
login_user: root
login_password: "{{ mysql_root_password }}"
register: create_database
- name: Import SQL database template on creation
include_tasks: import.yml
when: create_database.changed and database_template is defined