Skip to content

Commit

Permalink
Modify the edit_pdisk function to add new parameters. (#48)
Browse files Browse the repository at this point in the history
* Modify the edit_pdisk function to add new parameters.

* Modify the edit_pdisk function to add new parameters.
  • Loading branch information
ISIB-Group authored Oct 26, 2021
1 parent 9886a74 commit 2075702
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 3 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/48-edit_pdisk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- Modify the edit_pdisk function to add new parameters.
51 changes: 48 additions & 3 deletions plugins/modules/edit_pdisk.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,40 @@
- OFF is offline,FAIL is Failed,RBD is Rebuild,
- ON is Online,JB is JBOD,ES is Drive Erase stop,
- EM is Drive Erase Simple,EN is Drive Erase Normal,
- ET is Drive Erase Through,LOC is Locate,STL is Stop Locate.
- ET is Drive Erase Through,LOC is Locate,STL is Stop Locate,
- HS is Hot spare.
- Required when I(Info=None).
choices: ['UG', 'UB', 'OFF', 'FAIL', 'RBD', 'ON', 'JB', 'ES', 'EM', 'EN', 'ET', 'LOC', 'STL']
- Only the M5 model supports C(HS) Settings.
choices: ['UG', 'UB', 'OFF', 'FAIL', 'RBD', 'ON', 'JB', 'ES', 'EM', 'EN', 'ET', 'LOC', 'STL', 'HS']
type: str
action:
description:
- Action while set physical drive hotspare.
- Required when I(Info=None) and I(option=HS).
- Only the M5 model supports this parameter.
choices: ['remove', 'global', 'dedicate']
type: str
revertible:
description:
- IsRevertible while set physical drive hotspare.
- Required when I(Info=None) and I(option=HS) and I(action=dedicate).
- Only the M5 model supports this parameter.
choices: ['yes', 'no']
type: str
encl:
description:
- IsEnclAffinity while set physical drive hotspare.
- Required when I(Info=None) and I(option=HS) and I(action=dedicate).
- Only the M5 model supports this parameter.
choices: ['yes', 'no']
type: str
logical_drivers:
description:
- Logical Drivers while set physical drive hotspare, input multiple Logical Drivers index like 0,1,2.....
- Required when I(Info=None) and I(option=HS) and I(action=dedicate).
- Only the M5 model supports this parameter.
type: list
elements: int
extends_documentation_fragment:
- inspur.sm.ism
'''
Expand Down Expand Up @@ -72,6 +102,17 @@
device_id: 1
option: "LOC"
provider: "{{ ism }}"
- name: "M5 Edit pdisk"
inspur.sm.edit_pdisk:
ctrl_id: 0
device_id: 1
option: "HS"
action: "dedicate"
revertible: "yes"
encl: "yes"
logical_drivers: 1
provider: "{{ ism }}"
'''

RETURN = '''
Expand Down Expand Up @@ -127,7 +168,11 @@ def main():
info=dict(type='str', required=False, choices=['show']),
ctrl_id=dict(type='int', required=False),
device_id=dict(type='int', required=False),
option=dict(type='str', required=False, choices=['UG', 'UB', 'OFF', 'FAIL', 'RBD', 'ON', 'JB', 'ES', 'EM', 'EN', 'ET', 'LOC', 'STL']),
option=dict(type='str', required=False, choices=['UG', 'UB', 'OFF', 'FAIL', 'RBD', 'ON', 'JB', 'ES', 'EM', 'EN', 'ET', 'LOC', 'STL', 'HS']),
action=dict(type='str', required=False, choices=['remove', 'global', 'dedicate']),
revertible=dict(type='str', required=False, choices=['yes', 'no']),
encl=dict(type='str', required=False, choices=['yes', 'no']),
logical_drivers=dict(type='list', elements='int', required=False),
)
argument_spec.update(ism_argument_spec)
disk_obj = Disk(argument_spec)
Expand Down

0 comments on commit 2075702

Please sign in to comment.