Do not enable selinux_ignore_defaults

We should use the default (False) unless we have an explicit reason,
as suggested in the guide[1].

[1] https://www.puppet.com/docs/puppet/7/types/file.html#file-attribute-selinux_ignore_defaults

In general, you should leave this set at its default and only set it
to true when you need Puppet to not try to fix SELinux labels
automatically.

Change-Id: I69ea7cb9141a646442e9f87ef64843f04fcc2a65
This commit is contained in:
Takashi Kajinami
2025-05-26 16:32:19 +09:00
parent 039b251daf
commit 83cedb4202
2 changed files with 15 additions and 16 deletions

View File

@@ -333,14 +333,13 @@ class cloudkitty(
if $metrics_config {
file {'metrics.yml':
ensure => present,
path => $::cloudkitty::params::metrics_yaml,
content => to_yaml($metrics_config),
selinux_ignore_defaults => true,
mode => '0640',
owner => 'root',
group => $::cloudkitty::params::group,
tag => 'cloudkitty-yamls',
ensure => present,
path => $::cloudkitty::params::metrics_yaml,
content => to_yaml($metrics_config),
mode => '0640',
owner => 'root',
group => $::cloudkitty::params::group,
tag => 'cloudkitty-yamls',
}
}
}

View File

@@ -184,14 +184,14 @@ describe 'cloudkitty' do
end
it 'configures metrics.yml' do
is_expected.to contain_file('metrics.yml')
.with_ensure('present')
.with_path('/etc/cloudkitty/metrics.yml')
.with_selinux_ignore_defaults(true)
.with_mode('0640')
.with_owner('root')
.with_group('cloudkitty')
.with_tag('cloudkitty-yamls')
is_expected.to contain_file('metrics.yml').with(
:ensure => 'present',
:path => '/etc/cloudkitty/metrics.yml',
:mode => '0640',
:owner => 'root',
:group => 'cloudkitty',
:tag => 'cloudkitty-yamls'
)
end
end
end