|
1 | 1 | puppet-constraints
|
2 | 2 | ==================
|
3 | 3 |
|
4 |
| -Puppet module that introduces the constraint type |
| 4 | +Puppet module that introduces the constraint type. |
| 5 | + |
| 6 | +Origin: https://github.com/ffrank/puppet-constraints |
| 7 | + |
| 8 | +Released under the terms of the Apache 2 License. |
| 9 | + |
| 10 | +This module requires Puppet to be patched in order to perform and respect |
| 11 | +the checks of constraints. The patch is available in |
| 12 | +[a topic branch](https://github.com/ffrank/puppet/tree/ticket/master/PUP-2298-transaction-pre-run-checks). |
| 13 | + |
| 14 | +Authored by Felix Frank. |
| 15 | + |
| 16 | +Overview |
| 17 | +======== |
| 18 | + |
| 19 | +This module implements `constraints`, a new meta type that aims |
| 20 | +to make both the `ensure_resources` function and the `defined` function obsolete. |
| 21 | +More information can be found in John Bollinger's |
| 22 | +[original mailing list post](https://groups.google.com/d/msg/puppet-users/Fvl0aOe4RPE/Ph38bq3FmHcJ) |
| 23 | +which explains their motivation, lays out their semantics and sketches their syntax. |
| 24 | + |
| 25 | +Currently, the following syntaxes are implemented: |
| 26 | + |
| 27 | + # These are all equivalent |
| 28 | + constraint { |
| 29 | + 'foo': resource => Package['apache2'], |
| 30 | + { ensure => present }; |
| 31 | + 'bar': resource => Package['apache2'], |
| 32 | + { ensure => [ present ] }; |
| 33 | + 'baz': resource => Package['apache2'], |
| 34 | + { ensure => { allowed => [ present ] } }; |
| 35 | + } |
| 36 | + # Blacklist instead of whitelist |
| 37 | + constraint { |
| 38 | + 'oof': resource => Package['apache2'], |
| 39 | + { ensure => { forbid => [ absent, purged ] } }; |
| 40 | + } |
| 41 | + |
| 42 | +Any failed constraint causes the catalog to be considered invalid (agent side). |
0 commit comments