Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cisco.meraki.meraki_switchport] Cannot change type from "type": "access" to "type": "open". #342

Open
y0rune opened this issue Jul 20, 2022 · 5 comments

Comments

@y0rune
Copy link
Contributor

y0rune commented Jul 20, 2022

Hello!
I saw when I set the "type": "access" I cannot change the "type": "open". I resolve it via GUI (manually change it in the port configuration) So I think it is a bug :D

TASK [Configure port SW_E0_10_3/46] ***************************************************************************************************************************************************
task path: /home/yorune/repo/wtt-infrastructure-meraki/playbooks/SW_E0_10.yml:1831
redirecting (type: modules) cisco.meraki.meraki_switchport to cisco.meraki.meraki_ms_switchport
ok: [localhost] => {"changed": false, "data": {"access_policy_number": 2, "access_policy_type": "Custom access policy", "allowed_vlans": "1,15,1055,1730", "enabled": true, "isolation_enabled": false, "link_negotiation": "Auto negotiate", "link_negotiation_capabilities": ["Auto negotiate", "1 Gigabit full duplex (forced)", "100 Megabit (auto)", "100 Megabit full duplex (forced)", "10 Megabit (auto)", "10 Megabit full duplex (forced)"], "name": "E1_AP_TEST", "poe_enabled": true, "port_id": "46", "port_schedule_id": null, "rstp_enabled": true, "stp_guard": "disabled", "tags": [], "type": "access", "udld": "Alert only", "vlan": 1, "voice_vlan": null}, "response": "OK (unknown bytes)", "status": 200}

TASK [Configure port SW_E0_10_3/46] ***************************************************************************************************************************************************
task path: /home/yorune/repo/wtt-infrastructure-meraki/playbooks/SW_E0_10.yml:1838
redirecting (type: modules) cisco.meraki.meraki_switchport to cisco.meraki.meraki_ms_switchport
fatal: [localhost]: FAILED! => {"changed": false, "msg": "HTTP error 400 - https://api.meraki.com/api/v1/devices/Q2YP-7MNT-ZMH3/switch/ports/46 - Trunk ports do not support user-defined Access Policies", "response": "OK (unknown bytes)", "status": 400}

Vars:

- AP_TYPE: trunk
- AP_POE: yes
- AP_ALLOWED_VLANS:
   - 1
   - 15
   - 1055
   - 1730
    - name: Configure port SW_E0_10_3/46
      cisco.meraki.meraki_switchport:
        auth_key: "{{ MERAKI_API_KEY }}"
        serial: "{{ SERIAL_SW_E0_10_3 }}"
        name: "E1_AP_198_TEST"
        state: query
        number: 46
        
    - name: Configure port SW_E0_10_3/46
      cisco.meraki.meraki_switchport:
        auth_key: "{{ MERAKI_API_KEY }}"
        serial: "{{ SERIAL_SW_E0_10_3 }}"
        name: "E1_AP_198_TEST"
        state: present
        number: 46
        type: "{{ AP_TYPE }}"
        allowed_vlans: "{{ AP_ALLOWED_VLANS }}"
        poe_enabled: "{{ AP_POE }}"
@y0rune y0rune changed the title Cannot change type from "type": "access" to "type": "open". [cisco.meraki.meraki_switchport] Cannot change type from "type": "access" to "type": "open". Jul 20, 2022
@kbreit
Copy link
Collaborator

kbreit commented Jul 21, 2022

@y0rune Interesting. To confirm, you're not setting any custom access policies correct?

@y0rune
Copy link
Contributor Author

y0rune commented Jul 21, 2022

I set the custom access policies as you can see in the yaml code:

[Getting current Configure port SW_E0_10_3/46]
ok: [localhost] => {"changed": false, "data": {"access_policy_number": 2, "access_policy_type": "Custom access policy", "allowed_vlans": "1,15,1055,1730" ... "status": 200}

But in the state: present I do not set any custom polices.

@y0rune
Copy link
Contributor Author

y0rune commented Jul 21, 2022

For example I set the port like this:
image

After that I would like to change it like was before so I would like to run the playbook with the configuration you saw above.

@kbreit
Copy link
Collaborator

kbreit commented Jul 22, 2022

I'm going to test this further but I want to confirm one detail. I do see your AP_TYPE variable is set to trunk which isn't compatible with access policies. Is your intention this port be a trunk port?

@y0rune
Copy link
Contributor Author

y0rune commented Jul 24, 2022

Yeah this is my intention. I would like to set it into a trunk port. So I think I should disable policy and after that apply the type trunk. So I believe it can be automated in the ansible :D
Thank you for your response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants