The puppet documentation at http://docs.puppetlabs.com/references/stable/function.html says for the require function, that: "Evaluate one or more classes, adding the required class as a dependency." This implies that any resources in the required class are automatically added as a dependancy. I''m NOT seeing this behaviour. How is it supposed to work? Doug -- 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.
On Tue, Sep 6, 2011 at 11:52 AM, Douglas Garstang <doug.garstang@gmail.com> wrote:> The puppet documentation at > http://docs.puppetlabs.com/references/stable/function.html says for > the require function, that: > > "Evaluate one or more classes, adding the required class as a dependency." > > This implies that any resources in the required class are > automatically added as a dependancy. I''m NOT seeing this behaviour. > How is it supposed to work? > > Doug >Actually, more specifically, I have this: class platform::common { file { ''/etc/somedir'': ensure => directory; } class webapp::common { require "platform::common" file { "/etc/somedir/configfile": # stuff here. } } When puppet runs, it''s trying to apply the file /etc/somedir/configfile _before_ /etc/somedir. This seems to contradict the behaviour the documentation describes. Doug. -- Regards, Douglas Garstang http://www.linkedin.com/in/garstang Email: doug.garstang@gmail.com Cell: +1-805-340-5627 -- 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.
On Sep 6, 2011, at 11:58 AM, Douglas Garstang wrote:> On Tue, Sep 6, 2011 at 11:52 AM, Douglas Garstang > <doug.garstang@gmail.com> wrote: >> The puppet documentation at >> http://docs.puppetlabs.com/references/stable/function.html says for >> the require function, that: >> >> "Evaluate one or more classes, adding the required class as a dependency." >> >> This implies that any resources in the required class are >> automatically added as a dependancy. I''m NOT seeing this behaviour. >> How is it supposed to work? >> >> Doug >> > > Actually, more specifically, I have this: > > class platform::common { > file { > ''/etc/somedir'': > ensure => directory; > } > > class webapp::common { > require "platform::common" > file { > "/etc/somedir/configfile": > # stuff here. > } > } > > When puppet runs, it''s trying to apply the file > /etc/somedir/configfile _before_ /etc/somedir. This seems to > contradict the behaviour the documentation describes.---- Suggest you try this... class webapp::common { include platform::common file { "/etc/somedir/configfile": require => Class["platform::common"], # stuff here. } } Craig -- 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.
----- Original Message -----> > class platform::common { > > file { > > ''/etc/somedir'': > > ensure => directory; > > } > > > > class webapp::common { > > require "platform::common" > > file { > > "/etc/somedir/configfile": > > # stuff here. > > } > > } > > > > When puppet runs, it''s trying to apply the file > > /etc/somedir/configfile _before_ /etc/somedir. This seems to > > contradict the behaviour the documentation describes. > ---- > Suggest you try this... > class webapp::common { > include platform::common > file { > "/etc/somedir/configfile": > require => Class["platform::common"], > # stuff here. > } > }files auto require their parents, it''s not even needed to do the require => or require() He''s not showing actual code, log lines or errors. -- 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.
That''s a feature in newish versions, right? On Sep 6, 2011 12:55 PM, "R.I.Pienaar" <rip@devco.net> wrote:> > > ----- Original Message ----- >> > class platform::common { >> > file { >> > ''/etc/somedir'': >> > ensure => directory; >> > } >> > >> > class webapp::common { >> > require "platform::common" >> > file { >> > "/etc/somedir/configfile": >> > # stuff here. >> > } >> > } >> > >> > When puppet runs, it''s trying to apply the file >> > /etc/somedir/configfile _before_ /etc/somedir. This seems to >> > contradict the behaviour the documentation describes. >> ---- >> Suggest you try this... >> class webapp::common { >> include platform::common >> file { >> "/etc/somedir/configfile": >> require => Class["platform::common"], >> # stuff here. >> } >> } > > files auto require their parents, it''s not even needed to do > the require => or require() > > He''s not showing actual code, log lines or errors. > > -- > 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 topuppet-users+unsubscribe@googlegroups.com.> For more options, visit this group athttp://groups.google.com/group/puppet-users?hl=en.>-- 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.
----- Original Message -----> > > That''s a feature in newish versions, right?no, it''s been there for ages and ages. -- 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.
On Tue, Sep 6, 2011 at 1:19 PM, R.I.Pienaar <rip@devco.net> wrote:> > > ----- Original Message ----- >> >> >> That''s a feature in newish versions, right? > > no, it''s been there for ages and ages. > > -- > 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. > >Well this is all awfully confusing. The documentation pretty clearly says that using the require function automatically adds that class as a dependancy. If so, why would I need to explicitly add require => to resources? If I had to do that, I''d use include instead. Can someone at Puppet Labs maybe chime in here.....? Douglas. -- 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.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1> Well this is all awfully confusing. The documentation pretty clearly > says that using the require function automatically adds that class as > a dependancy. If so, why would I need to explicitly add require => to > resources? If I had to do that, I''d use include instead. Can someone > at Puppet Labs maybe chime in here.....?I''m using require a lot and it does what docs says. The "require =>"-param option is just an alternative way, which can be a bit more cumbersome. As R.I. said, file resources by themselves would do the ordering correctly and your examples are not reproducable, nor are there any traces/debugs etc. How can one chime in here? ~pete -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk5mnwoACgkQbwltcAfKi3+HOACdGtA7H9jEQPj6IAgNS6RdCt3q gboAnRRl2NW1x3zASpabj737xd0Y1ac+ =+ZHq -----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.
On Sep 6, 8:54 pm, "R.I.Pienaar" <r...@devco.net> wrote:> ----- Original Message ----- > > files auto require their parents, it''s not even needed to do > the require => or require() > >Could you please explain what exactly does it mean? Cheers!! -- 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.
----- Original Message -----> On Sep 6, 8:54 pm, "R.I.Pienaar" <r...@devco.net> wrote: > > ----- Original Message ----- > > > > files auto require their parents, it''s not even needed to do > > the require => or require() > > > > > Could you please explain what exactly does it mean? Cheers!!Given 2 file resources: file{"/foo": ensure => directory} file{"/foo/bar": content => "hello world"} Puppet knows that it would be dumb to create /foo/bar before /foo it also knows it would be tedious to add require statements all the time. So it does the right thing, it adds the require statement for you and you will never have a case where it creates them in the wrong order unless you made some mistake. -- R.I.Pienaar -- 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.
Thanks for the explanation. It turns out that I already use my stuff the very same way, only without understanding the significance. Two related question though: a. Does order matter? Like: file{"/foo/bar": content => "hello world"} file{"/foo": ensure => directory} b. Can it be uses the same way across the modules? Like, specifying "file{"/foo": ensure => directory}" in module-A and "file{"/foo/bar": content => "hello world"}" in module-B? Thanks again, in advance. cheers!! On Sep 7, 11:03 am, "R.I.Pienaar" <r...@devco.net> wrote:> ----- Original Message ----- > > On Sep 6, 8:54 pm, "R.I.Pienaar" <r...@devco.net> wrote: > > > ----- Original Message ----- > > > > files auto require their parents, it''s not even needed to do > > > the require => or require() > > > Could you please explain what exactly does it mean? Cheers!! > > Given 2 file resources: > > file{"/foo": ensure => directory} > file{"/foo/bar": content => "hello world"} > > Puppet knows that it would be dumb to create /foo/bar before /foo > it also knows it would be tedious to add require statements all the > time. > > So it does the right thing, it adds the require statement for you > and you will never have a case where it creates them in the wrong > order unless you made some mistake. > > -- > R.I.Pienaar-- 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.
----- Original Message -----> Thanks for the explanation. It turns out that I already use my stuff > the very same way, only without understanding the significance. > > Two related question though: > a. Does order matter? Like: > > file{"/foo/bar": content => "hello world"} > file{"/foo": ensure => directory}no it does not,> > b. Can it be uses the same way across the modules? Like, specifying > "file{"/foo": ensure => directory}" in module-A and "file{"/foo/bar": > content => "hello world"}" in module-B? > > Thanks again, in advance. cheers!!yup -- 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.
On Wed, Sep 7, 2011 at 3:03 AM, R.I.Pienaar <rip@devco.net> wrote:> > > ----- Original Message ----- >> On Sep 6, 8:54 pm, "R.I.Pienaar" <r...@devco.net> wrote: >> > ----- Original Message ----- >> > >> > files auto require their parents, it''s not even needed to do >> > the require => or require() >> > >> > >> Could you please explain what exactly does it mean? Cheers!! > > Given 2 file resources: > > file{"/foo": ensure => directory} > file{"/foo/bar": content => "hello world"} >Actually, that''s not true. I have seen numerous situations where puppet tries to create /foo/bar before /foo, and then complains that /foo does not exist. And, please don''t get all pissy at me for having a different view of this than you. Doug. -- 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.
On Wed, Sep 7, 2011 at 2:25 PM, Douglas Garstang <doug.garstang@gmail.com>wrote:> > Actually, that''s not true. I have seen numerous situations where > puppet tries to create /foo/bar before /foo, and then complains that > /foo does not exist. And, please don''t get all pissy at me for having > a different view of this than you.You''ve seen this with your own resources where the parent is a directory and the child is a file? Please bug report, as it''s been a very long time since that autorequire was put in (0.24.x ? 0.25.x?), and I haven''t seen a reported bug since then. -- Nigel Kersten Product Manager, Puppet Labs *Join us for **PuppetConf * <http://www.bit.ly/puppetconfsig> Sept 22/23 Portland, Oregon, USA. * * -- 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.
On Wed, Sep 7, 2011 at 2:27 PM, Nigel Kersten <nigel@puppetlabs.com> wrote:> On Wed, Sep 7, 2011 at 2:25 PM, Douglas Garstang <doug.garstang@gmail.com> > wrote: >> >> Actually, that''s not true. I have seen numerous situations where >> puppet tries to create /foo/bar before /foo, and then complains that >> /foo does not exist. And, please don''t get all pissy at me for having >> a different view of this than you. > > You''ve seen this with your own resources where the parent is a directory and > the child is a file? > Please bug report, as it''s been a very long time since that autorequire was > put in (0.24.x ? 0.25.x?), and I haven''t seen a reported bug since then.Totally... Although.... in this particular instance, the server is 2.7.3, and the client is 0.25.5... Doug -- 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.
On Wed, Sep 7, 2011 at 2:35 PM, Douglas Garstang <doug.garstang@gmail.com>wrote:> On Wed, Sep 7, 2011 at 2:27 PM, Nigel Kersten <nigel@puppetlabs.com> > wrote: > > On Wed, Sep 7, 2011 at 2:25 PM, Douglas Garstang < > doug.garstang@gmail.com> > > wrote: > >> > >> Actually, that''s not true. I have seen numerous situations where > >> puppet tries to create /foo/bar before /foo, and then complains that > >> /foo does not exist. And, please don''t get all pissy at me for having > >> a different view of this than you. > > > > You''ve seen this with your own resources where the parent is a directory > and > > the child is a file? > > Please bug report, as it''s been a very long time since that autorequire > was > > put in (0.24.x ? 0.25.x?), and I haven''t seen a reported bug since then. > > Totally... Although.... in this particular instance, the server is > 2.7.3, and the client is 0.25.5... > >ok. Bug report ? -- 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.
On Wed, Sep 7, 2011 at 3:12 PM, Nigel Kersten <nigel@puppetlabs.com> wrote:> > > On Wed, Sep 7, 2011 at 2:35 PM, Douglas Garstang <doug.garstang@gmail.com> > wrote: >> >> On Wed, Sep 7, 2011 at 2:27 PM, Nigel Kersten <nigel@puppetlabs.com> >> wrote: >> > On Wed, Sep 7, 2011 at 2:25 PM, Douglas Garstang >> > <doug.garstang@gmail.com> >> > wrote: >> >> >> >> Actually, that''s not true. I have seen numerous situations where >> >> puppet tries to create /foo/bar before /foo, and then complains that >> >> /foo does not exist. And, please don''t get all pissy at me for having >> >> a different view of this than you. >> > >> > You''ve seen this with your own resources where the parent is a directory >> > and >> > the child is a file? >> > Please bug report, as it''s been a very long time since that autorequire >> > was >> > put in (0.24.x ? 0.25.x?), and I haven''t seen a reported bug since then. >> >> Totally... Although.... in this particular instance, the server is >> 2.7.3, and the client is 0.25.5... >> > > ok. Bug report ?We''l see. To be honest, motivation is rather low right now because I was just kicked off the mcollective mailing list by Mr Pienaar for asking a question not in a manner to his liking. Doug. -- 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.
On 7 September 2011 23:22, Douglas Garstang <doug.garstang@gmail.com> wrote:> We''l see. To be honest, motivation is rather low right now because I > was just kicked off the mcollective mailing list by Mr Pienaar for > asking a question not in a manner to his liking. > >I''ll be honest, hoping you get kicked off this list also. Your attitude is absolutely appalling, I''m incredibly surprised and have huge respect to the people that have attempted to help you - you certainly didn''t deserve it. You really need to reassess how you approach mailing lists for help, some respect for the people helping and developing the free open source software you''re using would be a good start. -- 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.
On Wed, Sep 7, 2011 at 3:37 PM, Adam Gibbins <adam@adamgibbins.com> wrote:> > On 7 September 2011 23:22, Douglas Garstang <doug.garstang@gmail.com> wrote: >> >> We''l see. To be honest, motivation is rather low right now because I >> was just kicked off the mcollective mailing list by Mr Pienaar for >> asking a question not in a manner to his liking. >> > > I''ll be honest, hoping you get kicked off this list also. Your attitude is > absolutely appalling, I''m incredibly surprised and have huge respect to the > people that have attempted to help you - you certainly didn''t deserve it. > > You really need to reassess how you approach mailing lists for help, some > respect for the people helping and developing the free open source software > you''re using would be a good start.Thank you for your guidance. I totally agree with you, as attempting to defend myself would only result in more attacks. Doug. -- 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.
On Wed, Sep 7, 2011 at 4:07 PM, Douglas Garstang <doug.garstang@gmail.com>wrote:> On Wed, Sep 7, 2011 at 3:37 PM, Adam Gibbins <adam@adamgibbins.com> wrote: > > > > On 7 September 2011 23:22, Douglas Garstang <doug.garstang@gmail.com> > wrote: > >> > >> We''l see. To be honest, motivation is rather low right now because I > >> was just kicked off the mcollective mailing list by Mr Pienaar for > >> asking a question not in a manner to his liking. > >> > > > > I''ll be honest, hoping you get kicked off this list also. Your attitude > is > > absolutely appalling, I''m incredibly surprised and have huge respect to > the > > people that have attempted to help you - you certainly didn''t deserve it. > > > > You really need to reassess how you approach mailing lists for help, some > > respect for the people helping and developing the free open source > software > > you''re using would be a good start. > > Thank you for your guidance. I totally agree with you, as attempting > to defend myself would only result in more attacks. > >I''m going to add my weight to James'' response on that thread. Wording and tone matters. To everyone else, please don''t dog-pile on this issue unless you''re trying to be constructive. I do believe most of you have been trying to, but I''d like to prevent a mob mentality from emerging. -- Nigel Kersten Product Manager, Puppet Labs *Join us for **PuppetConf * <http://www.bit.ly/puppetconfsig> Sept 22/23 Portland, Oregon, USA. * * -- 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.
On Wed, Sep 07, 2011 at 02:25:21PM -0700, Douglas Garstang wrote:> On Wed, Sep 7, 2011 at 3:03 AM, R.I.Pienaar <rip@devco.net> wrote: > > > > > > ----- Original Message ----- > >> On Sep 6, 8:54 pm, "R.I.Pienaar" <r...@devco.net> wrote: > >> > ----- Original Message ----- > >> > > >> > files auto require their parents, it''s not even needed to do > >> > the require => or require() > >> > > >> > > >> Could you please explain what exactly does it mean? Cheers!! > > > > Given 2 file resources: > > > > file{"/foo": ensure => directory} > > file{"/foo/bar": content => "hello world"} > > > > Actually, that''s not true. I have seen numerous situations where > puppet tries to create /foo/bar before /foo, and then complains that > /foo does not exist. And, please don''t get all pissy at me for having > a different view of this than you. > > Doug. >I can only think of the situation that you manage File[''/foo/bar''] but not have a File[''/foo''] resource in your catalog. That means puppet does not automatically create parent directories (so no mkdir -p). It just establishes a relationship if you''ve also specified the parent directory as a puppet resource. There are different opinions if that is a good thing or a missing feature [1], personally I prefer the current explicit way. [1] http://projects.puppetlabs.com/issues/86 -Stefan
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1>> You''ve seen this with your own resources where the parent is a directory and >> the child is a file? >> Please bug report, as it''s been a very long time since that autorequire was >> put in (0.24.x ? 0.25.x?), and I haven''t seen a reported bug since then. > > Totally... Although.... in this particular instance, the server is > 2.7.3, and the client is 0.25.5...Note that to my knowledge this is an unsupported combination. Afair puppet only supports one major (?) version less as a client. Means that the client should be at least 2.6.x. Also if you are going to add a bugreport a (complete!) manifest that fails would be very helpfull, because With the simplest manifest: file{''/tmp/foo'': ensure => directory } file{''/tmp/foo/bar'': ensure => present } I''m not able to reproduce your problem in over a hundred executions. ~pete -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk5oe8sACgkQbwltcAfKi3+JtgCeKekxf2F9akTGPSa2I6gcX1YG 5DcAnjxR2jw1Lb+FCnvvLpKxAIJFlUiM =T3cl -----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.