1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-03-29 00:17:35 +00:00

pacemaker_resource: Add cloning support for resources and groups (#10665)

* add clone state for pacemaker_resource

* add changelog fragment

* Additional description entry for comment header

* Apply suggestions from code review

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

* Update plugins/modules/pacemaker_resource.py

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

* fix formatting for yamllint

* Apply code review suggestions

* refactor state name to cloned

* Update plugins/modules/pacemaker_resource.py

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

* Apply suggestions from code review

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>

* Apply suggestions from code review

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
Dexter 2025-09-07 15:24:01 -04:00 committed by GitHub
parent d0123a1038
commit 3baa13a3e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 113 additions and 7 deletions

View file

@ -13,6 +13,7 @@ from ansible_collections.community.general.plugins.module_utils.cmd_runner impor
_state_map = {
"present": "create",
"absent": "remove",
"cloned": "clone",
"status": "status",
"enabled": "enable",
"disabled": "disable",
@ -65,6 +66,8 @@ def pacemaker_runner(module, **kwargs):
resource_operation=cmd_runner_fmt.as_func(fmt_resource_operation),
resource_meta=cmd_runner_fmt.stack(cmd_runner_fmt.as_opt_val)("meta"),
resource_argument=cmd_runner_fmt.as_func(fmt_resource_argument),
resource_clone_ids=cmd_runner_fmt.as_list(),
resource_clone_meta=cmd_runner_fmt.as_list(),
apply_all=cmd_runner_fmt.as_bool("--all"),
agent_validation=cmd_runner_fmt.as_bool("--agent-validation"),
wait=cmd_runner_fmt.as_opt_eq_val("--wait"),