58
58
- Can be used when I(event_source=trigger).
59
59
type: "bool"
60
60
default: true
61
+ notify_if_canceled:
62
+ description:
63
+ - Weather to notify when escalation is canceled.
64
+ - Can be used when I(event_source=trigger).
65
+ type: "bool"
66
+ default: true
61
67
esc_period:
62
68
type: str
63
69
description:
@@ -1151,6 +1157,7 @@ def _construct_parameters(self, **kwargs):
1151
1157
_params ["pause_suppressed" ] = "1" if kwargs ["pause_in_maintenance" ] else "0"
1152
1158
if LooseVersion (self ._zbx_api_version ) >= LooseVersion ("6.4" ):
1153
1159
_params ["pause_symptoms" ] = "1" if kwargs ["pause_symptoms" ] else "0"
1160
+ _params ["notify_if_canceled" ] = "1" if kwargs ["notify_if_canceled" ] else "0"
1154
1161
1155
1162
_params ["update_operations" ] = kwargs .get ("update_operations" )
1156
1163
if "update_operations" in _params and not isinstance (_params .get ("update_operations" , None ), type (None )):
@@ -1504,6 +1511,7 @@ class RecoveryOperations(Operations):
1504
1511
"""
1505
1512
Restructures the user defined recovery operations data to fit the Zabbix API requirements
1506
1513
"""
1514
+
1507
1515
def _construct_operationtype (self , operation ):
1508
1516
"""Construct operation type.
1509
1517
@@ -1572,6 +1580,7 @@ class AcknowledgeOperations(Operations):
1572
1580
"""
1573
1581
Restructures the user defined acknowledge operations data to fit the Zabbix API requirements
1574
1582
"""
1583
+
1575
1584
def _construct_operationtype (self , operation ):
1576
1585
"""Construct operation type.
1577
1586
@@ -2177,7 +2186,8 @@ def main():
2177
2186
["type" , "send_message" , ["send_to_users" , "send_to_groups" ], True ]
2178
2187
]
2179
2188
),
2180
- pause_symptoms = dict (type = "bool" , required = False , default = True )
2189
+ pause_symptoms = dict (type = "bool" , required = False , default = True ),
2190
+ notify_if_canceled = dict (type = "bool" , required = False , default = True )
2181
2191
))
2182
2192
module = AnsibleModule (
2183
2193
argument_spec = argument_spec ,
@@ -2202,6 +2212,7 @@ def main():
2202
2212
recovery_operations = module .params ["recovery_operations" ]
2203
2213
acknowledge_operations = module .params ["acknowledge_operations" ]
2204
2214
pause_symptoms = module .params ["pause_symptoms" ]
2215
+ notify_if_canceled = module .params ["notify_if_canceled" ]
2205
2216
2206
2217
zapi_wrapper = Zapi (module )
2207
2218
action = Action (module )
@@ -2227,7 +2238,8 @@ def main():
2227
2238
pause_in_maintenance = pause_in_maintenance ,
2228
2239
operations = ops .construct_the_data (operations , event_source ),
2229
2240
recovery_operations = recovery_ops .construct_the_data (recovery_operations ),
2230
- conditions = fltr .construct_the_data (eval_type , formula , conditions )
2241
+ conditions = fltr .construct_the_data (eval_type , formula , conditions ),
2242
+ notify_if_canceled = notify_if_canceled
2231
2243
)
2232
2244
2233
2245
if LooseVersion (zapi_wrapper ._zbx_api_version ) >= LooseVersion ("6.4" ):
@@ -2257,7 +2269,8 @@ def main():
2257
2269
pause_in_maintenance = pause_in_maintenance ,
2258
2270
operations = ops .construct_the_data (operations , event_source ),
2259
2271
recovery_operations = recovery_ops .construct_the_data (recovery_operations ),
2260
- conditions = fltr .construct_the_data (eval_type , formula , conditions )
2272
+ conditions = fltr .construct_the_data (eval_type , formula , conditions ),
2273
+ notify_if_canceled = notify_if_canceled
2261
2274
)
2262
2275
2263
2276
kwargs [argument_spec ["acknowledge_operations" ]["aliases" ][0 ]] = acknowledge_ops .construct_the_data (acknowledge_operations )
0 commit comments