diff --git a/defaults/main.yml b/defaults/main.yml index 0634d972..74b23d1f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -186,7 +186,7 @@ glance_cors_allowed_origin: "{{ (glance_show_multiple_locations | bool) | ternar ## Cap the maximum number of threads / workers when a user value is unspecified. glance_api_threads_max: 16 -glance_api_threads: "{{ [[(ansible_processor_vcpus//ansible_processor_threads_per_core)|default(1), 1] | max, glance_api_threads_max] | min }}" +glance_api_threads: "{{ [[(ansible_facts['processor_vcpus']//ansible_facts['processor_threads_per_core'])|default(1), 1] | max, glance_api_threads_max] | min }}" glance_task_executor: taskflow glance_digest_algorithm: sha256 @@ -275,7 +275,7 @@ glance_services: # Glance uWSGI settings glance_wsgi_processes_max: 16 -glance_wsgi_processes: "{{ [[(ansible_processor_vcpus//ansible_processor_threads_per_core)|default(1), 1] | max * 2, glance_wsgi_processes_max] | min }}" +glance_wsgi_processes: "{{ [[(ansible_facts['processor_vcpus']//ansible_facts['processor_threads_per_core'])|default(1), 1] | max * 2, glance_wsgi_processes_max] | min }}" glance_wsgi_threads: 1 ## Tunable overrides diff --git a/handlers/main.yml b/handlers/main.yml index fdeddf6f..300e96f8 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -18,7 +18,7 @@ name: "{{ item.service_name }}" enabled: yes state: "stopped" - daemon_reload: "{{ (ansible_service_mgr == 'systemd') | ternary('yes', omit) }}" + daemon_reload: "{{ (ansible_facts['service_mgr'] == 'systemd') | ternary('yes', omit) }}" with_items: "{{ filtered_glance_services }}" register: _stop until: _stop is success @@ -33,7 +33,7 @@ name: "{{ item.service_name }}" enabled: yes state: "started" - daemon_reload: "{{ (ansible_service_mgr == 'systemd') | ternary('yes', omit) }}" + daemon_reload: "{{ (ansible_facts['service_mgr'] == 'systemd') | ternary('yes', omit) }}" with_items: "{{ filtered_glance_services }}" register: _start until: _start is success diff --git a/meta/main.yml b/meta/main.yml index 00aec9d1..906ad8e9 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -42,4 +42,4 @@ galaxy_info: dependencies: - role: apt_package_pinning when: - - ansible_pkg_mgr == 'apt' + - ansible_facts['pkg_mgr'] == 'apt' diff --git a/tasks/glance_install.yml b/tasks/glance_install.yml index 9415517d..f2fadd95 100644 --- a/tasks/glance_install.yml +++ b/tasks/glance_install.yml @@ -117,8 +117,8 @@ package: name: "{{ glance_package_list }}" state: "{{ glance_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 diff --git a/tasks/main.yml b/tasks/main.yml index 2231a127..d37447af 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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 diff --git a/tests/test-create-nfs-dev.yml b/tests/test-create-nfs-dev.yml index 4b490107..19c322bf 100644 --- a/tests/test-create-nfs-dev.yml +++ b/tests/test-create-nfs-dev.yml @@ -22,7 +22,7 @@ - block: - name: Install NFS packages package: - name: "{{ nfs_package[ansible_distribution | lower] }}" + name: "{{ nfs_package[ansible_facts['distribution'] | lower] }}" state: present - name: create the system group for nfs diff --git a/vars/redhat.yml b/vars/redhat.yml index 06e93954..399476ac 100644 --- a/vars/redhat.yml +++ b/vars/redhat.yml @@ -26,7 +26,7 @@ glance_devel_distro_packages: glance_service_distro_packages: - openstack-glance - - "{{ ansible_distribution_major_version is version('8', '<') | ternary('systemd-python', 'python3-systemd') }}" + - "{{ ansible_facts['distribution_major_version'] is version('8', '<') | ternary('systemd-python', 'python3-systemd') }}" glance_oslomsg_amqp1_distro_packages: - cyrus-sasl-lib