tripleo-operator-ansible/roles/tripleo_repos/tasks/install.yml

37 lines
1.3 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_repo_branch |
ternary(tripleo_repos_repo_branch, 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
# We do not sign the rpm and we are fetching straight from a URL
disable_gpg_check: true
become: true