Jean-Baptiste Quenot
2008-Apr-09 14:53 UTC
[Puppet Users] Require not honored with generate() function?
Hi there, I''m having an issue with generate() function and the Require type. Here is the manifest snippet: file { "/etc/apache2/extra": mode => 755, owner => "root", group => "root", recurse => true, source => ''puppet:///conf/apache/extra'' } file { "/etc/apache2/htpasswd-all": ensure => present, mode => 644, owner => root, group => root, content => generate("/bin/cat", "/etc/apache2/extra/htpasswd_1", "/etc/apache2/extra/htpasswd_2", # FIXME this require has no effect! require => File["/etc/apache2/extra"] } When I run puppetd, I get this error: err: Could not retrieve catalog: Failed to execute generator /bin/cat: Execution of ''/bin/cat /etc/apache2/extra/htpasswd_1 /etc/apache2/extra/htpasswd_2'' returned 256: /bin/cat: /etc/apache2/extra/htpasswd_1: No such file or directory /bin/cat: /etc/apache2/extra/htpasswd_2: No such file or directory at /.../puppet/manifests/apache.pp:72 on node myhost The File["/etc/apache2/extra"] requirement is not honored. Seems like generate() is evaluated first. Any idea what is wrong here? Cheers, -- Jean-Baptiste Quenot http://caraldi.com/jbq/blog/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Luke Kanies
2008-Apr-09 14:56 UTC
[Puppet Users] Re: Require not honored with generate() function?
On Apr 9, 2008, at 9:53 AM, Jean-Baptiste Quenot wrote:> The File["/etc/apache2/extra"] requirement is not honored. Seems like > generate() is evaluated first. > > Any idea what is wrong here?Once again, you''re confusing what happens on the server vs. the client. *All* functions evaluate on the server. That exception you''re seeing is generated on the server. Relationships only matter on the client. -- ''Tis better to be silent and be thought a fool, than to speak and remove all doubt. --Abraham Lincoln --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Jean-Baptiste Quenot
2008-Apr-09 15:04 UTC
[Puppet Users] Re: Require not honored with generate() function?
OK I''ll try to write a custom type then. Thanks for your answers. If that kind of things is written in the "pulling strings" book, I''ll definitely have to buy a copy :-) -- Jean-Baptiste Quenot http://caraldi.com/jbq/blog/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Luke Kanies
2008-Apr-09 15:06 UTC
[Puppet Users] Re: Require not honored with generate() function?
On Apr 9, 2008, at 10:04 AM, Jean-Baptiste Quenot wrote:> OK I''ll try to write a custom type then. Thanks for your answers. > > If that kind of things is written in the "pulling strings" book, I''ll > definitely have to buy a copy :-)I don''t know that it is; it''s just something you have to understand about how responsibilities are split. Watching your server logs in addition to your client logs (especially when testing new code), or at least recognizing when an error is likely to have been generated on the server, is a good place to start. -- Consistency requires you to be as ignorant today as you were a year ago. -- Bernard Berenson --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
James Turnbull
2008-Apr-09 20:39 UTC
[Puppet Users] Re: Require not honored with generate() function?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Luke Kanies wrote:> On Apr 9, 2008, at 10:04 AM, Jean-Baptiste Quenot wrote: > >> OK I''ll try to write a custom type then. Thanks for your answers. >> >> If that kind of things is written in the "pulling strings" book, I''ll >> definitely have to buy a copy :-) > I don''t know that it is; it''s just something you have to understand > about how responsibilities are split.It is indeed written there along with many other useful pieces of information. :) *beats his book drum* Regards James Turnbull - -- James Turnbull (james@lovedthanlost.net) - -- Author of: - - Pulling Strings with Puppet (http://www.amazon.com/gp/product/1590599780/) - - Pro Nagios 2.0 (http://www.amazon.com/gp/product/1590596099/) - - Hardening Linux (http://www.amazon.com/gp/product/1590594444/) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFH/SmZ9hTGvAxC30ARAjQpAJ95WImSU6pbJJYuCwOdxhxp+TUvHwCdEDsD 9+MZAo+mrfksPnF299VJ+jY=dZ2Q -----END PGP SIGNATURE----- --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Evan Hisey
2008-Apr-09 21:34 UTC
[Puppet Users] Re: Require not honored with generate() function?
On Wed, Apr 9, 2008 at 3:39 PM, James Turnbull <james@lovedthanlost.net> wrote:> > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > Luke Kanies wrote: > > On Apr 9, 2008, at 10:04 AM, Jean-Baptiste Quenot wrote: > > > > It is indeed written there along with many other useful pieces of > information. :) > > *beats his book drum* >Question about your generate example in the book, it looks to me to me like that example is showing a "client" use of generate. From waht Luke said that should not work. It would in practice give you a list of the server eth0 setting instead of hte client. Evan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
James Turnbull
2008-Apr-09 21:49 UTC
[Puppet Users] Re: Require not honored with generate() function?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Evan Hisey wrote:> On Wed, Apr 9, 2008 at 3:39 PM, James Turnbull <james@lovedthanlost.net> wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> >> Luke Kanies wrote: >> > On Apr 9, 2008, at 10:04 AM, Jean-Baptiste Quenot wrote: >> > >> >> It is indeed written there along with many other useful pieces of >> information. :) >> >> *beats his book drum* >> > Question about your generate example in the book, it looks to me to me > like that example is showing a "client" use of generate. From waht > Luke said that should not work. It would in practice give you a list > of the server eth0 setting instead of hte client.Its not a client use - that call would generate and return the results of ifconfig eth0 on the server - as the start of the section states: "Functions only run on the Puppet master. They are executed when the configuration on the master is parsed and compiled. So when you execute functions, you only have access to the resources on the master plus any Facter facts gathered from your nodes." Regards James Turnbull - -- James Turnbull (james@lovedthanlost.net) Author of: * Pulling Strings with Puppet (http://www.amazon.com/gp/product/1590599780/) * Pro Nagios 2.0 (http://www.amazon.com/gp/product/1590596099/) * Hardening Linux (http://www.amazon.com/gp/product/1590594444/) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFH/Tn39hTGvAxC30ARAhFMAJ4uyuV1rQhVhW1E+gsJW+Tibn1S6ACfUg8H ev/sADGtobL5pMurhWX9iEY=eBVi -----END PGP SIGNATURE----- --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---