saz / puppet-php

Puppet module to manage php (Apache, CLI, FPM)
Other
64 stars 38 forks source link

Modules prefixes #11

Closed aranw closed 11 years ago

aranw commented 11 years ago

When trying to add pear I get the following error.

err: /Stage[main]/Devbox/Php::Module[pear]/Package[php-pear]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install php5-pear' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package php5-pear

I traced the error down to the package prefix set on line 3 in manifests/modules.pp

The Pear package is not prefixed with php5- its just php-.

saz commented 11 years ago

Just set package_prefix => 'php-' for the pear module and it should be working as expected.

Or I misunderstood your problem.

aranw commented 11 years ago

Basically not all packages are prefixed with php5-, some are php-.

APC for example is php-apc PEAR is also php-pear

saz commented 11 years ago

That's the reason, why there is a parameter called package_prefix.

If you have a better way of solving this problem, I'm glad to hear it.

aranw commented 11 years ago

Shouldn't the user just put the full name?

Example

    php::module { ['php5-xdebug', 'php5-mysql', 'php5-curl', 'php5-gd' , 'php5-imagick', 'php5-mcrypt', 'php-pear', 'php-apc'] : 
        notify => [ Service['httpd'], ],
    }
aranw commented 11 years ago

Having issues with this still, need to still APC and xhprof packages. But its adding a php5- prefix to the start but for APC and xhprof its actually php-

This is my config options.

  php::module { [
        'curl', 'gd', 'mcrypt', 'memcached', 'mysql',
        'tidy', 'php-xhprof', 'imap',
        ]:
        notify => Class['php::fpm::service'],
    }

    php::module { [ 'memcache', 'php-apc', ]:
        notify => Class['php::fpm::service'],
        source  => '/etc/php5/conf.d/',
    }

This is the error message am getting.

err: /Stage[main]/Devbox_php_fpm/Php::Module[php-xhprof]/Package[php-php-xhprof]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install php5-php-xhprof' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package php5-php-xhprof

notice: /Stage[main]/Devbox_php_fpm/Php::Module[php-xhprof]/File[php-xhprof.ini]: Dependency Package[php-php-xhprof] has failures: true
warning: /Stage[main]/Devbox_php_fpm/Php::Module[php-xhprof]/File[php-xhprof.ini]: Skipping because of failed dependencies
err: /Stage[main]/Devbox_php_fpm/Php::Module[php-apc]/Package[php-php-apc]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install php5-php-apc' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package php5-php-apc
saz commented 11 years ago

Right now, you're able to fix your problem in the following way:

    php::module { [
        'curl', 'gd', 'mcrypt', 'memcached', 'mysql',
        'tidy', 'imap',
        ]:
        notify => Class['php::fpm::service'],
    }

    php::module { [ 'memcache', ]:
        notify => Class['php::fpm::service'],
        source  => '/etc/php5/conf.d/',
    }

    php::module { [ 'xhprof', ]:
        notify => Class['php::fpm::service'],
        package_prefix => 'php-',
    }

    php::module { [ 'apc', ]:
        notify => Class['php::fpm::service'],
        source  => '/etc/php5/conf.d/',
        package_prefix => 'php-',
    }
saz commented 11 years ago

I'll close this issue for now, but will consider removing the package_prefix parameter in favor of passing in the full package name.

If your issue isn't fixed, please feel free to open this again.