Alexandros Kosiaris has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/331960 )

Change subject: base module linting changes
......................................................................


base module linting changes

Add missing trailing commas

Use class full names for includes, as relative names are not allowed in
future Puppet versions

Quote values in selectors

Change-Id: I8bf871e38b0fbefc6948be626f173f38f30e1ca3
---
M modules/base/manifests/certificates.pp
M modules/base/manifests/environment.pp
M modules/base/manifests/firewall.pp
M modules/base/manifests/init.pp
M modules/base/manifests/labs.pp
M modules/base/manifests/monitoring/host.pp
M modules/base/manifests/phaste.pp
M modules/base/manifests/puppet.pp
M modules/base/manifests/service_unit.pp
M modules/base/manifests/standard_packages.pp
10 files changed, 52 insertions(+), 52 deletions(-)

Approvals:
  Alexandros Kosiaris: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/base/manifests/certificates.pp 
b/modules/base/manifests/certificates.pp
index 74a694b..0601302 100644
--- a/modules/base/manifests/certificates.pp
+++ b/modules/base/manifests/certificates.pp
@@ -23,7 +23,7 @@
     $puppet_ssl_dir = puppet_ssldir()
 
     sslcert::ca { 'Puppet_Internal_CA':
-        source => "${puppet_ssl_dir}/certs/ca.pem"
+        source => "${puppet_ssl_dir}/certs/ca.pem",
     }
 
     # install all CAs before generating certificates
diff --git a/modules/base/manifests/environment.pp 
b/modules/base/manifests/environment.pp
index 3599a92..4a95fc8 100644
--- a/modules/base/manifests/environment.pp
+++ b/modules/base/manifests/environment.pp
@@ -19,7 +19,7 @@
                         /^#alias ll=/ s/^#//
                         /^#alias la=/ s/^#//
                     ' /root/.bashrc",
