Skip to content

Commit

Permalink
fix group command build
Browse files Browse the repository at this point in the history
  • Loading branch information
munchtoast committed Jan 7, 2025
1 parent 2b0f636 commit 7f1b6d9
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions plugins/modules/pacemaker_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
description:
- Actions to associate with resource
type: dict
default: {}
suboptions:
argument_action:
description:
Expand Down Expand Up @@ -121,9 +120,15 @@
state: create
name: virtual-ip
resource_type:
name: IPaddr2
resource_name: IPaddr2
resource_option: "ip=[192.168.1.2]"
group: master
resource_arguments:
argument_action: group
argument_option:
- master
resource_operation:
operation_action: monitor
operation_option: interval=20
'''

RETURN = '''
Expand All @@ -132,10 +137,9 @@
type: bool
returned: always
out:
description: The output of the current state of the cluster. It return a
list of the nodes state.
description: The output of the resource state of the cluster.
type: str
sample: 'out: [[" overcloud-controller-0", " Online"]]}'
sample: 'out: [[" Assumed agent name ocf:heartbeat:IPaddr2 (deduced from IPaddr2)"]]}'
returned: always
rc:
description: exit code of the module
Expand Down Expand Up @@ -191,7 +195,9 @@ def create_cluster_resource(module, resource_name,
for m in resource_meta:
cmd += "meta %s " % m

if resource_arguments:
if resource_arguments is not None:
if resource_arguments.get('argument_action') == "group":
cmd += "--"
cmd += "%s " % resource_arguments.get('argument_action')
for option_argument in resource_arguments.get('argument_option'):
cmd += "%s " % option_argument
Expand Down Expand Up @@ -225,7 +231,7 @@ def main():
operation_option=dict(type='str', default=None),
)),
resource_meta=dict(type='list', elements='str', default=None),
resource_arguments=dict(type='dict', default=dict(), options=dict(
resource_arguments=dict(type='dict', default=None, options=dict(
argument_action=dict(type='str', default=None, choices=['clone', 'master', 'group']),
argument_option=dict(type='list', elements='str', default=None),
)),
Expand Down

0 comments on commit 7f1b6d9

Please sign in to comment.