Prepare for voxpupuli-puppet-lint-plugins

Fix new lint errors detected when full of the voxpupili lint plugins
are enabled.

Change-Id: I4ebee536b84f40b4ef742dbeb8eed8efecda7ba7
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
This commit is contained in:
Takashi Kajinami
2025-08-20 21:57:46 +09:00
parent 86d1ff0df8
commit 5d8e8cbf48
21 changed files with 19 additions and 40 deletions

View File

@@ -27,7 +27,7 @@
# [*defaults*] A config hash # [*defaults*] A config hash
# Optional. Defaults to an empty hash # Optional. Defaults to an empty hash
# #
class ceph::conf( class ceph::conf (
Hash $args = {}, Hash $args = {},
Hash $defaults = {} Hash $defaults = {}
) { ) {

View File

@@ -53,7 +53,6 @@ define ceph::fs (
# DEPRECATED PARAMETERS # DEPRECATED PARAMETERS
Optional[Float[0]] $exec_timeout = undef, Optional[Float[0]] $exec_timeout = undef,
) { ) {
if $exec_timeout { if $exec_timeout {
warning('The exec_timeout parameter is deprecated and has no effect') warning('The exec_timeout parameter is deprecated and has no effect')
} }

View File

@@ -169,7 +169,6 @@ class ceph (
$osd_op_threads = undef, $osd_op_threads = undef,
$rbd_default_features = undef, $rbd_default_features = undef,
) { ) {
include ceph::params include ceph::params
package { $ceph::params::packages : package { $ceph::params::packages :

View File

@@ -89,7 +89,6 @@ define ceph::key (
$inject_as_id = undef, $inject_as_id = undef,
$inject_keyring = undef, $inject_keyring = undef,
) { ) {
include ceph::params include ceph::params
$cluster_option = $cluster ? { $cluster_option = $cluster ? {
@@ -142,12 +141,11 @@ diff -N \$NEW_KEYRING ${keyring_path}
rv=\$? rv=\$?
rm \$NEW_KEYRING rm \$NEW_KEYRING
exit \$rv", exit \$rv",
require => [ File[$keyring_path], ], require => [File[$keyring_path]],
logoutput => true, logoutput => true,
} }
if $inject { if $inject {
$inject_id_option = $inject_as_id ? { $inject_id_option = $inject_as_id ? {
undef => '', undef => '',
default => " --name '${inject_as_id}'" default => " --name '${inject_as_id}'"
@@ -176,9 +174,8 @@ rv=$?
rm \$OLD_KEYRING rm \$OLD_KEYRING
rm \$TMP_KEYRING rm \$TMP_KEYRING
exit \$rv", exit \$rv",
require => [ Class['ceph'], Exec["ceph-key-${name}"], ], require => [Class['ceph'], Exec["ceph-key-${name}"]],
logoutput => true, logoutput => true,
} }
} }
} }

View File

@@ -27,6 +27,9 @@
# [*defaults*] A keys config hash # [*defaults*] A keys config hash
# Optional. Defaults to a empty hash. # Optional. Defaults to a empty hash.
# #
class ceph::keys($args = {}, $defaults = {}) { class ceph::keys (
$args = {},
$defaults = {},
) {
create_resources(ceph::key, $args, $defaults) create_resources(ceph::key, $args, $defaults)
} }

View File

@@ -35,12 +35,11 @@ define ceph::mirror (
$rbd_mirror_ensure = 'running', $rbd_mirror_ensure = 'running',
$rbd_mirror_enable = true, $rbd_mirror_enable = true,
) { ) {
ensure_resource( 'package', ensure_resource( 'package',
$pkg_mirror, $pkg_mirror,
{ {
ensure => present, ensure => present,
tag => [ 'ceph' ], tag => ['ceph'],
} }
) )

View File

@@ -88,7 +88,6 @@ define ceph::mon (
$mon_service = "ceph-mon-${id}" $mon_service = "ceph-mon-${id}"
if $ensure == present { if $ensure == present {
$ceph_mkfs = "ceph-mon-mkfs-${id}" $ceph_mkfs = "ceph-mon-mkfs-${id}"
if $authentication_type == 'cephx' { if $authentication_type == 'cephx' {
@@ -120,13 +119,10 @@ mon_data=\$(ceph-mon ${cluster_option} --id ${id} --show-config-value mon_data)
test -e \$mon_data/done test -e \$mon_data/done
", ",
} }
Exec["create-keyring-${id}"] -> Exec[$ceph_mkfs] Exec["create-keyring-${id}"] -> Exec[$ceph_mkfs]
} else { } else {
$keyring_path = $keyring $keyring_path = $keyring
} }
} else { } else {
$keyring_path = '/dev/null' $keyring_path = '/dev/null'
} }
@@ -208,7 +204,6 @@ test ! -e ${keyring_path}
} }
} }
} }
} else { } else {
service { $mon_service: service { $mon_service:
ensure => stopped, ensure => stopped,

View File

@@ -27,6 +27,9 @@
# [*defaults*] A config hash # [*defaults*] A config hash
# Optional. Defaults to a empty hash # Optional. Defaults to a empty hash
# #
class ceph::mons($args = {}, $defaults = {}) { class ceph::mons (
$args = {},
$defaults = {},
) {
create_resources(ceph::mon, $args, $defaults) create_resources(ceph::mon, $args, $defaults)
} }

View File

@@ -79,7 +79,6 @@ define ceph::osd (
Boolean $dmcrypt = false, Boolean $dmcrypt = false,
$dmcrypt_key_dir = '/etc/ceph/dmcrypt-keys', $dmcrypt_key_dir = '/etc/ceph/dmcrypt-keys',
) { ) {
include ceph::params include ceph::params
$exec_timeout_real = $exec_timeout ? { $exec_timeout_real = $exec_timeout ? {
undef => $ceph::params::exec_timeout, undef => $ceph::params::exec_timeout,
@@ -122,7 +121,6 @@ define ceph::osd (
} }
if $ensure == present { if $ensure == present {
$ceph_prepare = "ceph-osd-prepare-${name}" $ceph_prepare = "ceph-osd-prepare-${name}"
$ceph_activate = "ceph-osd-activate-${name}" $ceph_activate = "ceph-osd-activate-${name}"
@@ -193,8 +191,9 @@ ceph-volume lvm list ${data}
timeout => $exec_timeout_real, timeout => $exec_timeout_real,
tag => 'prepare', tag => 'prepare',
} }
if (str2bool($facts['os']['selinux']['enabled']) == true) {
stdlib::ensure_packages($ceph::params::pkg_policycoreutils, {'ensure' => 'present'}) if str2bool($facts['os']['selinux']['enabled']) == true {
stdlib::ensure_packages($ceph::params::pkg_policycoreutils, { 'ensure' => 'present' })
exec { "fcontext_${name}": exec { "fcontext_${name}":
command => "/bin/true # comment to satisfy puppet syntax requirements command => "/bin/true # comment to satisfy puppet syntax requirements
set -ex set -ex
@@ -233,9 +232,7 @@ ps -fCceph-osd|grep \"\\--id \$id \"
logoutput => true, logoutput => true,
tag => 'activate', tag => 'activate',
} }
} else { } else {
# ceph-disk: support osd removal http://tracker.ceph.com/issues/7454 # ceph-disk: support osd removal http://tracker.ceph.com/issues/7454
exec { "remove-osd-${name}": exec { "remove-osd-${name}":
command => "/bin/true # comment to satisfy puppet syntax requirements command => "/bin/true # comment to satisfy puppet syntax requirements

View File

@@ -35,13 +35,12 @@
# recovery. The recommended value is the absolute max for pid_max: 4194303 # recovery. The recommended value is the absolute max for pid_max: 4194303
# http://docs.ceph.com/docs/nautilus/rados/troubleshooting/troubleshooting-osd/ # http://docs.ceph.com/docs/nautilus/rados/troubleshooting/troubleshooting-osd/
# #
class ceph::osds( class ceph::osds (
$args = {}, $args = {},
$defaults = {}, $defaults = {},
# DEPRECATED PARAMS # DEPRECATED PARAMS
$pid_max = undef, $pid_max = undef,
) { ) {
if $pid_max != undef { if $pid_max != undef {
warning('pid_max parameter is deprecated and has no effect.') warning('pid_max parameter is deprecated and has no effect.')
} }

View File

@@ -65,7 +65,6 @@ define ceph::pool (
# DEPRECATED PARAMETERS # DEPRECATED PARAMETERS
Optional[Float[0]] $exec_timeout = undef, Optional[Float[0]] $exec_timeout = undef,
) { ) {
include ceph::params include ceph::params
if $exec_timeout { if $exec_timeout {

View File

@@ -24,7 +24,7 @@ class ceph::profile::osd {
require ceph::profile::client require ceph::profile::client
if $ceph::profile::params::fsid { if $ceph::profile::params::fsid {
$osd_defaults = {'fsid' => $ceph::profile::params::fsid} $osd_defaults = { 'fsid' => $ceph::profile::params::fsid }
} else { } else {
$osd_defaults = {} $osd_defaults = {}
} }

View File

@@ -248,7 +248,6 @@ class ceph::profile::params (
# DEPRECATED PARAMS # DEPRECATED PARAMS
$pid_max = undef, $pid_max = undef,
) { ) {
if $pid_max != undef { if $pid_max != undef {
warning('pid_max parameter is deprecated and has no effect.') warning('pid_max parameter is deprecated and has no effect.')
} }

View File

@@ -66,7 +66,6 @@ class ceph::repo (
Boolean $enable_sig = $ceph::params::enable_sig, Boolean $enable_sig = $ceph::params::enable_sig,
$ceph_mirror = undef, $ceph_mirror = undef,
) inherits ceph::params { ) inherits ceph::params {
case $facts['os']['family'] { case $facts['os']['family'] {
'Debian': { 'Debian': {
include apt include apt
@@ -127,7 +126,6 @@ not on ${facts['os']['name']}, which can lead to packaging issues.")
proxy_password => $proxy_password, proxy_password => $proxy_password,
} }
yumrepo { 'ext-ceph': yumrepo { 'ext-ceph':
ensure => $ensure, ensure => $ensure,
descr => "External Ceph ${release}", descr => "External Ceph ${release}",

View File

@@ -108,7 +108,6 @@ define ceph::rgw (
$rgw_swift_versioning_enabled = false, $rgw_swift_versioning_enabled = false,
$rgw_trust_forwarded_https = false, $rgw_trust_forwarded_https = false,
) { ) {
unless $name =~ /^radosgw\..+/ { unless $name =~ /^radosgw\..+/ {
fail("Define name must be started with 'radosgw.'") fail("Define name must be started with 'radosgw.'")
} }
@@ -121,7 +120,7 @@ define ceph::rgw (
if $rgw_enable_apis == undef { if $rgw_enable_apis == undef {
ceph_config { "client.${name}/rgw_enable_apis": ensure => absent } ceph_config { "client.${name}/rgw_enable_apis": ensure => absent }
} else { } else {
ceph_config { "client.${name}/rgw_enable_apis": value => join(any2array($rgw_enable_apis), ',')} ceph_config { "client.${name}/rgw_enable_apis": value => join(any2array($rgw_enable_apis), ',') }
} }
ceph_config { ceph_config {

View File

@@ -71,7 +71,7 @@ define ceph::rgw::apache_proxy_fcgi (
$rgw_port = 80, $rgw_port = 80,
$rewrite_rule = '.* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]', $rewrite_rule = '.* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]',
$setenv = 'proxy-nokeepalive 1', $setenv = 'proxy-nokeepalive 1',
$proxy_pass = {'path' => '/', 'url' => 'fcgi://127.0.0.1:9000/'}, $proxy_pass = { 'path' => '/', 'url' => 'fcgi://127.0.0.1:9000/' },
$syslog = true, $syslog = true,
$apache_mods = false, $apache_mods = false,
$apache_vhost = false, $apache_vhost = false,
@@ -79,7 +79,6 @@ define ceph::rgw::apache_proxy_fcgi (
$apache_purge_vhost = true, $apache_purge_vhost = true,
$custom_apache_ports = undef, $custom_apache_ports = undef,
) { ) {
include ceph::params include ceph::params
class { 'apache': class { 'apache':

View File

@@ -51,7 +51,6 @@ define ceph::rgw::barbican (
$rgw_keystone_barbican_password, $rgw_keystone_barbican_password,
$rgw_barbican_url = 'http://127.0.0.1:9311', $rgw_barbican_url = 'http://127.0.0.1:9311',
) { ) {
unless $name =~ /^radosgw\..+/ { unless $name =~ /^radosgw\..+/ {
fail("Define name must be started with 'radosgw.'") fail("Define name must be started with 'radosgw.'")
} }

View File

@@ -24,7 +24,6 @@
define ceph::rgw::beast ( define ceph::rgw::beast (
$rgw_frontends = ['beast', 'port=7480'], $rgw_frontends = ['beast', 'port=7480'],
) { ) {
unless $name =~ /^radosgw\..+/ { unless $name =~ /^radosgw\..+/ {
fail("Define name must be started with 'radosgw.'") fail("Define name must be started with 'radosgw.'")
} }

View File

@@ -24,7 +24,6 @@
define ceph::rgw::civetweb ( define ceph::rgw::civetweb (
$rgw_frontends = ['civetweb', 'port=7480'], $rgw_frontends = ['civetweb', 'port=7480'],
) { ) {
unless $name =~ /^radosgw\..+/ { unless $name =~ /^radosgw\..+/ {
fail("Define name must be started with 'radosgw.'") fail("Define name must be started with 'radosgw.'")
} }

View File

@@ -77,7 +77,6 @@ define ceph::rgw::keystone (
$rgw_s3_auth_use_keystone = true, $rgw_s3_auth_use_keystone = true,
$rgw_keystone_implicit_tenants = true, $rgw_keystone_implicit_tenants = true,
) { ) {
unless $name =~ /^radosgw\..+/ { unless $name =~ /^radosgw\..+/ {
fail("Define name must be started with 'radosgw.'") fail("Define name must be started with 'radosgw.'")
} }

View File

@@ -63,7 +63,6 @@ class ceph::rgw::keystone::auth (
$service_name = 'swift', $service_name = 'swift',
$service_type = 'object-store', $service_type = 'object-store',
) { ) {
include openstacklib::openstackclient include openstacklib::openstackclient
Keystone::Resource::Service_identity['rgw'] -> Service<| tag == 'ceph-radosgw' |> Keystone::Resource::Service_identity['rgw'] -> Service<| tag == 'ceph-radosgw' |>
@@ -86,4 +85,3 @@ class ceph::rgw::keystone::auth (
admin_url => $admin_url, admin_url => $admin_url,
} }
} }