69 lines
1.5 KiB
YAML
69 lines
1.5 KiB
YAML
---
|
|
# tasks file for wdijkerman.zabbix
|
|
|
|
- name: "Get Apache version"
|
|
action: shell apachectl -v | grep 'version' | awk -F '/' '{ print $2 }'| awk '{ print $1 }' | cut -c 1-3
|
|
register: apachectl_version
|
|
|
|
- name: "Set correct apache_version"
|
|
set_fact:
|
|
apache_version: "{{ apachectl_version.stdout }}"
|
|
|
|
- name: "Install the correct repository"
|
|
include: "RedHat.yml"
|
|
when: ansible_os_family == "RedHat"
|
|
tags:
|
|
- always
|
|
|
|
- name: "Install the correct repository"
|
|
include: "Debian.yml"
|
|
when: ansible_os_family == "Debian"
|
|
tags:
|
|
- always
|
|
|
|
- name: "Installing the postgresql database"
|
|
include: "postgresql.yml"
|
|
when: database_type_long == "postgresql"
|
|
tags:
|
|
- always
|
|
|
|
- name: "Installing the mysql database"
|
|
include: "mysql.yml"
|
|
when: database_type_long == "mysql"
|
|
tags:
|
|
- always
|
|
|
|
- name: "Configure zabbix-server"
|
|
template: src=zabbix_server.conf.j2
|
|
dest=/etc/zabbix/zabbix_server.conf
|
|
owner=zabbix
|
|
group=zabbix
|
|
mode=0644
|
|
notify: zabbix-server restarted
|
|
tags:
|
|
- zabbix-server
|
|
- init
|
|
- config
|
|
|
|
- name: "Create include dir zabbix-server"
|
|
file: path={{ server_include }}
|
|
owner=zabbix
|
|
group=zabbix
|
|
state=directory
|
|
mode=0644
|
|
tags:
|
|
- zabbix-server
|
|
- init
|
|
- config
|
|
|
|
- name: "Configure zabbix-web"
|
|
template: src=zabbix.conf.php.j2
|
|
dest=/etc/zabbix/web/zabbix.conf.php
|
|
owner=zabbix
|
|
group=zabbix
|
|
mode=0644
|
|
tags:
|
|
- zabbix-server
|
|
- init
|
|
- config
|