Created
March 11, 2016 15:45
-
-
Save SimonHoenscheid/465bd8ceb6836cbbe4ba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nginx::vhost::vhosts: | |
'foo.example.com': | |
ensure: 'present' | |
'example.net': | |
ensure: 'present' | |
$vhosts = hiera('nginx::vhost::vhosts') | |
$vhosts_list = keys($vhosts) | |
each($vhosts_list) |String $vhost_name| { | |
$vhost_config_ensure = $vhost_name['ensure'] | |
notify{"Vhost ${vhost_name} is set to ${vhost_config_ensure}":} | |
} | |
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: The value 'ensure' cannot be converted to Numeric. at /etc/puppetlabs/code/environments/production/modules/nginx/manifests/vhost.pp:25:40 on node puppetclient-01.local | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$vhost=hiera('nginx::vhost::vhosts')
$vhost.each |$key, $value| {
notify { "VHost: ${key} - Value: ${value['ensure']}": }
}