From e188839f7b7603f0c12201a31d0a1cdae6c8669f Mon Sep 17 00:00:00 2001 From: unman Date: Sun, 15 May 2022 14:48:23 +0000 Subject: [PATCH] Salt - caching proxy - Restore repo definitions on package removal --- cacher/restore_templates.sls | 42 ++++++++++++++++++++++++++++++++++++ cacher/restore_templates.top | 4 ++++ 2 files changed, 46 insertions(+) create mode 100644 cacher/restore_templates.sls create mode 100644 cacher/restore_templates.top diff --git a/cacher/restore_templates.sls b/cacher/restore_templates.sls new file mode 100644 index 0000000..e010875 --- /dev/null +++ b/cacher/restore_templates.sls @@ -0,0 +1,42 @@ +# vim: set syntax=yaml ts=2 sw=2 sts=2 et : +# +# +# +{% if grains['os_family']|lower == 'debian' %} + /etc/apt/sources.list: + file.replace: + - names: + - /etc/apt/sources.list + - /etc/apt/sources.list.d/qubes-r4.list + - pattern: 'http://HTTPS/' + - repl: 'https:' + - flags: [ 'IGNORECASE', 'MULTILINE' ] + +{% elif grains['os_family']|lower == 'arch' %} + pacman: + file.replace: + - names: + - /etc/pacman.d/mirrorlist + - /etc/pacman.d/99-qubes-repository-4.1.conf.disabled + - pattern: 'http://HTTPS/' + - repl: 'https:' + - flags: [ 'IGNORECASE', 'MULTILINE' ] + +{% elif grains['os_family']|lower == 'redhat' %} + /etc/yum.repos.d/: + file.replace: + - names: + - /etc/yum.repos.d/fedora.repo + - /etc/yum.repos.d/fedora-updates.repo + - /etc/yum.repos.d/fedora-updates-testing.repo + - /etc/yum.repos.d/fedora-cisco-openh264.repo + - pattern: 'metalink=http://HTTPS///(.*)basearch&protocol=http' + - repl: 'metalink=https://\1basearch' + - flags: [ 'IGNORECASE', 'MULTILINE' ] + /etc/yum.repos.d/qubes-r4.repo: + file.replace: + - pattern: 'http://HTTPS/' + - repl: 'https:' + - flags: [ 'IGNORECASE', 'MULTILINE' ] + +{% endif %} diff --git a/cacher/restore_templates.top b/cacher/restore_templates.top new file mode 100644 index 0000000..8fbc22a --- /dev/null +++ b/cacher/restore_templates.top @@ -0,0 +1,4 @@ +base: + qubes:type:template: + - match: pillar + - cacher.restore_templates