I’ve create and another module for this besides the mysql_replication, named mysql_variables.
The purpose of this module to get/set variables from running MySQL servers, and avoid to use shell module for this, because that is a bit frustrating, and there are long commands to run.
For example, when you wanna to set read_only mode via shell, you can do that like this:
ansible db-secondary.bfc.kinja-ops.com -m shell -a "mysql -e 'select @@read_only'"
db-secondary.bfc.kinja-ops.com | success | rc=0 >>
[root@admin banyek]# ansible db-secondary.bfc.kinja-ops.com -m shell -a "mysql -e 'set global read_only=1'"
db-secondary.bfc.kinja-ops.com | success | rc=0 >>
Not so neat, isn’t it, eh? And I have not speak about the —user and —password variables, to this could be real annoying.
That’s why I made this module, because it is a bit easier to use (and I like to use own toolset with the …
[Read more]