Closed hiddenshadow21 closed 2 years ago
Same problem here, looks like something wrong on https://github.com/ansible-collections/community.zabbix/blob/e62cd33202a4e795f3d9cc179996680069748eff/plugins/modules/zabbix_action.py#L1333 or https://github.com/ansible-collections/community.zabbix/blob/e62cd33202a4e795f3d9cc179996680069748eff/plugins/modules/zabbix_action.py#L1338
Fixed proposed: https://github.com/ansible-collections/community.zabbix/pull/734
In your very first post I see in the module invocation media_type
set properly.
changed: [127.0.0.1] => {
"changed": true,
"invocation": {
"module_args": {
<snip>
"recovery_operations": [
{
"media_type": "Slack",
how is that possible without your PR?
The invocation of @hiddenshadow21 is done correctly. But https://github.com/ansible-collections/community.zabbix/blob/e62cd33202a4e795f3d9cc179996680069748eff/plugins/modules/zabbix_action.py#L1332-L1333
removes it before sending to the Zabbix api.
Ok, makes sense, thanks. I don't remember why I put this .pop()
code, we'll see how your tests are running.
SUMMARY
When recovery_operations
type
is set tosend_message
it always uses default media_type (All
). It ignoresmedia_type
property.ISSUE TYPE
COMPONENT NAME
Zabbix_action: recovery_operation
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT / Zabbix Version
TargetOS:
Ubuntu 20.04 LTS
Zabbix Version:6.0.6 LTS
STEPS TO REPRODUCE
Create action with recovery operation
type
set tosend_message
and specifymedia_type
EXPECTED RESULTS
Action is created with
operations
andrecovery_operations
sending messages using specified media.ACTUAL RESULTS
Action is created with
operations
using specified media butrecovery_operations
media_type
is set toAll
.