CiscoDevNet / ansible-meraki

Cisco Meraki Ansible Collection
GNU General Public License v3.0
60 stars 44 forks source link

meraki_static_route: Module does not query static routes #449

Open JT252 opened 1 year ago

JT252 commented 1 year ago

This command taken from the meraki_static_route module does not query the static route table.

This is what I get when I run the playbook:

ok: [localhost] => { "changed": false, "data": [], "invocation": { "module_args": { "auth_key": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "enabled": null, "fixed_ip_assignments": null, "follow_redirects": "all", "gateway_ip": null, "gateway_vlan_id": null, "host": "api.meraki.com", "internal_error_retry_time": 60, "name": null, "net_id": null, "net_name": "JT252", "org_id": null, "org_name": "JT252", "output_format": "snakecase", "output_level": "normal", "protocol": "https", "rate_limit_retry_time": 165, "reserved_ip_ranges": null, "route_id": null, "state": "query", "subnet": null, "timeout": 30, "use_https": true, "use_proxy": false, "validate_certs": true } }, "response": "OK (unknown bytes)", "status": 200

kbreit commented 1 year ago

Sorry about the delay getting back to you. The state should be query and not absent for the module to do the query. Does that resolve the problem?

kbreit commented 1 year ago

I think I see the problem you're referring to. It's using state even though it's setup for absent. Let me look into that further.

JT252 commented 1 year ago

Yes, thanks.

On Mon, May 22, 2023 at 7:56 AM Kevin Breit @.***> wrote:

I think I see the problem you're referring to. It's using state even though it's setup for absent. Let me look into that further.

— Reply to this email directly, view it on GitHub https://github.com/CiscoDevNet/ansible-meraki/issues/449#issuecomment-1557086259, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQAC37TDTENY43FX23WCVL3XHNH6ZANCNFSM6AAAAAAXXXR56Y . You are receiving this because you authored the thread.Message ID: @.***>

kbreit commented 1 year ago

I'm unable to reproduce this locally. Can you confirm the playbook and the output match? The integration test at https://github.com/CiscoDevNet/ansible-meraki/blob/7d3b2ce1ca812519eeb9a8fd9b0e25603b8dca70/tests/integration/targets/meraki_mx_static_route/meraki_static_route/tasks/main.yml#L116 seems to match your use case and appears to work as the next step outputs static route information.