Skip to content

Commit

Permalink
Avoid duplicate declaration issues when server_additonal_settings and…
Browse files Browse the repository at this point in the history
… additional_settings contain same key

Remove use of puppet::config::additional_settings in favor of each() block
  • Loading branch information
treydock authored and mmoll committed Oct 17, 2017
1 parent 45b46ca commit 8963eee
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 30 deletions.
8 changes: 2 additions & 6 deletions manifests/agent/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,8 @@
}
}

# we need to store this in a variable, because older puppet doesn't
# like resource{function(): ... }
$additional_settings_keys = keys($::puppet::agent_additional_settings)
puppet::config::additional_settings{ $additional_settings_keys:
hash => $::puppet::agent_additional_settings,
resource => '::puppet::config::agent',
$::puppet::agent_additional_settings.each |$key,$value| {
puppet::config::agent { $key: value => $value }
}

if $::puppet::runmode == 'service' {
Expand Down
8 changes: 2 additions & 6 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,8 @@
puppet::config::main{'syslogfacility': value => $syslogfacility; }
}

# we need to store this in a variable, because older puppet doesn't
# like resource{function(): ... }
$additional_settings_keys = keys($additional_settings)
puppet::config::additional_settings{ $additional_settings_keys:
hash => $additional_settings,
resource => '::puppet::config::main',
$additional_settings.each |$key,$value| {
puppet::config::main { $key: value => $value }
}

file { $puppet_dir:
Expand Down
12 changes: 0 additions & 12 deletions manifests/config/additional_settings.pp

This file was deleted.

8 changes: 2 additions & 6 deletions manifests/server/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,8 @@
}
}

# we need to store this in a variable, because older puppet doesn't
# like resource{function(): ... }
$additional_settings_keys = keys($::puppet::server_additional_settings)
puppet::config::additional_settings{ $additional_settings_keys:
hash => $::puppet::server_additional_settings,
resource => '::puppet::config::master',
$::puppet::server_additional_settings.each |$key,$value| {
puppet::config::master { $key: value => $value }
}

file { "${puppet::vardir}/reports":
Expand Down

0 comments on commit 8963eee

Please sign in to comment.