Fix: Remove unused Handler 84/70884/15
authorVanessa Valderrama <vvalderrama@linuxfoundation.org>
Tue, 18 Oct 2022 18:05:38 +0000 (13:05 -0500)
committerVanessa Valderrama <vvalderrama@linuxfoundation.org>
Tue, 25 Oct 2022 17:24:31 +0000 (12:24 -0500)
This handler is not required. Ansible has a built in service
module that controls services on remote hosts

Also installing a previous version of mock-core-configs to
resolve a dependency issue with the latest version

distribution-gpg-keys 1.77 is not available for CentOS 7

Signed-off-by: Vanessa Valderrama <vvalderrama@linuxfoundation.org>
Change-Id: Ia93fd83f8ec06d4ec84d12ba638fbe92f363181b

handlers/main.yml
molecule/default/prepare.yml

index bad4570..e157579 100644 (file)
@@ -1,8 +1,2 @@
 ---
 # handlers file for lf-recommended-tools
-
-- name: restart sshd
-  service:
-    name: sshd
-    state: restarted
-  become: true
index 3940959..258bd0a 100644 (file)
@@ -2,20 +2,55 @@
 - name: Prepare
   hosts: all
   gather_facts: true
+
   tasks:
     - name: Update APT cache
       apt:
         update_cache: yes
       when: ansible_distribution == 'Ubuntu'
       become: true
+
     - rpm_key:
         state: present
         key: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-8
       when: ansible_os_family == 'RedHat'
       become: true
+
     - name: Install EPEL repository
       yum:
         name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm
         state: present
       when: ansible_os_family == 'RedHat'
       become: true
+
+    - name: Install yum-plugin-versionlock
+      yum:
+        name:
+          - yum-plugin-versionlock
+      when: ansible_os_family == 'RedHat'
+      become: true
+
+    - name: Install mock
+      yum:
+        name:
+          - mock-2.17-1.el7
+        state: present
+      when:
+        - ansible_os_family == 'RedHat' and ansible_distribution_major_version == "7"
+      become: true
+
+    - 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
+
+    - name: Install mock-core-configs from remote repo
+      yum:
+        name: https://rpmfind.net/linux/epel/testing/7/aarch64/Packages/m/mock-core-configs-31.6-1.el7.noarch.rpm
+        state: present
+      when:
+        - ansible_os_family == 'RedHat' and ansible_distribution_major_version == "7"
+      become: true