The main point of interaction between server and microkernel is the /svc/checkin/:id endpoint. It currently expects that the Microkernel peridoically posts the following JSON to that URL:
{
"facts": { ... facts hash ... }
}
command :unbind_node do |data| | |
data['name'] or error 400, | |
:error => "Supply 'name' to indicate which node to unbind" | |
if node = Razor::Data::Node.find_by_name(data['name']) | |
if node.policy | |
policy_name = node.policy.name | |
node.log_append(:event => :unbind, :policy => policy_name) | |
node.policy = nil | |
node.bound = false | |
node.save |
diff --git a/app.rb b/app.rb | |
index ae74307..75f43f2 100644 | |
--- a/app.rb | |
+++ b/app.rb | |
@@ -505,6 +505,21 @@ class Razor::App < Sinatra::Base | |
command :create_repo do |data| | |
check_permissions! "commands:create-repo:#{data['name']}" | |
+ | |
+ unless data['name'].is_a? String |
nodes: | |
short: | |
layout: table | |
columns: | |
name: | |
dhcp_mac: | |
format: mac | |
tags: | |
format: tag_names | |
policy: |
> gem install pe-razor-client | |
> export RAZOR_API=http://razor-server:8080/api | |
# Use any mirror listed here: http://isoredirect.centos.org/centos/6/isos/x86_64/ | |
# This will take a while, since it will download the ISO and unpack it. The response | |
# will mention a command, which you can use to check the progress/errors of the | |
# download via 'razor commands NNN' | |
> razor create-repo --name centos-6.5 --task centos \ | |
--iso-url http://mirror.anl.gov/pub/centos/6.5/isos/x86_64/CentOS-6.5-x86_64-bin-DVD1.iso | |
# A tag that will match any machine | |
> razor create-tag --name any --rule '["=", 1, 1]' |
define echo { | |
exec { "echo-$name": | |
command => "/usr/bin/echo $name" | |
} | |
} | |
Foo <| color == 'green' |> -> echo { "yo": } -> Foo <| color == 'red' |> | |
define foo($color) { | |
notice("foo[$name]: $color") |
(defn is-in-env? | |
"Return true if node N is in the desired environment according to the | |
subtree rooted at G. The following helpers are used: | |
(good? g) - true if g sets the environment to the desired one | |
(bad? g) - (not (good? g)) Note that this includes groups that do | |
not set the environment at all | |
(matches? n g) - true if the node N matches G's rule | |
(children g) - a list of G's child groups | |
Ignores environment trumps/override" |
(ns user | |
(:require [puppetlabs.http.client.sync :as http] | |
[clojure.java.io :as io] | |
[cheshire.core :as json])) | |
(def dir "/home/lutter/code/deployer/LOCAL/puppet-master/ssl") | |
(def config | |
{ | |
:ssl-config |
application lamp ( | |
$parameter = 'default', | |
){ | |
$names = [ 'one', 'two' 'three' ] | |
$names.each |name| { | |
site::apache { $name: | |
export => Http[$name], | |
} |