Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zabbix 5.0 testing changes #148

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 23 additions & 16 deletions ansible/roles/zabbix-server/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
when: ansible_distribution != "CentOS" or ansible_distribution_major_version != "7"

- name: Install Zabbix repository package
yum: name=http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm state=present
yum: name=https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm state=present

# https://support.zabbix.com/browse/ZBX-17371
- name: Import Zabbix repo key
Expand All @@ -17,13 +17,23 @@
state: present
name:
- zabbix-server-pgsql
- zabbix-web-pgsql
- zabbix-agent
- zabbix-get
- httpd
- centos-release-scl
- mod_ssl
- php-opcache
- libsemanage-python

- name: Enable Zabbix Frontend repo
command: yum-config-manager --enable zabbix-frontend

- name: Install Zabbix frontend packages
yum:
state: present
name:
- zabbix-web-pgsql-scl
- zabbix-apache-conf-scl

- name: Get Zabbix server version
shell: rpm -q --queryformat "%{VERSION}" zabbix-server-pgsql
register: zabbix_server_package
Expand All @@ -34,17 +44,17 @@
PGPASSWORD: "{{ zabbix_db_password }}"

- name: Modify PHP configuration for Zabbix
ini_file: dest=/etc/php.ini
section="{{ item.section | default('PHP') }}"
ini_file: dest=/etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
option="{{ item.option }}"
section="zabbix"
value="{{ item.value }}"
with_items:
- { option: max_execution_time, value: 300 }
- { option: memory_limit, value: 128M }
- { option: post_max_size, value: 16M }
- { option: upload_max_filesize, value: 2M }
- { option: max_input_time, value: 300 }
- { option: date.timezone, value: UTC, section: Date }
- { option: "php_value[max_execution_time]", value: 300 }
- { option: "php_value[memory_limit]", value: 128M }
- { option: "php_value[post_max_size]", value: 16M }
- { option: "php_value[upload_max_filesize]", value: 2M }
- { option: "php_value[max_input_time]", value: 300 }
- { option: "php_value[date.timezone]", value: UTC }

- name: Update /etc/zabbix/zabbix_server.conf
lineinfile: dest="/etc/zabbix/zabbix_server.conf"
Expand All @@ -64,11 +74,6 @@
owner=apache
group=apache

- name: Change default DocumentRoot in /etc/httpd/conf/httpd.conf
lineinfile: dest="/etc/httpd/conf/httpd.conf"
regexp='^DocumentRoot'
line='DocumentRoot "/usr/share/zabbix"'

- name: Create externalscripts and alertscripts symlinks in /etc/zabbix
file: src="/usr/lib/zabbix/{{ item }}"
dest="/etc/zabbix/{{ item }}"
Expand All @@ -90,3 +95,5 @@
with_items:
- httpd
- zabbix-server
- zabbix-agent
- rh-php72-php-fpm