Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654 Change-Id: Ie427a6343fd888c9a1dd5c37a6285d33cd008b3e
This commit is contained in:
parent
f1c847b1df
commit
599e30daaa
@ -33,7 +33,7 @@ zun_venv_python_executable: "{{ openstack_venv_python_executable | default('pyth
|
|||||||
# for the service setup. The host must already have
|
# for the service setup. The host must already have
|
||||||
# clouds.yaml properly configured.
|
# clouds.yaml properly configured.
|
||||||
zun_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}"
|
zun_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}"
|
||||||
zun_service_setup_host_python_interpreter: "{{ openstack_service_setup_host_python_interpreter | default((zun_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_python['executable'])) }}"
|
zun_service_setup_host_python_interpreter: "{{ openstack_service_setup_host_python_interpreter | default((zun_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable'])) }}"
|
||||||
|
|
||||||
# Set the package install state for distribution packages
|
# Set the package install state for distribution packages
|
||||||
# Options are 'present' and 'latest'
|
# Options are 'present' and 'latest'
|
||||||
@ -122,7 +122,7 @@ zun_docker_prune_frequency: hour
|
|||||||
|
|
||||||
## Database info
|
## Database info
|
||||||
zun_db_setup_host: "{{ openstack_db_setup_host | default('localhost') }}"
|
zun_db_setup_host: "{{ openstack_db_setup_host | default('localhost') }}"
|
||||||
zun_db_setup_python_interpreter: "{{ openstack_db_setup_python_interpreter | default((zun_db_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_python['executable'])) }}"
|
zun_db_setup_python_interpreter: "{{ openstack_db_setup_python_interpreter | default((zun_db_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable'])) }}"
|
||||||
zun_galera_address: "{{ galera_address | default('127.0.0.1') }}"
|
zun_galera_address: "{{ galera_address | default('127.0.0.1') }}"
|
||||||
zun_galera_user: zun
|
zun_galera_user: zun
|
||||||
zun_galera_database: zun
|
zun_galera_database: zun
|
||||||
@ -230,7 +230,7 @@ zun_container_runtime: runc
|
|||||||
|
|
||||||
## Cap the maximun number of threads / workers when a user value is unspecified.
|
## Cap the maximun number of threads / workers when a user value is unspecified.
|
||||||
zun_api_threads_max: 16
|
zun_api_threads_max: 16
|
||||||
zun_api_threads: "{{ [[(ansible_processor_vcpus//ansible_processor_threads_per_core)|default(1), 1] | max * 2, zun_api_threads_max] | min }}"
|
zun_api_threads: "{{ [[(ansible_facts['processor_vcpus']//ansible_facts['processor_threads_per_core'])|default(1), 1] | max * 2, zun_api_threads_max] | min }}"
|
||||||
|
|
||||||
zun_service_in_ldap: "{{ service_ldap_backend_enabled | default(False) }}"
|
zun_service_in_ldap: "{{ service_ldap_backend_enabled | default(False) }}"
|
||||||
|
|
||||||
@ -244,7 +244,7 @@ zun_scheduler_driver: filter_scheduler
|
|||||||
## uWSGI setup
|
## uWSGI setup
|
||||||
zun_wsgi_threads: 1
|
zun_wsgi_threads: 1
|
||||||
zun_wsgi_processes_max: 16
|
zun_wsgi_processes_max: 16
|
||||||
zun_wsgi_processes: "{{ [[ansible_processor_vcpus|default(1), 1] | max * 2, zun_wsgi_processes_max] | min }}"
|
zun_wsgi_processes: "{{ [[ansible_facts['processor_vcpus']|default(1), 1] | max * 2, zun_wsgi_processes_max] | min }}"
|
||||||
|
|
||||||
## Service Name-Group Mapping
|
## Service Name-Group Mapping
|
||||||
zun_services:
|
zun_services:
|
||||||
|
@ -16,11 +16,11 @@
|
|||||||
- name: Gather variables for each operating system
|
- name: Gather variables for each operating system
|
||||||
include_vars: "{{ item }}"
|
include_vars: "{{ item }}"
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
|
- "{{ ansible_facts['distribution'] | lower }}-{{ ansible_facts['distribution_version'] | lower }}.yml"
|
||||||
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
|
- "{{ ansible_facts['distribution'] | lower }}-{{ ansible_facts['distribution_major_version'] | lower }}.yml"
|
||||||
- "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
|
- "{{ ansible_facts['os_family'] | lower }}-{{ ansible_facts['distribution_major_version'] | lower }}.yml"
|
||||||
- "{{ ansible_distribution | lower }}.yml"
|
- "{{ ansible_facts['distribution'] | lower }}.yml"
|
||||||
- "{{ ansible_os_family | lower }}.yml"
|
- "{{ ansible_facts['os_family'] | lower }}.yml"
|
||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
delay: 2
|
delay: 2
|
||||||
|
|
||||||
when:
|
when:
|
||||||
- "ansible_pkg_mgr == 'apt'"
|
- "ansible_facts['pkg_mgr'] == 'apt'"
|
||||||
|
|
||||||
- name: Add docker repo
|
- name: Add docker repo
|
||||||
yum_repository:
|
yum_repository:
|
||||||
@ -90,7 +90,7 @@
|
|||||||
delay: 2
|
delay: 2
|
||||||
with_items: "{{ zun_docker_repo }}"
|
with_items: "{{ zun_docker_repo }}"
|
||||||
when:
|
when:
|
||||||
- ansible_pkg_mgr == 'dnf'
|
- ansible_facts['pkg_mgr'] == 'dnf'
|
||||||
|
|
||||||
- name: Enable module_hotfixes
|
- name: Enable module_hotfixes
|
||||||
lineinfile:
|
lineinfile:
|
||||||
@ -100,15 +100,15 @@
|
|||||||
insertafter: "^enabled"
|
insertafter: "^enabled"
|
||||||
with_items: "{{ zun_docker_repo }}"
|
with_items: "{{ zun_docker_repo }}"
|
||||||
when:
|
when:
|
||||||
- ansible_os_family | lower == 'redhat'
|
- ansible_facts['os_family'] | lower == 'redhat'
|
||||||
|
|
||||||
- name: Install compute distro packages
|
- name: Install compute distro packages
|
||||||
package:
|
package:
|
||||||
name: "{{ zun_distro_compute_packages }}"
|
name: "{{ zun_distro_compute_packages }}"
|
||||||
state: "{{ zun_package_state }}"
|
state: "{{ zun_package_state }}"
|
||||||
update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}"
|
update_cache: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('yes', omit) }}"
|
||||||
cache_valid_time: "{{ (ansible_pkg_mgr == 'apt') | ternary(cache_timeout, omit) }}"
|
cache_valid_time: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary(cache_timeout, omit) }}"
|
||||||
enablerepo: "{{ (ansible_pkg_mgr == 'dnf') | ternary('extras', omit) }}"
|
enablerepo: "{{ (ansible_facts['pkg_mgr'] == 'dnf') | ternary('extras', omit) }}"
|
||||||
|
|
||||||
- name: Ensure the containerd config directory exists
|
- name: Ensure the containerd config directory exists
|
||||||
file:
|
file:
|
||||||
@ -267,7 +267,7 @@
|
|||||||
command:
|
command:
|
||||||
cmd: "/sbin/mpathconf --enable"
|
cmd: "/sbin/mpathconf --enable"
|
||||||
creates: "/etc/multipath.conf"
|
creates: "/etc/multipath.conf"
|
||||||
when: ansible_os_family == "RedHat"
|
when: ansible_facts['os_family'] == "RedHat"
|
||||||
|
|
||||||
- name: Enable multipathd service
|
- name: Enable multipathd service
|
||||||
systemd:
|
systemd:
|
||||||
|
@ -15,18 +15,18 @@
|
|||||||
|
|
||||||
_zun_docker_package_version: "5:19.03.14~*"
|
_zun_docker_package_version: "5:19.03.14~*"
|
||||||
_zun_containerd_package_version: "1.4.3-1"
|
_zun_containerd_package_version: "1.4.3-1"
|
||||||
_zun_kata_package_version: "{{ (ansible_distribution_release | lower == 'focal') | ternary('1.12.0-2', '1.11.5-9') }}"
|
_zun_kata_package_version: "{{ (ansible_facts['distribution_release'] | lower == 'focal') | ternary('1.12.0-2', '1.11.5-9') }}"
|
||||||
|
|
||||||
zun_kata_repo_version: "{{ (ansible_distribution_release | lower == 'focal') | ternary('stable-1.12', 'stable-1.11') }}"
|
zun_kata_repo_version: "{{ (ansible_facts['distribution_release'] | lower == 'focal') | ternary('stable-1.12', 'stable-1.11') }}"
|
||||||
zun_kata_repo_distro: "{{ (ansible_distribution | lower == 'ubuntu') | ternary('x', '') }}{{ ansible_distribution | capitalize }}"
|
zun_kata_repo_distro: "{{ (ansible_facts['distribution'] | lower == 'ubuntu') | ternary('x', '') }}{{ ansible_facts['distribution'] | capitalize }}"
|
||||||
|
|
||||||
zun_docker_repo:
|
zun_docker_repo:
|
||||||
- name: "docker-ce"
|
- name: "docker-ce"
|
||||||
repo: "deb [arch=amd64] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release | lower }} stable"
|
repo: "deb [arch=amd64] https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }} {{ ansible_facts['distribution_release'] | lower }} stable"
|
||||||
gpg_uri: "https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg"
|
gpg_uri: "https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }}/gpg"
|
||||||
- name: "kata"
|
- name: "kata"
|
||||||
repo: "deb https://download.opensuse.org/repositories/home:/katacontainers:/releases:/{{ ansible_architecture }}:/{{ zun_kata_repo_version }}/{{ zun_kata_repo_distro }}_{{ ansible_distribution_version }}/ /"
|
repo: "deb https://download.opensuse.org/repositories/home:/katacontainers:/releases:/{{ ansible_facts['architecture'] }}:/{{ zun_kata_repo_version }}/{{ zun_kata_repo_distro }}_{{ ansible_facts['distribution_version'] }}/ /"
|
||||||
gpg_uri: "https://download.opensuse.org/repositories/home:/katacontainers:/releases:/{{ ansible_architecture }}:/{{ zun_kata_repo_version }}/{{ zun_kata_repo_distro }}_{{ ansible_distribution_version }}/Release.key"
|
gpg_uri: "https://download.opensuse.org/repositories/home:/katacontainers:/releases:/{{ ansible_facts['architecture'] }}:/{{ zun_kata_repo_version }}/{{ zun_kata_repo_distro }}_{{ ansible_facts['distribution_version'] }}/Release.key"
|
||||||
|
|
||||||
# Common apt packages
|
# Common apt packages
|
||||||
zun_distro_packages:
|
zun_distro_packages:
|
||||||
|
@ -20,11 +20,11 @@ _zun_kata_package_version: "1.11.3-1"
|
|||||||
zun_docker_repo:
|
zun_docker_repo:
|
||||||
- name: "docker-ce"
|
- name: "docker-ce"
|
||||||
description: Docker CE Stable
|
description: Docker CE Stable
|
||||||
repo: "https://download.docker.com/linux/centos/{{ ansible_distribution_major_version }}/$basearch/stable"
|
repo: "https://download.docker.com/linux/centos/{{ ansible_facts['distribution_major_version'] }}/$basearch/stable"
|
||||||
gpgkey: "https://download.docker.com/linux/centos/gpg"
|
gpgkey: "https://download.docker.com/linux/centos/gpg"
|
||||||
- name: "kata"
|
- name: "kata"
|
||||||
description: Kata runtime
|
description: Kata runtime
|
||||||
repo: "http://mirror.centos.org/centos/{{ ansible_distribution_major_version }}/virt/$basearch/kata-containers"
|
repo: "http://mirror.centos.org/centos/{{ ansible_facts['distribution_major_version'] }}/virt/$basearch/kata-containers"
|
||||||
gpgkey: "http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-Official"
|
gpgkey: "http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-Official"
|
||||||
|
|
||||||
# Common yum packages
|
# Common yum packages
|
||||||
@ -33,15 +33,15 @@ zun_distro_packages:
|
|||||||
- systemd-devel
|
- systemd-devel
|
||||||
|
|
||||||
zun_distro_compute_packages:
|
zun_distro_compute_packages:
|
||||||
- "containerd.io-{{ zun_containerd_package_version }}.el{{ ansible_distribution_major_version }}.x86_64"
|
- "containerd.io-{{ zun_containerd_package_version }}.el{{ ansible_facts['distribution_major_version'] }}.x86_64"
|
||||||
- "docker-ce-cli-{{ zun_docker_package_version }}.el{{ ansible_distribution_major_version }}.x86_64"
|
- "docker-ce-cli-{{ zun_docker_package_version }}.el{{ ansible_facts['distribution_major_version'] }}.x86_64"
|
||||||
- "docker-ce-{{ zun_docker_package_version }}.el{{ ansible_distribution_major_version }}.x86_64"
|
- "docker-ce-{{ zun_docker_package_version }}.el{{ ansible_facts['distribution_major_version'] }}.x86_64"
|
||||||
- pciutils
|
- pciutils
|
||||||
- numactl
|
- numactl
|
||||||
- device-mapper-multipath
|
- device-mapper-multipath
|
||||||
- "kata-runtime-{{ zun_kata_package_version }}.el{{ ansible_distribution_major_version }}.x86_64"
|
- "kata-runtime-{{ zun_kata_package_version }}.el{{ ansible_facts['distribution_major_version'] }}.x86_64"
|
||||||
- "kata-shim-{{ zun_kata_package_version }}.el{{ ansible_distribution_major_version }}.x86_64"
|
- "kata-shim-{{ zun_kata_package_version }}.el{{ ansible_facts['distribution_major_version'] }}.x86_64"
|
||||||
# NOTE: This package is unavailable from the centos mirrors
|
# NOTE: This package is unavailable from the centos mirrors
|
||||||
# - "kata-proxy-{{ zun_kata_package_version }}.el{{ ansible_distribution_major_version }}.x86_64"
|
# - "kata-proxy-{{ zun_kata_package_version }}.el{{ ansible_facts['distribution_major_version'] }}.x86_64"
|
||||||
|
|
||||||
zun_docker_groupname: docker
|
zun_docker_groupname: docker
|
||||||
|
Loading…
Reference in New Issue
Block a user