hello list..

I am sharing a yum configuration in a class (centos.pp) between two
nodes.  But the yum configuration doesn't apply at all to one node
even tho it does to another identically configured node.


## packages are failing to install via yum on one ec2 aws instance and
another identical ec2 instance works fine

[root@kromep2 ~]# cat /etc/redhat-release
CentOS release 5.5 (Final)

## machine info for the machine with errors

[root@ec2-184-72-200-83 ~]# uname -a
Linux ec2-184-72-200-83.compute-1.amazonaws.com 2.6.21.7-2.fc8xen #1
SMP Fri Feb 15 12:39:36 EST 2008 i686 i686 i386 GNU/Linux


[root@ec2-184-72-200-83 ~]# puppetd -t
info: Caching catalog for ec2-184-72-200-83.compute-1.amazonaws.com


## errors installing packages via yum

info: //apache/Tidy[/etc/httpd/conf.d/ssl.conf]: File does not exist
info: //centos/Tidy[/etc/yum.repos.d/CentOS-Media.repo]: File does not exist

info: //centos/Tidy[/etc/yum.repos.d/CentOS.repo]: File does not exist

info: Applying configuration version '1300227365'

notice: //centos/Cron[runPuppet]/hour: defined 'hour' as '*'

notice: //centos/Cron[runPuppet]/weekday: defined 'weekday' as '*'

err: //apache/Package[php-mysql.i386]/ensure: change from absent to
present failed: Could not find package php-mysql.i386

err: //apache/Package[php-mcrypt.i386]/ensure: change from absent to
present failed: Could not find package php-mcrypt.i386

notice: //centos/Exec[/bin/rpm --import
/etc/pki/rpm-gpg/RPM-GPG-KEY.dag.txt]/returns: executed successfully
err: //apache/Package[php-common.i386]/ensure: change from absent to
present failed: Could not find package php-common.i386

err: //apache/Package[php-cli.i386]/ensure: change from absent to
present failed: Could not find package php-cli.i386

err: //apache/Package[php-mhash.i386]/ensure: change from absent to
present failed: Could not find package php-mhash.i386

err: //apache/Package[php-gd.i386]/ensure: change from absent to
present failed: Could not find package php-gd.i386

err: //apache/Package[php.i386]/ensure: change from absent to present
failed: Could not find package php.i386

err: //apache/Package[php-xmlrpc.i386]/ensure: change from absent to
present failed: Could not find package php-xmlrpc.i386

err: //apache/Service[httpd]/ensure: change from stopped to running
failed: Could not start Service[httpd]: Execution of '/sbin/service
httpd start' returned 1:  at
/etc/puppet/modules/apache/manifests/init.pp:177

err: //apache/Package[php-devel.i386]/ensure: change from absent to
present failed: Could not find package php-devel.i386

err: //apache/Package[php-pdo.i386]/ensure: change from absent to
present failed: Could not find package php-pdo.i386

err: //apache/Package[php-pear.noarch]/ensure: change from absent to
present failed: Could not find package php-pear.noarch

err: //apache/Package[php-soap.i386]/ensure: change from absent to
present failed: Could not find package php-soap.i386

err: //apache/Package[php-xml.i386]/ensure: change from absent to
present failed: Could not find package php-xml.i386

notice: Finished catalog run in 26.97 seconds

## packages install via yum on another identical ec2 cloud instance

notice: //apache/Package[php-xmlrpc.i386]/ensure: created
notice: //apache/Exec[create apache log dir]/returns: executed successfully
notice: //baseapps/Package[koan]/ensure: created
notice: //apache/Package[php-pear.noarch]/ensure: created


## this is the machine info on the machine that works

[root@kromep2 ~]# cat /etc/redhat-release
CentOS release 5.5 (Final)

[root@kromep2 ~]# uname -a
Linux kromep2 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:39:36 EST 2008
i686 athlon i386 GNU/Linux




## nodes.pp


[root@puppet ~]# cat /etc/puppet/manifests/nodes.pp
{

   ....

node 'ec2-184-72-200-83.compute-1.amazonaws.com' inherits webserver {
## <- packages don't install here
}



node 'kromep2.acadaca.net' inherits webserver {  ## <- packages do install here
}



  ...

}

## these nodes both inherit a webserver class from
/etc/puppet/manifests/classes/template.pp

node basenode {

    case $operatingsystem {
        centos: { include centos }
        ubuntu: { include ubuntu }
        default: { include centos }
    }
    include baseapps, sshd
}

node default inherits basenode {}
node webserver inherits basenode {
     include apache
}

node dbserver inherits basenode {
     include mysql
}

node mailserver inherits basenode {
     include postfix
}



## /etc/puppet/manifests/os/centos.pp -- this is where the yum
configuation is done

class centos {

 include basefiles
 include baseapps


 exec { "create ssl dir":
        command => "/bin/mkdir /etc/ssl",
        creates => "/etc/ssl"

}


 exec {"create amanda dir":
       command => "/bin/mkdir /etc/amanda",
       creates => "/etc/amanda"

}

exec {"create amanda home":
       command => "/bin/mkdir /var/lib/amanda",
       creates => "/var/lib/amanda"
}


