1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/setup_zabbix/tasks/setup.yml
Eike Frost ed376abe42 zabbix_host integration tests (#33184)
* Integration tests for zabbix_host using Zabbix on Ubuntu 14.04.

* fix duplicate yaml key in test

* .changed -> is changed, |failed -> is failed, trim configfile

* zabbix_host integration test does not need BOTMETA entry, inherited from module
2017-12-05 14:29:12 -05:00

48 lines
1.3 KiB
YAML

# sets up and starts Zabbix with default settings (works on Ubuntu 14.04,
# possibly more) using a MySQL database.
- name: create mysql user {{ db_user }}
mysql_user:
name: "{{ db_user }}"
password: "{{ db_password }}"
state: present
priv: "{{ db_name }}.*:ALL"
- name: install zabbix repository
apt: deb={{ zabbix_release_deb }} state=present
- name: install zabbix debian dependencies
apt: name={{ item }} state=latest update_cache=yes
with_items: "{{ zabbix_packages }}"
- name: install zabbix-api python package
pip:
name: zabbix-api
- name: import initial zabbix database
mysql_db:
name: "{{ db_name }}"
login_user: "{{ db_user }}"
login_password: "{{ db_password }}"
state: import
target: /usr/share/doc/zabbix-server-mysql/create.sql.gz
- name: deploy zabbix-server configuration
template:
src: zabbix_server.conf.j2
dest: /etc/zabbix/zabbix_server.conf
owner: zabbix
group: zabbix
mode: 0644
- name: deploy zabbix web frontend configuration
template:
src: zabbix.conf.php.j2
dest: /etc/zabbix/web/zabbix.conf.php
mode: 0644
- name: restart zabbix-server
service: name=zabbix-server state=restarted enabled=yes
- name: restart apache2
service: name=apache2 state=restarted enabled=yes