ansible-meraki icon indicating copy to clipboard operation
ansible-meraki copied to clipboard

meraki_static_route: Module does not query static routes

Open JT252 opened this issue 1 year ago • 4 comments

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

  • name: Delete static routes meraki_static_route: auth_key: abc123 state: absent org_name: YourOrg net_name: YourNet
    delegate_to: localhost

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

JT252 avatar May 06 '23 00:05 JT252

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 avatar May 22 '23 01:05 kbreit

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.

kbreit avatar May 22 '23 11:05 kbreit

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: @.***>

JT252 avatar May 22 '23 21:05 JT252

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.

kbreit avatar May 23 '23 01:05 kbreit