refactor: handle INJECT_FACTS_AS_VARS=false by using ansible_facts instead
Ansible 2.20 has deprecated the use of Ansible facts as variables. For example, `ansible_distribution` is now deprecated in favor of `ansible_facts["distribution"]`. This is due to making the default setting `INJECT_FACTS_AS_VARS=false`. For now, this will create WARNING messages, but in Ansible 2.24 it will be an error. See https://docs.ansible.com/projects/ansible/latest/porting_guides/porting_guide_core_2.20.html#inject-facts-as-vars Signed-off-by: Rich Megginson <rmeggins@redhat.com>
This commit is contained in:
committed by
Richard Megginson
parent
ebf671b9a8
commit
c9cd2fb359
+2
-2
@@ -35,8 +35,8 @@ __aide_rh_distros:
|
||||
__aide_rh_distros_fedora: "{{ __aide_rh_distros + ['Fedora'] }}"
|
||||
|
||||
# Use this in conditionals to check if distro is Red Hat or clone
|
||||
__aide_is_rh_distro: "{{ ansible_distribution in __aide_rh_distros }}"
|
||||
__aide_is_rh_distro: "{{ ansible_facts['distribution'] in __aide_rh_distros }}"
|
||||
|
||||
# Use this in conditionals to check if distro is Red Hat or clone, or Fedora
|
||||
__aide_is_rh_distro_fedora: "{{ ansible_distribution in __aide_rh_distros_fedora }}"
|
||||
__aide_is_rh_distro_fedora: "{{ ansible_facts['distribution'] in __aide_rh_distros_fedora }}"
|
||||
# END - DO NOT EDIT THIS BLOCK - rh distros variables
|
||||
|
||||
Reference in New Issue
Block a user