Salt - caching proxy - allow updated package to update mirrors list and config file

This commit is contained in:
NAME 2022-11-22 15:52:18 +00:00
parent e0f4b40397
commit 4464f2aa4a
No known key found for this signature in database
GPG Key ID: FDD1B8244731B36C
4 changed files with 58 additions and 2 deletions

View File

@ -1,5 +1,5 @@
Name: 3isec-qubes-cacher
Version: 1.8
Version: 1.9
Release: 1%{?dist}
Summary: A caching proxy in Qubes
@ -75,6 +75,8 @@ if [ $1 -eq 1 ]; then
qubesctl --skip-dom0 --targets=cacher state.apply cacher.configure
qubesctl state.apply cacher.use
qubesctl --skip-dom0 --templates state.apply cacher.change_templates
elif [ $1 -eq 2 ]; then
qubesctl --skip-dom0 --targets=template-cacher state.apply cacher.update
fi
%preun
@ -88,6 +90,10 @@ if [ $1 -eq 0 ]; then
fi
%changelog
* Mon Nov 21 2022 unman <unman@thirdeyesecurity.org> - 1.9NEWNEW
- Change packaging so that upgrade will update mirror lists and config
- Update fedora mirror list
- Include anacron
* Mon Aug 22 2022 unman <unman@thirdeyesecurity.org> - 1.8
- Stop rewriting for Whonix templates
* Sun Aug 21 2022 unman <unman@thirdeyesecurity.org> - 1.7

16
cacher/config.sls Normal file
View File

@ -0,0 +1,16 @@
# vim: set syntax=yaml ts=2 sw=2 sts=2 et :
#
#
#
{% if grains['nodename'] != 'dom0' %}
/etc/apt-cacher-ng/acng.conf:
file.managed:
- source:
- salt://cacher/acng.conf
- user: root
- group: root
- makedirs: True
{% endif %}

22
cacher/mirrors.sls Normal file
View File

@ -0,0 +1,22 @@
# vim: set syntax=yaml ts=2 sw=2 sts=2 et :
#
#
#
{% if grains['nodename'] != 'dom0' %}
/etc/apt-cacher-ng/fedora_mirrors:
file.managed:
- source:
- 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 %}

12
cacher/update.sls Normal file
View File

@ -0,0 +1,12 @@
# vim: set syntax=yaml ts=2 sw=2 sts=2 et :
#
#
#
{% if grains['nodename'] != 'dom0' %}
include:
- cacher.mirrors
- cacher.config
{% endif %}