Limit tripleo-repos to CentOS

Our example playbooks have tripleo_repos defined however if they are run
on RHEL boxes this fails. Let's limit the tripleo_repos to just centos
for now.  Additionally switch to use ansible_facts for distribution
version information as well.

Change-Id: Ib9dc4219254b1afc9eb6b4e35099b1b3649930a7
This commit is contained in:
Alex Schultz 2021-07-13 14:13:09 -06:00
parent d2619150b5
commit 4b60170a31
2 changed files with 8 additions and 4 deletions

View File

@ -36,6 +36,8 @@
name: tripleo_repos
vars:
tripleo_repos_debug: "{{ standalone_debug }}"
when:
- ansible_facts.distribution == 'CentOS'
- name: Ensure system is up to date
yum:
@ -56,14 +58,14 @@
name: python-tripleoclient
state: installed
become: true
when: ansible_distribution_major_version|int <= 7
when: ansible_facts.distribution_major_version|int <= 7
- name: install python3 tripleoclient
package:
name: python3-tripleoclient
state: present
become: true
when: ansible_distribution_major_version|int >= 8
when: ansible_facts.distribution_major_version|int >= 8
- name: Generate parameters.yaml
copy:

View File

@ -26,6 +26,8 @@
- name: Configure tripleo repositories
include_role:
name: tripleo_repos
when:
- ansible_facts.distribution == 'CentOS'
- name: Ensure system is up to date
yum:
@ -46,14 +48,14 @@
name: python-tripleoclient
state: installed
become: true
when: ansible_distribution_major_version|int <= 7
when: ansible_facts.distribution_major_version|int <= 7
- name: install python3 tripleoclient
package:
name: python3-tripleoclient
state: present
become: true
when: ansible_distribution_major_version|int >= 8
when: ansible_facts.distribution_major_version|int >= 8
- name: Copy sample undercloud.conf
copy: