Apresenta erro quando tento criar um usuário (via Ansible) no Mysql. O que pode estar ocorrendo de errado?
Utilizo o ansible 2.4.6.0 e python2.7. Encontrei este link aqui, mas não me ajudou:
https://github.com/ansible/ansible/issues/47927
[root@ip-172-31-65-160 ansible]# ansible-playbook provisioning_yum3.yml -u root -i hosts -k SSH password:
PLAY [all] ************************************************************************************************************************************************************
TASK [Gathering Facts] ************************************************************************************************************************************************
ok: [172.31.76.224]
TASK [Instala pacotes] ************************************************************************************************************************************************
ok: [172.31.76.224] => (item=[u'php', u'httpd.x86_64', u'php-gd', u'mysql-server', u'MySQL-python', u'php-mysql'])
TASK [Cria database MySql] ********************************************************************************************************************************************
ok: [172.31.76.224]
TASK [Criar usuario MySql] ********************************************************************************************************************************************
fatal: [172.31.76.224]: FAILED! => {"changed": false, "failed": true, "module_stderr": "Shared connection to 172.31.76.224 closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n File \"/tmp/ansible_yCw_RA/ansible_module_mysql_user.py\", line 218, in <module>\r\n from ansible.module_utils.basic import AnsibleModule\r\nzlib.error: Error -2 while preparing to decompress data: inconsistent stream state\r\n", "msg": "MODULE FAILURE", "rc": 0}
to retry, use: --limit @/ansible/provisioning_yum3.retry
PLAY RECAP ************************************************************************************************************************************************************
172.31.76.224 : ok=3 changed=0 unreachable=0 failed=1
cat provisioning_yum3.yml
---
- hosts: all
tasks:
- name: 'Instala pacotes'
yum:
name: "{{ item }}"
state: latest
become: yes
with_items:
- php
- httpd.x86_64
- php-gd
- mysql-server
- MySQL-python
- php-mysql
- name: 'Cria database MySql'
mysql_db:
name: wordpress_db
login_user: root
login_password: 123456
state: present
- name: 'Criar usuario MySql'
mysql_user:
login_user: root
login_password: 123456
name: wordpress_user
password: 123456
priv: 'wordpress_db.*:ALL'
state: present