Re: apt

56 views
Skip to first unread message

Jeff Schroeder

unread,
Mar 24, 2012, 10:11:37 PM3/24/12
to Andres Douglas, jeffsc...@computer.org, salt-...@googlegroups.com
Hi Andres, I copied that gist from one of our community members. If I recall, his github username is fatbox as is his nickname on IRC.

I do not have the apt state that gist reference but he might if you can track him down.

Sent from my iPhone

On Mar 24, 2012, at 15:26, Andres Douglas <andres....@gmail.com> wrote:

Hey Jeff,

Hope you're having a good weekend. I've been playing with Salt a bit more, as promised. It's surprising how easy it is to get it running. Chef took me a few days just to get a server running. 

I did run into a problem using your gist for custom repos:

# salt '*' state.highstate
ubuntu-11.10-server-amd64:
    Data failed to compile:
----------
    Specified SLS apt in environment base is not available on the salt master

Looks like it's not finding the apt sls referenced in the include in line 1 of the gist. Where can I get my hands on it?

Thanks for your help so far,

Andres

-- 
Andres Douglas | @AndresDouglas | blog |  
Download Bakodo Pro for your iPhone

David Bishop

unread,
Mar 24, 2012, 10:19:11 PM3/24/12
to salt-...@googlegroups.com, Andres Douglas, jeffsc...@computer.org
Hope this helps. Note it requires 0.9.8 - the watch_in syntax is brand new. Also, you'll obviously have to replace the key names with your own keys (unless you happen to also have keys called 'fatbox' and 'debian-david', which would be weird).

apt/init.sls: 
apt:
  pkg:
    - latest

dselect:
  pkg:
    - latest

apt-update:                                                                                                                                                                       
  cmd:                                                                                                                                                                            
    - wait                                                                                                                                                                         
    - name: /usr/bin/apt-get update   



fatbox/apt.sls: 
include:
  - apt

# our custom sources
/etc/apt/sources.list.d/fatbox.list:
  file:
    - managed
    - owner: root
    - group: root
    - mode: 644
    - watch_in:
        - cmd: apt-update

# and the key to go with it
{% for key in 'fatbox','debian-david' %}

/etc/apt/{{ key }}.key:
  file:
    - managed
    - source: salt://fatbox/debian/apt/{{ key }}.key
    - owner: root
    - group: root
    - mode: 644

apt-add-{{ key }}-key:
  cmd:
    - wait
    - name: apt-key add /etc/apt/{{ key }}.key
    - watch:
      - file: /etc/apt/{{ key }}.key
    - watch_in:
        - cmd: apt-update

{% endfor %}

Jeff Schroeder

unread,
Mar 24, 2012, 10:21:57 PM3/24/12
to David Bishop, salt-...@googlegroups.com, Andres Douglas, jeffsc...@computer.org
Thanks David

Sent from my iPhone

Andres Douglas

unread,
Mar 28, 2012, 5:22:08 PM3/28/12
to salt-...@googlegroups.com, David Bishop, jeffsc...@computer.org
Looks like it didn't accept my previous reply pre-joining the group. Thanks guys, that worked perfectly.
Reply all
Reply to author
Forward
0 new messages