diff --git a/salt/sys-cacher/install-client.sls b/salt/sys-cacher/install-client.sls index f7dadb6..b1abe91 100644 --- a/salt/sys-cacher/install-client.sls +++ b/salt/sys-cacher/install-client.sls @@ -7,17 +7,16 @@ SPDX-License-Identifier: AGPL-3.0-or-later {% if grains['os_family']|lower == 'debian' -%} {% if not salt['file.file_exists']('/usr/share/whonix/marker') -%} {% for repo in salt['file.find']('/etc/apt/sources.list.d/', name='*(list|sources)') -%} - {{ repo }}_baseurl: - file.replace: - - name: {{ repo }} - - pattern: 'https://' - - repl: 'http://HTTPS///' - - flags: [ 'IGNORECASE', 'MULTILINE' ] - - backup: False - + "{{ repo }}_baseurl": + file.replace: + - name: {{ repo }} + - pattern: 'https://' + - repl: 'http://HTTPS///' + - flags: [ 'IGNORECASE', 'MULTILINE' ] + - backup: False {% endfor -%} - /etc/apt/sources.list: + "/etc/apt/sources.list": file.replace: - name: /etc/apt/sources.list - pattern: 'https:' @@ -27,7 +26,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later {% endif -%} {% elif grains['os_family']|lower == 'arch' -%} - pacman: + "pacman": file.replace: - names: - /etc/pacman.d/mirrorlist @@ -39,34 +38,36 @@ SPDX-License-Identifier: AGPL-3.0-or-later {% elif grains['os_family']|lower == 'redhat' -%} {% for repo in salt['file.find']('/etc/yum.repos.d/', name='*repo') -%} - {{ repo }}_baseurl: - file.replace: - - name: {{ repo }} - - pattern: 'baseurl(.*)https://' - - repl: 'baseurl\1http://HTTPS///' - - flags: [ 'IGNORECASE', 'MULTILINE' ] - - backup: False - {{ repo }}_metalink: - file.replace: - - name: {{ repo }} - - pattern: 'metalink=https://(.*)' - - repl: 'metalink=http://HTTPS///\1' - - flags: [ 'IGNORECASE', 'MULTILINE' ] - - backup: False +"{{ repo }}_baseurl": + file.replace: + - name: {{ repo }} + - pattern: 'baseurl(.*)https://' + - repl: 'baseurl\1http://HTTPS///' + - flags: [ 'IGNORECASE', 'MULTILINE' ] + - backup: False +"{{ repo }}_metalink": + file.replace: + - name: {{ repo }} + - pattern: 'metalink=https://(.*)' + - repl: 'metalink=http://HTTPS///\1' + - flags: [ 'IGNORECASE', 'MULTILINE' ] + - backup: False {% endfor -%} + {% for repo in salt['file.find']('/etc/yum.repos.d/', name='rpmfusion*repo*') -%} - {{ repo }}_uncomment: - file.uncomment: - - name: {{ repo }} - - regex : '.*baseurl(.*)' - - backup: False - {{ repo }}_comment: - file.comment: - - name: {{ repo }} - - regex: '^metalink=http(.*)' - - ignore_missing: True - - backup: False +"{{ repo }}_uncomment": + file.uncomment: + - name: {{ repo }} + - regex: '.*baseurl(.*)' + - backup: False + +"{{ repo }}_comment": + file.comment: + - name: {{ repo }} + - regex: '^metalink=http(.*)' + - ignore_missing: True + - backup: False {% endfor -%} {% endif -%} diff --git a/salt/sys-cacher/uninstall-client.sls b/salt/sys-cacher/uninstall-client.sls index 0ea8d52..6cf5a01 100644 --- a/salt/sys-cacher/uninstall-client.sls +++ b/salt/sys-cacher/uninstall-client.sls @@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later {% if grains['os_family']|lower == 'debian' -%} {% for repo in salt['file.find']('/etc/apt/sources.list.d/', name='*(list|sources)') -%} - {{ repo }}_baseurl: + "{{ repo }}_baseurl": file.replace: - name: {{ repo }} - pattern: 'http://HTTPS/' @@ -15,7 +15,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later - backup: False {% endfor -%} - /etc/apt/sources.list: + "/etc/apt/sources.list": file.replace: - name: /etc/apt/sources.list - pattern: 'http://HTTPS/' @@ -24,7 +24,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later - backup: False {% elif grains['os_family']|lower == 'arch' -%} - pacman: + "pacman": file.replace: - names: - /etc/pacman.d/mirrorlist @@ -37,21 +37,21 @@ SPDX-License-Identifier: AGPL-3.0-or-later {% elif grains['os_family']|lower == 'redhat' -%} {% for repo in salt['file.find']('/etc/yum.repos.d/', name='*repo*') -%} -{{ repo }}_baseurl: - file.replace: - - name: {{ repo }} - - pattern: 'baseurl(.*)http://HTTPS/' - - repl: 'baseurl\1https:' - - flags: [ 'IGNORECASE', 'MULTILINE' ] - - backup: False +"{{ repo }}_baseurl": + file.replace: + - name: {{ repo }} + - pattern: 'baseurl(.*)http://HTTPS/' + - repl: 'baseurl\1https:' + - flags: [ 'IGNORECASE', 'MULTILINE' ] + - backup: False -{{ repo }}_metalink: - file.replace: - - name: {{ repo }} - - pattern: 'metalink=http://HTTPS///(.*)' - - repl: 'metalink=https://\1' - - flags: [ 'IGNORECASE', 'MULTILINE' ] - - backup: False +"{{ repo }}_metalink": + file.replace: + - name: {{ repo }} + - pattern: 'metalink=http://HTTPS///(.*)' + - repl: 'metalink=https://\1' + - flags: [ 'IGNORECASE', 'MULTILINE' ] + - backup: False {% endfor -%} {% endif -%}