Larry Ludwig
2008-Apr-11 14:44 UTC
[Puppet Users] problem with package function and removing rpms
I have a recipe that I''m ensuring that I remove rpms that may be
installed by CentOS/RHEL before I install the MySQL.com rpms.
the recipe and logs are listed below. For testing I have mysql-* rpms
already installed.
Is there a method to force specific order to run the recipe?
What am I doing wrong?
# install mysql rpms (not CentOS/RHEL vesions)
# PROCESS:
# - removes any CentOS/RHEL rpms that might be installed
# - makes sure that our rpm repo is installed
# - makes sure the service is running and will start upon boot
class mysql5 {
$removerpms =
["perl-DBD-MySQL","mysql-devel","mysql-
bench","mysql-server","mysql"]
# remove CentOS/RHEL rpms
package { $removerpms:
ensure => absent,
}
# install base rpm to find mysql rpms in yum repo
package { "yum-em-mysql5":
ensure => installed,
provider => "rpm",
source => "http://$yumrepo/yum/4/base/noarch/RPMS/yum-
em-mysql5-1.0.0-1.em.noarch.rpm",
}
# install mysql rpms
$installrpms =
["MySQL-server","MySQL-devel","MySQL-
shared","MySQL-client"]
package { $installrpms:
ensure => installed,
}
# make sure mysql is setup to run
service { mysql:
name => "sshd",
enable => true,
ensure => running,
require => Package["MySQL-server"],
}
}
Apr 11 10:35:49 devcentos46 puppetd[13136]: (//Node[devcentos46]/
mysql5/Package[mysql]/ensure) removed
Apr 11 10:35:50 devcentos46 puppetd[13136]: (//
Node[devcentos46.empoweringmedia.net]/mysql5/Package[MySQL-server]/
ensure) change from absent to present failed: Execution of ''/usr/bin/
yum -d 0 -e 0 -y
install MySQL-server'' returned 256: Error: Missing Dependency:
libmysqlclient.so.14()(64bit) is needed by package perl-DBD-MySQL
Apr 11 10:35:50 devcentos46 puppetd[13136]: (//
Node[devcentos46.empoweringmedia.net]/mysql5/Service[mysql])
Dependency package[MySQL-server] has 1 failures
Apr 11 10:35:50 devcentos46 puppetd[13136]: (//
Node[devcentos46.empoweringmedia.net]/mysql5/Service[mysql]) Skipping
because of failed dependencies
Apr 11 10:35:51 devcentos46 puppetd[13136]: (//
Node[devcentos46.empoweringmedia.net]/mysql5/Package[MySQL-client]/
ensure) change from absent to present failed: Execution of ''/usr/bin/
yum -d 0 -e 0 -y
install MySQL-client'' returned 256: Transaction Check Error: file /
usr/bin/msql2mysql from install of MySQL-client-5.0.45-0.glibc23
conflicts with file from package mysql-4.1.20-3.RHEL4.1.el4_6.1
file /usr/bin/mysql from install of MySQL-client-5.0.45-0.glibc23
conflicts with file from package mysql-4.1.20-3.RHEL4.1.el4_6.1
file /usr/bin/mysql_find_rows from install of MySQL-client-5.0.45-
0.glibc23 conflicts with file from package
mysql-4.1.20-3.RHEL4.1.el4_6.1 file /usr/bin/mysql_tableinfo from
install of MySQL-client-5.0.45-0.glibc23 conflicts with file from
package mysql-4.1.20-3.
RHEL4.1.el4_6.1 file /usr/bin/mysql_waitpid from install of MySQL-
client-5.0.45-0.glibc23 conflicts with file from package
mysql-4.1.20-3.RHEL4.1.el4_6.1 file /usr/bin/mysqlaccess from
install of
MySQL-client-5.0.45-0.glibc23 conflicts with file from package
mysql-4.1.20-3.RHEL4.1.el4_6.1 file /usr/bin/mysqladmin from install
of MySQL-client-5.0.45-0.glibc23 conflicts with file from package
mysql-4.1.20-3.RHEL4.1.el4_6.1 file /usr/bin/mysqlbinlog from
install of MySQL-client-5.0.45-0.glibc23 conflicts with file from
package mysql-4.1.20-3.RHEL4.1.el4_6.1 file /usr/bin/mysqlcheck from
install of MySQL-client-5.0.45-0.glibc23 conflicts with file from
package mysql-4.1.20-3.RHEL4.1.el4_6.1 file /usr/bin/mysqldump from
install of MySQL-client-5.0.45-0.glibc23 conflicts with file fr
om package mysql-4.1.20-3.RHEL4.1.el4_6.1 file /usr/bin/mysqlimport
from install of MySQL-client-5.0.45-0.glibc23 conflicts with file from
package mysql-4.1.20-3.RHEL4.1.el4_6.1 file /usr/bin/mysq
lshow from install of MySQL-client-5.0.45-0.glibc23 conflicts with
file from package mysql-4.1.20-3.RHEL4.1.el4_6.1 file /usr/share/man/
man1/mysql.1.gz from install of MySQL-client-5.0.45-0.glibc23
conflicts with file from package mysql-4.1.20-3.RHEL4.1.el4_6.1
file /usr/share/man/man1/mysqlaccess.1.gz from install of MySQL-
client-5.0.45-0.glibc23 conflicts with file from package mysql-4.1.20-
3.RHEL4.1.el4_6.1 file /usr/share/man/man1/mysqladmin.1.gz from
install of MySQL-client-5.0.45-0.glibc23 conflicts with file from
package mysql-4.1.20-3.RHEL4.1.el4_6.1 file /usr/share/man/man1/my
sqldump.1.gz from install of MySQL-client-5.0.45-0.glibc23 conflicts
with file from package mysql-4.1.20-3.RHEL4.1.el4_6.1 file /usr/
share/man/man1/mysqlshow.1.gz from install of MySQL-client-5.0.45
-0.glibc23 conflicts with file from package
mysql-4.1.20-3.RHEL4.1.el4_6.1 file /usr/share/man/man1/msql2mysql.
1.gz from install of MySQL-client-5.0.45-0.glibc23 conflicts with file
from package mys
ql-server-4.1.20-3.RHEL4.1.el4_6.1 file /usr/share/man/man1/
mysqlbinlog.1.gz from install of MySQL-client-5.0.45-0.glibc23
conflicts with file from package mysql-
server-4.1.20-3.RHEL4.1.el4_6.1 fi
le /usr/share/man/man1/mysqlcheck.1.gz from install of MySQL-
client-5.0.45-0.glibc23 conflicts with file from package mysql-
server-4.1.20-3.RHEL4.1.el4_6.1 file /usr/share/man/man1/mysqlimport.
1.gz
from install of MySQL-client-5.0.45-0.glibc23 conflicts with file from
package mysql-server-4.1.20-3.RHEL4.1.el4_6.1
Apr 11 10:35:52 devcentos46 puppetd[13136]: (//
Node[devcentos46.empoweringmedia.net]/mysql5/Package[MySQL-devel]/
ensure) change from absent to present failed: Execution of ''/usr/bin/
yum -d 0 -e 0 -y i
nstall MySQL-devel'' returned 256: Transaction Check Error: file /
usr/bin/mysql_config from install of MySQL-devel-5.0.45-0.glibc23
conflicts with file from package mysql-4.1.20-3.RHEL4.1.el4_6.1
file /usr/share/man/man1/mysql_config.1.gz from install of MySQL-
devel-5.0.45-0.glibc23 conflicts with file from package mysql-
server-4.1.20-3.RHEL4.1.el4_6.1
Apr 11 10:35:52 devcentos46 puppetd[13136]: (//
Node[devcentos46.empoweringmedia.net]/mysql5/Package[perl-DBD-MySQL]/
ensure) change from 2.9004-3.1.centos4 to absent failed: Execution of
''/bin/rpm -e p
erl-DBD-MySQL-2.9004-3.1.centos4.x86_64'' returned 256: error: Failed
dependencies: perl-DBD-MySQL is needed by (installed) mysql-
server-4.1.20-3.RHEL4.1.el4_6.1.x86_64
Apr 11 10:35:54 devcentos46 yum: Installed: MySQL-shared.x86_64
5.0.45-0.glibc23
Apr 11 10:35:55 devcentos46 puppetd[13136]: (//
Node[devcentos46.empoweringmedia.net]/mysql5/Package[MySQL-shared]/
ensure) created
Apr 11 10:35:55 devcentos46 puppetd[13136]: (//
Node[devcentos46.empoweringmedia.net]/mysql5/Package[mysql-server]/
ensure) removed
Apr 11 10:35:55 devcentos46 puppetd[13136]: Finished catalog run in
9.11 seconds
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from this group, send email to
puppet-users-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---
Larry Ludwig
2008-Apr-11 15:12 UTC
[Puppet Users] Re: problem with package function and removing rpms
Correct me if I''m wrong but it the package script appears to pool all of the rpms it''s needs into one big group, with some sort of sorting of the array, and then run each one at a time? I''ve even tried putting the removed rpms into a seperate class and it still appears to run the list in the same order? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Luke Kanies
2008-Apr-11 15:15 UTC
[Puppet Users] Re: problem with package function and removing rpms
On Apr 11, 2008, at 10:12 AM, Larry Ludwig wrote:> Correct me if I''m wrong but it the package script appears to pool all > of the rpms it''s needs into one big group, with some sort of sorting > of the array, and then run each one at a time? > > I''ve even tried putting the removed rpms into a seperate class and it > still appears to run the list in the same order?Resource ordering is determined by the dependency graph, and yes, all rpms are run separately. If you want to control the order, use dependency relationships. -- Life isn''t fair. It''s just fairer than death, that''s all. -- William Goldman --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Larry Ludwig
2008-Apr-11 15:34 UTC
[Puppet Users] Re: problem with package function and removing rpms
> Resource ordering is determined by the dependency graph, and yes, all > rpms are run separately. > > If you want to control the order, use dependency relationships. >Ok using require? I tried: $installrpms = ["MySQL-server","MySQL-devel","MySQL-shared","MySQL- client"] package { $installrpms: ensure => latest, require => Package[$removerpms], } And puppet barfed on this concating the array into one big long string So I assume then each package should be seperate? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Luke Kanies
2008-Apr-11 15:36 UTC
[Puppet Users] Re: problem with package function and removing rpms
On Apr 11, 2008, at 10:34 AM, Larry Ludwig wrote:> >> Resource ordering is determined by the dependency graph, and yes, all >> rpms are run separately. >> >> If you want to control the order, use dependency relationships. >> > Ok using require?Yes, or subscribe/before/after.> > I tried: > > $installrpms = ["MySQL-server","MySQL-devel","MySQL-shared","MySQL- > client"] > package { $installrpms: > ensure => latest, > require => Package[$removerpms], > } > > And puppet barfed on this concating the array into one big long string > > So I assume then each package should be seperate?Unfortunately, I haven''t been able to get the language to support arrays in resource references, so at this point, yeah, mention them individually, unfortunately. -- If two men agree on everything, you may be sure that one of them is doing the thinking. -- Lyndon B. Johnson --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Larry Ludwig
2008-Apr-11 16:05 UTC
[Puppet Users] Re: problem with package function and removing rpms
Sucess! Thanks... except mysql doesn''t start? the logs say otherwise
# install mysql rpms (not CentOS/RHEL vesions)
# PROCESS:
# - removes any CentOS/RHEL rpms that might be installed
# - makes sure that our rpm repo is installed
# - makes sure the service is running and will start upon boot
class mysql5 {
# remove CentOS/RHEL rpms
package { "mysql-server":
ensure => absent,
}
package { "perl-DBD-MySQL":
ensure => absent,
require => Package["mysql-server"]
}
package { "mysql-devel":
ensure => absent,
require => Package["perl-DBD-MySQL"]
}
package { "mysql-bench":
ensure => absent,
require => Package["mysql-devel"]
}
package { "mysql":
ensure => absent,
require => Package["mysql-bench"]
}
# install base rpm to find mysql rpms in yum repo
package { "yum-em-mysql5":
ensure => installed,
provider => "rpm",
source => "http://$yumrepo/yum/4/base/noarch/RPMS/yum-
em-mysql5-1.0.0-1.em.noarch.rpm",
require => Package["mysql"]
}
# install mysql rpms
package { "MySQL-server":
ensure => latest,
require => Package["yum-em-mysql5"]
}
package { "MySQL-devel":
ensure => latest,
require => Package["MySQL-server"]
}
package { "MySQL-shared":
ensure => latest,
require => Package["MySQL-devel"]
}
package { "MySQL-client":
ensure => latest,
require => Package["MySQL-shared"]
}
# make sure mysql is setup to run
service { "mysql":
ensure => running,
enable => true,
require => Package["MySQL-server"]
}
}
[root@devcentos46 log]# service puppet restart ; tail -f /var/log/
messages
Stopping puppet: [ OK ]
Starting puppet: [ OK ]
Apr 11 11:59:34 devcentos46 puppetd[14710]: Finished catalog run in
2.40 seconds
Apr 11 12:01:03 devcentos46 yum: Installed: mysql.x86_64
4.1.20-3.RHEL4.1.el4_6.1
Apr 11 12:01:04 devcentos46 yum: Installed: mysql.i386
4.1.20-3.RHEL4.1.el4_6.1
Apr 11 12:01:05 devcentos46 yum: Installed: perl-DBD-MySQL.x86_64
2.9004-3.1.centos4
Apr 11 12:01:09 devcentos46 yum: Installed: mysql-server.x86_64
4.1.20-3.RHEL4.1.el4_6.1
Apr 11 12:01:21 devcentos46 puppetd[14710]: Caught TERM; shutting down
Apr 11 12:01:21 devcentos46 puppetd[14710]: Shutting down
Apr 11 12:01:21 devcentos46 puppet: puppetd shutdown succeeded
Apr 11 12:01:22 devcentos46 puppetd[14827]: Reopening log files
Apr 11 12:01:22 devcentos46 puppet: puppetd startup succeeded
Apr 11 12:01:22 devcentos46 puppetd[14827]: Starting Puppet client
version 0.24.4
Apr 11 12:01:23 devcentos46 puppetd[14827]: Starting catalog run
Apr 11 12:01:25 devcentos46 puppetd[14827]: (//Node[devcentos46]/
mysql5/Package[mysql-server]/ensure) removed
Apr 11 12:01:26 devcentos46 puppetd[14827]: (//Node[devcentos46]/
mysql5/Package[perl-DBD-MySQL]/ensure) removed
Apr 11 12:01:27 devcentos46 puppetd[14827]: (//Node[devcentos46]/
mysql5/Package[mysql]/ensure) removed
Apr 11 12:01:27 devcentos46 puppetd[14827]: (//Node[devcentos46]/
mysql5/Package[yum-em-mysql5]/ensure) created
Apr 11 12:01:30 devcentos46 yum: Installed: MySQL-shared.x86_64
5.0.45-0.glibc23
Apr 11 12:01:36 devcentos46 yum: Installed: MySQL-server.x86_64
5.0.45-0.glibc23
Apr 11 12:01:37 devcentos46 yum: Erased: mysql
Apr 11 12:01:37 devcentos46 puppetd[14827]: (//Node[devcentos46]/
mysql5/Package[MySQL-server]/ensure) created
Apr 11 12:01:42 devcentos46 yum: Installed: MySQL-devel.x86_64
5.0.45-0.glibc23
Apr 11 12:01:42 devcentos46 puppetd[14827]: (//Node[devcentos46]/
mysql5/Package[MySQL-devel]/ensure) created
Apr 11 12:01:43 devcentos46 yum: Installed: MySQL-client.x86_64
5.0.45-0.glibc23
Apr 11 12:01:43 devcentos46 puppetd[14827]: (//Node[devcentos46]/
mysql5/Package[MySQL-client]/ensure) created
Apr 11 12:01:44 devcentos46 puppetd[14827]: (//Node[devcentos46]/
mysql5/Service[mysql]/ensure) ensure changed ''stopped'' to
''running''
Apr 11 12:01:44 devcentos46 puppetd[14827]: Finished catalog run in
20.38 seconds
[root@devcentos46 log]# ps aux | grep mysql
root 14984 0.0 0.0 3680 516 pts/0 S+ 12:01 0:00 grep
mysql
yum-em-mysql5-1.0.0-1.em
[root@devcentos46 log]# rpm -q -a | grep -i mysql
yum-em-mysql5-1.0.0-1.em
MySQL-server-5.0.45-0.glibc23
MySQL-client-5.0.45-0.glibc23
MySQL-shared-5.0.45-0.glibc23
MySQL-devel-5.0.45-0.glibc23
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from this group, send email to
puppet-users-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---
Andreas Rogge
2008-Apr-11 16:21 UTC
[Puppet Users] Re: problem with package function and removing rpms
Larry Ludwig schrieb:> # install mysql rpms (not CentOS/RHEL vesions) > # PROCESS: > # - removes any CentOS/RHEL rpms that might be installed > # - makes sure that our rpm repo is installed > # - makes sure the service is running and will start upon boote I know it is totally off-topic, but did you realize that centosplus contains packages for mysql 5.0? -- Solvention Egermannstr. 6-8 53359 Rheinbach Tel: +49 2226 158179-0 Fax: +49 2226 158179-9 http://www.solvention.de mailto:info@solvention.de
Larry Ludwig
2008-Apr-11 16:25 UTC
[Puppet Users] Re: problem with package function and removing rpms
On Apr 11, 12:21 pm, Andreas Rogge <a.ro...@solvention.de> wrote:> Larry Ludwig schrieb:> # install mysql rpms (not CentOS/RHEL vesions) > > # PROCESS: > > # - removes any CentOS/RHEL rpms that might be installed > > # - makes sure that our rpm repo is installed > > # - makes sure the service is running and will start upon boot > > e > I know it is totally off-topic, but did you realize that centosplus > contains packages for mysql 5.0?yes and no, Yes I do realize but using Centos4.6 in this example. But no we aren''t using them, the rpms in the distro are different than mysql''s. We''ve had better success with newer features using mysql versions. the distro only backports security and functionality bugs. In addition the control panel vendor we use removes them by default (yea I know bad practice but we have to live with their "admin" choice) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---