I am new to ansible i want to execute my command like this
zact /usr/share/doc/zabbix-server-mysql-3.0.9/create.sql.gz| mysql -u zabbix -p zabbixdb
Ansible_code:
- name: Import the initial schema
mysql_db:
state: import
login_user: zabbix
login_password: 1234
name: zabbixdb
target: /usr/share/doc/zabbix-server-mysql-3.0.9/create.sql.gz
run_once: true
Output_error:
failed: [10.100.140.230] => {"failed": true}
msg: unable to connect, check login credentials (login_user, and login_password, which can be defined in ~/.my.cnf), check that mysql socket exists and mysql server is running
I cannot create this file ~/.my.cnf using template since i am using ansible 1.9.6 and config file in used in higher versions of ansible Can someone please suggest me a workaround for this.
Ansible_Version:
ansible --version
ansible 1.9.6 (stable-1.9 b377301195) last updated 2017/04/09 00:47:37 (GMT -400)
lib/ansible/modules/core: (detached HEAD 746d51d1ff) last updated 2017/04/09 00:47:59 (GMT -400)
lib/ansible/modules/extras: (detached HEAD 2c073442b0) last updated 2017/04/09 00:48:19 (GMT -400)
configured module search path = /opt/ansible/library