2017-11-21 09:40:58 +01:00
|
|
|
- block:
|
|
|
|
- name: Install epel repo which is missing on rhel-7 and is needed for rpmfluff
|
2019-04-05 19:06:22 +02:00
|
|
|
include_role:
|
|
|
|
name: setup_epel
|
2017-11-21 09:40:58 +01:00
|
|
|
when:
|
2020-04-23 18:58:33 +02:00
|
|
|
- ansible_distribution in ['RedHat', 'CentOS']
|
2019-01-18 23:31:02 +01:00
|
|
|
- ansible_distribution_major_version is version('7', '==')
|
2017-11-21 09:40:58 +01:00
|
|
|
|
2019-11-15 23:07:48 +01:00
|
|
|
- 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"
|
2018-07-25 00:17:51 +02:00
|
|
|
|
|
|
|
- name: Install rpmfluff and deps
|
2019-11-15 23:07:48 +01:00
|
|
|
action: "{{ ansible_facts.pkg_mgr }}"
|
|
|
|
args:
|
|
|
|
name: "{{ rpm_repo_packages }}"
|
2019-01-18 23:31:02 +01:00
|
|
|
|
2021-02-04 02:34:12 +01:00
|
|
|
- set_fact:
|
|
|
|
repos:
|
|
|
|
- "fake-{{ ansible_architecture }}"
|
|
|
|
- "fake-i686"
|
|
|
|
- "fake-ppc64"
|
|
|
|
changed_when: yes
|
|
|
|
notify: remove repos
|
2017-11-21 09:40:58 +01:00
|
|
|
|
|
|
|
- name: Create RPMs and put them into a repo
|
2021-02-04 02:34:12 +01:00
|
|
|
create_repo:
|
|
|
|
arch: "{{ ansible_architecture }}"
|
|
|
|
tempdir: "{{ remote_tmp_dir }}"
|
2017-11-21 09:40:58 +01:00
|
|
|
register: repo
|
|
|
|
|
|
|
|
- set_fact:
|
2021-02-04 02:34:12 +01:00
|
|
|
repodir: "{{ repo.repo_dir }}"
|
2017-11-21 09:40:58 +01:00
|
|
|
|
|
|
|
- name: Install the repo
|
|
|
|
yum_repository:
|
|
|
|
name: "fake-{{ ansible_architecture }}"
|
|
|
|
description: "fake-{{ ansible_architecture }}"
|
|
|
|
baseurl: "file://{{ repodir }}"
|
|
|
|
gpgcheck: no
|
2021-02-04 02:34:12 +01:00
|
|
|
when: install_repos | bool
|
2017-11-21 09:40:58 +01:00
|
|
|
|
2019-01-30 01:56:57 +01:00
|
|
|
- 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 }}
|
|
|
|
|
2017-11-21 09:40:58 +01:00
|
|
|
- name: Create RPMs and put them into a repo (i686)
|
2021-02-04 02:34:12 +01:00
|
|
|
create_repo:
|
|
|
|
arch: i686
|
|
|
|
tempdir: "{{ remote_tmp_dir }}"
|
2017-11-21 09:40:58 +01:00
|
|
|
register: repo_i686
|
|
|
|
|
|
|
|
- set_fact:
|
2021-02-04 02:34:12 +01:00
|
|
|
repodir_i686: "{{ repo_i686.repo_dir }}"
|
2017-11-21 09:40:58 +01:00
|
|
|
|
|
|
|
- name: Install the repo (i686)
|
|
|
|
yum_repository:
|
|
|
|
name: "fake-i686"
|
|
|
|
description: "fake-i686"
|
|
|
|
baseurl: "file://{{ repodir_i686 }}"
|
|
|
|
gpgcheck: no
|
2021-02-04 02:34:12 +01:00
|
|
|
when: install_repos | bool
|
2017-11-21 09:40:58 +01:00
|
|
|
|
|
|
|
- name: Create RPMs and put them into a repo (ppc64)
|
2021-02-04 02:34:12 +01:00
|
|
|
create_repo:
|
|
|
|
arch: ppc64
|
|
|
|
tempdir: "{{ remote_tmp_dir }}"
|
2017-11-21 09:40:58 +01:00
|
|
|
register: repo_ppc64
|
|
|
|
|
|
|
|
- set_fact:
|
2021-02-04 02:34:12 +01:00
|
|
|
repodir_ppc64: "{{ repo_ppc64.repo_dir }}"
|
2017-11-21 09:40:58 +01:00
|
|
|
|
|
|
|
- name: Install the repo (ppc64)
|
|
|
|
yum_repository:
|
|
|
|
name: "fake-ppc64"
|
|
|
|
description: "fake-ppc64"
|
|
|
|
baseurl: "file://{{ repodir_ppc64 }}"
|
|
|
|
gpgcheck: no
|
2021-02-04 02:34:12 +01:00
|
|
|
when: install_repos | bool
|
2018-03-22 18:19:29 +01:00
|
|
|
|
2017-11-21 09:40:58 +01:00
|
|
|
when: ansible_distribution in ['RedHat', 'CentOS', 'ScientificLinux', 'Fedora']
|