puppet-rundeck 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +13 -9
- data/VERSION +1 -1
- data/lib/puppet-rundeck.rb +10 -12
- data/spec/spec_helper.rb +1 -0
- metadata +4 -4
data/Rakefile
CHANGED
@@ -24,16 +24,20 @@ rescue LoadError
|
|
24
24
|
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
25
25
|
end
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
spec
|
30
|
-
|
31
|
-
|
27
|
+
begin
|
28
|
+
require 'spec/rake/spectask'
|
29
|
+
Spec::Rake::SpecTask.new(:spec) do |spec|
|
30
|
+
spec.libs << 'lib' << 'spec'
|
31
|
+
spec.spec_files = FileList['spec/**/*_spec.rb']
|
32
|
+
end
|
32
33
|
|
33
|
-
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
34
|
-
|
35
|
-
|
36
|
-
|
34
|
+
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
35
|
+
spec.libs << 'lib' << 'spec'
|
36
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
37
|
+
spec.rcov = true
|
38
|
+
end
|
39
|
+
rescue LoadError
|
40
|
+
puts "RSpec not available. Install it with: gem install rspec"
|
37
41
|
end
|
38
42
|
|
39
43
|
task :spec => :check_dependencies
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.4
|
data/lib/puppet-rundeck.rb
CHANGED
@@ -16,13 +16,10 @@
|
|
16
16
|
|
17
17
|
require 'sinatra/base'
|
18
18
|
require 'puppet'
|
19
|
-
require 'puppet/rails'
|
20
19
|
require 'builder/xchar'
|
21
20
|
|
22
21
|
class PuppetRundeck < Sinatra::Base
|
23
22
|
|
24
|
-
include Puppet
|
25
|
-
|
26
23
|
class << self
|
27
24
|
attr_accessor :config_file
|
28
25
|
attr_accessor :username
|
@@ -41,22 +38,23 @@ class PuppetRundeck < Sinatra::Base
|
|
41
38
|
|
42
39
|
get '/' do
|
43
40
|
response = '<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE project PUBLIC "-//DTO Labs Inc.//DTD Resources Document 1.0//EN" "project.dtd"><project>'
|
44
|
-
Puppet::Node
|
41
|
+
Puppet::Node.terminus_class = :yaml
|
45
42
|
Puppet[:clientyamldir] = "$yamldir"
|
46
|
-
nodes = Puppet::Node
|
43
|
+
nodes = Puppet::Node.search("*")
|
47
44
|
nodes.each do |n|
|
48
|
-
|
45
|
+
facts = Puppet::Node::Facts.find(n.name)
|
46
|
+
tags = Puppet::Resource::Catalog.find(n.name).tags
|
49
47
|
response << <<-EOH
|
50
48
|
<node name="#{xml_escape(n.name)}"
|
51
49
|
type="Node"
|
52
50
|
description="#{xml_escape(n.name)}"
|
53
|
-
osArch="#{xml_escape(
|
54
|
-
osFamily="#{xml_escape(
|
55
|
-
osName="#{xml_escape(
|
56
|
-
osVersion="#{xml_escape(
|
57
|
-
tags="
|
51
|
+
osArch="#{xml_escape(facts.values["kernel"])}"
|
52
|
+
osFamily="#{xml_escape(facts.values["kernel"])}"
|
53
|
+
osName="#{xml_escape(facts.values["operatingsystem"])}"
|
54
|
+
osVersion="#{xml_escape(facts.values["operatingsystemrelease"])}"
|
55
|
+
tags="#{xml_escape(tags.join(','))}"
|
58
56
|
username="#{xml_escape(PuppetRundeck.username)}"
|
59
|
-
hostname="#{xml_escape(
|
57
|
+
hostname="#{xml_escape(facts.values["fqdn"])}"/>
|
60
58
|
EOH
|
61
59
|
end
|
62
60
|
response << "</project>"
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-rundeck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- James Turnbull
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-01-
|
18
|
+
date: 2011-01-29 00:00:00 +11:00
|
19
19
|
default_executable: puppet-rundeck
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|