Commit Graph

4579 Commits

Author SHA1 Message Date
Tom Vaughan
3642ca5e3f Copy grain matcher to create pillar matcher.
First, please see the pillars documentation:
http://salt.readthedocs.org/en/latest/topics/pillar/index.html. Next,
perhaps an example will explain this best...

Let's say you have a `/src/pillar/top.sls` that looks like:

    base:
      'hostname1':
        - production
      'hostname2':
        - development

And a `/srv/pillar/production.sls` that looks like:

    role: production
    countrycode: us

And a `/srv/pillar/development.sls` that looks like:

    role: development
    countrycode: cl

This means that `/srv/salt/top.sls` could now look like:

    base:
      '*':
        - ssh
      'role:production':
        - match: pillar
        - users.production
        - default
        - clojure
      'role:development':
        - match: pillar
        - users.development
        - default.dev
        - clojure.dev

Both `role` and `countrycode` may also be used as a template variable
as explained in the pillar documentation above.

For a real-world example, please see:

 * https://github.com/rentalita/ubuntu-setup
 * https://github.com/rentalita/ubuntu-setup/blob/master/salt/apt/init.sls.
 * https://github.com/rentalita/ubuntu-setup/blob/master/salt/apt/sources.list

This commit also extends the salt command-line client so that it too
may use the pillar matcher, like:

    salt -I 'role:production' test.ping

Documentation and tests are not included in this commit. These will
come in a later commit.

The `pillar_match` routine is simply a copy of the `grain_match`
routine. But I grep'd for the `exsel` matcher to figure out what parts
of the code needed to be touched in order to (hopefully) make this
work. I suppose a pillar pcre matcher could be made just as easily.
2012-05-18 10:20:22 -04:00
Thomas S Hatch
c2c3ef0712 Merge pull request #1295 from sharpone74/develop
Small change in upstart.py service module to correctly report a target service start/stop status.
2012-05-16 22:52:42 -07:00
Justin Sharp
be16c59dfb Change the order of checking ubuntu's service scripts for type (upstart/sysv) when getting status 2012-05-16 23:39:52 -06:00
Thomas S Hatch
a4864f9c80 Add initial compiler tests 2012-05-16 23:00:01 -06:00
Thomas S Hatch
fdf155bbe2 Add interface for testing bad sls data 2012-05-16 22:58:18 -06:00
Thomas S Hatch
76efdd9fb0 Fix bug in tests with aliases 2012-05-16 22:49:19 -06:00
Thomas S Hatch
417a23be72 Merge pull request #1294 from kvelarde/develop
First commit for rabbitmq module
2012-05-16 21:02:56 -07:00
Kurtis Velarde
c9ed68b92a Adding better doc strings and output for list_vhosts 2012-05-16 20:01:07 -07:00
Kurtis Velarde
a4456b5602 Woops forgot to prepend rabbitmqctl to list_users() 2012-05-16 19:17:28 -07:00
Kurtis Velarde
81bca9cbde First commit for rabbitmq module 2012-05-16 17:03:25 -07:00
Thomas S Hatch
f1b086de89 Merge pull request #1287 from padelt/develop
Clarify pillar use for files managed on minions that include pillar key/...
2012-05-16 07:38:37 -07:00
Jeff Schroeder
cba4679b18 Merge pull request #1289 from bastichelaar/develop
Expr_form is not passed through with publish module
2012-05-16 05:08:49 -07:00
bastichelaar
b969fd2760 Referenced the wrong variable 2012-05-16 14:32:58 +03:00
bastichelaar
9add19bcde Expr_form is not passed through with publish module 2012-05-16 14:26:52 +03:00
Philipp Adelt
b2dad7920d Clarify pillar use for files managed on minions that include pillar key/value data 2012-05-16 12:58:35 +02:00
Thomas S Hatch
dead135744 Merge pull request #1286 from kvelarde/develop
Develop
2012-05-15 23:04:10 -07:00
Kurtis Velarde
4518cd7f7f Forgot to add a return for pkgng_update without this call hangs 2012-05-15 18:00:49 -07:00
Kurtis Velarde
7893d3968c Adding -y to pkgng install and purge methods 2012-05-15 17:43:11 -07:00
Kurtis Velarde
10dc7ad615 Adding pkg_update call to get latest repo.txz file.
When rebuilding your package repo all minions will have to have
pkg_update run so they have access to the latest repo listing.
2012-05-15 14:39:55 -07:00
Jeff Schroeder
67c399a3f7 Merge pull request #1283 from hathawsh/develop
Fix NameErrors in yaml_mako.
2012-05-15 11:06:40 -07:00
Shane Hathaway
47aea9dc7b Fix NameErrors. 2012-05-15 11:23:34 -06:00
Thomas S Hatch
5f9a7e87e4 Initial host state test 2012-05-14 23:56:45 -06:00
Thomas S Hatch
26bcb2a4cf Add state_result method to ModuleCase
This makes getting the result field out of the return from run_state
easier
2012-05-14 23:43:16 -06:00
Thomas S Hatch
1c1c99039b Merge pull request #1280 from dcolish/develop
When stdout is part of a pipeline disable color output
2012-05-14 22:04:56 -07:00
Dan Colish
2f992e85da Merge branch 'develop' of git://github.com/saltstack/salt into develop 2012-05-14 22:03:25 -07:00
Dan Colish
ac80940343 Issue #1140, disable color output when stdout is part of a pipeline and not a tty 2012-05-14 22:02:18 -07:00
Thomas S Hatch
5e7f642e4c Merge pull request #1279 from dcolish/develop
Declare out in local client sys.doc
2012-05-14 21:41:04 -07:00
Dan Colish
e6c4e38951 Merge branch 'develop' of git://github.com/saltstack/salt into develop 2012-05-14 21:32:29 -07:00
Dan Colish
5b7c943299 Fix #1234, define out to ensure no unbound vars.
When there are no minions to check for docs, out will be undefined.
2012-05-14 21:31:22 -07:00
Thomas S Hatch
56561149a5 Add standalone minion to contents 2012-05-14 13:40:28 -06:00
Thomas S Hatch
6bfa7de00d Merge branch 'develop' of github.com:saltstack/salt into develop 2012-05-14 13:36:36 -06:00
Thomas S Hatch
fd17c6a1dd Add doc for standalone minion 2012-05-14 13:33:20 -06:00
Thomas S Hatch
21646fd14e Merge pull request #1277 from uggedal/develop
Include my salt states as community examples.
2012-05-14 12:31:08 -07:00
Eivind Uggedal
aee8687c2b Include my salt states as community examples.
Some are arch linux specific, but most could easily be generalized.
Some highlights:

  * going
  * gunicorn
  * iptables
  * nginx
  * phantomjs
  * postgresql
  * redis
  * salt
  * ssh
  * tarsnap
