From 4464f2aa4a6300ed44ddb8375429b713252f2549 Mon Sep 17 00:00:00 2001 From: NAME Date: Tue, 22 Nov 2022 15:52:18 +0000 Subject: [PATCH] Salt - caching proxy - allow updated package to update mirrors list and config file --- cacher.spec | 10 ++++++++-- cacher/config.sls | 16 ++++++++++++++++ cacher/mirrors.sls | 22 ++++++++++++++++++++++ cacher/update.sls | 12 ++++++++++++ 4 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 cacher/config.sls create mode 100644 cacher/mirrors.sls create mode 100644 cacher/update.sls diff --git a/cacher.spec b/cacher.spec index 79857c0..12770fd 100644 --- a/cacher.spec +++ b/cacher.spec @@ -1,10 +1,10 @@ Name: 3isec-qubes-cacher -Version: 1.8 +Version: 1.9 Release: 1%{?dist} Summary: A caching proxy in Qubes License: GPLv3+ -SOURCE0: cacher +SOURCE0: cacher %description This package provides a caching proxy, named cacher. @@ -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 - 1.9NEWNEW +- Change packaging so that upgrade will update mirror lists and config +- Update fedora mirror list +- Include anacron * Mon Aug 22 2022 unman - 1.8 - Stop rewriting for Whonix templates * Sun Aug 21 2022 unman - 1.7 diff --git a/cacher/config.sls b/cacher/config.sls new file mode 100644 index 0000000..2fc431f --- /dev/null +++ b/cacher/config.sls @@ -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 %} diff --git a/cacher/mirrors.sls b/cacher/mirrors.sls new file mode 100644 index 0000000..6db2dce --- /dev/null +++ b/cacher/mirrors.sls @@ -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 %} diff --git a/cacher/update.sls b/cacher/update.sls new file mode 100644 index 0000000..bb29da5 --- /dev/null +++ b/cacher/update.sls @@ -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 %}