Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pillar parameter to set the major/minor version of SaltStack repository #293

Closed
kakwa opened this issue Feb 7, 2017 · 12 comments
Closed

Comments

@kakwa
Copy link
Contributor

kakwa commented Feb 7, 2017

Hello,

It would be nice if there was a way to set the version of saltstack, leveraging the already present versioning in the repository:

For example the saltstack debian repositories provide the following versioned URL:

#pin to Major version
deb http://repo.saltstack.com/apt/debian/8/amd64/2016.11 jessie main

#pin to Minor release
deb http://repo.saltstack.com/apt/debian/8/amd64/archive/2016.11.2 jessie main

Adding a pillar and using it in the map.jinja file could do the job. This pillar can default to latest to retain the current behavior.

Example implementation:

salt:
   - release: '2016.11'
--- a/salt/map.jinja
+++ b/salt/map.jinja
@@ -39,7 +39,7 @@ that differ from whats in defaults.yaml
 {% set os_family_map = salt['grains.filter_by']({
     'Debian':  {
       'pkgrepo': 'deb http://repo.saltstack.com/apt/' +
-      salt['grains.get']('os')|lower + '/' + salt['grains.get']('osmajorrelease', osrelease) + '/amd64/latest ' + salt['grains.get']('oscodename') + ' main',
+      salt['grains.get']('os')|lower + '/' + salt['grains.get']('osmajorrelease', osrelease) + '/amd64/' + salt['pillar.get']('salt:release', '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',
       'libgit2': 'libgit2-22',
       'gitfs': {
@@ -138,7 +138,7 @@ that differ from whats in defaults.yaml
   }, merge=salt['grains.filter_by']({
     'Ubuntu':  {
       'pkgrepo': 'deb http://repo.saltstack.com/apt/' +
-      salt['grains.get']('os')|lower + '/' + osrelease + '/amd64/latest ' + salt['grains.get']('oscodename') + ' main',
+      salt['grains.get']('os')|lower + '/' + osrelease + '/amd64/' + salt['pillar.get']('salt:release', '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',
       'pygit2': 'python-pygit2',
       'gitfs': {
@@ -153,7 +153,7 @@ that differ from whats in defaults.yaml
     },
     'Raspbian': {
       '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',
+      salt['grains.get']('os_family')|lower + '/' + salt['grains.get']('osmajorrelease', osrelease) + '/armhf/' + salt['pillar.get']('salt:release', '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',
     },
     'SmartOS': {

This implementation seems to work fine on Debian, but I don't have the infrastructure to test it with other distributions/OSes, and I'm not sure it respects the proper guide lines. I'm only providing it as an example.

@daks
Copy link
Member

daks commented May 23, 2017

I would really like this feature too.

@aboe76
Copy link
Member

aboe76 commented May 24, 2017

could be combined with : #291

@daks
Copy link
Member

daks commented May 24, 2017

@aboe76 seems good for me

@aboe76
Copy link
Member

aboe76 commented May 24, 2017

@kakwa could you make a PR?

@daks
Copy link
Member

daks commented May 26, 2017

@aboe76 isn't #291 already good?

@aboe76
Copy link
Member

aboe76 commented May 26, 2017 via email

@kakwa
Copy link
Contributor Author

kakwa commented May 30, 2017

@aboe76

here is the PR:
#314

It needs some testing before merge, I don't have a testing environment for this.

@aboe76
Copy link
Member

aboe76 commented May 30, 2017

@kakwa I will test it tomorrow.

@partsalliance
Copy link

is this working for anyone? there is no change when i place release: '2016.3' inside my pillar file

@0xf10e
Copy link
Contributor

0xf10e commented Aug 2, 2017

@partsalliance I'm sure I've pinned a subset of my minions to 2016.11 and I didn't pull any PR-branches (like #315) for this… Got to check my pillar.

edit: Couldn't find anything like [salt:release] set in my pillars, may have confused it with setting the pkg version in the zabbix-formula.

@aboe76
Copy link
Member

aboe76 commented Aug 2, 2017

@partsalliance can you give us a redacted pillar file of the salt stuff to better understand your issue?
It should work with something like this:

salt:
  release: 2016.3

@aboe76
Copy link
Member

aboe76 commented Jan 26, 2019

close issue, fixed with #358

@aboe76 aboe76 closed this as completed Jan 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants