Skip to content

Commit f38dac1

Browse files
committed
Attempt to fix ansible_facts deprecation warnings.
1 parent 335e889 commit f38dac1

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

molecule/default/converge.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
apt:
1616
update_cache: true
1717
cache_valid_time: 600
18-
when: ansible_os_family == 'Debian'
18+
when: ansible_facts.os_family == 'Debian'
1919
changed_when: false
2020

2121
roles:
2222
- role: geerlingguy.repo-remi
2323
when:
24-
- ansible_os_family == 'RedHat'
25-
- ansible_distribution != 'Fedora'
24+
- ansible_facts.os_family == 'RedHat'
25+
- ansible_facts.distribution != 'Fedora'
2626
- role: geerlingguy.php
2727

2828
post_tasks:

molecule/default/source-install.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
pre_tasks:
1616
- name: Update apt cache.
1717
apt: update_cache=true cache_valid_time=600
18-
when: ansible_os_family == 'Debian'
18+
when: ansible_facts.os_family == 'Debian'
1919
changed_when: false
2020

2121
roles:

tasks/configure-fpm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@
5252
enabled: "{{ php_fpm_enabled_on_boot }}"
5353
when:
5454
- php_enable_php_fpm
55-
- ansible_distribution != "Debian"
55+
- ansible_facts.distribution != "Debian"
5656
- not ansible_check_mode

tasks/install-from-source.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
- mariadb-devel
2828
- gmp-devel
2929
state: present
30-
when: ansible_os_family == 'RedHat'
30+
when: ansible_facts.os_family == 'RedHat'
3131

3232
- name: Update apt cache (Debian).
3333
apt: update_cache=yes cache_valid_time=86400
34-
when: ansible_os_family == 'Debian'
34+
when: ansible_facts.os_family == 'Debian'
3535

3636
- name: Ensure dependencies for building from source are installed (Debian).
3737
apt:
@@ -59,7 +59,7 @@
5959
- librecode-dev
6060
- libssl-dev
6161
state: present
62-
when: ansible_os_family == 'Debian'
62+
when: ansible_facts.os_family == 'Debian'
6363

6464
- name: Define php_fpm_daemon (if not defined already).
6565
set_fact:

tasks/main.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
---
22
# Variable setup.
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 distribution and version-specific vars.
77
include_vars: "{{ item }}"
88
with_first_found:
99
- files:
10-
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
10+
- "{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_major_version }}.yml"
1111
skip: true
1212

1313
- name: Set the default PHP version for Debian-based OSes.
1414
set_fact:
1515
php_default_version_debian: "{{ __php_default_version_debian }}"
16-
when: php_default_version_debian is not defined and ansible_os_family == 'Debian'
16+
when: php_default_version_debian is not defined and ansible_facts.os_family == 'Debian'
1717

1818
- name: Define the name of the JSON extension package on Debian for PHP <8.
1919
set_fact:
2020
__php_json_package_debian: "{{ 'php' + php_default_version_debian + '-json' }}"
21-
when: ansible_os_family == 'Debian' and php_default_version_debian is version('8.0', '<')
21+
when: ansible_facts.os_family == 'Debian' and php_default_version_debian is version('8.0', '<')
2222

2323
- name: Add the JSON extension on Debian for PHP <8.
2424
set_fact:
@@ -53,7 +53,7 @@
5353
- name: Define php_opcache_conf_filename (Ubuntu 16.04).
5454
set_fact:
5555
php_opcache_conf_filename: "10-opcache.ini"
56-
when: php_opcache_conf_filename is not defined and ansible_distribution_version == "16.04"
56+
when: php_opcache_conf_filename is not defined and ansible_facts.distribution_version == "16.04"
5757

5858
- name: Define php_opcache_conf_filename.
5959
set_fact:
@@ -69,12 +69,12 @@
6969
- include_tasks: setup-RedHat.yml
7070
when:
7171
- not php_install_from_source
72-
- ansible_os_family == 'RedHat'
72+
- ansible_facts.os_family == 'RedHat'
7373

7474
- include_tasks: setup-Debian.yml
7575
when:
7676
- not php_install_from_source
77-
- ansible_os_family == 'Debian'
77+
- ansible_facts.os_family == 'Debian'
7878

7979
# Install PHP from source when php_install_from_source is true.
8080
- include_tasks: install-from-source.yml

0 commit comments

Comments
 (0)