Hi,

Before making any further changes to my existing PHP module, I'd like
to get a few recommendations from anyone who has already faced this
problem...

My existing module supports Fedora, RHEL and clones. I'd like to extend
support to more distributions, by adding a typical "params" class to it.

So far, so good. I've already done it for other modules.

*BUT* in the case of PHP, file locations, file splitting and package
splitting can be extremely different from one distro to the next.

For instance, in the case of Fedora/RHEL we have :
 * Packages : php-cli, php-fpm, php (for mod_php)
 * Configurations : /etc/php.ini, /etc/php.d/, /etc/php-fpm.conf,
   /etc/php-fpm.d/

Now in the case of Gentoo (don't ask) :
 * Package : dev-lang/php (only this one for everything)
 * Configurations : *lots* such as these :
   /etc/php/cli-php${php_version}/php.ini
   /etc/php/fpm-php${php_version}/php.ini
   /etc/php/fpm-php${php_version}/php-fpm.conf
   /etc/php/fpm-php${php_version}/ext/
   /etc/php/fpm-php${php_version}/ext-active/

I want to keep my module very flexible : Install only CLI, only FPM,
only Apache httpd module or any combination of those three.

The first problem I'm facing is with package requirements, where even
with virtual resources I'm in a dead end. Not to mention wanting to
support "ensure => absent" on any of CLI/FPM/mod when there's a single
package for all three will no longer be easy.

Right now, I'm going this way :
    # packages
    case $::operatingsystem {
        'Gentoo': {
            @package { 'dev-lang/php': ensure => installed }
            $package_cli = 'dev-lang/php'
            $package_fpm = 'dev-lang/php'
        }
        /(RedHat|CentOS)/: {
            @package { 'php-cli': ensure => installed }
            @package { 'php-fpm': ensure => installed }
            $package_cli = 'php-cli'
            $package_fpm = 'php-fpm'
        }
    }

Then I'll be realizing $package_<x> where relevant. Is there any better
way to do this?

Cheers,
Matthias

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to