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 Sep 26, 2022
1 parent 9421bd4 commit 7bbd46e
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 @@ -87,15 +87,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 @@ -160,6 +160,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 @@ -743,6 +746,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 @@ -72,6 +72,7 @@
$server_puppetserver_logdir = undef
$server_ruby_load_paths = []
$server_jruby_gem_home = undef
$puppetconf_mode = '0674'
}

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

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

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

Expand Down

0 comments on commit 7bbd46e

Please sign in to comment.