����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 -*-

# 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": "certified"}

DOCUMENTATION = r"""
---
module: aci_epg
short_description: Manage End Point Groups (EPG) objects (fv:AEPg)
description:
- Manage End Point Groups (EPG) on Cisco ACI fabrics.
options:
  tenant:
    description:
    - Name of an existing tenant.
    type: str
    aliases: [ tenant_name ]
  ap:
    description:
    - Name of an existing application network profile, that will contain the EPGs.
    type: str
    aliases: [ app_profile, app_profile_name ]
  epg:
    description:
    - Name of the end point group.
    type: str
    aliases: [ epg_name, name ]
  bd:
    description:
    - Name of the bridge domain being associated with the EPG.
    type: str
    aliases: [ bd_name, bridge_domain ]
  priority:
    description:
    - The QoS class.
    - The APIC defaults to C(unspecified) when unset during creation.
    type: str
    choices: [ level1, level2, level3, unspecified ]
  intra_epg_isolation:
    description:
    - The Intra EPG Isolation.
    - The APIC defaults to C(unenforced) when unset during creation.
    type: str
    choices: [ enforced, unenforced ]
  description:
    description:
    - Description for the EPG.
    type: str
    aliases: [ descr ]
  fwd_control:
    description:
    - The forwarding control used by the EPG.
    - The APIC defaults to C(none) when unset during creation.
    type: str
    choices: [ none, proxy-arp ]
  preferred_group:
    description:
    - Whether or not the EPG is part of the Preferred Group and can communicate without contracts.
    - This is very convenient for migration scenarios, or when ACI is used for network automation but not for policy.
    - The APIC defaults to C(false) when unset during creation.
    type: bool
  monitoring_policy:
    description:
    - The name of the monitoring policy.
    type: str
  custom_qos_policy:
    description:
    - The name of the custom Quality of Service policy.
    type: str
  useg:
    description:
    - Use C(yes) to create uSeg EPG and C(no) is used to create Application EPG.
    type: str
    choices: [ 'yes', 'no' ]
  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
  name_alias:
    description:
    - The alias for the current object. This relates to the nameAlias field in ACI.
    type: str
extends_documentation_fragment:
- cisco.aci.aci
- cisco.aci.annotation

notes:
- The C(tenant) and C(app_profile) used must exist before using this module in your playbook.
  The M(cisco.aci.aci_tenant) and M(cisco.aci.aci_ap) modules can be used for this.
seealso:
- module: cisco.aci.aci_tenant
- module: cisco.aci.aci_ap
- name: APIC Management Information Model reference
  description: More information about the internal APIC class B(fv:AEPg).
  link: https://developer.cisco.com/docs/apic-mim-ref/
author:
- Swetha Chunduri (@schunduri)
- Shreyas Srish (@shrsr)
"""

EXAMPLES = r"""
- name: Add a new EPG
  cisco.aci.aci_epg:
    host: apic
    username: admin
    password: SomeSecretPassword
    tenant: production
    ap: intranet
    epg: web_epg
    description: Web Intranet EPG
    bd: prod_bd
    monitoring_policy: default
    preferred_group: true
    state: present
  delegate_to: localhost

- aci_epg:
    host: apic
    username: admin
    password: SomeSecretPassword
    tenant: production
    ap: ticketing
    epg: "{{ item.epg }}"
    description: Ticketing EPG
    bd: "{{ item.bd }}"
    priority: unspecified
    intra_epg_isolation: unenforced
    state: present
  delegate_to: localhost
  with_items:
    - epg: web
      bd: web_bd
    - epg: database
      bd: database_bd

- name: Add a new uSeg EPG
  cisco.aci.aci_epg:
    host: apic
    username: admin
    password: SomeSecretPassword
    tenant: production
    ap: intranet
    epg: web_epg
    description: Web Intranet EPG
    bd: prod_bd
    monitoring_policy: default
    preferred_group: true
    useg: 'yes'
    state: present
  delegate_to: localhost

- name: Remove an EPG
  cisco.aci.aci_epg:
    host: apic
    username: admin
    password: SomeSecretPassword
    validate_certs: false
    tenant: production
    app_profile: intranet
    epg: web_epg
    monitoring_policy: default
    state: absent
  delegate_to: localhost

- name: Query an EPG
  cisco.aci.aci_epg:
    host: apic
    username: admin
    password: SomeSecretPassword
    tenant: production
    ap: ticketing
    epg: web_epg
    state: query
  delegate_to: localhost
  register: query_result

- name: Query all EPGs
  cisco.aci.aci_epg:
    host: apic
    username: admin
    password: SomeSecretPassword
    state: query
  delegate_to: localhost
  register: query_result

- name: Query all EPGs with a Specific Name
  cisco.aci.aci_epg:
    host: apic
    username: admin
    password: SomeSecretPassword
    validate_certs: false
    epg: web_epg
    state: query
  delegate_to: localhost
  register: query_result

- name: Query all EPGs of an App Profile
  cisco.aci.aci_epg:
    host: apic
    username: admin
    password: SomeSecretPassword
    validate_certs: false
    ap: ticketing
    state: query
  delegate_to: localhost
  register: query_result
"""

