CiscoDevNet/ansible-meraki

Meraki_Alert default_destinations http_server_id

nsn-amagruder opened this issue · 8 comments

The http_server_id isn't being configured using meraki_alert module. The email does get configured. I ran a query and can get the exact http_server_id. No error is returned, it just doesn't configure the WebHook in the default alerts.

  tasks:
    - name: Configure Meraki Alerts
      cisco.meraki.meraki_alert:
       org_name: OrgName
       net_name: NetNAMe
       state: present
       default_destinations:
         emails:
           - 'email@domain.com'
         http_server_ids:
           - 'http_server_idstring
         all_admins: yes
         snmp: no
      delegate_to: localhost

Results

  ],
        "default_destinations": {
            "all_admins": true,
            "emails": [
                "email@domain.com"
            ],
            "http_server_ids": [],
            "snmp": false
        }
    },
    "failed": false,
    "response": "OK (unknown bytes)",
    "status": 200

Thanks for reporting this. I took a quick look at the code and think I know why it is happening. I'll try to fix it this weekend. There are a few small things I need to fix across the collection but I should be able to do a new release over the next couple of weeks.

@nsn-amagruder Are you able to test #311? This should fix it.

@kbreit Appreciate the quick response. After figuring out how to add the repository and get it check out, I'm not sure if it is using the new files or not. I'm not aquatinted with git that well.

git fetch ciscodevnet
remote: Enumerating objects: 97, done.
remote: Counting objects: 100% (49/49), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 97 (delta 42), reused 47 (delta 42), pack-reused 48
Unpacking objects: 100% (97/97), 15.14 KiB | 159.00 KiB/s, done.
From https://github.com/CiscoDevNet/ansible-meraki

  • [new branch] bugfix/capitalization -> ciscodevnet/bugfix/capitalization
  • [new branch] kbreit/whitespace -> ciscodevnet/kbreit/whitespace
  • [new branch] master -> ciscodevnet/master
  • [new branch] release-branch/1.0 -> ciscodevnet/release-branch/1.0
  • [new tag] v1.4.0 -> v1.4.0
  • [new tag] v1.3.2 -> v1.3.2

git status
On branch bugfixes/310-alert-webhook-fix

Look in plugins/modules for the module. In this case meraki_alert.py. Copy that over your collection module. If you're using the collection copy that over the older version that's I think in ~/.ansible. It's not the exact path but you should be able to drill down to find it pretty easily. Let me know if you can't figure it out and I'll try the actual steps.

@kbreit I guess I was making it more complicated that it had to be. I downloaded the new Meraki_alert.py file and replaced the other one. Same issue. It doesn't config the default Webhooks. I was checking the Meraki API v1 and it says the httpServerIds is the correct value. Not sure if this has anything to do with it or not. I tried updating the file with this in place of http_server_id. The API does return "http_server_ids": [], in the output.

https://developer.cisco.com/meraki/api-v1/#!update-network-alerts-settings

@nsn-amagruder I use snakecase and Meraki uses camel case so I spend a lot of conversion. Can you take a look at like 240 in the meraki_alert file that you believe is in use to confirm you're using the version in the PR? Paste that line in and I'll confirm. Thanks

@kbreit The ansible collection was installed in the base ./ansible directory as well as underneath python directory. I put it in the wrong place. It is working as expected. Thank you so much.

    "diff": {
        "after": {
            "default_destinations": {
                "http_server_ids": [
                    "fake_server_id"
                ]

I suspected the problem had to do with duplicate installs. It's bit me too. I'll merge and get a new release soon. Thanks for testing.