You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
538 B
22 lines
538 B
5 years ago
|
---
|
||
|
|
||
|
- name: Check if a TLS PSK key exists
|
||
|
stat: path=/etc/zabbix/zabbix_agentd.psk
|
||
|
register: zbx_psk
|
||
|
tags: zabbix
|
||
|
|
||
|
- name: Generate random PSK key for TLS encryption
|
||
|
shell: openssl rand -hex 32 > /etc/zabbix/zabbix_agentd.psk
|
||
|
when:
|
||
|
- not zbx_psk.stat.exists
|
||
|
- zabbix_agent_encryption == "psk"
|
||
|
tags: zabbix
|
||
|
|
||
|
- name: Restrict permission on PSK file
|
||
|
file: path=/etc/zabbix/zabbix_agentd.psk owner=root group=zabbix mode=0640
|
||
|
when:
|
||
|
- not zbx_psk.stat.exists
|
||
|
- zabbix_agent_encryption == "psk"
|
||
|
tags: zabbix
|
||
|
|