Remove logic for Ubuntu 20.04 and Debian 11
This commit is contained in:
@ -1,19 +1,6 @@
|
||||
---
|
||||
- name: Configure Debian packages
|
||||
block:
|
||||
# Create directory for third-party package signing keys. Required on distros
|
||||
# older than Debian 12 / Ubuntu 22.04.
|
||||
#
|
||||
# See: https://wiki.debian.org/DebianRepository/UseThirdParty
|
||||
- name: Create /etc/apt/keyrings
|
||||
file:
|
||||
path: /etc/apt/keyrings
|
||||
mode: "0755"
|
||||
owner: root
|
||||
group: root
|
||||
state: directory
|
||||
when: ansible_distribution_major_version is version('12', '<')
|
||||
|
||||
# Scaleway seems to use a weird sources.list format as of Debian 12?
|
||||
- name: Check for weird Debian sources
|
||||
ansible.builtin.stat:
|
||||
|
@ -1,19 +1,6 @@
|
||||
---
|
||||
- name: Configure Ubuntu packages
|
||||
block:
|
||||
# Create directory for third-party package signing keys. Required on distros
|
||||
# older than Debian 12 / Ubuntu 22.04.
|
||||
#
|
||||
# See: https://wiki.debian.org/DebianRepository/UseThirdParty
|
||||
- name: Create /etc/apt/keyrings
|
||||
file:
|
||||
path: /etc/apt/keyrings
|
||||
mode: "0755"
|
||||
owner: root
|
||||
group: root
|
||||
state: directory
|
||||
when: ansible_distribution_major_version is version('22.04', '<')
|
||||
|
||||
- name: Configure apt mirror
|
||||
ansible.builtin.template: src=sources.list.j2 dest=/etc/apt/sources.list owner=root group=root mode=0644
|
||||
when: ansible_architecture != 'armv7l'
|
||||
@ -45,38 +32,6 @@
|
||||
- name: Install base packages
|
||||
ansible.builtin.apt: pkg={{ ubuntu_base_packages }} state=present cache_valid_time=3600
|
||||
|
||||
# We have to remove snaps one by one in a specific order because some depend
|
||||
# on others. Only after that can we remove the corresponding system packages.
|
||||
- name: Remove lxd snap
|
||||
community.general.snap: name=lxd state=absent
|
||||
when: ansible_distribution_version is version('20.04', '==')
|
||||
ignore_errors: true
|
||||
|
||||
- name: Remove core18 snap
|
||||
community.general.snap: name=core18 state=absent
|
||||
when: ansible_distribution_version is version('20.04', '==')
|
||||
ignore_errors: true
|
||||
|
||||
- name: Remove snapd snap
|
||||
community.general.snap: name=snapd state=absent
|
||||
when: ansible_distribution_version is version('20.04', '==')
|
||||
ignore_errors: true
|
||||
|
||||
- name: Set fact for packages to remove (Ubuntu 20.04)
|
||||
ansible.builtin.set_fact:
|
||||
ubuntu_annoying_packages:
|
||||
- whoopsie # security (CIS 4.1)
|
||||
- apport # security (CIS 4.1)
|
||||
- command-not-found # annoying
|
||||
- command-not-found-data # annoying
|
||||
- python3-commandnotfound # annoying
|
||||
- snapd # annoying (Ubuntu >= 16.04)
|
||||
- lxd-agent-loader # annoying (Ubuntu 20.04)
|
||||
when: ansible_distribution_version is version('20.04', '==')
|
||||
|
||||
- name: Remove packages
|
||||
ansible.builtin.apt: name={{ ubuntu_annoying_packages }} state=absent purge=true
|
||||
|
||||
- name: Disable annoying Canonical spam in MOTD
|
||||
ansible.builtin.file: path={{ item }} mode=0644 state=absent
|
||||
loop:
|
||||
|
@ -59,12 +59,7 @@ NFT_HEAD
|
||||
fi
|
||||
|
||||
echo "Reloading nftables"
|
||||
{% if ansible_distribution == 'Ubuntu' and ansible_distribution_version is version('20.04', '<=') %}
|
||||
{% set systemctl_bin = '/bin/systemctl' %}
|
||||
{% else %}
|
||||
{% set systemctl_bin = '/usr/bin/systemctl' %}
|
||||
{% endif -%}
|
||||
|
||||
{{ systemctl_bin }} reload nftables.service
|
||||
/usr/bin/systemctl reload nftables.service
|
||||
|
||||
rm -v firehol_level1.netset
|
||||
|
Reference in New Issue
Block a user