Fix setup_rpm integration tests for CentOS 8 (#64862)

This commit is contained in:
Sam Doran 2019-11-15 17:07:48 -05:00 committed by GitHub
parent 5e3b6c84c7
commit 5d2a3ecbc4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 33 additions and 39 deletions

View file

@ -6,52 +6,30 @@
- ansible_distribution in ['RedHat'] - ansible_distribution in ['RedHat']
- ansible_distribution_major_version is version('7', '==') - ansible_distribution_major_version is version('7', '==')
- name: Install rpmfluff and deps - name: Include distribution specific variables
package: include_vars: "{{ lookup('first_found', params) }}"
name: "{{ item }}" vars:
with_items: params:
- python{{ ansible_python_version.split(".")[0] }}-rpmfluff files:
- createrepo - "{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_version }}.yml"
when: - "{{ ansible_facts.os_family }}-{{ ansible_facts.distribution_major_version }}.yml"
- ansible_distribution in ['Fedora'] - "{{ ansible_facts.distribution }}.yml"
- "{{ ansible_facts.os_family }}.yml"
- default.yml
paths:
- "{{ role_path }}/vars"
- name: Install rpmfluff and deps - name: Install rpmfluff and deps
package: action: "{{ ansible_facts.pkg_mgr }}"
name: "{{ item }}" args:
with_items: name: "{{ rpm_repo_packages }}"
- python-rpmfluff
- createrepo_c
- createrepo # used by el6 version of rpmfluff
when:
- ansible_distribution not in ['Fedora']
- ansible_python["version"]["major"] == 2
- name: Install rpmfluff and deps
package:
name: "{{ item }}"
with_items:
- python3-rpmfluff
- createrepo_c
- createrepo # used by el6 version of rpmfluff
when:
- ansible_distribution not in ['Fedora']
- ansible_python["version"]["major"] == 3
- not (ansible_distribution == 'RedHat' and ansible_distribution_major_version is version('8', '>='))
- name: Install rpmfluff from pip on RHEL 8 and later - name: Install rpmfluff from pip on RHEL 8 and later
pip: pip:
name: rpmfluff name: rpmfluff
when: when:
- ansible_distribution == 'RedHat' and ansible_distribution_major_version is version('8', '>=') - ansible_facts.distribution in ['RedHat', 'CentOS']
- ansible_facts.distribution_major_version is version('8', '>=')
- name: Install packages needed on RHEL 8 and later
dnf:
name: "{{ item }}"
with_items:
- createrepo_c
- rpm-build
when:
- ansible_distribution == 'RedHat' and ansible_distribution_major_version is version('8', '>=')
- name: Copy script for creating a repo - name: Copy script for creating a repo
copy: copy:

View file

@ -0,0 +1,3 @@
rpm_repo_packages:
- "{{ 'python' ~ rpm_repo_python_major_version ~ '-rpmfluff' }}"
- createrepo

View file

@ -0,0 +1,4 @@
rpm_repo_packages:
- python-rpmfluff
- createrepo_c
- createrepo

View file

@ -0,0 +1,4 @@
rpm_repo_packages:
- python-rpmfluff
- createrepo_c
- createrepo

View file

@ -0,0 +1,4 @@
rpm_repo_packages:
- rpm-build
- createrepo_c
- createrepo

View file

@ -0,0 +1 @@
rpm_repo_python_major_version: "{{ ansible_facts.python_version.split('.')[0] }}"