diff --git a/roles/zabbix_agent/tasks/Linux.yml b/roles/zabbix_agent/tasks/Linux.yml index 779736aac..52870b7ba 100644 --- a/roles/zabbix_agent/tasks/Linux.yml +++ b/roles/zabbix_agent/tasks/Linux.yml @@ -150,26 +150,16 @@ - zabbix_agent2 | bool - zabbix_agent_package_remove -- name: test - block: - - name: "Make sure the zabbix-agent service is running" - ansible.builtin.service: - name: "{{ zabbix_agent_service }}" - state: started - enabled: true - become: true - when: - - not (zabbix_agent_docker | bool) - tags: - - service - rescue: - - name: get results - shell: - cmd: journalctl -xe - register: _res - - debug: - var: _res.content | b64decode - - fail: +- name: "Make sure the zabbix-agent service is running" + ansible.builtin.service: + name: "{{ zabbix_agent_service }}" + state: started + enabled: true + become: true + when: + - not (zabbix_agent_docker | bool) + tags: + - service - name: "Give zabbix-agent access to system.hw.chassis info" ansible.builtin.file: diff --git a/roles/zabbix_agent/templates/agent.conf.j2 b/roles/zabbix_agent/templates/agent.conf.j2 index da3b8e15e..21be06915 100644 --- a/roles/zabbix_agent/templates/agent.conf.j2 +++ b/roles/zabbix_agent/templates/agent.conf.j2 @@ -139,7 +139,7 @@ Plugins.{{ my_name }}.{{ param }}={{ value }} {{ (zabbix_agent_tlspskidentity is defined and zabbix_agent_tlspskidentity is not none) | ternary('', '# ') }}TLSPSKIdentity={{ zabbix_agent_tlspskidentity | default('') }} {{ (zabbix_agent_tlsservercertissuer is defined and zabbix_agent_tlsservercertissuer is not none) | ternary('', '# ') }}TLSServerCertIssuer={{ zabbix_agent_tlsservercertissuer | default('') }} {{ (zabbix_agent_tlsservercertsubject is defined and zabbix_agent_tlsservercertsubject is not none) | ternary('', '# ') }}TLSServerCertSubject={{ zabbix_agent_tlsservercertsubject | default('') }} -{{ (zabbix_agent_unsafeuserparameters is defined and zabbix_agent_unsafeuserparameters is not none) | ternary('', '# ') }}UnsafeUserParameters={{ zabbix_agent_unsafeuserparameters | default('') }} +{{ (zabbix_agent_unsafeuserparameters is defined and zabbix_agent_unsafeuserparameters is not none) | ternary('', '# ') }}UnsafeUserParameters={{ zabbix_agent_unsafeuserparameters | default (false) | ternary('1', '0') }} {% if not zabbix_agent2 and ansible_os_family != "Windows" %} {{ (zabbix_agent_runas_user is defined and zabbix_agent_runas_user is not none) | ternary('', '# ') }}User={{ zabbix_agent_runas_user | default('') }} {% endif %}