Clean-room implementation of the Puppet External Node Classifier and server database that we use at work.
- Duplicate existing functionality
- Magicaly templated Heira backend
- Relationships, including enough to define network config for an entire stack (from IPs to firewall and load balancer, etc)
Step-by-step:
git clone
cd noodle
bundle install
- Run tests:
rake
- Start app:
rackup
Perhaps the travis-ci.org steps are helpful and/or a decent alternative :)
# Search
curl -s -XGET http://localhost:9292/nodes/jojo.example.com
# (returns nothing)
# Create
curl -s -XPOST http://localhost:9292/nodes/jojo.example.com -d @node.json
# Name: jojo.example.com
# Ilk: host
# Status: surplus
# Params:
# site = moon
# Facts:
# Or create via PUT
curl -s -XPUT http://localhost:9292/nodes/jojo.example.com -d @node.json
# Name: jojo.example.com
# Ilk: host
# Status: surplus
# Params:
# site = moon
# Facts:
# Search again
curl -s -XGET http://localhost:9292/nodes/jojo.example.com
# Name: jojo.example.com
# Ilk: host
# Status: surplus
# Params:
# site = moon
# Facts:
# Patch
curl -s -XPATCH http://localhost:9292/nodes/jojo.example.com -d @patch.json
# Name: jojo.example.com
# Ilk: host
# Status: surplus
# Params:
# site = mars <--- changed
# Facts:
# Delete
curl -s -XDELETE http://localhost:9292/nodes/jojo.example.com
# Deleted jojo.example.com
# Pry me a river
curl -s -XPUT http://localhost:9292/nodes/jojo.example.com -d @realnode-1.json
curl -s -XPUT http://localhost:9292/nodes/jojo.example.com -d @realnode-2.json
./prymeariver
# And try some of the examples it spits out
# Magic search #1
curl -q -XGET 'http://localhost:9292/nodes/_/site=moon'
# cheese1.example.com
# jojo.example.com
# Magic search #2
curl -q -XGET 'http://localhost:9292/nodes/_/operatingsystem=ackack'
# greenie.example.com