TOSIT-IO / tdp-collection-prerequisites

Ansible collection with TDP prerequisites
Apache License 2.0
3 stars 10 forks source link

fix: add nmap-ncat package to provide ncat command #56

Closed atocharnaud closed 1 year ago

atocharnaud commented 1 year ago

ncat command is not installed on RHEL 8.6 and above and needs to be installed separately

Which issue(s) this PR fixes

Fixes #55

Additional comments

Possibly also fixe https://github.com/TOSIT-IO/tdp-collection/issues/600

Agreements

rpignolet commented 1 year ago

Why installing this package ? On Rocky 8, dnf install nc install nmap-ncat package. Are you sure on your installation, ncat is absent ?

atocharnaud commented 1 year ago

Why installing this package ? On Rocky 8, dnf install nc install nmap-ncat package. Are you sure on your installation, ncat is absent ?

Positively.

atoch_admin@EM-ALGO-PP-2 ~]$ more /etc/redhat-release Red Hat Enterprise Linux release 8.6 (Ootpa) [atoch_admin@EM-ALGO-PP-2 ~]$ ncat -bash: ncat: command not found [atoch_admin@EM-ALGO-PP-2 ~]$ sudo dnf install nc [sudo] password for atoch_admin: Updating Subscription Management repositories. Red Hat Enterprise Linux 8 for x86_64 - BaseOS 123 kB/s | 4.1 kB 00:00 Docker CE RHEL 8 71 kB/s | 2.0 kB 00:00 Red Hat Enterprise Linux 8 for x86_64 - AppStre 137 kB/s | 4.5 kB 00:00 EPEL-8 x86_64 73 kB/s | 2.3 kB 00:00 nginx-stable-RHEL8 66 kB/s | 2.0 kB 00:00 nginx-mainline-RHEL8 73 kB/s | 2.0 kB 00:00 Dependencies resolved.

Package Arch Version Repository Size

Installing: netcat x86_64 1.219-1.el8 OECD_EPEL_EPEL-8_x86_64 35 k Installing dependencies: libbsd x86_64 0.9.1-4.el8 OECD_EPEL_EPEL-8_x86_64 106 k libretls x86_64 3.5.2-1.el8 OECD_EPEL_EPEL-8_x86_64 42 k

Transaction Summary

Install 3 Packages

Total download size: 182 k Installed size: 481 k Is this ok [y/N]: y Downloading Packages: (1/3): libretls-3.5.2-1.el8.x86_64.rpm 780 kB/s | 42 kB 00:00 (2/3): libbsd-0.9.1-4.el8.x86_64.rpm 1.7 MB/s | 106 kB 00:00 (3/3): netcat-1.219-1.el8.x86_64.rpm 29 kB/s | 35 kB 00:01

Total 151 kB/s | 182 kB 00:01 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : libretls-3.5.2-1.el8.x86_64 1/3 Installing : libbsd-0.9.1-4.el8.x86_64 2/3 Installing : netcat-1.219-1.el8.x86_64 3/3 Running scriptlet: netcat-1.219-1.el8.x86_64 3/3 Verifying : libbsd-0.9.1-4.el8.x86_64 1/3 Verifying : libretls-3.5.2-1.el8.x86_64 2/3 Verifying : netcat-1.219-1.el8.x86_64 3/3 Installed products updated. Uploading Tracer Profile

Installed: libbsd-0.9.1-4.el8.x86_64 libretls-3.5.2-1.el8.x86_64 netcat-1.219-1.el8.x86_64

Complete! [atoch_admin@EM-ALGO-PP-2 ~]$ ncat -bash: ncat: command not found [atoch_admin@EM-ALGO-PP-2 ~]$ sudo dnf install nmap-ncat Updating Subscription Management repositories. Red Hat Enterprise Linux 8 for x86_64 - BaseOS 109 kB/s | 4.1 kB 00:00 Docker CE RHEL 8 64 kB/s | 2.0 kB 00:00 Red Hat Enterprise Linux 8 for x86_64 - AppStre 118 kB/s | 4.5 kB 00:00 EPEL-8 x86_64 72 kB/s | 2.3 kB 00:00 nginx-stable-RHEL8 57 kB/s | 2.0 kB 00:00 nginx-mainline-RHEL8 70 kB/s | 2.0 kB 00:00 Dependencies resolved.

Package Arch Version Repository Size

Installing: nmap-ncat x86_64 2:7.70-6.el8 rhel-8-for-x86_64-appstream-rpms 237 k

Transaction Summary

Install 1 Package

Total download size: 237 k Installed size: 480 k Is this ok [y/N]: y Downloading Packages: nmap-ncat-7.70-6.el8.x86_64.rpm 3.8 MB/s | 237 kB 00:00

Total 3.7 MB/s | 237 kB 00:00 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : nmap-ncat-2:7.70-6.el8.x86_64 1/1 Running scriptlet: nmap-ncat-2:7.70-6.el8.x86_64 1/1 Verifying : nmap-ncat-2:7.70-6.el8.x86_64 1/1 Installed products updated. Uploading Tracer Profile

Installed: nmap-ncat-2:7.70-6.el8.x86_64

Complete! [atoch_admin@EM-ALGO-PP-2 ~]$ ncat Ncat: You must specify a host to connect to. QUITTING.

rpignolet commented 1 year ago

Can you disable EPEL on your Redhat and retry please ? I think the netcat package from EPEL is installed instead of nmap-ncat.

kpgtek commented 1 year ago

Can you disable EPEL on your Redhat and retry please ? I think the netcat package from EPEL is installed instead of nmap-ncat.

netcat is provided from EPEL:

[root]# dnf info nmap-ncat | egrep 'Repository|From repo'
Repository   : appstream-8
[root]# dnf info netcat | egrep 'Repository|From repo'
Repository   : @System
From repo    : epel-8-x86_64
rpignolet commented 1 year ago

So I think we should install the package nmap-ncat instead of nc. The nmap-ncat package is available for Centos 7 too. Please remove nc package and replace it with nmap-ncat. This way the package will correctly be installed even if EPEL is enabled for RHEL 7 and 8.

rpignolet commented 1 year ago

Can you squash your commit please ? One commit should be enough for this PR.

leopaul36 commented 1 year ago

Can you squash your commit please ? One commit should be enough for this PR.

I squashed on merge. Thanks for your contribution @atocharnaud!