diff --git a/inventory/inventory.yml b/inventory/inventory.yml index 8b02597..39125e5 100644 --- a/inventory/inventory.yml +++ b/inventory/inventory.yml @@ -10,15 +10,19 @@ all: vm1: ansible_host: 192.168.56.2 ansible_ssh_private_key_file: .vagrant/machines/vm1/virtualbox/private_key + psk_key: 00fcb3f04e646dd9186717bb43f96aa829d01d497ea31254ca72a1ebe568aa96 vm2: ansible_host: 192.168.56.3 ansible_ssh_private_key_file: .vagrant/machines/vm2/virtualbox/private_key + psk_key: 2009df4793fbd2f4afd351b825e43e4a2463524fd64fd08c27c9e353f085c94f vm3: ansible_host: 192.168.56.4 ansible_ssh_private_key_file: .vagrant/machines/vm3/virtualbox/private_key + psk_key: 182e39bb63953f682347f717359a24621556d83516c54fff00e86dd8e9d89b45 vm4: ansible_host: 192.168.56.5 ansible_ssh_private_key_file: .vagrant/machines/vm4/virtualbox/private_key + psk_key: d8f5c88673de18afdde646ed3590fbe36d2951b9cfe8fac56e8b722115e791ee redhat: vars: ZBXDIR: '/etc' diff --git a/tasks/configure-zabbix_agent.yml b/tasks/configure-zabbix_agent.yml index ad80ddb..2b105ee 100644 --- a/tasks/configure-zabbix_agent.yml +++ b/tasks/configure-zabbix_agent.yml @@ -4,3 +4,9 @@ template: src=~/git/ansible_vagrant/templates/zabbix_agentd.conf.j2 dest={{ ZBXDIR }}/zabbix_agentd.conf backup=yes notify: - restart zabbix-agent + +- name: Zabbix Agent PSK fájl létrehozása + diff: yes + template: src=~/git/ansible_vagrant/templates/zabbix.psk.j2 dest={{ ZBXDIR }}/zabbix.psk backup=yes owner=zabbix group=zabbix mode=0640 + notify: + - restart zabbix-agent diff --git a/templates/zabbix_agentd.conf.j2 b/templates/zabbix_agentd.conf.j2 index 917c910..5aa2396 100644 --- a/templates/zabbix_agentd.conf.j2 +++ b/templates/zabbix_agentd.conf.j2 @@ -8,5 +8,8 @@ LogFileSize={{ ZBXLOGFILESIZE }} Server={{ ZBXSERVER }} ListenPort={{ ZBXAGENTPORT }} ListenIP={{ ZBXLISTENIP }} -ServerActive=127.0.0.1 -Hostname={{ inventory_hostname_short}} +Hostname={{ inventory_hostname_short }} +TLSConnect=psk +TLSAccept=psk +TLSPSKFile={{ ZBXDIR }}/zabbix.psk +TLSPSKIdentity={{ inventory_hostname_short }}