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

[PR #11750/6c809dd9 backport][stable-12] pacemaker: fix race condition on resource creation (#11877)

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



---------


(cherry picked from commit 6c809dd9db)

Co-authored-by: munchtoast <45038532+munchtoast@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
patchback[bot] 2026-04-18 22:55:56 +02:00 committed by GitHub
parent 27ca6be10a
commit 449a179d8f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 382 additions and 17 deletions

View file

@ -149,6 +149,7 @@ from ansible_collections.community.general.plugins.module_utils.module_helper im
from ansible_collections.community.general.plugins.module_utils.pacemaker import (
get_pacemaker_maintenance_mode,
pacemaker_runner,
wait_for_resource,
)
@ -237,7 +238,7 @@ class PacemakerResource(StateModuleHelper):
def state_present(self):
with self.runner(
"cli_action state name resource_type resource_option resource_operation resource_meta resource_argument "
"resource_clone_ids resource_clone_meta wait",
"resource_clone_ids resource_clone_meta",
output_process=self._process_command_output(
not get_pacemaker_maintenance_mode(self.runner), "already exists"
),
@ -247,10 +248,12 @@ class PacemakerResource(StateModuleHelper):
cli_action="resource",
resource_clone_ids=self.fmt_as_stack_argument(self.module.params["resource_clone_ids"], "clone"),
)
if not self.module.check_mode and self.vars.wait and not get_pacemaker_maintenance_mode(self.runner):
wait_for_resource(self.runner, "resource", self.vars.name, self.vars.wait)
def state_cloned(self):
with self.runner(
"cli_action state name resource_clone_ids resource_clone_meta wait",
"cli_action state name resource_clone_ids resource_clone_meta",
output_process=self._process_command_output(
not get_pacemaker_maintenance_mode(self.runner), "already a clone resource"
),
@ -260,6 +263,8 @@ class PacemakerResource(StateModuleHelper):
cli_action="resource",
resource_clone_meta=self.fmt_as_stack_argument(self.module.params["resource_clone_meta"], "meta"),
)
if not self.module.check_mode and self.vars.wait and not get_pacemaker_maintenance_mode(self.runner):
wait_for_resource(self.runner, "resource", self.vars.name, self.vars.wait)
def state_enabled(self):
with self.runner(