You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
monitor task fails when changing existing monitor and providing more "accepted_statuscodes" than it was originally created with or do nothing if decreasing the amount
#52
Open
MoGutzeit opened this issue
Jul 25, 2024
· 0 comments
Will work if it creates a new monitor but will fail if:
The monitor does already exist and
The monitor was originally created with two or less accepted statuscodes
TASK [MONITOR | Create or change Monitors] ***********
failed: [localhost] (item=mypage1.de) => {"ansible_loop_var": "item", "changed": false, "item": "mypage1.de", "msg": "Traceback (most recent call last):\n File \"/tmp/ansible_lucasheld.uptime_kuma.monitor_payload_48wj05n1/ansible_lucasheld.uptime_kuma.monitor_payload.zip/ansible_collections/lucasheld/uptime_kuma/plugins/modules/monitor.py\", line 578, in main\n File \"/tmp/ansible_lucasheld.uptime_kuma.monitor_payload_48wj05n1/ansible_lucasheld.uptime_kuma.monitor_payload.zip/ansible_collections/lucasheld/uptime_kuma/plugins/modules/monitor.py\", line 425, in run\n File \"/tmp/ansible_lucasheld.uptime_kuma.monitor_payload_48wj05n1/ansible_lucasheld.uptime_kuma.monitor_payload.zip/ansible_collections/lucasheld/uptime_kuma/plugins/module_utils/common.py\", line 28, in object_changed\n if value[i] != value2[i]:\nIndexError: list index out of range\n"}
When decreasing the amount of accepted statuscodes, it won't fail but just not try to change the status codes.
For example a monitor was created with 3 accepted codes and I try to change it to two:
When changing an existing monitor with more values in the list of "accepted_statuscodes" than it was created with, the module fails.
For example my playbook with the task:
Will work if it creates a new monitor but will fail if:
When decreasing the amount of accepted statuscodes, it won't fail but just not try to change the status codes.
For example a monitor was created with 3 accepted codes and I try to change it to two:
The module does not try and change the monitor.
The text was updated successfully, but these errors were encountered: