mysql: use /etc/mysql/debian.cnf for configuration
This commit is contained in:
parent
65f91f09b0
commit
0481c51a40
|
@ -23,22 +23,11 @@
|
|||
priv: "*.*:ALL,GRANT"
|
||||
update_password: on_create
|
||||
state: present
|
||||
config_file: "/etc/mysql/debian.cnf"
|
||||
register: create_mysqladmin_user
|
||||
tags:
|
||||
- mysql
|
||||
|
||||
# Ansible 2.2 allows to create with ini_file
|
||||
# before: we have to create the file beforehand
|
||||
|
||||
- name: touch /root/.my.cnf
|
||||
file:
|
||||
path: /root/.my.cnf
|
||||
state: touch
|
||||
changed_when: False
|
||||
when: create_mysqladmin_user.changed
|
||||
tags:
|
||||
- mysql
|
||||
|
||||
- name: mysqladmin is the default user
|
||||
ini_file:
|
||||
dest: /root/.my.cnf
|
||||
|
@ -46,6 +35,7 @@
|
|||
section: client
|
||||
option: '{{ item.option }}'
|
||||
value: '{{ item.value }}'
|
||||
create: yes
|
||||
with_items:
|
||||
- { option: 'user', value: 'mysqladmin' }
|
||||
- { option: password, value: '{{ mysql_admin_password.stdout }}' }
|
||||
|
@ -58,7 +48,7 @@
|
|||
name: root
|
||||
#host_all: yes
|
||||
host: "{{ item }}"
|
||||
config_file: /root/.my.cnf
|
||||
config_file: "/etc/mysql/debian.cnf"
|
||||
state: absent
|
||||
with_items:
|
||||
- "localhost"
|
||||
|
|
Loading…
Reference in a new issue