From f70c8572a57a4fe08b0b4e38939daa5fef1f2f44 Mon Sep 17 00:00:00 2001 From: Ossi Salmi Date: Mon, 4 May 2015 11:03:26 +0300 Subject: [PATCH] Lint fixes --- alpine/manifests/init.pp | 11 ++++++----- autofs/manifests/init.pp | 3 ++- dell/manifests/init.pp | 10 +++++++--- gnome/manifests/init.pp | 2 +- hastymail/manifests/init.pp | 4 ++-- igraph/manifests/init.pp | 3 ++- irc/manifests/init.pp | 23 +++++++++++++++++------ lsb/manifests/init.pp | 8 ++++++-- lynx/manifests/init.pp | 7 +++---- motd/manifests/init.pp | 2 +- mutt/manifests/init.pp | 11 ++++++----- raid/manifests/init.pp | 8 ++++---- sasl/manifests/init.pp | 4 +++- selinux/manifests/init.pp | 4 ++-- sks/manifests/init.pp | 1 + ssh/manifests/init.pp | 5 +++-- sudo/manifests/init.pp | 6 ++++-- svn/manifests/init.pp | 2 +- 18 files changed, 71 insertions(+), 43 deletions(-) diff --git a/alpine/manifests/init.pp b/alpine/manifests/init.pp index f6ba2c9..55dd1e6 100644 --- a/alpine/manifests/init.pp +++ b/alpine/manifests/init.pp @@ -1,15 +1,16 @@ - +# Install alpine. +# class alpine { package { "alpine": ensure => installed, } - if ! $mail_server { - $mail_server = "mail.${domain}" + if ! $::mail_server { + $mail_server = "mail.${::domain}" } - if ! $mail_domain { - $mail_domain = $domain + if ! $::mail_domain { + $mail_domain = $::domain } file { "/usr/bin/pine": diff --git a/autofs/manifests/init.pp b/autofs/manifests/init.pp index 21404c8..a9c0875 100644 --- a/autofs/manifests/init.pp +++ b/autofs/manifests/init.pp @@ -1,4 +1,5 @@ - +# Install and configure autofs service. +# class autofs { package { "autofs": diff --git a/dell/manifests/init.pp b/dell/manifests/init.pp index 9aa86e4..fff0708 100644 --- a/dell/manifests/init.pp +++ b/dell/manifests/init.pp @@ -1,16 +1,19 @@ - +# Prerequisites for Dell tools +# class dell::common { + case $::operatingsystem { - "centos", "redhat": { + "centos","redhat": { include yum::repo::dell } default: { - fail("Dell modules not supported in ${operatingsystem}") + fail("Dell modules not supported in ${::operatingsystem}") } } } + # Tools and services for Dell iDRAC7 management # class dell::idrac7 { @@ -39,4 +42,5 @@ class dell::idrac7 { group => "root", require => Package["srvadmin-idrac7"], } + } diff --git a/gnome/manifests/init.pp b/gnome/manifests/init.pp index c26871e..e336d8a 100644 --- a/gnome/manifests/init.pp +++ b/gnome/manifests/init.pp @@ -117,7 +117,7 @@ define gnome::gconf($value, $source = "default", $type = "string", $ltype = "") } } - exec { "gconftool-2 --direct --config-source xml:readwrite:${xml} --type ${type} $param --set '${name}' '${value}'": + exec { "gconftool-2 --direct --config-source xml:readwrite:${xml} --type ${type} ${param} --set '${name}' '${value}'": path => "/bin:/usr/bin:/sbin:/usr/sbin", unless => "test \"`gconftool-2 --direct --config-source xml:readwrite:${xml} --get '${name}'`\" = '${value}'", } diff --git a/hastymail/manifests/init.pp b/hastymail/manifests/init.pp index af8735a..8f57dee 100644 --- a/hastymail/manifests/init.pp +++ b/hastymail/manifests/init.pp @@ -13,8 +13,8 @@ class hastymail($datadir=undef) { include php::mcrypt if !$hastymail_package { - if $hastymail_package_latest { - $hastymail_package = $hastymail_package_latest + if $::hastymail_package_latest { + $hastymail_package = $::hastymail_package_latest } else { fail("Must define \$hastymail_package or \$hastymail_package_latest") } diff --git a/igraph/manifests/init.pp b/igraph/manifests/init.pp index f30a508..9341a6f 100644 --- a/igraph/manifests/init.pp +++ b/igraph/manifests/init.pp @@ -3,11 +3,12 @@ class igraph::python { case $::operatingsystem { - ubuntu: { + "ubuntu": { package { "python-igraph": ensure => installed, } } + default: { } } } diff --git a/irc/manifests/init.pp b/irc/manifests/init.pp index 1587cb3..89323d1 100644 --- a/irc/manifests/init.pp +++ b/irc/manifests/init.pp @@ -83,10 +83,21 @@ class irc::services inherits irc::server { # $ident: # Use ident service. Defaults to false. # -define irc::network($desc, $servername, $serverdesc, $port, $sslport, - $sslcert="", $operator=["*@127.0.0.1"], $operuser="root", - $operpass, $userpass="", $services=false, $servpass="", - $ident=false) { +define irc::network( + $desc, + $servername, + $serverdesc, + $port, + $sslport, + $operpass, + $sslcert="", + $operator=["*@127.0.0.1"], + $operuser="root", + $userpass="", + $services=false, + $servpass="", + $ident=false, +) { include irc::server @@ -124,12 +135,12 @@ define irc::network($desc, $servername, $serverdesc, $port, $sslport, mode => "0600", owner => "irc", group => "irc", - source => "${sslcert}", + source => $sslcert, require => File["/var/lib/ratbox/${name}"], } } else { ssl::certificate { "/var/lib/ratbox/${name}/ircd.pem": - cn => "${servername}", + cn => $servername, mode => "0600", owner => "irc", group => "irc", diff --git a/lsb/manifests/init.pp b/lsb/manifests/init.pp index 56e95fa..7551dec 100644 --- a/lsb/manifests/init.pp +++ b/lsb/manifests/init.pp @@ -1,4 +1,3 @@ - # Add LSB Core system components # class lsb::core { @@ -14,6 +13,9 @@ class lsb::core { "ubuntu": { $pkgname = "lsb-core" } + default: { + fail("lsb::core not supported on ${::operatingsystem}"} + } } package { "lsb-core": @@ -42,6 +44,9 @@ class lsb::desktop { "ubuntu": { $pkgname = "lsb-desktop" } + default: { + fail("lsb::desktop not supported on ${::operatingsystem}"} + } } package { "lsb-desktop": @@ -50,4 +55,3 @@ class lsb::desktop { } } - diff --git a/lynx/manifests/init.pp b/lynx/manifests/init.pp index 426489c..70957fb 100644 --- a/lynx/manifests/init.pp +++ b/lynx/manifests/init.pp @@ -1,4 +1,3 @@ - # Install Lynx WWW browser # # === Global variables: @@ -8,8 +7,8 @@ # class lynx { - if ! $www_default_url { - $www_default_url = "http://www.${domain}" + if ! $::www_default_url { + $www_default_url = "http://www.${::domain}" } if $::operatingsystem != "OpenBSD" { @@ -39,7 +38,7 @@ class lynx { default => "/etc/lynx-site.cfg", }, content => template("lynx/lynx-site.cfg.erb"), - mode => 0644, + mode => "0644", owner => "root", group => $::operatingsystem ? { "openbsd" => "wheel", diff --git a/motd/manifests/init.pp b/motd/manifests/init.pp index 3df5908..63814e2 100644 --- a/motd/manifests/init.pp +++ b/motd/manifests/init.pp @@ -1,4 +1,3 @@ - # Deploy motd file to server # class motd { @@ -9,6 +8,7 @@ class motd { ensure => absent, } } + default: { } } file { "/etc/motd": diff --git a/mutt/manifests/init.pp b/mutt/manifests/init.pp index 8fe08a1..664e17a 100644 --- a/mutt/manifests/init.pp +++ b/mutt/manifests/init.pp @@ -1,15 +1,16 @@ - +# Install mutt. +# class mutt { package { "mutt": ensure => installed, } - if ! $mail_server { - $mail_server = "mail.${domain}" + if ! $::mail_server { + $mail_server = "mail.${::domain}" } - if ! $mail_domain { - $mail_domain = $domain + if ! $::mail_domain { + $mail_domain = $::domain } case $::operatingsystem { diff --git a/raid/manifests/init.pp b/raid/manifests/init.pp index fad8c2f..aea5648 100644 --- a/raid/manifests/init.pp +++ b/raid/manifests/init.pp @@ -94,7 +94,7 @@ class raid::tools::mdadm { # class raid::tools::megacli { - if ! $raid_megacli_package { + if ! $::raid_megacli_package { fail("Must define \$raid_megacli_package") } @@ -102,18 +102,18 @@ class raid::tools::megacli { fail("raid::tools::megacli not supported in ${::operatingsystem}") } - file { "/usr/local/src/${raid_megacli_package}": + file { "/usr/local/src/${::raid_megacli_package}": ensure => present, mode => "0644", owner => "root", group => "root", - source => "puppet:///files/packages/${raid_megacli_package}", + source => "puppet:///files/packages/${::raid_megacli_package}", before => Package["MegaCli"], } package { "MegaCli": ensure => latest, provider => "rpm", - source => "/usr/local/src/${raid_megacli_package}", + source => "/usr/local/src/${::raid_megacli_package}", } } diff --git a/sasl/manifests/init.pp b/sasl/manifests/init.pp index 676c447..f7c060b 100644 --- a/sasl/manifests/init.pp +++ b/sasl/manifests/init.pp @@ -16,7 +16,7 @@ class sasl::client { }, } - if $kerberos_realm and $::operatingsystem != "OpenBSD" { + if $::kerberos_realm and $::operatingsystem != "OpenBSD" { package { "cyrus-sasl-gssapi": ensure => installed, name => $::operatingsystem ? { @@ -73,6 +73,7 @@ class sasl::saslauthd { notify => Service["saslauthd"], } } + default: { ) } file { "/etc/saslauthd.conf": @@ -111,6 +112,7 @@ class sasl::saslauthd { notify => Service["saslauthd"], } } + default: { } } } default: { diff --git a/selinux/manifests/init.pp b/selinux/manifests/init.pp index dc94323..a418402 100644 --- a/selinux/manifests/init.pp +++ b/selinux/manifests/init.pp @@ -9,7 +9,7 @@ # class selinux { - if $kernel != "Linux" { + if $::kernel != "Linux" { fail("SELinux supported only on Linux systems") } @@ -162,7 +162,7 @@ class selinux::restorecond { group => "root", seltype => "selinux_config_t", source => [ - "puppet:///files/selinux/restorecond.conf.${homename}", + "puppet:///files/selinux/restorecond.conf.${::homename}", "puppet:///files/selinux/restorecond.conf", "puppet:///modules/selinux/restorecond.conf", ], diff --git a/sks/manifests/init.pp b/sks/manifests/init.pp index a6f4878..81f8372 100644 --- a/sks/manifests/init.pp +++ b/sks/manifests/init.pp @@ -68,6 +68,7 @@ class sks($datadir=undef) { notify => Service["sks"], } } + default: { } } file { "/var/lib/sks/www": diff --git a/ssh/manifests/init.pp b/ssh/manifests/init.pp index 24c5aba..161bdef 100644 --- a/ssh/manifests/init.pp +++ b/ssh/manifests/init.pp @@ -17,10 +17,10 @@ class ssh::known_hosts { $::ipaddress6, $::ec2_public_ipv4) - @@sshkey { $homename: + @@sshkey { $::homename: ensure => present, type => rsa, - key => $sshrsakey, + key => $::sshrsakey, host_aliases => $aliases, require => File["/etc/ssh/ssh_known_hosts"], } @@ -161,6 +161,7 @@ class ssh::disable inherits ssh::server { before => Service["sshd"], } } + default: { } } Service["sshd"] { diff --git a/sudo/manifests/init.pp b/sudo/manifests/init.pp index 6a4f273..408fcdc 100644 --- a/sudo/manifests/init.pp +++ b/sudo/manifests/init.pp @@ -37,20 +37,22 @@ class sudo { } + # Install fake sudo # class sudo::fake { file { "/usr/bin/sudo": ensure => present, - mode => 0555, + mode => "0555", owner => "root", group => "root", source => "puppet:///modules/sudo/fakesudo", } - + } + # Add sudoer. # # === Parameters diff --git a/svn/manifests/init.pp b/svn/manifests/init.pp index c8e141c..b60da67 100644 --- a/svn/manifests/init.pp +++ b/svn/manifests/init.pp @@ -7,7 +7,7 @@ class svn { } file { "/etc/subversion/servers": - ensure => $http_proxy ? { + ensure => $::http_proxy ? { "" => absent, default => present, },