lib/dev-lxc/chef-cluster.rb in dev-lxc-0.1.2 vs lib/dev-lxc/chef-cluster.rb in dev-lxc-0.2.0
- old
+ new
@@ -66,14 +66,20 @@
def destroy
puts "Destroying cluster"
chef_servers.reverse_each { |cs| cs.destroy }
end
- def destroy_base_containers
- @servers.keys.each do |server_name|
- DevLXC::Container.new("b-#{server_name}").destroy
+ def destroy_base_container(type)
+ case type
+ when :unique
+ @servers.keys.each do |server_name|
+ DevLXC::ChefServer.new(server_name, @cluster_config).destroy_base_container(:unique)
+ end
+ when :shared
+ DevLXC::ChefServer.new(@servers.keys.first, @cluster_config).destroy_base_container(:shared)
+ when :platform
+ DevLXC::ChefServer.new(@servers.keys.first, @cluster_config).destroy_base_container(:platform)
end
- DevLXC::Container.new(DevLXC::ChefServer.new(@servers.keys.first, @cluster_config).base_server_name).destroy
end
def chef_server_config
chef_server_config = %Q(api_fqdn "#{@api_fqdn}"\n)
@cluster_config["packages"]["server"].to_s.match(/(private-chef|chef-server)[_-](\d+)\.(\d+\.?){2,}-/)