summaryrefslogtreecommitdiff
path: root/global/overlay/etc
diff options
context:
space:
mode:
Diffstat (limited to 'global/overlay/etc')
-rwxr-xr-xglobal/overlay/etc/puppet/cosmos_enc.py20
-rw-r--r--global/overlay/etc/puppet/puppet.conf1
2 files changed, 8 insertions, 13 deletions
diff --git a/global/overlay/etc/puppet/cosmos_enc.py b/global/overlay/etc/puppet/cosmos_enc.py
index 63c3a66..131d161 100755
--- a/global/overlay/etc/puppet/cosmos_enc.py
+++ b/global/overlay/etc/puppet/cosmos_enc.py
@@ -5,20 +5,14 @@ import yaml
import os
import re
-rules_path = os.environ.get("COSMOS_RULES_PATH","/etc/puppet")
-
node_name = sys.argv[1]
-rules = dict()
-for p in rules_path.split(":"):
- rules_file = os.path.join(p,"cosmos-rules.yaml")
- if os.path.exists(rules_file):
- with open(rules_file) as fd:
- rules.update(yaml.load(fd))
+db_file = os.environ.get("COSMOS_ENC_DB","/etc/puppet/cosmos-db.yaml")
+db = dict(classes=dict())
+
+if os.path.exists(db_file):
+ with open(db_file) as fd:
+ db.update(yaml.load(fd))
-classes = dict()
-for reg,cls in rules.iteritems():
- if re.search(reg,node_name):
- classes.update(cls)
+print yaml.dump(dict(classes=db['classes'].get(node_name,dict()),parameters=dict(roles=db.get('members',[]))))
-print yaml.dump(dict(classes=classes))
diff --git a/global/overlay/etc/puppet/puppet.conf b/global/overlay/etc/puppet/puppet.conf
index 0ba85f4..a269892 100644
--- a/global/overlay/etc/puppet/puppet.conf
+++ b/global/overlay/etc/puppet/puppet.conf
@@ -7,6 +7,7 @@ factpath=$vardir/lib/facter
templatedir=$confdir/templates
node_terminus = exec
external_nodes = /etc/puppet/cosmos_enc.py
+modulepath = /etc/puppet/modules:/etc/puppet/cosmos-modules:/usr/share/puppet/modules
[master]
# These are needed when the puppetmaster is run by passenger