From 6dc74f1916e60a507ed6da7097a96fa747a63500 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Wed, 19 May 2021 10:14:41 +0200 Subject: [cleanup-*] cleanup roles for apt and systemd --- cleanup-apt/tasks/main.yml | 8 ++++++++ cleanup-systemd/defaults/main.yml | 28 ++++++++++++++++++++++++++++ cleanup-systemd/tasks/main.yml | 18 ++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 cleanup-apt/tasks/main.yml create mode 100644 cleanup-systemd/defaults/main.yml create mode 100644 cleanup-systemd/tasks/main.yml diff --git a/cleanup-apt/tasks/main.yml b/cleanup-apt/tasks/main.yml new file mode 100644 index 0000000..7618ab3 --- /dev/null +++ b/cleanup-apt/tasks/main.yml @@ -0,0 +1,8 @@ +--- +- name: apt | Remove dependencies that are no longer required + apt: + autoremove: yes + +# https://github.com/ansible/ansible/issues/38920 +- name: apt | Clean package cache + command: apt-get clean diff --git a/cleanup-systemd/defaults/main.yml b/cleanup-systemd/defaults/main.yml new file mode 100644 index 0000000..3237532 --- /dev/null +++ b/cleanup-systemd/defaults/main.yml @@ -0,0 +1,28 @@ +services: + - apport + - apport-autoreport + - apt-daily-upgrade + - apt-daily-upgrade.timer + - apt-daily + - apt-daily.timer + - fstrim.timer + - motd-news.timer + - smartd + - openarena-server + - anacron + - anacron.timer + - networkd-dispatcher + - NetworkManager + - NetworkManager-wait-online + - wpa_supplicant + - winbind + - nmbd + - smbd + - apparmor + - grub-common + - unattended-upgrades + - systemd-journal-flush + - systemd-tmpfiles-clean + - systemd-tmpfiles-clean.timer + - alsa-restore + - man-db.timer diff --git a/cleanup-systemd/tasks/main.yml b/cleanup-systemd/tasks/main.yml new file mode 100644 index 0000000..b6e61e4 --- /dev/null +++ b/cleanup-systemd/tasks/main.yml @@ -0,0 +1,18 @@ +--- +- name: Disable obsolete systemd services + systemd: + name: "{{ item }}" + state: stopped + masked: yes + enabled: no + with_items: + - "{{ services }}" + ignore_errors: yes + +- name: Remove kexec sysvinit compatibility files + file: + path: "{{ item }}" + state: absent + with_items: + - /etc/init.d/kexec + - /etc/init.d/kexec-load -- cgit v1.2.3-55-g7522