Skip to content

Commit

Permalink
make foreman puppet module dir optional
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Jun 16, 2018
1 parent 9836977 commit e8b7a0c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,8 @@
#
# $server_parser:: Sets the parser to use. Valid options are 'current' or 'future'.
# Defaults to 'current'.
# $create_foreman_modules_directory: Boolean that defaults to false. If true, we create a dedicated directory for
# puppet modules, that will be used only be foreman, and not puppetserver.
#
# === Usage:
#
Expand Down Expand Up @@ -731,6 +733,7 @@
Boolean $server_puppetserver_experimental = $puppet::params::server_puppetserver_experimental,
Array[String] $server_puppetserver_trusted_agents = $puppet::params::server_puppetserver_trusted_agents,
Optional[Enum['off', 'jit', 'force']] $server_compile_mode = $puppet::params::server_compile_mode,
Boolean $create_foreman_modules_directory = $puppet::params::server_create_foreman_modules_directory,
) inherits puppet::params {
include ::puppet::config
Class['puppet::config'] -> Class['puppet']
Expand Down
4 changes: 4 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -479,4 +479,8 @@

# Normally agents can only fetch their own catalogs. If you want some nodes to be able to fetch *any* catalog, add them here.
$server_puppetserver_trusted_agents = []

# decide if we want to create a separate directory where foreman stores puppet modules
$server_create_foreman_modules_directory = false

}
1 change: 1 addition & 0 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@
Boolean $puppetserver_experimental = $::puppet::server_puppetserver_experimental,
Array[String] $puppetserver_trusted_agents = $::puppet::server_puppetserver_trusted_agents,
Optional[Enum['off', 'jit', 'force']] $compile_mode = $::puppet::server_compile_mode,
Boolean $create_foreman_modules_directory = $puppet::create_foreman_modules_directory,
) {
if $implementation == 'master' and $ip != $puppet::params::ip {
notify {
Expand Down
8 changes: 5 additions & 3 deletions manifests/server/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,11 @@
}

# Create Foreman share dir which does not depend on Puppet version
exec { 'mkdir -p /usr/share/puppet/modules':
creates => '/usr/share/puppet/modules',
path => ['/usr/bin', '/bin'],
if ($puppet::server::create_foreman_modules_directory == true) {
exec { 'mkdir -p /usr/share/puppet/modules':
creates => '/usr/share/puppet/modules',
path => ['/usr/bin', '/bin'],
}
}

## SSL and CA configuration
Expand Down

0 comments on commit e8b7a0c

Please sign in to comment.