Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Merot committed Oct 23, 2017
2 parents 964467b + 3b3bcd1 commit e4f0957
Show file tree
Hide file tree
Showing 16 changed files with 132 additions and 30 deletions.
29 changes: 17 additions & 12 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
This module has grown over time based on a range of contributions from
people using it. If you follow these contributing guidelines your patch
will likely make it into a release a little quicker.
will likely make it into a release a little more quickly.

## Contributing

Expand Down Expand Up @@ -65,6 +65,10 @@ add tests if you're adding new functionality. If you've not used
[rspec-puppet](http://rspec-puppet.com/) before then feel free to ask
about how best to test your new feature.

To run the linter, the syntax checker and the unit tests:

bundle exec rake test

To run your all the unit tests

bundle exec rake spec SPEC_OPTS='--format documentation'
Expand All @@ -73,10 +77,6 @@ To run a specific spec test set the `SPEC` variable:

bundle exec rake spec SPEC=spec/foo_spec.rb

To run the linter, the syntax checker and the unit tests:

bundle exec rake test

## Integration tests

The unit tests just check the code runs, not that it does exactly what
Expand All @@ -89,15 +89,20 @@ with:

bundle exec rake acceptance

This will run the tests on an Ubuntu 12.04 virtual machine. You can also
run the integration tests against Centos 6.6 with.
This will run the tests on the module's default nodeset. You can override the
nodeset used, e.g.,

BEAKER_set=centos-7-x64 bundle exec rake acceptance

There are default rake tasks for the various acceptance test modules, e.g.,

BEAKER_set=centos-66-x64 bundle exec rake acceptances
bundle exec rake beaker:centos-7-x64
bundle exec rake beaker:ssh:centos-7-x64

If you don't want to have to recreate the virtual machine every time you
can use `BEAKER_DESTROY=no` and `BEAKER_PROVISION=no`. On the first run you will
at least need `BEAKER_PROVISION` set to yes (the default). The Vagrantfile
for the created virtual machines will be in `.vagrant/beaker_vagrant_fies`.
If you don't want to have to recreate the virtual machine every time you can
use `BEAKER_destroy=no` and `BEAKER_provision=no`. On the first run you will at
least need `BEAKER_provision` set to yes (the default). The Vagrantfile for the
created virtual machines will be in `.vagrant/beaker_vagrant_files`.

The easiest way to debug in a docker container is to open a shell:

Expand Down
2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
modulesync_config_version: '1.1.0'
modulesync_config_version: '1.3.0'
10 changes: 10 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ AllCops:
- Gemfile
- Rakefile
- Guardfile
- Vagrantfile
Lint/ConditionPosition:
Enabled: True

Expand Down Expand Up @@ -530,3 +531,12 @@ Layout/IndentHeredoc:
# disable Yaml safe_load. This is needed to support ruby2.0.0 development envs
Security/YAMLLoad:
Enabled: false

# This affects hiera interpolation, as well as some configs that we push.
Style/FormatStringToken:
Enabled: false

# This is useful, but sometimes a little too picky about where unit tests files
# are located.
RSpec/FilePath:
Enabled: false
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ matrix:
- rvm: 2.1.9
bundler_args: --without system_tests development
env: PUPPET_VERSION="~> 4.0" CHECK=test
- rvm: 2.4.1
- rvm: 2.4.2
bundler_args: --without system_tests development
env: PUPPET_VERSION="~> 5.0" CHECK=test
- rvm: 2.4.1
env: PUPPET_VERSION="~> 5.0" CHECK=test_with_coveralls
- rvm: 2.4.2
bundler_args: --without system_tests development
env: PUPPET_VERSION="~> 5.0" CHECK=rubocop
- rvm: 2.4.1
- rvm: 2.4.2
bundler_args: --without system_tests development
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
- rvm: 2.4.1
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@ All notable changes to this project will be documented in this file.
Each new release typically also includes the latest modulesync defaults.
These should not affect the functionality of the module.

## [v5.0.1](https://github.com/voxpupuli/puppet-zabbix/tree/v5.0.1) (2017-10-21)
[Full Changelog](https://github.com/voxpupuli/puppet-zabbix/compare/v5.0.0...v5.0.1)

**Fixed bugs:**

- add selinux workaround for IPC in zabbix-server3.4 [\#459](https://github.com/voxpupuli/puppet-zabbix/pull/459) ([bastelfreak](https://github.com/bastelfreak))
- Remove updateExisting from applications in zabbix template provider. [\#450](https://github.com/voxpupuli/puppet-zabbix/pull/450) ([breaker1](https://github.com/breaker1))
- Add missing proxy\_mode variable to zabbix\_proxy provider [\#447](https://github.com/voxpupuli/puppet-zabbix/pull/447) ([breaker1](https://github.com/breaker1))

**Closed issues:**

- Zabbix API errors when adding Templates in Zabbix 3.4 v2 [\#449](https://github.com/voxpupuli/puppet-zabbix/issues/449)
- Zabbix API errors when adding Templates in Zabbix 3.4 [\#446](https://github.com/voxpupuli/puppet-zabbix/issues/446)
- SenderFrequency parameter is deprecated in Zabbix 3.4 [\#437](https://github.com/voxpupuli/puppet-zabbix/issues/437)

**Merged pull requests:**

- Changed image to images in template provider. [\#448](https://github.com/voxpupuli/puppet-zabbix/pull/448) ([breaker1](https://github.com/breaker1))

## [v5.0.0](https://github.com/voxpupuli/puppet-zabbix/tree/v5.0.0) (2017-09-17)
[Full Changelog](https://github.com/voxpupuli/puppet-zabbix/compare/v4.1.3...v5.0.0)

Expand All @@ -19,6 +38,10 @@ These should not affect the functionality of the module.
- Syntax Error at line 82 in file init.pp [\#423](https://github.com/voxpupuli/puppet-zabbix/issues/423)
- pg\_hba problems in zabbix::database [\#411](https://github.com/voxpupuli/puppet-zabbix/issues/411)

**Merged pull requests:**

- release 5.0.0 [\#444](https://github.com/voxpupuli/puppet-zabbix/pull/444) ([bastelfreak](https://github.com/bastelfreak))

## [v4.1.3](https://github.com/voxpupuli/puppet-zabbix/tree/v4.1.3) (2017-06-26)
[Full Changelog](https://github.com/voxpupuli/puppet-zabbix/compare/v4.1.2...v4.1.3)

Expand Down
17 changes: 10 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def location_for(place, fake_version = nil)
end

group :test do
gem 'puppetlabs_spec_helper', '~> 2.2.0', :require => false
gem 'puppetlabs_spec_helper', '~> 2.4.0', :require => false
gem 'rspec-puppet', '~> 2.5', :require => false
gem 'rspec-puppet-facts', :require => false
gem 'rspec-puppet-utils', :require => false
Expand All @@ -22,18 +22,13 @@ group :test do
gem 'puppet-lint-unquoted_string-check', :require => false
gem 'puppet-lint-variable_contains_upcase', :require => false
gem 'metadata-json-lint', :require => false
gem 'puppet-blacksmith', :require => false
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem'
gem 'puppet-strings', '~> 1.0', :require => false
gem 'redcarpet', :require => false
gem 'rubocop', '~> 0.49.1', :require => false if RUBY_VERSION >= '2.3.0'
gem 'rubocop-rspec', '~> 1.15.0', :require => false if RUBY_VERSION >= '2.3.0'
gem 'mocha', '>= 1.2.1', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
gem 'github_changelog_generator', '~> 1.13.0', :require => false if RUBY_VERSION < '2.2.2'
gem 'rack', '~> 1.0', :require => false if RUBY_VERSION < '2.2.2'
gem 'github_changelog_generator', :require => false if RUBY_VERSION >= '2.2.2'
gem 'parallel_tests', :require => false
gem 'fakefs', :require => false
end
Expand All @@ -46,6 +41,7 @@ group :development do
end

group :system_tests do
gem 'winrm', :require => false
if beaker_version = ENV['BEAKER_VERSION']
gem 'beaker', *location_for(beaker_version)
end
Expand All @@ -59,12 +55,19 @@ group :system_tests do
gem 'beaker-module_install_helper', :require => false
end

group :release do
gem 'github_changelog_generator', :require => false if RUBY_VERSION >= '2.2.2'
gem 'puppet-blacksmith', :require => false
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem'
gem 'puppet-strings', '~> 1.0', :require => false
end



if facterversion = ENV['FACTER_GEM_VERSION']
gem 'facter', facterversion.to_s, :require => false, :groups => [:test]
else
gem 'facter', :require => false, :groups => [:test]
gem 'facter', :require => false, :groups => [:test]
end

ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 5.0' : puppetversion = ENV['PUPPET_VERSION'].to_s
Expand Down
14 changes: 14 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ task test: [
:release_checks,
]

desc "Run main 'test' task and report merged results to coveralls"
task test_with_coveralls: [:test] do
if Dir.exist?(File.expand_path('../lib', __FILE__))
require 'coveralls/rake/task'
Coveralls::RakeTask.new
Rake::Task['coveralls:push'].invoke
else
puts 'Skipping reporting to coveralls. Module has no lib dir'
end
end

begin
require 'github_changelog_generator/task'
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
Expand All @@ -39,6 +50,9 @@ begin
config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file.\nEach new release typically also includes the latest modulesync defaults.\nThese should not affect the functionality of the module."
config.exclude_labels = %w{duplicate question invalid wontfix wont-fix modulesync skip-changelog}
config.user = 'voxpupuli'
metadata_json = File.join(File.dirname(__FILE__), 'metadata.json')
metadata = JSON.load(File.read(metadata_json))
config.project = metadata['name']
end
rescue LoadError
end
Expand Down
14 changes: 14 additions & 0 deletions files/zabbix-server-ipc.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module zabbix-server-ipc 1.0;

require {
type tmp_t;
type zabbix_t;
class sock_file { create write };
class unix_stream_socket connectto;
}

#============= zabbix_t ==============

allow zabbix_t self:unix_stream_socket connectto;

allow zabbix_t tmp_t:sock_file { create write };
4 changes: 4 additions & 0 deletions lib/puppet/provider/zabbix_proxy/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ def create
# Set some vars
host = @resource[:hostname]
ipaddress = @resource[:ipaddress]

# Normally 0 is active and 1 is passive, in the API, its 5 and 6
proxy_mode = @resource[:mode] + 5

use_ip = @resource[:use_ip]
port = @resource[:port]
templates = @resource[:templates]
Expand Down
3 changes: 1 addition & 2 deletions lib/puppet/provider/zabbix_template/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ def create
format: 'xml',
rules: {
applications: {
createMissing: true,
updateExisting: true
createMissing: true
},
discoveryRules: {
createMissing: true,
Expand Down
9 changes: 9 additions & 0 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -566,5 +566,14 @@
source_te => 'puppet:///modules/zabbix/zabbix-server.te',
before => $dependency,
}
# zabbix-server 3.4 introduced IPC via a socket in /tmp
# https://support.zabbix.com/browse/ZBX-12567
if versioncmp($zabbix_version, '3.3') > 1 {
selinux::module{'zabbix-server-ipc':
ensure => 'present',
source_te => 'puppet:///modules/zabbix/zabbix-server-ips.te',
before => $dependency,
}
}
}
}
2 changes: 1 addition & 1 deletion manifests/web.pp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
$zabbixapi_version = '2.4.4'
}
default : {
$zabbixapi_version = '2.4.7'
$zabbixapi_version = '3.2.1'
}
}

Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppet-zabbix",
"version": "5.0.1-rc0",
"version": "5.0.2-rc0",
"summary": "Installing and maintaining Zabbix. Will install server, proxy, java-gateway and agent on RedHat/Debian/Ubuntu (Incl. exported resources).",
"author": "Vox Pupuli",
"dependencies": [
Expand Down
20 changes: 20 additions & 0 deletions spec/acceptance/nodesets/docker/debian-9.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/theforeman/foreman-installer-modulesync
HOSTS:
debian-9-x64:
platform: debian-9-amd64
hypervisor: docker
image: debian:9
docker_preserve_image: true
docker_cmd: '["/sbin/init"]'
docker_image_commands:
- 'apt-get update && apt-get install -y cron locales-all net-tools wget systemd-sysv'
- 'rm -f /usr/sbin/policy-rc.d'
- 'systemctl mask [email protected] getty-static.service'
CONFIG:
trace_limit: 200
masterless: true
...
# vim: syntax=yaml
2 changes: 2 additions & 0 deletions spec/acceptance/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class { 'zabbix::database': } ->
class { 'zabbix::server': }
EOS

shell('yum clean metadata') if fact('os.family') == 'RedHat'

# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
Expand Down
3 changes: 1 addition & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
require 'simplecov-console'
SimpleCov.formatters = [
SimpleCov::Formatter::HTMLFormatter,
SimpleCov::Formatter::Console,
Coveralls::SimpleCov::Formatter
SimpleCov::Formatter::Console
]
SimpleCov.start do
track_files 'lib/**/*.rb'
Expand Down

0 comments on commit e4f0957

Please sign in to comment.