Module: EC2
- Defined in:
- lib/ec2_userdata.rb
Defined Under Namespace
Classes: UserData
Class Method Summary collapse
-
.ec2? ⇒ Boolean
Returns true if the current instance is running on the EC2 cloud.
Class Method Details
.ec2? ⇒ Boolean
Returns true if the current instance is running on the EC2 cloud
59 60 61 62 63 |
# File 'lib/ec2_userdata.rb', line 59 def self.ec2? return @running_on_ec2 if @running_on_ec2 raise("nslookup must be in the path") if cmd_exec("which nslookup").blank? @running_on_ec2 = (cmd_exec("nslookup 169.254.169.254").match(/NXDOMAIN/) || []).size < 1 end |