diff --git a/roles/common/tasks/packages_Ubuntu.yml b/roles/common/tasks/packages_Ubuntu.yml index 3e68798..4110803 100644 --- a/roles/common/tasks/packages_Ubuntu.yml +++ b/roles/common/tasks/packages_Ubuntu.yml @@ -34,12 +34,26 @@ - whoopsie # CIS 4.1 - apport # CIS 4.1 - - name: Remove annoying packages - apt: pkg={{ item }} state=absent purge=yes - loop: - - command-not-found - - command-not-found-data - - python3-commandnotfound + - name: Set fact for annoying packages + set_fact: + ubuntu_annoying_packages: + - command-not-found + - command-not-found-data + - python3-commandnotfound + + - name: Set fact for more annoying packages + set_fact: + ubuntu_more_annoying_packages: + - snapd + - lxd + - lxd-client + - liblxc1 + - lxc-common + - lxcfs + when: ansible_distribution_version is version_compare('16.04', '>=') + + - name: Remove more annoying packages + apt: name={{ ubuntu_annoying_packages | union(ubuntu_more_annoying_packages) }} state=absent purge=yes - name: Configure cron-apt import_tasks: cron-apt.yml