mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-16 09:55:26 -07:00
zabbix: add validate certs param (#31739)
This commit is contained in:
parent
2087dc7384
commit
6984eecdb9
6 changed files with 74 additions and 10 deletions
|
@ -76,6 +76,9 @@ options:
|
|||
description:
|
||||
- The timeout of API request (seconds).
|
||||
default: 10
|
||||
|
||||
extends_documentation_fragment:
|
||||
- zabbix
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
|
@ -177,6 +180,7 @@ def main():
|
|||
login_password=dict(type='str', required=True, no_log=True),
|
||||
http_login_user=dict(type='str', required=False, default=None),
|
||||
http_login_password=dict(type='str', required=False, default=None, no_log=True),
|
||||
validate_certs=dict(type='bool', required=False, default=True),
|
||||
host_name=dict(type='str', required=True),
|
||||
macro_name=dict(type='str', required=True),
|
||||
macro_value=dict(type='str', required=True),
|
||||
|
@ -194,6 +198,7 @@ def main():
|
|||
login_password = module.params['login_password']
|
||||
http_login_user = module.params['http_login_user']
|
||||
http_login_password = module.params['http_login_password']
|
||||
validate_certs = module.params['validate_certs']
|
||||
host_name = module.params['host_name']
|
||||
macro_name = (module.params['macro_name']).upper()
|
||||
macro_value = module.params['macro_value']
|
||||
|
@ -203,7 +208,8 @@ def main():
|
|||
zbx = None
|
||||
# login to zabbix
|
||||
try:
|
||||
zbx = ZabbixAPIExtends(server_url, timeout=timeout, user=http_login_user, passwd=http_login_password)
|
||||
zbx = ZabbixAPIExtends(server_url, timeout=timeout, user=http_login_user, passwd=http_login_password,
|
||||
validate_certs=validate_certs)
|
||||
zbx.login(login_user, login_password)
|
||||
except Exception as e:
|
||||
module.fail_json(msg="Failed to connect to Zabbix server: %s" % e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue