1

I am trying to install a package in Centos using puppet.

The package can be installed using yum install (sudo yum install bash-completion), but puppet says it doen't exist! (I have had this problem when trying to install several other packages too).

Here is what I am using:

    file { '/etc/bash_completion.d/symfony2-autocomplete.bash':
        ensure => present,
        owner => 'vagrant',
        group => 'vagrant',
        mode => '0777',
        require => Package['bash-completion'],
        content => template('extras/symfony2-autocomplete.bash'),
    }

Is there a list of puppet packages available? (or maybe have I forgotten to include something somewhere?)

Thanks!

2 Answers 2

2

You have not instructed Puppet to install a package at all.

file { '...': require => Package['...'] }

will not result in package installation. It just builds a relationship between a file resource and the named package.

package { 'bash-completion': ensure => 'installed' }

will do what you need. The require metaparameter will then work as well.

2
  • that worked thanks. After lots of trial and error, I realised that I needed to put the whole package name (xorg-x11-server-Xvfb instead of Xvfb, even though sudo yum install Xvfb works) using yum info -v was also quite helpful for anyone else reading!
    – timhc22
    Dec 1, 2014 at 11:45
  • 1
    Yes, the package resource will not behave just like yum in all contexts. For example, resources that can be provided by more than one package (which I suspect is the case for Xvfb) cannot be managed through Puppet so easily. You should indeed use the exact name of the package(s) in question. Dec 1, 2014 at 12:00
2

On CentOS 6, bash-completion is in the EPEL repository. You either forgot to add EPEL, or your manifest is trying to install bash-completion before adding the EPEL repo.

It's in the base repositories in CentOS 7.

Oh, and your file ownership and permissions are wrong, but you probably knew that already...

1
  • Ah ha makes sense! Thanks! And yes, I thought someone might pick up on that, thanks :P
    – timhc22
    Nov 28, 2014 at 17:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .