Sha256: 95f80b46c22ae1238677b81f941a1b95c99b282f47e7b0fcd5d8c76d9dbefe23

Contents?: true

Size: 929 Bytes

Versions: 1

Compression:

Stored size: 929 Bytes

Contents

#
# Author:: Cary Penniman (<cary@rightscale.com>)
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

provides "cloud"

require_plugin "ec2"

def on_ec2?
  ec2 != nil
end

def get_ec2_values
  cloud[:instance_id] = ec2['instance_id']
  cloud[:public_ip] = ec2['public_ipv4']
  cloud[:private_ip] = ec2['local_ipv4']
  cloud[:provider] = "ec2"
end

if on_ec2?
  cloud Mash.new
  get_ec2_values
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rightscale-ohai-0.3.3.1 lib/ohai/plugins/cloud.rb