diff --git a/roles/zabbix_agent/tasks/Linux.yml b/roles/zabbix_agent/tasks/Linux.yml index 9aeb3c236..99af1374b 100644 --- a/roles/zabbix_agent/tasks/Linux.yml +++ b/roles/zabbix_agent/tasks/Linux.yml @@ -128,18 +128,6 @@ 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 }}" @@ -147,10 +135,9 @@ 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