Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error trying downgrade version php-fpm #54

Open
pcarrilloj opened this issue Dec 19, 2014 · 1 comment
Open

error trying downgrade version php-fpm #54

pcarrilloj opened this issue Dec 19, 2014 · 1 comment
Assignees

Comments

@pcarrilloj
Copy link

in centos-6.5-i386

When I try to set specific version of php-fpm for and older one, fail because php-common is already installed in a newer version. even in a fresh installation (I'm using it in vagrant).

this is my class, it works if I don't try force the version number

class appsrv {
    require yum::repo::remi
    require yum::repo::epel
    require yum::repo::remi_php55
    # For the user to exist
    require websrv
    package { 'libtidy':
        ensure  => present,
    }
    package { 'libtidy-devel':
        ensure  => present,
    } 
    package { 'php-tidy':
        ensure  => present,
    }
    package { 'yum-allowdowngrade':
        ensure  => present,
    }
    php::module { [ 'pecl-apcu',
                'pear',
                'pdo',
                'mysqlnd',
                'pgsql',
                'pecl-mongo',
                'pecl-sqlite',
                'mbstring',
                'mcrypt',
                'xml',
                'pecl-memcached',
                'gd',
                'soap']:
                notify  => Service['php-fpm'],
                }

    php::fpm::conf { 'www':
      listen  => '127.0.0.1:9001',
      user    => 'nginx',
      pm_status_path => '/status',
    }~>File['/var/log/php-fpm']

    class { php::fpm::daemon:
        ensure => '5.4.35', 
        log_owner => 'nginx',
        log_group => 'nginx',
        log_dir_mode => '0775',
    }
    php::ini { '/etc/php.ini':
      short_open_tag             => 'On',
      asp_tags                   => 'Off',
      date_timezone             =>'America/Mexico_City',
      error_reporting           => 'E_ALL',
      display_errors            => 'On',
      html_errors               => 'On',
      notify  => Service['php-fpm'],
    }
    file { '/var/log/php-fpm/www-error.log':
      ensure => "file",
      owner  => "nginx",
      group  => "nginx",
      mode   => 664
    }
    file { '/var/log/php-fpm/error.log':
      ensure => "file",
      owner  => "root",
      group  => "nginx",
      mode   => 664,
    }
}

and this is the error (the relevant part only)

Execution of '/usr/bin/yum -d 0 -e 0 -y install php-fpm-5.4.35' returned 1: Error: Package: php-fpm-5.4.35-1.el6.remi.i686 (remi)
           Requires: php-common(x86-32) = 5.4.35-1.el6.remi
           Installed: php-common-5.5.20-2.el6.remi.i686 (@remi-php55)
               php-common(x86-32) = 5.5.20-2.el6.remi
           Available: php-common-5.3.3-38.el6.i686 (base)
               php-common(x86-32) = 5.3.3-38.el6
           Available: php-common-5.3.3-40.el6_6.i686 (updates)
               php-common(x86-32) = 5.3.3-40.el6_6
           Available: php-common-5.4.35-1.el6.remi.i686 (remi)
               php-common(x86-32) = 5.4.35-1.el6.remi
           Available: php-common-5.4.36-1.el6.remi.i686 (remi)
               php-common(x86-32) = 5.4.36-1.el6.remi
           Available: php-common-5.5.19-2.el6.remi.i686 (remi-php55)
               php-common(x86-32) = 5.5.19-2.el6.remi
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
@thias
Copy link
Owner

thias commented Mar 6, 2015

This is a tricky case to handle... I can think of ways using hiera to override class parameters, but I can't think of any simple ways which would work in pure puppet DSL (such as your example).

Do you have the ability to use hiera? If you do, then it should be possible to add a new ensure parameter to the common class, which would be the only one needing to be set to the version you require, then all of the other classes which need one of the other main packages would have access to that variable after including the common class, and use it to set the ensure parameter for their own package.

@thias thias self-assigned this Mar 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants