add cron script to clean the cache every day

This commit is contained in:
histausse 2021-06-29 01:59:26 +02:00
parent 0d7536ed19
commit 73c3a16029
Signed by: histausse
GPG key ID: 67486F107F62E9E9
3 changed files with 15 additions and 13 deletions

View file

@ -18,7 +18,7 @@
mode: '644' mode: '644'
notify: Restart apt-cacher-ng notify: Restart apt-cacher-ng
- name: Create config files - name: Set admin auth
template: template:
src: "security.conf.j2" src: "security.conf.j2"
dest: "/etc/apt-cacher-ng/security.conf" dest: "/etc/apt-cacher-ng/security.conf"
@ -28,6 +28,15 @@
notify: Restart apt-cacher-ng notify: Restart apt-cacher-ng
no_log: true no_log: true
# This is uggly, and overkill
- name: Set cron job to clear the cache
template:
src: "clear-apt-cache_cron.j2"
dest: "/etc/cron.daily/clear-apt-cache"
owner: root
group: root
mode: '755'
- name: Edit the clients allowed to use the proxy - name: Edit the clients allowed to use the proxy
lineinfile: lineinfile:
path: /etc/hosts.allow path: /etc/hosts.allow

View file

@ -0,0 +1,5 @@
{{ ansible_managed | comment }}
systemctl stop apt-cacher-ng
rm -rf /var/chache/apt-cacher-ng/
systemctl start apt-cacher-ng

View file

@ -1,12 +0,0 @@
{{ ansible_managed | comment }}
# This file contains confidential data and should be protected with file
# permissions from being read by untrusted users.
#
# NOTE: permissions are fixated with dpkg-statoverride on Debian systems.
# Read its manual page for details.
# Basic authentication with username and password, required to
# visit pages with administrative functionality. Format: username:password
AdminAuth: {{ apt_proxy_admin_user }}:{{ apt_proxy_admin_mdp }}