diff --git a/docs/ZABBIX_AGENT_ROLE.md b/docs/ZABBIX_AGENT_ROLE.md index c49eb9c8e..3be1d1086 100644 --- a/docs/ZABBIX_AGENT_ROLE.md +++ b/docs/ZABBIX_AGENT_ROLE.md @@ -330,7 +330,7 @@ The following table lists all variables that are exposed to modify the configura | StartAgents | zabbix_agent_startagents | 3 | Agent Only | | StatusPort | zabbix_agent_statusport | 9999 | Agent 2 Only | | Timeout | zabbix_agent_timeout | 3 | | -| TLSAccept | zabbix_agent_tlsconnect | | | +| TLSAccept | zabbix_agent_tlsconnect | unencrypted | Is overridden with `zabbix_agent_tlspsk_auto` == True | | TLSCAFile | zabbix_agent_tlscafile | /etc/zabbix/tls_psk_auto.secret | | | TLSCertFile | zabbix_agent_tlscertfile | | | | TLSCipherAll | zabbix_agent_tlscipherall | | Agent on Linux Only | @@ -339,7 +339,7 @@ The following table lists all variables that are exposed to modify the configura | TLSCipherCert13 | zabbix_agent_tlsciphercert13 | | Agent on Linux Only | | TLSCipherPSK | zabbix_agent_tlscipherpsk | | Agent on Linux Only | | TLSCipherPSK13 | zabbix_agent_tlscipherpsk13 | | Agent on Linux Only | -| TLSConnect | zabbix_agent_tlsconnect | | | +| TLSConnect | zabbix_agent_tlsconnect | unencrypted | Is overridden with `zabbix_agent_tlspsk_auto` == True | | TLSCRLFile | zabbix_agent_tlscrlfile | | | | TLSKeyFile | zabbix_agent_tlskeyfile | | | | TLSPSKFile | zabbix_agent_tlspskfile | | | diff --git a/roles/zabbix_agent/tasks/main.yml b/roles/zabbix_agent/tasks/main.yml index ab42a76d0..00c1f61b3 100644 --- a/roles/zabbix_agent/tasks/main.yml +++ b/roles/zabbix_agent/tasks/main.yml @@ -32,6 +32,8 @@ zabbix_agent_pidfile: "{{ zabbix_agent_pidfile is defined | ternary(zabbix_agent_pidfile, _pidfile) }}" zabbix_agent_service: "{{ zabbix_agent_service is defined | ternary(zabbix_agent_service, _agent_service) }}" zabbix_agent_tls_subject: "{{ zabbix_agent_tls_subject is defined | ternary(zabbix_agent_tls_subject, _tls_subject) }}" + zabbix_agent_tlsaccept: "{{ zabbix_agent_tlsaccept is defined | ternary(zabbix_agent_tlsaccept, 'unencrypted')}}" + zabbix_agent_tlsconnect: "{{ zabbix_agent_tlsconnect is defined | ternary(zabbix_agent_tlsconnect, 'unencrypted')}}" - name: Setting Zabbix API Server Port ansible.builtin.set_fact: @@ -61,7 +63,7 @@ - config - name: Configure PSK - when: "zabbix_agent_tlsaccept == 'psk' or zabbix_agent_tlsconnect == 'psk'" + when: "( zabbix_agent_tlsaccept == 'psk' ) or (zabbix_agent_tlsconnect == 'psk')" block: - name: Gather PSK Secret Info ansible.builtin.include_tasks: psk_secret.yml