Skip to content

Commit

Permalink
Merge pull request #397 from myii/PR_364-py3
Browse files Browse the repository at this point in the history
Fix `repo.saltstack.com` URLs for Python 3 packages (#364)
  • Loading branch information
aboe76 authored Feb 1, 2019
2 parents 698085f + f7be659 commit 5eee4c6
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 11 deletions.
4 changes: 4 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ salt:
# This state will remove "/etc/salt/master" when you set this to true.
master_remove_config: True

# Set this to 'py3' to install the Python 3 packages.
# If this is not set, the Python 2 packages will be installed by default.
py_ver: 'py3'

# Set this to False to not have the formula install packages (in the case you
# install Salt via git/pip/etc.)
install_packages: True
Expand Down
12 changes: 8 additions & 4 deletions salt/osfamilymap.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml

{% import_yaml "salt/ospyvermap.yaml" as ospyvermap %}
{% set ospyver = salt['grains.filter_by'](ospyvermap, grain='os_family') or {} %}
{% set py_ver_dir = salt['pillar.filter_by'](ospyver, pillar='salt:py_ver', default='py2') %}

{% set osrelease = salt['grains.get']('osrelease') %}
{% set salt_release = salt['pillar.get']('salt:release', 'latest') %}
{% if salt_release.split('.')|length >= 3 %}
Expand All @@ -11,8 +15,8 @@
{% set oscodename = salt['grains.get']('oscodename') %}

Debian:
pkgrepo: 'deb http://repo.saltstack.com/apt/{{ os_lower }}/{{ osmajorrelease }}/amd64/{{ salt_release }} {{ oscodename }} main'
key_url: 'https://repo.saltstack.com/apt/{{ os_lower }}/{{ osmajorrelease }}/amd64/{{ salt_release }}/SALTSTACK-GPG-KEY.pub'
pkgrepo: 'deb http://repo.saltstack.com/{{ py_ver_dir }}/{{ os_lower }}/{{ osmajorrelease }}/amd64/{{ salt_release }} {{ oscodename }} main'
key_url: 'https://repo.saltstack.com/{{ py_ver_dir }}/{{ os_lower }}/{{ osmajorrelease }}/amd64/{{ salt_release }}/SALTSTACK-GPG-KEY.pub'
libgit2: libgit2-22
pyinotify: python-pyinotify
gitfs:
Expand All @@ -26,8 +30,8 @@ Debian:
install_from_source: False

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'
pkgrepo: 'https://repo.saltstack.com/{{ py_ver_dir }}/redhat/$releasever/$basearch/{{ salt_release }}'
key_url: 'https://repo.saltstack.com/{{ py_ver_dir }}/redhat/$releasever/$basearch/{{ salt_release }}/SALTSTACK-GPG-KEY.pub'
pygit2: python-pygit2
python_git: GitPython
gitfs:
Expand Down
15 changes: 8 additions & 7 deletions salt/osmap.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml

{% import_yaml "salt/ospyvermap.yaml" as ospyvermap %}
{% set ospyver = salt['grains.filter_by'](ospyvermap, grain='os_family') or {} %}
{% set py_ver_dir = salt['pillar.filter_by'](ospyver, pillar='salt:py_ver', default='py2') %}

{% set osrelease = salt['grains.get']('osrelease') %}
{% set salt_release = salt['pillar.get']('salt:release', 'latest') %}
{% if salt_release.split('.')|length >= 3 %}
Expand All @@ -14,8 +18,8 @@ Fedora:
pygit2: python2-pygit2

Ubuntu:
pkgrepo: 'deb http://repo.saltstack.com/apt/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }} {{ oscodename }} main'
key_url: 'https://repo.saltstack.com/apt/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }}/SALTSTACK-GPG-KEY.pub'
pkgrepo: 'deb http://repo.saltstack.com/{{ py_ver_dir }}/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }} {{ oscodename }} main'
key_url: 'https://repo.saltstack.com/{{ py_ver_dir }}/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }}/SALTSTACK-GPG-KEY.pub'
pygit2: python-pygit2
gitfs:
pygit2:
Expand All @@ -25,8 +29,8 @@ Ubuntu:
install_from_package: Null

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

SmartOS:
salt_master: salt
Expand All @@ -45,6 +49,3 @@ SmartOS:
config_path: /opt/local/etc/salt
master:
gitfs_provider: dulwich



30 changes: 30 additions & 0 deletions salt/ospyvermap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml

Debian:
py2: 'apt'
py3: 'py3'

RedHat:
py2: 'yum'
py3: 'py3'

Suse: {}

Gentoo: {}

Arch: {}

Alpine: {}

FreeBSD: {}

OpenBSD: {}

Windows:
py2: 'Py2'
py3: 'Py3'

MacOS:
py2: 'py2'
py3: 'py3'

0 comments on commit 5eee4c6

Please sign in to comment.