Duncan Hill
2008-Jun-20  14:49 UTC
[Puppet Users] Editing /etc/redhat-release pre and post rpm installation
HP''s management tools have a specific requirement -
/etc/redhat-release must contain the official RHEL release line, so
the CentOS one upsets the RPM installer.
I had the bright (?) idea of using replace
(http://reductivelabs.com/trac/puppet/wiki/Recipes/SimpleText) in the
following manner:
    replace {
        "ins_centos_release":
            file        => "/etc/redhat-release",
            pattern     => "Red Hat Enterprise Linux Server release 5
(Tikanga)",
            replacement => "CentOS release 5 (Final)";
        "ins_rhel_release":
            file        => "/etc/redhat-release",
            pattern     => "CentOS release 5 (Final)",
            replacement => "Red Hat Enterprise Linux Server release 5
(Tikanga)";
    }
    package {
        "tg3":
            ensure  => present;
        "hpsmh":
            ensure  => present,
            require => [Replace[ins_rhel_release], Package[tg3] ],
            notify  => [Replace[ins_centos_release]];
    }
However, my client-side logs say:
notice: Starting catalog run
notice: //Node[lhm-srv-psql02]/hp_managed/Package[hpsmh]/ensure: is
absent, should be present (noop)
info: //Node[lhm-srv-psql02]/hp_managed/Package[hpsmh]: Scheduling
refresh of Exec[/usr/bin/perl -pi -e ''s/Red Hat Enterprise Linux
Server release 5 (Tikanga)/CentOS release 5 (Final)/''
''/etc/redhat-release'']
which tells me that the requirement of ins_rhel_release isn''t being
used properly (or in the manner I''m aiming for).  I''ve tried
moving
the require and notify to a before and after on the Replace
statements, but get in my puppetmaster logs:
Jun 20 15:34:33 lhm-srv-puppetmaster puppetmasterd[6036]: Invalid
parameter ''after'' for type ''Replace'' at
/etc/puppet/manifests/classes/hp_managed.pp:61 on node lhm-srv-psql02
So, other than creating two puppetmaster filestore files for
release-centos and release-redhat, how can I make this work?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Duncan Hill
2008-Jun-23  14:33 UTC
[Puppet Users] Re: Editing /etc/redhat-release pre and post rpm installation
2008/6/20 Duncan Hill <bajandude@googlemail.com>:> "ins_rhel_release": > file => "/etc/redhat-release", > pattern => "CentOS release 5 (Final)", > replacement => "Red Hat Enterprise Linux Server release 5 > (Tikanga)"; > } > package { > "tg3": > ensure => present; > "hpsmh": > ensure => present, > require => [Replace[ins_rhel_release], Package[tg3] ] > }The solution to this one turned out to be a bit silly in the end. Made the pattern line ''CentOS release 5 \(Final\)'', and suddenly the world lit up with: notice: //Node[lhm-srv-app01]/hp_managed/Replace[ins_rhel_release]/Exec[/usr/bin/perl -pi -e ''s/CentOS release 5 \(Final\)/Red Hat Enterprise Linux Server release 5 (Tikanga)/'' ''/etc/redhat-release'']/returns: executed successfully Gotta love gotchas. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Duncan Hill
2008-Jun-24  10:12 UTC
[Puppet Users] Re: Editing /etc/redhat-release pre and post rpm installation
2008/6/23 Duncan Hill <bajandude@googlemail.com>:> The solution to this one turned out to be a bit silly in the end. > Made the pattern line ''CentOS release 5 \(Final\)'', and suddenly the > world lit up with: > notice: //Node[lhm-srv-app01]/hp_managed/Replace[ins_rhel_release]/Exec[/usr/bin/perl > -pi -e ''s/CentOS release 5 \(Final\)/Red Hat Enterprise Linux Server > release 5 (Tikanga)/'' ''/etc/redhat-release'']/returns: executed > successfullyAnd yet another self-reply. this doesn''t work perfectly, and actually makes Puppetmaster throw a few warnings: Jun 24 11:10:04 lhm-srv-puppetmaster puppetmasterd[29577]: Unrecognised escape sequence ''\)'' in file /etc/puppet/manifests/classes/hp_managed8.pp at line 54 Despite the chaining requests with notify and require, the node constantly executes the pair of Execs as well, which is kind of annoying. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---