Skip to content
This repository has been archived by the owner on Apr 16, 2018. It is now read-only.

Commit

Permalink
Update of commit as the feedback suggested in PR 196
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFlyingCorpse committed Apr 26, 2016
1 parent 6017def commit 26083ee
Show file tree
Hide file tree
Showing 47 changed files with 125 additions and 125 deletions.
2 changes: 1 addition & 1 deletion manifests/conf.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
$template = undef,
$options_hash = undef,
$ensure = present,
$target_dir = "${::icinga2::params::etcprefix}/conf.d",
$target_dir = "${::icinga2::config_dir}/conf.d",
$target_file_name = "${name}.conf",
$target_file_owner = $::icinga2::config_owner,
$target_file_group = $::icinga2::config_group,
Expand Down
64 changes: 32 additions & 32 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
# maintained directories
file {
[
$::icinga2::params::etcprefix,
"${::icinga2::params::etcprefix}/pki",
"${::icinga2::params::etcprefix}/scripts",
"${::icinga2::params::etcprefix}/features-available",
$::icinga2::config_dir,
"${::icinga2::config_dir}/pki",
"${::icinga2::config_dir}/scripts",
"${::icinga2::config_dir}/features-available",
]:
ensure => directory,
}

# TODO: temporary until we provide some default templates
file {
[
"${::icinga2::params::etcprefix}/conf.d",
"${::icinga2::config_dir}/conf.d",
]:
ensure => directory,
purge => $::icinga2::purge_confd,
Expand All @@ -35,54 +35,54 @@

file {
[
"${::icinga2::params::etcprefix}/features-enabled",
"${::icinga2::params::etcprefix}/objects",
"${::icinga2::params::etcprefix}/zones.d",
"${::icinga2::config_dir}/features-enabled",
"${::icinga2::config_dir}/objects",
"${::icinga2::config_dir}/zones.d",
]:
ensure => directory,
purge => $::icinga2::purge_configs,
recurse => $::icinga2::purge_configs,
force => $::icinga2::purge_configs,
}

file { "${::icinga2::params::etcprefix}/icinga2.conf":
file { "${::icinga2::config_dir}/icinga2.conf":
ensure => file,
content => template($::icinga2::config_template),
}

# maintained object directories
file {
[
"${::icinga2::params::etcprefix}/objects/hosts",
"${::icinga2::params::etcprefix}/objects/hostgroups",
"${::icinga2::params::etcprefix}/objects/services",
"${::icinga2::params::etcprefix}/objects/servicegroups",
"${::icinga2::params::etcprefix}/objects/users",
"${::icinga2::params::etcprefix}/objects/usergroups",
"${::icinga2::params::etcprefix}/objects/checkcommands",
"${::icinga2::params::etcprefix}/objects/notificationcommands",
"${::icinga2::params::etcprefix}/objects/eventcommands",
"${::icinga2::params::etcprefix}/objects/notifications",
"${::icinga2::params::etcprefix}/objects/timeperiods",
"${::icinga2::params::etcprefix}/objects/scheduleddowntimes",
"${::icinga2::params::etcprefix}/objects/dependencies",
"${::icinga2::params::etcprefix}/objects/perfdatawriters",
"${::icinga2::params::etcprefix}/objects/graphitewriters",
"${::icinga2::params::etcprefix}/objects/idomysqlconnections",
"${::icinga2::params::etcprefix}/objects/idopgsqlconnections",
"${::icinga2::params::etcprefix}/objects/livestatuslisteners",
"${::icinga2::params::etcprefix}/objects/statusdatawriters",
"${::icinga2::params::etcprefix}/objects/applys",
"${::icinga2::params::etcprefix}/objects/templates",
"${::icinga2::params::etcprefix}/objects/constants",
"${::icinga2::config_dir}/objects/hosts",
"${::icinga2::config_dir}/objects/hostgroups",
"${::icinga2::config_dir}/objects/services",
"${::icinga2::config_dir}/objects/servicegroups",
"${::icinga2::config_dir}/objects/users",
"${::icinga2::config_dir}/objects/usergroups",
"${::icinga2::config_dir}/objects/checkcommands",
"${::icinga2::config_dir}/objects/notificationcommands",
"${::icinga2::config_dir}/objects/eventcommands",
"${::icinga2::config_dir}/objects/notifications",
"${::icinga2::config_dir}/objects/timeperiods",
"${::icinga2::config_dir}/objects/scheduleddowntimes",
"${::icinga2::config_dir}/objects/dependencies",
"${::icinga2::config_dir}/objects/perfdatawriters",
"${::icinga2::config_dir}/objects/graphitewriters",
"${::icinga2::config_dir}/objects/idomysqlconnections",
"${::icinga2::config_dir}/objects/idopgsqlconnections",
"${::icinga2::config_dir}/objects/livestatuslisteners",
"${::icinga2::config_dir}/objects/statusdatawriters",
"${::icinga2::config_dir}/objects/applys",
"${::icinga2::config_dir}/objects/templates",
"${::icinga2::config_dir}/objects/constants",
]:
ensure => directory,
purge => $::icinga2::purge_configs,
recurse => $::icinga2::purge_configs,
force => $::icinga2::purge_configs,
}

file { "${::icinga2::params::etcprefix}/zones.conf":
file { "${::icinga2::config_dir}/zones.conf":
ensure => file,
content => template('icinga2/zones.conf.erb'),
}
Expand Down
2 changes: 1 addition & 1 deletion manifests/config/objectdir.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Class['icinga2::config'] ->
file { "icinga2 objectdir ${name}":
ensure => directory,
path => "${::icinga2::params::etcprefix}/objects/${name}",
path => "${::icinga2::config_dir}/objects/${name}",
owner => $::icinga2::config_owner,
group => $::icinga2::config_group,
mode => $::icinga2::config_mode,
Expand Down
8 changes: 4 additions & 4 deletions manifests/database.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
exec { 'mysql_schema_load':
user => 'root',
path => $::path,
command => "mysql -h '${::icinga2::db_host}' -u '${::icinga2::db_user}' -p'${::icinga2::db_pass}' '${::icinga2::db_name}' < '${db_schema}' && touch ${::icinga2::params::etcprefix}/mysql_schema_loaded.txt",
creates => "${::icinga2::params::etcprefix}/mysql_schema_loaded.txt",
command => "mysql -h '${::icinga2::db_host}' -u '${::icinga2::db_user}' -p'${::icinga2::db_pass}' '${::icinga2::db_name}' < '${db_schema}' && touch ${::icinga2::config_dir}/mysql_schema_loaded.txt",
creates => "${::icinga2::config_dir}/mysql_schema_loaded.txt",
}
}
elsif $::icinga2::db_type == 'pgsql' {
Expand All @@ -47,8 +47,8 @@
environment => [
"PGPASSWORD=${::icinga2::db_pass}",
],
command => "psql -U '${::icinga2::db_user}' -h '${::icinga2::db_host}' ${port} -d '${::icinga2::db_name}' < '${db_schema}' && touch ${::icinga2::params::etcprefix}/postgres_schema_loaded.txt",
creates => "${::icinga2::params::etcprefix}/postgres_schema_loaded.txt",
command => "psql -U '${::icinga2::db_user}' -h '${::icinga2::db_host}' ${port} -d '${::icinga2::db_name}' < '${db_schema}' && touch ${::icinga2::config_dir}/postgres_schema_loaded.txt",
creates => "${::icinga2::config_dir}/postgres_schema_loaded.txt",
}
}

Expand Down
6 changes: 3 additions & 3 deletions manifests/feature.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
Class['icinga2::config'] ->
file { "icinga2 feature ${name}":
ensure => file,
path => "${::icinga2::params::etcprefix}/features-available/${name}.conf",
path => "${::icinga2::config_dir}/features-available/${name}.conf",
content => $content_rel,
} ->
File["icinga2 feature ${name} enabled"]
Expand All @@ -42,8 +42,8 @@

file { "icinga2 feature ${name} enabled":
ensure => link,
path => "${::icinga2::params::etcprefix}/features-enabled/${name}.conf",
target => "${::icinga2::params::etcprefix}/features-available/${name}.conf",
path => "${::icinga2::config_dir}/features-enabled/${name}.conf",
target => "${::icinga2::config_dir}/features-available/${name}.conf",
}

if $::icinga2::manage_service {
Expand Down
6 changes: 3 additions & 3 deletions manifests/feature/api.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
class icinga2::feature::api (
$accept_commands = false,
$accept_config = false,
$ca_path = "${::icinga2::params::etcprefix}/pki/ca.crt",
$cert_path = "${::icinga2::params::etcprefix}/pki/${::fqdn}.crt",
$key_path = "${::icinga2::params::etcprefix}/pki/${::fqdn}.key",
$ca_path = "${::icinga2::config_dir}/pki/ca.crt",
$cert_path = "${::icinga2::config_dir}/pki/${::fqdn}.crt",
$key_path = "${::icinga2::config_dir}/pki/${::fqdn}.key",
$crl_path = undef,
$bind_host = undef,
$bind_port = undef,
Expand Down
2 changes: 1 addition & 1 deletion manifests/feature/debuglog.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
class icinga2::feature::debuglog (
$severity = 'debug',
$path = "${::icinga2::params::varprefix}/log/icinga2/debug.log"
$path = "${::icinga2::var_dir}/log/icinga2/debug.log"
) {

validate_string($severity)
Expand Down
2 changes: 1 addition & 1 deletion manifests/feature/graphite.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
enable_send_thresholds => $enable_send_thresholds,
enable_send_metadata => $enable_send_metadata,
enable_legacy_mode => $enable_legacy_mode,
target_dir => "${::icinga2::params::etcprefix}/features-available",
target_dir => "${::icinga2::config_dir}/features-available",
}

::icinga2::feature { 'graphite':
Expand Down
2 changes: 1 addition & 1 deletion manifests/feature/ido_mysql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
cleanup => $cleanup,
categories => $categories,
target_file_name => 'ido-mysql.conf',
target_dir => "${::icinga2::params::etcprefix}/features-available",
target_dir => "${::icinga2::config_dir}/features-available",
} ->

::icinga2::feature { 'ido-mysql':
Expand Down
2 changes: 1 addition & 1 deletion manifests/feature/ido_pgsql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
cleanup => $cleanup,
categories => $categories,
target_file_name => 'ido-pgsql.conf',
target_dir => "${::icinga2::params::etcprefix}/features-available",
target_dir => "${::icinga2::config_dir}/features-available",
} ->

::icinga2::feature { 'ido-pgsql':
Expand Down
2 changes: 1 addition & 1 deletion manifests/feature/mainlog.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
class icinga2::feature::mainlog (
$severity = 'information',
$path = "${::icinga2::params::varprefix}/log/icinga2/icinga2.log"
$path = "${::icinga2::var_dir}/log/icinga2/icinga2.log"
) {

validate_string($severity)
Expand Down
8 changes: 4 additions & 4 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
$db_schema_pgsql = $::icinga2::params::db_schema_pgsql,
$pid_file = $::icinga2::params::pid_file,
$restart_cmd = $::icinga2::params::restart_cmd,
$dirprefix = false,
$etcprefix = false,
$shareprefix = false,
$varprefix = false,
$dirprefix = $::icinga2::params::dirprefix,
$config_dir = $::icinga2::params::config_dir,
$share_dir = $::icinga2::params::share_dir,
$var_dir = $::icinga2::params::var_dir,
) inherits ::icinga2::params {
# TODO: temporary parameter until we provide some default templates
validate_bool($purge_confd)
Expand Down
2 changes: 1 addition & 1 deletion manifests/object/apiuser.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
$password = undef,
$client_cn = undef,
$permissions = ['*'],
$target_dir = "${::icinga2::params::etcprefix}/objects/apiusers",
$target_dir = "${::icinga2::config_dir}/objects/apiusers",
$file_name = "${name}.conf",
) {

Expand Down
2 changes: 1 addition & 1 deletion manifests/object/apply_dependency.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
$states = [],
$assign_where = undef,
$ignore_where = undef,
$target_dir = "${::icinga2::params::etcprefix}/objects/applys",
$target_dir = "${::icinga2::config_dir}/objects/applys",
$target_file_name = "${name}.conf",
$target_file_ensure = file,
$target_file_owner = $::icinga2::config_owner,
Expand Down
2 changes: 1 addition & 1 deletion manifests/object/apply_notification_to_host.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
$period = undef,
$types = [],
$states = [],
$target_dir = "${::icinga2::params::etcprefix}/objects/applys",
$target_dir = "${::icinga2::config_dir}/objects/applys",
$target_file_name = "${name}.conf",
$target_file_ensure = file,
$target_file_owner = $::icinga2::config_owner,
Expand Down
2 changes: 1 addition & 1 deletion manifests/object/apply_notification_to_service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
$period = undef,
$types = [],
$states = [],
$target_dir = "${::icinga2::params::etcprefix}/objects/applys",
$target_dir = "${::icinga2::config_dir}/objects/applys",
$target_file_name = "${name}.conf",
$target_file_ensure = file,
$target_file_owner = $::icinga2::config_owner,
Expand Down
2 changes: 1 addition & 1 deletion manifests/object/apply_scheduleddowntime.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
$ignore_where = undef,
$fixed = undef,
$duration = undef,
$target_dir = "${::icinga2::params::etcprefix}/objects/applys",
$target_dir = "${::icinga2::config_dir}/objects/applys",
$file_name = "${name}.conf",
) {

Expand Down
2 changes: 1 addition & 1 deletion manifests/object/apply_service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
$action_url = undef,
$icon_image = undef,
$icon_image_alt = undef,
$target_dir = "${::icinga2::params::etcprefix}/objects/applys",
$target_dir = "${::icinga2::config_dir}/objects/applys",
$target_file_name = "${name}.conf",
$target_file_ensure = file,
$target_file_owner = $::icinga2::config_owner,
Expand Down
2 changes: 1 addition & 1 deletion manifests/object/checkcommand.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
$refresh_icinga2_service = true,
$sudo = false,
$sudo_cmd = '/usr/bin/sudo',
$target_dir = "${::icinga2::params::etcprefix}/objects/checkcommands",
$target_dir = "${::icinga2::config_dir}/objects/checkcommands",
$target_file_ensure = file,
$target_file_group = $::icinga2::config_group,
$target_file_mode = $::icinga2::config_mode,
Expand Down
2 changes: 1 addition & 1 deletion manifests/object/checkresultreader.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
$ensure = 'file',
$object_checkresultreadername = $name,
$spool_dir = undef,
$target_dir = "${::icinga2::params::etcprefix}/objects/checkresultreaders",
$target_dir = "${::icinga2::config_dir}/objects/checkresultreaders",
$target_file_name = "${name}.conf",
$target_file_ensure = file,
$target_file_owner = $::icinga2::config_owner,
Expand Down
2 changes: 1 addition & 1 deletion manifests/object/compatlogger.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
$object_compatloggername = $name,
$log_dir = undef,
$rotation_method = undef,
$target_dir = "${::icinga2::params::etcprefix}/objects/compatloggers",
$target_dir = "${::icinga2::config_dir}/objects/compatloggers",
$target_file_name = "${name}.conf",
$target_file_ensure = file,
$target_file_owner = $::icinga2::config_owner,
Expand Down
2 changes: 1 addition & 1 deletion manifests/object/dependency.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
$disable_notifications = undef,
$period = undef,
$states = [],
$target_dir = "${::icinga2::params::etcprefix}/objects/dependencies",
$target_dir = "${::icinga2::config_dir}/objects/dependencies",
$target_file_name = "${name}.conf",
$target_file_ensure = file,
$target_file_owner = $::icinga2::config_owner,
Expand Down
2 changes: 1 addition & 1 deletion manifests/object/endpoint.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
$host = undef,
$port = undef,
$log_duration = undef,
$target_dir = "${::icinga2::params::etcprefix}/objects/endpoints",
$target_dir = "${::icinga2::config_dir}/objects/endpoints",
$file_name = "${name}.conf",
) {

Expand Down
2 changes: 1 addition & 1 deletion manifests/object/eventcommand.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
$env = {},
$vars = {},
$timeout = undef,
$target_dir = "${::icinga2::params::etcprefix}/objects/eventcommands",
$target_dir = "${::icinga2::config_dir}/objects/eventcommands",
$target_file_name = "${name}.conf",
$target_file_ensure = file,
$target_file_owner = $::icinga2::config_owner,
Expand Down
2 changes: 1 addition & 1 deletion manifests/object/gelfwriter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
$source = undef,
# Put the object files this defined type generates in features-available
# since the Gelf writer feature is one that has to be explicitly enabled.
$target_dir = "${::icinga2::params::etcprefix}/features-available",
$target_dir = "${::icinga2::config_dir}/features-available",
$file_name = "${name}.conf",
) {
# Do some validation
Expand Down
2 changes: 1 addition & 1 deletion manifests/object/graphitewriter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
$enable_legacy_mode = undef,
# Put the object files this defined type generates in features-available
# since the Graphite writer feature is one that has to be explicitly enabled.
$target_dir = "${::icinga2::params::etcprefix}/objects/graphitewriters",
$target_dir = "${::icinga2::config_dir}/objects/graphitewriters",
$file_name = "${name}.conf",
) {
# Do some validation
Expand Down
2 changes: 1 addition & 1 deletion manifests/object/host.pp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
$action_url = undef,
$icon_image = undef,
$icon_image_alt = undef,
$target_dir = "${::icinga2::params::etcprefix}/objects/hosts",
$target_dir = "${::icinga2::config_dir}/objects/hosts",
$target_file_name = "${name}.conf",
$target_file_ensure = file,
$target_file_owner = $::icinga2::config_owner,
Expand Down
2 changes: 1 addition & 1 deletion manifests/object/hostgroup.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
$display_name = $name,
$templates = [],
$groups = [],
$target_dir = "${::icinga2::params::etcprefix}/objects/hostgroups",
$target_dir = "${::icinga2::config_dir}/objects/hostgroups",
$target_file_name = "${name}.conf",
$target_file_ensure = file,
$target_file_owner = $::icinga2::config_owner,
Expand Down
2 changes: 1 addition & 1 deletion manifests/object/icingastatuswriter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
$object_name = $name,
$status_path = undef,
$update_interval = undef,
$target_dir = "${::icinga2::params::etcprefix}/objects/icingastatuswriters",
$target_dir = "${::icinga2::config_dir}/objects/icingastatuswriters",
$target_file_name = "${name}.conf",
$target_file_owner = $::icinga2::config_owner,
$target_file_group = $::icinga2::config_group,
Expand Down
Loading

0 comments on commit 26083ee

Please sign in to comment.