Merge "Use ansible_facts[] instead of fact variables"

This commit is contained in:
Zuul 2021-05-27 23:12:48 +00:00 committed by Gerrit Code Review
commit 1fe2df61d2
3 changed files with 8 additions and 8 deletions

View File

@ -44,7 +44,7 @@ masakari_system_user_home: "/var/lib/{{ masakari_system_user_name }}"
## Database credentials
masakari_db_setup_host: "{{ openstack_db_setup_host | default('localhost') }}"
masakari_db_setup_python_interpreter: "{{ openstack_db_setup_python_interpreter | default((masakari_db_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_python['executable'])) }}"
masakari_db_setup_python_interpreter: "{{ openstack_db_setup_python_interpreter | default((masakari_db_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable'])) }}"
masakari_galera_address: "{{ galera_address | default('127.0.0.1') }}"
masakari_galera_database: masakari
masakari_galera_user: masakari

View File

@ -39,4 +39,4 @@ galaxy_info:
dependencies:
- role: apt_package_pinning
when:
- ansible_pkg_mgr == 'apt'
- ansible_facts['pkg_mgr'] == 'apt'

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