ansible/test/integration/targets/setup_rpm_repo/tasks/main.yml
Matt Davis 4c5ce5a1a9
module compat for py3.8+ controller (#73423)
* module compat for py3.8+ controller

* replaced internal usages of selinux bindings with internal ctypes binding (allows basic selinux operations from any Python interpreter), plus tests

* added new respawn_module API to allow modules to import Python packages that are only available under a well-known interpreter, plus tests

* added respawn logic to modules that need Python libs from a specific system interpreter (apt, apt_repository, dnf, yum)

minimize internal HAVE_SELINUX usage

spurious junk

pep8

* pylint fixes

* add RHEL8 Python 3.8 testing

* more pylint

* import sanity

* unit tests

* changelog update

* fix a bunch of stuff

* tweak changelog

* fix setup_rpm_repo on EL8

* misc sanity/test fixes

* misc feedback tweaks

* fix import fallback in test module

* fix selinux MU test

* fix dnf tests to avoid python-dependent test packages

* add trailing LFs to aliases

* fix yum tests to avoid test package with Python deps

* hack create_repo for EL6 to create noarch package
2021-02-10 21:32:59 -08:00

95 lines
2.6 KiB
YAML

- block:
- name: Install epel repo which is missing on rhel-7 and is needed for rpmfluff
include_role:
name: setup_epel
when:
- ansible_distribution in ['RedHat', 'CentOS']
- ansible_distribution_major_version is version('7', '==')
- name: Include distribution specific variables
include_vars: "{{ lookup('first_found', params) }}"
vars:
params:
files:
- "{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_version }}.yml"
- "{{ ansible_facts.os_family }}-{{ ansible_facts.distribution_major_version }}.yml"
- "{{ ansible_facts.distribution }}.yml"
- "{{ ansible_facts.os_family }}.yml"
- default.yml
paths:
- "{{ role_path }}/vars"
- name: Install rpmfluff and deps
action: "{{ ansible_facts.pkg_mgr }}"
args:
name: "{{ rpm_repo_packages }}"
- set_fact:
repos:
- "fake-{{ ansible_architecture }}"
- "fake-i686"
- "fake-ppc64"
changed_when: yes
notify: remove repos
- name: Create RPMs and put them into a repo
create_repo:
arch: "{{ ansible_architecture }}"
tempdir: "{{ remote_tmp_dir }}"
register: repo
- set_fact:
repodir: "{{ repo.repo_dir }}"
- name: Install the repo
yum_repository:
name: "fake-{{ ansible_architecture }}"
description: "fake-{{ ansible_architecture }}"
baseurl: "file://{{ repodir }}"
gpgcheck: no
when: install_repos | bool
- name: Copy comps.xml file
copy:
src: comps.xml
dest: "{{ repodir }}"
register: repodir_comps
- name: Register comps.xml on repo
command: createrepo -g {{ repodir_comps.dest | quote }} {{ repodir | quote }}
- name: Create RPMs and put them into a repo (i686)
create_repo:
arch: i686
tempdir: "{{ remote_tmp_dir }}"
register: repo_i686
- set_fact:
repodir_i686: "{{ repo_i686.repo_dir }}"
- name: Install the repo (i686)
yum_repository:
name: "fake-i686"
description: "fake-i686"
baseurl: "file://{{ repodir_i686 }}"
gpgcheck: no
when: install_repos | bool
- name: Create RPMs and put them into a repo (ppc64)
create_repo:
arch: ppc64
tempdir: "{{ remote_tmp_dir }}"
register: repo_ppc64
- set_fact:
repodir_ppc64: "{{ repo_ppc64.repo_dir }}"
- name: Install the repo (ppc64)
yum_repository:
name: "fake-ppc64"
description: "fake-ppc64"
baseurl: "file://{{ repodir_ppc64 }}"
gpgcheck: no
when: install_repos | bool
when: ansible_distribution in ['RedHat', 'CentOS', 'ScientificLinux', 'Fedora']