Imho you should separate the resources (class/defines) used by the
physical machine from those of the virtual machine.
Example:
You should have a define for the physical machines, that creates the
virtual machine(s). They would probably look like your define
my_vserver, without the property physical host (as the physical host is
determined by where the resource is applied).
Anything that is going to be set up on the virtual machine should get
defined in the virtual machines. Now if there is some application, which
gets installed on the virtual machine, that requires special parameters
on the physical host, you should export this resource(s) with a known
clear tag like exporttophysicalfrom_www_example.com. (sugest: maybe
create a puppet function/define to make it harder for typos to slip in
here). Now, in the define you used on the physical server, you import
all exported resources which are tagged with this string (note that
define should have a virtual hostname parameter)
:-)
Just my 2 cents,
Silviu
On 28.06.2010 17:12, David Darville wrote:
I am trying to use Puppet to handle our Linux Vserver based virtual servers,
including the actual installation of the virtual servers. (If you don't know
how Linux Vserver works, think of a BSD style jail)
The elegant way to configure this, would be to export the configuration
details from the virtual machine configuration, and then collect it on the
physical machine, which then installs/reconfigures the virtual server.
This results in some configuration similar to the following pseudo
configuration:
####
include my_vserver
node "virtual01.domain.tld" {
$ip = '192.168.0.37'
@@my_vserver { $host:
ensure => running,
ip => $ip,
physical_host => "physical01.domain.tld",
}
# Additional configuration
}
node "physical01.domain.tld" {
My_vserver<<| physical_host == $hostname |>>
# Additional configuration
}
####
I already have a preliminary module, which handles the actual installation
and configuration of the virtual servers. The problem is that it requires
the egg before the chicken, by needing to have the resource exported by the
Puppet instance inside the virtual server, before the virtual server can be
installed.
Does anyone have a good idea on how to solve this problem?
--
David Darville
--
You received this message because you are subscribed to the Google Groups "Puppet
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.