Fix: Fix molecule test errors for latest ansible 23/72623/1
authorEric Ball <eball@linuxfoundation.org>
Wed, 7 Feb 2024 00:13:47 +0000 (16:13 -0800)
committerEric Ball <eball@linuxfoundation.org>
Wed, 7 Feb 2024 00:13:47 +0000 (16:13 -0800)
This include:
* Use MOLECULE_PLATFORM_NAME rather than MOLECULE_DISTRO to run tests
  per distro.
* Remove "warn" arg from command actions, as it is no longer
  supported.
* Replace generic "package" with "yum" and "apt".
* Specify ansible.builtin.command for action using a register. There
  was an error caused by a missing field from the registered output
  otherwise.
* Fix list concat formatting for package list in vars/.
* Add gpg to package list. Some docker images do not come with it
  included, which was causing failures.

Issue: RELENG-5129
Change-Id: I0a665f11f6f592ed2fe1ec2875a6db9e758e91cf
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
.github/workflows/gerrit-verify.yaml
molecule/default/prepare.yml
tasks/main.yml
vars/main.yml

index 72aa927..fdf4d76 100644 (file)
@@ -124,7 +124,7 @@ jobs:
         env:
           PY_COLORS: "1"
           ANSIBLE_FORCE_COLOR: "1"
-          MOLECULE_DISTRO: ${{ matrix.distro }}
+          MOLECULE_PLATFORM_NAME: ${{ matrix.distro }}
 
   vote:
     if: ${{ always() }}
index 258bd0a..26b99d3 100644 (file)
@@ -41,8 +41,6 @@
 
     - name: Lock mock-core-configs version$
       command: yum versionlock mock
-      args:
-        warn: false
       when:
         - ansible_os_family == 'RedHat' and ansible_distribution_major_version == "7"
       become: true
index 1041a97..3fc6e64 100644 (file)
@@ -14,7 +14,7 @@
   become: true
 
 - name: Install LF Recommended Tools on RedHat
-  package:
+  yum:
     name: "{{ lf_recommended_tools_packages }}"
     state: present
   when: ansible_os_family == 'RedHat'
@@ -22,7 +22,7 @@
 
 - name: Install LF Recommended Tools on Debian
   # Note: apt module requires state: 'fixed' not in dnf or yum modules
-  package:
+  apt:
     name: "{{ lf_recommended_tools_packages }}"
     state: fixed
   when: ansible_os_family == 'Debian'
@@ -94,9 +94,7 @@
           tags: ["skip_ansible_lint"]
 
         - name: Ensure Node.js AppStream module is disabled (CentOS 8+).
-          command: yum module disable -y nodejs
-          args:
-            warn: false
+          ansible.builtin.command: yum module disable -y nodejs
           register: module_disable
           changed_when: "'Nothing to do.' not in module_disable.stdout"
           when: ansible_distribution_major_version | int >= 8
index d631243..03d27ff 100644 (file)
@@ -1,5 +1,5 @@
 ---
-lf_recommended_tools_packages: "{{ lf_recommended_tools_packages_common }} + {{ lf_recommended_tools_packages_distro }}"
+lf_recommended_tools_packages: "{{ lf_recommended_tools_packages_common + lf_recommended_tools_packages_distro }}"
 lf_recommended_tools_packages_common:
   - ant
   - crudini
@@ -8,6 +8,7 @@ lf_recommended_tools_packages_common:
   - dstat
   - facter
   - git
+  - gpg
   - graphviz
   - jq
   - sshpass