arrays - Evaluation Error while using the Hiera hash in puppet -
i have following values in hiera yaml file:
test::config_php::php_modules : -'soap' -'mcrypt' -'pdo' -'mbstring' -'php-process' -'pecl-memcache' -'devel' -'php-gd' -'pear' -'mysql' -'xml'
and following test class:
class test::config_php ( $php_version, $php_modules = hiera_hash('php_modules', {}), $module_name, ){ class { 'php': version => $php_version, } $php_modules.each |string $php_module| { php::module { $php_module: } } }
while running puppet manifests following error:
error: evaluation error: error while evaluating function call, create_resources(): second argument must hash @ /tmp/vagrant-puppet/modules-f38a037289f9864906c44863800dbacf/ssh/manifests/init.pp:46:3 on node testdays-1a.vagrant.loc.vag quite confused on doing wrong. puppet version 3.6.2 , have parser = future
i appreciate here.
looks yaml off.
- you don't need quotes in yaml.
- your indentation 2 instead of one.
- your first colon on first time spaced. throw syntax error.
it should more this:
test::config_php::php_modules: - soap - mcrypt - pdo - mbstring - php-process - pecl-memcache - devel - php-gd - pear - mysql - xml
in future try , yaml parsers this: link
Comments
Post a Comment