From: Vanessa Valderrama Date: Tue, 18 Oct 2022 18:05:38 +0000 (-0500) Subject: Fix: Remove unused Handler X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=cefa9ddf2cdd6f7f114b8906c6f0b89e6bb5bc76;p=ansible%2Froles%2Flf-recommended-tools.git Fix: Remove unused Handler 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 Change-Id: Ia93fd83f8ec06d4ec84d12ba638fbe92f363181b --- diff --git a/handlers/main.yml b/handlers/main.yml index bad4570..e157579 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,8 +1,2 @@ --- # handlers file for lf-recommended-tools - -- name: restart sshd - service: - name: sshd - state: restarted - become: true diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml index 3940959..258bd0a 100644 --- a/molecule/default/prepare.yml +++ b/molecule/default/prepare.yml @@ -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