---# tasks file for mysql-name:include assert.ymlinclude_tasks:assert.ymlrun_once:yes-name:install mysqlpackage:name:"{{mysql_packages}}"state:presentnotify:-set root password-name:configure mysql serverini_file:dest:/etc/mysql/mariadb.conf.d/50-server.cnfsection:"{{item.section}}"option:"{{item.option}}"value:"{{item.value}}"mode:"0644"loop:"{{mysql_configuration_options}}"loop_control:label:"{{item.option}}"notify:-restart mysql server-name:configure mysql clientini_file:dest:/etc/mysql/mariadb.conf.d/50-client.cnfsection:clientoption:socketvalue:"{{mysql_socket}}"mode:"0644"-name:initialize mysqlcommand:"{{mysql_initialize_command}}"args:creates:/var/lib/mysql/mysqlwhen:-ansible_distribution == "Alpine" oransible_distribution == "Archlinux"-name:flush handlersmeta:flush_handlers-name:place my.cnftemplate:src:my.cnf.j2dest:/root/.my.cnfmode:"0640"-name:start and enable mysqlservice:name:"{{mysql_service}}"state:startedenabled:yes-name:create databasesmysql_db:name:"{{item.name}}"state:"{{item.state|default('present')}}"target:"{{item.target|default(omit)}}"encoding:"{{item.encoding|default(omit)}}"collation:"{{item.collation|default(omit)}}"login_unix_socket:"{{mysql_socket}}"login_user:rootlogin_password:"{{mysql_root_password}}"loop:"{{mysql_databases}}"loop_control:label:"{{item.name}}"when:-mysql_databases is definedno_log:yes-name:create usersmysql_user:name:"{{item.name}}"state:presentpassword:"{{item.password|default(omit)}}"priv:"{{item.priv|default(omit)}}"host:"{{item.host|default(omit)}}"update_password:"{{item.update_password|default('on_create')}}"login_unix_socket:"{{mysql_socket}}"login_user:rootlogin_password:"{{mysql_root_password}}"loop:"{{mysql_users}}"loop_control:label:"{{item.name}}"when:-mysql_users is definedno_log:yes-name:flush handlersmeta:flush_handlers