From 36221f37d0ffb5cb0bb8a5698340241c9e00345c Mon Sep 17 00:00:00 2001 From: Anton Dmitriev Date: Sat, 23 Nov 2024 21:12:03 +0200 Subject: [PATCH] fixes https://github.com/ansible/ansible/issues/84374 --- roles/zabbix_agent/defaults/main.yml | 4 ++-- roles/zabbix_agent/tasks/main.yml | 2 +- roles/zabbix_proxy/defaults/main.yml | 4 ++-- roles/zabbix_proxy/tasks/main.yml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/roles/zabbix_agent/defaults/main.yml b/roles/zabbix_agent/defaults/main.yml index 9f090a12c..ed0256714 100644 --- a/roles/zabbix_agent/defaults/main.yml +++ b/roles/zabbix_agent/defaults/main.yml @@ -64,8 +64,8 @@ zabbix_api_use_ssl: false zabbix_api_login_pass: !unsafe zabbix zabbix_api_validate_certs: false ansible_httpapi_pass: "{{ zabbix_api_login_pass }}" -ansible_httpapi_port: "{{ zabbix_api_server_port }}" -ansible_httpapi_validate_certs: "{{ zabbix_api_validate_certs }}" +ansible_httpapi_port: "{{ hostvars[inventory_hostname]['zabbix_api_server_port'] }}" +ansible_httpapi_validate_certs: "{{ hostvars[inventory_hostname]['zabbix_api_validate_certs'] }}" # API Related Variables zabbix_api_create_hostgroup: false diff --git a/roles/zabbix_agent/tasks/main.yml b/roles/zabbix_agent/tasks/main.yml index 889c77cfc..e6eef5439 100644 --- a/roles/zabbix_agent/tasks/main.yml +++ b/roles/zabbix_agent/tasks/main.yml @@ -103,7 +103,7 @@ vars: gather_facts: false ansible_user: "{{ zabbix_api_login_user }}" - ansible_httpapi_use_ssl: "{{ zabbix_api_use_ssl }}" + ansible_httpapi_use_ssl: "{{ hostvars[inventory_hostname]['zabbix_api_use_ssl'] }}" ansible_network_os: community.zabbix.zabbix ansible_connection: httpapi # Can't think of a way to make http_login_* vars be undefined -( diff --git a/roles/zabbix_proxy/defaults/main.yml b/roles/zabbix_proxy/defaults/main.yml index c681bffab..cbd21b561 100644 --- a/roles/zabbix_proxy/defaults/main.yml +++ b/roles/zabbix_proxy/defaults/main.yml @@ -121,8 +121,8 @@ zabbix_api_login_user: Admin zabbix_api_login_pass: !unsafe zabbix zabbix_api_validate_certs: false ansible_httpapi_pass: "{{ zabbix_api_login_pass }}" -ansible_httpapi_port: "{{ zabbix_api_server_port }}" -ansible_httpapi_validate_certs: "{{ zabbix_api_validate_certs }}" +ansible_httpapi_port: "{{ hostvars[inventory_hostname]['zabbix_api_server_port'] }}" +ansible_httpapi_validate_certs: "{{ hostvars[inventory_hostname]['zabbix_api_validate_certs'] }}" zabbix_api_timeout: 30 zabbix_api_create_proxy: false zabbix_proxy_state: present diff --git a/roles/zabbix_proxy/tasks/main.yml b/roles/zabbix_proxy/tasks/main.yml index 1d429c4cd..aa59e06b0 100644 --- a/roles/zabbix_proxy/tasks/main.yml +++ b/roles/zabbix_proxy/tasks/main.yml @@ -131,7 +131,7 @@ ansible_user: "{{ zabbix_api_login_user }}" ansible_network_os: community.zabbix.zabbix ansible_connection: httpapi - ansible_httpapi_use_ssl: "{{ zabbix_api_use_ssl }}" + ansible_httpapi_use_ssl: "{{ hostvars[inventory_hostname]['zabbix_api_use_ssl'] }}" http_login_user: "{{ zabbix_api_http_user | default(-42) }}" http_login_password: "{{ zabbix_api_http_password | default(-42) }}" community.zabbix.zabbix_proxy: