Elukey has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/331332 )

Change subject: Introduce linters using rake
......................................................................


Introduce linters using rake

Add a Rakefile and depends on puppet-syntax/puppet-lint. That lets one
easily check syntax of manifests and templates as well as puppet style
recommandation (puppet-lint).

Ignore puppet-lint 80 chars line limit.
Instruct puppet-lint to threat module with relative path or it fails
under Jenkins which checkout the source code in a directory named after
the job.

Fix ensure found on line but not as first attribute in
manifests/server.pp

Add Gem dependecy safe_yaml ~> 1.0.4 since Puppet 3.7 fails on ruby 2.2+
(eg ruby2.4 on Mac). https://tickets.puppetlabs.com/browse/PUP-3796

Git ignore Gemfile.lock, that is only needed for deployment purposes.

Bug: T154894
Change-Id: Id8e19ee14cc1673e84278b30a5e4eddf5192ea77
---
A .gitignore
A .puppet-lint.rc
A Gemfile
A Rakefile
M manifests/server.pp
5 files changed, 32 insertions(+), 1 deletion(-)

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



diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..66f8ed3
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/Gemfile.lock
diff --git a/.puppet-lint.rc b/.puppet-lint.rc
new file mode 100644
index 0000000..b0d12b7
--- /dev/null
+++ b/.puppet-lint.rc
@@ -0,0 +1 @@
+--no-80chars-check
diff --git a/Gemfile b/Gemfile
new file mode 100644
index 0000000..1416f0a
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,10 @@
+source 'https://rubygems.org'
+
+gem 'rake'
+gem 'puppet', '~> 3.7.0'
+# Puppet 3.7 fails on ruby 2.2+
+# https://tickets.puppetlabs.com/browse/PUP-3796
+gem 'safe_yaml', '~> 1.0.4'
+
+gem 'puppet-lint', '1.1.0'
+gem 'puppet-syntax'
diff --git a/Rakefile b/Rakefile
new file mode 100644
index 0000000..a15ba1a
--- /dev/null
+++ b/Rakefile
@@ -0,0 +1,19 @@
+require 'bundler/setup'
+require 'puppet-lint/tasks/puppet-lint'
+require 'puppet-syntax/tasks/puppet-syntax'
+
+# To please Jenkins
+# https://github.com/rodjek/puppet-lint/issues/361
+PuppetLint.configuration.relative = true
+
+task :default => [:help]
+
+desc 'Run all build/tests commands (CI entry point)'
+task :test => [
+    :syntax,
+    :lint,
+]
+
+task :help do
+    system "rake -T"
+end
diff --git a/manifests/server.pp b/manifests/server.pp
index 3cc2262..7382870 100644
--- a/manifests/server.pp
+++ b/manifests/server.pp
@@ -79,11 +79,11 @@
     }
 
     cron { 'zookeeper-cleanup':
+        ensure  => $cleanup_cron_ensure,
         command => "${cleanup_script} ${cleanup_script_args}",
         minute  => 10,
         hour    => 0,
         user    => 'zookeeper',
-        ensure  => $cleanup_cron_ensure,
         require => Service['zookeeper'],
     }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id8e19ee14cc1673e84278b30a5e4eddf5192ea77
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet/zookeeper
Gerrit-Branch: master
Gerrit-Owner: Hashar <has...@free.fr>
Gerrit-Reviewer: Elukey <ltosc...@wikimedia.org>
Gerrit-Reviewer: Hashar <has...@free.fr>
Gerrit-Reviewer: Ottomata <ao...@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