Skip to content
Snippets Groups Projects
Commit 28e73013 authored by Lars Beckers's avatar Lars Beckers
Browse files

basic zabbix role setup

parents
No related branches found
No related tags found
No related merge requests found
---
- name: restart zabbix agent
service: name=zabbix-agent state=restarted
---
dependencies:
- role: zabbix-repo
---
- name: ensure the agent package is installed
apt: name=zabbix-agent state=latest
notify:
- restart zabbix agent
tags:
- packages
- zabbix
# TODO
- name: ensure the agent is configured
template: src=zabbix_agentd.conf.j2 dest=/etc/zabbix/zabbix_agentd.conf
notify:
- restart zabbix agent
tags:
- zabbix
# TODO
#- name: create directory for external scripts
# file: path=/usr/local/lib/zabbix/externalscripts state=directory owner=root group=root mode=0755
# tags:
# - service
# - zabbix
# TODO e.g. disk i/o, smart, cups, ...
- name: ensure the server is enabled and running
service: name=zabbix-agent state=running enabled=yes
tags:
- service
- zabbix
- meta: flush_handlers
---
- name: restart zabbix frontend
service: name=zabbix-frontend state=restarted
---
dependencies:
- role: zabbix-repo
- role: webserver
- role: uwsgi-php
# TODO webserver fails ansible on initial deployment currently by purpose
---
- name: ensure the frontend package is installed
apt: name=zabbix-frontend-php state=latest
notify:
- restart zabbix frontend
tags:
- packages
- zabbix
# TODO configure frontend
# TODO create systemd/uwsgi unit and corresponding stuff
# TODO configure webserver
- name: ensure the frontend is enabled and running
service: name=zabbix-frontend state=running enabled=yes
tags:
- service
- zabbix
- meta: flush_handlers
---
dependencies:
- role: zabbix-repo
---
- name: update apt cache
apt: update_cache=yes
---
# this essentially does what zabbix-release does, but does not mitigate package signing
# TODO place file
# see: https://repo.zabbix.com/zabbix-official-repo.key
- name: ensure apt got the key to verify the zabbix repo
apt_key: data="{{ lookup('file', 'zabbix.gpg') }}" state=present
notify:
- update apt cache
tags:
- packages
- repos
- zabbix
- name: ensure apt knows about the zabbix repo
apt_repository: repo={{ item }} state=present
with_items:
- 'deb http://repo.zabbix.com/zabbix/3.0/debian jessie main'
- 'deb-src http://repo.zabbix.com/zabbix/3.0/debian jessie main'
notify:
- update apt cache
tags:
- packages
- repos
- zabbix
- meta: flush_handlers
---
- name: restart zabbix server
service: name=zabbix-server state=restarted
---
dependencies:
- role: zabbix-repo
---
- name: ensure the server package is installed
apt: name=zabbix-server-pgsql state=latest
notify:
- restart zabbix server
tags:
- packages
- zabbix
# TODO configure database connection
# TODO initialize database using (local?) sql files
# TODO configure completely
- name: ensure the server is enabled and running
service: name=zabbix-server state=running enabled=yes
tags:
- service
- zabbix
- meta: flush_handlers
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment