geerlingguy / ansible-role-mysql

Ansible Role - MySQL
https://galaxy.ansible.com/geerlingguy/mysql/
MIT License
1.05k stars 861 forks source link

Skip replication tasks #501

Closed RemiLecpac closed 6 months ago

RemiLecpac commented 1 year ago

For replication, the playbook skips all tasks. Probably because of the following condition tasks/replications.yml:

(slave.Is_Slave is defined and not slave.Is_Slave) or (slave.Is_Slave is not defined and slave is failed)

The condition always returns me false.

Version:

VincentChantreau commented 1 year ago

same problem here The problem appear when I installed community.mysql collection It seems that they replaced Is_Slave by Is_Replica (what a great idea to rename everything...) So replacing the old Is_Slave variable in the replication tasks did the trick for me Hope it can be fixed soon

giorgioma commented 1 year ago

See #503

hahayusuf commented 1 year ago

I am glad with the fix.

However, I still seem to have the same issue of the replication tasks skipping.

When I comment out the following condition in the replication.yml file, it works as expected:

(slave.Is_Slave is defined and not slave.Is_Slave) or (slave.Is_Replica is defined and not slave.Is_Replica) or (slave.Is_Slave is not defined and slave.Is_Replica is not defined and slave is failed)

I am facing this issue with the "Configure replication" and "Start replication". I still do not understand what is causing this as the condition appears to cater for both the 'slave' and 'replica' naming convention.

stale[bot] commented 1 year ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

github-actions[bot] commented 1 year ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

azhinu commented 1 year ago

Start replication task is skipped on first run with role v4.3.3 (latest on this moment). But it runs on second run. I think this is because replica status is checked before Configure replication on the slave task runs. And the role have condition slave.Is_Replica is defined and slave.Is_Replica, that returns false on first run. But in second run replica status is true and Start replication task runs. So I think, we should to recheck replica status before Start replication task to let complete all task in first run.

github-actions[bot] commented 8 months ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

github-actions[bot] commented 6 months ago

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.