runpuppet 0.5.4 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/runpuppet.rb +11 -1
  3. data/runpuppet.gemspec +1 -1
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.4
1
+ 0.5.5
@@ -102,7 +102,17 @@ class Runpuppet
102
102
  end
103
103
 
104
104
  def self.local_ip
105
- %x(ifconfig)[/192.168.\d+.\d+/] || config['local_ip']
105
+ if is_ec2?
106
+ require 'facter/application'
107
+ res = Facter::Application.run(ARGV)
108
+ ip = res.find{|x| x[0] == 'ec2_public_ipv4'}[1]
109
+ else
110
+ %x(ifconfig)[/192.168.\d+.\d+/] || config['local_ip']
111
+ end
112
+ end
113
+
114
+ def self.is_ec2?
115
+ %x(arp -n) =~ /fe:ff:ff:ff:ff/
106
116
  end
107
117
  end
108
118
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{runpuppet}
8
- s.version = "0.5.4"
8
+ s.version = "0.5.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Roman Heinrich"]
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: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 4
10
- version: 0.5.4
9
+ - 5
10
+ version: 0.5.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Roman Heinrich