2023-11-13 09:33:28 -05:00
|
|
|
{#
|
|
|
|
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
|
|
|
|
|
|
|
|
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)') -%}
|
2023-12-20 10:47:35 -05:00
|
|
|
"{{ repo }}_baseurl":
|
2023-11-13 09:33:28 -05:00
|
|
|
file.replace:
|
|
|
|
- name: {{ repo }}
|
|
|
|
- pattern: 'http://HTTPS/'
|
|
|
|
- repl: 'https:'
|
|
|
|
- flags: [ 'IGNORECASE', 'MULTILINE' ]
|
|
|
|
- backup: False
|
|
|
|
{% endfor -%}
|
|
|
|
|
2023-12-20 10:47:35 -05:00
|
|
|
"/etc/apt/sources.list":
|
2023-11-13 09:33:28 -05:00
|
|
|
file.replace:
|
|
|
|
- name: /etc/apt/sources.list
|
|
|
|
- pattern: 'http://HTTPS/'
|
|
|
|
- repl: 'https:'
|
|
|
|
- flags: [ 'IGNORECASE', 'MULTILINE' ]
|
|
|
|
- backup: False
|
|
|
|
|
|
|
|
{% elif grains['os_family']|lower == 'arch' -%}
|
2023-12-20 10:47:35 -05:00
|
|
|
"pacman":
|
2023-11-13 09:33:28 -05:00
|
|
|
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' ]
|
|
|
|
- backup: False
|
|
|
|
|
|
|
|
|
|
|
|
{% elif grains['os_family']|lower == 'redhat' -%}
|
|
|
|
{% for repo in salt['file.find']('/etc/yum.repos.d/', name='*repo*') -%}
|
2023-12-20 10:47:35 -05:00
|
|
|
"{{ 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
|
2023-11-13 09:33:28 -05:00
|
|
|
|
|
|
|
{% endfor -%}
|
|
|
|
{% endif -%}
|