RETURN = r"""
current:
  description: The existing configuration from the APIC after the module has finished
  returned: success
  type: list
  sample:
    [
        {
            "fvTenant": {
                "attributes": {
                    "descr": "Production environment",
                    "dn": "uni/tn-production",
                    "name": "production",
                    "nameAlias": "",
                    "ownerKey": "",
                    "ownerTag": ""
                }
            }
        }
    ]
error:
  description: The error information as returned from the APIC
  returned: failure
  type: dict
  sample:
    {
        "code": "122",
        "text": "unknown managed object class foo"
    }
raw:
  description: The raw output returned by the APIC REST API (xml or json)
  returned: parse error
  type: str
  sample: '<?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata>'
sent:
  description: The actual/minimal configuration pushed to the APIC
  returned: info
  type: list
  sample:
    {
        "fvTenant": {
            "attributes": {
                "descr": "Production environment"
            }
        }
    }
previous:
  description: The original configuration from the APIC before the module has started
  returned: info
  type: list
  sample:
    [
        {
            "fvTenant": {
                "attributes": {
                    "descr": "Production",
                    "dn": "uni/tn-production",
                    "name": "production",
                    "nameAlias": "",
                    "ownerKey": "",
                    "ownerTag": ""
                }
            }
        }
    ]
proposed:
  description: The assembled configuration from the user-provided parameters
  returned: info
  type: dict
  sample:
    {
        "fvTenant": {
            "attributes": {
                "descr": "Production environment",
                "name": "production"
            }
        }
    }
filter_string:
  description: The filter string used for the request
  returned: failure or debug
  type: str
  sample: ?rsp-prop-include=config-only
method:
  description: The HTTP method used for the request to the APIC
  returned: failure or debug
  type: str
  sample: POST
response:
  description: The HTTP response from the APIC
  returned: failure or debug
  type: str
  sample: OK (30 bytes)
status:
  description: The HTTP status from the APIC
  returned: failure or debug
  type: int
  sample: 200
url:
  description: The HTTP url used for the request to the APIC
  returned: failure or debug
  type: str
  sample: https://10.11.12.13/api/mo/uni/tn-production.json
"""

from ansible.module_utils.basic import AnsibleModule
from ansible_collections.cisco.aci.plugins.module_utils.aci import ACIModule, aci_argument_spec, aci_annotation_spec


