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

Standardize pkgrepo usage #250

Merged
merged 2 commits into from
Mar 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis/install_salt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ install_salt () {
# Don't autostart services
printf '#!/bin/sh\nexit 101\n' | sudo install -m 755 /dev/stdin /usr/sbin/policy-rc.d
curl https://repo.saltstack.com/apt/ubuntu/14.04/amd64/archive/2015.5.8/SALTSTACK-GPG-KEY.pub | sudo apt-key add -
printf 'deb http://repo.saltstack.com/apt/ubuntu/14.04/amd64/archive/2015.5.8 trusty main\n' | sudo tee -a /etc/apt/sources.list >/dev/null
printf 'deb http://repo.saltstack.com/apt/ubuntu/14.04/amd64/archive/2015.5.8 trusty main\n' | sudo tee /etc/apt/sources.list.d/saltstack.list >/dev/null
sudo apt-get -y update
sudo apt-get -y install salt-minion=2015.5.8+ds-1
elif [ "${OS_NAME}" = "osx" ]; then
Expand Down
6 changes: 5 additions & 1 deletion longview/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ longview:
- name: 'deb http://apt-longview.linode.com/ trusty main'
- file: /etc/apt/sources.list.d/longview.list
- key_url: https://apt-longview.linode.com/linode.gpg

/etc/apt/sources.list.d/longview.list:
file.exists:
- require:
- pkgrepo: longview
- require_in:
- file: /etc/apt/sources.list.d

16 changes: 16 additions & 0 deletions salt/common.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{% from tpldir ~ '/map.jinja' import salt %}

{% if grains['os'] == 'Ubuntu' %}
salt:
pkgrepo.managed:
- name: 'deb http://repo.saltstack.com/apt/ubuntu/14.04/amd64/archive/{{ salt.version }} trusty main'
- file: /etc/apt/sources.list.d/saltstack.list
- key_url: https://repo.saltstack.com/apt/ubuntu/14.04/amd64/archive/{{ salt.version }}/SALTSTACK_GPG_KEY.pub

/etc/apt/sources.list.d/saltstack.list:
file.exists:
- require:
- pkgrepo: salt
- require_in:
- file: /etc/apt/sources.list.d
{% endif %}
10 changes: 10 additions & 0 deletions salt/map.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{%
set salt = salt.grains.filter_by({
'defaults': {
'version': '2015.5.8'
},
},
base='defaults',
merge=salt.pillar.get('salt', {})
)
%}
21 changes: 13 additions & 8 deletions servo-dependencies.sls
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,26 @@ homebrew-link-openssl:
- require:
- pkg: servo-dependencies
{% else %}
FIX enable multiverse:
pkgrepo.absent:
- name: deb http://archive.ubuntu.com/ubuntu trusty multiverse

enable multiverse:
multiverse:
pkgrepo.managed:
- name: deb http://archive.ubuntu.com/ubuntu trusty multiverse
- name: 'deb http://archive.ubuntu.com/ubuntu trusty multiverse'
- file: /etc/apt/sources.list.d/multiverse.list
- require_in:
- pkg: ttf-mscorefonts-installer

/etc/apt/sources.list.d/multiverse.list:
file.exists:
- require:
- pkgrepo: multiverse
- require_in:
- file: /etc/apt/sources.list.d

ttf-mscorefonts-installer:
debconf.set:
- name: ttf-mscorefonts-installer
- data: { 'msttcorefonts/accepted-mscorefonts-eula': { 'type': 'boolean', 'value': True } }
pkg.installed:
- pkgs:
- ttf-mscorefonts-installer
- requires:
- require:
- debconf: ttf-mscorefonts-installer
{% endif %}
1 change: 1 addition & 0 deletions top.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ base:
'*':
- common
- servo-dependencies
- salt.common

'os:Ubuntu':
- match: grain
Expand Down
10 changes: 6 additions & 4 deletions ubuntu/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
- mode: 755
- source: salt://{{ tpldir }}/files/policy-rc.d

# Workaround for https://github.com/saltstack/salt/issues/26605
# Clean the directory first, and require it in all pkgrepo states
# which add repositories to the sources.list.d folder (instead of
# the main /etc/apt/sources.list file)
# Workaround for https://github.com/saltstack/salt/issues/26605:
# For each pkgrepo state which adds any repositories to the sources.list.d
# folder (instead of the main /etc/apt/sources.list file), create an extra,
# no-op file.exists state which requires the pkgrepo state and require_ins
# this state
/etc/apt/sources.list.d:
file.directory:
- user: root
- group: root
- file_mode: 644
- dir_mode: 755
- recurse:
- user
Expand Down