What the correct way to downgrade version with puppet? (CentOS 6.4)

2,082 views
Skip to first unread message

shlo....@gmail.com

unread,
Nov 10, 2013, 6:08:47 AM11/10/13
to puppet...@googlegroups.com
Hi,
I'm using Puppet to downgrade php from 5.5.5 to 5.3.3. It failed because yum command failed.
It has dependencies that need to removed or downgrade.
   ...
   php-common(x86-64) = 5.5.5-2.el6.remi is needed by (installed) php-xml-5.5.5-2.el6.remi.x86_64
   ...

How can I tell Puppet to remove the php-xml, php-common etc from the higher version and to install php  and those packages  (php-xml, php-common etc) he just remove in  lower version?

Thanks.

Derek Harkness

unread,
Nov 11, 2013, 9:38:12 AM11/11/13
to puppet...@googlegroups.com
You can specify a version string for each package.

package { [ ‘php-xml’, ‘php-common’ ]:
ensure => “5.3.3”,
}

You might have to break them out and add in some dependency.

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/8147ba9c-3f34-4b99-a02e-fd23909fb553%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

shlo....@gmail.com

unread,
Nov 12, 2013, 10:37:15 AM11/12/13
to puppet...@googlegroups.com, dhar...@mac.com
In this case I need to ensure it delete php-5.5.5 and after that install php-5.3.3. 
When trying to install php-5.3.3 when php-5.5.5 exist it exit with  errors about conflict in version.
How can I ensure that specific version of php is absent?

Derek Harkness

unread,
Nov 12, 2013, 10:11:41 PM11/12/13
to puppet...@googlegroups.com
Could you do something like

package { ‘php-5.5.5’:
ensure => absent,
}

package { ‘php-5.3.3’:
ensure => ‘5.3.3',
require => Package[‘php-5.5.5’],
}


shlo....@gmail.com

unread,
Nov 13, 2013, 5:47:53 AM11/13/13
to puppet...@googlegroups.com, dhar...@mac.com

Now I got an error that Puppet cannot successfully remove the php with the error:
Error: Execution of '/bin/rpm -e 'php-5.5.5-2.el6.remi.x86_64' returned 1: error: package 'php-5.5.5-2.el6.remi.x86_64 is not installed
Error: /Stage[main]/Php/Package[php-5.5.5-2.el6.remi.x86_64]/ensure: change from 5.5.5-2.el6.remi to absent failed: Execution of '/bin/rpm -e 'php-5.5.5-2.el6.remi.x86_64' returned 1: error: package 'php-5.5.5-2.el6.remi.x86_64 is not installed

But when I run the command: 
/bin/rpm -e 'php-5.5.5-2.el6.remi.x86_64' 
from the command line php remove successfully.

Thank you very much for your answer.

shlo....@gmail.com

unread,
Nov 13, 2013, 9:29:33 AM11/13/13
to puppet...@googlegroups.com, dhar...@mac.com


From the command line, with 'rpm' I get errors about dependencies but if I remove it using 'yum' it remove it successfully.
so I write:
package { 'php-common':
provider => 'yum',
ensure => absent,
}
But it still use the 'rpm' command and give me conflict rpm have. 

It's ignore the provider definition.
Why it still don't use the yum command?

jcbollinger

unread,
Nov 13, 2013, 6:29:03 PM11/13/13
to puppet...@googlegroups.com


On Wednesday, November 13, 2013 8:29:33 AM UTC-6, shlo....@gmail.com wrote:


From the command line, with 'rpm' I get errors about dependencies but if I remove it using 'yum' it remove it successfully.
so I write:
package { 'php-common':
provider => 'yum',
ensure => absent,
}
But it still use the 'rpm' command and give me conflict rpm have. 

It's ignore the provider definition.
Why it still don't use the yum command?



Because you will potentially remove more packages than just the one you specified.  Puppet is being careful to not change the target machine state in ways that you did not declare.  If you really mean to tell Puppet "Damn the icebergs!  Full speed ahead!" then use "ensure => 'purged'".


John

shlo....@gmail.com

unread,
Nov 14, 2013, 1:23:59 AM11/14/13
to puppet...@googlegroups.com
Thanks, It's work!
Reply all
Reply to author
Forward
0 new messages