def main():
    argument_spec = aci_argument_spec()
    argument_spec.update(aci_annotation_spec())
    argument_spec.update(
        epg=dict(type="str", aliases=["epg_name", "name"]),  # Not required for querying all objects
        bd=dict(type="str", aliases=["bd_name", "bridge_domain"]),
        ap=dict(type="str", aliases=["app_profile", "app_profile_name"]),  # Not required for querying all objects
        tenant=dict(type="str", aliases=["tenant_name"]),  # Not required for querying all objects
        description=dict(type="str", aliases=["descr"]),
        priority=dict(type="str", choices=["level1", "level2", "level3", "unspecified"]),
        intra_epg_isolation=dict(choices=["enforced", "unenforced"]),
        fwd_control=dict(type="str", choices=["none", "proxy-arp"]),
        preferred_group=dict(type="bool"),
        state=dict(type="str", default="present", choices=["absent", "present", "query"]),
        name_alias=dict(type="str"),
        monitoring_policy=dict(type="str"),
        custom_qos_policy=dict(type="str"),
        useg=dict(type="str", choices=["yes", "no"]),
    )

    module = AnsibleModule(
        argument_spec=argument_spec,
        supports_check_mode=True,
        required_if=[
            ["state", "absent", ["ap", "epg", "tenant"]],
            ["state", "present", ["ap", "epg", "tenant"]],
        ],
    )

    aci = ACIModule(module)

    epg = module.params.get("epg")
    bd = module.params.get("bd")
    description = module.params.get("description")
    priority = module.params.get("priority")
    intra_epg_isolation = module.params.get("intra_epg_isolation")
    fwd_control = module.params.get("fwd_control")
    preferred_group = aci.boolean(module.params.get("preferred_group"), "include", "exclude")
    state = module.params.get("state")
    tenant = module.params.get("tenant")
    ap = module.params.get("ap")
    name_alias = module.params.get("name_alias")
    monitoring_policy = module.params.get("monitoring_policy")
    custom_qos_policy = module.params.get("custom_qos_policy")
    useg = module.params.get("useg")

    child_configs = [dict(fvRsBd=dict(attributes=dict(tnFvBDName=bd))), dict(fvRsAEPgMonPol=dict(attributes=dict(tnMonEPGPolName=monitoring_policy)))]

    if custom_qos_policy is not None:
        child_configs.append(dict(fvRsCustQosPol=dict(attributes=dict(tnQosCustomPolName=custom_qos_policy))))

    aci.construct_url(
        root_class=dict(
            aci_class="fvTenant",
            aci_rn="tn-{0}".format(tenant),
            module_object=tenant,
            target_filter={"name": tenant},
        ),
        subclass_1=dict(
            aci_class="fvAp",
            aci_rn="ap-{0}".format(ap),
            module_object=ap,
            target_filter={"name": ap},
        ),
        subclass_2=dict(
            aci_class="fvAEPg",
            aci_rn="epg-{0}".format(epg),
            module_object=epg,
            target_filter={"name": epg},
        ),
        child_classes=["fvRsBd", "fvRsAEPgMonPol", "fvRsCustQosPol"],
    )

    aci.get_existing()

    if state == "present":
        aci.payload(
            aci_class="fvAEPg",
            class_config=dict(
                name=epg,
                descr=description,
                prio=priority,
                pcEnfPref=intra_epg_isolation,
                fwdCtrl=fwd_control,
                prefGrMemb=preferred_group,
                nameAlias=name_alias,
                isAttrBasedEPg=useg,
            ),
            child_configs=child_configs,
        )

        aci.get_diff(aci_class="fvAEPg")

        aci.post_config()

    elif state == "absent":
        aci.delete_config()

    aci.exit_json()