 exec { "/usr/bin/wget http://apt.sw.be/RPM-GPG-KEY.dag.txt":
        cwd => "/etc/pki/rpm-gpg/",
        creates => "/etc/pki/rpm-gpg/RPM-GPG-KEY.dag.txt",
        path => "/usr/bin"
 }


 exec { "/bin/rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY.dag.txt":
        cwd => "/etc/pki/rpm-gpg",
        require => Exec["/usr/bin/wget http://apt.sw.be/RPM-GPG-KEY.dag.txt";],
        path => "/bin"
 }

cron  {
         "runPuppet":
             command => "/usr/sbin/puppetd",
             user    => root,
             weekday => '*',
             minute  => "0",
             hour    => '*'

}


 tidy { "/etc/yum.repos.d/CentOS-Media.repo":
          age => '0s',
      }

 tidy { "/etc/yum.repos.d/CentOS.repo":
         age => '0s',
 }

yumrepo { 'epel-testing':
    mirrorlist =>
'http://mirrors.fedoraproject.org/mirrorlist?repo=testing-epel5&arch=$basearch',
    enabled => '0',
    failovermethod => 'priority',
    gpgcheck => '1',
    gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL',
    descr => 'Extra Packages for Enterprise Linux 5 - Testing - $basearch '
}
yumrepo { 'epel-testing-debuginfo':
    mirrorlist =>
'http://mirrors.fedoraproject.org/mirrorlist?repo=testing-debug-epel5&arch=$basearch',
    enabled => '0',
    failovermethod => 'priority',
    gpgcheck => '1',
    gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL',
    descr => 'Extra Packages for Enterprise Linux 5 - Testing -
$basearch - Debug'
}
yumrepo { 'epel-testing-source':
    mirrorlist =>
'http://mirrors.fedoraproject.org/mirrorlist?repo=testing-source-epel5&arch=$basearch',
    enabled => '0',
    failovermethod => 'priority',
    gpgcheck => '1',
    gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL',
    descr => 'Extra Packages for Enterprise Linux 5 - Testing -
$basearch - Source'
}
yumrepo { 'rpmforge':
    mirrorlist => ' http://apt.sw.be/redhat/el5/en/mirrors-rpmforge',
    protect => ' 0',
    enabled => ' 1',
    gpgcheck => ' 1',
    gpgkey => ' file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag',
    descr => ' Red Hat Enterprise $releasever - RPMforge.net - dag'
}
yumrepo { 'epel':
    mirrorlist =>
'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch',
    enabled => '1',
    failovermethod => 'priority',
    gpgcheck => '1',
    gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL',
    descr => 'Extra Packages for Enterprise Linux 5 - $basearch'
}
yumrepo { 'epel-debuginfo':
    mirrorlist =>
'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-debug-5&arch=$basearch',
    enabled => '0',
    failovermethod => 'priority',
    gpgcheck => '1',
    gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL',
    descr => 'Extra Packages for Enterprise Linux 5 - $basearch - Debug'
}
yumrepo { 'epel-source':
    mirrorlist =>
'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-source-5&arch=$basearch',
    enabled => '0',
    failovermethod => 'priority',
    gpgcheck => '1',
    gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL',
    descr => 'Extra Packages for Enterprise Linux 5 - $basearch - Source'
}
yumrepo { 'base':
    mirrorlist =>
'http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os',
    gpgcheck => '1',
    gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5',
    descr => 'CentOS-$releasever - Base'
}
yumrepo { 'updates':
    mirrorlist =>
'http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates',
    gpgcheck => '1',
    gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5',
    descr => 'CentOS-$releasever - Updates'
}
yumrepo { 'addons':
    mirrorlist =>
'http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons',
    gpgcheck => '1',
    gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5',
    descr => 'CentOS-$releasever - Addons'
}
yumrepo { 'extras':
    mirrorlist =>
'http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras',
    gpgcheck => '1',
    gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5',
    descr => 'CentOS-$releasever - Extras'
}
yumrepo { 'centosplus':
    mirrorlist =>
'http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus',
    enabled => '0',
    gpgcheck => '1',
    gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5',
    descr => 'CentOS-$releasever - Plus'
}
yumrepo { 'contrib':
    mirrorlist =>
'http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib',
    enabled => '0',
    gpgcheck => '1',
    gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5',
    descr => 'CentOS-$releasever - Contrib'
}
yumrepo { 'c5-media':
    baseurl => 'file:///media/CentOS/
        file:///media/cdrom/
        file:///media/cdrecorder/',
    enabled => '0',
    gpgcheck => '1',
    gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5',
    descr => 'CentOS-$releasever - Media'
}
yumrepo { 'scalr':
    baseurl => 'http://rpm.scalr.net/rpm/rhel/$releasever/$basearch',
    enabled => '1',
    gpgcheck => '0',
    descr => 'scalr'
}
}


## /etc/puppet/modules/apache/manifests/init.pp.. this is where the
majority of packages that I am trying to install are failing on the
one node, yet succeeding on the other.

class apache {

