Skip to content

Commit

Permalink
feat: option to set mode of puppet.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
teluq-pbrideau committed Jan 27, 2023
1 parent 49fb1af commit 45e3dab
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@
-> case $facts['os']['family'] {
'Windows': {
concat { "${puppet_dir}/puppet.conf":
mode => '0674',
mode => $puppet::puppetconf_mode,
}
}

default: {
concat { "${puppet_dir}/puppet.conf":
owner => 'root',
group => $puppet::params::root_group,
mode => '0644',
mode => $puppet::puppetconf_mode,
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@
# of the classes associated with the retrieved
# configuration.
#
# $puppetconf_mode:: The permissions for /etc/puppetlabs/puppet/puppet.conf
# default to '0644' and '0674' on windows
#
# == puppet::agent parameters
#
# $agent:: Should a puppet agent be installed
Expand Down Expand Up @@ -752,6 +755,7 @@
Optional[Stdlib::Absolutepath] $server_versioned_code_id = undef,
Optional[Stdlib::Absolutepath] $server_versioned_code_content = undef,
Array[String[1]] $server_jolokia_metrics_whitelist = [],
Pattern[/^[0-9]{3,4}$/] $puppetconf_mode = $puppet::params::puppetconf_mode,
) inherits puppet::params {
contain puppet::config

Expand Down
4 changes: 4 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
$server_puppetserver_logdir = undef
$server_ruby_load_paths = []
$server_jruby_gem_home = undef
$puppetconf_mode = '0674'
}

/^(FreeBSD|DragonFly)$/ : {
Expand Down Expand Up @@ -96,6 +97,7 @@
# lint:endignore
}
$server_jruby_gem_home = '/var/puppet/server/data/puppetserver/jruby-gems'
$puppetconf_mode = '0644'
}

'Archlinux' : {
Expand All @@ -114,6 +116,7 @@
$server_puppetserver_logdir = undef
$server_ruby_load_paths = []
$server_jruby_gem_home = undef
$puppetconf_mode = '0644'
}

default : {
Expand Down Expand Up @@ -152,6 +155,7 @@
$server_jruby_gem_home = '/var/lib/puppet/jruby-gems'
}
$root_group = undef
$puppetconf_mode = '0644'
}
}

Expand Down

0 comments on commit 45e3dab

Please sign in to comment.