Skip to content

Commit

Permalink
Fix zabbix_agent include_dir creation logic (#1366)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPykavy authored Aug 9, 2024
1 parent 760b134 commit 6141221
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions roles/zabbix_agent/tasks/Linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,29 +128,16 @@
tags:
- config

- name: "Create include dir zabbix-agent"
ansible.builtin.file:
path: "{{ zabbix_agent_include_dir }}"
owner: root
group: zabbix
mode: "{{ zabbix_agent_include_mode }}"
state: directory
become: true
tags:
- config
when: zabbix_agent_include_dir is string

- name: "Create include dirs zabbix-agent"
ansible.builtin.file:
path: "{{ include_dir }}"
owner: root
group: zabbix
mode: "{{ zabbix_agent_include_mode }}"
state: directory
loop: "{{ zabbix_agent_include_dir | list }}" # To prevent errors, filter a string value as a list
loop: "{{ [zabbix_agent_include_dir] if zabbix_agent_include_dir is string else zabbix_agent_include_dir }}"
loop_control:
loop_var: 'include_dir'
when: zabbix_agent_include_dir is iterable
become: true
tags:
- config
Expand Down

0 comments on commit 6141221

Please sign in to comment.