if __name__ == "__main__":
    main()

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
__init__.py File 0 B 0644
aci_aaa_custom_privilege.py File 9.62 KB 0644
aci_aaa_domain.py File 7.35 KB 0644
aci_aaa_role.py File 9.25 KB 0644
aci_aaa_ssh_auth.py File 7.08 KB 0644
aci_aaa_user.py File 10.42 KB 0644
aci_aaa_user_certificate.py File 7.98 KB 0644
aci_aaa_user_domain.py File 8.3 KB 0644
aci_aaa_user_role.py File 9.71 KB 0644
aci_access_port_block_to_access_port.py File 13.72 KB 0644
aci_access_port_to_interface_policy_leaf_profile.py File 16.96 KB 0644
aci_access_span_dst_group.py File 14.48 KB 0644
aci_access_span_filter_group.py File 6.46 KB 0644
aci_access_span_filter_group_entry.py File 10.24 KB 0644
aci_access_sub_port_block_to_access_port.py File 11.84 KB 0644
aci_aep.py File 7.61 KB 0644
aci_aep_to_domain.py File 8.91 KB 0644
aci_aep_to_epg.py File 9.56 KB 0644
aci_ap.py File 7.67 KB 0644
aci_bd.py File 15.52 KB 0644
aci_bd_dhcp_label.py File 8.89 KB 0644
aci_bd_subnet.py File 13.81 KB 0644
aci_bd_to_l3out.py File 7.29 KB 0644
aci_bgp_rr_asn.py File 6.16 KB 0644
aci_bgp_rr_node.py File 7 KB 0644
aci_bulk_static_binding_to_epg.py File 21.97 KB 0644
aci_cloud_ap.py File 7.61 KB 0644
aci_cloud_aws_provider.py File 7.54 KB 0644
aci_cloud_bgp_asn.py File 6.53 KB 0644
aci_cloud_cidr.py File 7.87 KB 0644
aci_cloud_ctx_profile.py File 8.61 KB 0644
aci_cloud_epg.py File 7.59 KB 0644
aci_cloud_epg_selector.py File 10.64 KB 0644
aci_cloud_external_epg.py File 8.21 KB 0644
aci_cloud_external_epg_selector.py File 5.39 KB 0644
aci_cloud_provider.py File 4.46 KB 0644
aci_cloud_region.py File 5.59 KB 0644
aci_cloud_subnet.py File 8.99 KB 0644
aci_cloud_vpn_gateway.py File 6.52 KB 0644
aci_cloud_zone.py File 5.87 KB 0644
aci_config_export_policy.py File 8.63 KB 0644
aci_config_rollback.py File 9.65 KB 0644
aci_config_snapshot.py File 10.4 KB 0644
aci_contract.py File 9.33 KB 0644
aci_contract_export.py File 7.62 KB 0644
aci_contract_subject.py File 14.18 KB 0644
aci_contract_subject_to_filter.py File 12.77 KB 0644
aci_contract_subject_to_service_graph.py File 6.85 KB 0644
aci_dhcp_relay.py File 7.13 KB 0644
aci_dhcp_relay_provider.py File 10.84 KB 0644
aci_dns_domain.py File 7.06 KB 0644
aci_dns_profile.py File 6.39 KB 0644
aci_dns_provider.py File 7.11 KB 0644
aci_domain.py File 14.38 KB 0644
aci_domain_to_encap_pool.py File 11.44 KB 0644
aci_domain_to_vlan_pool.py File 10.62 KB 0644
aci_encap_pool.py File 8.85 KB 0644
aci_encap_pool_range.py File 13.35 KB 0644
aci_epg.py File 11.87 KB 0644
aci_epg_monitoring_policy.py File 7.43 KB 0644
aci_epg_to_contract.py File 10.95 KB 0644
aci_epg_to_contract_interface.py File 8.69 KB 0644
aci_epg_to_contract_master.py File 8.13 KB 0644
aci_epg_to_domain.py File 18.38 KB 0644
aci_esg.py File 9.76 KB 0644
aci_esg_contract_master.py File 8.09 KB 0644
aci_esg_epg_selector.py File 9.14 KB 0644
aci_esg_ip_subnet_selector.py File 7.82 KB 0644
aci_esg_tag_selector.py File 9.42 KB 0644
aci_fabric_leaf_profile.py File 6.37 KB 0644
aci_fabric_leaf_switch_assoc.py File 7.88 KB 0644
aci_fabric_node.py File 7.94 KB 0644
aci_fabric_pod_policy_group.py File 9.79 KB 0644
aci_fabric_scheduler.py File 9.77 KB 0644
aci_fabric_spine_profile.py File 6.39 KB 0644
aci_fabric_spine_switch_assoc.py File 7.92 KB 0644
aci_fabric_switch_block.py File 8.53 KB 0644
aci_fabric_switch_policy_group.py File 13.11 KB 0644
aci_filter.py File 7.4 KB 0644
aci_filter_entry.py File 13.3 KB 0644
aci_firmware_group.py File 6.89 KB 0644
aci_firmware_group_node.py File 6.64 KB 0644
aci_firmware_policy.py File 6.7 KB 0644
aci_firmware_source.py File 8.21 KB 0644
aci_igmp_interface_policy.py File 11.2 KB 0644
aci_interface_blacklist.py File 8.32 KB 0644
aci_interface_config.py File 13.15 KB 0644
aci_interface_description.py File 9.57 KB 0644
aci_interface_policy_cdp.py File 7.14 KB 0644
aci_interface_policy_fc.py File 7.05 KB 0644
aci_interface_policy_l2.py File 7.98 KB 0644
aci_interface_policy_leaf_breakout_port_group.py File 7.14 KB 0644
aci_interface_policy_leaf_policy_group.py File 19.02 KB 0644
aci_interface_policy_leaf_profile.py File 8.64 KB 0644
aci_interface_policy_leaf_profile_fex_policy_group.py File 7.74 KB 0644
aci_interface_policy_link_level.py File 8.84 KB 0644
aci_interface_policy_lldp.py File 7.38 KB 0644
aci_interface_policy_mcp.py File 6.92 KB 0644
aci_interface_policy_ospf.py File 13.76 KB 0644
aci_interface_policy_port_channel.py File 10.65 KB 0644
aci_interface_policy_port_security.py File 7.89 KB 0644
aci_interface_policy_spanning_tree.py File 7.59 KB 0644
aci_interface_selector_to_switch_policy_leaf_profile.py File 7.6 KB 0644
aci_l2out.py File 8.34 KB 0644
aci_l2out_extepg.py File 8.77 KB 0644
aci_l2out_extepg_to_contract.py File 9.94 KB 0644
aci_l2out_logical_interface_path.py File 11.43 KB 0644
aci_l2out_logical_interface_profile.py File 8.18 KB 0644
aci_l2out_logical_node_profile.py File 7.36 KB 0644
aci_l3out.py File 11.5 KB 0644
aci_l3out_bgp_peer.py File 16.8 KB 0644
aci_l3out_extepg.py File 9.23 KB 0644
aci_l3out_extepg_to_contract.py File 9.83 KB 0644
aci_l3out_extsubnet.py File 10.96 KB 0644
aci_l3out_interface.py File 10.87 KB 0644
aci_l3out_interface_secondary_ip.py File 10.91 KB 0644
aci_l3out_logical_interface_profile.py File 8.96 KB 0644
aci_l3out_logical_interface_profile_ospf_policy.py File 9.83 KB 0644
aci_l3out_logical_interface_vpc_member.py File 11.53 KB 0644
aci_l3out_logical_node.py File 8.34 KB 0644
aci_l3out_logical_node_profile.py File 8.88 KB 0644
aci_l3out_route_tag_policy.py File 7.64 KB 0644
aci_l3out_static_routes.py File 10.23 KB 0644
aci_l3out_static_routes_nexthop.py File 8.45 KB 0644
aci_maintenance_group.py File 6.89 KB 0644
aci_maintenance_group_node.py File 6.57 KB 0644
aci_maintenance_policy.py File 8.21 KB 0644
aci_node_mgmt_epg.py File 8.11 KB 0644
aci_ntp_policy.py File 7.76 KB 0644
aci_ntp_server.py File 8.82 KB 0644
aci_rest.py File 14.22 KB 0644
aci_snmp_client.py File 7.24 KB 0644
aci_snmp_client_group.py File 7.45 KB 0644
aci_snmp_community_policy.py File 6.72 KB 0644
aci_snmp_policy.py File 6.83 KB 0644
aci_snmp_user.py File 7.8 KB 0644
aci_static_binding_to_epg.py File 16.59 KB 0644
aci_static_node_mgmt_address.py File 9.61 KB 0644
aci_switch_leaf_selector.py File 10.67 KB 0644
aci_switch_policy_leaf_profile.py File 6.68 KB 0644
aci_switch_policy_vpc_protection_group.py File 8.74 KB 0644
aci_syslog_group.py File 9.55 KB 0644
aci_syslog_remote_dest.py File 9.3 KB 0644
aci_syslog_source.py File 7.38 KB 0644
aci_system.py File 4.82 KB 0644
aci_taboo_contract.py File 7.76 KB 0644
aci_tag.py File 7.35 KB 0644
aci_tenant.py File 6.62 KB 0644
aci_tenant_action_rule_profile.py File 7.34 KB 0644
aci_tenant_ep_retention_policy.py File 11.06 KB 0644
aci_tenant_span_dst_group.py File 11.92 KB 0644
aci_tenant_span_src_group.py File 7.94 KB 0644
aci_tenant_span_src_group_src.py File 8.46 KB 0644
aci_tenant_span_src_group_to_dst_group.py File 8.28 KB 0644
aci_vlan_pool.py File 7.62 KB 0644
aci_vlan_pool_encap_block.py File 10.63 KB 0644
aci_vmm_controller.py File 10.43 KB 0644
aci_vmm_credential.py File 8.68 KB 0644
aci_vmm_uplink.py File 6.89 KB 0644
aci_vmm_uplink_container.py File 6.71 KB 0644
aci_vmm_vswitch_policy.py File 14.72 KB 0644
aci_vrf.py File 9.04 KB 0644
aci_vzany_to_contract.py File 7.89 KB 0644