From 9f1e8be5ef3d6cf6fcc6b4fa23fc43033ee8a2fe Mon Sep 17 00:00:00 2001 From: unman Date: Tue, 21 Feb 2023 12:57:17 +0000 Subject: [PATCH] Use caching pillar as condition for repo change --- builder/install.sls | 2 +- gpg/install.sls | 3 ++- i2p/install.sls | 2 +- ids/install.sls | 3 +-- multimedia/install.sls | 2 +- mutt/install.sls | 2 +- print/install.sls | 2 +- pyenv/install.sls | 2 +- reader/install.sls | 2 +- share/install.sls | 2 +- syncthing/install.sls | 3 ++- 11 files changed, 13 insertions(+), 12 deletions(-) diff --git a/builder/install.sls b/builder/install.sls index d8363e6..3e192e9 100644 --- a/builder/install.sls +++ b/builder/install.sls @@ -1,6 +1,6 @@ # vim: set syntax=yaml ts=2 sw=2 sts=2 et : -{% if salt['qvm.exists']('cacher') %} +{% if salt['pillar.get']('update_proxy:caching') %} {% for repo in salt['file.find']('/etc/yum.repos.d/', name='*repo*') %} {{ repo }}_baseurl: diff --git a/gpg/install.sls b/gpg/install.sls index f7fc07e..26211ff 100644 --- a/gpg/install.sls +++ b/gpg/install.sls @@ -1,6 +1,7 @@ # vim: set syntax=yaml ts=2 sw=2 sts=2 et : -{% if salt['qvm.exists']('cacher') %} + +{% if salt['pillar.get']('update_proxy:caching') %} /etc/apt/sources.list: file.replace: diff --git a/i2p/install.sls b/i2p/install.sls index 14e490e..4dbe2db 100644 --- a/i2p/install.sls +++ b/i2p/install.sls @@ -23,7 +23,7 @@ - mode: 644 - makedirs: True -{% if salt['qvm.exists']('cacher') %} +{% if salt['pillar.get']('update_proxy:caching') %} {% if grains['os_family']|lower == 'debian' %} {% if grains['nodename']|lower != 'host' %} {% for repo in salt['file.find']('/etc/apt/sources.list.d/', name='*list') %} diff --git a/ids/install.sls b/ids/install.sls index aa70b34..732c722 100644 --- a/ids/install.sls +++ b/ids/install.sls @@ -5,8 +5,7 @@ {% if grains['nodename'] != 'dom0' %} - -{% if salt['qvm.exists']('cacher') %} +{% if salt['pillar.get']('update_proxy:caching') %} /etc/apt/sources.list: file.replace: diff --git a/multimedia/install.sls b/multimedia/install.sls index a10a5ed..c941d92 100644 --- a/multimedia/install.sls +++ b/multimedia/install.sls @@ -2,7 +2,7 @@ # # -{% if salt['qvm.exists']('cacher') %} +{% if salt['pillar.get']('update_proxy:caching') %} update_sources: file.replace: - names: diff --git a/mutt/install.sls b/mutt/install.sls index 7ade26a..33ba0a9 100644 --- a/mutt/install.sls +++ b/mutt/install.sls @@ -3,7 +3,7 @@ {% if grains['nodename'] != 'dom0' %} -{% if salt['qvm.exists']('cacher') %} +{% if salt['pillar.get']('update_proxy:caching') %} /etc/apt/sources.list: file.replace: diff --git a/print/install.sls b/print/install.sls index 7283a88..00e289b 100644 --- a/print/install.sls +++ b/print/install.sls @@ -1,7 +1,7 @@ # vim: set syntax=yaml ts=2 sw=2 sts=2 et : # -{% if salt['qvm.exists']('cacher') %} +{% if salt['pillar.get']('update_proxy:caching') %} /etc/apt/sources.list: file.replace: diff --git a/pyenv/install.sls b/pyenv/install.sls index 61a9250..35c9bdf 100644 --- a/pyenv/install.sls +++ b/pyenv/install.sls @@ -5,7 +5,7 @@ {% if grains['nodename'] != 'dom0' %} -{% if salt['qvm.exists']('cacher') %} +{% if salt['pillar.get']('update_proxy:caching') %} {% if grains['os_family']|lower == 'debian' %} {% if grains['nodename']|lower != 'host' %} {% for repo in salt['file.find']('/etc/apt/sources.list.d/', name='*list') %} diff --git a/reader/install.sls b/reader/install.sls index cfacbe1..14bb2cc 100644 --- a/reader/install.sls +++ b/reader/install.sls @@ -3,7 +3,7 @@ # # -{% if salt['qvm.exists']('cacher') %} +{% if salt['pillar.get']('update_proxy:caching') %} {% if grains['os_family']|lower == 'debian' %} {% if grains['nodename']|lower != 'host' %} {% for repo in salt['file.find']('/etc/apt/sources.list.d/', name='*list') %} diff --git a/share/install.sls b/share/install.sls index 1776000..eca172b 100644 --- a/share/install.sls +++ b/share/install.sls @@ -1,6 +1,6 @@ # vim: set syntax=yaml ts=2 sw=2 sts=2 et : -{% if salt['qvm.exists']('cacher') %} +{% if salt['pillar.get']('update_proxy:caching') %} /etc/apt/sources.list: file.replace: diff --git a/syncthing/install.sls b/syncthing/install.sls index cb00a99..55cc0e8 100644 --- a/syncthing/install.sls +++ b/syncthing/install.sls @@ -20,7 +20,8 @@ - group: root - makedirs: True -{% if salt['qvm.exists']('cacher') %} + +{% if salt['pillar.get']('update_proxy:caching') %} {% for repo in salt['file.find']('/etc/apt/sources.list.d/', name='*list') %} {{ repo }}_baseurl: