Adding a PPA to minions

637 views
Skip to first unread message

Brett Glasson

unread,
Apr 8, 2015, 2:17:25 AM4/8/15
to salt-...@googlegroups.com
Hi all

I have been playing around a bit with salt after I broke up with puppet and I must say I'm finding it a lot less frustrating. So far I have gotten to the stage where I can get most things working but I have reached an impasse that has me stumped.

The master and minions os are both Linux Mint 17.1 which uses the ubuntu trusty repository for 95% of its stuff.

I am trying to add a package which requires a launchpad ppa, specifically "Kodi" (formerly xbox media center / xbmc)

Looking at the salt documentation it seems a simple enough procedure:

I added this entry to a common.sls file that is already used to install a bunch of stuff from the standard repository using the details from the kodi website

kodi: 
  pkgrepo.managed:
    - ppa: team-xbmc/ppa
 

When I try to push to the minion it fails:

    State: - pkgrepo
    Name:      kodi
    Function:  managed
        Result:    False
        Comment:   Failed to confirm config of repo 'kodi': repo 'kodi' was not found


OK, so the example given in the documentation is in the "base" section, so I put lines 2 and 3 in the base section of top.sls instead

This time there is no error but it doesn't actually do anything (there is no ppa file added to /etc/apt/sources.list.d)

The documentation also has some extra lines that relate to actually installing the package so I add those for completeness sake. My top.sls now looks like this:

base:
  '*':
    - common

  pkgrepo.managed:
    - ppa: team-xbmc/ppa
  pkg.latest:
    - name: kodi
    - refresh: True

Again, no error, but nothing happens, no ppa, no kodi package is installed.

There is clearly something I am missing here.

So, I notice there is an alternate method of adding a ppa which involves creating a ppa file containing the url, specifying the key and key server etc. I decide to give that method a go:

This is what I added to my common.sls file:

kodi:
  pkgrepo.managed:
    - name: deb http://ppa.launchpad.net/team-xbmc/ppa/ubuntu trusty main
    - dist: trusty
    - file: /etc/apt/sources.list.d/team-xbmc-ppa-trusty.list
    - ppa: team-xbmc/ppa
    - key: 91E7EE5E
    - keyserver: keyserver.ubuntu.com 
    - require_in:
      - pkg: kodi

I got that data from the kodi website and also confirmed it another host that already had kodi installed.

When I push that change there are no errors and when I check for the ppa it has been added to sources.list.d. Yay

However when I run apt-get update on the minion I geet this error:

apt-get update
E: Type 'kodi' is not known on line 2 in source list /etc/apt/sources.list
E: The list of sources could not be read.

Hmmm, I edit the file and there is a single word "kodi" in there. Further experimentation revealed that this line was added during my attempts to get the first method to work. I removed that line and tried again.

This time it "worked" but had a gpg key error at the end.

W: GPG error: http://ppa.launchpad.net trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6D975C4791E7EE5E

For some reason it has not downloaded the key correctly. I have checked and double checked (kodi website and the manually configured working host) and the key is the correct one (caveat, see below).

If I do apt-key list on the working host it shows the key like this:

pub   1024R/91E7EE5E 2009-01-20
uid                  Launchpad PPA for XBMC for Linux

(This also corresponds to the key shown on the kodi website). Originally I had stripped the first part off but I added it back and tried again with the same result.

Also, I note that the key shown in the error is also a longer string so I put that in as well, same result.

I really can't figure out what I'm doing wrong. It seems like it should be pretty straight forward.

Any clues much appreciated.




Bruce Wang

unread,
Apr 8, 2015, 7:01:51 AM4/8/15
to salt-...@googlegroups.com
The following: 

On Wed, Apr 8, 2015 at 4:17 PM, Brett Glasson <brett....@gmail.com> wrote:
kodi:
  pkgrepo.managed:
    - name: deb http://ppa.launchpad.net/team-xbmc/ppa/ubuntu trusty main
    - dist: trusty
    - file: /etc/apt/sources.list.d/team-xbmc-ppa-trusty.list
    - ppa: team-xbmc/ppa
    - key: 91E7EE5E
    - keyserver: keyserver.ubuntu.com 
    - require_in:
      - pkg: kodi

