2014-08-16 23:35:57 +02:00
|
|
|
---
|
|
|
|
|
2018-04-26 15:58:35 +02:00
|
|
|
- block:
|
|
|
|
- name: Configure apt mirror
|
|
|
|
template: src=sources.list.j2 dest=/etc/apt/sources.list owner=root group=root mode=0644
|
|
|
|
when: ansible_architecture != 'armv7l'
|
2014-08-16 23:35:57 +02:00
|
|
|
|
2018-04-26 15:58:35 +02:00
|
|
|
- name: Upgrade base OS
|
2018-12-20 08:37:09 +01:00
|
|
|
apt: upgrade=dist update_cache=yes cache_valid_time=3600
|
2014-08-16 23:35:57 +02:00
|
|
|
|
2018-12-20 08:36:43 +01:00
|
|
|
- name: Set Ubuntu base packages
|
|
|
|
set_fact:
|
|
|
|
ubuntu_base_packages:
|
2018-04-26 15:58:35 +02:00
|
|
|
- git
|
|
|
|
- tmux
|
|
|
|
- iotop
|
|
|
|
- htop
|
|
|
|
- strace
|
|
|
|
- cron-apt
|
|
|
|
- safe-rm
|
|
|
|
- debian-goodies
|
|
|
|
- mosh
|
|
|
|
- python-pycurl # for ansible's apt_repository
|
|
|
|
- vim
|
|
|
|
- unzip
|
|
|
|
- apt-transport-https # for https support in apt
|
2019-09-14 19:36:40 +02:00
|
|
|
- zstd
|
2014-08-16 23:35:57 +02:00
|
|
|
|
2018-12-20 08:36:43 +01:00
|
|
|
- name: Install base packages
|
2018-12-20 08:40:10 +01:00
|
|
|
apt: pkg={{ ubuntu_base_packages }} state=present update_cache=yes cache_valid_time=3600
|
2018-12-20 08:36:43 +01:00
|
|
|
|
2020-04-25 09:02:52 +02:00
|
|
|
# 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
|
|
|
|
snap: name=lxd state=absent
|
|
|
|
when: ansible_distribution_version is version('20.04', '==')
|
2020-05-19 15:05:58 +02:00
|
|
|
ignore_errors: yes
|
2020-04-25 09:02:52 +02:00
|
|
|
|
|
|
|
- name: Remove core18 snap
|
|
|
|
snap: name=core18 state=absent
|
|
|
|
when: ansible_distribution_version is version('20.04', '==')
|
2020-05-19 15:05:58 +02:00
|
|
|
ignore_errors: yes
|
2020-04-25 09:02:52 +02:00
|
|
|
|
|
|
|
- name: Remove snapd snap
|
|
|
|
snap: name=snapd state=absent
|
|
|
|
when: ansible_distribution_version is version('20.04', '==')
|
2020-05-19 15:05:58 +02:00
|
|
|
ignore_errors: yes
|
2020-04-25 09:02:52 +02:00
|
|
|
|
|
|
|
- name: Set fact for packages to remove (Ubuntu <= 18.04)
|
2018-12-20 08:31:58 +01:00
|
|
|
set_fact:
|
|
|
|
ubuntu_annoying_packages:
|
2018-12-20 08:54:46 +01:00
|
|
|
- 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 # annoying (Ubuntu >= 16.04)
|
|
|
|
- lxd-client # annoying (Ubuntu >= 16.04)
|
|
|
|
- liblxc1 # annoying (Ubuntu >= 16.04)
|
|
|
|
- lxc-common # annoying (Ubuntu >= 16.04)
|
|
|
|
- lxcfs #annoying (Ubuntu >= 16.04)
|
2020-04-25 09:02:52 +02:00
|
|
|
when: ansible_distribution_version is version('18.04', '<=')
|
|
|
|
|
|
|
|
- name: Set fact for packages to remove (Ubuntu 20.04)
|
|
|
|
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', '==')
|
2018-12-20 08:54:46 +01:00
|
|
|
|
|
|
|
- name: Remove packages
|
|
|
|
apt: name={{ ubuntu_annoying_packages }} state=absent purge=yes
|
2014-08-16 23:35:57 +02:00
|
|
|
|
2018-12-20 09:27:52 +01:00
|
|
|
- name: Disable annoying Canonical spam in MOTD
|
2020-04-24 21:37:50 +02:00
|
|
|
file: path={{ item }} mode=0644 state=absent
|
2018-12-20 09:27:52 +01:00
|
|
|
loop:
|
|
|
|
- /etc/update-motd.d/99-esm # Ubuntu 14.04
|
2018-12-20 09:31:18 +01:00
|
|
|
- /etc/update-motd.d/10-help-text # Ubuntu 14.04+
|
2018-12-20 09:27:52 +01:00
|
|
|
- /etc/update-motd.d/50-motd-news # Ubuntu 18.04+
|
|
|
|
- /etc/update-motd.d/80-esm # Ubuntu 18.04+
|
|
|
|
- /etc/update-motd.d/80-livepatch # Ubuntu 18.04+
|
|
|
|
ignore_errors: yes
|
|
|
|
|
2018-04-26 15:58:35 +02:00
|
|
|
- name: Configure cron-apt
|
|
|
|
import_tasks: cron-apt.yml
|
|
|
|
tags: cron-apt
|
2015-05-24 22:55:04 +02:00
|
|
|
|
2018-04-26 15:58:35 +02:00
|
|
|
- name: Install tarsnap
|
|
|
|
import_tasks: tarsnap.yml
|
2018-04-25 17:46:28 +02:00
|
|
|
tags: packages
|
2017-02-07 16:28:35 +01:00
|
|
|
|
2015-05-24 22:55:04 +02:00
|
|
|
# vim: set sw=2 ts=2:
|