CentOS 7 and Puppet unable to install nc
Asked Answered
I

3

21

I am having a weird issue with having puppet enforce the package nc.

I installed it manually in the end via: yum install nc

I see puppet does it via:
/usr/bin/yum -d 0 -e 0 -y list nc
Returns: Error: No matching Packages to list

I have tested this by command line as well:
yum list nc
Returns Error: No matching Packages to list

Yet, when I do:
yum install nc
Returns: Package 2:nmap-ncat-6.40-4.el7.x86_64 already installed and latest version

What am I missing?

Illusage answered 14/3, 2015 at 5:43 Comment(0)
S
3

You can use a case in this case, to separate versions one example is using FACT os (which returns the version etc of your system... the command facter will return the details:

root@sytem# facter -p os
{"name"=>"CentOS", "family"=>"RedHat", "release"=>{"major"=>"7", "minor"=>"0", "full"=>"7.0.1406"}}

#we capture release hash
$curr_os = $os['release']

case $curr_os['major'] {
  '7': { .... something }
  *: {something}
}

That is an fast example, Might have typos, or not exactly working. But using system facts you can see what happens.

The OS fact provides you 3 main variables: name, family, release... Under release you have a small dictionary with more information about your os! combining these you can create cases to meet your targets.

Sallet answered 15/3, 2015 at 7:24 Comment(1)
Took me awhile, but I get it now. This is in response to the @Illusage comment about @ VassilisAretakis solution only working in some versions of the OS but not in other versions. So that he could apply different solution based on OS version. OK.Overtrade
S
22

Nc is a link to nmap-ncat.

It would be nice to use nmap-ncat in your puppet, because NC is a virtual name of nmap-ncat.

Puppet cannot understand the links/virtualnames

your puppet should be:

package {
  'nmap-ncat':
    ensure => installed;
}
Sallet answered 14/3, 2015 at 21:53 Comment(2)
Great, that works for 7, but breaks 6.6: Execution of '/usr/bin/yum -d 0 -e 0 -y list nmap-ncat' returned 1: Error: No matching Packages to list Would I have to update my manifests to split on version, or is there another option?Illusage
@Werner -- that is what I would do. And hope that they don't break that feature in the future. ;)Anteversion
R
17
yum install nmap-ncat.x86_64

resolved my problem

Rudolfrudolfo answered 25/11, 2018 at 12:53 Comment(1)
yum found the x84_64 version for me without adding that suffix fwiw, so I did yum install nmap-ncatSouthwestward
S
3

You can use a case in this case, to separate versions one example is using FACT os (which returns the version etc of your system... the command facter will return the details:

root@sytem# facter -p os
{"name"=>"CentOS", "family"=>"RedHat", "release"=>{"major"=>"7", "minor"=>"0", "full"=>"7.0.1406"}}

#we capture release hash
$curr_os = $os['release']

case $curr_os['major'] {
  '7': { .... something }
  *: {something}
}

That is an fast example, Might have typos, or not exactly working. But using system facts you can see what happens.

The OS fact provides you 3 main variables: name, family, release... Under release you have a small dictionary with more information about your os! combining these you can create cases to meet your targets.

Sallet answered 15/3, 2015 at 7:24 Comment(1)
Took me awhile, but I get it now. This is in response to the @Illusage comment about @ VassilisAretakis solution only working in some versions of the OS but not in other versions. So that he could apply different solution based on OS version. OK.Overtrade

© 2022 - 2024 — McMap. All rights reserved.