Files
tripleo-operator-ansible/roles/tripleo_repos/tasks/install.yml
Alex Schultz 706a9a73e0 Fix tripleo_repos to handle components
For centos8, we have componentized the openstack bits in RDO so we need
to fetch tripleo-repos from the tripleo component. This change will
properly identify the expected repo for tripleo-repos when not
installed.

Change-Id: I6ed72dd9166345f37191fce393488ae8f26a00b0
2020-03-31 13:21:53 -06:00

33 lines
1.2 KiB
YAML

---
- name: Build distro string
set_fact:
_tripleo_repos_distro: "{{ (ansible_facts.distribution == 'RedHat') | ternary('rhel', 'centos') }}{{ ansible_facts.distribution_major_version }}"
_tripleo_repos_component: "{{ (ansible_facts.distribution_major_version|int >= 8) | ternary('component/tripleo/', '') }}"
- name: Build RDO repo url
set_fact:
_tripleo_repos_repo_url: "{{ tripleo_repos_repo_base }}/{{ _tripleo_repos_distro }}-{{ tripleo_repos_branch }}/{{ _tripleo_repos_component }}/current/"
- name: Find available tripleo_repos rpm
block:
- name: Grab repo package list
uri:
url: "{{ _tripleo_repos_repo_url }}"
return_content: true
retries: 10
delay: 3
register: _tripleo_repos_repo_data
- name: Find rpm name
set_fact:
_tripleo_repos_rpm: "{{ _tripleo_repos_repo_data.content | regex_search('python[0-9]-tripleo-repos-[a-z0-9-.]+\\.rpm') }}"
- name: Fail if rpm is missing
fail:
msg: Unable to find tripleo_repos rpm
when: _tripleo_repos_rpm|length == 0
- name: Install tripleo-repos
yum:
name: "{{ _tripleo_repos_repo_url }}{{ _tripleo_repos_rpm }}"
state: present
become: true