Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix zabbix_agent include_dir creation logic #1366

Merged
merged 1 commit into from
Aug 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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