1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-21 19:29:05 +00:00

pacemaker: fix race condition on resource creation (#11750)

* remove pacemaker wait arg and fix race condition

* fix up pacemaker resource and stonith polling

* add changelog for pacemaker timeout bug

* remove env from test case and fix changelog file name

* Update changelogs/fragments/11750-pacemaker-wait-race-condition.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
munchtoast 2026-04-18 16:45:58 -04:00 committed by GitHub
parent afe9de7562
commit 6c809dd9db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 382 additions and 17 deletions

View file

@ -125,7 +125,7 @@ value:
"""
from ansible_collections.community.general.plugins.module_utils.module_helper import StateModuleHelper
from ansible_collections.community.general.plugins.module_utils.pacemaker import pacemaker_runner
from ansible_collections.community.general.plugins.module_utils.pacemaker import pacemaker_runner, wait_for_resource
class PacemakerStonith(StateModuleHelper):
@ -206,7 +206,7 @@ class PacemakerStonith(StateModuleHelper):
def state_present(self):
with self.runner(
"cli_action state name resource_type resource_option resource_operation resource_meta resource_argument agent_validation wait",
"cli_action state name resource_type resource_option resource_operation resource_meta resource_argument agent_validation",
output_process=self._process_command_output(True, "already exists"),
check_mode_skip=True,
) as ctx:
@ -218,6 +218,8 @@ class PacemakerStonith(StateModuleHelper):
resource_meta=self.vars.stonith_metas,
resource_argument=self.vars.stonith_argument,
)
if not self.module.check_mode and self.vars.wait:
wait_for_resource(self.runner, "stonith", self.vars.name, self.vars.wait)
def state_enabled(self):
with self.runner(