add cron script to clean the cache every day

networking
histausse 3 years ago
parent 0d7536ed19
commit 73c3a16029
Signed by: histausse
GPG Key ID: 67486F107F62E9E9

@ -18,7 +18,7 @@
mode: '644'
notify: Restart apt-cacher-ng
- name: Create config files
- name: Set admin auth
template:
src: "security.conf.j2"
dest: "/etc/apt-cacher-ng/security.conf"
@ -28,6 +28,15 @@
notify: Restart apt-cacher-ng
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
lineinfile:
path: /etc/hosts.allow

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

@ -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 }}
Loading…
Cancel
Save