    $packagelist =
["httpd.$architecture","httpd-devel.$architecture","webalizer.$architecture","php.$architecture","php-common.$architecture","php-devel.$architecture","php-xmlrpc.$architecture","php-gd.$architecture",
"php-pear.noarch", "php-pdo.$architecture",
"php-mcrypt.$architecture", "php-mhash.$architecture",
"php-mysql.$architecture", "php-cli.$architecture",
"php-soap.$architecture", "php-xml.$architecture",
"mod_ssl.$architecture"]

    package { $packagelist:
           ensure => "installed"
    }




   exec { "create httpd dir":
        command => "/bin/mkdir -p /etc/httpd",
        creates => "/etc/httpd"

   }

   exec {"create apache module dir":
        command => "/bin/mkdir -p /usr/lib/httpd/modules",
        creates => "/usr/lib/httpd/modules/mod_file_cache.so"
   }

   exec { "create apache module link":
          command => "/bin/ln -s /usr/lib/httpd/modules /etc/httpd/modules",
          require => Exec["create apache module dir"],
          creates => "/etc/httpd/modules"
   }

   exec { "create apache log dir":
        command => "/bin/mkdir -p /var/log/httpd/logs",
        creates => "/var/log/httpd/logs"
   }


   exec { "create apache error log":
        command => "/bin/touch /etc/httpd/logs/error_log",
        require =>  Exec["create apache log dir"],
        creates => "/etc/httpd/logs/error_log"
   }

   exec { "create apache log link":
         command => "/bin/ln -s /var/log/httpd/logs /etc/httpd/logs",
         require => Exec["create apache log dir"],
         creates => "/etc/httpd/logs"
    }



    exec { "create apache run dir":
        command => "/bin/mkdir -p /var/run/httpd",
        creates => "/var/run/httpd"
   }


   exec { "create apache run link":
         command => "/bin/ln -s /var/run/httpd /etc/httpd/run",
         require => Exec["create apache log dir"],
         creates => "/etc/httpd/run"
    }

    exec { "create httpd conf dir":
        command => "/bin/mkdir -p /etc/httpd/conf.d",
        creates => "/etc/httpd/conf.d"

   }


   exec { "create httpd vhost conf dir":
        command => "/bin/mkdir -p /etc/httpd/conf",
        creates => "/etc/httpd/conf"

   }


   file { "/etc/php.ini":
          owner => root,
          group => root,
          mode => 440,
          source => "puppet:///apache/php.ini"
   }

   file { "/usr/lib/httpd/modules/mod_file_cache.so":
         owner => root,
         group => root,
         mode => 766,
         require => Exec["create apache module dir"],
         source => "puppet:///apache/krome/httpd/modules/mod_file_cache.so"
   }

   file {
   "/etc/httpd/conf/httpd.conf":
    owner => root,
    group => root,
    mode => 440,
    require => Exec["create httpd conf dir"],
    source => "puppet:///apache/krome/httpd/conf/httpd.conf"
   }


   file {
    "/usr/lib/httpd/modules/mod_auth_basic.so":
     owner => root,
     group => root,
     mode => 766,
     source => "puppet:///apache/krome/httpd/modules/mod_auth_basic.so"
   }



   file {
   "/etc/httpd/conf.d/000-ssl.conf":
    owner => root,
    group => root,
    mode => 440,
    require => Exec["create httpd conf dir"],
    source => "puppet:///apache/krome/httpd/conf.d/000-ssl.conf"
   }

    file {
   "/etc/httpd/conf.d/001-chrome-ssl.conf":
    owner => root,
    group => root,
    mode => 440,
    require => Exec["create httpd conf dir"],
    source => "puppet:///apache/krome/httpd/conf.d/001-chrome-ssl.conf"
   }

   file {
   "/etc/httpd/conf.d/002-chrome.conf":
     owner => root,
     group => root,
     mode => 440,
     require => Exec["create httpd conf dir"],
     source => "puppet:///apache/krome/httpd/conf.d/002-chrome.conf"
   }

    file {
   "/etc/httpd/conf.d/php.conf":
      owner => root,
      group => root,
      mode => 440,
      require => Exec["create httpd conf dir"],
      source => "puppet:///apache/krome/httpd/conf.d/php.conf"
   }

   file {
   "/etc/httpd/conf.d/proxy_ajp.conf":
     owner => root,
     group => root,
     mode  => 440,
     require => Exec["create httpd conf dir"],
     source => "puppet:///apache/krome/httpd/conf.d/proxy_ajp.conf"
   }


   file {
   "/etc/httpd/conf.d/welcome.conf":
    owner => root,
    group => root,
    mode => 440,
    require => Exec["create httpd conf dir"],
    source => "puppet:///apache/krome/httpd/conf.d/welcome.conf"
   }

   tidy { "/etc/httpd/conf.d/ssl.conf":
          age => '0s',
    }



   service { "httpd":
   enable => "true",
   ensure => "running",
   hasrestart => "true",
   hasstatus => "true",
   require => [ Package["httpd.$architecture"],
Tidy["/etc/httpd/conf.d/ssl.conf"] ]
   }

}


Thanks for your help!

-- 
GPG me!!

gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to