Prepare for new lint plugins

This fixes a few lint warnings/errors detected by the following plugins
we aim to enable soon.
 - puppet-lint-file_ensure-check
 - puppet-lint-trailing_comma-check
 - puppet-lint-topscope-variable-check

Change-Id: I777669d524fe98bcf866358294cb1ff7d2f69de1
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
This commit is contained in:
Takashi Kajinami
2025-08-15 20:00:00 +09:00
parent d31e9bab6d
commit 3bc612652e
6 changed files with 8 additions and 7 deletions

View File

@@ -75,6 +75,7 @@ define openstacklib::clouds (
} }
file { $path: file { $path:
ensure => file,
mode => '0600', mode => '0600',
owner => $file_user, owner => $file_user,
group => $file_group, group => $file_group,

View File

@@ -26,7 +26,7 @@ class openstacklib::iscsid(
package { 'open-iscsi': package { 'open-iscsi':
ensure => $package_ensure, ensure => $package_ensure,
name => $::openstacklib::params::open_iscsi_package_name, name => $openstacklib::params::open_iscsi_package_name,
tag => 'openstack', tag => 'openstack',
} }

View File

@@ -10,10 +10,10 @@
# #
# [*package_name*] # [*package_name*]
# (Optional) The name of the package to install # (Optional) The name of the package to install
# Defaults to $::openstacklib::params::openstackclient_package_name # Defaults to $openstacklib::params::openstackclient_package_name
# #
class openstacklib::openstackclient( class openstacklib::openstackclient(
$package_name = $::openstacklib::params::openstackclient_package_name, $package_name = $openstacklib::params::openstackclient_package_name,
$package_ensure = 'present', $package_ensure = 'present',
) inherits openstacklib::params { ) inherits openstacklib::params {

View File

@@ -76,7 +76,7 @@ define openstacklib::policy (
file_user => $file_user, file_user => $file_user,
file_group => $file_group, file_group => $file_group,
file_format => $file_format, file_format => $file_format,
purge_config => $purge_config purge_config => $purge_config,
} }
create_resources('openstacklib::policy::base', $policies, $policy_defaults) create_resources('openstacklib::policy::base', $policies, $policy_defaults)

View File

@@ -53,7 +53,7 @@ define openstacklib::policy::base (
file_user => $file_user, file_user => $file_user,
file_group => $file_group, file_group => $file_group,
file_format => $file_format, file_format => $file_format,
purge_config => $purge_config purge_config => $purge_config,
}) })
# NOTE(tkajianm): Currently we use single quotes('') to quote the whole # NOTE(tkajianm): Currently we use single quotes('') to quote the whole
@@ -65,7 +65,7 @@ define openstacklib::policy::base (
file_line { "${file_path}-${key}" : file_line { "${file_path}-${key}" :
path => $file_path, path => $file_path,
line => "'${key}': '${value_real}'", line => "'${key}': '${value_real}'",
match => "^['\"]?${key}(?!:)['\"]?\\s*:.+" match => "^['\"]?${key}(?!:)['\"]?\\s*:.+",
} }
Openstacklib::Policy::Default<| title == $file_path |> Openstacklib::Policy::Default<| title == $file_path |>
-> File_line<| title == "${file_path}-${key}" |> -> File_line<| title == "${file_path}-${key}" |>

View File

@@ -29,7 +29,7 @@ class openstacklib::policyrcd(
# We put this out there so openstack services wont auto start # We put this out there so openstack services wont auto start
# when installed. # when installed.
file { '/usr/sbin/policy-rc.d': file { '/usr/sbin/policy-rc.d':
ensure => present, ensure => file,
content => template('openstacklib/policy-rc.d.erb'), content => template('openstacklib/policy-rc.d.erb'),
mode => '0755', mode => '0755',
owner => root, owner => root,