Jon McKenzie
2012-Sep-14 16:51 UTC
[Puppet Users] Node collecting its own exported resource
I''m writing a module in which nodes export a concat::fragment, collect all other nodes'' analogous resource, and populate a config file (in this case, the krb5.conf for MIT Kerberos). It seems that nodes are not able to collect their own resource, but they can collect every other resource, with a given tag. I''ve validated that all of the appropriate resources exist in the storeconfigs database. I''ve been doing some searching, and have read some things that suggest there might be a regression in this area, but I haven''t found anything definitive. I know the documentation states that nodes can in fact collect their own exported resources, but I haven''t been able to get this working. I''ve also tried it with just a plain "file" resource (rather than a concat::fragment), e.g. inside a given class: @@file { "/tmp/export-${::fqdn}": tag => "testexport", } File <<| tag == "testexport" |>> This also produces the same behavior. Thanks! -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/huzwZYKfZs4J. 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.
jcbollinger
2012-Sep-17 14:32 UTC
[Puppet Users] Re: Node collecting its own exported resource
On Friday, September 14, 2012 11:51:34 AM UTC-5, Jon McKenzie wrote:> > It seems that nodes are not able to collect their own resource, but they > can collect every other resource, with a given tag. I''ve validated that all > of the appropriate resources exist > in the storeconfigs database. > >Nodes should be able to collect resources they themselves export. It sounds like you have a good, simple failure case, so I recommend you file a ticket. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/qXd29c1alFEJ. 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.
mpounsett@afilias.info
2013-Jun-26 23:04 UTC
[Puppet Users] Re: Node collecting its own exported resource
On Monday, September 17, 2012 10:32:07 AM UTC-4, jcbollinger wrote:> > > > On Friday, September 14, 2012 11:51:34 AM UTC-5, Jon McKenzie wrote: >> >> It seems that nodes are not able to collect their own resource, but they >> can collect every other resource, with a given tag. I''ve validated that all >> of the appropriate resources exist >> in the storeconfigs database. >> >> > Nodes should be able to collect resources they themselves export. It > sounds like you have a good, simple failure case, so I recommend you file a > ticket. >Was a ticket ever opened for this? I''ve just run into the same issue, but searching the ticket database I''m not able to find anything already open for it... I''ll submit a ticket if there isn''t one already. -- 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. For more options, visit https://groups.google.com/groups/opt_out.
Ken Barber
2013-Jun-27 11:26 UTC
Re: [Puppet Users] Re: Node collecting its own exported resource
> Was a ticket ever opened for this? I''ve just run into the same issue, but > searching the ticket database I''m not able to find anything already open for > it... I''ll submit a ticket if there isn''t one already.Not sure whats going on, but this seems to work fine for Puppet 3.2.2: # cat /tmp/foo.pp @@notify { ''asdf'': tag => ''asdf'', } Notify <<| tag == ''asdf'' |>> # puppet apply /tmp/foo.pp Notice: asdf Notice: /Stage[main]//Notify[asdf]/message: defined ''message'' as ''asdf'' Notice: Finished catalog run in 12.52 seconds # puppet --version 3.2.2 Perhaps if you can provide a code snippet like the simplified case above we can take a look at what is going wrong. Also - what version of Puppet are you running? ken. -- 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. For more options, visit https://groups.google.com/groups/opt_out.
mpounsett@afilias.info
2013-Jun-27 12:55 UTC
Re: [Puppet Users] Re: Node collecting its own exported resource
On Thursday, June 27, 2013 7:26:34 AM UTC-4, Ken Barber wrote:> > Perhaps if you can provide a code snippet like the simplified case > above we can take a look at what is going wrong. Also - what version > of Puppet are you running? >> facter puppetversion 2.7.21 (Puppet Enterprise 2.8.2) Your code snipped doesn''t work because, according to the Exported Resources docs[1], ''storeconfigs'' is enabled in the [master] section of puppet.conf, and therefore isn''t set for ''puppet apply''. I built a small module though and tried with that and it works... so now I''m trying to figure out what''s different about that vs. my actual use case. I''m at a loss. This is the part of the manifest that''s the problem. In the block below, ${site} is a custom fact that gives me the data centre name, and it''s pulled from the FQDN of the server; ${pad_index} is a zero-padded customer number, to give a simplified explanation. This bit is part of a larger collection of files that are assembled into a final config by the Exec that''s referenced. There are two "mgmt" class servers, and the first @@file resource is never picked up in the File <<||>> collector by the node where it was defined. That is, mgmt1 gets mgmt2''s resource, but not its own. I had to stick in the second, non-exported resource, to make it work. Note that even though the exported resource doesn''t get realized, I''m still seeing duplicate declarations if I have the two resources named the same, thus the ''exported'' and ''own'' strings added to the resource titles. # This needs to go on *both* mgmt servers (one from each) so it''s # an exported resource just like from the app servers. @@file { "${pad_index}-${title}-${fqdn}-exported-hcdV.conf": path => "${hcdVdir}/healthcheckd.conf.d/${pad_index}-${fqdn}. conf", owner => $::aconfig::params::user, group => $::aconfig::params::group, mode => 0644, content => template("aconfig/hcdV-instance-mgmt.conf.erb"), notify => Exec["hcdV.conf-${title}-refresh"], tag => "hcdV.conf-${title}-${site}", } # Temporary workaround .. exported resources aren''t picked up by # the server that defined them, so we have to define this resource # twice. One of these will probably start throwing an error when # the bug is fixed. file { "${pad_index}-${title}-${fqdn}-own-hcdV.conf": path => "${hcdVdir}/healthcheckd.conf.d/${pad_index}-${fqdn}.conf", owner => $::aconfig::params::user, group => $::aconfig::params::group, mode => 0644, content => template("aconfig/hcdV-instance-mgmt.conf.erb"), notify => Exec["hcdV.conf-${title}-refresh"], tag => "hcdV.conf-${title}-${site}", } # # collects all the hcdV config files for this site/vertical File <<| tag == "hcdV.conf-${title}-${site}" |>> Perhaps another pair of eyes will pick up what I''m missing... why is the behaviour here different from the simplified test? For reference, this was my test module, which worked as expected:> cat modules/mymodule/manifests/init.pp# vim:autoindent:expandtab:ts=4 class mymodule { @@file { ''asdf'': path => ''/tmp/myfile.txt'', source => ''puppet:///modules/mymodule/myfile.txt'', tag => ''asdf'', } File <<| tag == ''asdf'' |>> } -- 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. For more options, visit https://groups.google.com/groups/opt_out.
Nan Liu
2013-Jun-27 15:40 UTC
Re: [Puppet Users] Re: Node collecting its own exported resource
On Thu, Jun 27, 2013 at 5:55 AM, <mpounsett@afilias.info> wrote:> > > On Thursday, June 27, 2013 7:26:34 AM UTC-4, Ken Barber wrote: >> >> Perhaps if you can provide a code snippet like the simplified case >> above we can take a look at what is going wrong. Also - what version >> of Puppet are you running? >> > > > facter puppetversion > 2.7.21 (Puppet Enterprise 2.8.2) > > Your code snipped doesn''t work because, according to the Exported > Resources docs[1], ''storeconfigs'' is enabled in the [master] section of > puppet.conf, and therefore isn''t set for ''puppet apply''. > > I built a small module though and tried with that and it works... so now > I''m trying to figure out what''s different about that vs. my actual use > case. I''m at a loss. > > This is the part of the manifest that''s the problem. In the block below, > ${site} is a custom fact that gives me the data centre name, and it''s > pulled from the FQDN of the server; ${pad_index} is a zero-padded customer > number, to give a simplified explanation. > > This bit is part of a larger collection of files that are assembled into a > final config by the Exec that''s referenced. There are two "mgmt" class > servers, and the first @@file resource is never picked up in the File > <<||>> collector by the node where it was defined. That is, mgmt1 gets > mgmt2''s resource, but not its own. I had to stick in the second, > non-exported resource, to make it work. Note that even though the exported > resource doesn''t get realized, I''m still seeing duplicate declarations if I > have the two resources named the same, thus the ''exported'' and ''own'' > strings added to the resource titles. > > # This needs to go on *both* mgmt servers (one from each) so > it''s > # an exported resource just like from the app servers. > @@file { "${pad_index}-${title}-${fqdn}-exported-hcdV.conf": > path => > "${hcdVdir}/healthcheckd.conf.d/${pad_index}-${fqdn}. > conf", > owner => $::aconfig::params::user, > group => $::aconfig::params::group, > mode => 0644, > content => template("aconfig/hcdV-instance-mgmt.conf.erb"), > notify => Exec["hcdV.conf-${title}-refresh"], > tag => "hcdV.conf-${title}-${site}", > } > # Temporary workaround .. exported resources aren''t picked up > by > # the server that defined them, so we have to define this > resource > # twice. One of these will probably start throwing an error > when > # the bug is fixed. > file { "${pad_index}-${title}-${fqdn}-own-hcdV.conf": > path => > "${hcdVdir}/healthcheckd.conf.d/${pad_index}-${fqdn}.conf", > owner => $::aconfig::params::user, > group => $::aconfig::params::group, > mode => 0644, > content => template("aconfig/hcdV-instance-mgmt.conf.erb"), > notify => Exec["hcdV.conf-${title}-refresh"], > tag => "hcdV.conf-${title}-${site}", > } > > # > # collects all the hcdV config files for this site/vertical > File <<| tag == "hcdV.conf-${title}-${site}" |>> > > Perhaps another pair of eyes will pick up what I''m missing... why is the > behaviour here different from the simplified test? For reference, this was > my test module, which worked as expected: >Might be the usage of dash in the tag. Puppet had a series of bugs related to dash. I would look at the generated catalog and see what are the tags associated with the resource. For example: reference: File[/opt/puppet/libexec/mcollective/mcollective/agent/package.ddl] tags: - file - class - "pe_mcollective::server::plugins" - pe_mcollective - default This should confirm whether the bug is with usage of dash or collection of resources. HTH, Nan -- 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. For more options, visit https://groups.google.com/groups/opt_out.
mpounsett@afilias.info
2013-Jun-27 16:06 UTC
Re: [Puppet Users] Re: Node collecting its own exported resource
On Thursday, June 27, 2013 11:40:41 AM UTC-4, Nan Liu wrote:> > > Might be the usage of dash in the tag. Puppet had a series of bugs related > to dash. I would look at the generated catalog and see what are the tags > associated with the resource. For example: >The problem is the resource isn''t in the catalog, so I can''t examine its tags. :) I tried changing the tag from using hyphens to using underscores, but that didn''t help. It''s half-working with hyphens in the tag though, and all my other tags with hyphens are working, so it''d have to be a pretty specific bug for that to be it. -- 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. For more options, visit https://groups.google.com/groups/opt_out.