Sha256: dba5807e2c8372107e4e20cc57a44bfcc841d2d417df46b1663183495a6587b4

Contents?: true

Size: 1.15 KB

Versions: 6

Compression:

Stored size: 1.15 KB

Contents

namespace :ec2 do
  desc 'Tag all (untagged) instances with role and environment'
  task :retag do |_t|
    EC2.retag
  end

  desc 'Rehash instances'
  task :rehash do |_t|
    EC2.rehash
  end

  desc 'Rehash single attribute of all instances'
  task :rehash_attr_all, [:property] do |_t, args|
    if args[:property].nil?
      puts 'Missing property'
      return 1
    end
    EC2.rehash_property(args[:property])
  end

  desc 'Rehash ec2 attributes for a single instance'
  task :rehash_attrs_for, [:instance] do |_t, args|
    if args[:instance].nil?
      puts 'Missing instance'
      return 1
    end
    res = EC2.rehash_properties_for_instance(args[:instance])
    return 1 unless res
  end

  desc 'Rehash a single property for an instance'
  task :rehash_attr_for, [:instance, :property] do |_t, args|
    if args[:instance].nil?
      puts 'Missing instance'
      return 1
    end
    if args[:property].nil?
      puts 'Missing property'
      return 1
    end
    res = EC2.rehash_property_for_instance(args[:property], args[:instance])
    if res
      puts "#{property} for instance #{instance} set to '#{res}'"
    else
      return 1
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gaptool-server-0.8.5 tasks/ec2.rb
gaptool-server-0.8.4 tasks/ec2.rb
gaptool-server-0.8.3 tasks/ec2.rb
gaptool-server-0.8.2 tasks/ec2.rb
gaptool-server-0.8.1 tasks/ec2.rb
gaptool-server-0.8.0 tasks/ec2.rb