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?

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

The reason I am doing this is I will have an arbitrary number of servers
load balancing a site and since I can keep track of what interface a site is
going to use I can use that to build my apache file.


--------------

node definition snippet:

ip_address::new{ "eth0:0":
  iface         => "eth0:0",
  ip              => "192.168.0.84",
  netmask    => "255.255.255.0",
  gateway    => "192.168.0.1",
  iface_type => "static",
  before       => Apache2::Site["test.example.com"]
}

app_server class snippet:

$ipalias = "ipaddress_eth0_0"
apache2::site { "test.example.com":
  name    => "test.example.com.conf",
  ensure  => "present",
  require  => Apache2::Config["base"],
  require  => Ip_address::New["eth0:0"],
  content => template("s_apache_site/site.conf.erb"),
  notify    => Exec["reload-apache2"]
}


erb snippet:
<VirtualHost <%= eval(ipalias) -%>:80>
-----------


Chris

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to