using stdlib module

1,385 views
Skip to first unread message

Shantanu

unread,
Apr 8, 2012, 9:39:40 PM4/8/12
to Puppet Users

I am trying to get stdlib installed and working as mentioned in the
module of the week blog post -
http://puppetlabs.com/blog/module-of-the-week-puppetlabsstdlib-puppet-labs-standard-library/
.

I ran following file_line test without noop mode. It created the
required file however it didn't agree to the fact that 'dan is
awesome' (created empty file).

{{{
$ puppet apply stdlib/tests/file_line.pp
notice: /Stage[main]//File[/tmp/dansfile]/ensure: created
notice: Finished catalog run in 0.02 seconds

$ cat /tmp/dansfile
$
}}}

I tried to use some of the functions in stdlib, e.g. validates_re,
however that resulted in 'Unknown function' error. So I am not sure if
this module is installed correctly. Following is the system
information:
* CentOS release 6.2
* ruby 1.8.7
* facter 1.6.6
* Puppet 2.6.14
* stdlib was installed using puppet-module, however initially I had
manually cloned stdlib git repository which didn't work as well.

Appreciate any help on how to debug this further.

--
Thanks,
Shantanu

harveyzh

unread,
Apr 9, 2012, 12:57:09 PM4/9/12
to Puppet Users
Shantanu:

There is a related thread - "stdlib module not working" - :

https://groups.google.com/group/puppet-users/browse_thread/thread/9a2502a8fb4f4d50/3f988a9300c78ed2?lnk=gst&q=stdlib#3f988a9300c78ed2

On Apr 9, 9:39 am, Shantanu <knowshant...@gmail.com> wrote:
> I am trying to get stdlib installed and working as mentioned in the
> module of the week blog post -http://puppetlabs.com/blog/module-of-the-week-puppetlabsstdlib-puppet...

Jeff McCune

unread,
Apr 9, 2012, 2:14:30 PM4/9/12
to puppet...@googlegroups.com
On Mon, Apr 9, 2012 at 12:57 PM, harveyzh <zh.j...@gmail.com> wrote:
Shantanu:

There is  a related thread - "stdlib module not working" - :


Yes, I think the take away from that thread as it relates to this issue is to specify:

file_line { '/tmp/dansfile':
  ensure => present,
  ...
}

The other issue you mentioned with functions appears to be an separate issue.  I believe Puppet 2.6 has problems loading functions from modules if you're using puppet apply instead of puppet agent with pluginsync.

Please try Puppet 2.7 if you'd like to use puppet apply with stdlib in the modulepath.

Hope this helps,
-Jeff McCune

Shantanu

unread,
Apr 9, 2012, 2:37:29 PM4/9/12
to Puppet Users


On Apr 9, 1:14 pm, Jeff McCune <j...@puppetlabs.com> wrote:
Thanks for the help - harveyzh and Jeff.

It's working fine after I added 'ensure => present' line to the
manifest.

The issue with functions is resolved as well. I had typos in couple of
function names that I had tried and hence it was returning 'unknown
function' error. It worked fine for me with 'puppet apply' as well.

--
Shantanu
Reply all
Reply to author
Forward
0 new messages