From a163d9f14c82e9486039f7e7d06397a37ac6b4ec Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Tue, 15 Feb 2022 16:32:50 +0100 Subject: [PATCH] Use ansible_facts to access pkg_mgr This is required when injecting facts as vars is disabled [0]. [0] https://docs.ansible.com/ansible/latest/reference_appendices/config.html#inject-facts-as-vars --- tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index fbcd6c8..001d324 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -7,7 +7,7 @@ name: chrony state: present update_cache: yes - cache_valid_time: "{{ '3600' if ansible_pkg_mgr == 'apt' else omit }}" + cache_valid_time: "{{ '3600' if ansible_facts.pkg_mgr == 'apt' else omit }}" become: true - import_tasks: config_chrony.yml