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 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
- require 'spec/rake/spectask'
28
- Spec::Rake::SpecTask.new(:spec) do |spec|
29
- spec.libs << 'lib' << 'spec'
30
- spec.spec_files = FileList['spec/**/*_spec.rb']
31
- end
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
- spec.libs << 'lib' << 'spec'
35
- spec.pattern = 'spec/**/*_spec.rb'
36
- spec.rcov = true
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.3
1
+ 0.0.4
@@ -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::Facts.terminus_class = :yaml
41
+ Puppet::Node.terminus_class = :yaml
45
42
  Puppet[:clientyamldir] = "$yamldir"
46
- nodes = Puppet::Node::Facts.search("*")
43
+ nodes = Puppet::Node.search("*")
47
44
  nodes.each do |n|
48
- puts "Processing #{n.name}"
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(n.values["kernel"])}"
54
- osFamily="#{xml_escape(n.values["kernel"])}"
55
- osName="#{xml_escape(n.values["operatingsystem"])}"
56
- osVersion="#{xml_escape(n.values["operatingsystemrelease"])}"
57
- tags="nil"
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(n.values["fqdn"])}"/>
57
+ hostname="#{xml_escape(facts.values["fqdn"])}"/>
60
58
  EOH
61
59
  end
62
60
  response << "</project>"
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  $LOAD_PATH.unshift(File.dirname(__FILE__))
2
2
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
+ require 'rubygems'
3
4
  require 'puppet-rundeck'
4
5
  require 'spec'
5
6
  require 'spec/autorun'
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: 25
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
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-11 00:00:00 -08:00
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