example42 / puppet-php

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

Fix templating with php::conf and remove metaparameters #46

Closed jimmykane closed 10 years ago

jimmykane commented 10 years ago

As proposed in the overing section of the README.md the usage scenario will be like:

php::conf { 'php.ini-cli':
  path     => '/etc/php5/cli/php.ini',
  template => 'example42/php/php.ini-cli.erb',
}

Though the php::conf faild to provide a mechanism to pass parameters (values) to the template. Thus making this approach not usable (or at least not templatable)

jimmykane commented 10 years ago

Also to state here that value could also have been omitted but if someone does not want to use his templates and want to use the standard that comes with this module then it's needed in order to be able to pass parameters. Example (with no extra templates):

php::conf { 'php.ini-cli':
  path     => '/etc/php5/cli/php.ini2',
  template => 'php/extra-ini.erb',
  value =>  [
    'xdebug.remote_enable = 1',
    'xdebug.default_enable = 1',
    # 'xdebug.remote_autostart = 1',
    'xdebug.remote_connect_back = 1', # Connect back to the client that's initating the web request.
    'xdebug.remote_log="/var/log/xdebug/xdebug.log"',
    'xdebug.profiler_enable_trigger = 1',
    'xdebug.profiler_output_dir = "/vagrant/data/profiling"'
  ],
}
alvagante commented 10 years ago

Actually the intended way to pass arbitrary values to the template is to use the options_hash parameter...

jimmykane commented 10 years ago

I agree, but someone would have to construct and store his own templates in order to pass the config values. In that case I don't see any usage for using the ::conf apart from confusion with the ::ini or am I missing something ?

alvagante commented 10 years ago

Well, actually THERE is some confusion. Let's say generally that the ini is a php module specific define, provided by a contributor to directly manage ini files. The conf is a more generic define which allows manipulation of arbitrary config files, since is present also in other modules, with similar structure, I'd not change it on the php module alone, and would use the ini for specific and custom enhancements.