From fe76fe35decc321a7db272b0c660e7948e548b67 Mon Sep 17 00:00:00 2001 From: Andrei Stepanov Date: Oct 16 2017 16:06:32 +0000 Subject: Add care about -debuginfo packages. Tries to solve the next issue: https://upstreamfirst.fedorainfracloud.org/gdb/issue/1 https://pagure.io/standard-test-roles/issue/57 Signed-off-by: Andrei Stepanov --- diff --git a/roles/standard-test-beakerlib/tasks/main.yml b/roles/standard-test-beakerlib/tasks/main.yml index f6c6df1..c203326 100644 --- a/roles/standard-test-beakerlib/tasks/main.yml +++ b/roles/standard-test-beakerlib/tasks/main.yml @@ -6,6 +6,27 @@ ansible_ssh_host: 127.0.0.1 ansible_ssh_connection: local +- name: Packages to be present on the system. + set_fact: + # Separate debuginfo and ordinary packages. There is an issue on GitHub: + # https://github.com/ansible/ansible/issues/31579. The easiest way to + # install debuginfo for package is to use 'debuginfo-install'. This + # program is present on RHEL/CentOS/Fedora and it automatically enables + # debuginfo repos. + pkgs_ordinary_req: > + {{ + required_packages | + reject('match', '.*-debuginfo$') | + list + }} + pkgs_debuginfo_req: > + {{ + required_packages | + select('match', '.*-debuginfo$') | + list | + regex_replace('-debuginfo') + }} + - block: - name: Gather facts setup: @@ -37,11 +58,32 @@ with_items: - rsync - findutils - + - name: Install any test-specific package requirements + # Note, this method cannot install -debuginfo packages. package: name={{item}} state=latest with_items: - - "{{ required_packages }}" + - "{{ pkgs_ordinary_req }}" + + - block: + - name: Install yum-utils + package: name=yum-utils state=latest + when: ansible_pkg_mgr == 'yum' + + - name: Install dnf-utils + # System can have installed yum-utils. Which conflicts wih dnf-utils. + # Therefore, remove yum-utils and install dnf-utils. + shell: dnf --assumeyes --allowerasing install dnf-utils + when: ansible_pkg_mgr == 'dnf' + + - name: Care about debuginfo packages for DNF/YUM systems + shell: | + debuginfo-install --assumeyes {{item}} + with_items: + - "{{ pkgs_debuginfo_req }}" + when: + - "[ansible_pkg_mgr] | intersect(['dnf', 'yum'])" + - pkgs_debuginfo_req # Only manually install packages on non atomic hosts when: ansible_pkg_mgr != 'unknown'