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

Make Debian use pkgrepo.managed #191

Merged
merged 1 commit into from
Dec 5, 2015
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
4 changes: 3 additions & 1 deletion salt/map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
{## Start with defaults from defaults.yaml ##}
{% import_yaml "salt/defaults.yaml" as default_settings %}

{##
{##
Setup variable using grains['os_family'] based logic, only add key:values here
that differ from whats in defaults.yaml
##}
{% set os_family_map = salt['grains.filter_by']({
'Debian': {
'pkgrepo': 'deb http://debian.saltstack.com/debian ' + salt['grains.get']('oscodename') + '-saltstack main',
'key_url': 'salt://' + slspath + '/saltstack.gpg',
'libgit2': 'libgit2-22',
'gitfs': {
'pygit2': {
Expand Down
4 changes: 4 additions & 0 deletions salt/pkgrepo/debian/absent.sls
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{% from "salt/map.jinja" import salt_settings with context %}

drop-saltstack-pkgrepo:
pkgrepo.absent:
- name: {{ salt_settings.pkgrepo }}
file.absent:
- name: /etc/apt/sources.list.d/saltstack.list

Expand Down
22 changes: 6 additions & 16 deletions salt/pkgrepo/debian/init.sls
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
saltstack-apt-key:
file.managed:
- name: /etc/apt/trusted.gpg.d/saltstack.gpg
- source: salt://{{ slspath }}/saltstack.gpg
- user: root
- group: root
- mode: 644
{% from "salt/map.jinja" import salt_settings with context %}

saltstack-pkgrepo:
file.managed:
- name: /etc/apt/sources.list.d/saltstack.list
- source: salt://{{ slspath }}/sources.list
- user: root
- group: root
- mode: 644
- template: jinja
- require:
- file: saltstack-apt-key
pkgrepo.managed:
- humanname: SaltStack Debian Repo
- name: {{ salt_settings.pkgrepo }}
- file: /etc/apt/sources.list.d/saltstack.list
- key_url: {{ salt_settings.key_url }}
# Order: 1 because we can't put a require_in on "pkg: salt-{master,minion}"
# because we don't know if they are used.
- order: 1
2 changes: 0 additions & 2 deletions salt/pkgrepo/debian/sources.list

This file was deleted.