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.

24 lines
628 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: "/var/run/mysqld/mysqld.sock"
- name: Create SQL database {{ database_name }}
mysql_db:
db: "{{ database_name }}"
login_unix_socket: "/var/run/mysqld/mysqld.sock"
register: create_database
- name: Import SQL database template on creation
include_tasks: import.yml
when: create_database.changed and database_template is defined