If there is more then one silencing for a given subscription and sensu_silence tries to figure out if a check is already silenced to remove the silencing later on, the code results in false positives. The API request to remove the check fails with 404 response code.
Summary
If there is more then one silencing for a given subscription and
sensu_silence
tries to figure out if a check is already silenced to remove the silencing later on, the code results in false positives. The API request to remove the check fails with 404 response code.Root cause for the issue can be found within this code path: https://github.com/ansible-collections/community.general/blob/4c4ef80ca9518792bc4e0551864a7929254a27a0/plugins/modules/sensu_silence.py#L145-L150
Given there is a silencing for a specific subscription and a check called
check="foo"
, but we want to remove a silencing forcheck=None
, the mentioned code results in a false positive, even if there is no silencing forcheck=None
. The original bug is to assume that there is only one silencing for a specific subscription and to use a generator to map all silencings into a dict with subscription as keys. https://github.com/ansible-collections/community.general/blob/4c4ef80ca9518792bc4e0551864a7929254a27a0/plugins/modules/sensu_silence.py#L145Issue Type
Bug Report
Component Name
sensu_silence
Ansible Version
6.6.0
Community.general Version
5.8.0
Configuration
No response
OS / Environment
Arch Linux
Steps to Reproduce
client:$HOSTNAME
Expected Results
Actual Results
Code of Conduct