optimize APT usage

This commit is contained in:
Pim Kunis 2022-12-20 17:02:09 +01:00
parent 73105db948
commit bc8c4eac8a
4 changed files with 22 additions and 4 deletions

View file

@ -21,3 +21,11 @@ Should probably start creating a seperate cert for each subdomain.
### Git server
GitLab? Gitea?
### Firewall
Seems to be a little annoying with all the docker stuff
### Mastodon
Fix cache filling up so much space: cronjob to remove them?

View file

@ -1,3 +1,10 @@
- name: APT upgrade
apt:
autoremove: true
upgrade: yes
state: latest
update_cache: yes
cache_valid_time: 86400 # One day
- name: Create /data directory
file:
path: /data

View file

@ -6,14 +6,17 @@
- gnupg
- lsb-release
- python3-pip
state: latest
update_cache: true
- name: Add Docker APT key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
- name: Add Docker repository
apt_repository:
repo: "deb https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable"
register: apt_repository
- name: Update APT cache
apt:
update_cache: true
when: apt_repository.changed
- name: Install Docker packages
apt:
pkg:
@ -21,8 +24,6 @@
- docker-ce-cli
- containerd.io
- docker-compose-plugin
state: latest
update_cache: true
- name: Install Docker modules for Python
pip:
name:

2
roles/ssh/meta/main.yml Normal file
View file

@ -0,0 +1,2 @@
dependencies:
- role: common