Skip to content

Commit

Permalink
feat: add suse support (applied suggestions from hatifnatt and myii)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghormoon committed Apr 16, 2021
1 parent 9778cd3 commit a245ec4
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ default-ubuntu-1604-master-py3: {extends: '.test_instance'}
# default-centos-7-master-py3: {extends: '.test_instance'}
# default-fedora-33-master-py3: {extends: '.test_instance'}
default-fedora-32-master-py3: {extends: '.test_instance'}
# default-opensuse-leap-152-master-py3: {extends: '.test_instance'}
default-opensuse-leap-152-master-py3: {extends: '.test_instance'}
# default-opensuse-tmbl-latest-master-py3: {extends: '.test_instance'}
# default-amazonlinux-2-master-py3: {extends: '.test_instance'}
# default-oraclelinux-8-master-py3: {extends: '.test_instance'}
Expand Down
2 changes: 2 additions & 0 deletions test/integration/default/controls/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
setting_dbsocket = '/var/run/mysqld/mysqld.sock'
when 'fedora'
server_file_group = 'zabbixsrv'
when 'suse'
setting_dbsocket = '/run/mysql/mysql.sock'
end

# TODO: Conditional content to consider for inclusion below
Expand Down
2 changes: 1 addition & 1 deletion zabbix/agent/repo.sls
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ include:
# Here we just add a requisite declaration to ensure correct order
extend:
zabbix_agent_repo:
{% if salt['grains.get']('os_family') == 'Debian' -%}
{% if salt['grains.get']('os_family') in ['Debian', 'Suse'] -%}
pkgrepo:
- require_in:
- pkg: zabbix-agent
Expand Down
2 changes: 1 addition & 1 deletion zabbix/frontend/repo.sls
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ include:
# Here we just add a requisite declaration to ensure correct order
extend:
zabbix_frontend_repo:
{% if salt['grains.get']('os_family') == 'Debian' -%}
{% if salt['grains.get']('os_family') in ['Debian', 'Suse'] -%}
pkgrepo:
- require_in:
- pkg: zabbix-frontend-php
Expand Down
46 changes: 46 additions & 0 deletions zabbix/osfamilymap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,52 @@ 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: /run/zabbix/zabbix_agentd.pid
logfile: /var/log/zabbix/zabbix_agentd.log
includes:
- /etc/zabbix/zabbix_agentd.d/*.conf
server:
pkgs:
- zabbix-server-mysql
service: zabbix-server
config: /etc/zabbix/zabbix_server.conf
dbsocket: /run/mysql/mysql.sock
pidfile: /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-mysql
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: /run/zabbix/zabbix_proxy.pid
logfile: /var/log/zabbix/zabbix_proxy.log
mysql:
pkgs:
- MySQL-python
pgsql:
pkgs:
- postgresql
sql_file: /usr/share/doc/packages/zabbix-server-pgsql/create.sql.gz


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
2 changes: 1 addition & 1 deletion zabbix/proxy/repo.sls
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ include:
# Here we just add a requisite declaration to ensure correct order
extend:
zabbix_proxy_repo:
{% if salt['grains.get']('os_family') == 'Debian' -%}
{% if salt['grains.get']('os_family') in ['Debian', 'Suse'] -%}
pkgrepo:
- require_in:
- pkg: zabbix-proxy
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' %}
{{ id_prefix }}_repo:
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 %}
2 changes: 1 addition & 1 deletion zabbix/server/repo.sls
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ include:
# Here we just add a requisite declaration to ensure correct order
extend:
zabbix_server_repo:
{% if salt['grains.get']('os_family') == 'Debian' -%}
{% if salt['grains.get']('os_family') in ['Debian', 'Suse'] -%}
pkgrepo:
- require_in:
- pkg: zabbix-server
Expand Down

0 comments on commit a245ec4

Please sign in to comment.