From 2993decdc5b8dd71ca957e7096229f16d6973caa Mon Sep 17 00:00:00 2001 From: Sean Molenaar Date: Fri, 19 May 2023 09:11:15 +0200 Subject: [PATCH 1/5] fix(maps): fix keys and archs --- salt/defaults.yaml | 2 +- salt/osfamilymap.yaml | 9 +++++---- salt/osfingermap.yaml | 4 ++-- salt/osmap.yaml | 11 ++++++----- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/salt/defaults.yaml b/salt/defaults.yaml index 2b84eec3e..dd02856b8 100644 --- a/salt/defaults.yaml +++ b/salt/defaults.yaml @@ -4,7 +4,7 @@ salt: version: '' pin_version: false - py_ver: '' ## py2 is default + py_ver: 'py3' ## py3 is default rootuser: root rootgroup: root install_packages: true diff --git a/salt/osfamilymap.yaml b/salt/osfamilymap.yaml index e2e48a640..e2c723679 100644 --- a/salt/osfamilymap.yaml +++ b/salt/osfamilymap.yaml @@ -4,6 +4,7 @@ {%- set py_ver_repr = salt['pillar.get']('salt:py_ver', '') %} +{%- set repoarch = 'amd64' if salt['grains.get']('osarch', '') == 'x86_64' else 'arm64' %} {%- set osrelease = salt['grains.get']('osrelease', '') %} {%- set salt_release = salt['pillar.get']('salt:release', 'latest') %} {%- if salt_release.split('.')|length >= 3 %} @@ -13,7 +14,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.saltproject.io') %} +{%- set salt_repo = salt['pillar.get']('salt:repo', 'https://repo.saltproject.io/salt') %} #from template-formula {%- if grains.os_family == 'MacOS' %} @@ -25,7 +26,7 @@ Debian: - pkgrepo: 'deb [signed-by=/usr/share/keyrings/salt-archive-keyring.gpg arch=amd64] {{ salt_repo }}/{{ py_ver_repr or 'py3' }}/{{ osfamily_lower }}/{{ osmajorrelease }}/amd64/{{ salt_release }} {{ oscodename }} main' + pkgrepo: 'deb [signed-by=/usr/share/keyrings/salt-archive-keyring.gpg arch={{ repoarch }}] {{ salt_repo }}/{{ py_ver_repr or 'py3' }}/{{ osfamily_lower }}/{{ osmajorrelease }}/{{ repoarch }}/{{ salt_release }} {{ oscodename }} main' pkgrepo_keyring: '{{ salt_repo }}/{{ py_ver_repr or 'py3' }}/{{ osfamily_lower }}/{{ osmajorrelease }}/amd64/{{ salt_release }}/salt-archive-keyring.gpg' pkgrepo_keyring_hash: sha256=ea38e0cdbd8dc53e1af154a8d711a2a321a69f81188062dc5cde9d54df2b8c47 libgit2: libgit2-22 @@ -43,8 +44,8 @@ Debian: RedHat: pkgrepo_name: saltstack pkgrepo_humanname: SaltStack repo for RHEL/CentOS $releasever - 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' + pkgrepo: '{{ salt_repo }}/{{ py_ver_repr or 'py3' }}/redhat/$releasever/$basearch/{{ salt_release }}' + key_url: '{{ salt_repo }}/{{ py_ver_repr or 'py3' }}/redhat/$releasever/$basearch/{{ salt_release }}/SALT-PROJECT-GPG-PUBKEY-{{ "today" | strftime("%Y") }}.pub' pygit2: python-pygit2 python_git: GitPython gitfs: diff --git a/salt/osfingermap.yaml b/salt/osfingermap.yaml index d92030d1b..995624b08 100644 --- a/salt/osfingermap.yaml +++ b/salt/osfingermap.yaml @@ -14,5 +14,5 @@ Oracle Linux Server-7: pkgrepo_humanname: SaltStack repo for RHEL/CentOS {{ osmajorrelease }} - pkgrepo: '{{ salt_repo }}/{{ py_ver_repr or 'yum' }}/redhat/{{ osmajorrelease }}/$basearch/{{ salt_release }}' - key_url: '{{ salt_repo }}/{{ py_ver_repr or 'yum' }}/redhat/{{ osmajorrelease }}/$basearch/{{ salt_release }}/SALTSTACK-GPG-KEY.pub' + pkgrepo: '{{ salt_repo }}/{{ py_ver_repr or 'py3' }}/redhat/{{ osmajorrelease }}/$basearch/{{ salt_release }}' + key_url: '{{ salt_repo }}/{{ py_ver_repr or 'py3' }}/redhat/{{ osmajorrelease }}/$basearch/{{ salt_release }}/SALT-PROJECT-GPG-PUBKEY-{{ "today" | strftime("%Y") }}.pub' diff --git a/salt/osmap.yaml b/salt/osmap.yaml index c55372822..321a0c7c7 100644 --- a/salt/osmap.yaml +++ b/salt/osmap.yaml @@ -4,6 +4,7 @@ {%- set py_ver_repr = salt['pillar.get']('salt:py_ver', '') %} +{%- set repoarch = 'amd64' if salt['grains.get']('osarch', '') == 'x86_64' else 'arm64' %} {%- set osrelease = salt['grains.get']('osrelease', '') %} {%- set salt_release = salt['pillar.get']('salt:release', 'latest') %} {%- if salt_release.split('.')|length >= 3 %} @@ -22,13 +23,13 @@ Amazon: pkgrepo_name: saltstack-amzn-repo pkgrepo_humanname: SaltStack repo for Amazon Linux 2 pkgrepo: '{{ salt_repo }}/{{ py_ver_repr or 'yum' }}/amazon/2/$basearch/{{ salt_release }}' - key_url: '{{ salt_repo }}/{{ py_ver_repr or 'yum' }}/amazon/2/$basearch/{{ salt_release }}/SALTSTACK-GPG-KEY.pub' + key_url: '{{ salt_repo }}/{{ py_ver_repr or 'yum' }}/amazon/2/$basearch/{{ salt_release }}/SALT-PROJECT-GPG-PUBKEY-{{ "today" | strftime("%Y") }}.pub' Ubuntu: - pkgrepo: 'deb [signed-by=/usr/share/keyrings/salt-archive-keyring.gpg arch=amd64] {{ salt_repo }}/{{ py_ver_repr or 'apt' }}/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }} {{ oscodename }} main' - pkgrepo_keyring: '{{ salt_repo }}/{{ py_ver_repr or 'apt' }}/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }}/salt-archive-keyring.gpg' + pkgrepo: 'deb [signed-by=/usr/share/keyrings/SALT-PROJECT-GPG-PUBKEY-{{ "today" | strftime("%Y") }}.gpg arch={{ repoarch }}] {{ salt_repo }}/{{ py_ver_repr or 'apt' }}/{{ os_lower }}/{{ osrelease }}/{{ repoarch }}/{{ salt_release }} {{ oscodename }} main' + pkgrepo_keyring: '{{ salt_repo }}/{% if oscodename == "jammy" %}salt/{% endif %}{{ py_ver_repr or 'apt' }}/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }}/SALT-PROJECT-GPG-PUBKEY-{{ "today" | strftime("%Y") }}.gpg' pkgrepo_keyring_hash: sha256=ea38e0cdbd8dc53e1af154a8d711a2a321a69f81188062dc5cde9d54df2b8c47 - key_url: '{{ salt_repo }}/{{ py_ver_repr or 'apt' }}/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }}/SALTSTACK-GPG-KEY.pub' + key_url: '{{ salt_repo }}/{{ py_ver_repr or 'apt' }}/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }}/SALT-PROJECT-GPG-PUBKEY-{{ "today" | strftime("%Y") }}.gpg' pygit2: python-pygit2 gitfs: pygit2: @@ -39,7 +40,7 @@ Ubuntu: Raspbian: pkgrepo: 'deb [signed-by=/usr/share/keyrings/salt-archive-keyring.gpg arch=armhf] {{ salt_repo }}/{{ py_ver_repr or 'py3' }}/{{ os_family_lower }}/{{ osmajorrelease }}/armhf/{{ salt_release }} {{ oscodename }} main' - pkgrepo_keyring: '{{ salt_repo }}/{{ py_ver_repr or 'py3' }}/{{ os_family_lower }}/{{ osmajorrelease }}/armhf/{{ salt_release }}/salt-archive-keyring.gpg' + pkgrepo_keyring: '{{ salt_repo }}/{{ py_ver_repr or 'py3' }}/{{ os_family_lower }}/{{ osmajorrelease }}/armhf/{{ salt_release }}/SALT-PROJECT-GPG-PUBKEY-{{ "today" | strftime("%Y") }}.gpg' SmartOS: salt_master: salt From b1f8f19c32cfda5acd4a17395b84d475493154cb Mon Sep 17 00:00:00 2001 From: Sean Molenaar Date: Wed, 14 Jun 2023 12:55:26 +0200 Subject: [PATCH 2/5] fix(maps): fix key names --- salt/osfamilymap.yaml | 2 +- salt/osfingermap.yaml | 2 +- salt/osmap.yaml | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/salt/osfamilymap.yaml b/salt/osfamilymap.yaml index e2c723679..c734b1f3c 100644 --- a/salt/osfamilymap.yaml +++ b/salt/osfamilymap.yaml @@ -45,7 +45,7 @@ RedHat: pkgrepo_name: saltstack pkgrepo_humanname: SaltStack repo for RHEL/CentOS $releasever pkgrepo: '{{ salt_repo }}/{{ py_ver_repr or 'py3' }}/redhat/$releasever/$basearch/{{ salt_release }}' - key_url: '{{ salt_repo }}/{{ py_ver_repr or 'py3' }}/redhat/$releasever/$basearch/{{ salt_release }}/SALT-PROJECT-GPG-PUBKEY-{{ "today" | strftime("%Y") }}.pub' + key_url: '{{ salt_repo }}/{{ py_ver_repr or 'py3' }}/redhat/$releasever/$basearch/{{ salt_release }}/SALT-PROJECT-GPG-PUBKEY-2023.pub' pygit2: python-pygit2 python_git: GitPython gitfs: diff --git a/salt/osfingermap.yaml b/salt/osfingermap.yaml index 995624b08..3bf71e01e 100644 --- a/salt/osfingermap.yaml +++ b/salt/osfingermap.yaml @@ -15,4 +15,4 @@ Oracle Linux Server-7: pkgrepo_humanname: SaltStack repo for RHEL/CentOS {{ osmajorrelease }} pkgrepo: '{{ salt_repo }}/{{ py_ver_repr or 'py3' }}/redhat/{{ osmajorrelease }}/$basearch/{{ salt_release }}' - key_url: '{{ salt_repo }}/{{ py_ver_repr or 'py3' }}/redhat/{{ osmajorrelease }}/$basearch/{{ salt_release }}/SALT-PROJECT-GPG-PUBKEY-{{ "today" | strftime("%Y") }}.pub' + key_url: '{{ salt_repo }}/{{ py_ver_repr or 'py3' }}/redhat/{{ osmajorrelease }}/$basearch/{{ salt_release }}/SALT-PROJECT-GPG-PUBKEY-2023.pub' diff --git a/salt/osmap.yaml b/salt/osmap.yaml index 321a0c7c7..e7aa78de8 100644 --- a/salt/osmap.yaml +++ b/salt/osmap.yaml @@ -23,11 +23,11 @@ Amazon: pkgrepo_name: saltstack-amzn-repo pkgrepo_humanname: SaltStack repo for Amazon Linux 2 pkgrepo: '{{ salt_repo }}/{{ py_ver_repr or 'yum' }}/amazon/2/$basearch/{{ salt_release }}' - key_url: '{{ salt_repo }}/{{ py_ver_repr or 'yum' }}/amazon/2/$basearch/{{ salt_release }}/SALT-PROJECT-GPG-PUBKEY-{{ "today" | strftime("%Y") }}.pub' + key_url: '{{ salt_repo }}/{{ py_ver_repr or 'yum' }}/amazon/2/$basearch/{{ salt_release }}/SALT-PROJECT-GPG-PUBKEY-2023.pub' Ubuntu: - pkgrepo: 'deb [signed-by=/usr/share/keyrings/SALT-PROJECT-GPG-PUBKEY-{{ "today" | strftime("%Y") }}.gpg arch={{ repoarch }}] {{ salt_repo }}/{{ py_ver_repr or 'apt' }}/{{ os_lower }}/{{ osrelease }}/{{ repoarch }}/{{ salt_release }} {{ oscodename }} main' - pkgrepo_keyring: '{{ salt_repo }}/{% if oscodename == "jammy" %}salt/{% endif %}{{ py_ver_repr or 'apt' }}/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }}/SALT-PROJECT-GPG-PUBKEY-{{ "today" | strftime("%Y") }}.gpg' + pkgrepo: 'deb [signed-by=/usr/share/keyrings/SALT-PROJECT-GPG-PUBKEY-2023.gpg arch={{ repoarch }}] {{ salt_repo }}/{{ py_ver_repr or 'apt' }}/{{ os_lower }}/{{ osrelease }}/{{ repoarch }}/{{ salt_release }} {{ oscodename }} main' + pkgrepo_keyring: '{{ salt_repo }}/{% if oscodename == "jammy" %}salt/{% endif %}{{ py_ver_repr or 'apt' }}/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }}/SALT-PROJECT-GPG-PUBKEY-2023.gpg' pkgrepo_keyring_hash: sha256=ea38e0cdbd8dc53e1af154a8d711a2a321a69f81188062dc5cde9d54df2b8c47 key_url: '{{ salt_repo }}/{{ py_ver_repr or 'apt' }}/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }}/SALT-PROJECT-GPG-PUBKEY-{{ "today" | strftime("%Y") }}.gpg' pygit2: python-pygit2 @@ -40,7 +40,7 @@ Ubuntu: Raspbian: pkgrepo: 'deb [signed-by=/usr/share/keyrings/salt-archive-keyring.gpg arch=armhf] {{ salt_repo }}/{{ py_ver_repr or 'py3' }}/{{ os_family_lower }}/{{ osmajorrelease }}/armhf/{{ salt_release }} {{ oscodename }} main' - pkgrepo_keyring: '{{ salt_repo }}/{{ py_ver_repr or 'py3' }}/{{ os_family_lower }}/{{ osmajorrelease }}/armhf/{{ salt_release }}/SALT-PROJECT-GPG-PUBKEY-{{ "today" | strftime("%Y") }}.gpg' + pkgrepo_keyring: '{{ salt_repo }}/{{ py_ver_repr or 'py3' }}/{{ os_family_lower }}/{{ osmajorrelease }}/armhf/{{ salt_release }}/SALT-PROJECT-GPG-PUBKEY-2023.gpg' SmartOS: salt_master: salt From 18d556900e85f0db2729e9c0f9399e93542fd913 Mon Sep 17 00:00:00 2001 From: Lenard Fudala Date: Wed, 14 Jun 2023 14:59:40 -0500 Subject: [PATCH 3/5] fix(onedir,maps): fix keys for onedir and classic --- salt/osfamilymap.yaml | 20 +++++++++++++------- salt/osfingermap.yaml | 10 ++++++++-- salt/osmap.yaml | 24 +++++++++++++++--------- 3 files changed, 36 insertions(+), 18 deletions(-) diff --git a/salt/osfamilymap.yaml b/salt/osfamilymap.yaml index c734b1f3c..f07093488 100644 --- a/salt/osfamilymap.yaml +++ b/salt/osfamilymap.yaml @@ -4,17 +4,23 @@ {%- set py_ver_repr = salt['pillar.get']('salt:py_ver', '') %} -{%- set repoarch = 'amd64' if salt['grains.get']('osarch', '') == 'x86_64' else 'arm64' %} +{%- set repoarch = salt['grains.get']('osarch') %} {%- set osrelease = salt['grains.get']('osrelease', '') %} {%- set salt_release = salt['pillar.get']('salt:release', 'latest') %} {%- if salt_release.split('.')|length >= 3 %} {%- set salt_release = 'archive/' ~ salt_release %} {%- endif %} +{%- set salt_release_major = salt_release.split('.') | map('int') | list | first %} +{%- if salt_release != "latest" %} +{%- set onedir = salt['pillar.get']('salt:onedir', True) if (salt_release_major >= 3005) and (salt_release != "archive/") else False %} +{%- else %} +{%- set onedir = True %} +{%- endif %} {%- set osfamily_lower = salt['grains.get']('os_family')|lower %} {%- 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.saltproject.io/salt') %} +{%- set salt_repo = salt['pillar.get']('salt:repo', 'https://repo.saltproject.io') %} #from template-formula {%- if grains.os_family == 'MacOS' %} @@ -26,9 +32,9 @@ Debian: - pkgrepo: 'deb [signed-by=/usr/share/keyrings/salt-archive-keyring.gpg arch={{ repoarch }}] {{ salt_repo }}/{{ py_ver_repr or 'py3' }}/{{ osfamily_lower }}/{{ osmajorrelease }}/{{ repoarch }}/{{ salt_release }} {{ oscodename }} main' - pkgrepo_keyring: '{{ salt_repo }}/{{ py_ver_repr or 'py3' }}/{{ osfamily_lower }}/{{ osmajorrelease }}/amd64/{{ salt_release }}/salt-archive-keyring.gpg' - pkgrepo_keyring_hash: sha256=ea38e0cdbd8dc53e1af154a8d711a2a321a69f81188062dc5cde9d54df2b8c47 + pkgrepo: 'deb [signed-by=/usr/share/keyrings/salt-archive-keyring.gpg arch={{ repoarch }}] {{ salt_repo }}/{% if onedir == True %}salt/{% endif %}{{ py_ver_repr or 'py3' }}/{{ osfamily_lower }}/{{ osmajorrelease }}/{{ repoarch }}/{{ salt_release }} {{ oscodename }} main' + pkgrepo_keyring: '{{ salt_repo }}/{% if onedir == True %}salt/{% endif %}{{ py_ver_repr or 'py3' }}/{{ osfamily_lower }}/{{ osmajorrelease }}/amd64/{{ salt_release }}/{% if (salt_release == "latest") or (salt_release_major >= 3006) %}SALT-PROJECT-GPG-PUBKEY-2023.gpg{% else %}salt-archive-keyring.gpg{% endif %}' + pkgrepo_keyring_hash: sha256={% if salt_release_major >= 3006 %}c6f6cbcd96fdb130b1dde8dcfc05d46a3a3f322ff0514f98e2e6473896243472{% else %}ea38e0cdbd8dc53e1af154a8d711a2a321a69f81188062dc5cde9d54df2b8c47{% endif %} libgit2: libgit2-22 pyinotify: python-pyinotify gitfs: @@ -44,8 +50,8 @@ Debian: RedHat: pkgrepo_name: saltstack pkgrepo_humanname: SaltStack repo for RHEL/CentOS $releasever - pkgrepo: '{{ salt_repo }}/{{ py_ver_repr or 'py3' }}/redhat/$releasever/$basearch/{{ salt_release }}' - key_url: '{{ salt_repo }}/{{ py_ver_repr or 'py3' }}/redhat/$releasever/$basearch/{{ salt_release }}/SALT-PROJECT-GPG-PUBKEY-2023.pub' + pkgrepo: '{{ salt_repo }}/{% if (osmajorrelease == "9") or (onedir == True) %}salt/{% endif %}{{ py_ver_repr or 'py3' }}/redhat/$releasever/$basearch/{{ salt_release }}' + key_url: '{{ salt_repo }}/{% if (osmajorrelease == "9") or (onedir == True) %}salt/{% endif %}{{ py_ver_repr or 'py3' }}/redhat/$releasever/$basearch/{{ salt_release }}/{% if (osmajorrelease == "9") and (salt_release_major == 3005) %}SALTSTACK-GPG-KEY2.pub{% elif (salt_release == "latest") or (salt_release_major >= 3006) %}SALT-PROJECT-GPG-PUBKEY-2023.pub{% else %}SALTSTACK-GPG-KEY.pub{% endif %}' pygit2: python-pygit2 python_git: GitPython gitfs: diff --git a/salt/osfingermap.yaml b/salt/osfingermap.yaml index 3bf71e01e..1b151c3ab 100644 --- a/salt/osfingermap.yaml +++ b/salt/osfingermap.yaml @@ -9,10 +9,16 @@ {%- if salt_release.split('.')|length >= 3 %} {%- set salt_release = 'archive/' ~ salt_release %} {%- endif %} +{%- set salt_release_major = salt_release.split('.') | map('int') | list | first %} +{%- if salt_release != "latest" %} +{%- set onedir = salt['pillar.get']('salt:onedir', True) if (salt_release_major >= 3005) and (salt_release != "archive/") else False %} +{%- else %} +{%- set onedir = True %} +{%- endif %} {%- set osmajorrelease = salt['grains.get']('osmajorrelease', osrelease)|string %} {%- set salt_repo = salt['pillar.get']('salt:repo', 'https://repo.saltproject.io') %} Oracle Linux Server-7: pkgrepo_humanname: SaltStack repo for RHEL/CentOS {{ osmajorrelease }} - pkgrepo: '{{ salt_repo }}/{{ py_ver_repr or 'py3' }}/redhat/{{ osmajorrelease }}/$basearch/{{ salt_release }}' - key_url: '{{ salt_repo }}/{{ py_ver_repr or 'py3' }}/redhat/{{ osmajorrelease }}/$basearch/{{ salt_release }}/SALT-PROJECT-GPG-PUBKEY-2023.pub' + pkgrepo: '{{ salt_repo }}/{% if onedir == True %}salt/{% endif %}{{ py_ver_repr or 'py3' }}/redhat/{{ osmajorrelease }}/$basearch/{{ salt_release }}' + key_url: '{{ salt_repo }}/{% if onedir == True %}salt/{% endif %}{{ py_ver_repr or 'py3' }}/redhat/{{ osmajorrelease }}/$basearch/{{ salt_release }}/{% if (salt_release == "latest") or (salt_release_major >= 3006) %}SALT-PROJECT-GPG-PUBKEY-2023.pub{% else %}SALTSTACK-GPG-KEY.pub{% endif %}' diff --git a/salt/osmap.yaml b/salt/osmap.yaml index e7aa78de8..7c46a209b 100644 --- a/salt/osmap.yaml +++ b/salt/osmap.yaml @@ -4,12 +4,18 @@ {%- set py_ver_repr = salt['pillar.get']('salt:py_ver', '') %} -{%- set repoarch = 'amd64' if salt['grains.get']('osarch', '') == 'x86_64' else 'arm64' %} +{%- set repoarch = salt['grains.get']('osarch') %} {%- set osrelease = salt['grains.get']('osrelease', '') %} {%- set salt_release = salt['pillar.get']('salt:release', 'latest') %} {%- if salt_release.split('.')|length >= 3 %} {%- set salt_release = 'archive/' ~ salt_release %} {%- endif %} +{%- set salt_release_major = salt_release.split('.') | map('int') | list | first %} +{%- if salt_release != "latest" %} +{%- set onedir = salt['pillar.get']('salt:onedir', True) if (salt_release_major >= 3005) and (salt_release != "archive/") else False %} +{%- else %} +{%- set onedir = True %} +{%- endif %} {%- set os_lower = salt['grains.get']('os')|lower %} {%- set osmajorrelease = salt['grains.get']('osmajorrelease', osrelease)|string %} {%- set oscodename = salt['grains.get']('oscodename') %} @@ -22,14 +28,14 @@ Fedora: Amazon: pkgrepo_name: saltstack-amzn-repo pkgrepo_humanname: SaltStack repo for Amazon Linux 2 - pkgrepo: '{{ salt_repo }}/{{ py_ver_repr or 'yum' }}/amazon/2/$basearch/{{ salt_release }}' - key_url: '{{ salt_repo }}/{{ py_ver_repr or 'yum' }}/amazon/2/$basearch/{{ salt_release }}/SALT-PROJECT-GPG-PUBKEY-2023.pub' + pkgrepo: '{{ salt_repo }}/{% if onedir == True %}salt/{% endif %}{{ py_ver_repr or 'py3' }}/amazon/2/$basearch/{{ salt_release }}' + key_url: '{{ salt_repo }}/{% if onedir == True %}salt/{% endif %}{{ py_ver_repr or 'py3' }}/amazon/2/$basearch/{{ salt_release }}/{% if (salt_release == "latest") or (salt_release_major >= 3006) %}SALT-PROJECT-GPG-PUBKEY-2023.pub{% else %}SALTSTACK-GPG-KEY.pub{% endif %}' Ubuntu: - pkgrepo: 'deb [signed-by=/usr/share/keyrings/SALT-PROJECT-GPG-PUBKEY-2023.gpg arch={{ repoarch }}] {{ salt_repo }}/{{ py_ver_repr or 'apt' }}/{{ os_lower }}/{{ osrelease }}/{{ repoarch }}/{{ salt_release }} {{ oscodename }} main' - pkgrepo_keyring: '{{ salt_repo }}/{% if oscodename == "jammy" %}salt/{% endif %}{{ py_ver_repr or 'apt' }}/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }}/SALT-PROJECT-GPG-PUBKEY-2023.gpg' - pkgrepo_keyring_hash: sha256=ea38e0cdbd8dc53e1af154a8d711a2a321a69f81188062dc5cde9d54df2b8c47 - key_url: '{{ salt_repo }}/{{ py_ver_repr or 'apt' }}/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }}/SALT-PROJECT-GPG-PUBKEY-{{ "today" | strftime("%Y") }}.gpg' + pkgrepo: 'deb [signed-by=/usr/share/keyrings/salt-archive-keyring.gpg arch={{ repoarch }}] {{ salt_repo }}/{% if (oscodename == "jammy") or (onedir == True) %}salt/{% endif %}{{ py_ver_repr or 'apt' }}/{{ os_lower }}/{{ osrelease }}/{{ repoarch }}/{{ salt_release }} {{ oscodename }} main' + pkgrepo_keyring: '{{ salt_repo }}/{% if (oscodename == "jammy") or (onedir == True) %}salt/{% endif %}{{ py_ver_repr or 'py3' }}/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }}/{% if (salt_release == "latest") or (salt_release_major >= 3006) %}SALT-PROJECT-GPG-PUBKEY-2023.gpg{% else %}salt-archive-keyring.gpg{% endif %}' + pkgrepo_keyring_hash: sha256={% if (salt_release == "latest") or (salt_release_major >= 3006) %}c6f6cbcd96fdb130b1dde8dcfc05d46a3a3f322ff0514f98e2e6473896243472{% else %}ea38e0cdbd8dc53e1af154a8d711a2a321a69f81188062dc5cde9d54df2b8c47{% endif %} + key_url: '{{ salt_repo }}/{% if (oscodename == "jammy") or (onedir == True) %}salt/{% endif %}{{ py_ver_repr or 'py3' }}/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }}/{% if (oscodename == "jammy") and (salt_release_major == 3005) %}salt-archive-keyring.gpg{% elif (salt_release == "latest") or (salt_release_major >= 3006) %}SALT-PROJECT-GPG-PUBKEY-2023.pub{% else %}SALTSTACK-GPG-KEY.pub{% endif %}' pygit2: python-pygit2 gitfs: pygit2: @@ -39,8 +45,8 @@ Ubuntu: install_from_package: Null Raspbian: - pkgrepo: 'deb [signed-by=/usr/share/keyrings/salt-archive-keyring.gpg arch=armhf] {{ salt_repo }}/{{ py_ver_repr or 'py3' }}/{{ os_family_lower }}/{{ osmajorrelease }}/armhf/{{ salt_release }} {{ oscodename }} main' - pkgrepo_keyring: '{{ salt_repo }}/{{ py_ver_repr or 'py3' }}/{{ os_family_lower }}/{{ osmajorrelease }}/armhf/{{ salt_release }}/SALT-PROJECT-GPG-PUBKEY-2023.gpg' + pkgrepo: 'deb [signed-by=/usr/share/keyrings/salt-archive-keyring.gpg arch=armhf] {{ salt_repo }}/{% if onedir == True %}salt/{% endif %}{{ py_ver_repr or 'py3' }}/{{ os_family_lower }}/{{ osmajorrelease }}/armhf/{{ salt_release }} {{ oscodename }} main' + pkgrepo_keyring: '{{ salt_repo }}/{% if onedir == True %}salt/{% endif %}{{ py_ver_repr or 'py3' }}/{{ os_family_lower }}/{{ osmajorrelease }}/armhf/{{ salt_release }}/{% if (salt_release == "latest") or (salt_release_major >= 3006) %}SALT-PROJECT-GPG-PUBKEY-2023.gpg{% else %}salt-archive-keyring.gpg{% endif %}' SmartOS: salt_master: salt From 671e92631922e0ecf96005680cde3d096c8a3723 Mon Sep 17 00:00:00 2001 From: Lenard Fudala Date: Wed, 26 Jul 2023 15:17:31 -0500 Subject: [PATCH 4/5] fix(macos): use pillars for plist sources --- salt/master.sls | 2 +- salt/minion.sls | 2 +- salt/osmap.yaml | 9 +++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/salt/master.sls b/salt/master.sls index af9d867d1..dfd3d7705 100644 --- a/salt/master.sls +++ b/salt/master.sls @@ -13,7 +13,7 @@ include: salt-master-macos: file.managed: - name: /Library/LaunchDaemons/com.saltstack.salt.master.plist - - source: https://raw.githubusercontent.com/saltstack/salt/master/pkg/osx/scripts/com.saltstack.salt.master.plist + - source: {{ salt_settings.salt_master_macos_plist_source }} - source_hash: {{ salt_settings.salt_master_macos_plist_hash }} - retry: {{ salt_settings.retry_options | json }} - require_in: diff --git a/salt/minion.sls b/salt/minion.sls index 97db5b321..fdc3ddd74 100644 --- a/salt/minion.sls +++ b/salt/minion.sls @@ -42,7 +42,7 @@ salt-minion-macos: file.managed: - onlyif: {{ grains.os == 'MacOS' }} - name: /Library/LaunchDaemons/com.saltstack.salt.minion.plist - - source: https://raw.githubusercontent.com/saltstack/salt/master/pkg/osx/scripts/com.saltstack.salt.master.plist + - source: {{ salt_settings.salt_minion_macos_plist_source }} - source_hash: {{ salt_settings.salt_minion_macos_plist_hash }} - retry: {{ salt_settings.retry_options | json }} - require_in: diff --git a/salt/osmap.yaml b/salt/osmap.yaml index 7c46a209b..81ecad455 100644 --- a/salt/osmap.yaml +++ b/salt/osmap.yaml @@ -7,6 +7,9 @@ {%- set repoarch = salt['grains.get']('osarch') %} {%- set osrelease = salt['grains.get']('osrelease', '') %} {%- set salt_release = salt['pillar.get']('salt:release', 'latest') %} +{%- if salt_release != "latest" %} +{%- set salt_release_major = salt_release.split('.') | map('.') | list | first %} +{%- endif %} {%- if salt_release.split('.')|length >= 3 %} {%- set salt_release = 'archive/' ~ salt_release %} {%- endif %} @@ -69,8 +72,10 @@ SmartOS: MacOS: minion_service: com.saltstack.salt.minion master_service: com.saltstack.salt.master - salt_master_macos_plist_hash: 8435331b2d48ca8f0759f216e5b15ec9171a4216b1441328c732c6906728b7c9 - salt_minion_macos_plist_hash: 26b33da12e0d8960ee96b488c8352002c22a377c19bf3df3f986a1e49eca8b20 + salt_master_macos_plist_source: https://github.com/saltstack/salt/raw/master/pkg/macos/scripts/com.saltstack.salt.master.plist + salt_minion_macos_plist_source: https://github.com/saltstack/salt/raw/master/pkg/macos/scripts/com.saltstack.salt.minion.plist + salt_master_macos_plist_hash: 97666226c14ec2fd755edb5d909688540a36408dfe9fb34a1c15676020376ace + salt_minion_macos_plist_hash: 17d9556b5742a785eaddaec117132be99af138cab7157dbacbda2058538b6e69 FreeBSD: salt_master: py39-salt From e4ceed9a12e8a99749d5e4736cd2a641cabf6e72 Mon Sep 17 00:00:00 2001 From: Lenard Fudala Date: Wed, 26 Jul 2023 16:44:51 -0500 Subject: [PATCH 5/5] fix(maps): remove old extra block --- salt/osmap.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/salt/osmap.yaml b/salt/osmap.yaml index 81ecad455..54159bf98 100644 --- a/salt/osmap.yaml +++ b/salt/osmap.yaml @@ -7,9 +7,6 @@ {%- set repoarch = salt['grains.get']('osarch') %} {%- set osrelease = salt['grains.get']('osrelease', '') %} {%- set salt_release = salt['pillar.get']('salt:release', 'latest') %} -{%- if salt_release != "latest" %} -{%- set salt_release_major = salt_release.split('.') | map('.') | list | first %} -{%- endif %} {%- if salt_release.split('.')|length >= 3 %} {%- set salt_release = 'archive/' ~ salt_release %} {%- endif %}