So basically I am using this (http://github.com/larstobi/puppet-dns/) module to manage amazon''s route53 dns entries. The generic definition goes like that: node ''testnode'' { base::route53::r53delegation { "$primary_fqdn.": ;} } On a server node which (is actually my puppet master) submits dns entries to amazon I do: node ''masternode'' { include base::route53::r53server } The problem is that whenever I specify resources via base::route53::r53delegation within same node where base::route53::r53server is included, resources seems to show up (be exported) in the mysql database but are never realized... --debug --verbose is not really verbose enough about realizing resources... A little help how to further debug this would be highly appreciated... The definitions looks like below: define base::route53::r53delegation($recordname ='''', target="$::ec2_public_hostname",rtype=''CNAME'',$ttl=60) { @@dnsrecord { "$title": ensure => present, value => "$target", type => "$rtype", zone => ''foobar.com.'', ttl => "$ttl", } } class base::route53::r53server { include base::generalsettings Dnsrecord <<| tag == ''Base::Route53::R53delegation'' |>> { id => "${base::generalsettings::route53_id}", secret => "${base::generalsettings::route53_key}", } } -- 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/-/umtktxpjlqIJ. 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-Oct-25 13:58 UTC
[Puppet Users] Re: Weird problem realizing exported resources
On Wednesday, October 24, 2012 6:10:18 AM UTC-5, MCZ wrote:> > So basically I am using this (http://github.com/larstobi/puppet-dns/) > module to manage amazon''s route53 dns entries. > The generic definition goes like that: > > node ''testnode'' { > base::route53::r53delegation { "$primary_fqdn.": ;} > } > > On a server node which (is actually my puppet master) submits dns entries > to amazon I do: > > node ''masternode'' { > include base::route53::r53server > } > > The problem is that whenever I specify resources > via base::route53::r53delegation within same node where > base::route53::r53server is included, resources seems to show up (be > exported) in the mysql database but are never realized... >Would you care to show how that node declaration looks?> --debug --verbose is not really verbose enough about realizing resources... > A little help how to further debug this would be highly appreciated... > > The definitions looks like below: > > define base::route53::r53delegation($recordname ='''', > target="$::ec2_public_hostname",rtype=''CNAME'',$ttl=60) { > @@dnsrecord { "$title": > ensure => present, > value => "$target", > type => "$rtype", > zone => ''foobar.com.'', > ttl => "$ttl", > } > } > > class base::route53::r53server { > include base::generalsettings > Dnsrecord <<| tag == ''Base::Route53::R53delegation'' |>> { > id => "${base::generalsettings::route53_id}", > secret => "${base::generalsettings::route53_key}", > } > } >Is this on Puppet 3? Puppet 3 has at least one or two of issues related to resources that are both exported and collected by the same node. I don''t see a ticket related to this particular behavior, but it is conceivable that there is a bug. On the other hand, I would also be looking at the possibility of parse-order issues. Do make sure that the node''s own exported resources are declared before the collection that includes them is declared. 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/-/xVGr9SBTTcoJ. 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.
Its puppet 2.7.x latest, I chain resources like this: node ''puppetmaster-client'' { include base::route53::r53server $primary_fqdn = ''puppetmaster.foo.bar'' base::route53::r53delegation { ["$primary_fqdn.",''xyz.foo.bar.'']: } ->Class[''base::route53::r53server''] } Anyway, that is not that important although a bit annoying....I hope in 3.x this will be fixed, time to put some effort to migrate anyway. On Thursday, 25 October 2012 14:58:34 UTC+1, jcbollinger wrote:> > > > On Wednesday, October 24, 2012 6:10:18 AM UTC-5, MCZ wrote: >> >> So basically I am using this (http://github.com/larstobi/puppet-dns/) >> module to manage amazon''s route53 dns entries. >> The generic definition goes like that: >> >> node ''testnode'' { >> base::route53::r53delegation { "$primary_fqdn.": ;} >> } >> >> On a server node which (is actually my puppet master) submits dns entries >> to amazon I do: >> >> node ''masternode'' { >> include base::route53::r53server >> } >> >> The problem is that whenever I specify resources >> via base::route53::r53delegation within same node where >> base::route53::r53server is included, resources seems to show up (be >> exported) in the mysql database but are never realized... >> > > Would you care to show how that node declaration looks? > > > >> --debug --verbose is not really verbose enough about realizing >> resources... >> A little help how to further debug this would be highly appreciated... >> >> The definitions looks like below: >> >> define base::route53::r53delegation($recordname ='''', >> target="$::ec2_public_hostname",rtype=''CNAME'',$ttl=60) { >> @@dnsrecord { "$title": >> ensure => present, >> value => "$target", >> type => "$rtype", >> zone => ''foobar.com.'', >> ttl => "$ttl", >> } >> } >> >> class base::route53::r53server { >> include base::generalsettings >> Dnsrecord <<| tag == ''Base::Route53::R53delegation'' |>> { >> id => "${base::generalsettings::route53_id}", >> secret => "${base::generalsettings::route53_key}", >> } >> } >> > > > Is this on Puppet 3? Puppet 3 has at least one or two of issues related > to resources that are both exported and collected by the same node. I > don''t see a ticket related to this particular behavior, but it is > conceivable that there is a bug. > > On the other hand, I would also be looking at the possibility of > parse-order issues. Do make sure that the node''s own exported resources > are declared before the collection that includes them is declared. > > > 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/-/QHazOwT6J2QJ. 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
2013-Jan-24 20:43 UTC
[Puppet Users] Re: Weird problem realizing exported resources
On Thursday, January 24, 2013 9:20:23 AM UTC-6, MCZ wrote:> > Its puppet 2.7.x latest, I chain resources like this: > > node ''puppetmaster-client'' { > include base::route53::r53server > $primary_fqdn = ''puppetmaster.foo.bar'' > base::route53::r53delegation { ["$primary_fqdn.",''xyz.foo.bar.'']: > } ->Class[''base::route53::r53server''] > } > >I really don''t see the advantage of using the chain operator in that case. I would write this, instead: base::route53::r53delegation { ["$primary_fqdn.",''xyz.foo.bar.'']: require => Class[''base::route53::r53server''] } It means the same thing, but it''s clearer (to me) and exposes a smaller cross-section for bugs. Nevertheless, I don''t think that''s related to your problem. Having looked at your failure case, I suspect you have a parse-order issue. Moreover, I suspect that you are confusing order of resource application with parse order: only the former is affected by resource relationships, so I don''t think the chain operator is doing what you expected. I think moving the declaration of class base::route53::r53server after that of the base::route53::r53delegation declarations will solve the problem by ensuring that the delegations are parsed (and their Dnsrecord resources exported) before the server class is parsed (and at that time collects the resources): node ''puppetmaster-client'' { $primary_fqdn = ''puppetmaster.foo.bar'' base::route53::r53delegation { ["$primary_fqdn.",''xyz.foo.bar.'']: } include ''base::route53::r53server'' # If you really do need chaining then put it here: } 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/-/TvPoFRPkZP0J. 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 is very interesting insight, indeed I was confusing resource ordering with parsing order although none of the proposed solutions worked for me, anyway, thanks for making a good point! On Thursday, 24 January 2013 20:43:32 UTC, jcbollinger wrote:> > > > On Thursday, January 24, 2013 9:20:23 AM UTC-6, MCZ wrote: >> >> Its puppet 2.7.x latest, I chain resources like this: >> >> node ''puppetmaster-client'' { >> include base::route53::r53server >> $primary_fqdn = ''puppetmaster.foo.bar'' >> base::route53::r53delegation { >> ["$primary_fqdn.",''xyz.foo.bar.'']: } ->Class[''base::route53::r53server''] >> } >> >> > I really don''t see the advantage of using the chain operator in that > case. I would write this, instead: > > base::route53::r53delegation { ["$primary_fqdn.",''xyz.foo.bar.'']: > require => Class[''base::route53::r53server''] > } > > It means the same thing, but it''s clearer (to me) and exposes a smaller > cross-section for bugs. > > Nevertheless, I don''t think that''s related to your problem. Having looked > at your failure case, I suspect you have a parse-order issue. Moreover, I > suspect that you are confusing order of resource application with parse > order: only the former is affected by resource relationships, so I don''t > think the chain operator is doing what you expected. I think moving the > declaration of class base::route53::r53server after that of the > base::route53::r53delegation declarations will solve the problem by > ensuring that the delegations are parsed (and their Dnsrecord resources > exported) before the server class is parsed (and at that time collects the > resources): > > node ''puppetmaster-client'' { > $primary_fqdn = ''puppetmaster.foo.bar'' > base::route53::r53delegation { ["$primary_fqdn.",''xyz.foo.bar.'']: > } > include ''base::route53::r53server'' > # If you really do need chaining then put it here: > } > > > 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.