Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654 Change-Id: Ifa117789eaa79b3107a4a3dd8d1e1379ca04d238
This commit is contained in:
parent
394d487536
commit
e00da435b4
|
@ -20,7 +20,7 @@ debug: False
|
|||
# for the service setup. The host must already have
|
||||
# clouds.yaml properly configured.
|
||||
ceilometer_service_setup_host: "{{ openstack_service_setup_host | default('localhost') }}"
|
||||
ceilometer_service_setup_host_python_interpreter: "{{ openstack_service_setup_host_python_interpreter | default((ceilometer_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_python['executable'])) }}"
|
||||
ceilometer_service_setup_host_python_interpreter: "{{ openstack_service_setup_host_python_interpreter | default((ceilometer_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_facts['python']['executable'])) }}"
|
||||
|
||||
# Set the package install state for distribution packages
|
||||
# Options are 'present' and 'latest'
|
||||
|
@ -192,7 +192,7 @@ ceilometer_service_in_ldap: "{{ service_ldap_backend_enabled | default(False) }}
|
|||
## Ceilometer config
|
||||
# Cap the maximum number of threads / workers when a user value is unspecified
|
||||
ceilometer_notification_workers_max: 16
|
||||
ceilometer_notification_workers: "{{ [[ansible_processor_vcpus|default(2) // 2, 1] | max, ceilometer_notification_workers_max] | min }}"
|
||||
ceilometer_notification_workers: "{{ [[ansible_facts['processor_vcpus']|default(2) // 2, 1] | max, ceilometer_notification_workers_max] | min }}"
|
||||
|
||||
# Enable/Disable Ceilometer per service
|
||||
cinder_ceilometer_enabled: "{{ (groups['cinder_all'] is defined) and (groups['cinder_all'] | length > 0) }}"
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
name: "{{ item.0.service_name }}"
|
||||
enabled: yes
|
||||
state: "stopped"
|
||||
daemon_reload: "{{ (ansible_service_mgr == 'systemd') | ternary('yes', omit) }}"
|
||||
daemon_reload: yes
|
||||
with_subelements:
|
||||
- "{{ ceilometer_services }}"
|
||||
- group
|
||||
|
@ -36,7 +36,7 @@
|
|||
name: "{{ item.0.service_name }}"
|
||||
enabled: yes
|
||||
state: "started"
|
||||
daemon_reload: "{{ (ansible_service_mgr == 'systemd') | ternary('yes', omit) }}"
|
||||
daemon_reload: yes
|
||||
with_subelements:
|
||||
- "{{ ceilometer_services }}"
|
||||
- group
|
||||
|
|
|
@ -39,4 +39,4 @@ galaxy_info:
|
|||
dependencies:
|
||||
- role: apt_package_pinning
|
||||
when:
|
||||
- ansible_pkg_mgr == 'apt'
|
||||
- ansible_facts['pkg_mgr'] == 'apt'
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
package:
|
||||
name: "{{ ceilometer_package_list }}"
|
||||
state: "{{ ceilometer_package_state }}"
|
||||
update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}"
|
||||
cache_valid_time: "{{ (ansible_pkg_mgr == 'apt') | ternary(cache_timeout, omit) }}"
|
||||
update_cache: "{{ (ansible_facts['pkg_mgr'] == 'apt') | 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
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
- 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 }}.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 }}.yml"
|
||||
tags:
|
||||
- always
|
||||
|
||||
|
@ -125,4 +125,4 @@
|
|||
when:
|
||||
- _ceilometer_is_first_play_host
|
||||
tags:
|
||||
- ceilometer-config
|
||||
- ceilometer-config
|
||||
|
|
Loading…
Reference in New Issue