remove packages before installing

This commit is contained in:
packetcat 2023-04-22 19:20:06 -04:00
parent 634ccb19b6
commit a2427a856f
1 changed files with 12 additions and 11 deletions

View File

@ -24,6 +24,18 @@
hostname: hostname:
name: "{{ inventory_hostname }}" name: "{{ inventory_hostname }}"
use: systemd use: systemd
- name: Remove packages we do not need
apt:
name: "{{ packages }}"
state: absent
vars:
packages:
- exim4-daemon-light
- consolekit
- snapd
- lxcfs
- rpcbind
- ufw
- name: Install required packages - name: Install required packages
apt: apt:
name: "{{ packages }}" name: "{{ packages }}"
@ -54,17 +66,6 @@
- postfix - postfix
- python-is-python3 - python-is-python3
- net-tools - net-tools
- name: Remove packages we do not need
apt:
name: "{{ packages }}"
state: absent
vars:
packages:
- exim4-daemon-light
- consolekit
- snapd
- lxcfs
- rpcbind
- name: Ensure haveged, ntp, and vnstat are started on boot - name: Ensure haveged, ntp, and vnstat are started on boot
service: name={{ item }} enabled=yes service: name={{ item }} enabled=yes
with_items: with_items: