I'm working on building a structure for my webservers. I have my setup in hiera, but I can't seem to get puppet to give back the correct types.
In common.yaml
vhosts:
hostname:
sitename:
app_url: value
app_type: value
I have multiple sites per vhost and multiple vhosts. In my manifest I'm going to be creating the folder structure and other setup tasks, but for for now I can't even get it to iterate over the sites.
Current manifest:
define application($app_name, $app_url) {
notice("App Type: ${app_type}")
notice("App Url: ${app_url}")
}
$vhosts = hiera('vhosts')
$vhosts.each |$vhost| {
create_resources(application, $vhost)
}
The error I get is that create_resources
requires a Hash. However, if I type cast $vhost
I get that it's not a Hash but a Tuple.
How did I get a Tuple out of my yaml hash? Is there a better way to iterate over this data set to get what I need?