Ask Your Question
1

How can I have puppet ensure mysql-server (from Red Hat) is absent, but ensure MySQL-server from (mysql.com) is installed?

asked 2013-03-13 13:45:35 -0500

slseed1969 gravatar image

I'm trying to ensure MySQL-server is installed on a node which I've placed in a yum repo, however at the same time, my Red Hat repo has the mysql-server package available. It appears the puppet yum package provider is not case-sensitive so if I ensure that mysql-server is absent and ensure MySQL-server is installed, my MySQL-server package gets installed and removed every other run.

Mar 13 11:24:04 vmverify-el6s yum[14218]: Installed: MySQL-server-5.5.13-1.linux2.6.x86_64 Mar 13 11:24:07 vmverify-el6s puppet-agent[13229]: (/Stage[main]/Mysql/Package[MySQL-server]/ensure) created ... Mar 13 11:26 ... (more)

edit retag flag offensive close merge delete

Comments

1

I discovered that yum was infact ignoring case for MySQL-server. I believe it has something to do with the metadata of the package so when it would remove mysql-server, this ...(more)

slseed1969 gravatar imageslseed1969 ( 2013-03-13 20:56:46 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted
0

answered 2013-03-13 14:56:34 -0500

slseed1969 gravatar image

I could take that approach, however I was hoping to avoid it. You see, on my default server installation I want to have the mysql-server package from Red Hat. It's only in certain cases where I need to override this with a newer package. If I were to take your approach I would have to manipulate the yum.conf for these class of systems to prevent it from getting the Red Hat package. I was hoping to avoid this as I'm already managing the yum.conf in another module. This would require special handling just for this small ... (more)

edit flag offensive delete link more
0

answered 2013-03-13 14:07:43 -0500

Daenney gravatar image

updated 2013-03-13 14:09:51 -0500

This is actually something you need to fix in your package manager I think.

In yum.conf for every repository you have a [repo] section. To every one of those section you can add an exclude entry like this exclude=mysql*.

Or if you're using yum/conf.d find all the repositories that provide the mysql package and add the exclude to those you want to avoid.

Once you got that sorted, remove the package you want gone and on the next run let Puppet handle it.

You can also have a look at the following plugins for YUM ... (more)

edit flag offensive delete link more
0

answered 2013-03-13 16:27:27 -0500

ramindk gravatar image

updated 2013-03-15 12:22:28 -0500

You've got a few options.

  1. exclude as needed. I'd use hiera_array and collect an excludes needed and write them out as needed in your yum module. Pros: adds useful functionality to your Puppet code base Cons: Need to setup Hiera and plan how you'd use this data.

    hieradata/fqdn_of_special_db_server.yaml

    yum_base_excludes: ['mysql-server','mysql-client','mysql-libs','mysql-devel']

    modules/yum/manifests/init.pp

    $base_excludes = hiera_array('yum_base_excludes')

    Where you go from here depends on how you set repo files.

  2. Set specific version, ensure => '5.5.17'. I assume the versions would be different between Redhat and Mysql provided packages. Set to ...

(more)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-03-13 13:45:35 -0500

Seen: 805 times

Last updated: Mar 15 '13