update pkgmgr example

This commit is contained in:
Andrew Hammond 2013-03-08 13:32:21 -08:00
parent cd72c8a8d1
commit fc8d90f3c8
2 changed files with 28 additions and 0 deletions

View File

@ -10,6 +10,24 @@ declarations are typically rather simple:
vim:
pkg.installed
A more involved example involves pulling from a custom repository.
Note that the pkgrepo has a require_in clause.
This is necessary and can not be replaced by a require clause in the pkg.
.. code-block:: yaml
pkgrepo.managed:
- human_name: Logstash PPA
- name: deb http://ppa.launchpad.net/wolfnet/logstash/ubuntu precise main
- dist: precise
- file: /etc/apt/sources.list.d/logstash.list
- keyid: 28B04E4A
- keyserver: keyserver.ubuntu.com
- require_in:
- pkg: logstash
logstash:
pkg.installed
'''
# Import python libs

View File

@ -24,6 +24,12 @@ Package repositories can be managed with the pkgrepo state:
- file: /etc/apt/sources.list.d/logstash.list
- keyid: 28B04E4A
- keyserver: keyserver.ubuntu.com
- require_in:
- pkg: logstash
pkg.latest:
- name: logstash
- refresh: True
'''
@ -116,6 +122,10 @@ def managed(name, **kwargs):
file. The consolidate will run every time the state is processed. The
option only needs to be set on one repo managed by salt to take effect.
require_in
Set this to a list of pkg.installed or pkg.lastest to trigger the running
of apt-get update prior to attempting to install these packages.
Setting a require in the pkg will not work for this.
'''
ret = {'name': name,
'changes': {},