summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDag Wieers <dag@wieers.com>2017-08-17 21:00:23 +0200
committerGitHub <noreply@github.com>2017-08-17 21:00:23 +0200
commite8011878995f451debed7e7549b0875b14031f3c (patch)
tree20bcb035eb21f70c8cf44db89d3807ccaa21477b
parentd4cedbee20ecf873d3d9a6b4ff35d3ae408d306c (diff)
downloadansible-e8011878995f451debed7e7549b0875b14031f3c.tar.gz
Bugfix and assorted fixes (#28352)
These are updates from aci-ansible.
-rw-r--r--lib/ansible/module_utils/aci.py2
-rw-r--r--lib/ansible/modules/network/aci/aci_ap.py8
-rw-r--r--lib/ansible/modules/network/aci/aci_contract.py4
-rw-r--r--lib/ansible/modules/network/aci/aci_contract_subject_to_filter.py14
-rw-r--r--lib/ansible/modules/network/aci/aci_filter_entry.py15
5 files changed, 22 insertions, 21 deletions
diff --git a/lib/ansible/module_utils/aci.py b/lib/ansible/module_utils/aci.py
index b5f55abb61..a42356b5b2 100644
--- a/lib/ansible/module_utils/aci.py
+++ b/lib/ansible/module_utils/aci.py
@@ -138,7 +138,7 @@ class ACIModule(object):
# Handle deprecated method/action parameter
if self.params['method']:
# Deprecate only if state was a valid option (not for aci_rest)
- if self.module.argument_spec('state', False):
+ if 'state' in self.module.argument_spec:
self.module.deprecate("Parameter 'method' or 'action' is deprecated, please use 'state' instead", '2.6')
method_map = dict(delete='absent', get='query', post='present')
self.params['state'] = method_map[self.params['method']]
diff --git a/lib/ansible/modules/network/aci/aci_ap.py b/lib/ansible/modules/network/aci/aci_ap.py
index 3cf5b002ea..7ee9842ab8 100644
--- a/lib/ansible/modules/network/aci/aci_ap.py
+++ b/lib/ansible/modules/network/aci/aci_ap.py
@@ -18,10 +18,6 @@ description:
- Manage top level Application Profile (AP) objects on Cisco ACI fabrics
- More information from the internal APIC class
I(fv:Ap) at U(https://developer.cisco.com/media/mim-ref/MO-fvAp.html).
-notes:
-- This module does not manage EPGs, see M(aci_epg) to do this.
-- The C(tenant) used must exist before using this module in your playbook.
- The M(aci_tenant) module can be used for this.
author:
- Swetha Chunduri (@schunduri)
- Dag Wieers (@dagwieers)
@@ -29,6 +25,10 @@ author:
version_added: '2.4'
requirements:
- ACI Fabric 1.0(3f)+
+notes:
+- This module does not manage EPGs, see M(aci_epg) to do this.
+- The C(tenant) used must exist before using this module in your playbook.
+ The M(aci_tenant) module can be used for this.
options:
tenant:
description:
diff --git a/lib/ansible/modules/network/aci/aci_contract.py b/lib/ansible/modules/network/aci/aci_contract.py
index 419d1b9728..2489099ee0 100644
--- a/lib/ansible/modules/network/aci/aci_contract.py
+++ b/lib/ansible/modules/network/aci/aci_contract.py
@@ -118,7 +118,7 @@ def main():
description = module.params['description']
scope = module.params['scope']
priority = module.params['priority']
- target = module.params['target']
+ dscp = module.params['dscp']
state = module.params['state']
aci = ACIModule(module)
@@ -143,7 +143,7 @@ def main():
if state == 'present':
# Filter out module parameters with null values
- aci.payload(aci_class='vzBrCP', class_config=dict(name=contract, descr=description, scope=scope, prio=priority, targetDscp=target))
+ aci.payload(aci_class='vzBrCP', class_config=dict(name=contract, descr=description, scope=scope, prio=priority, targetDscp=dscp))
# Generate config diff which will be used as POST request body
aci.get_diff(aci_class='vzBrCP')
diff --git a/lib/ansible/modules/network/aci/aci_contract_subject_to_filter.py b/lib/ansible/modules/network/aci/aci_contract_subject_to_filter.py
index fd44625ffe..2b176888a0 100644
--- a/lib/ansible/modules/network/aci/aci_contract_subject_to_filter.py
+++ b/lib/ansible/modules/network/aci/aci_contract_subject_to_filter.py
@@ -45,7 +45,7 @@ options:
subject:
description:
- The name of the Contract Subject.
- aliases: [ subject_name ]
+ aliases: [ contract_subject, subject_name ]
state:
description:
- Use C(present) or C(absent) for adding or removing.
@@ -85,9 +85,9 @@ def main():
argument_spec = aci_argument_spec
argument_spec.update(
contract=dict(type='str', aliases=['contract_name']),
- filter_name=dict(type='str'),
+ filter=dict(type='str', aliases=['filter_name']),
log=dict(tyep='str', choices=['log', 'none'], aliases=['directive']),
- subject=dict(type='str', aliases=['subject_name']),
+ subject=dict(type='str', aliases=['contract_subject', 'subject_name']),
tenant=dict(type='str', aliases=['tenant_name']),
state=dict(type='str', default='present', choices=['absent', 'present', 'query']),
method=dict(type='str', choices=['delete', 'get', 'post'], aliases=['action'], removed_in_version='2.6'), # Deprecated starting from v2.6
@@ -96,12 +96,12 @@ def main():
module = AnsibleModule(
argument_spec=argument_spec,
supports_check_mode=True,
- required_if=[['state', 'absent', ['contract', 'filter_name', 'subject', 'tenant']],
- ['state', 'present', ['contract', 'filter_name', 'subject', 'tenant']]]
+ required_if=[['state', 'absent', ['contract', 'filter', 'subject', 'tenant']],
+ ['state', 'present', ['contract', 'filter', 'subject', 'tenant']]]
)
# contract = module.params['contract']
- filter_name = module.params['filter_name']
+ filter_name = module.params['filter']
log = module.params['log']
# subject = module.params['subject']
# tenant = module.params['tenant']
@@ -114,7 +114,7 @@ def main():
# TODO: cleanup this logic and provide better filter_strings for all options
if filter_name is not None:
# Work with specific binding
- path = 'api/mo/uni/tn-%(tenant)s/brc-%(contract)s/subj-%(subject)s/rssubjFiltAtt-%(filter_name)s.json' % module.params
+ path = 'api/mo/uni/tn-%(tenant)s/brc-%(contract)s/subj-%(subject)s/rssubjFiltAtt-%(filter)s.json' % module.params
else:
path = 'api/class/vzRsSubjFiltAtt.json'
diff --git a/lib/ansible/modules/network/aci/aci_filter_entry.py b/lib/ansible/modules/network/aci/aci_filter_entry.py
index e1505871f7..a74b1cbf83 100644
--- a/lib/ansible/modules/network/aci/aci_filter_entry.py
+++ b/lib/ansible/modules/network/aci/aci_filter_entry.py
@@ -52,14 +52,15 @@ options:
entry:
description:
- Then name of the Filter Entry.
- aliases: [ entry_name, name ]
+ aliases: [ entry_name, filter_entry, name ]
ether_type:
description:
- The Ethernet type.
choices: [ arp, fcoe, ip, mac_security, mpls_ucast, trill, unspecified ]
- filter_name:
+ filter:
description:
The name of Filter that the entry should belong to.
+ aliases: [ filter_name ]
icmp_msg_type:
description:
- ICMPv4 message type; used when ip_protocol is icmp.
@@ -94,7 +95,7 @@ EXAMPLES = r'''
tenant: "{{ tenant }}"
ether_name: "{{ ether_name }}"
icmp_msg_type: "{{ icmp_msg_type }}"
- filter_name: "{{ filter_name }}"
+ filter: "{{ filter }}"
descr: "{{ descr }}"
host: "{{ inventory_hostname }}"
username: "{{ user }}"
@@ -132,9 +133,9 @@ def main():
dst_port=dict(type='str'),
dst_port_end=dict(type='str'),
dst_port_start=dict(type='str'),
- entry=dict(type='str', aliases=['entry_name', 'name']),
+ entry=dict(type='str', aliases=['entry_name', 'filter_entry', 'name']),
ether_type=dict(choices=VALID_ETHER_TYPES, type='str'),
- filter_name=dict(type='str'),
+ filter=dict(type='str', aliases=['filter_name']),
icmp_msg_type=dict(type='str', choices=VALID_ICMP_TYPES),
icmp6_msg_type=dict(type='str', choices=VALID_ICMP6_TYPES),
ip_protocol=dict(choices=VALID_IP_PROTOCOLS, type='str'),
@@ -163,7 +164,7 @@ def main():
dst_start = FILTER_PORT_MAPPING[dst_start]
entry = module.params['entry']
ether_type = module.params['ether_type']
- filter_name = module.params['filter_name']
+ filter_name = module.params['filter']
icmp_msg_type = module.params['icmp_msg_type']
if icmp_msg_type is not None:
icmp_msg_type = ICMP_MAPPING[icmp_msg_type]
@@ -192,7 +193,7 @@ def main():
if entry is not None:
# fail when entry is provided without tenant and filter_name
if tenant is not None and filter_name is not None:
- path = 'api/mo/uni/tn-%(tenant)s/flt-%(filter_name)s/e-%(entry)s.json' % module.params
+ path = 'api/mo/uni/tn-%(tenant)s/flt-%(filter)s/e-%(entry)s.json' % module.params
elif tenant is not None and state == 'query':
path = 'api/mo/uni/tn-%(tenant)s.json?rsp-subtree=full&rsp-subtree-class=vzEntry&rsp-subtree-filter=eq(vzEntry.name, \
\"%(entry)s\")&rsp-subtree-include=no-scoped' % module.params