From e6f39789ed0728e61e1f7d52148397f0700b1013 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 26 May 2024 22:30:19 +0200 Subject: apt-cacher-ng: use nginx for publishing --- roles/apt-cacher-ng/defaults/main.yml | 2 ++ roles/apt-cacher-ng/tasks/main.yml | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'roles') diff --git a/roles/apt-cacher-ng/defaults/main.yml b/roles/apt-cacher-ng/defaults/main.yml index eb50d456..e172d7da 100644 --- a/roles/apt-cacher-ng/defaults/main.yml +++ b/roles/apt-cacher-ng/defaults/main.yml @@ -2,6 +2,8 @@ # apt_cacher_ng_storage: # type: ... +# apt_cacher_ng_hostname: apt.example.com + # apt_cacher_ng_remaps: # debrep: # path: /debian diff --git a/roles/apt-cacher-ng/tasks/main.yml b/roles/apt-cacher-ng/tasks/main.yml index eb1620cc..df47ee9e 100644 --- a/roles/apt-cacher-ng/tasks/main.yml +++ b/roles/apt-cacher-ng/tasks/main.yml @@ -56,8 +56,10 @@ copy: content: | # ansible managed - ForceManaged: 1 + BindAddress: 127.0.0.1 + + ForceManaged: 1 {% for name, config in apt_cacher_ng_remaps.items() %} Remap-{{ name }}: {{ config.path }} ; file:backends_{{ name }} {% endfor %} @@ -82,3 +84,17 @@ regexp: '#\s*AdminAuth:' line: "AdminAuth: {{ apt_cacher_ng_admin_auth.username }}:{{ apt_cacher_ng_admin_auth.password }}" notify: restart apt-cacher-ng + +- name: configure nginx vhost + vars: + nginx_vhost: + default: yes + name: apt-cacher-ng + template: generic + hostnames: + - "{{ apt_cacher_ng_hostname }}" + locations: + '/': + proxy_pass: http://127.0.0.1:3142 + include_role: + name: nginx/vhost -- cgit v1.2.3