diff --git a/manifests/init.pp b/manifests/init.pp index 55d9dac1..f6bee3e6 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -731,6 +731,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'] diff --git a/manifests/params.pp b/manifests/params.pp index a8cece36..fca35d30 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -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 + } diff --git a/manifests/server.pp b/manifests/server.pp index 8e82ed55..78897fa7 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -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 { diff --git a/manifests/server/config.pp b/manifests/server/config.pp index f8d73103..c059c28d 100644 --- a/manifests/server/config.pp +++ b/manifests/server/config.pp @@ -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