add cron script to clean the cache every day
This commit is contained in:
parent
0d7536ed19
commit
73c3a16029
3 changed files with 15 additions and 13 deletions
|
@ -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
|
||||
|
|
5
roles/apt_cacher_ng/templates/clear-apt-cache_cron.j2
Normal file
5
roles/apt_cacher_ng/templates/clear-apt-cache_cron.j2
Normal 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
|
|
@ -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…
Reference in a new issue