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-07-02 14:51:20 -04:00 committed by munchtoast
commit cfd1167ee8

View file

@ -9,14 +9,13 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = '''
---
module: pacemaker_stonith module: pacemaker_stonith
short_description: Manage pacemaker STONITH short_description: Manage pacemaker STONITH
author: author:
- Dexter Le (@munchtoast) - Dexter Le (@munchtoast)
version_added: 11.1.0 version_added: 11.1.0
description: description:
- This module can manage STONITH in a Pacemaker cluster using the pacemaker CLI. - This module manages STONITH in a Pacemaker cluster using the pacemaker CLI.
extends_documentation_fragment: extends_documentation_fragment:
- community.general.attributes - community.general.attributes
attributes: attributes:
@ -38,7 +37,7 @@ options:
type: str type: str
stonith_type: stonith_type:
description: description:
- Specify the STONITH device type - Specify the STONITH device type.
type: str type: str
stonith_options: stonith_options:
description: description:
@ -59,12 +58,12 @@ options:
type: str type: str
operation_options: operation_options:
description: description:
- Operation option to associate with action. - Operation options to associate with action.
type: list type: list
elements: str elements: str
stonith_metas: stonith_metas:
description: description:
- List of meta to associate with STONITH. - List of metadata to associate with STONITH.
type: list type: list
elements: str elements: str
stonith_argument: stonith_argument:
@ -84,7 +83,7 @@ options:
elements: str elements: str
agent_validation: agent_validation:
description: description:
- enabled agent validation for STONITH creation. - Enabled agent validation for STONITH creation.
type: bool type: bool
default: false default: false
wait: wait:
@ -95,12 +94,7 @@ options:
''' '''
EXAMPLES = ''' EXAMPLES = '''
--- - name: Create virtual-ip STONITH
- name: Create pacemaker STONITH
hosts: localhost
gather_facts: false
tasks:
- name: Create virtual-ip STONITH
community.general.pacemaker_stonith: community.general.pacemaker_stonith:
state: present state: present
name: virtual-stonith name: virtual-stonith
@ -132,8 +126,8 @@ class PacemakerStonith(StateModuleHelper):
'present', 'absent', 'enabled', 'disabled']), 'present', 'absent', 'enabled', 'disabled']),
name=dict(type='str', required=True), name=dict(type='str', required=True),
stonith_type=dict(type='str'), stonith_type=dict(type='str'),
stonith_options=dict(type='list', elements='str', default=list()), stonith_options=dict(type='list', elements='str', default=[]),
stonith_operations=dict(type='list', elements='dict', default=list(), options=dict( stonith_operations=dict(type='list', elements='dict', default=[], options=dict(
operation_action=dict(type='str'), operation_action=dict(type='str'),
operation_options=dict(type='list', elements='str'), operation_options=dict(type='list', elements='str'),
)), )),
@ -149,7 +143,6 @@ class PacemakerStonith(StateModuleHelper):
supports_check_mode=True supports_check_mode=True
) )
use_old_vardict = False
default_state = "present" default_state = "present"
def __init_module__(self): def __init_module__(self):