christian.reiss.sg@googlemail.com
2013-Oct-10 09:54 UTC
[Puppet Users] Two (hopefuly minor) Questions (ip-array, line for several hosts)
Hey Folks, I have two question, which I hope are minor. First off I would like an array with all IPs for a system. This would come in handy for sshkeys, hosts and the likes. Second, and more important, I need to add a line into a file for every host. To clarify here is an example: - I have 3 (theoretical) nameservers, which configs (zones) get distributed over puppet. - I want, in each zonefile a line "mydomain.de. IN NS <$fqdn::dns::server>." Furthermore I want those lines purged if a NS does clean/deactivated. Thanks for your help in advance! -Christian. -- 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.
jcbollinger
2013-Oct-10 13:52 UTC
[Puppet Users] Re: Two (hopefuly minor) Questions (ip-array, line for several hosts)
On Thursday, October 10, 2013 4:54:31 AM UTC-5, christian...@googlemail.com wrote:> > Hey Folks, > > I have two question, which I hope are minor. First off I would like an > array with all IPs for a system. This would come in handy for sshkeys, > hosts and the likes. > >That kind of information can be provided to the master only in the form of one or more node facts, but node facts are always strings. Therefore, you would need a custom function to produce the array you''re after. The standard node facts do include per-interface IP addresses, though, so your function probably just needs to collect those into an array. Look for fact names of the form ipaddress_<ifc>, where <ifc> is any of the elements of the comma-delimited list provided by the ''interfaces'' fact. Be prepared for some interfaces to not have corresponding addresses, and ignore the plain ''ipaddress'' fact, which will be a duplicate of one of the others.> Second, and more important, I need to add a line into a file for every > host. To clarify here is an example: > > - I have 3 (theoretical) nameservers, which configs (zones) get > distributed over puppet. > - I want, in each zonefile a line > > "mydomain.de. IN NS <$fqdn::dns::server>." > > Furthermore I want those lines purged if a NS does clean/deactivated. > >Install PuppetLabs''s useful ''stdlib'' add-in module, which provides a File_line resource type that should do what you want. 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. For more options, visit https://groups.google.com/groups/opt_out.
christian.reiss.sg@googlemail.com
2013-Oct-23 08:39 UTC
[Puppet Users] Re: Two (hopefuly minor) Questions (ip-array, line for several hosts)
Hey folks, that worked, thanks. -Christian. Am Donnerstag, 10. Oktober 2013 11:54:31 UTC+2 schrieb christian...@googlemail.com:> > Hey Folks, > > I have two question, which I hope are minor. First off I would like an > array with all IPs for a system. This would come in handy for sshkeys, > hosts and the likes. > > Second, and more important, I need to add a line into a file for every > host. To clarify here is an example: > > - I have 3 (theoretical) nameservers, which configs (zones) get > distributed over puppet. > - I want, in each zonefile a line > > "mydomain.de. IN NS <$fqdn::dns::server>." > > Furthermore I want those lines purged if a NS does clean/deactivated. > > > Thanks for your help in advance! > -Christian. >-- 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.