Skip to content

Commit 5eee4c6

Browse files
authored
Merge pull request #397 from myii/PR_364-py3
Fix `repo.saltstack.com` URLs for Python 3 packages (#364)
2 parents 698085f + f7be659 commit 5eee4c6

File tree

4 files changed

+50
-11
lines changed

4 files changed

+50
-11
lines changed

pillar.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ salt:
1010
# This state will remove "/etc/salt/master" when you set this to true.
1111
master_remove_config: True
1212

13+
# Set this to 'py3' to install the Python 3 packages.
14+
# If this is not set, the Python 2 packages will be installed by default.
15+
py_ver: 'py3'
16+
1317
# Set this to False to not have the formula install packages (in the case you
1418
# install Salt via git/pip/etc.)
1519
install_packages: True

salt/osfamilymap.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# -*- coding: utf-8 -*-
22
# vim: ft=yaml
33

4+
{% import_yaml "salt/ospyvermap.yaml" as ospyvermap %}
5+
{% set ospyver = salt['grains.filter_by'](ospyvermap, grain='os_family') or {} %}
6+
{% set py_ver_dir = salt['pillar.filter_by'](ospyver, pillar='salt:py_ver', default='py2') %}
7+
48
{% set osrelease = salt['grains.get']('osrelease') %}
59
{% set salt_release = salt['pillar.get']('salt:release', 'latest') %}
610
{% if salt_release.split('.')|length >= 3 %}
@@ -11,8 +15,8 @@
1115
{% set oscodename = salt['grains.get']('oscodename') %}
1216

1317
Debian:
14-
pkgrepo: 'deb http://repo.saltstack.com/apt/{{ os_lower }}/{{ osmajorrelease }}/amd64/{{ salt_release }} {{ oscodename }} main'
15-
key_url: 'https://repo.saltstack.com/apt/{{ os_lower }}/{{ osmajorrelease }}/amd64/{{ salt_release }}/SALTSTACK-GPG-KEY.pub'
18+
pkgrepo: 'deb http://repo.saltstack.com/{{ py_ver_dir }}/{{ os_lower }}/{{ osmajorrelease }}/amd64/{{ salt_release }} {{ oscodename }} main'
19+
key_url: 'https://repo.saltstack.com/{{ py_ver_dir }}/{{ os_lower }}/{{ osmajorrelease }}/amd64/{{ salt_release }}/SALTSTACK-GPG-KEY.pub'
1620
libgit2: libgit2-22
1721
pyinotify: python-pyinotify
1822
gitfs:
@@ -26,8 +30,8 @@ Debian:
2630
install_from_source: False
2731

2832
RedHat:
29-
pkgrepo: 'https://repo.saltstack.com/yum/redhat/$releasever/$basearch/{{ salt_release }}'
30-
key_url: 'https://repo.saltstack.com/yum/redhat/$releasever/$basearch/{{ salt_release }}/SALTSTACK-GPG-KEY.pub'
33+
pkgrepo: 'https://repo.saltstack.com/{{ py_ver_dir }}/redhat/$releasever/$basearch/{{ salt_release }}'
34+
key_url: 'https://repo.saltstack.com/{{ py_ver_dir }}/redhat/$releasever/$basearch/{{ salt_release }}/SALTSTACK-GPG-KEY.pub'
3135
pygit2: python-pygit2
3236
python_git: GitPython
3337
gitfs:

salt/osmap.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# -*- coding: utf-8 -*-
22
# vim: ft=yaml
33

4+
{% import_yaml "salt/ospyvermap.yaml" as ospyvermap %}
5+
{% set ospyver = salt['grains.filter_by'](ospyvermap, grain='os_family') or {} %}
6+
{% set py_ver_dir = salt['pillar.filter_by'](ospyver, pillar='salt:py_ver', default='py2') %}
7+
48
{% set osrelease = salt['grains.get']('osrelease') %}
59
{% set salt_release = salt['pillar.get']('salt:release', 'latest') %}
610
{% if salt_release.split('.')|length >= 3 %}
@@ -14,8 +18,8 @@ Fedora:
1418
pygit2: python2-pygit2
1519

1620
Ubuntu:
17-
pkgrepo: 'deb http://repo.saltstack.com/apt/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }} {{ oscodename }} main'
18-
key_url: 'https://repo.saltstack.com/apt/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }}/SALTSTACK-GPG-KEY.pub'
21+
pkgrepo: 'deb http://repo.saltstack.com/{{ py_ver_dir }}/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }} {{ oscodename }} main'
22+
key_url: 'https://repo.saltstack.com/{{ py_ver_dir }}/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }}/SALTSTACK-GPG-KEY.pub'
1923
pygit2: python-pygit2
2024
gitfs:
2125
pygit2:
@@ -25,8 +29,8 @@ Ubuntu:
2529
install_from_package: Null
2630

2731
Raspbian:
28-
pkgrepo: 'deb http://repo.saltstack.com/apt/{{ os_lower }}/{{ osmajorrelease }}/armhf/{{ salt_release }} {{ oscodename }} main'
29-
key_url: 'https://repo.saltstack.com/apt/{{ os_lower }}/{{ osmajorrelease }}/armhf/{{ salt_release }}/SALTSTACK-GPG-KEY.pub'
32+
pkgrepo: 'deb http://repo.saltstack.com/{{ py_ver_dir }}/{{ os_lower }}/{{ osmajorrelease }}/armhf/{{ salt_release }} {{ oscodename }} main'
33+
key_url: 'https://repo.saltstack.com/{{ py_ver_dir }}/{{ os_lower }}/{{ osmajorrelease }}/armhf/{{ salt_release }}/SALTSTACK-GPG-KEY.pub'
3034

3135
SmartOS:
3236
salt_master: salt
@@ -45,6 +49,3 @@ SmartOS:
4549
config_path: /opt/local/etc/salt
4650
master:
4751
gitfs_provider: dulwich
48-
49-
50-

salt/ospyvermap.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
4+
Debian:
5+
py2: 'apt'
6+
py3: 'py3'
7+
8+
RedHat:
9+
py2: 'yum'
10+
py3: 'py3'
11+
12+
Suse: {}
13+
14+
Gentoo: {}
15+
16+
Arch: {}
17+
18+
Alpine: {}
19+
20+
FreeBSD: {}
21+
22+
OpenBSD: {}
23+
24+
Windows:
25+
py2: 'Py2'
26+
py3: 'Py3'
27+
28+
MacOS:
29+
py2: 'py2'
30+
py3: 'py3'

0 commit comments

Comments
 (0)