From 5e35cfc3321df891dca8e17a2afe1209c31b1a7b Mon Sep 17 00:00:00 2001 From: Daniel Linder Date: Sun, 9 Jul 2023 14:07:01 -0500 Subject: [PATCH] Gather package_facts if not defined When calling role, the package_facts variable may not always be available - if it is not defined, gather them before continuing. --- tasks/facts.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tasks/facts.yml b/tasks/facts.yml index 89acf0f..ab0daaa 100644 --- a/tasks/facts.yml +++ b/tasks/facts.yml @@ -1,4 +1,10 @@ --- +- name: Ensure we have package facts + ansible.builtin.package_facts: + manager: auto + when: + - ansible_facts.packages is not defined + - name: Set installed PHP version vars: package: php-fpm