Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check master replication status. #500

Closed
zangra-dev opened this issue Aug 26, 2022 · 3 comments
Closed

Check master replication status. #500

zangra-dev opened this issue Aug 26, 2022 · 3 comments
Labels

Comments

@zangra-dev
Copy link

zangra-dev commented Aug 26, 2022

In tasks/replication.yml
This errors occurs while I'm testing this role on vagrant guests.

Problem 1
has a delegate_to: "{{ mysql_replication_master }} option which in my case needed a remote_user
to fix a remote SSH connection failure

Problem 2
a) When I give the remote_user: my ansible_user variable it gives me an "Unhandled exception occurred while templating"
b) Using a custom group variable gives me an "msg": "'remote_user' is undefined"

solution is to set a variable in defaults/main.yml which can be overridden for the different used distribution ....

- name: Check master replication status.
  mysql_replication: mode=getprimary
  delegate_to: "{{ mysql_replication_master }}"
  remote_user: "{{ guest_user }}"
  register: master
  when:
    - (slave.Is_Replica is defined and not slave.Is_Replica) or (slave.Is_Replica is not defined and slave is failed)
    - mysql_replication_role == 'slave'
    - (mysql_replication_master | length) > 0
  tags: ['skip_ansible_galaxy']

- name: "debug 'master' var"
  debug:
    msg: "{{ master }}, guest_user: {{ guest_user }}"

This is also a follow up of #495

@giorgioma
Copy link
Contributor

See #503

@stale
Copy link

stale bot commented Feb 18, 2023

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.

@stale stale bot added the stale label Feb 18, 2023
@stale
Copy link

stale bot commented Apr 2, 2023

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.

@stale stale bot closed this as completed Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants