Hi all, I need advice about the right puppet way of doing things. my task is to deploy a client software, which includes generating a configuration file using a text-file which maps the clients to the server. I´ve create custom facts, which parse the mapping file and these values are used within an erb-template. problem is that facter is only run at puppet startup (?), and a new mapping file copied during the puppet run will not be recognized - as puppet will fill in the old facter values which results in a wrong configuration file. my only solutions so far is to run puppet twice, which is not good. are there other possible solutions, maybe writing my own function (not read yet)? thanks , Stefan --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi> my task is to deploy a client software, which includes generating a > configuration file > using a text-file which maps the clients to the server. > > I´ve create custom facts, which parse the mapping file and these > values are > used within an erb-template. > > problem is that facter is only run at puppet startup (?), and a new > mapping file > copied during the puppet run will not be recognized - as puppet will > fill in the > old facter values which results in a wrong configuration file. > > my only solutions so far is to run puppet twice, which is not good. > > are there other possible solutions, maybe writing my own function (not > read yet)?well, the thing is that the template get evaluated on the server, while the facts are sent from the client to the server, when puppet starts its run. So due to this order you''ll never be able to deploy a file, parse its content and use that in templates withing the same run. As far as I understood is the mapping file deployed by puppet as well? So how do you generate the mapping file? Wouldn''t it be possible to generate the config file with these values directly? Or how is the mapping file created? cheers pete --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Stefan Wiederoder
2008-Nov-24 15:16 UTC
[Puppet Users] Re: question regarding erb-templates
> As far as I understood is the mapping file deployed by puppet as well?yes, that´s true.> So how do you generate the mapping file? Wouldn''t it be possible to > generate the config file with these values directly? Or how is the > mapping file created? > > cheers petethe mapping is file created by other people who are responsible for the whole application, they´re putting the file on our server. therefore it´s possible to generate the config-files on the server and distribute them like this: file { "/etc/client.cfg" : source => "puppet://puppet/x_generated_configs/config_$fqdn", owner => root, group => root, mode => 644 } thanks for you answer. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---