Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Latest commit

 

History

History
59 lines (51 loc) · 1.29 KB

README.md

File metadata and controls

59 lines (51 loc) · 1.29 KB

easyenc

A simple ENC and compiler for Puppet, fed by a yaml "database". Please keep in mind that this is still a work in progress.

Requires python and python-yaml packages in Ubuntu 12.04. YMMV.

easyenc.py

A simple ENC (External Node Classifier) for Puppet, fed by a yaml "database".

In your puppet master configuration, enter something along the lines of this to use:

[master]
  node_terminus = exec
  external_nodes = /usr/local/bin/easyenc.py /var/lib/puppet/easyenc.yaml

/var/lib/puppet/easyenc.yaml:

---
default:
  environment: unknown
  class: roles::unknown
test.example.com:
  environment: dev
  class: roles::dev::test
another.example.com:
  class: roles::some::role

easyenc-compiler.py

Compilation of easyenc.yaml from a directory of yaml files. somename.yaml gives environment "somename" for all hosts listed in that file. default.yaml is special...

/etc/easyenc.d/default.yaml:

---
environment: unknown

/etc/easyenc.d/prod.yaml:

---
an.example.com: roles::some::role
another.example.com: roles::prod::web
$ easyenc-compiler.py /etc/easyenc.d
---
an.example.com: 
  environment: prod
  class: roles::some::role
another.example.com: 
  environment: prod
  class: roles::prod::web
default:
  environment: unknown