ansible/test/integration/targets/setup_rpm_repo/tasks/main.yml

74 lines
2 KiB
YAML
Raw Normal View History

- block:
- name: Install epel repo which is missing on rhel-7 and is needed for rpmfluff
package:
name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
when:
- ansible_distribution in ['RedHat']
- name: Install rpmfluff and deps
package:
name: "{{ item }}"
with_items:
- python{{ ansible_python_version.split(".")[0] }}-rpmfluff
when:
- ansible_distribution in ['Fedora']
- name: Install rpmfluff and deps
package:
name: "{{ item }}"
with_items:
- python-rpmfluff
- createrepo_c
- createrepo # used by el6 version of rpmfluff
when:
- ansible_distribution not in ['Fedora']
- name: Copy script for creating a repo
copy:
src: create-repo.py
dest: /tmp/create-repo.py
mode: 0755
- name: Create RPMs and put them into a repo
shell: "python /tmp/create-repo.py {{ ansible_architecture }}"
register: repo
- set_fact:
repodir: "{{ repo.stdout_lines[-1] }}"
- name: Install the repo
yum_repository:
name: "fake-{{ ansible_architecture }}"
description: "fake-{{ ansible_architecture }}"
baseurl: "file://{{ repodir }}"
gpgcheck: no
- name: Create RPMs and put them into a repo (i686)
shell: "python /tmp/create-repo.py i686"
register: repo_i686
- set_fact:
repodir_i686: "{{ repo_i686.stdout_lines[-1] }}"
- name: Install the repo (i686)
yum_repository:
name: "fake-i686"
description: "fake-i686"
baseurl: "file://{{ repodir_i686 }}"
gpgcheck: no
- name: Create RPMs and put them into a repo (ppc64)
shell: "python /tmp/create-repo.py ppc64"
register: repo_ppc64
- set_fact:
repodir_ppc64: "{{ repo_ppc64.stdout_lines[-1] }}"
- name: Install the repo (ppc64)
yum_repository:
name: "fake-ppc64"
description: "fake-ppc64"
baseurl: "file://{{ repodir_ppc64 }}"
gpgcheck: no
when: ansible_distribution in ['RedHat', 'CentOS', 'ScientificLinux', 'Fedora']