From 8742ab30bb951cb28b3b527693aab9f6439b76f6 Mon Sep 17 00:00:00 2001 From: Mark Ferrell Date: Tue, 2 Mar 2021 08:57:59 -0800 Subject: [PATCH 1/2] feat: allow selecting alternate salt package repositories Make the upstream salt package repository selectable, thus allowing the use of archived salt versions (hosted in https://archive.repo.saltproject.io), as well as custom salt versions hosted in alternate repositories. --- pillar.example | 4 ++++ salt/osfamilymap.yaml | 9 +++++---- salt/osmap.yaml | 13 +++++++------ 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/pillar.example b/pillar.example index 91d5d8a..5860152 100644 --- a/pillar.example +++ b/pillar.example @@ -37,6 +37,10 @@ salt: salt_ssh: 'salt-ssh' pyinotify: 'python-pyinotify' # the package to be installed for pyinotify + # Set which salt repository to use, default to https://repo.saltstack.com + # For older releases use https://archive.repo.saltproject.io + repo: 'https://archive.repo.saltproject.io' + # Set which release of SaltStack to use, default to 'latest' # To get the available releases: # * http://repo.saltstack.com/yum/redhat/7/x86_64/ diff --git a/salt/osfamilymap.yaml b/salt/osfamilymap.yaml index 9400075..7f31b24 100644 --- a/salt/osfamilymap.yaml +++ b/salt/osfamilymap.yaml @@ -13,6 +13,7 @@ {%- set osmajorrelease = salt['grains.get']('osmajorrelease', osrelease)|string %} {%- set oscodename = salt['grains.get']('oscodename') %} {%- set opensuse_repo_suffix = 'Leap_' ~ osrelease if salt['grains.get']('osfinger', '') == 'Leap-15' else 'Tumbleweed' %} +{%- set salt_repo = salt['pillar.get']('salt:repo', 'https://repo.saltstack.com') %} #from template-formula {%- if grains.os_family == 'MacOS' %} @@ -24,8 +25,8 @@ Debian: - pkgrepo: 'deb http://repo.saltstack.com/{{ py_ver_repr or 'apt' }}/{{ osfamily_lower }}/{{ osmajorrelease }}/amd64/{{ salt_release }} {{ oscodename }} main' - key_url: 'https://repo.saltstack.com/{{ py_ver_repr or 'apt' }}/{{ osfamily_lower }}/{{ osmajorrelease }}/amd64/{{ salt_release }}/SALTSTACK-GPG-KEY.pub' + pkgrepo: 'deb {{ salt_repo }}/{{ py_ver_repr or 'apt' }}/{{ osfamily_lower }}/{{ osmajorrelease }}/amd64/{{ salt_release }} {{ oscodename }} main' + key_url: '{{ salt_repo }}/{{ py_ver_repr or 'apt' }}/{{ osfamily_lower }}/{{ osmajorrelease }}/amd64/{{ salt_release }}/SALTSTACK-GPG-KEY.pub' libgit2: libgit2-22 pyinotify: python-pyinotify gitfs: @@ -41,8 +42,8 @@ Debian: RedHat: pkgrepo_name: saltstack pkgrepo_humanname: SaltStack repo for RHEL/CentOS $releasever - pkgrepo: 'https://repo.saltstack.com/{{ py_ver_repr or 'yum' }}/redhat/$releasever/$basearch/{{ salt_release }}' - key_url: 'https://repo.saltstack.com/{{ py_ver_repr or 'yum' }}/redhat/$releasever/$basearch/{{ salt_release }}/SALTSTACK-GPG-KEY.pub' + pkgrepo: '{{ salt_repo }}/{{ py_ver_repr or 'yum' }}/redhat/$releasever/$basearch/{{ salt_release }}' + key_url: '{{ salt_repo }}/{{ py_ver_repr or 'yum' }}/redhat/$releasever/$basearch/{{ salt_release }}/SALTSTACK-GPG-KEY.pub' pygit2: python-pygit2 python_git: GitPython gitfs: diff --git a/salt/osmap.yaml b/salt/osmap.yaml index bd8ba2c..3eb0b5a 100644 --- a/salt/osmap.yaml +++ b/salt/osmap.yaml @@ -13,6 +13,7 @@ {% set osmajorrelease = salt['grains.get']('osmajorrelease', osrelease)|string %} {% set oscodename = salt['grains.get']('oscodename') %} {% set os_family_lower = salt['grains.get']('os_family')|lower %} +{% set salt_repo = salt['pillar.get']('salt:repo', 'https://repo.saltstack.com') %} Fedora: pygit2: python2-pygit2 @@ -20,12 +21,12 @@ Fedora: Amazon: pkgrepo_name: saltstack-amzn-repo pkgrepo_humanname: SaltStack repo for Amazon Linux 2 - pkgrepo: 'https://repo.saltstack.com/{{ py_ver_dir or 'yum' }}/amazon/2/$basearch/{{ salt_release }}' - key_url: 'https://repo.saltstack.com/{{ py_ver_dir or 'yum' }}/amazon/2/$basearch/{{ salt_release }}/SALTSTACK-GPG-KEY.pub' + pkgrepo: '{{ salt_repo }}/{{ py_ver_dir or 'yum' }}/amazon/2/$basearch/{{ salt_release }}' + key_url: '{{ salt_repo }}/{{ py_ver_dir or 'yum' }}/amazon/2/$basearch/{{ salt_release }}/SALTSTACK-GPG-KEY.pub' Ubuntu: - pkgrepo: 'deb http://repo.saltstack.com/{{ py_ver_dir or 'apt' }}/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }} {{ oscodename }} main' - key_url: 'https://repo.saltstack.com/{{ py_ver_dir or 'apt' }}/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }}/SALTSTACK-GPG-KEY.pub' + pkgrepo: 'deb {{ salt_repo }}/{{ py_ver_dir or 'apt' }}/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }} {{ oscodename }} main' + key_url: '{{ salt_repo }}/{{ py_ver_dir or 'apt' }}/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }}/SALTSTACK-GPG-KEY.pub' pygit2: python-pygit2 gitfs: pygit2: @@ -35,8 +36,8 @@ Ubuntu: install_from_package: Null Raspbian: - pkgrepo: 'deb http://repo.saltstack.com/{{ py_ver_dir or 'apt' }}/{{ os_family_lower }}/{{ osmajorrelease }}/armhf/{{ salt_release }} {{ oscodename }} main' - key_url: 'https://repo.saltstack.com/{{ py_ver_dir or 'apt' }}/{{ os_family_lower }}/{{ osmajorrelease }}/armhf/{{ salt_release }}/SALTSTACK-GPG-KEY.pub' + pkgrepo: 'deb {{ salt_repo }}/{{ py_ver_dir or 'apt' }}/{{ os_family_lower }}/{{ osmajorrelease }}/armhf/{{ salt_release }} {{ oscodename }} main' + key_url: '{{ salt_repo }}/{{ py_ver_dir or 'apt' }}/{{ os_family_lower }}/{{ osmajorrelease }}/armhf/{{ salt_release }}/SALTSTACK-GPG-KEY.pub' SmartOS: salt_master: salt From e94a8c9dcec9c1643d655859de58eebb5d1eab81 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Wed, 3 Mar 2021 21:06:35 +0000 Subject: [PATCH 2/2] test(debian+ubuntu): update `pkgrepo` to use `https` instead of `http` ``` $ GREP_SED="\(pkgrepo: deb http\):" \ && grep -rl "${GREP_SED}" test/integration/v* \ | xargs sed -i -e "/${GREP_SED}/s//\1s:/" ``` --- test/integration/v3000-py2/files/_mapdata/ubuntu-16.yaml | 2 +- test/integration/v3000-py2/files/_mapdata/ubuntu-18.yaml | 2 +- test/integration/v3000-py3/files/_mapdata/debian-10.yaml | 2 +- test/integration/v3000-py3/files/_mapdata/debian-9.yaml | 2 +- test/integration/v3000-py3/files/_mapdata/ubuntu-16.yaml | 2 +- test/integration/v3000-py3/files/_mapdata/ubuntu-18.yaml | 2 +- test/integration/v3001-py3/files/_mapdata/debian-10.yaml | 2 +- test/integration/v3001-py3/files/_mapdata/debian-9.yaml | 2 +- test/integration/v3001-py3/files/_mapdata/ubuntu-16.yaml | 2 +- test/integration/v3001-py3/files/_mapdata/ubuntu-18.yaml | 2 +- test/integration/v3001-py3/files/_mapdata/ubuntu-20.yaml | 2 +- test/integration/v3002-py3/files/_mapdata/debian-10.yaml | 2 +- test/integration/v3002-py3/files/_mapdata/debian-9.yaml | 2 +- test/integration/v3002-py3/files/_mapdata/ubuntu-16.yaml | 2 +- test/integration/v3002-py3/files/_mapdata/ubuntu-18.yaml | 2 +- test/integration/v3002-py3/files/_mapdata/ubuntu-20.yaml | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/test/integration/v3000-py2/files/_mapdata/ubuntu-16.yaml b/test/integration/v3000-py2/files/_mapdata/ubuntu-16.yaml index c881856..ba55dc8 100644 --- a/test/integration/v3000-py2/files/_mapdata/ubuntu-16.yaml +++ b/test/integration/v3000-py2/files/_mapdata/ubuntu-16.yaml @@ -86,7 +86,7 @@ values: state: running parallel: true pin_version: false - pkgrepo: deb http://repo.saltstack.com/apt/ubuntu/16.04/amd64/3000 xenial main + pkgrepo: deb https://repo.saltstack.com/apt/ubuntu/16.04/amd64/3000 xenial main py_ver: '' pygit2: python-pygit2 pyinotify: python-pyinotify diff --git a/test/integration/v3000-py2/files/_mapdata/ubuntu-18.yaml b/test/integration/v3000-py2/files/_mapdata/ubuntu-18.yaml index 6ddb6b5..f099f27 100644 --- a/test/integration/v3000-py2/files/_mapdata/ubuntu-18.yaml +++ b/test/integration/v3000-py2/files/_mapdata/ubuntu-18.yaml @@ -86,7 +86,7 @@ values: state: running parallel: true pin_version: false - pkgrepo: deb http://repo.saltstack.com/apt/ubuntu/18.04/amd64/3000 bionic main + pkgrepo: deb https://repo.saltstack.com/apt/ubuntu/18.04/amd64/3000 bionic main py_ver: '' pygit2: python-pygit2 pyinotify: python-pyinotify diff --git a/test/integration/v3000-py3/files/_mapdata/debian-10.yaml b/test/integration/v3000-py3/files/_mapdata/debian-10.yaml index 65f4191..e94449e 100644 --- a/test/integration/v3000-py3/files/_mapdata/debian-10.yaml +++ b/test/integration/v3000-py3/files/_mapdata/debian-10.yaml @@ -86,7 +86,7 @@ values: state: running parallel: true pin_version: false - pkgrepo: deb http://repo.saltstack.com/py3/debian/10/amd64/3000 buster main + pkgrepo: deb https://repo.saltstack.com/py3/debian/10/amd64/3000 buster main py_ver: py3 pyinotify: python-pyinotify python_dulwich: python-dulwich diff --git a/test/integration/v3000-py3/files/_mapdata/debian-9.yaml b/test/integration/v3000-py3/files/_mapdata/debian-9.yaml index 3b4fed1..5b6a56f 100644 --- a/test/integration/v3000-py3/files/_mapdata/debian-9.yaml +++ b/test/integration/v3000-py3/files/_mapdata/debian-9.yaml @@ -86,7 +86,7 @@ values: state: running parallel: true pin_version: false - pkgrepo: deb http://repo.saltstack.com/py3/debian/9/amd64/3000 stretch main + pkgrepo: deb https://repo.saltstack.com/py3/debian/9/amd64/3000 stretch main py_ver: py3 pyinotify: python-pyinotify python_dulwich: python-dulwich diff --git a/test/integration/v3000-py3/files/_mapdata/ubuntu-16.yaml b/test/integration/v3000-py3/files/_mapdata/ubuntu-16.yaml index 00aad2f..09ce99c 100644 --- a/test/integration/v3000-py3/files/_mapdata/ubuntu-16.yaml +++ b/test/integration/v3000-py3/files/_mapdata/ubuntu-16.yaml @@ -86,7 +86,7 @@ values: state: running parallel: true pin_version: false - pkgrepo: deb http://repo.saltstack.com/py3/ubuntu/16.04/amd64/3000 xenial main + pkgrepo: deb https://repo.saltstack.com/py3/ubuntu/16.04/amd64/3000 xenial main py_ver: py3 pygit2: python-pygit2 pyinotify: python-pyinotify diff --git a/test/integration/v3000-py3/files/_mapdata/ubuntu-18.yaml b/test/integration/v3000-py3/files/_mapdata/ubuntu-18.yaml index 2baea53..08ed091 100644 --- a/test/integration/v3000-py3/files/_mapdata/ubuntu-18.yaml +++ b/test/integration/v3000-py3/files/_mapdata/ubuntu-18.yaml @@ -86,7 +86,7 @@ values: state: running parallel: true pin_version: false - pkgrepo: deb http://repo.saltstack.com/py3/ubuntu/18.04/amd64/3000 bionic main + pkgrepo: deb https://repo.saltstack.com/py3/ubuntu/18.04/amd64/3000 bionic main py_ver: py3 pygit2: python-pygit2 pyinotify: python-pyinotify diff --git a/test/integration/v3001-py3/files/_mapdata/debian-10.yaml b/test/integration/v3001-py3/files/_mapdata/debian-10.yaml index 70682f6..fe4ecc5 100644 --- a/test/integration/v3001-py3/files/_mapdata/debian-10.yaml +++ b/test/integration/v3001-py3/files/_mapdata/debian-10.yaml @@ -86,7 +86,7 @@ values: state: running parallel: true pin_version: false - pkgrepo: deb http://repo.saltstack.com/py3/debian/10/amd64/3001 buster main + pkgrepo: deb https://repo.saltstack.com/py3/debian/10/amd64/3001 buster main py_ver: py3 pyinotify: python-pyinotify python_dulwich: python-dulwich diff --git a/test/integration/v3001-py3/files/_mapdata/debian-9.yaml b/test/integration/v3001-py3/files/_mapdata/debian-9.yaml index 331367c..5f67a36 100644 --- a/test/integration/v3001-py3/files/_mapdata/debian-9.yaml +++ b/test/integration/v3001-py3/files/_mapdata/debian-9.yaml @@ -86,7 +86,7 @@ values: state: running parallel: true pin_version: false - pkgrepo: deb http://repo.saltstack.com/py3/debian/9/amd64/3001 stretch main + pkgrepo: deb https://repo.saltstack.com/py3/debian/9/amd64/3001 stretch main py_ver: py3 pyinotify: python-pyinotify python_dulwich: python-dulwich diff --git a/test/integration/v3001-py3/files/_mapdata/ubuntu-16.yaml b/test/integration/v3001-py3/files/_mapdata/ubuntu-16.yaml index 372cd7d..4959e5e 100644 --- a/test/integration/v3001-py3/files/_mapdata/ubuntu-16.yaml +++ b/test/integration/v3001-py3/files/_mapdata/ubuntu-16.yaml @@ -86,7 +86,7 @@ values: state: running parallel: true pin_version: false - pkgrepo: deb http://repo.saltstack.com/py3/ubuntu/16.04/amd64/3001 xenial main + pkgrepo: deb https://repo.saltstack.com/py3/ubuntu/16.04/amd64/3001 xenial main py_ver: py3 pygit2: python-pygit2 pyinotify: python-pyinotify diff --git a/test/integration/v3001-py3/files/_mapdata/ubuntu-18.yaml b/test/integration/v3001-py3/files/_mapdata/ubuntu-18.yaml index 4a67c3e..0f0b46b 100644 --- a/test/integration/v3001-py3/files/_mapdata/ubuntu-18.yaml +++ b/test/integration/v3001-py3/files/_mapdata/ubuntu-18.yaml @@ -86,7 +86,7 @@ values: state: running parallel: true pin_version: false - pkgrepo: deb http://repo.saltstack.com/py3/ubuntu/18.04/amd64/3001 bionic main + pkgrepo: deb https://repo.saltstack.com/py3/ubuntu/18.04/amd64/3001 bionic main py_ver: py3 pygit2: python-pygit2 pyinotify: python-pyinotify diff --git a/test/integration/v3001-py3/files/_mapdata/ubuntu-20.yaml b/test/integration/v3001-py3/files/_mapdata/ubuntu-20.yaml index ebb0a21..9f1a5d5 100644 --- a/test/integration/v3001-py3/files/_mapdata/ubuntu-20.yaml +++ b/test/integration/v3001-py3/files/_mapdata/ubuntu-20.yaml @@ -86,7 +86,7 @@ values: state: running parallel: true pin_version: false - pkgrepo: deb http://repo.saltstack.com/py3/ubuntu/20.04/amd64/3001 focal main + pkgrepo: deb https://repo.saltstack.com/py3/ubuntu/20.04/amd64/3001 focal main py_ver: py3 pygit2: python-pygit2 pyinotify: python-pyinotify diff --git a/test/integration/v3002-py3/files/_mapdata/debian-10.yaml b/test/integration/v3002-py3/files/_mapdata/debian-10.yaml index 8d612e4..cf4a608 100644 --- a/test/integration/v3002-py3/files/_mapdata/debian-10.yaml +++ b/test/integration/v3002-py3/files/_mapdata/debian-10.yaml @@ -86,7 +86,7 @@ values: state: running parallel: true pin_version: false - pkgrepo: deb http://repo.saltstack.com/py3/debian/10/amd64/3002 buster main + pkgrepo: deb https://repo.saltstack.com/py3/debian/10/amd64/3002 buster main py_ver: py3 pyinotify: python-pyinotify python_dulwich: python-dulwich diff --git a/test/integration/v3002-py3/files/_mapdata/debian-9.yaml b/test/integration/v3002-py3/files/_mapdata/debian-9.yaml index b13b12e..6681f68 100644 --- a/test/integration/v3002-py3/files/_mapdata/debian-9.yaml +++ b/test/integration/v3002-py3/files/_mapdata/debian-9.yaml @@ -86,7 +86,7 @@ values: state: running parallel: true pin_version: false - pkgrepo: deb http://repo.saltstack.com/py3/debian/9/amd64/3002 stretch main + pkgrepo: deb https://repo.saltstack.com/py3/debian/9/amd64/3002 stretch main py_ver: py3 pyinotify: python-pyinotify python_dulwich: python-dulwich diff --git a/test/integration/v3002-py3/files/_mapdata/ubuntu-16.yaml b/test/integration/v3002-py3/files/_mapdata/ubuntu-16.yaml index 2c017d7..8fca9f2 100644 --- a/test/integration/v3002-py3/files/_mapdata/ubuntu-16.yaml +++ b/test/integration/v3002-py3/files/_mapdata/ubuntu-16.yaml @@ -86,7 +86,7 @@ values: state: running parallel: true pin_version: false - pkgrepo: deb http://repo.saltstack.com/py3/ubuntu/16.04/amd64/3002 xenial main + pkgrepo: deb https://repo.saltstack.com/py3/ubuntu/16.04/amd64/3002 xenial main py_ver: py3 pygit2: python-pygit2 pyinotify: python-pyinotify diff --git a/test/integration/v3002-py3/files/_mapdata/ubuntu-18.yaml b/test/integration/v3002-py3/files/_mapdata/ubuntu-18.yaml index 361028c..b9b2f8a 100644 --- a/test/integration/v3002-py3/files/_mapdata/ubuntu-18.yaml +++ b/test/integration/v3002-py3/files/_mapdata/ubuntu-18.yaml @@ -86,7 +86,7 @@ values: state: running parallel: true pin_version: false - pkgrepo: deb http://repo.saltstack.com/py3/ubuntu/18.04/amd64/3002 bionic main + pkgrepo: deb https://repo.saltstack.com/py3/ubuntu/18.04/amd64/3002 bionic main py_ver: py3 pygit2: python-pygit2 pyinotify: python-pyinotify diff --git a/test/integration/v3002-py3/files/_mapdata/ubuntu-20.yaml b/test/integration/v3002-py3/files/_mapdata/ubuntu-20.yaml index acbd77c..3060276 100644 --- a/test/integration/v3002-py3/files/_mapdata/ubuntu-20.yaml +++ b/test/integration/v3002-py3/files/_mapdata/ubuntu-20.yaml @@ -86,7 +86,7 @@ values: state: running parallel: true pin_version: false - pkgrepo: deb http://repo.saltstack.com/py3/ubuntu/20.04/amd64/3002 focal main + pkgrepo: deb https://repo.saltstack.com/py3/ubuntu/20.04/amd64/3002 focal main py_ver: py3 pygit2: python-pygit2 pyinotify: python-pyinotify