diff --git a/CHANGELOG.md b/CHANGELOG.md index 7645c16..212fb7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,5 +8,6 @@ * Manage default preferences file. * Ensure to install some additionnals tools (aptitude,…). * Ensure to remove really useless packages (laptop-detect, tasksel,…). +* Ensure to never remove some packages pattern. * Manage general, periodic and dpkg config files. * Purge default configuration files sets by others apps. diff --git a/README.md b/README.md index ca6c4cf..ab9a596 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ Manage APT repos, preferences and configuration for IPR's servers. ## Configuration ### APT Configuration +- Ensure to never remove some packages pattern. - Set general APT configurations. - Set periodic actions. - Set dpkg default values. diff --git a/defaults/main.yml b/defaults/main.yml index 2cc16cf..ee0ae7c 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -6,8 +6,6 @@ apt_conf_download_upgradeable_pkg: 1 apt_conf_auto_clean_interval: 0 apt_conf_purge_list: - 00trustcdrom - - 01autoremove - - 01autoremove-kernels - 15hobbit-plugins-update-stamp - 20listchanges - 70debconf diff --git a/tasks/config.yml b/tasks/config.yml index 4a1bacf..627f20f 100644 --- a/tasks/config.yml +++ b/tasks/config.yml @@ -9,6 +9,7 @@ group: root mode: 0644 with_items: + - "etc/apt/apt.conf.d/01autoremove" - "etc/apt/apt.conf.d/10general" - "etc/apt/apt.conf.d/10periodic" diff --git a/templates/etc/apt/apt.conf.d/01autoremove.j2 b/templates/etc/apt/apt.conf.d/01autoremove.j2 new file mode 100644 index 0000000..33bd89b --- /dev/null +++ b/templates/etc/apt/apt.conf.d/01autoremove.j2 @@ -0,0 +1,53 @@ +# {{ ansible_managed }} + +APT +{ + NeverAutoRemove + { + "^firmware-linux.*"; + "^linux-firmware$"; + "^pve-kernel-.*"; + }; + + VersionedKernelPackages + { + # linux kernels + "linux-image"; + "linux-headers"; + "linux-image-extra"; + "linux-signed-image"; + # kfreebsd kernels + "kfreebsd-image"; + "kfreebsd-headers"; + # hurd kernels + "gnumach-image"; + # (out-of-tree) modules + ".*-modules"; + ".*-kernel"; + "linux-backports-modules-.*"; + # tools + "linux-tools"; + }; + + Never-MarkAuto-Sections + { + "metapackages"; + "contrib/metapackages"; + "non-free/metapackages"; + "restricted/metapackages"; + "oldlibs"; + "universe/metapackages"; + "multiverse/metapackages"; + }; + + Move-Autobit-Sections + { + "oldlibs"; + "contrib/oldlibs"; + "non-free/oldlibs"; + "restricted/oldlibs"; + "universe/oldlibs"; + "multiverse/oldlibs"; + }; +}; +