Skip to content

Commit

Permalink
Lintsand fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alvagante committed Oct 20, 2023
1 parent 834c4f6 commit 830767e
Show file tree
Hide file tree
Showing 36 changed files with 98 additions and 98 deletions.
2 changes: 1 addition & 1 deletion manifests/admin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

String $user = 'admin',

String $master = '',
String $master = '', # lint:ignore:params_empty_string_assignment
Variant[Undef,String] $keyshare_method = 'storeconfigs',

Boolean $auto_prereq = $psick::auto_prereq,
Expand Down
2 changes: 1 addition & 1 deletion manifests/admin/master.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

if $psick::admin::keyshare_method == 'storeconfigs'
and ($ssh_key or $::admin_user_key) {

Check warning on line 21 in manifests/admin/master.pp

View workflow job for this annotation

GitHub Actions / Syntax validation

top scope fact instead of facts hash (check: top_scope_facts)
@@ssh_authorized_key { "admin_user_${psick::admin::user}_rsa-${clientcert}":
@@ssh_authorized_key { "admin_user_${psick::admin::user}_rsa-${facts['clientcert']}":
ensure => $ensure,
key => pick($ssh_key,$::admin_user_key),

Check warning on line 24 in manifests/admin/master.pp

View workflow job for this annotation

GitHub Actions / Syntax validation

top scope fact instead of facts hash (check: top_scope_facts)
user => $psick::admin::user,
Expand Down
2 changes: 1 addition & 1 deletion manifests/archive.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Enum['download','extract','compress','auto'] $action = 'auto',

Optional[String] $source = $title,
Optional[Stdlib::Absolutepath] $download_dir = '/var/tmp',
Stdlib::Absolutepath $download_dir = '/var/tmp',
Optional[String] $download_command = undef,
Integer $download_timeout = 600,
Array $download_exec_env = [],
Expand Down
12 changes: 6 additions & 6 deletions manifests/aws.pp
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#
class psick::aws (
String $region = chop($::ec2_placement_availability_zone),
String $region = chop($facts['ec2_placement_availability_zone']),

String $default_vpc_name = 'myvpc',
String $default_cidr_block_prefix = '10.0',
Boolean $create_defaults = false,

String $cli_class = '::psick::aws::cli',
String $puppet_class = '',
String $vpc_class = '',
String $sg_class = '',
String $ec2_class = '',
String $rds_class = '',
String $puppet_class = '', # lint:ignore:params_empty_string_assignment
String $vpc_class = '', # lint:ignore:params_empty_string_assignment
String $sg_class = '', # lint:ignore:params_empty_string_assignment
String $ec2_class = '', # lint:ignore:params_empty_string_assignment
String $rds_class = '', # lint:ignore:params_empty_string_assignment

Boolean $manage = $psick::manage,
Boolean $noop_manage = $psick::noop_manage,
Expand Down
4 changes: 2 additions & 2 deletions manifests/aws/cli.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
class psick::aws::cli (
String $ensure = 'present',
String $region = $psick::aws::region,
String $aws_access_key_id = '',
String $aws_secret_access_key = '',
String $aws_access_key_id = '', # lint:ignore:params_empty_string_assignment
String $aws_secret_access_key = '', # lint:ignore:params_empty_string_assignment
String $config_template = 'psick/aws/credentials.erb',
Array $install_gems = ['aws-sdk-core' , 'retries'],
Boolean $install_system_gems = true,
Expand Down
2 changes: 1 addition & 1 deletion manifests/aws/cli/script.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Boolean $autorun = true,
String $destination_dir = '/var/tmp',
Variant[Undef,String] $region = undef,
String $command = '',
String $command = '', # lint:ignore:params_empty_string_assignment
) {
$script_path = "${destination_dir}/${title}"
$exec_command = $command ? {
Expand Down
20 changes: 10 additions & 10 deletions manifests/base.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# Is exposes parameters that allow to define any class (from Psick,
# public modules or local profiles) to include after the prerequisites
# classes declared in the osich::pre class.
# For each different $::kernel value a differet entrypoint is exposed.
# For each different $facts['kernel'] value a differet entrypoint is exposed.
#
# For each of these $::kernel_classes parameters, it's expected an Hash of key-values:
# For each of these $facts['kernel']_classes parameters, it's expected an Hash of key-values:
# Keys can have any name, and are used as markers to allow overrides,
# exceptions management and customisations across Hiera's hierarchies.
# Values are actual class names to include in the node's catalog.
Expand Down Expand Up @@ -34,19 +34,19 @@
# psick::base::manage: false
#
# @param linux_classes Hash with the list of classes to include
# in the common baseline when $::kernel is Linux. Of each key-value
# in the common baseline when $facts['kernel'] is Linux. Of each key-value
# of the hash, the key is used as marker to eventually override
# across Hiera hierarchies and the value is the name of the class
# to actually include. Any key name can be used, but the value
# must be a valid class existing the the $modulepath. If the value
# is set to empty string ('') then the class of the relevant marker
# is not included.
# @param windows_classes Hash with the list of classes to include
# in the common baseline when $::kernel is windows.
# in the common baseline when $facts['kernel'] is windows.
# @param solaris_classes Hash with the list of classes to include
# in the common baseline when $::kernel is Solaris.
# in the common baseline when $facts['kernel'] is Solaris.
# @param darwin_classes Hash with the list of classes to include
# in the common baseline when $::kernel is Darwin.
# in the common baseline when $facts['kernel'] is Darwin.
# @param manage If to actually manage any resource in this class. If false no
# resource is managed. Default value is taken from main psick class.
# @param noop_manage If to use the noop() function for all the resources provided
Expand Down Expand Up @@ -77,28 +77,28 @@
noop($noop_value)
}

if !empty($linux_classes) and $::kernel == 'Linux' {
if !empty($linux_classes) and $facts['kernel'] == 'Linux' {
$linux_classes.each |$n,$c| {
if $c != '' {
contain $c
}
}
}
if !empty($windows_classes) and $::kernel == 'windows' {
if !empty($windows_classes) and $facts['kernel'] == 'windows' {
$windows_classes.each |$n,$c| {
if $c != '' {
contain $c
}
}
}
if !empty($darwin_classes) and $::kernel == 'Darwin' {
if !empty($darwin_classes) and $facts['kernel'] == 'Darwin' {
$darwin_classes.each |$n,$c| {
if $c != '' {
contain $c
}
}
}
if !empty($solaris_classes) and $::kernel == 'Solaris' {
if !empty($solaris_classes) and $facts['kernel'] == 'Solaris' {
$solaris_classes.each |$n,$c| {
if $c != '' {
contain $c
Expand Down
4 changes: 2 additions & 2 deletions manifests/bolt.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
String $ssh_user = 'root',
String $ssh_group = 'root',

String $master = '',
Optional[Enum['storeconfigs','static']] $keyshare_method = 'storeconfigs',
String $master = '', # lint:ignore:params_empty_string_assignment
Enum['storeconfigs','static'] $keyshare_method = 'storeconfigs',

Boolean $auto_prereq = $psick::auto_prereq,

Expand Down
4 changes: 2 additions & 2 deletions manifests/bolt/master.pp
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@
if $psick::bolt::keyshare_method == 'storeconfigs'
and defined('psick::bolt::bolt_user_pub_key')
or defined('bolt_user_key') {
@@ssh_authorized_key { "bolt_user_${psick::bolt::ssh_user}_rsa-${clientcert}":
@@ssh_authorized_key { "bolt_user_${psick::bolt::ssh_user}_rsa-${facts['clientcert']}":
ensure => $ensure,
key => pick($psick::bolt::bolt_user_pub_key,$::bolt_user_key),
key => pick($psick::bolt::bolt_user_pub_key,getvar('facts.bolt_user_key')),
user => $psick::bolt::ssh_user,
type => 'rsa',
tag => "bolt_master_${psick::bolt::master}_${psick::bolt::bolt_user}",
Expand Down
8 changes: 4 additions & 4 deletions manifests/bolt/project.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
# from a given $control_repo_url.
# By default everything is cretaed in a directory called Boltdir in
# the home passed as title. It's possible to specify a different $user
# (using whatever title) or a different destination $path
# (using whatever title) or a different destination $path
#
# @example Create a bolt project in /home/al/Boltdir (on *nix)
#
#
# psick::bolt::project { 'al': }
#
# @example Create a bolt project in /opt/admins/bolt-control-center as user admin
#
#
# psick::bolt::project { 'control-center':
# user => 'admin',
# path => '/opt/admins/bolt-control-center',
Expand Down Expand Up @@ -137,7 +137,7 @@

if $puppetfile_install {
exec { 'bolt install puppetfile':
path => $::path,
path => $facts['path'],
cwd => $bolt_dir,
creates => 'modules/stdlib', # Quick and very dirty
}
Expand Down
3 changes: 1 addition & 2 deletions manifests/git/clone.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
Optional[String] $git_pubkey_path = undef,
Optional[String] $revision = undef,
Optional[String] $repo_dir = undef,
String $post_sync_command = '',
String $post_sync_command = '', # lint:ignore:params_empty_string_assignment
) {

$safe_path = regsubst($path,'/', '_', 'G')

$clone_path = $repo_dir ? {
Expand Down
16 changes: 8 additions & 8 deletions manifests/hardening.pp
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@
# Default from psick class.
class psick::hardening (

String $pam_class = '',
String $packages_class = '',
String $services_class = '',
String $tcpwrappers_class = '',
String $suid_class = '',
String $users_class = '',
String $securetty_class = '',
String $network_class = '',
String $pam_class = '', # lint:ignore:params_empty_string_assignment
String $packages_class = '', # lint:ignore:params_empty_string_assignment
String $services_class = '', # lint:ignore:params_empty_string_assignment
String $tcpwrappers_class = '', # lint:ignore:params_empty_string_assignment
String $suid_class = '', # lint:ignore:params_empty_string_assignment
String $users_class = '', # lint:ignore:params_empty_string_assignment
String $securetty_class = '', # lint:ignore:params_empty_string_assignment
String $network_class = '', # lint:ignore:params_empty_string_assignment

Boolean $manage = $psick::manage,
Boolean $noop_manage = $psick::noop_manage,
Expand Down
8 changes: 4 additions & 4 deletions manifests/hardening/network.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
# @param remove_ftp_user Remove or leave the local ftp user
#
class psick::hardening::network (
String $modprobe_template = '',
String $netconfig_template = '',
String $blacklist_template = '',
String $services_template = '',
String $modprobe_template = '', # lint:ignore:params_empty_string_assignment
String $netconfig_template = '', # lint:ignore:params_empty_string_assignment
String $blacklist_template = '', # lint:ignore:params_empty_string_assignment
String $services_template = '', # lint:ignore:params_empty_string_assignment
Boolean $manage = $psick::manage,
Boolean $noop_manage = $psick::noop_manage,
Boolean $noop_value = $psick::noop_value,
Expand Down
8 changes: 4 additions & 4 deletions manifests/hardening/pam.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
# password_min_age: 7
#
class psick::hardening::pam (
String $system_auth_template = '',
String $password_auth_template = '',
String $login_defs_template = '',
String $system_auth_template = '', # lint:ignore:params_empty_string_assignment
String $password_auth_template = '', # lint:ignore:params_empty_string_assignment
String $login_defs_template = '', # lint:ignore:params_empty_string_assignment
Boolean $manage = $psick::manage,
Boolean $noop_manage = $psick::noop_manage,
Boolean $noop_value = $psick::noop_value,
Expand Down Expand Up @@ -76,7 +76,7 @@
mode => '0400',
}
}
if ( $::os['family'] == 'RedHat' and $::os['release']['major'] == '7' ) {
if ( $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '7' ) {
file { '/etc/pam.d/system-auth-ac':
content => template($real_system_auth_template),
}
Expand Down
2 changes: 1 addition & 1 deletion manifests/hosts/dynamic.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Manage /etc/hosts dynamically. Requires puppetdb
#
class psick::hosts::dynamic (
String $dynamic_magicvar = '',
String $dynamic_magicvar = '', # lint:ignore:params_empty_string_assignment
Boolean $dynamic_exclude = false,
String $dynamic_ip = $facts['networking']['ip'],
Array $dynamic_alias = [$facts['networking']['hostname']],
Expand Down
12 changes: 6 additions & 6 deletions manifests/hosts/resource.pp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#
class psick::hosts::resource (
Optional[Hash] $hosts = {},
Optional[Hash] $defaults = {},
Boolean $use_defaults = true,
Hash $hosts = {},
Hash $defaults = {},
Boolean $use_defaults = true,

Boolean $manage = $psick::manage,
Boolean $noop_manage = $psick::noop_manage,
Boolean $noop_value = $psick::noop_value,
Boolean $manage = $psick::manage,
Boolean $noop_manage = $psick::noop_manage,
Boolean $noop_value = $psick::noop_value,
) {
if $manage {
if $noop_manage {
Expand Down
8 changes: 4 additions & 4 deletions manifests/logs/rsyslog.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
# up with lookup('psick::logs::rsyslog::options', {} )
#
class psick::logs::rsyslog (
Enum['present','absent'] $ensure = 'present',
Enum['present','absent'] $ensure = 'present',

Variant[String[1],Undef] $config_dir_source = undef,
String $config_file_template = '',
Array $server_ip = [],
Variant[String[1],Undef] $config_dir_source = undef,
String $config_file_template = '', # lint:ignore:params_empty_string_assignment
Array $server_ip = [],
) {
$options_default = {
}
Expand Down
4 changes: 2 additions & 2 deletions manifests/motd.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
class psick::motd (
String $motd_file_ensure = 'present',
String $motd_file_template = 'psick/motd/motd.erb',
String $motd_extratext = '',
String $motd_extratext = '', # lint:ignore:params_empty_string_assignment

String $issue_file_ensure = 'present',
String $issue_file_template = 'psick/motd/issue.erb',
String $issue_extratext = '',
String $issue_extratext = '', # lint:ignore:params_empty_string_assignment

Boolean $manage = $psick::manage,
Boolean $noop_manage = $psick::noop_manage,
Expand Down
2 changes: 1 addition & 1 deletion manifests/netinstall.pp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
define psick::netinstall (
$url,
$destination_dir,
$extracted_dir = '',
String $extracted_dir = '',
$retrieve_command = 'wget',
$retrieve_args = '',
$owner = 'root',
Expand Down
4 changes: 2 additions & 2 deletions manifests/nfs/export.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
String $share = '/srv/nfs',

String $guest = '127.0.0.1',
String $options = '',
String $options = '', # lint:ignore:params_empty_string_assignment

String $content = '',
String $content = '', # lint:ignore:params_empty_string_assignment

Boolean $use_exportsd = false,
) {
Expand Down
2 changes: 1 addition & 1 deletion manifests/nfs/mount.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
String $server,
String $share,
Enum[present,absent] $ensure = present,
String $mountpoint = '',
String $mountpoint = '', # lint:ignore:params_empty_string_assignment
String $client_options = 'auto',
) {
$real_mountpoint = $mountpoint ? {
Expand Down
2 changes: 1 addition & 1 deletion manifests/nodejs.pp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
String $setup_script_url = 'https://rpm.nodesource.com/setup_10.x',
String $setup_script_path = '/tmp/NodeJS',
Hash $setup_script_params = {},
String $setup_script_creates = '',
String $setup_script_creates = '', # lint:ignore:params_empty_string_assignment

Boolean $nvm_manage = false,
Hash $nvm_installs = {},
Expand Down
2 changes: 1 addition & 1 deletion manifests/php/module.pp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
define psick::php::module (
Psick::Ensure $ensure = 'present',
Hash $package_options = {},
String $prefix = '',
String $prefix = '', # lint:ignore:params_empty_string_assignment
) {
$real_module_prefix = $prefix ? {
'' => $psick::php::module_prefix,
Expand Down
2 changes: 1 addition & 1 deletion manifests/profile.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# setting is overridden: resources are always applied.
# Default from psick class.
class psick::profile (
String $template = '',
String $template = '', # lint:ignore:params_empty_string_assignment
Hash $options = {},

Hash $scripts_hash = {},
Expand Down
6 changes: 3 additions & 3 deletions manifests/profile/script.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
define psick::profile::script (
Enum['present','absent'] $ensure = 'present',
Boolean $autoexec = false,
String $source = '',
String $content = '',
String $template = '',
String $source = '', # lint:ignore:params_empty_string_assignment
String $content = '', # lint:ignore:params_empty_string_assignment
String $template = '', # lint:ignore:params_empty_string_assignment
String $config_dir = '/etc/profile.d',
String $owner = 'root',
String $group = 'root',
Expand Down
Loading

0 comments on commit 830767e

Please sign in to comment.