voxpupuli / puppet-php

Generic Puppet module to manage PHP on many platforms
http://forge.puppet.com/puppet/php
MIT License
87 stars 268 forks source link

php::config::settings generates error #178

Open StL-Jim opened 8 years ago

StL-Jim commented 8 years ago

I may be missing something here, but when I try to use php::config::settings to modify a value in /etc/php.ini it generates an error: php::config::setting { 'Date/date.timezone': file => '/etc/php.ini', value => 'America/Chicago', }

Error 400 on SERVER: Must pass key to Php::Config::Setting[Date/date.timezone] at /etc/puppet/environments/php56/site/modules/courtesy/manifests/profiles/php/php_common.pp:27 on node

davividal commented 7 years ago

I'm using it like this:

class { '::php':
    ensure       => latest,
    dev          => false,
    pear         => false,
    manage_repos => true,
    settings     => {
      'Date/date.timezone' => 'America/Sao_Paulo'
    },
    # ...
}
thorstenk commented 6 years ago

The example in php::config::setting suggests that $key is a namevar but in fact it isn't. Thus the parameter key has to be set explicitly.

bastelfreak commented 6 years ago

@thorstenk could you provide a PR that updates the docs?

thorstenk commented 6 years ago

@bastelfreak Sorry, I totally missed the notification about your comment.

I had the impression that the original intent was to use $key as namevar, because of the variable name $split_name in setting.pp#L30. But now I saw the call to assert_private() so I guess updating the docs is better than interpreting this issue as a feature request. The approach of @centric-jim is no intended use, I assume.