diff --git a/README.md b/README.md index cae965b..5885e0c 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ apache_access_log: {{ apache_base_dir}}/logs/access_log apache_php_socket: {{ apache_base_dir }}/php-fpm.sock apache_use_php: true apache_use_ssl: true +apache_use_zabbix: true - wether we install script to monitor certificate expiry date apache_use_certbot: true apache_stats: true apache_ssl_certificate: /etc/letsencrypt/live/{{ apache_server_name }}/cert.pem diff --git a/defaults/main.yml b/defaults/main.yml index e041c99..46fbdab 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -6,6 +6,7 @@ apache_access_log: "{{ apache_base_dir}}/logs/access_log" apache_php_socket: "{{ apache_base_dir }}/php-fpm.sock" apache_use_php: true apache_use_ssl: true +apache_use_zabbix: true apache_use_certbot: true apache_ssl_certificate: "/etc/letsencrypt/live/{{ apache_server_name }}/cert.pem" apache_ssl_chain: "/etc/letsencrypt/live/{{ apache_server_name }}/fullchain.pem" diff --git a/handlers/main.yml b/handlers/main.yml index 206ea9e..3aeb645 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -10,4 +10,9 @@ service: name: php73-php-fpm state: restarted - when: apache_restart \ No newline at end of file + when: apache_restart + +- name: restart zabbix_agentd + service: + name: zabbix-agent + state: restarted \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml index 928fe6e..4a6d73a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -52,4 +52,9 @@ - name: goaccess import_tasks: goaccess.yml when: apache_stats - tags: stats \ No newline at end of file + tags: stats + +- name: zabbix setup + import_tasks: zabbix.yml + when: apache_use_zabbix and apache_use_ssl + tags: zabbix, ssl \ No newline at end of file diff --git a/tasks/zabbix.yml b/tasks/zabbix.yml new file mode 100644 index 0000000..1356268 --- /dev/null +++ b/tasks/zabbix.yml @@ -0,0 +1,13 @@ +--- +- name: deploy zabbix lld script + copy: + src: lld_certlist.py + dest: /etc/zabbix/scripts + group: zabbix + mode: 0750 + +- name: deploy zabbix userparameter + copy: + dest: /etc/zabbix/zabbix_agentd.d/user_parameter_certificate_discovery.conf + content: "UserParameter=certificate.discovery,/etc/zabbix/scripts/lld_certlist.py" + notify: restart zabbix_agentd