Skip to content

Instantly share code, notes, and snippets.

plathrop / gist:2726954
Created May 18, 2012 18:39 — forked from jedi4ever/gist:2726756
Strategy: Logic to determine if a commit (or series) has impact on a Puppet Role (class)


Given a puppet tree (with manifest and modules) dir
When rspec-puppet tests and puppet lint tests pass Instead of re-running test on all possible roles I want to calculate what roles (classes) were impacted in between revision of the puppet tree

Roles would translate to classes in puppet tree with a special prefix f.i. role_


diff --git a/src/ b/src/
index 8c8e995..b22572f 100644
--- a/src/
+++ b/src/
@@ -37,6 +37,59 @@
namespace ledger {
+expr_t::expr_t() : base_type()
def splitat(thing, seq):
if seq is []:
if thing not in seq:
return chain.from_iterable([seq])
return chain([seq[:seq.index(thing)]],
splitby(thing, seq[(seq.index(thing) + 1):]))
#platform=x86, AMD64, or Intel EM64T
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
# Use NFS installation media
== Rules ==
On Infrastructure
There is one system, not a collection of systems.
The desired state of the system should be a known quantity.
The "known quantity" must be machine parseable.
The actual state of the system must self-correct to the desired state.
The only authoritative source for the actual state of the system is the system.
The entire system must be deployable using source media and text files.