-                onlyif  => "grep -q '^#alias ll' /root/.bashrc"
+                onlyif  => "grep -q '^#alias ll' /root/.bashrc",
             }
 
             file { '/etc/profile.d/mysql-ps1.sh':
@@ -73,7 +73,7 @@
     ### Settings commons to all realms
 
     $wikimedia_cluster = $::realm ? {
-        labs    => "labs\n",
+        'labs'  => "labs\n",
         default => "${::site}\n",
     }
 
diff --git a/modules/base/manifests/firewall.pp 
b/modules/base/manifests/firewall.pp
index 69b5b5e..130c984 100644
--- a/modules/base/manifests/firewall.pp
+++ b/modules/base/manifests/firewall.pp
@@ -1,8 +1,8 @@
 # Don't include this sub class on all hosts yet
 # NOTE: Policy is DROP by default
 class base::firewall($ensure = 'present') {
-    include network::constants
-    include ferm
+    include ::network::constants
+    include ::ferm
 
     $defscontent = $::realm ? {
         'labs'  => template('base/firewall/defs.erb', 
'base/firewall/defs.labs.erb'),
diff --git a/modules/base/manifests/init.pp b/modules/base/manifests/init.pp
index f0550f7..232a3e0 100644
--- a/modules/base/manifests/init.pp
+++ b/modules/base/manifests/init.pp
@@ -1,5 +1,5 @@
 class base {
-    include apt
+    include ::apt
 
     file { '/usr/local/sbin':
         ensure => directory,
@@ -10,43 +10,43 @@
 
     $puppetmaster = hiera('puppetmaster')
 
-    class { 'base::puppet':
+    class { '::base::puppet':
         server   => $puppetmaster,
     }
 
     # Temporary workaround for T140100. Remove as soon as Labs instances get
     # grub-pc or trusty gets phased out from Labs, whichever comes first.
     if ($::realm == 'production') or (os_version('debian >= jessie')) {
-        include grub::defaults
+        include ::grub::defaults
     }
 
-    include passwords::root
-    include base::resolving
+    include ::passwords::root
+    include ::base::resolving
     include ::rsyslog
-    include base::remote_syslog
-    include base::sysctl
+    include ::base::remote_syslog
+    include ::base::sysctl
     include ::motd
-    include base::standard_packages
-    include base::environment
-    include base::phaste
-    include base::screenconfig
-    include base::certificates
-    include ssh::client
-    include ssh::server
-    include role::salt::minions
+    include ::base::standard_packages
+    include ::base::environment
+    include ::base::phaste
+    include ::base::screenconfig
+    include ::base::certificates
+    include ::ssh::client
+    include ::ssh::server
+    include ::role::salt::minions
     include ::trebuchet
-    include nrpe
-    include base::kernel
-    include base::debdeploy
+    include ::nrpe
+    include ::base::kernel
+    include ::base::debdeploy
 
     # lint:ignore:quoted_booleans
     if $::is_virtual == 'false' {
-        include ipmi::monitor
+        include ::ipmi::monitor
     }
     # lint:endignore
 
     if os_version('debian >= jessie') {
-        include base::initramfs
+        include ::base::initramfs
     }
 
     # include base::monitor::host.
@@ -55,7 +55,7 @@
 
     $group_contact = hiera('contactgroups', 'admins')
 
-    class { 'base::monitoring::host':
+    class { '::base::monitoring::host':
         contact_group => $group_contact,
     }
 
diff --git a/modules/base/manifests/labs.pp b/modules/base/manifests/labs.pp
index 63a39cc..4a3f0ad 100644
--- a/modules/base/manifests/labs.pp
+++ b/modules/base/manifests/labs.pp
@@ -1,6 +1,6 @@
 class base::labs inherits base {
-    include apt::unattendedupgrades,
-        apt::noupgrade
+    include ::apt::unattendedupgrades
+    include ::apt::noupgrade
 
     # Labs instances /var is quite small, provide our own default
     # to keep less records (T71604).
@@ -59,7 +59,7 @@
         user { 'root':
             password => regsubst(
                 generate('/usr/local/sbin/make-labs-root-password', 
$::labsproject),
-                '\s$', '')
+                '\s$', ''),
         }
     }
 }
diff --git a/modules/base/manifests/monitoring/host.pp 
b/modules/base/manifests/monitoring/host.pp
index 4f535e5..0781f23 100644
--- a/modules/base/manifests/monitoring/host.pp
+++ b/modules/base/manifests/monitoring/host.pp
@@ -29,14 +29,14 @@
     $nrpe_check_disk_options = '-w 6% -c 3% -l -e -A -i "/srv/sd[a-b][1-3]" 
--exclude-type=tracefs',
     $nrpe_check_disk_critical = false,
 ) {
-    include base::puppet::params # In order to be able to use some variables
+    include ::base::puppet::params # In order to be able to use some variables
 
     # RAID checks
-    include raid
+    include ::raid
 
-    monitoring::host { $::hostname: }
+    ::monitoring::host { $::hostname: }
 
-    monitoring::service { 'ssh':
+    ::monitoring::service { 'ssh':
         description   => 'SSH',
         check_command => 'check_ssh',
     }
@@ -79,7 +79,7 @@
         source => 'puppet:///modules/base/monitoring/check_ipmi_sensor',
     }
 
-    sudo::user { 'nagios_puppetrun':
+    ::sudo::user { 'nagios_puppetrun':
         user       => 'nagios',
         privileges => ['ALL = NOPASSWD: 
/usr/local/lib/nagios/plugins/check_puppetrun'],
     }
@@ -89,37 +89,37 @@
     # labsnagiosbuilder/templates/classes/base.cfg under labs/nagios-builder
     # to reflect this check name
     if $::realm == 'labs' {
-        nrpe::monitor_service { 'root_disk_space':
+        ::nrpe::monitor_service { 'root_disk_space':
             description  => 'Disk space on /',
             nrpe_command => '/usr/lib/nagios/plugins/check_disk -w 5% -c 2% -l 
-e -p /',
         }
     }
 
-    nrpe::monitor_service { 'disk_space':
+    ::nrpe::monitor_service { 'disk_space':
         description  => 'Disk space',
         critical     => $nrpe_check_disk_critical,
         nrpe_command => "/usr/lib/nagios/plugins/check_disk 
${nrpe_check_disk_options}",
     }
 
-    nrpe::monitor_service { 'dpkg':
+    ::nrpe::monitor_service { 'dpkg':
         description  => 'DPKG',
         nrpe_command => '/usr/local/lib/nagios/plugins/check_dpkg',
     }
     $warninginterval = $base::puppet::params::freshnessinterval
     $criticalinterval = $base::puppet::params::freshnessinterval * 2
-    nrpe::monitor_service { 'puppet_checkpuppetrun':
+    ::nrpe::monitor_service { 'puppet_checkpuppetrun':
         description  => 'puppet last run',
         nrpe_command => "/usr/bin/sudo 
/usr/local/lib/nagios/plugins/check_puppetrun -w ${warninginterval} -c 
${criticalinterval}",
     }
-    nrpe::monitor_service {'check_eth':
+    ::nrpe::monitor_service {'check_eth':
         description  => 'configured eth',
         nrpe_command => '/usr/local/lib/nagios/plugins/check_eth',
     }
-    nrpe::monitor_service { 'check_dhclient':
+    ::nrpe::monitor_service { 'check_dhclient':
         description  => 'dhclient process',
         nrpe_command => '/usr/lib/nagios/plugins/check_procs -w 0:0 -c 0:0 -C 
dhclient',
     }
-    nrpe::monitor_service { 'check_salt_minion':
+    ::nrpe::monitor_service { 'check_salt_minion':
         description  => 'salt-minion processes',
         nrpe_command => "/usr/lib/nagios/plugins/check_procs -w 1: -c 1:4 
--ereg-argument-array '^/usr/bin/python /usr/bin/salt-minion'",
     }
@@ -131,7 +131,7 @@
             group  => 'root',
             mode   => '0555',
         }
-        nrpe::monitor_service { 'check_systemd_state':
+        ::nrpe::monitor_service { 'check_systemd_state':
             description  => 'Check systemd state',
             nrpe_command => 
'/usr/local/lib/nagios/plugins/check_systemd_state',
         }
diff --git a/modules/base/manifests/phaste.pp b/modules/base/manifests/phaste.pp
index 2b9b56c..ae01259 100644
--- a/modules/base/manifests/phaste.pp
+++ b/modules/base/manifests/phaste.pp
@@ -4,7 +4,7 @@
 # onto Phabricator.
 #
 class base::phaste( $ensure = present ) {
-    include passwords::phabricator
+    include ::passwords::phabricator
 
     $conf = {
         user => 'ProdPasteBot',
diff --git a/modules/base/manifests/puppet.pp b/modules/base/manifests/puppet.pp
index 299bfb1..343adb2 100644
--- a/modules/base/manifests/puppet.pp
+++ b/modules/base/manifests/puppet.pp
@@ -3,8 +3,8 @@
     $certname=undef,
     $dns_alt_names=undef,
     ) {
-    include passwords::puppet::database
-    include base::puppet::params
+    include ::passwords::puppet::database
+    include ::base::puppet::params
     $interval = $base::puppet::params::interval
     $crontime = $base::puppet::params::crontime
     $freshnessinterval = $base::puppet::params::freshnessinterval
@@ -51,7 +51,7 @@
         }
     }
 
-    class { 'puppet_statsd':
+    class { '::puppet_statsd':
         statsd_host   => 'statsd.eqiad.wmnet',
         metric_format => 'puppet.<%= metric %>',
     }
@@ -81,7 +81,7 @@
         mode    => '0555',
         owner   => 'root',
         group   => 'root',
-        content => template('base/puppet-run.erb')
+        content => template('base/puppet-run.erb'),
     }
 
     file { '/usr/local/sbin/run-no-puppet':
diff --git a/modules/base/manifests/service_unit.pp 
b/modules/base/manifests/service_unit.pp
index f44cdf4..69a5550 100644
--- a/modules/base/manifests/service_unit.pp
+++ b/modules/base/manifests/service_unit.pp
@@ -119,7 +119,7 @@
                 owner  => 'root',
                 group  => 'root',
                 mode   => '0555',
-                before => File[$path]
+                before => File[$path],
             }
         }
 
@@ -153,13 +153,13 @@
 
     if $declare_service {
         $enable = $ensure ? {
-            present => true,
-            default => false,
+            'present' => true,
+            default   => false,
         }
         $base_params = {
             ensure   => ensure_service($ensure),
             provider => $::initsystem,
-            enable   => $enable
+            enable   => $enable,
         }
         $params = merge($base_params, $service_params)
         ensure_resource('service', $name, $params)
diff --git a/modules/base/manifests/standard_packages.pp 
b/modules/base/manifests/standard_packages.pp
index 2179d40..0654a0c 100644
--- a/modules/base/manifests/standard_packages.pp
+++ b/modules/base/manifests/standard_packages.pp
@@ -45,7 +45,7 @@
     package { 'tzdata': ensure => latest }
 
     if $::network_zone == 'internal' {
-        include nrpe
+        include ::nrpe
     }
 
     # uninstall these packages

-- 
To view, visit https://gerrit.wikimedia.org/r/331960
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8bf871e38b0fbefc6948be626f173f38f30e1ca3
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Juniorsys <juniorsys_wikime...@outlook.com>
Gerrit-Reviewer: Alexandros Kosiaris <akosia...@wikimedia.org>
Gerrit-Reviewer: Gehel <gleder...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to