Ask Your Question

usage of class - stdlib

asked 2015-01-27 06:42:11 -0500

thampi_lakshmi gravatar image

updated 2015-01-28 19:55:51 -0500

GregLarkin gravatar image

Trying to use class stdlib's function - file_line to add a new line in the file /etc/profile

class postgresql::profilechange1{

  file_line{'Path updation':
    ensure => present,
    line => 'PATH=$PATH:/usr/local/pgsql/bin\n',
    path => '/etc/profile',

But with this response

 Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type stdlib::file_line

Please suggest the best way to include a class without this error

edit retag flag offensive close merge delete


Have you installed the stdlib module in your modules directory? It looks like it is not finding stdlib.

lorcutt gravatar imagelorcutt ( 2015-01-27 10:53:42 -0500 )edit

What is the output of "puppet config print modulepath" or post a link to a pastebin of your puppet.conf file, please.

GregLarkin gravatar imageGregLarkin ( 2015-01-28 20:07:00 -0500 )edit

root@sys-server:/home/lakshmi# puppet config print modulepath /etc/puppet/modules The link puppet.conf

thampi_lakshmi gravatar imagethampi_lakshmi ( 2015-01-29 00:44:36 -0500 )edit

2 Answers

Sort by » oldest newest most voted

answered 2015-01-27 23:58:11 -0500

thampi_lakshmi gravatar image

Yes i have installed stdlib module and it is available at lakshmi@sys-server:/etc/puppet/modules$ sudo puppet module list /etc/puppet/modules âââ puppetlabs-concat (v1.1.2) âââ puppetlabs-stdlib (v4.5.1)

the version of puppet being run is lakshmi@sys-server:/etc/puppet/modules$ sudo puppet --version 3.4.3

Can you throw some light on the bug reported

Seems similar to me, but couldnt find a solution to the problem

edit flag offensive delete link more

answered 2015-02-03 03:11:46 -0500

GregLarkin gravatar image

I don't think bug #16568 that you referenced is part of this issue that you reported. I just created a test file like this:

file_line { 'Path updation':
  ensure => present,
  line   => 'PATH=$PATH:/usr/local/pgsql/bin',
  path   => '/etc/profile',

I was able to use puppet apply to add the desired line to my /etc/profile file. One thing to be aware of is that you don't need the explicit newline character at the end of the line, and if you use single quotes around the string, it will be placed as a literal in your PATH line, which is probably not what you want.

Since it appears that your stdlib module is installed correctly, but puppet does not find it during execution, please add the "--debug --trace" options to the command line and post the output for review.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-01-27 06:42:11 -0500

Seen: 524 times

Last updated: Feb 03 '15