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

Bug fix: Only reset a failed state if present to avoid error #234

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

andanotheruser
Copy link
Contributor

Description

Fixes an issue where a failed state is reset while none is present, leading to an error and the playbook failing:

  TASK [ansible-mariadb-galera-cluster : manage_node_state | reset failed status (otherwise service can't be stopped)] ***
  fatal: [node2]: FAILED! => {"changed": false, "cmd": ["systemctl", "reset-failed", "mariadb"], "delta": "0:00:00.007486", "end": "2024-11-14 11:43:51.597408", "msg": "non-zero return code", "rc": 1, "start": "2024-11-14 11:43:51.589922", "stderr": "Failed to reset failed state of unit mariadb.service: Unit mariadb.service not loaded.", "stderr_lines": ["Failed to reset failed state of unit mariadb.service: Unit mariadb.service not loaded."], "stdout": "", "stdout_lines": []}
  skipping: [node1]

This change ensures a failed state is only reset if it is present and will fix the merge request pipeline for #227, #229 and #230

Related Issue

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (non-breaking change that does not add functionality or fix an issue)

Checklist:

  • I have read the CONTRIBUTING document.
  • I have run the pre-merge tests locally and they pass.
  • [] I have updated the documentation accordingly. -> No change required.
  • [] I have added tests to cover my changes. -> Nothing new required.
  • All new and existing tests passed.

@andanotheruser
Copy link
Contributor Author

Not yet sure why this fails on Rocky.

@andanotheruser andanotheruser marked this pull request as draft November 14, 2024 12:32
@andanotheruser andanotheruser force-pushed the fix-reset-failed-status branch from b5f7e5b to 8f8a785 Compare November 14, 2024 12:35
@andanotheruser andanotheruser force-pushed the fix-reset-failed-status branch from 4c9ac5a to 9e69730 Compare November 14, 2024 13:00
@andanotheruser
Copy link
Contributor Author

andanotheruser commented Nov 14, 2024

Not yet sure why this fails on Rocky.

Found it.

mariadb_systemd_service_name must include the full name. Ansible will fail with mariadb on some distributions, as it does not have the key in the dict: ansible_facts.services[mariadb_systemd_service_name].state, however, using the full unit name solves this.

@andanotheruser andanotheruser marked this pull request as ready for review November 14, 2024 13:03
@andanotheruser
Copy link
Contributor Author

@eRadical This MR will fix an issue that causes the pipeline of my other two MRs to fail. :)

@eRadical eRadical requested a review from elcomtik November 19, 2024 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant