bitcycle
bitcycle

Reputation: 7792

Installing several RPMs with custom install flags

I'm trying to do the initial work to get our dev shop to start using vagrant + puppet during development. At this stage in my puppet manifest development, I need to install several RPMs that are available via an internal http server (not a repo) with very specific flags ('--nodeps').

So, here's an example of what I need to install:

http://1.2.3.4/bar/package1.rpm
http://1.2.3.4/bar/package2.rpm
http://1.2.3.4/bar/package3.rpm

I would normally install them in this way:

rpm --install --nodeps ${rpm_uri}

I would like to be able to do something like this

$custom_rpms = [
    'http://1.2.3.4/bar/package1.rpm',
    'http://1.2.3.4/bar/package2.rpm',
    'http://1.2.3.4/bar/package3.rpm',
]

# edit:  just realized I was instantiating the parameterized
#        class wrong.  :) 
class { 'custom_package': package_file => $custom_rpms }

With this module

# modules/company_packages/manifests/init.pp
define company_package($package_file) {
    exec { "/bin/rpm  --install --nodeps ${package_file} --nodeps" }
}

But, I'm not sure if that's right. Can some of you puppet masters (no pun intended) school me on how this should be done?

Upvotes: 0

Views: 4630

Answers (2)

mutsu
mutsu

Reputation: 76

You may have already worked around this by now, but if not.

Using a repository is the preferred method as it will autoresolve all the dependancies, but it that's not available you can try the following. (I'm using epel as an example rpm)

package {"epel-release":
  provider=>rpm,
  ensure=>installed,
  install_options => ['--nodeps'],
  source=>"http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm",
}

It used to be that 'install_options ' was only supported in windows. It appears that it is now supported in linux. If there is sequence that would be helpful, add "require=Package["package3.rpm"]," to sequence.

Upvotes: 3

bitcycle
bitcycle

Reputation: 7792

Answered by Randm over irc.freenode.net#puppet

Create or use an existing repo and install them with yum so that it resolves the dependencies for you.

Upvotes: 0

Related Questions