Files
tripleo-operator-ansible/roles/tripleo_repos/tasks/install.yml
Alex Schultz b64e78c60d Fix tripleo_repos role
We accidently renamed the tripleo-repos rpm and command when we renamed
the role from tripleo-repos to tripleo_repos.  Additionally we didn't
have return_content for the uri request to find the rpm url so it wasn't
working correctly.

Change-Id: I14ccb1583740592daa3f98ca50ac5c59303a25cd
2020-02-07 23:18:22 +00:00

32 lines
1.0 KiB
YAML

---
- name: Build distro string
set_fact:
_tripleo_repos_distro: "{{ (ansible_facts.distribution == 'RedHat') | ternary('rhel', 'centos') }}{{ ansible_facts.distribution_major_version }}"
- name: Build RDO repo url
set_fact:
_tripleo_repos_repo_url: "{{ tripleo_repos_repo_base }}/{{ _tripleo_repos_distro }}-{{ tripleo_repos_branch }}/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