Dear team,
I'm trying to execute MySQL , queries using ansible playbook, kindly provide steps or format of the MySQL command,
Currently I'm planning to use as given below
- name: "+++Run MySQL query SHOW STATUS+++"
command: > ## I can use shell module as well.
mysql -u {{ user_name }} -p {{ pass }} --db {{ DB_name }}
--host={{ h1_ip }} --batch --skip-column-names
--execute: "show master status;" > /tmp/status
register: m_status
- name: "+++The Value of Update_user_status+++"
debug:
msg="The Value of Above query {{ m_status.stdout }
Where as DB username, password and schema names are hardcoded in the vars.yml file.