Slightly Off-Topic: CI Test of Puppet module fail

18 views
Skip to first unread message

Thomas Bendler

unread,
Jan 19, 2016, 6:55:25 AM1/19/16
to puppet-users

​Hello,

I have a small problem with a Puppet module I've wrote​. The module is:


When I check the module locally with:

bundle exec rake validate && bundle exec rake lint && bundle exec rake spec SPEC_OPTS='--format documentation'

​it says everything is fine. When I deploy the module on my test box, it work fine. When I pass my commit to Travis CI, it fail:


Any Ideas?

Regards Thomas​
--
Linux ... enjoy the ride!

Gareth Rushgrove

unread,
Jan 19, 2016, 7:31:34 AM1/19/16
to puppet...@googlegroups.com
The error from Travis suggests a linting issue, specifically:

manifests/config/mysql.pp - WARNING: ensure found on line but it's
not the first attribute on line 24

My guess for why you're not seeing that locally, but it's coming up in
Travis is that the version of puppet-lint is unspecified. I'd wager
that locally you have an older version, but Travis is installing the
latest.

https://github.com/thbe/puppet-bacula/blob/master/Gemfile#L7

Looking at this more closely however the plot thickens. It looks like
it might be a bug in puppet-lint.

https://github.com/thbe/puppet-bacula/blob/master/manifests/config/mysql.pp#L24

The code referenced does use ensure, but as an attribute of a nested
data structure, not as a parameter.

Two options present:

* Add a control comment to ignore the check for that line, described
here: http://puppet-lint.com/controlcomments/
* Determine the local version of puppet-lint that is passing the check
and pin to that version in your Gemfile

I'd also open the issue over on
https://github.com/rodjek/puppet-lint/issues as I think it's a bug.

Cheers (and definitely not off-topic. This list is for pretty-much
anything that's useful to users of Puppet in my view.

Gareth
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CAELoU1OO_vbiJoG2gmEEbnjE23LnUvH7yYJZmk4t_W9NoK_rSg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



--
Gareth Rushgrove
@garethr

devopsweekly.com
morethanseven.net
garethrushgrove.com

Thomas Bendler

unread,
Jan 19, 2016, 9:19:22 AM1/19/16
to puppet-users
Hi Gareth,

thanks a lot, using the control comment fixed my problem and the CI run is now passing.

Regards Thomas


For more options, visit https://groups.google.com/d/optout.



--
performance, security, automation, SAP
cimt consulting ag, Burchardstrasse 17, 20095 Hamburg
fon: +49 (163) 6081 302, fax: +49 (40) 5 33 02-22, web: www.cimt.de
key: FED7C867 at pgp.mit.edu

Sitz der Gesellschaft: Hamburg, Amtsgericht Hamburg, HRB 74173
Vorstand: Christoph Friedlaender, Dr.-Ing. Thorsten Kuhlmann
Vorsitzender des Aufsichtsrats: Christian Gottsmann

Garrett Honeycutt

unread,
Jan 20, 2016, 1:52:39 PM1/20/16
to puppet...@googlegroups.com
Hi,

puppet-lint is not actively maintained - the last commit is April 11th,
2015. If you install it from rubygems, the latest release is 1.1.0
though GitHub reads that there have been 58 commits to master since then.

In order to get the latest version, you need to install from git. Here's
the line to use in your Gemfile

gem 'puppet-lint', :git => 'https://github.com/rodjek/puppet-lint.git'

If you are interested in extending your style with other community
puppet-lint plugins, here is what I use in my Gemfile's

gem 'puppet-lint-absolute_classname-check'
gem 'puppet-lint-alias-check'
gem 'puppet-lint-empty_string-check'
gem 'puppet-lint-file_ensure-check'
gem 'puppet-lint-file_source_rights-check'
gem 'puppet-lint-fileserver-check'
gem 'puppet-lint-leading_zero-check'
gem 'puppet-lint-spaceship_operator_without_tag-check'
gem 'puppet-lint-trailing_comma-check'
gem 'puppet-lint-undef_in_function-check'
gem 'puppet-lint-unquoted_string-check'
gem 'puppet-lint-variable_contains_upcase'

Best regards,
-g

--
Garrett Honeycutt
@learnpuppet
Puppet Training with LearnPuppet.com
Mobile: +1.206.414.8658
Reply all
Reply to author
Forward
0 new messages