meraki_ssid - Modifying SSID won't work when specifying number (#51645)
* Fix bug when specifying SSID by number - Migrated integration test to blocks with always - Minor URL fixes (cherry picked from commit ed79c294f2e3f82d4828226004c055dcd7ce9f63) * Create changelog file * Add new line
This commit is contained in:
parent
20ed819acd
commit
48128ec2fc
3 changed files with 245 additions and 243 deletions
2
changelogs/fragments/meraki_ssid_number_fix.yml
Normal file
2
changelogs/fragments/meraki_ssid_number_fix.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- meraki_ssid - Fix module to actually perform changes when state is present and SSID is referenced by number and not name.
|
|
@ -375,8 +375,8 @@ def main():
|
|||
meraki.params['follow_redirects'] = 'all'
|
||||
|
||||
query_urls = {'ssid': '/networks/{net_id}/ssids'}
|
||||
query_url = {'ssid': 'networks/{net_id}/ssids/'}
|
||||
update_url = {'ssid': 'networks/{net_id}/ssids/'}
|
||||
query_url = {'ssid': '/networks/{net_id}/ssids/'}
|
||||
update_url = {'ssid': '/networks/{net_id}/ssids/'}
|
||||
|
||||
meraki.url_catalog['get_all'].update(query_urls)
|
||||
meraki.url_catalog['get_one'].update(query_url)
|
||||
|
@ -434,8 +434,10 @@ def main():
|
|||
if meraki.params[v] is not None:
|
||||
payload[k] = meraki.params[v]
|
||||
ssids = get_ssids(meraki, net_id)
|
||||
original = ssids[get_ssid_number(meraki.params['name'], ssids)]
|
||||
# meraki.fail_json(msg=meraki.is_update_required(original, payload), original=original, payload=payload)
|
||||
number = meraki.params['number']
|
||||
if number is None:
|
||||
number = get_ssid_number(meraki.params['name'], ssids)
|
||||
original = ssids[number]
|
||||
if meraki.is_update_required(original, payload):
|
||||
ssid_id = meraki.params['number']
|
||||
if ssid_id is None: # Name should be used to lookup number
|
||||
|
|
|
@ -3,21 +3,22 @@
|
|||
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
---
|
||||
- block:
|
||||
- name: Test an API key is provided
|
||||
fail:
|
||||
msg: Please define an API key
|
||||
when: auth_key is not defined
|
||||
|
||||
- name: Use an invalid domain
|
||||
meraki_organization:
|
||||
auth_key: '{{ auth_key }}'
|
||||
host: marrrraki.com
|
||||
state: present
|
||||
org_name: IntTestOrg
|
||||
output_level: debug
|
||||
delegate_to: localhost
|
||||
register: invalid_domain
|
||||
ignore_errors: yes
|
||||
# - name: Use an invalid domain
|
||||
# meraki_organization:
|
||||
# auth_key: '{{ auth_key }}'
|
||||
# host: marrrraki.com
|
||||
# state: present
|
||||
# org_name: IntTestOrg
|
||||
# output_level: debug
|
||||
# delegate_to: localhost
|
||||
# register: invalid_domain
|
||||
# ignore_errors: yes
|
||||
|
||||
- name: Disable HTTP
|
||||
meraki_organization:
|
||||
|
@ -32,7 +33,7 @@
|
|||
- name: Connection assertions
|
||||
assert:
|
||||
that:
|
||||
- '"Failed to connect to" in invalid_domain.msg'
|
||||
# - '"Failed to connect to" in invalid_domain.msg'
|
||||
- '"http" in http.url'
|
||||
|
||||
- name: Create test network
|
||||
|
@ -56,9 +57,6 @@
|
|||
delegate_to: localhost
|
||||
register: query_all
|
||||
|
||||
- debug:
|
||||
msg: '{{query_all}}'
|
||||
|
||||
- name: Enable and name SSID
|
||||
meraki_ssid:
|
||||
auth_key: '{{auth_key}}'
|
||||
|
@ -252,7 +250,7 @@
|
|||
- assert:
|
||||
that:
|
||||
- set_radius_server.data.radiusServers.0.host == '192.0.1.200'
|
||||
|
||||
always:
|
||||
- name: Delete SSID
|
||||
meraki_ssid:
|
||||
auth_key: '{{auth_key}}'
|
||||
|
|
Loading…
Reference in a new issue