runpuppet 0.5.15 → 0.5.16

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -6,9 +6,13 @@ cat /etc/runpuppet.yml:
6
6
  command:cd /etc/puppet/repo && git fetch && git checkout -f origin/@@branch@@ && puppet -v --debug --logdest console --modulepath /etc/puppet/repo/modules /etc/puppet/repo/manifests/site.pp
7
7
  branch: staging
8
8
  local_ip: 192.168.10.10
9
+ >>>> or grab IP from a network interface
10
+ local_ip_interface: vmbr0
9
11
  lock_file: /tmp/runpuppet.lock
10
12
 
11
13
 
14
+
15
+
12
16
  This is the companion for our puppet_controller, a light-weight web-service to coordinate local puppet runs on servers.
13
17
 
14
18
  == Contributing to runpuppet
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.15
1
+ 0.5.16
data/bin/runpuppet CHANGED
@@ -19,6 +19,7 @@ Options:
19
19
  BANNER
20
20
 
21
21
  opts.on("-h", "--help","Show this.") { puts opts; exit }
22
+ opts.on("--readme", 'Show Readme'){ puts File.read(File.join(File.dirname(__FILE__), '..', 'README.rdoc')); exit }
22
23
  opts.on('-v', '--version','Show Version'){ puts Runpuppet::VERSION; exit}
23
24
  opts.on('--try','Runs only if selected on puppet_controller'){ options[:try] = true }
24
25
  opts.on('-f', '--facts','Report facts'){ options[:facts] = true }
data/lib/runpuppet.rb CHANGED
@@ -40,10 +40,10 @@ class Runpuppet
40
40
  begin
41
41
  url = Config.puppet_controller_url + path
42
42
  puts "Getting #{url}" if options[:verbose]
43
- open(url , {:http_basic_authentication =>Config.puppet_controller_auth} )
43
+ RestClient.get(url)
44
44
  rescue Exception => e
45
45
  puts e.inspect
46
- puts "WARNING: error connecting to puppet controller!"
46
+ puts "WARNING: error connecting in GET (PuppetMaster)"
47
47
  end
48
48
  end
49
49
 
@@ -55,7 +55,7 @@ class Runpuppet
55
55
  RestClient.post "#{Config.puppet_controller_url}/puppet/#{path}", params
56
56
  rescue Exception => e
57
57
  puts e.inspect
58
- puts "WARNING: error connecting to puppet controller!"
58
+ puts "WARNING: error connecting in POST (PuppetMaster)"
59
59
  end
60
60
  end
61
61
 
@@ -131,11 +131,20 @@ class Runpuppet
131
131
  require 'facter'
132
132
  require 'facter/ec2'
133
133
  ip = Facter.value("ec2_public_ipv4")
134
+ elsif config['local_ip_interface']
135
+ parse_local_ip_from_interface
134
136
  else
135
137
  %x(ifconfig)[/192.168.\d+.\d+/] || config['local_ip']
136
138
  end
137
139
  end
138
140
 
141
+
142
+ def self.parse_local_ip_from_interface
143
+ # %x(ifconfig #{config['local_ip_interface']}).lines.grep(/inet addr/).first.match(/addr:(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})?/)
144
+ %x(ip addr list #{config['local_ip_interface']}).match(/inet (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})?/)
145
+ return $1
146
+ end
147
+
139
148
  def self.is_ec2?
140
149
  %x(arp -n -i eth0) =~ /fe:ff:ff:ff:ff/
141
150
  end
data/runpuppet.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{runpuppet}
8
- s.version = "0.5.15"
8
+ s.version = "0.5.16"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Roman Heinrich}]
12
- s.date = %q{2012-02-09}
12
+ s.date = %q{2012-04-27}
13
13
  s.description = %q{Is the local client to the puppet_controller}
14
14
  s.email = %q{roman.heinrich@gmail.com}
15
15
  s.executables = [%q{runpuppet}]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runpuppet
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 43
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 15
10
- version: 0.5.15
9
+ - 16
10
+ version: 0.5.16
11
11
  platform: ruby
12
12
  authors:
13
13
  - Roman Heinrich
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-02-09 00:00:00 Z
18
+ date: 2012-04-27 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  version_requirements: &id001 !ruby/object:Gem::Requirement