using puppetlabs-stdlib and hiera, if that matters.
I know this is really more of a ruby/erb question, but I've been searching
for a couple hours and haven't turned up anything relatively close to what
I'm trying to do, and I'm hoping someone here has had to do this and can
provide a suggestion for how to proceed.
I'm generating a configuration file from a template. The configuration
file will need to have IP addresses in it, but I would like to be able to
use either hostnames or IP adresses in the puppet config. This means
that I need to be able to resolve the hostnames and turn them into IP
addresses, probably in the template itself.
Basically, given something like this in puppet:
class foo::data {
$webfarm = {
http_servers => hiera('webfarm_http_servers', [
{
host => 'foo1.example.com',
port => '80',
},
{
host => 'foo2.example.com',
port => '80',
},
{
host => 'foo3.example.com',
port => '80',
},
]),
https_servers => hiera('webfarm_https_servers', [
{
host => 'foo1.example.com',
port => '443',
},
{
host => 'foo22.example.com',
port => '443',
},
{
host => 'foo99.example.com',
port => '443',
},
]),
}
}
I need my template to iterate over the http_servers and https_servers
arrays and resolve the values for the host key for each element.
Anyone have an example of how to do this in a template?
Thanks,
Tim
--
Tim Mooney [email protected]
Enterprise Computing & Infrastructure 701-231-1076 (Voice)
Room 242-J6, IACC Building 701-231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164
--
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.
Tim Mooney [email protected]
Enterprise Computing & Infrastructure 701-231-1076 (Voice)
Room 242-J6, IACC Building 701-231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164
--
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.