Skip to content

Commit 9738781

Browse files
committed
add basic metadata
1 parent 6fce4b7 commit 9738781

File tree

3 files changed

+70
-1
lines changed

3 files changed

+70
-1
lines changed

LICENSE

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Copyright (C) 2014 Felix Frank
2+
3+
Contact: Felix.Frank __AT__ Alumni.TU-Berlin.de
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.

Modulefile

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name 'ffrank-constraints'
2+
version '0.1'
3+
author 'Felix Frank'
4+
summary 'Puppet module that implements the constraint type'
5+
description 'The constraint type aims to lift the need for both
6+
the defined() and ensure_resource() functions. Each constraint
7+
defines a set of allowed and/or forbidden resource properties, e.g.
8+
9+
constraint {
10+
"foo": resource => Package["apache2"],
11+
{ ensure => present };
12+
}
13+
14+
See README.md for more examples.'
15+
license 'Apache'
16+
project_page 'https://github.com/ffrank/puppet-constraints'

README.md

+39-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,42 @@
11
puppet-constraints
22
==================
33

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

Comments
 (0)