Skip to content

Commit

Permalink
fixed agent config
Browse files Browse the repository at this point in the history
  • Loading branch information
pyrodie18 committed Jun 13, 2024
1 parent 5e2d3fc commit e34d505
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 deletions.
30 changes: 10 additions & 20 deletions roles/zabbix_agent/tasks/Linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion roles/zabbix_agent/templates/agent.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down

0 comments on commit e34d505

Please sign in to comment.