Skip to content

Commit

Permalink
fix(fedora): get all fedora instances working (2018.3+)
Browse files Browse the repository at this point in the history
* Semi-automated using myii/ssf-formula#143

BREAKING CHANGE: Minimum Salt version support is now `2018.3` in line
with official upstream support; also use of the `traverse` Jinja filter.
  • Loading branch information
myii committed Mar 31, 2020
1 parent 74bb032 commit 32ef0e6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- env: INSTANCE=default-debian-10-master-py3
# - env: INSTANCE=default-ubuntu-1804-master-py3
# - env: INSTANCE=default-centos-8-master-py3
# - env: INSTANCE=default-fedora-31-master-py3
- env: INSTANCE=default-fedora-31-master-py3
# - env: INSTANCE=default-opensuse-leap-151-master-py3
# - env: INSTANCE=default-amazonlinux-2-master-py3
# - env: INSTANCE=default-arch-base-latest-master-py2
Expand Down
4 changes: 2 additions & 2 deletions FORMULA
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ os: Debian, Ubuntu, Raspbian, RedHat, Fedora, CentOS, FreeBSD, Windows
os_family: Debian, RedHat, FreeBSD, Windows
version: 0.21.4
release: 1
minimum_version: 2015.8
minimum_version: 2018.3
summary: Formula for installing Zabbix
description: Formula for installing Zabbix
top_level_dir: zabbix
top_level_dir: zabbix
3 changes: 1 addition & 2 deletions test/integration/default/controls/services_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
impact 0.5
title 'should be running and enabled'

# Note: Checking the service for `zabbix-server` is not working yet on Fedora
services =
case platform[:name]
when 'fedora'
%w[zabbix-agent]
%w[zabbix-agent zabbix-server-mysql]
else
%w[zabbix-agent zabbix-server]
end
Expand Down
11 changes: 10 additions & 1 deletion zabbix/osmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@ Ubuntu: {}
Raspbian: {}

# os_family: RedHat
Fedora: {}
Fedora:
server:
service: zabbix-server-mysql
srv_user: 'zabbixsrv'
srv_group: 'zabbixsrv'
pidfile: /var/run/zabbixsrv/zabbix_server.pid
socketdir: /var/run/zabbixsrv
logfile: /var/log/zabbixsrv/zabbix_server.log
alertscriptspath: /usr/share/zabbix/alertscripts
externalscripts: /usr/share/zabbix/externalscripts
CentOS: {}
Amazon: {}

Expand Down
11 changes: 7 additions & 4 deletions zabbix/server/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
include:
- zabbix.users
{%- set srv_user = zabbix | traverse('server:srv_user', zabbix.user) %}
{%- set srv_group = zabbix | traverse('server:srv_group', zabbix.group) %}
zabbix-server:
pkg.installed:
- pkgs:
Expand All @@ -26,17 +29,17 @@ zabbix-server:
zabbix-server-logdir:
file.directory:
- name: {{ salt['file.dirname'](zabbix.server.logfile) }}
- user: {{ zabbix.user }}
- group: {{ zabbix.group }}
- user: {{ srv_user }}
- group: {{ srv_group }}
- dirmode: 755
- require:
- pkg: zabbix-server
zabbix-server-piddir:
file.directory:
- name: {{ salt['file.dirname'](zabbix.server.pidfile) }}
- user: {{ zabbix.user }}
- group: {{ zabbix.group }}
- user: {{ srv_user }}
- group: {{ srv_group }}
- dirmode: 755
- require:
- pkg: zabbix-server
Expand Down

0 comments on commit 32ef0e6

Please sign in to comment.