|
|
|
@ -58,9 +58,9 @@ extends_documentation_fragment: aci
|
|
|
|
|
EXAMPLES = r'''
|
|
|
|
|
- name: Add Explicit vPC Protection Group
|
|
|
|
|
aci_switch_policy_vpc_protection_group:
|
|
|
|
|
host: "{{ aci_hostname }}"
|
|
|
|
|
username: "{{ aci_username }}"
|
|
|
|
|
password: "{{ aci_password }}"
|
|
|
|
|
host: apic
|
|
|
|
|
username: admin
|
|
|
|
|
password: SomeSecretPassword
|
|
|
|
|
protection_group: protectiongroupname
|
|
|
|
|
protection_group_id: 6
|
|
|
|
|
vpc_domain_policy: vpcdomainpolicyname
|
|
|
|
@ -70,15 +70,116 @@ EXAMPLES = r'''
|
|
|
|
|
|
|
|
|
|
- name: Remove Explicit vPC Protection Group
|
|
|
|
|
aci_switch_policy_vpc_protection_group:
|
|
|
|
|
host: "{{ aci_hostname }}"
|
|
|
|
|
username: "{{ aci_username }}"
|
|
|
|
|
password: "{{ aci_password }}"
|
|
|
|
|
host: apic
|
|
|
|
|
username: admin
|
|
|
|
|
password: SomeSecretPassword
|
|
|
|
|
protection_group: protectiongroupname
|
|
|
|
|
state: absent
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
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: string
|
|
|
|
|
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: string
|
|
|
|
|
sample: ?rsp-prop-include=config-only
|
|
|
|
|
method:
|
|
|
|
|
description: The HTTP method used for the request to the APIC
|
|
|
|
|
returned: failure or debug
|
|
|
|
|
type: string
|
|
|
|
|
sample: POST
|
|
|
|
|
response:
|
|
|
|
|
description: The HTTP response from the APIC
|
|
|
|
|
returned: failure or debug
|
|
|
|
|
type: string
|
|
|
|
|
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: string
|
|
|
|
|
sample: https://10.11.12.13/api/mo/uni/tn-production.json
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
from ansible.module_utils.network.aci.aci import ACIModule, aci_argument_spec
|
|
|
|
|