install-packages: invoke package manager only when necessary
This commit is contained in:
parent
271f0a27a5
commit
6ad2462448
3 changed files with 30 additions and 16 deletions
25
roles/install-packages/defaults/main.yml
Normal file
25
roles/install-packages/defaults/main.yml
Normal 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
|
|
@ -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
|
|
||||||
|
|
|
@ -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
|
|
||||||
|
|
Loading…
Reference in a new issue