Ask Your Question
0

Unable to install vim to puppet node

asked 2016-06-06 08:24:07 -0500

rbhanot4739 gravatar image

Hello,

I am very new to puppet and just started with it. I am using opensource puppet and created the following manifest on puppet master.

node 'node1.example.com' {
  package { 'vim':
    ensure => installed,
    }
  }

After i run puppet agent on my node, i get the following error.

Error: Execution of '/usr/bin/yum -d 0 -e 0 -y list vim' returned 1: Error: No matching Packages to list
Error: /Stage[main]/Main/Node[node1.example.com]/Package[vim]/ensure: change from absent to present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y list vim' returned 1: Error: No matching Packages to list

The strange thing is this happened with only vim, i tried installing nano by just replacing the name vim to nano in above and it worked just fine. So can anyone help me on troubleshooting and fixing the issue here. I have tried my bit could not get it resolve.

puppet --version 3.8.7

Both Puppet master and agent are running on centos 6.7.

edit retag flag offensive close merge delete

Comments

That error messaged, "No matching Packages to list", means there are no packages with names that match "vim" in the yum repositories your machine is configured to use. Which operating system and release are you running? Perhaps vim is available under a different, longer, name?

csharpsteen gravatar imagecsharpsteen ( 2016-06-06 10:13:14 -0500 )edit

Ah, CentOS 6.7. Apologies, haven't had my coffee yet this morning :)

csharpsteen gravatar imagecsharpsteen ( 2016-06-06 10:17:16 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-06-06 10:36:44 -0500

csharpsteen gravatar image

On CentOS, vim is a Virtual Package which is provided by other packages, notably vim-enhanced.

So, the following should work:

package {'vim-enhanced':
  ensure => installed
}

You can also enable the allow_virtual parameter which will allow Puppet to resolve vim as a package name:

package {'vim':
  ensure => installed,
  allow_virtual => true,
}

The allow_virtual parameter is enabled by default starting with Puppet 4, so using vim as a package name will work without any additional parameters in modern versions of Puppet.

edit flag offensive delete link more

Comments

Great thanks !! I tried allow_virtual = true and it seems to work just fine.

rbhanot4739 gravatar imagerbhanot4739 ( 2016-06-07 01:25:03 -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: 2016-06-06 08:16:31 -0500

Seen: 350 times

Last updated: Jun 06 '16