Skip to content
Closed
Show file tree
Hide file tree
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
9 changes: 4 additions & 5 deletions zabbix/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# vim: ft=yaml
---
zabbix:
version_repo: 2.2
version_repo: 5.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussion about setting v 5 as default is going on here #123

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree with this as part of the merge. While I agree it needs to happen, this should be in a different pull request.

user: zabbix
group: zabbix
home: /var/lib/zabbix
Expand All @@ -24,7 +24,7 @@ zabbix:
- /etc/zabbix/zabbix_agentd.d/
server:
pkgs:
- zabbix-server-mysql
- zabbix-server-pgsql
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't change global defaults and call it 'non breaking change'. Also I can't understand why you ever touch global defaults if you have Suse section in osfamilymap.yaml.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree with changing this portion of the defaults file altogether. There is a whole portion of this formula to deal with postgres instead of mysql. Mysql is still valid, and there is no reason to change this in the defaults.

- zabbix-get
service: zabbix-server
config: /etc/zabbix/zabbix_server.conf
Expand All @@ -36,18 +36,17 @@ zabbix:
dbname: zabbix
dbuser: zabbix
dbpassword: zabbix
dbsocket: /var/run/mysqld/mysqld.sock
dbsocket: ""
timeout: '4'
alertscriptspath: /usr/lib/zabbix/alertscripts
externalscripts: /usr/lib/zabbix/externalscripts
fpinglocation: /usr/bin/fping
fping6location: /usr/bin/fping6
logslowqueries: '3000'
frontend:
pkgs:
- zabbix-web-mysql
config: /etc/zabbix/web/zabbix.conf.php
dbtype: MYSQL
dbtype: POSTGRESQL
dbhost: localhost
dbname: zabbix
dbuser: zabbix
Expand Down
41 changes: 41 additions & 0 deletions zabbix/osfamilymap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,47 @@ RedHat:
pkgs:
- MySQL-python

Suse:
version_repo: 5.0
user: zabbix
group: zabbix
shell: /sbin/nologin
agent:
pkgs:
- zabbix-agent
service: zabbix-agent
config: /etc/zabbix/zabbix_agentd.conf
pidfile: /var/run/zabbix/zabbix_agentd.pid
logfile: /var/log/zabbix/zabbix_agentd.log
includes:
- /etc/zabbix/zabbix_agentd.d/*.conf
server:
pkgs:
- zabbix-server-pgsql
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You set package to PostgreSQL version.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unless mysql is not available in Suse, which I imagine it is, these changes need to be made in the zabbix.pgsql portion of the formula, or can be modified in your own pillar files.

service: zabbix-server
config: /etc/zabbix/zabbix_server.conf
dbsocket: /var/lib/mysql/mysql.sock
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But you don't set dbsocket to empty string as required for PostgreSQL DB type. Also you don't set dbtype: POSTGRESQL in frontend section below.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unless mysql is not available in Suse, which I imagine it is, these changes need to be made in the zabbix.pgsql portion of the formula, or can be modified in your own pillar files.

pidfile: /var/run/zabbix/zabbix_server.pid
logfile: /var/log/zabbix/zabbix_server.log
snmptrapperfile: /var/log/snmptrap/snmptrap.log
fpinglocation: /usr/sbin/fping
fping6location: /usr/sbin/fping
frontend:
pkgs:
- zabbix-web-pgsql
config: /etc/zabbix/web/zabbix.conf.php
proxy:
pkgs:
- zabbix-proxy-sqlite3
service: zabbix-proxy
config: /etc/zabbix/zabbix_proxy.conf
dbname: /var/lib/zabbix/zabbix_proxy.db
pidfile: /var/run/zabbix/zabbix_proxy.pid
logfile: /var/log/zabbix/zabbix_proxy.log
mysql:
pkgs:
- MySQL-python

FreeBSD:
version_repo: 2.2
user: zabbix
Expand Down
2 changes: 2 additions & 0 deletions zabbix/osfingermap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Amazon Linux AMI-2018: {}

# os: SUSE
Leap-15: {}
SLES-15: {}
SLES-12: {}

# os: FreeBSD
FreeBSD-12: {}
Expand Down
10 changes: 10 additions & 0 deletions zabbix/repo.sls
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@
- gpgcheck: 1
- gpgkey: https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-79EA5ED4
{%- elif salt['grains.get']('os_family') == 'Suse' %}
zabbix_repo:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id_prefix must be used in state id, otherwise there will be conflicts between id-s i.e. when Zabbix server and Zabbix agent will be installed simultaneously.

pkgrepo.managed:
- name: zabbix
- humanname: "Zabbix Official Repository"
- baseurl: https://repo.zabbix.com/zabbix/{{ zabbix.version_repo }}/sles/{{ grains['osmajorrelease'] }}/x86_64/
- gpgcheck: 1
- gpgkey: https://repo.zabbix.com/zabbix/{{ zabbix.version_repo }}/sles/{{ grains['osmajorrelease'] }}/x86_64/repodata/repomd.xml.key
- gpgautoimport: True
{%- else %}
{{ id_prefix }}_repo: {}
{%- endif %}