From: Eric Ball Date: Tue, 3 Jun 2025 19:03:22 +0000 (-0700) Subject: Change netcat pkg to netcat-traditional on Deb X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=698ace498f6868f42fcf4b56326322edd2b82175;p=ansible%2Froles%2Flf-recommended-tools.git Change netcat pkg to netcat-traditional on Deb Newer versions of Ubuntu no longer have the "netcat" package, but all versions from 18.04-24.04 have "netcat-traditional" available to install the netcat binary. This also includes fixes for molecule testing, which was no longer working with the latest version of ansible/molecule. Change-Id: I298c18e69530736a3f67a582e0df48631c55d705 Signed-off-by: Eric Ball --- diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index ece185b..0353568 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -4,19 +4,20 @@ dependency: driver: name: docker platforms: - - name: centos7 - image: centos:7 - - name: centos8 - image: quay.io/centos/centos:stream8 - - name: ubuntu1804 - image: ubuntu:18.04 + # - name: centos7 + # image: centos:7 + # - name: centos8 + # image: quay.io/centos/centos:stream8 + # - name: ubuntu1804 + # image: ubuntu:18.04 - name: ubuntu2004 image: ubuntu:20.04 - name: ubuntu2204 image: ubuntu:22.04 + - name: ubuntu2404 + image: ubuntu:24.04 provisioner: name: ansible -scenario: - name: default -verifier: - name: testinfra + # Fix for role path finding in latest molecule versions (~25.4.0) + env: + ANSIBLE_ROLES_PATH: ../../../ diff --git a/tasks/main.yml b/tasks/main.yml index 225be90..27238ad 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -21,6 +21,18 @@ when: ansible_os_family == 'RedHat' become: true +- name: Install pre-packages on Debian + # These packages must be installed before others on Ubuntu 24.04+ + ansible.builtin.package: + name: + - apt-utils + - pcp + state: present + when: + - ansible_facts['distribution'] == 'Ubuntu' + - ansible_distribution_major_version | int >= 24 + become: true + - name: Install LF Recommended Tools on Debian # Note: apt module requires state: 'fixed' not in dnf or yum modules ansible.builtin.package: @@ -66,7 +78,7 @@ - name: Add NodeSource repository/NodeJS vars: # Sets the packaged/baseline version of NodeJS - nodejs_version: "16.x" + nodejs_version: "22.x" block: - name: Add NodeSource repository/NodeJS under RedHat/CentOS become: true @@ -115,22 +127,20 @@ block: - name: Import the NodeSource GPG key into apt ansible.builtin.apt_key: - url: "https://keyserver.ubuntu.com/pks/lookup?\ - op=get&fingerprint=on&search=0x1655A0AB68576280" - id: "68576280" + url: "https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key" state: present - name: Add NodeSource deb repository ansible.builtin.apt_repository: repo: "deb https://deb.nodesource.com/node_{{ nodejs_version }} \ - {{ ansible_distribution_release }} main" + nodistro main" state: present - name: Add NodeSource deb-src repository ansible.builtin.apt_repository: repo: "deb-src \ https://deb.nodesource.com/node_{{ nodejs_version }} \ - {{ ansible_distribution_release }} main" + nodistro main" state: present - name: Install Node.js diff --git a/tasks/pkg-names-Debian.yaml b/tasks/pkg-names-Debian.yaml index 87db4a1..94b465c 100644 --- a/tasks/pkg-names-Debian.yaml +++ b/tasks/pkg-names-Debian.yaml @@ -1,6 +1,6 @@ --- pkg_gnu_parallel: parallel -pkg_netcat: netcat +pkg_netcat: netcat-traditional pkg_perl_digest_sha: libdigest-sha-perl pkg_perl_extutils_makemaker: libextutils-makemaker-cpanfile-perl pkg_perl_xml_xpath: libxml-xpath-perl diff --git a/vars/Debian.yaml b/vars/Debian.yaml index bd84e22..dc82bcf 100644 --- a/vars/Debian.yaml +++ b/vars/Debian.yaml @@ -7,7 +7,7 @@ lf_recommended_tools_packages_distro: - libextutils-makemaker-cpanfile-perl - libxml-xpath-perl - llvm - - netcat + - netcat-traditional - parallel - tk-dev - wget