Use ansible_facts[] instead of fact variables

See https://github.com/ansible/ansible/issues/73654
Change-Id: Ic75eac3e27fd542370a04f9bd946d907f0756061
This commit is contained in:
Jonathan Rosser
2021年03月01日 10:29:14 +00:00
parent 4a2f3e3351
commit 049a1aed1e

View File

@@ -16,12 +16,12 @@
- name:Gather variables for each operating system
include_vars:"{{ item }}"
with_first_found:
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ ansible_distribution | lower }}.yml"
- "{{ ansible_os_family | lower }}-{{ ansible_distribution_version.split('.')[0] }}.yml"
- "{{ ansible_os_family | lower }}.yml"
- "{{ ansible_facts['distribution'] | lower }}-{{ ansible_facts['distribution_version'] | lower }}.yml"
- "{{ ansible_facts['distribution'] | lower }}-{{ ansible_facts['distribution_major_version'] | lower }}.yml"
- "{{ ansible_facts['os_family'] | lower }}-{{ ansible_facts['distribution_major_version'] | lower }}.yml"
- "{{ ansible_facts['distribution'] | lower }}.yml"
- "{{ ansible_facts['os_family'] | lower }}-{{ ansible_facts['distribution_version'].split('.')[0] }}.yml"
- "{{ ansible_facts['os_family'] | lower }}.yml"
tags:
- always
@@ -35,7 +35,7 @@
- name:Gather variables for source installs
include_vars:source_install.yml
when:
- ((tempest_install_method == 'source') or (tempest_install_method == 'distro' and ansible_distribution == 'Ubuntu'))
- ((tempest_install_method == 'source') or (tempest_install_method == 'distro' and ansible_facts['distribution'] == 'Ubuntu'))
tags:
- always

View File

@@ -18,8 +18,8 @@
package:
name:"{{ tempest_package_list }}"
state:"{{ tempest_package_state }}"
update_cache:"{{ (ansible_pkg_mgr in ['apt', 'zypper']) | ternary('yes', omit) }}"
cache_valid_time:"{{ (ansible_pkg_mgr == 'apt') | ternary(cache_timeout, omit) }}"
update_cache:"{{ (ansible_facts['pkg_mgr'] in ['apt', 'zypper']) | ternary('yes', omit) }}"
cache_valid_time:"{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary(cache_timeout, omit) }}"
register:install_packages
until:install_packages is success
retries:5
@@ -31,7 +31,7 @@
# in defaults as in case of non-integrated tests meta handlers from other roles might fail.
- name:Install Tempest packages from PIP
import_tasks:tempest_install_source.yml
when:(tempest_install_method | default('source')) == 'source' or (tempest_install_method == 'distro' and ansible_distribution == 'Ubuntu')
when:(tempest_install_method | default('source')) == 'source' or (tempest_install_method == 'distro' and ansible_facts['distribution'] == 'Ubuntu')
- name:Install stackviz on venv
import_role:
Reference in New Issue
openstack/openstack-ansible-os_tempest
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.