lib/open-dock/commands/configure_host.rb in open-dock-0.1.13 vs lib/open-dock/commands/configure_host.rb in open-dock-0.1.14
- old
+ new
@@ -8,16 +8,21 @@
options.default container: 'all'
host = args[0]
user = Ops::DEFAULT_USER
containers = Docker::containers_for(host)
- if options.container == "all"
- containers.each do |container_name, config|
- ssh_port = Docker::get_container_port config
- Chef::cook(user,container_name, host, ssh_port)
- end
+ if File.exists? "#{Ops::NODES_DIR}/#{host}.json" # Not a container ship
+ Chef::install(user, host)
+ Chef::cook(user, host)
else
- ssh_port = Docker::get_container_port containers[options.container]
- Chef::cook(user, options.container, host, ssh_port)
+ if options.container == "all"
+ containers.each do |container_name, config|
+ ssh_port = Docker::get_container_port config
+ Chef::cook_container(user,container_name, host, ssh_port)
+ end
+ else
+ ssh_port = Docker::get_container_port containers[options.container]
+ Chef::cook_container(user, options.container, host, ssh_port)
+ end
end
end
end
\ No newline at end of file