should be (you can't use ppa: at same time with details in name:) 

kodi:
  pkgrepo.managed:
    - name: deb http://ppa.launchpad.net/team-xbmc/ppa/ubuntu trusty main
    - dist: trusty
    - file: /etc/apt/sources.list.d/team-xbmc-ppa-trusty.list
    - key: 91E7EE5E
    - keyserver: keyserver.ubuntu.com 
    - require_in:
      - pkg: kodi


Brett Glasson

unread,
Apr 8, 2015, 7:23:59 PM4/8/15
to salt-...@googlegroups.com, br...@brucewang.net
Thanks for that Bruce. Sorry about the delay I am in Australia so there are time zone differences. 

Anyhow, that extra line was my mistake. I originally tried it as you suggested (as per the documentation) and when that did not work I went into "clutching at straws mode" and added the ppa line from the first method. I then forgot to remove it when I pasted the code into here. Suffice to say it still doesn't work like that. There must be something I am not properly understanding here.

Brett Glasson

unread,
Apr 9, 2015, 12:22:38 AM4/9/15
to salt-...@googlegroups.com
OK, I have made some progress. I decided to try and configure the "logstash" ppa that is used in the example on the SaltStack documentation and had no more luck there than with kodi. 

I then hit google again and started trawling through the results beyond page 2 and eventually stumbled on another server hosting Salt documentation located in China. The page was in english however. Anyway on that page there was another directive mentioned that I hadn't seen on the main doc pages. It was called key_url

So I modified my configuration to be like this:

logstash:
  pkgrepo.managed:
    - dist: stable
    - file: /etc/apt/sources.list.d/logstash-ppa.list
    - keyserver: keyserver.ubuntu.com

Now the ppa is added properly and the key is added to the apt keyring correctly. Note: I am not sure whether the "keyserver" line in my example is still required. I would expect not as we are explicitly providing the URL to the GPG key now so it would seem superfluous.

Anyway, it appears that the documentation on the main Salt website is just plain wrong because the examples given do not work.

Patrick

unread,
Apr 9, 2015, 2:47:16 AM4/9/15
to salt-...@googlegroups.com
Bare in mind PPA's and plain repo's are different. For a ppa (i.e. launchpad ppa), give this a whirl (of course modify for your own PPA). It should handle the required bits. 

This is from : https://launchpad.net/~saltstack/+archive/ubuntu/salt (looking at the ppa, you can see the saltstack/salt bit)

saltstack-ppa:
    pkgrepo.managed:
        - ppa: saltstack/salt
        - refresh_db: true
        - require:
            - pkg: software-properties

software-properties:
    pkg.latest:
        - pkgs:
            - software-properties-common
            - python-software-properties


Patrick
----------------------------------------
patrick <at> eefy <dot> net

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brett Glasson

unread,
Apr 9, 2015, 2:55:26 AM4/9/15
to salt-...@googlegroups.com
Hi Patrick, that is pretty much the first thing I tried because a similar example is included in the Salt documentation. Unfortunately it doesn't seem to actually work like that. All this did was to simply place the name of the ppa (in your example that would be "saltstack-ppa") into the main sources.list file without any other details. My sources list literally contained a line like this:

saltstack-ppa

What did work was using the first ppa example from the documentation and adding the key_url directive which is not mentioned in the main documentation anywhere that I can see. Perhaps the documentation is out of date or something.



On Wednesday, April 8, 2015 at 4:17:25 PM UTC+10, Brett Glasson wrote:

Patrick Ancillotti

unread,
Apr 9, 2015, 9:36:23 AM4/9/15
to salt-...@googlegroups.com
Hi Brett,

So I didn't pull that from the documentation, but rather our own repo at work, so I know it works. What version of salt are you using? 

_____________________________
From: Brett Glasson <brett....@gmail.com>
Sent: Thursday, April 9, 2015 12:55 AM
Subject: [salt-users] Re: Adding a PPA to minions
To: <salt-...@googlegroups.com>

German Gutierrez

unread,
Apr 9, 2015, 12:43:32 PM4/9/15
to salt-...@googlegroups.com
Brett,
        I noted that you used the same name for the package and the repo in your sls, dunno if that's OK, I try not to mess with that, my ppa below is "nginx_stable_ppa" and it worked right away, never had problems with ppa and saltstack.

nginx_stable_ppa:
    pkgrepo.managed:
        - ppa: nginx/stable
        - require_in:
            - pkg: nginx

nginx:
  pkg:
    - installed
  service:
    - running
    - enable: True
    - reload: True
    - watch:
      - pkg: nginx
      - file: /etc/nginx/nginx.conf
      - file: /etc/nginx/sites-enabled/*
      - file: /etc/nginx/sites-available/*


--
Regards,
German

Brett Glasson

unread,
Apr 9, 2015, 6:38:28 PM4/9/15
to salt-...@googlegroups.com
I'm using the version of salt from the Ubuntu trusty repository which is 0.17.5. Perhaps I should use the SaltStack repository version instead?

Bruce Wang

unread,
Apr 9, 2015, 7:00:20 PM4/9/15
to salt-...@googlegroups.com
0.17.5 is way too old (facepalm) no wonder everything is mismatched.

Try use current stable version, which is 2014.7.2 (or maybe 2014.7.4 if that got released)

On Fri, Apr 10, 2015 at 8:38 AM, Brett Glasson <brett....@gmail.com> wrote:
I'm using the version of salt from the Ubuntu trusty repository which is 0.17.5. Perhaps I should use the SaltStack repository version instead?

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Patrick

unread,
Apr 9, 2015, 7:03:07 PM4/9/15
to salt-...@googlegroups.com
What Bruce said. For that matter though, you can pull the deb down, and install it from the above mentioned PPA :) You likely will now face a fair amount less of the 'oddities' that came with running an older version! 

Patrick
----------------------------------------
patrick <at> eefy <dot> net

Brett Glasson

unread,
Apr 9, 2015, 7:11:43 PM4/9/15
to salt-...@googlegroups.com
Hi German

I literally pasted your example code into my setup and got the same error as before:

    State: - pkgrepo
    Name:      nginx_stable_ppa
    Function:  managed
        Result:    False
        Comment:   Failed to confirm config of repo 'nginx_stable_ppa': repo 'nginx_stable_ppa' was not found

As I said earlier, I did manage to get this working but I'm still confused as to why my setup fails where everybody else's seems to work OK. I am going to try using the official packages instead of the Ubuntu provided ones and see if that makes a difference.

Oh, and thanks or your help as well!

On Wednesday, April 8, 2015 at 4:17:25 PM UTC+10, Brett Glasson wrote:

Brett Glasson

unread,
Apr 9, 2015, 10:31:12 PM4/9/15
to salt-...@googlegroups.com
OK, so I have updated salt on both the minion and master and am now using version 2014.7.2 from the official repo.

I've configured the ppa using the code that Phillip posted:

saltstack-ppa:
  pkgrepo.managed:
    - ppa: saltstack/salt
    - refresh_db: true
    - require:
      - pkg: software-properties

software-properties:
  pkg.latest:
    - pkgs:
      - software-properties-common
      - python-software-properties

I push it to the minion.

This time it has behaved differently as there is no error returned:

ID: saltstack-ppa
    Function: pkgrepo.managed
      Result: True
     Comment: Configured package repo 'saltstack-ppa'
     Started: 12:27:23.285511
    Duration: 220.467 ms
     Changes:   
              ----------
              repo:
                  saltstack-ppa


However the ppa is still not added correctly. Instead the word "saltstack-ppa" is added to /etc/apt/sources.list with no url 

It's very strange. I have no idea what is going on here.

Colton Myers

unread,
Apr 21, 2015, 5:23:08 PM4/21/15
to salt-...@googlegroups.com
Well, now that you've updated to a recent version of salt, I would recommend opening an issue on Github. It may be a strange interaction with Linux Mint or something, I'm not sure.

--
Colton Myers
Platform Engineer, SaltStack
@basepi on Twitter/Github/IRC

--

Brett Glasson

unread,
Apr 27, 2015, 8:10:16 PM4/27/15
to salt-...@googlegroups.com

It looks like somebody has already done that and see what happens once it hits the repo
Reply all
Reply to author
Forward
0 new messages