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

Use repo.saltstack.com where appropriate/possible #180

Closed
9 tasks
eliasp opened this issue Oct 9, 2015 · 9 comments
Closed
9 tasks

Use repo.saltstack.com where appropriate/possible #180

eliasp opened this issue Oct 9, 2015 · 9 comments

Comments

@eliasp
Copy link

eliasp commented Oct 9, 2015

Currently, the following distributions/releases are covered by https://repo.saltstack.com:

  • Debian
    • Jessie (8)
  • Ubuntu
    • Precise Pangolin (12.04)
    • Trusty Tahr (14.04)
  • RHEL/CentOS
    • RHEL/CentOS 5
    • RHEL/CentOS 6
    • RHEL/CentOS 7

salt.pkgrepo should make use of repo.saltstack.com where appropriate/possible.

I might take care of providing a PR for Ubuntu. Can't promise yet to add support for other distributions as well.

@TheBigBear
Copy link

+1

rhertzog added a commit to rhertzog/salt-formula that referenced this issue Jun 20, 2016
repo.saltstack.com handles all currently supported Debian releases as well
as all supported Ubuntu releases so this change should be fine.

Part of saltstack-formulas#180.
@rhertzog
Copy link
Contributor

Once #234 is merged you should be able to cross the Debian and Ubuntu items in the todo list. Note that Debian 7 Wheezy is available on repo.saltstack.com as well.

rhertzog added a commit that referenced this issue Jun 20, 2016
repo.saltstack.com handles all currently supported Debian releases as well
as all supported Ubuntu releases so this change should be fine.

Part of #180.
@jbouse
Copy link
Contributor

jbouse commented Aug 13, 2016

Currently the salt-formula does not properly work on a Raspberry Pi running Raspbian...

  • First issue is that the salt.pkgrepo state tries to include salt.pkgrepo.raspbian because grains['os'] returns Rasbian but grains['os_family'] returns Debian. This was easily overcome in some crude testing by symlinking salt/pkgrepo/debian as salt/pkgrepo/raspbian but that lead to the second issue.
  • Second issue is that the salt/map.jinja hard codes the 'amd64' arch into the pkgrepo setting value rather than using grains['osarch'] which returns the appropriate 'armhr'.

Adding the symlink along with the following patch appears to work for Debian and Raspbian but would obviously break for Ubuntu systems that are also Debian os_family.

diff --git a/salt/map.jinja b/salt/map.jinja
index 2da0b0b..8cdccd0 100644
--- a/salt/map.jinja
+++ b/salt/map.jinja
@@ -12,8 +12,8 @@ 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',
-      '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_family')|lower + '/' + salt['grains.get']('osmajorrelease', osrelease) + '/' + salt['grains.get']('osarch') + '/latest ' + salt['grains.get']('oscodename') + ' main',
+      'key_url': 'https://repo.saltstack.com/apt/' + salt['grains.get']('os_family')|lower + '/' + salt['grains.get']('osmajorrelease', osrelease) + '/' + salt['grains.get']('osarch') + '/latest/SALTSTACK-GPG-KEY.pub',
       'libgit2': 'libgit2-22',
       'gitfs': {
         'pygit2': {

@wwentland
Copy link
Contributor

@jbouse thank you. Could you open a PR for the grains['osarch'] fix? That would be most appreciated!

@jbouse
Copy link
Contributor

jbouse commented Aug 13, 2016

@BABILEN Yeah, I'm fine putting a PR in... I want to find a solution that doesn't break Ubuntu while fixing for Rasbian. As soon as I do that I'll get the PR submitted from my fork.

@rhertzog
Copy link
Contributor

On Fri, 12 Aug 2016, Jeremy T. Bouse wrote:

  • Second issue is that the salt/map.jinja hard codes the 'amd64' arch
    into the pkgrepo setting value rather than using grains['osarch'] which
    returns the appropriate 'armhr'.

That's because the ubuntu/debian repositories only have "amd64"
directories and no directories for other architectures AFAIR. That's
not a problem because the packages are "Arch: all" and thus can
be used on any architecture.

Cheers,

Raphaël Hertzog ◈ Debian Developer

Support Debian LTS: http://www.freexian.com/services/debian-lts.html
Learn to master Debian: http://debian-handbook.info/get/

@jbouse
Copy link
Contributor

jbouse commented Aug 13, 2016

@rhertzog Yes, the salt package are "Arch: all" but there are "Arch: amd64" dependency packages in the repository which wouldn't work. I think I've figured a better way than my initial patch for map.jinja that doesn't have any adverse effect on Debian/Ubuntu but fixes the pkgrepo/key_url for Rasbian systems.

The remaining piece I'm working on is the salt.pkgrepo include

jbouse added a commit to ugns/salt-formula that referenced this issue Aug 13, 2016
While Rasbian reports back the following grains values:

local:
    ----------
    os:
        Raspbian
    os_family:
        Debian
    osarch:
        armhf

This caused the pkgrepo & key_url settings to be incorrect. Correect
these settings to the appropriate repo.saltstack.com URLs for Raspbian.

Part of saltstack-formulas#180
@jbouse
Copy link
Contributor

jbouse commented Aug 13, 2016

Got the PR submitted which currently corrects the pkgrepo and key_url values to match documented URLs for repo.saltstack.com for Raspbian... I still haven't found a more elegant way than to symlink the salt/pkgrepo/debian as salt/pkgrepo/raspbian... My attempts at tweaks to the salt/pkgrepo/init.sls have all failed at this point so far.

jbouse added a commit to ugns/salt-formula that referenced this issue Aug 13, 2016
Rasbian reports back the following grain values:

local:
    ----------
    os:
        Raspbian
    os_family:
        Debian
    osarch:
        armhf
    osmajorrelease:
        8
    osrelease:
        8.0

Ubuntu reports back the following grain values:

local:
    ----------
    os:
        Ubuntu
    os_family:
        Debian
    osarch:
        amd64
    osmajorrelease:
        14
    osrelease:
        14.04

For Raspbian the osarch needed to be changed from other Debain os_family
distributions.
For Ubuntu the osrelease value is needed instead of osmajorrelease as other
Debian os_family distributions.

Part of saltstack-formulas#180
@jbouse
Copy link
Contributor

jbouse commented Aug 13, 2016

I believe I got a solid solution and it also improves/fixes Ubuntu as well. I believe the salt/pkgrepo/ubuntu/ is actually no longer needed now as well but I left it alone.

@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

6 participants