Selaa lähdekoodia

add a way to set which release of saltstack to use

SaltStack provides "versioned" repositories, this commit add a way
to set which release of salt to use.
It adds a pillar "salt:release" which can be set to a specific release
(ex: 2016.11). This release is then used to configure properly the
repositories URLs for Debian/Ubuntu/RedHat.
The default behavior is to point to 'latest', retaining the previous
behavior if the "salt:release" pillar is not set.
tags/v0.57.0
carpenti 7 vuotta sitten
vanhempi
commit
6622d177bf
3 muutettua tiedostoa jossa 17 lisäystä ja 8 poistoa
  1. +6
    -0
      pillar.example
  2. +9
    -6
      salt/map.jinja
  3. +2
    -2
      salt/pkgrepo/redhat/init.sls

+ 6
- 0
pillar.example Näytä tiedosto

salt-cloud: 'salt-cloud' salt-cloud: 'salt-cloud'
salt-ssh: 'salt-ssh' salt-ssh: 'salt-ssh'


# Set which release of SaltStack to use, default to 'latest'
# To get the available releases:
# * http://repo.saltstack.com/yum/redhat/7/x86_64/
# * http://repo.saltstack.com/apt/debian/8/amd64/
release: 2016.11

# salt master config # salt master config
master: master:
fileserver_backend: fileserver_backend:

+ 9
- 6
salt/map.jinja Näytä tiedosto

that differ from whats in defaults.yaml that differ from whats in defaults.yaml
##} ##}
{% set osrelease = salt['grains.get']('osrelease') %} {% set osrelease = salt['grains.get']('osrelease') %}
{% set salt_release = salt['pillar.get']('salt:release', 'latest') %}
{% set os_family_map = salt['grains.filter_by']({ {% set os_family_map = salt['grains.filter_by']({
'Debian': { 'Debian': {
'pkgrepo': 'deb http://repo.saltstack.com/apt/' + 'pkgrepo': 'deb http://repo.saltstack.com/apt/' +
salt['grains.get']('os')|lower + '/' + salt['grains.get']('osmajorrelease', osrelease) + '/amd64/latest ' + salt['grains.get']('oscodename') + ' main',
'key_url': 'https://repo.saltstack.com/apt/' + salt['grains.get']('os')|lower + '/' + salt['grains.get']('osmajorrelease', osrelease) + '/amd64/latest/SALTSTACK-GPG-KEY.pub',
salt['grains.get']('os')|lower + '/' + salt['grains.get']('osmajorrelease', osrelease) + '/amd64/' + salt_release + ' ' + salt['grains.get']('oscodename') + ' main',
'key_url': 'https://repo.saltstack.com/apt/' + salt['grains.get']('os')|lower + '/' + salt['grains.get']('osmajorrelease', osrelease) + '/amd64/' + salt_release + '/SALTSTACK-GPG-KEY.pub',
'libgit2': 'libgit2-22', 'libgit2': 'libgit2-22',
'gitfs': { 'gitfs': {
'pygit2': { 'pygit2': {
}, },
}, },
'RedHat': { 'RedHat': {
'pkgrepo': 'https://repo.saltstack.com/yum/redhat/$releasever/$basearch/' + salt_release
'key_url': 'https://repo.saltstack.com/yum/redhat/$releasever/$basearch/' + salt_release + '/SALTSTACK-GPG-KEY.pub'
'pygit2': salt['grains.filter_by']({ 'pygit2': salt['grains.filter_by']({
'Fedora': 'python2-pygit2', 'Fedora': 'python2-pygit2',
'default': 'python-pygit2', 'default': 'python-pygit2',
}, merge=salt['grains.filter_by']({ }, merge=salt['grains.filter_by']({
'Ubuntu': { 'Ubuntu': {
'pkgrepo': 'deb http://repo.saltstack.com/apt/' + 'pkgrepo': 'deb http://repo.saltstack.com/apt/' +
salt['grains.get']('os')|lower + '/' + osrelease + '/amd64/latest ' + salt['grains.get']('oscodename') + ' main',
'key_url': 'https://repo.saltstack.com/apt/' + salt['grains.get']('os')|lower + '/' + osrelease + '/amd64/latest/SALTSTACK-GPG-KEY.pub',
salt['grains.get']('os')|lower + '/' + osrelease + '/amd64/' + salt_release + ' ' + salt['grains.get']('oscodename') + ' main',
'key_url': 'https://repo.saltstack.com/apt/' + salt['grains.get']('os')|lower + '/' + osrelease + '/amd64/' + salt_release + '/SALTSTACK-GPG-KEY.pub',
'pygit2': 'python-pygit2', 'pygit2': 'python-pygit2',
'gitfs': { 'gitfs': {
'pygit2': { 'pygit2': {
}, },
'Raspbian': { 'Raspbian': {
'pkgrepo': 'deb http://repo.saltstack.com/apt/' + 'pkgrepo': 'deb http://repo.saltstack.com/apt/' +
salt['grains.get']('os_family')|lower + '/' + salt['grains.get']('osmajorrelease', osrelease) + '/armhf/latest ' + salt['grains.get']('oscodename') + ' main',
'key_url': 'https://repo.saltstack.com/apt/' + salt['grains.get']('os_family')|lower + '/' + salt['grains.get']('osmajorrelease', osrelease) + '/armhf/latest/SALTSTACK-GPG-KEY.pub',
salt['grains.get']('os_family')|lower + '/' + salt['grains.get']('osmajorrelease', osrelease) + '/armhf/' + salt_release + ' ' + salt['grains.get']('oscodename') + ' main',
'key_url': 'https://repo.saltstack.com/apt/' + salt['grains.get']('os_family')|lower + '/' + salt['grains.get']('osmajorrelease', osrelease) + '/armhf/' + salt_release + '/SALTSTACK-GPG-KEY.pub',
}, },
'SmartOS': { 'SmartOS': {
'salt_master': 'salt', 'salt_master': 'salt',

+ 2
- 2
salt/pkgrepo/redhat/init.sls Näytä tiedosto

saltstack-pkgrepo: saltstack-pkgrepo:
pkgrepo.managed: pkgrepo.managed:
- humanname: SaltStack repo for RHEL/CentOS $releasever - humanname: SaltStack repo for RHEL/CentOS $releasever
- baseurl: https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest
- baseurl: {{ salt_settings.pkgrepo }}
- enabled: 1 - enabled: 1
- gpgcheck: 1 - gpgcheck: 1
- gpgkey: https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest/SALTSTACK-GPG-KEY.pub
- gpgkey: {{ salt_settings.key_url }}

Loading…
Peruuta
Tallenna