Salt - caching proxy - general tidy up

This commit is contained in:
unman 2022-05-15 14:36:33 +00:00
parent d45858fb64
commit 655d37e127
No known key found for this signature in database
GPG Key ID: FDD1B8244731B36C
6 changed files with 25 additions and 8 deletions

View File

@ -6,13 +6,13 @@ Config files are included, which will work out of the box for Debian,Ubuntu and
The cache and log directories are bind-mounted in /rw in the cacher qube.
Copy directory to /srv/salt, then run:
qubesctl state.apply cacher.create.
qubesctl state.apply cacher.create
qubesctl --skip-dom0 --targets=template-cacher state.apply cacher.install
qubesctl --skip-dom0 --targets=cacher state.apply cacher.configure
To automatically use the proxy run:
qubesctl state.apply cacher.use
This will configure /etc/qubes-rpc/policy/qubes.UpdatesProxy to use the cachingproxy be default.
This will configure /etc/qubes/policy.d/30-user.policy to use the caching proxy be default.
apt-cacher-ng will cache HTTPS requests if you change https:// to http://HTTPS/// in repo source lists.
To configure the templates to use the proxy in this way, run:

View File

@ -60,12 +60,12 @@ Port:8082
# installation using information collected on the system.
# Examples:
#Remap-debrep: https://deb.debian.org http://deb.debian.org file:deb_mirrors.gz /debian ; file:backends_debian # Debian Archives
Remap-alxrep: file:archlx_mirrors /archlinux # ; file:backend_archlx # Arch Linux
Remap-debrep: https://deb.debian.org http://deb.debian.org file:deb_mirrors.gz /debian
Remap-fedora: file:fedora_mirrors # Fedora Linux
Remap-uburep: file:ubuntu_mirrors /ubuntu ; file:backends_ubuntu # Ubuntu Archives
Remap-cygwin: file:cygwin_mirrors /cygwin # ; file:backends_cygwin # incomplete, please create this file or specify preferred mirrors here
#Remap-sfnet: file:sfnet_mirrors # ; file:backends_sfnet # incomplete, please create this file or specify preferred mirrors here
Remap-alxrep: file:archlx_mirrors /archlinux # ; file:backend_archlx # Arch Linux
Remap-fedora: file:fedora_mirrors # Fedora Linux
Remap-epel: file:epel_mirrors # Fedora EPEL
Remap-slrep: file:sl_mirrors # Scientific Linux
Remap-gentoo: file:gentoo_mirrors.gz /gentoo ; file:backends_gentoo # Gentoo Archives
@ -93,6 +93,7 @@ ReportPage: acng-report.html
# it's a convenience alias for the Debug option, see below for details.
#
# UnbufferLogs: 0
UnbufferLogs: 1
# Enables extended client information in log entries. When set to 0, only
# activity type, time and transfer sizes are logged.
@ -217,9 +218,9 @@ ExThreshold: 4
#
# To see examples of the expected syntax, run: apt-cacher-ng -p debug=1
#
PfilePatternEx: .*xml.zck$|.*yaml.gz$|.*fedora.*arch=x86_64$|.*f30&arch=x86_64|.*29&arch=x86_64
PfilePatternEx: .*xml.zck$|.*yaml.gz$|.*fedora.*arch=x86_64$|.*f35&arch=x86_64|.*f36&arch=x86_64
# VfilePatternEx:
VfilePatternEx: ^/\?release=[0-9]+&arch=.*|.*/RPM-GPG-KEY.*|.*\?repo=fedora
VfilePatternEx: ^/\?release=[0-9]+&arch=.*|.*/RPM-GPG-KEY.*|.*\?repo=fedora|.*pkg.tar.zst.sig
# SPfilePatternEx:
# SVfilePatternEx:
# WfilePatternEx:

View File

@ -1,5 +1,7 @@
# vim: set syntax=yaml ts=2 sw=2 sts=2 et :
{% if grains['nodename'] != 'dom0' %}
/rw/config/rc.local:
file.append:
- text: |
@ -18,3 +20,5 @@
- user: root
- group: root
- makedirs: True
{% endif %}

View File

@ -2,4 +2,4 @@
base:
cacher:
- cacher.install
- cacher.configure

View File

@ -2,6 +2,9 @@
#
#
#
{% if grains['nodename'] != 'dom0' %}
allow-testing:
file.uncomment:
- name: /etc/apt/sources.list.d/qubes-r4.list
@ -44,3 +47,12 @@ cp /lib/apt-cacher-ng/deb_mirrors.gz /etc/apt-cacher-ng/deb_mirrors.gz:
- salt://cacher/fedora_mirrors
- user: root
- group: root
/etc/apt-cacher-ng/archlx_mirrors:
file.managed:
- source:
- salt://cacher/archlx_mirrors
- user: root
- group: root
{% endif %}

View File

@ -6,4 +6,4 @@ qvm-present-id:
/etc/qubes/policy.d/30-user.policy:
file.prepend:
- text: "qubes.UpdatesProxy * @type:TemplateVM @default allow,target=cacher"
- text: "qubes.UpdatesProxy * @type:TemplateVM @default allow target=cacher"