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.
19 lines
475 B
19 lines
475 B
#
|
|
# Task: create maridb
|
|
#
|
|
#
|
|
|
|
- name: generate name for database
|
|
set_fact:
|
|
mariadb_dbname: "db{{ lookup('community.general.random_string', length=16, upper=false, special=false) }}"
|
|
|
|
- name: create db
|
|
community.mysql.mysql_query:
|
|
login_db: "mysql"
|
|
login_unix_socket: "{{ mariadb_socket }}"
|
|
query: CREATE DATABASE {{ mariadb_dbname }} DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
|
|
|
|
- name: result
|
|
debug:
|
|
msg: "dbname > {{ mariadb_dbname }}"
|