Add apt-cacher-ng to reduce network load

This commit is contained in:
2026-04-29 13:12:30 +01:00
parent 97d7a2783d
commit 8faba369e0
4 changed files with 114 additions and 2 deletions
+21 -1
View File
@@ -2,7 +2,7 @@
# install roles and collections
ansible-galaxy install -r requirements.yml
# Install the playbook
# Install the frontend
ansible-playbook -i inventory.yaml -e @secrets.enc --ask-vault-pass frontend.yaml
# Github runner
@@ -13,4 +13,24 @@ ansible-playbook -i inventory.yaml -e @secrets.enc --ask-vault-pass gitea.yaml
# graphana + prometheus
ansible-playbook -i inventory.yaml -e @secrets.enc --ask-vault-pass monitor.yaml
# apt-cacheer-ng
ansible-playbook -i inventory.yaml --ask-become-pass apt-cacher-ng.yaml
```
To make use of the apt cache, ensure you have a file like this with CACHE_HOST changes to your actual host
```bash
echo << EOF >> /etc/apt/apt.conf.d/01proxy
Acquire::HTTP::Proxy "http://<CACHE_HOST>:3142";
Acquire::HTTPS::Proxy "false";
EOF
```
or add these to a Dockerfile
```
RUN echo 'Acquire::HTTP::Proxy "http://<CACHE_HOST>:3142";' >> /etc/apt/apt.conf.d/01proxy \
&& echo 'Acquire::HTTPS::Proxy "false";' >> /etc/apt/apt.conf.d/01proxy
```