Add python-pymysql to default packages and add mysql_connection variable
parent
87ac16013e
commit
00d6be5bd4
|
@ -2,6 +2,7 @@
|
|||
|
||||
mysql_packages:
|
||||
- mariadb
|
||||
- python-pymysql
|
||||
|
||||
mysql_service_name: mariadb
|
||||
|
||||
|
@ -13,5 +14,12 @@ mysql_main_conf:
|
|||
dest: /etc/my.cnf
|
||||
mysql_confd: []
|
||||
|
||||
mysql_connection:
|
||||
unix_socket: /run/mysqld/mysqld.sock
|
||||
# host:
|
||||
# port:
|
||||
# user:
|
||||
# password:
|
||||
|
||||
mysql_databases: []
|
||||
mysql_users: []
|
||||
|
|
|
@ -35,14 +35,26 @@
|
|||
mysql_db:
|
||||
name: "{{ item.name }}"
|
||||
state: "{{ item.state | d(omit) }}"
|
||||
|
||||
login_unix_socket: "{{ mysql_connection.unix_socket | d(omit) }}"
|
||||
login_host: "{{ mysql_connection.host | d(omit) }}"
|
||||
login_port: "{{ mysql_connection.port | d(omit) }}"
|
||||
login_user: "{{ mysql_connection.user | d(omit) }}"
|
||||
login_password: "{{ mysql_connection.password | d(omit) }}"
|
||||
with_items: "{{ mysql_databases }}"
|
||||
|
||||
- name: MySQL | Create users
|
||||
mysql_user:
|
||||
name: "{{ item.name }}"
|
||||
state: "{{ item.state | d(omit) }}"
|
||||
state: "{{ item.state | d(omit) }}"
|
||||
password: "{{ item.password | d(omit) }}"
|
||||
priv: "{{ item.priv | d(omit) }}"
|
||||
priv: "{{ item.priv | d(omit) }}"
|
||||
|
||||
login_unix_socket: "{{ mysql_connection.unix_socket | d(omit) }}"
|
||||
login_host: "{{ mysql_connection.host | d(omit) }}"
|
||||
login_port: "{{ mysql_connection.port | d(omit) }}"
|
||||
login_user: "{{ mysql_connection.user | d(omit) }}"
|
||||
login_password: "{{ mysql_connection.password | d(omit) }}"
|
||||
with_items: "{{ mysql_users }}"
|
||||
|
||||
- name: unbound | Run handlers
|
||||
|
|
Loading…
Reference in New Issue