diff --git a/changelogs/fragments/1307.yml b/changelogs/fragments/1307.yml new file mode 100644 index 000000000..1c4bb9886 --- /dev/null +++ b/changelogs/fragments/1307.yml @@ -0,0 +1,2 @@ +bugfixes: + - zabbix_agent, zabbix_proxy, and zabbix_server roles - Fixed problem with include file diff --git a/roles/zabbix_agent/tasks/Linux.yml b/roles/zabbix_agent/tasks/Linux.yml index 52870b7ba..d11324b70 100644 --- a/roles/zabbix_agent/tasks/Linux.yml +++ b/roles/zabbix_agent/tasks/Linux.yml @@ -130,7 +130,7 @@ - name: "Create include dir zabbix-agent" ansible.builtin.file: - path: "{{ zabbix_agent_include }}" + path: "{{ zabbix_agent_include_dir }}" owner: root group: zabbix mode: "{{ zabbix_agent_include_mode }}" diff --git a/roles/zabbix_agent/tasks/main.yml b/roles/zabbix_agent/tasks/main.yml index 2293199aa..8a82546ff 100644 --- a/roles/zabbix_agent/tasks/main.yml +++ b/roles/zabbix_agent/tasks/main.yml @@ -26,7 +26,7 @@ - name: Set Variables ansible.builtin.set_fact: - zabbix_agent_include: "{{ zabbix_agent_include is defined | ternary(zabbix_agent_include, _include) }}" + zabbix_agent_include_dir: "{{ zabbix_agent_include_dir is defined | ternary(zabbix_agent_include_dir, _include) }}" zabbix_agent_logfile: "{{ zabbix_agent_logfilee is defined | ternary(zabbix_agent_logfile, _logfile) }}" zabbix_agent_package: "{{ zabbix_agent_package is defined | ternary(zabbix_agent_package, _agent_package) }}" zabbix_agent_pidfile: "{{ zabbix_agent_pidfile is defined | ternary(zabbix_agent_pidfile, _pidfile) }}" @@ -35,6 +35,10 @@ zabbix_agent_tlsaccept: "{{ zabbix_agent_tlsaccept is defined | ternary(zabbix_agent_tlsaccept, 'unencrypted')}}" zabbix_agent_tlsconnect: "{{ zabbix_agent_tlsconnect is defined | ternary(zabbix_agent_tlsconnect, 'unencrypted')}}" +- name: Set Include Files + ansible.builtin.set_fact: + zabbix_agent_include: "{{ zabbix_agent_include is defined | ternary(zabbix_agent_include, zabbix_agent_include_dir + '/*.conf') }}" + - name: Setting Zabbix API Server Port ansible.builtin.set_fact: zabbix_api_server_port: "{{ '443' if zabbix_api_use_ssl|bool else '80' }}" diff --git a/roles/zabbix_proxy/defaults/main.yml b/roles/zabbix_proxy/defaults/main.yml index 001f893a9..c681bffab 100644 --- a/roles/zabbix_proxy/defaults/main.yml +++ b/roles/zabbix_proxy/defaults/main.yml @@ -58,7 +58,8 @@ zabbix_proxy_historycachesize: 16M zabbix_proxy_historyindexcachesize: 4M zabbix_proxy_hostname: "{{ inventory_hostname }}" zabbix_proxy_housekeepingfrequency: 1 -zabbix_proxy_include: /etc/zabbix/zabbix_proxy.conf.d/*.conf +zabbix_proxy_include_dir: /etc/zabbix/zabbix_proxy.conf.d +zabbix_proxy_include: "{{ zabbix_proxy_include_dir + '/*.conf' }}" zabbix_proxy_javagatewayport: 10052 zabbix_proxy_listenip: 0.0.0.0 zabbix_proxy_libdir: /usr/lib/zabbix diff --git a/roles/zabbix_proxy/tasks/main.yml b/roles/zabbix_proxy/tasks/main.yml index 1c1bafe24..c4b6aa64d 100644 --- a/roles/zabbix_proxy/tasks/main.yml +++ b/roles/zabbix_proxy/tasks/main.yml @@ -85,7 +85,7 @@ mode: "{{ item.mode | default('0755') }}" become: true loop: - - path: "{{ zabbix_proxy_include }}" + - path: "{{ zabbix_proxy_include_dir }}" mode: "{{ zabbix_proxy_include_mode }}" - path: "{{ zabbix_proxy_loadmodulepath }}" - required: "{{ zabbix_proxy_tlspskfile is defined }}" diff --git a/roles/zabbix_server/defaults/main.yml b/roles/zabbix_server/defaults/main.yml index bc8851061..8ac3fd878 100644 --- a/roles/zabbix_server/defaults/main.yml +++ b/roles/zabbix_server/defaults/main.yml @@ -56,7 +56,8 @@ zabbix_server_historyindexcachesize: 4M zabbix_server_historystoragedateindex: false zabbix_server_historystoragetypes: uint,dbl,str,log,text zabbix_server_housekeepingfrequency: 1 -zabbix_server_include: /etc/zabbix/zabbix_server.conf.d/*.conf +zabbix_server_include_dir: /etc/zabbix/zabbix_server.conf.d +zabbix_server_include: "{{ zabbix_server_include_dir + '/*.conf' }}" zabbix_server_javagatewayport: 10052 zabbix_server_listenip: 0.0.0.0 zabbix_server_listenport: 10051 diff --git a/roles/zabbix_server/tasks/main.yml b/roles/zabbix_server/tasks/main.yml index 533046504..339c74263 100644 --- a/roles/zabbix_server/tasks/main.yml +++ b/roles/zabbix_server/tasks/main.yml @@ -74,7 +74,7 @@ - name: "Create include dir zabbix-server" ansible.builtin.file: - path: "{{ zabbix_server_include }}" + path: "{{ zabbix_server_include_dir }}" owner: "{{ zabbix_os_user }}" group: "{{ zabbix_os_user }}" state: directory