2012-05-14 21:23:58 +02:00
Kurtis Velarde
3b60a3523a Over looked another pkg call: s/pkg_delete/pkg delete/ 2012-05-14 11:24:13 -07:00
Kurtis Velarde
2dc9cc549c Fixing missing _ for _check_pkgng 2012-05-14 11:11:57 -07:00
Thomas S Hatch
3abc36b4d2 Add tests for cmd state 2012-05-14 11:18:36 -06:00
Thomas S Hatch
8e26ea646e Add rm_alias test 2012-05-14 10:44:17 -06:00
Thomas S Hatch
fcfc4c470c Fix un needed format addition in file state 2012-05-14 10:13:45 -06:00
Thomas S Hatch
3c92ebc465 aliases.list_aliases test 2012-05-14 09:59:38 -06:00
Thomas S Hatch
800cf2825c Add test for aliases.has_target 2012-05-14 00:04:26 -06:00
Thomas S Hatch
c4244eb603 Merge branch 'develop' of github.com:saltstack/salt into develop 2012-05-13 23:52:28 -06:00
Thomas S Hatch
b97ec99999 Add initial aliases tests 2012-05-13 23:51:22 -06:00
Thomas S Hatch
c5df9f6526 Add config for aliases tests 2012-05-13 23:51:00 -06:00
Thomas S Hatch
69e096515a Merge pull request #1275 from baijum/pyximport_import
Add missing import of `pyximport`
2012-05-13 22:48:30 -07:00
Baiju Muthukadan
e6707c490d Add missing import of pyximport 2012-05-14 16:38:14 +05:30
Thomas S Hatch
e25396dc72 Fix #1263 2012-05-13 23:28:57 -06:00
Thomas S Hatch
04652619d8 Fix #1268, this adds the working test for recursive requisite errors 2012-05-13 23:16:45 -06:00
Thomas S Hatch
274ba484be Add check for recursive requisites when verifying the high data 2012-05-13 22:58:06 -06:00
Thomas S Hatch
d1615cdebb A few tabs crept in.... 2012-05-13 21:48:33 -06:00