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

Add new “salt.pkgrepo” state #75

Merged
merged 1 commit into from Dec 22, 2014
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.rst
Expand Up @@ -47,6 +47,20 @@ Configure pillar data under salt:ssh_roster to feed the template.
Install a minion and configure it in `standalone mode
<docs.saltstack.com/en/latest/topics/tutorials/standalone_minion.html>`_.

``salt.pkgrepo``
----------------

Enable the official saltstack package repository in order to always
benefit from the latest version. This state currently only works on Debian
and Ubuntu, and aims to implement the `installation recommendations of the
official documentation
<http://docs.saltstack.com/en/latest/topics/installation/index.html#platform-specific-installation-instructions>`_.

``salt.pkgrepo.absent``
-----------------------

Undo the effects of ``salt.pkgrepo``.

``Configuration``
=================
Every option available in the templates can be set in pillar. Settings under 'salt' will be overridden by more specific settings under ``salt['master']``, ``salt['minion']`` or ``salt['cloud']``
Expand Down
2 changes: 2 additions & 0 deletions salt/pkgrepo/absent.sls
@@ -0,0 +1,2 @@
include:
- .{{ grains['os']|lower }}.absent
7 changes: 7 additions & 0 deletions salt/pkgrepo/debian/absent.sls
@@ -0,0 +1,7 @@
drop-saltstack-pkgrepo:
file.absent:
- name: /etc/apt/sources.list.d/saltstack.list

drop-saltstack-apt-key:
file.absent:
- name: /etc/apt/trusted.gpg.d/saltstack.gpg
21 changes: 21 additions & 0 deletions salt/pkgrepo/debian/init.sls
@@ -0,0 +1,21 @@
saltstack-apt-key:
file.managed:
- name: /etc/apt/trusted.gpg.d/saltstack.gpg
- source: salt://salt/pkgrepo/debian/saltstack.gpg
- user: root
- group: root
- mode: 644

saltstack-pkgrepo:
file.managed:
- name: /etc/apt/sources.list.d/saltstack.list
- source: salt://salt/pkgrepo/debian/sources.list
- user: root
- group: root
- mode: 644
- template: jinja
- require:
- file: saltstack-apt-key
# 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
Binary file added salt/pkgrepo/debian/saltstack.gpg
Binary file not shown.
2 changes: 2 additions & 0 deletions salt/pkgrepo/debian/sources.list
@@ -0,0 +1,2 @@
# saltstack
deb http://debian.saltstack.com/debian {{ grains['oscodename'] }}-saltstack main
2 changes: 2 additions & 0 deletions salt/pkgrepo/init.sls
@@ -0,0 +1,2 @@
include:
- .{{ grains['os']|lower }}
3 changes: 3 additions & 0 deletions salt/pkgrepo/ubuntu/absent.sls
@@ -0,0 +1,3 @@
drop-saltstack-pkgrepo:
pkgrepo.absent:
- ppa: saltstack/salt
3 changes: 3 additions & 0 deletions salt/pkgrepo/ubuntu/init.sls
@@ -0,0 +1,3 @@
saltstack-pkgrepo:
pkgrepo.managed:
- ppa: saltstack/salt