Module: Elzar::Compute
- Defined in:
- lib/elzar/compute.rb
Class Method Summary collapse
- .bootstrap(instance_id, aws_config) ⇒ Object
- .converge!(instance_id, aws_config) ⇒ Object
- .destroy!(instance_id, aws_config) ⇒ Object
- .provision(name, aws_config) ⇒ Object
- .provision_and_bootstrap!(instance_name, aws_config) ⇒ Object
Class Method Details
.bootstrap(instance_id, aws_config) ⇒ Object
22 23 24 25 |
# File 'lib/elzar/compute.rb', line 22 def self.bootstrap(instance_id, aws_config) slushy_instance = slushy_instance_for(instance_id, aws_config) slushy_instance.bootstrap end |
.converge!(instance_id, aws_config) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/elzar/compute.rb', line 27 def self.converge!(instance_id, aws_config) tmpdir = Elzar.merge_and_create_temp_directory File.('provision/') slushy_instance = slushy_instance_for(instance_id, aws_config) slushy_instance.converge tmpdir [slushy_instance.instance_id, slushy_instance.server.public_ip_address] end |
.destroy!(instance_id, aws_config) ⇒ Object
35 36 37 38 |
# File 'lib/elzar/compute.rb', line 35 def self.destroy!(instance_id, aws_config) slushy_instance = slushy_instance_for(instance_id, aws_config) slushy_instance.terminate end |
.provision(name, aws_config) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/elzar/compute.rb', line 14 def self.provision(name, aws_config) config = aws_config['server']['creation_config'] config['tags'] = {'Name' => name} slushy_instance = Slushy::Instance.launch(fog_connection(aws_config), config) [slushy_instance.instance_id, slushy_instance.server.public_ip_address] end |
.provision_and_bootstrap!(instance_name, aws_config) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/elzar/compute.rb', line 7 def self.provision_and_bootstrap!(instance_name, aws_config) instance_id, instance_ip = provision(instance_name, aws_config) bootstrap(instance_id, aws_config) [instance_id, instance_ip] end |