example42 / puppet-php

A puppet module for php. According to Example42 NextGen spec.
Other
45 stars 62 forks source link

hiera create_resource error for php::augeas #83

Closed catalinpan closed 9 years ago

catalinpan commented 9 years ago

Hiera doesn't pass the right value which need to be validated by any2bool when I create resources. The error is:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: any2bool(): Unknown type of boolean given at /etc/puppet/modules/php/manifests/init.pp:180

*.pp file

    $myphpAugeas = hiera_hash('php::augeas', {})
    create_resources('php::augeas', $myphpAugeas)

*.yaml file

        php::augeas:
                   'php-memorylimit':
                           entry: 'PHP/memory_limit'
                           value: 512M

                   'php-date_timezone':
                           entry: 'Date/date.timezone'
                           value: 'Europe/London'

To fix this I have changed this line: $bool_augeas=any2bool($augeas) to $bool_augeas=($augeas)

I am wondering is there any other alternative for this? If not is it possible to have this in the module to be able to pull from puppetforge?

Thanks

alvagante commented 9 years ago

The augeas param ini init.pp is intended to be a boolean that affect the management of php.ini. You can solve your issue just by using a different hiera key in your pp file, for example: $myphpAugeas = hiera_hash('php::augeas_resources', {})

catalinpan commented 9 years ago

Thank you very much! Work perfect.