diff options
Diffstat (limited to 'global/overlay/etc')
-rw-r--r-- | global/overlay/etc/puppet/cosmos-db.yaml | 14 | ||||
-rw-r--r-- | global/overlay/etc/puppet/cosmos-modules.conf | 12 | ||||
-rwxr-xr-x | global/overlay/etc/puppet/cosmos_enc.py | 20 |
3 files changed, 27 insertions, 19 deletions
diff --git a/global/overlay/etc/puppet/cosmos-db.yaml b/global/overlay/etc/puppet/cosmos-db.yaml new file mode 100644 index 0000000..729afc4 --- /dev/null +++ b/global/overlay/etc/puppet/cosmos-db.yaml @@ -0,0 +1,14 @@ +classes: + cdr1.sunet.se: {sunet: null, sunet-cdr: null} + cdr2.sunet.se: {sunet: null, sunet-cdr: null} + sto-tug-kvm-lab1.swamid.se: {swamid: null} + sto-tug-kvm-lab2.swamid.se: {swamid: null} + sto-tug-kvm1.swamid.se: {swamid: null} + wp.sunet.se: {} +members: + all: [sto-tug-kvm1.swamid.se, cdr1.sunet.se, sto-tug-kvm-lab1.swamid.se, wp.sunet.se, + cdr2.sunet.se, sto-tug-kvm-lab2.swamid.se] + sunet: [cdr1.sunet.se, cdr2.sunet.se] + sunet-cdr: [cdr1.sunet.se, cdr2.sunet.se] + swamid: [sto-tug-kvm1.swamid.se, sto-tug-kvm-lab1.swamid.se, sto-tug-kvm-lab2.swamid.se] + diff --git a/global/overlay/etc/puppet/cosmos-modules.conf b/global/overlay/etc/puppet/cosmos-modules.conf index c47e936..1a77592 100644 --- a/global/overlay/etc/puppet/cosmos-modules.conf +++ b/global/overlay/etc/puppet/cosmos-modules.conf @@ -1,14 +1,14 @@ # # name source (puppetlabs fq name or git url) upgrade (yes/no) # -concat puppetlabs/concat no -stdlib puppetlabs/stdlib no +#concat puppetlabs/concat no +#stdlib puppetlabs/stdlib no cosmos git://github.com/leifj/puppet-cosmos.git yes ufw git://github.com/SUNET/puppet-module-ufw.git yes apt puppetlabs/apt no -vcsrepo puppetlabs/vcsrepo no -xinetd puppetlabs/xinetd no -golang elithrar/golang yes -python git://github.com/stankevich/puppet-python.git yes +#vcsrepo puppetlabs/vcsrepo no +#xinetd puppetlabs/xinetd no +#golang elithrar/golang yes +#python git://github.com/stankevich/puppet-python.git yes dhcp git://github.com/SUNET/puppetlabs-dhcp yes hiera-gpg git://github.com/SUNET/hiera-gpg.git no 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)) |