Skip to content

Commit

Permalink
Fixed problem with include file
Browse files Browse the repository at this point in the history
  • Loading branch information
pyrodie18 committed Jun 30, 2024
1 parent 28c4921 commit 23720e0
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 6 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/1307.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- zabbix_agent and zabbix_server roles - Fixed problem with include file
2 changes: 1 addition & 1 deletion roles/zabbix_agent/tasks/Linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
6 changes: 5 additions & 1 deletion roles/zabbix_agent/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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) }}"
Expand All @@ -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' }}"
Expand Down
3 changes: 2 additions & 1 deletion roles/zabbix_proxy/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion roles/zabbix_proxy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
3 changes: 2 additions & 1 deletion roles/zabbix_server/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion roles/zabbix_server/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 23720e0

Please sign in to comment.