Ask Your Question
0

how to install package on red hat 6.2

asked 2015-03-12 10:12:54 -0500

akshay gravatar image

updated 2015-03-12 11:27:47 -0500

ramindk gravatar image
class  oracle {

  define oracle_packages {

    file { "/home/oracle_pkg/${name}":
      ensure => present,
      source => "puppet:///modules/oracle/${name}",
      notify => Package[$name],
    }

    package { $name:
      ensure          => present,
      provider         => 'rpm',
      allow_virtual    => false,
      source           => "/home/oracle_pkg/${name}",
      require          => File["/home/oracle_pkg/${name}"],
      install_options  => ["rpm -ivh --force=/home/oracle_pkg/"],
    }

   oracle_packages { 'binutils-2.20.51.0.2-5.28.el6.x86_64.rpm': }
   oracle_packages { 'compat-libcap1-1.10-1.x86_64.rpm': }

    exec { 'rpm -ivh --force':
      command => "rpm -ivh --force ",
      path    => ["/home/oracle_pkg/"],
    }
}

I m try to install the oracle package on agent machine but it gives me an error. Error is : Could not find 'rpm'. So what are the option for installing the packages on red hat machine? So what is the mistake in my code? Please help me.

edit retag flag offensive close merge delete

Comments

Please help me

akshay gravatar imageakshay ( 2015-03-12 10:29:31 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-03-13 05:19:38 -0500

I'd suggest firstly adding the packages to a yum repo - easier to manage, also sorts dependencies etc - also easier to handle in puppet.

if you dont want to do that then try changing

command => "rpm ..."

to

command => "/bin/rpm ..."

Cheers Stuart

edit flag offensive delete link more

Comments

I was trying this but it gives me an error. So please send a demo code to install multiple package on red hat machine successfully. I m try to install the oracle packages. So please send me a demo code that have the dependency. So how to write the code for rpm packages?

akshay gravatar imageakshay ( 2015-03-13 08:51:34 -0500 )edit

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: 2015-03-12 10:12:54 -0500

Seen: 180 times

Last updated: Mar 13 '15