mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-04 05:04:22 -07:00
feat(initial): Add working changes to pacemaker_stonith
This commit is contained in:
parent
89e90cbf91
commit
356c42ba3b
2 changed files with 16 additions and 6 deletions
|
@ -14,7 +14,7 @@ module: pacemaker_stonith
|
||||||
short_description: Manage pacemaker stonith
|
short_description: Manage pacemaker stonith
|
||||||
author:
|
author:
|
||||||
- Dexter Le (@munchtoast)
|
- Dexter Le (@munchtoast)
|
||||||
version_added: 10.6.0
|
version_added: 10.8.0
|
||||||
description:
|
description:
|
||||||
- This module can manage stonith in a Pacemaker cluster using the pacemaker CLI.
|
- This module can manage stonith in a Pacemaker cluster using the pacemaker CLI.
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
|
@ -156,11 +156,11 @@ class PacemakerStonith(StateModuleHelper):
|
||||||
self.runner = pacemaker_runner(self.module, cli_action='stonith')
|
self.runner = pacemaker_runner(self.module, cli_action='stonith')
|
||||||
self.vars.set('previous_value', self._get())
|
self.vars.set('previous_value', self._get())
|
||||||
self.vars.set('value', self.vars.previous_value, change=True, diff=True)
|
self.vars.set('value', self.vars.previous_value, change=True, diff=True)
|
||||||
self.vars.set('resource_type', self.vars.stonith_type)
|
self.module.params['resource_type'] = dict(resource_name=self.vars.stonith_type)
|
||||||
self.vars.set('resource_option', self.vars.stonith_option)
|
self.module.params['resource_option'] = self.vars.stonith_option
|
||||||
self.vars.set('resource_operation', self.vars.stonith_operation)
|
self.module.params['resource_operation'] = self.vars.stonith_operation
|
||||||
self.vars.set('resource_meta', self.vars.stonith_meta)
|
self.module.params['resource_meta'] = self.vars.stonith_meta
|
||||||
self.vars.set('resource_argument', self.vars.stonith_argument)
|
self.module.params['resource_argument'] = self.vars.stonith_argument
|
||||||
|
|
||||||
def _process_command_output(self, fail_on_err, ignore_err_msg=""):
|
def _process_command_output(self, fail_on_err, ignore_err_msg=""):
|
||||||
def process(rc, out, err):
|
def process(rc, out, err):
|
||||||
|
|
|
@ -96,6 +96,11 @@ test_cases:
|
||||||
rc: 1
|
rc: 1
|
||||||
out: ""
|
out: ""
|
||||||
err: "Error: Resource 'virtual-stonith' does not exist.\n"
|
err: "Error: Resource 'virtual-stonith' does not exist.\n"
|
||||||
|
- command: ["/testbin/pcs", stonith, status, virtual-stonith]
|
||||||
|
environ: *env-def
|
||||||
|
rc: 1
|
||||||
|
out: ""
|
||||||
|
err: ""
|
||||||
- id: test_absent_minimal_input_stonith_exists
|
- id: test_absent_minimal_input_stonith_exists
|
||||||
input:
|
input:
|
||||||
state: absent
|
state: absent
|
||||||
|
@ -116,6 +121,11 @@ test_cases:
|
||||||
rc: 0
|
rc: 0
|
||||||
out: ""
|
out: ""
|
||||||
err: "Attempting to stop: virtual-ip... Stopped\n"
|
err: "Attempting to stop: virtual-ip... Stopped\n"
|
||||||
|
- command: ["/testbin/pcs", stonith, status, virtual-stonith]
|
||||||
|
environ: *env-def
|
||||||
|
rc: 1
|
||||||
|
out: ""
|
||||||
|
err: ""
|
||||||
- id: test_enabled_minimal_input_stonith_not_exists
|
- id: test_enabled_minimal_input_stonith_not_exists
|
||||||
input:
|
input:
|
||||||
state: enabled
|
state: enabled
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue