Skip to content

Commit

Permalink
Use ansible_facts to access pkg_mgr
Browse files Browse the repository at this point in the history
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
  • Loading branch information
priteau committed Feb 16, 2022
1 parent 03e263f commit a163d9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a163d9f

Please sign in to comment.