Skip to content

Commit

Permalink
Merge pull request #217 from bastelfreak/fix216
Browse files Browse the repository at this point in the history
Fix216
  • Loading branch information
rnelson0 committed May 13, 2016
2 parents f7a72d1 + 22329a0 commit f58bdb0
Show file tree
Hide file tree
Showing 33 changed files with 6 additions and 36 deletions.
2 changes: 1 addition & 1 deletion lib/puppet/provider/zabbix.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# encoding: utf-8
# zabbix provider type for puppet
# rubocop:disable Style/ClassAndModuleChildren
class Puppet::Provider::Zabbix < Puppet::Provider
# Require the zabbixapi gem
def self.require_zabbix
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/provider/zabbix_application/ruby.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'zabbix'))
Puppet::Type.type(:zabbix_application).provide(:ruby, parent: Puppet::Provider::Zabbix) do
def connect
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/provider/zabbix_host/ruby.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'zabbix'))
Puppet::Type.type(:zabbix_host).provide(:ruby, parent: Puppet::Provider::Zabbix) do
def create
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/provider/zabbix_hostgroup/ruby.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'zabbix'))
Puppet::Type.type(:zabbix_hostgroup).provide(:ruby, parent: Puppet::Provider::Zabbix) do
def connect
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/provider/zabbix_proxy/ruby.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'zabbix'))
Puppet::Type.type(:zabbix_proxy).provide(:ruby, parent: Puppet::Provider::Zabbix) do
def create
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/provider/zabbix_template/ruby.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'zabbix'))
Puppet::Type.type(:zabbix_template).provide(:ruby, parent: Puppet::Provider::Zabbix) do
def create
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/provider/zabbix_template_host/ruby.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'zabbix'))
Puppet::Type.type(:zabbix_template_host).provide(:ruby, parent: Puppet::Provider::Zabbix) do
def template_name
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/provider/zabbix_userparameters/ruby.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'zabbix'))
Puppet::Type.type(:zabbix_userparameters).provide(:ruby, parent: Puppet::Provider::Zabbix) do
def create
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/type/zabbix_application.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..'))
require 'puppet/util/zabbix'

Expand Down
1 change: 0 additions & 1 deletion lib/puppet/type/zabbix_host.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
Puppet::Type.newtype(:zabbix_host) do
ensurable do
defaultvalues
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/type/zabbix_hostgroup.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..'))
require 'puppet/util/zabbix'

Expand Down
1 change: 0 additions & 1 deletion lib/puppet/type/zabbix_proxy.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
Puppet::Type.newtype(:zabbix_proxy) do
ensurable do
defaultvalues
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/type/zabbix_template.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
Puppet::Type.newtype(:zabbix_template) do
ensurable do
defaultvalues
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/type/zabbix_template_host.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..'))
require 'puppet/util/zabbix'

Expand Down
1 change: 0 additions & 1 deletion lib/puppet/type/zabbix_userparameters.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..'))
Puppet::Type.newtype(:zabbix_userparameters) do
ensurable do
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/util/zabbix.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
# this module adds additional params to a puppet type
module Puppet::Util::Zabbix # rubocop:disable Style/ClassAndModuleChildren
def self.add_zabbix_type_methods(type)
Expand Down
3 changes: 1 addition & 2 deletions manifests/agent.pp
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,7 @@
# is set to for example "eth1" or "bond0.73".
if ($listenip != undef) {
if ($listenip =~ /^(eth|bond|lxc|eno|tap|tun).*/) {
$int_name = "ipaddress_${listenip}"
$listen_ip = inline_template('<%= scope.lookupvar(int_name) %>')
$int_name = getvar("::ipaddress_${listenip}")
} elsif is_ip_address($listenip) or $listenip == '*' {
$listen_ip = $listenip
} else {
Expand Down
3 changes: 1 addition & 2 deletions manifests/proxy.pp
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,7 @@
# is set to for example "eth1" or "bond0.73".
if ($listenip != undef) {
if ($listenip =~ /^(eth|bond|lxc|eno|tap|tun).*/) {
$int_name = "ipaddress_${listenip}"
$listen_ip = inline_template('<%= scope.lookupvar(int_name) %>')
$int_name = getvar("::ipaddress_${listenip}")
} elsif is_ip_address($listenip) {
$listen_ip = $listenip
} else {
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
{
"name": "puppetlabs/stdlib",
"version_requirement": ">= 4.1.0"
"version_requirement": ">= 4.4.0"
},
{
"name": "puppetlabs/mysql",
Expand Down
1 change: 0 additions & 1 deletion spec/classes/agent_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
require 'spec_helper'

describe 'zabbix::agent' do
Expand Down
1 change: 0 additions & 1 deletion spec/classes/coverage_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
require 'rspec-puppet'

at_exit { RSpec::Puppet::Coverage.report! }
1 change: 0 additions & 1 deletion spec/classes/database_mysql_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
require 'spec_helper'

describe 'zabbix::database::mysql' do
Expand Down
1 change: 0 additions & 1 deletion spec/classes/database_postgresql_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
require 'spec_helper'

describe 'zabbix::database::postgresql' do
Expand Down
1 change: 0 additions & 1 deletion spec/classes/database_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
require 'spec_helper'

describe 'zabbix::database' do
Expand Down
1 change: 0 additions & 1 deletion spec/classes/javagateway_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
require 'spec_helper'

describe 'zabbix::javagateway' do
Expand Down
1 change: 0 additions & 1 deletion spec/classes/proxy_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
require 'spec_helper'

describe 'zabbix::proxy' do
Expand Down
1 change: 0 additions & 1 deletion spec/classes/repo_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
require 'spec_helper'

describe 'zabbix::repo' do
Expand Down
1 change: 0 additions & 1 deletion spec/classes/sender_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
require 'spec_helper'

describe 'zabbix::sender' do
Expand Down
1 change: 0 additions & 1 deletion spec/classes/server_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
require 'spec_helper'

describe 'zabbix::server' do
Expand Down
1 change: 0 additions & 1 deletion spec/classes/userparameter_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
require 'spec_helper'

describe 'zabbix::userparameter' do
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/web_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
require 'spec_helper'

def package_provider_for_gems
Expand Down Expand Up @@ -117,7 +116,8 @@ def package_provider_for_gems
database_name: 'zabbix-server',
database_user: 'zabbix-server',
database_password: 'zabbix-server',
zabbix_server: 'localhost')
zabbix_server: 'localhost'
)
end

it { should contain_file('/etc/zabbix/web/zabbix.conf.php').with_content(/^\$DB\['SERVER'\] = 'localhost'/) }
Expand Down
1 change: 0 additions & 1 deletion spec/defines/userparameters_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
require 'spec_helper'

describe 'zabbix::userparameters', type: :define do
Expand Down
1 change: 0 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# encoding: utf-8
require 'puppetlabs_spec_helper/module_spec_helper'
require 'rspec-puppet-facts'
include RspecPuppetFacts

0 comments on commit f58bdb0

Please sign in to comment.