Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Puppet: stdlib installed but not available in namespace?

as a puppet newbie, I have a problem including the stdlib plugin

I would like to use stdlib's file_line, thus I try to include stdlib and call it

class service_mon
{
  include stdlib
  file_line 
  {
    "${name}_services": path=> ...
  }
}

However, I get an error message, that stdlib cannot been found

err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class stdlib for my.node.name at /etc/puppet/workspace/dev/src/modules/mymanifest/manifests/deploy.pp:87 on node my.node.name

which makes me wonder since stdlib should be installed(?) ...or?

puppet module install puppetlabs-stdli

puppet module list
/etc/puppet/modules
└── puppetlabs-stdlib (v4.2.2)
/usr/share/puppet/modules (no modules installed)

puppet config print modulepath
/etc/puppet/modules:/usr/share/puppet/modules

So, I guess in principle all necessary files are 'there' but how can I convince Puppet to include stdlib as well?

like image 326
THX Avatar asked Oct 21 '22 06:10

THX


1 Answers

Puppet modules do not work like java modules - include stdlib would only make sense if there actually was a class stdlib in the module which did something useful, which is not the case.

Note: Many Puppet modules do have such a class that serves as the central entry point, but stdlib is a notable exception.

You can use the parser functions from stdlib by just calling them. As for the types, those just become available to Puppet if

  • the module is installed inside your $modulepath and
  • you have pluginsync enabled on your agents

You can use file_line without any ado.

like image 158
Felix Frank Avatar answered Oct 23 '22 22:10

Felix Frank