Skip to content

Commit 4a6c870

Browse files
authored
Merge pull request #268 from Evaluation-Software-Development/ansible_2_20
update to prevent INJECT_FACTS_AS_VARS deprecation
2 parents d28c26b + 71ecb64 commit 4a6c870

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

molecule/default/converge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
pre_tasks:
1515
- name: Update apt cache.
1616
apt: update_cache=yes cache_valid_time=600
17-
when: ansible_os_family == 'Debian'
17+
when: ansible_facts.os_family == 'Debian'
1818
changed_when: false
1919

2020
roles:

tasks/configure-RedHat.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@
4545
stat:
4646
path: /etc/pki/tls/certs/localhost.crt
4747
register: localhost_cert
48-
when: ansible_distribution_major_version | int >= 8
48+
when: ansible_facts.distribution_major_version | int >= 8
4949

5050
- name: Ensure httpd certs are installed (RHEL 8 and later).
5151
command: /usr/libexec/httpd-ssl-gencerts
5252
when:
53-
- ansible_distribution_major_version | int >= 8
53+
- ansible_facts.distribution_major_version | int >= 8
5454
- not localhost_cert.stat.exists

tasks/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
---
22
# Include variables and define needed variables.
33
- name: Include OS-specific variables.
4-
include_vars: "{{ ansible_os_family }}.yml"
4+
include_vars: "{{ ansible_facts.os_family }}.yml"
55

66
- name: Include variables for Amazon Linux.
77
include_vars: "AmazonLinux.yml"
88
when:
9-
- ansible_distribution == "Amazon"
10-
- ansible_distribution_major_version == "NA"
9+
- ansible_facts.distribution == "Amazon"
10+
- ansible_facts.distribution_major_version == "NA"
1111

1212
- name: Define apache_packages.
1313
set_fact:
1414
apache_packages: "{{ __apache_packages | list }}"
1515
when: apache_packages is not defined
1616

1717
# Setup/install tasks.
18-
- include_tasks: "setup-{{ ansible_os_family }}.yml"
18+
- include_tasks: "setup-{{ ansible_facts.os_family }}.yml"
1919

2020
# Figure out what version of Apache is installed.
2121
- name: Get installed version of Apache.
@@ -38,7 +38,7 @@
3838

3939
# Configure Apache.
4040
- name: Configure Apache.
41-
include_tasks: "configure-{{ ansible_os_family }}.yml"
41+
include_tasks: "configure-{{ ansible_facts.os_family }}.yml"
4242

4343
- name: Ensure Apache has selected state and enabled on boot.
4444
service:

0 commit comments

Comments
 (0)