Debian Codegraph @

ansible_collections/community/zabbix/roles/zabbix_agent/tasks/psk_secret.yml

raw symbols SCIP
1 ---
2 - name: AutoPSK | read existing TLS PSK file
3 ansible.builtin.slurp:
4 src: "{{ zabbix_agent_tlspskfile }}"
5 when: zabbix_agent_tlspskcheck.stat.exists
6 no_log: "{{ ansible_verbosity < 3 }}"
7 register: zabbix_agent_tlspsk_base64
8 become: "{{ ansible_facts['os_family'] != 'Windows' }}"
9
10 - name: AutoPSK | Save Existing PSK Secret
11 ansible.builtin.set_fact:
12 zabbix_agent_tlspsk_read: "{{ zabbix_agent_tlspsk_base64['content'] | b64decode | trim }}"
13 when: zabbix_agent_tlspskcheck.stat.exists
14 no_log: "{{ ansible_verbosity < 3 }}"
15
16 - name: AutoPSK | Use Existing PSK Secret
17 ansible.builtin.set_fact:
18 zabbix_agent_tlspsk_secret: "{{ zabbix_agent_tlspsk_read }}"
19 when:
20 - zabbix_agent_tlspskcheck.stat.exists
21 - zabbix_agent_tlspsk_read | length >= 32
22 no_log: "{{ ansible_verbosity < 3 }}"
23
24 - name: AutoPSK | Generate New PSK Secret
25 ansible.builtin.set_fact:
26 zabbix_agent_tlspsk_secret: "{{ lookup('password', '/dev/null chars=hexdigits length=64') }}"
27 when:
28 - zabbix_agent_tlspsk_secret is undefined
29 - zabbix_agent_tlspsk_auto | bool
30 no_log: "{{ ansible_verbosity < 3 }}"