Skip to content

Commit

Permalink
Merge pull request #634 from SimonHoenscheid/simonhoenscheid_correct_…
Browse files Browse the repository at this point in the history
…fixtures_and_metadata

correct fixtures and metadata
  • Loading branch information
lbetz authored Oct 5, 2020
2 parents 1f12bac + 9209289 commit e78355a
Show file tree
Hide file tree
Showing 14 changed files with 64 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .bundle/config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
BUNDLE_JOBS: "4"
BUNDLE_PATH: ".vendor/bundle"
BUNDLE_PATH: "vendor/bundle"
BUNDLE_DISABLE_SHARED_GEMS: "true"
BUNDLE_BUILD: "--no-ri --no-rdoc"
BUNDLE_WITHOUT: "system_tests"
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ end

#move to .sync.yaml in the future
gem 'puppetlabs_spec_helper', '>= 2.0'
gem 'puppet-lint', '>= 2.0.0'
gem 'facter', '>= 2.4.0'
gem 'facterdb', '>= 1.0.0'
gem 'puppet-lint', '>= 2.4.2'
gem 'facter', '>= 2.5.1'
gem 'facterdb', '>= 1.4.0'
gem 'rspec-puppet-facts', '>= 1.6.0'
gem 'serverspec'
gem 'r10k'
Expand Down
12 changes: 6 additions & 6 deletions examples/example1/modules/profile/manifests/icinga2/api_agent.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
) {

class { 'icinga2':
confd => false,
features => ['mainlog'],
confd => false,
features => ['mainlog'],
}

# Feature: api
Expand All @@ -26,18 +26,18 @@

# Declaration
class { 'profile::icinga2::agent':
endpoints => {
'NodeName' => {},
endpoints => {
'NodeName' => {},
'satellite.example.org' => {
'host' => '172.16.2.11',
},
},
zones => {
'ZoneName' => {
'endpoints' => ['NodeName'],
'parent' => 'dmz',
'parent' => 'dmz',
},
'dmz' => {
'dmz' => {
'endpoints' => ['satellite.example.org'],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@
zone_name => 'dmz',
endpoints => {
'satellite.example.org' => {},
'master.example.org' => {
'master.example.org' => {
'host' => '172.16.1.11',
},
},
zones => {
'master' => {
'endpoints' => ['master.example.org'],
},
'dmz' => {
'dmz' => {
'endpoints' => ['satellite.example.org'],
'parent' => 'master',
},
Expand Down
24 changes: 12 additions & 12 deletions examples/example3/site/profile/manifests/backuppc/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@

# Icinga CheckCommand and Apply Rules
@@icinga2::object::checkcommand { 'backuppc':
import => [
import => [
'plugin-check-command',
],
command => [
command => [
'sudo', '-u', 'backuppc',
'PluginContribDir + /check_backuppc',
],
arguments => {
arguments => {
'-w' => '$backuppc_wtime$',
'-c' => '$backuppc_ctime$',
'-H' => {
'value' => '$backuppc_desired$',
'value' => '$backuppc_desired$',
'set_if' => '$backuppc_desired$',
},
'-x' => {
'value' => '$backuppc_exclude$',
'value' => '$backuppc_exclude$',
'set_if' => '$backuppc_exclude$',
},
'-V' => {
Expand All @@ -35,20 +35,20 @@
'set_if' => '$backuppc_statusonly$',
},
},
vars => {
vars => {
'backuppc_wtime' => '2',
'backuppc_ctime' => '4',
},
target => '/etc/icinga2/zones.d/global-templates/backuppc-command.conf',
target => '/etc/icinga2/zones.d/global-templates/backuppc-command.conf',
}

@@file { '/etc/icinga2/conf.d/services/backuppc.conf':
ensure => file,
owner => 'nagios',
group => 'nagios',
tag => 'icinga2::config::exported',
ensure => file,
owner => 'nagios',
group => 'nagios',
tag => 'icinga2::config::exported',
source => [
"puppet:///modules/1024/icinga/services/backuppc.conf",
'puppet:///modules/1024/icinga/services/backuppc.conf',
],
}
}
18 changes: 9 additions & 9 deletions examples/example3/site/profile/manifests/icinga/agent.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@
# The vars (set in the various nodes hiera files) are used to Apply Services
# to these hosts. (See profile::icinga::server)
@@::icinga2::object::host { $::fqdn:
display_name => $::fqdn,
address => $::ipaddress_eth0,
check_command => 'hostalive',
vars => hiera_hash('icinga_vars', {}),
target => "/etc/icinga2/zones.d/master/${::fqdn}.conf"
display_name => $::fqdn,
address => $::ipaddress_eth0,
check_command => 'hostalive',
vars => hiera_hash('icinga_vars', {}),
target => "/etc/icinga2/zones.d/master/${::fqdn}.conf"
}

# Create virtual resources for this agent node
@@::icinga2::object::endpoint { "$::fqdn":
host => "$::ipaddress_eth0",
@@::icinga2::object::endpoint { "${::fqdn}":
host => "${::ipaddress_eth0}",
}

@@::icinga2::object::zone { "$::fqdn":
endpoints => [ "$::fqdn", ],
@@::icinga2::object::zone { "${::fqdn}":
endpoints => [ "${::fqdn}", ],
parent => 'master',
}

Expand Down
30 changes: 15 additions & 15 deletions examples/example3/site/profile/manifests/icinga/applyrules.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,32 @@
# example's README on why this is the case.

file { '/etc/icinga2/conf.d/services/nginx.conf':
ensure => file,
owner => 'nagios',
group => 'nagios',
tag => 'icinga2::config::file',
ensure => file,
owner => 'nagios',
group => 'nagios',
tag => 'icinga2::config::file',
source => [
"puppet:///modules/1024/icinga/services/nginx.conf",
'puppet:///modules/1024/icinga/services/nginx.conf',
],
}

file { '/etc/icinga2/conf.d/services/postgres.conf':
ensure => file,
owner => 'nagios',
group => 'nagios',
tag => 'icinga2::config::file',
ensure => file,
owner => 'nagios',
group => 'nagios',
tag => 'icinga2::config::file',
source => [
"puppet:///modules/1024/icinga/services/postgres.conf",
'puppet:///modules/1024/icinga/services/postgres.conf',
],
}

file { '/etc/icinga2/conf.d/services/elasticsearch.conf':
ensure => file,
owner => 'nagios',
group => 'nagios',
tag => 'icinga2::config::file',
ensure => file,
owner => 'nagios',
group => 'nagios',
tag => 'icinga2::config::file',
source => [
"puppet:///modules/1024/icinga/services/elasticsearch.conf",
'puppet:///modules/1024/icinga/services/elasticsearch.conf',
],
}

Expand Down
2 changes: 2 additions & 0 deletions manifests/feature/elasticsearch.pp
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,13 @@
}

# The password parameter isn't parsed anymore.
# lint:ignore:variables_not_enclosed
if $password {
$_password = "-:\"${password}\""
} else {
$_password = undef
}
# lint:endignore

$attrs = {
host => $host,
Expand Down
3 changes: 2 additions & 1 deletion manifests/feature/icingadb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@
'present' => Class['::icinga2::service'],
default => undef,
}

# lint:ignore:variables_not_enclosed
# The password parameter isn't parsed anymore.
if $password {
$_password = "-:\"${password}\""
} else {
$_password = undef
}
# lint:endignore

# compose attributes
$attrs = {
Expand Down
2 changes: 2 additions & 0 deletions manifests/feature/idomysql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@
$attrs_ssl = { enable_ssl => $enable_ssl }
}

# lint:ignore:variables_not_enclosed
$attrs = {
host => $host,
port => $port,
Expand All @@ -272,6 +273,7 @@
cleanup => $cleanup,
categories => $categories,
}
# lint:endignore

# install additional package
if $ido_mysql_package_name and $manage_package {
Expand Down
3 changes: 2 additions & 1 deletion manifests/feature/idopgsql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
'present' => Class['::icinga2::service'],
default => undef,
}

# lint:ignore:variables_not_enclosed
$attrs = {
host => $host,
port => $port,
Expand All @@ -104,6 +104,7 @@
cleanup => $cleanup,
categories => $categories,
}
# lint:endignore

# install additional package
if $ido_pgsql_package_name and $manage_package {
Expand Down
2 changes: 2 additions & 0 deletions manifests/feature/influxdb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,14 @@
$attrs_ssl = { ssl_enable => $enable_ssl }
}

# lint:ignore:variables_not_enclosed
# The password parameter isn't parsed anymore.
if $password {
$_password = "-:\"${password}\""
} else {
$_password = undef
}
# lint:endignore

$attrs = {
host => $host,
Expand Down
2 changes: 2 additions & 0 deletions manifests/object/apiuser.pp
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,14 @@
Variant[String, Integer] $order = 30,
) {

# lint:ignore:variables_not_enclosed
# The password parameter isn't parsed anymore.
if $password {
$_password = "-:\"${password}\""
} else {
$_password = undef
}
# lint:endignore

# compose the attributes
$attrs = {
Expand Down
4 changes: 4 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
{
"name": "puppetlabs/concat",
"version_requirement": ">= 2.1.0 < 7.0.0"
},
{
"name": "icinga/icinga",
"version_requirement": ">= 0.1.3"
}
],
"operatingsystem_support": [
Expand Down

0 comments on commit e78355a

Please sign in to comment.