Leonard Ehrenfried
2013-Apr-28 09:40 UTC
[Puppet Users] Learning puppet: how to use a module?
Hi, I''m currently learning puppet but I have come across something which I can''t figure out from the docs. I have a rails app, which needs a few Ubuntu packages installed to work. Some of those come from a PPA, which is a non-standard repository, which needs to be added to the list of repos. I would like to automate this step, too. I have just one node where puppet needs to run, so I just have one file which I execute with `puppet apply`. I''m not using a puppetmaster. The pp file can be viewed here: https://github.com/lenniboy/jcheld/blob/master/puppet/jcheld.pp I have installed the puppetlabs-apt module and I can see that that was successful like this: $ puppet module list /home/lenni/.puppet/modules ├── puppetlabs-apt (v1.1.0) └── puppetlabs-stdlib (v4.0.2) Now, when I run puppet I get the following error: $ sudo puppet apply puppet/jcheld.pp Error: Could not find class apt for ip-10-59-51-209.eu-west-1.compute.internal on node ip-10-59-51-209.eu-west-1.compute.internal Error: Could not find class apt for ip-10-59-51-209.eu-west-1.compute.internal on node ip-10-59-51-209.eu-west-1.compute.internal I think it is likely that I''m not understanding something fundamentally about how modules are supposed to be used. Could someone help me out? Thanks Leonard -- 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+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Ellison Marks
2013-Apr-29 01:11 UTC
[Puppet Users] Re: Learning puppet: how to use a module?
From the puppet apply man page: When provided with a modulepath, via command line or config file, puppet apply can effectively mimic the catalog that would be served by puppet master with access to the same modules, although there are some subtle differences. When combined with scheduling and an automated system for pushing manifests, this can be used to implement a serverless Puppet site. http://docs.puppetlabs.com/man/apply.html So looks like you need to give it the path to where your modules are installed. This can be done with --modulepath=/path/to/module/dirctory on the command line or with the modulepath configuration setting in the agent section of your config file. On Sunday, April 28, 2013 2:40:01 AM UTC-7, Leonard Ehrenfried wrote:> > Hi, > > I''m currently learning puppet but I have come across something which I > can''t figure out from the docs. > > I have a rails app, which needs a few Ubuntu packages installed to work. > Some of those come from a PPA, which is a non-standard repository, which > needs to be added to the list of repos. I would like to automate this step, > too. > > I have just one node where puppet needs to run, so I just have one file > which I execute with `puppet apply`. I''m not using a puppetmaster. > > The pp file can be viewed here: > https://github.com/lenniboy/jcheld/blob/master/puppet/jcheld.pp > > I have installed the puppetlabs-apt module and I can see that that was > successful like this: > > $ puppet module list > /home/lenni/.puppet/modules > ├── puppetlabs-apt (v1.1.0) > └── puppetlabs-stdlib (v4.0.2) > > Now, when I run puppet I get the following error: > > $ sudo puppet apply puppet/jcheld.pp > Error: Could not find class apt for > ip-10-59-51-209.eu-west-1.compute.internal on node > ip-10-59-51-209.eu-west-1.compute.internal > Error: Could not find class apt for > ip-10-59-51-209.eu-west-1.compute.internal on node > ip-10-59-51-209.eu-west-1.compute.internal > > I think it is likely that I''m not understanding something fundamentally > about how modules are supposed to be used. > > Could someone help me out? > > Thanks > Leonard >-- 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+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
jcbollinger
2013-Apr-29 14:00 UTC
[Puppet Users] Re: Learning puppet: how to use a module?
On Sunday, April 28, 2013 4:40:01 AM UTC-5, Leonard Ehrenfried wrote:> > Hi, > > I''m currently learning puppet but I have come across something which I > can''t figure out from the docs. > > I have a rails app, which needs a few Ubuntu packages installed to work. > Some of those come from a PPA, which is a non-standard repository, which > needs to be added to the list of repos. I would like to automate this step, > too. > > I have just one node where puppet needs to run, so I just have one file > which I execute with `puppet apply`. I''m not using a puppetmaster. > > The pp file can be viewed here: > https://github.com/lenniboy/jcheld/blob/master/puppet/jcheld.pp > > I have installed the puppetlabs-apt module and I can see that that was > successful like this: > > $ puppet module list > /home/lenni/.puppet/modules > ├── puppetlabs-apt (v1.1.0) > └── puppetlabs-stdlib (v4.0.2) > > Now, when I run puppet I get the following error: > > $ sudo puppet apply puppet/jcheld.pp > Error: Could not find class apt for > ip-10-59-51-209.eu-west-1.compute.internal on node > ip-10-59-51-209.eu-west-1.compute.internal > Error: Could not find class apt for > ip-10-59-51-209.eu-west-1.compute.internal on node > ip-10-59-51-209.eu-west-1.compute.internal > > I think it is likely that I''m not understanding something fundamentally > about how modules are supposed to be used. >I think a key thing you have missed is that when you install a module by hand, you are meant to remove the leading "<provider>-" segment of its directory name. Use of such prefixes helps avoid accidentally clobbering one module''s contents with those of a distinct yet like-named module''s, but you cannot actually have two different modules with the same name installed (and functional) at the same time. John -- 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+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Leonard Ehrenfried
2013-May-03 13:04 UTC
[Puppet Users] Re: Learning puppet: how to use a module?
Thanks for the hint! It was indeed the missing module path. I now run puppet the following way, which works: sudo puppet apply --modulepath=/home/lenni/.puppet/modules/ puppet/jcheld.pp On Monday, April 29, 2013 3:11:51 AM UTC+2, Ellison Marks wrote:> > From the puppet apply man page: > > When provided with a modulepath, via command line or config file, puppet > apply can effectively mimic the catalog that would be served by puppet > master with access to the same modules, although there are some subtle > differences. When combined with scheduling and an automated system for > pushing manifests, this can be used to implement a serverless Puppet site. > http://docs.puppetlabs.com/man/apply.html > > So looks like you need to give it the path to where your modules are > installed. This can be done with --modulepath=/path/to/module/dirctory on > the command line or with the modulepath configuration setting in the agent > section of your config file. > > On Sunday, April 28, 2013 2:40:01 AM UTC-7, Leonard Ehrenfried wrote: >> >> Hi, >> >> I''m currently learning puppet but I have come across something which I >> can''t figure out from the docs. >> >> I have a rails app, which needs a few Ubuntu packages installed to work. >> Some of those come from a PPA, which is a non-standard repository, which >> needs to be added to the list of repos. I would like to automate this step, >> too. >> >> I have just one node where puppet needs to run, so I just have one file >> which I execute with `puppet apply`. I''m not using a puppetmaster. >> >> The pp file can be viewed here: >> https://github.com/lenniboy/jcheld/blob/master/puppet/jcheld.pp >> >> I have installed the puppetlabs-apt module and I can see that that was >> successful like this: >> >> $ puppet module list >> /home/lenni/.puppet/modules >> ├── puppetlabs-apt (v1.1.0) >> └── puppetlabs-stdlib (v4.0.2) >> >> Now, when I run puppet I get the following error: >> >> $ sudo puppet apply puppet/jcheld.pp >> Error: Could not find class apt for >> ip-10-59-51-209.eu-west-1.compute.internal on node >> ip-10-59-51-209.eu-west-1.compute.internal >> Error: Could not find class apt for >> ip-10-59-51-209.eu-west-1.compute.internal on node >> ip-10-59-51-209.eu-west-1.compute.internal >> >> I think it is likely that I''m not understanding something fundamentally >> about how modules are supposed to be used. >> >> Could someone help me out? >> >> Thanks >> Leonard >> >-- 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+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.