On Fri, Sep 18, 2009 at 2:54 AM, David Schmitt <da...@dasz.at> wrote:
> > Chris Blumentritt wrote: > > I receive the following error when trying to do the puppet below: > > Failed to parse template s_apache_site/site.conf.erb: Could not find > > value for 'ipaddress_eth0_0' > > > > As far as I can tell the ipaddress_eth0_0 fact has to exist on the > > client before it will parse. I was hoping that I could get the new ip > > address in place thus creating the fact so that when the apache site is > > created the information would be available. Maybe all facts are > > compiled at the when puppetd is run and there is no way to add facts > > during the run of puppetd? > > puppet sends all facts to the server at the beginning of each run to > receive an updated configuration. The configuration is compiled > (functions run, templates expanded) on the server before passing it on > to the client. The latter only receives a list of resources which it > dutifully applies. > > Therefore it is impossible to "create" facts on the fly: the client > doesn't have enough information to re-compile its manifests. > > This is one of the few cases (enabling providers is another major one) > where you have to defer some resources until the next run, where you > have the facts available. > > > The way I see around this is to first add the ip address with out > > calling the apache::site definition and once the ip address gets on > > there run puppet with apache::site definition. There has got to be > > better way, any suggestions > > If you really want to avoid the second run, you can refactor your > manifest so you are not using a fact in you template, but directly the > configuration information: > > > node web1{ > $secondary_ip = xxx > > network::ip { $secondary_ip: } > apache::site { blah: ip => $secondary_ip } > } > How can I access the $secondary_ip variable from a class? I have the app_server class make the same site on more than one server and I do not think I can more than once in the node. Besides, defining the same site more than one time seems bad. > > > Regards, DavidS > > > > --~--~---------~--~----~------------~-------~--~----~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---