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

@ -0,0 +1,25 @@
---
COMMON_PKGS:
- bash-completion
- htop
- vim
- strace
- dmidecode
- nethogs
- sysbench
- fio
- rsync
- lsof
EPEL_PKGS:
- iperf3
- nmap
- lvm2
- bind-utils
- psmisc # may work on deb/ubuntu also? - provides killall
- wget
DEB_PKGS:
- "{{ common_pkgs }}"
- dnsutils

View file

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

View file

@ -1,14 +1,6 @@
--- ---
- name: install packages (RHEL/CentOS/Fedora) - name: install packages (EPEL/Fedora)
package: package:
name: "{{ item }}" name: "{{ (COMMON_PKGS + EPEL_PKGS) | difference(ansible_facts.packages) }}"
state: latest state: present
with_items:
- "{{ common_pkgs }}"
- iperf3
- nmap
- lvm2
- bind-utils
- psmisc # may work on deb/ubuntu also? - provides killall
- wget