install-packages: invoke package manager only when necessary

This commit is contained in:
Josh Lay 2020-04-17 20:50:21 -05:00
parent 271f0a27a5
commit 6ad2462448
3 changed files with 30 additions and 16 deletions

View file

@ -2,8 +2,5 @@
- name: install packages (Debian/Ubuntu)
package:
name: "{{ item }}"
state: latest
with_items:
- "{{ common_pkgs }}"
- dnsutils
name: "{{ (COMMON_PKGS + DEB_PKGS) | difference(ansible_facts.packages) }}"
state: present