On Thursday, May 2, 2013 at 12:48 AM, NagaLakshmi wrote:
Hi,I've written a rack application using grape which calls knife's bootstrapcommand to bootstrap a VM.The following is the code to bootstrapmodule Chefclass Bootstrap < Grape::APIformat :jsoncontent_type :json,"application/json"params dorequires :VM_IP, :type => String, :desc => "ip value"requires :VM_username, :type => String, :desc => "username"requires :VM_password, :type => String, :desc => "password"endresource :virtualmachinepost 'bootstrap' docontent_type "application/json"status "200"body "Boostrapped Successfully!!!"t1 = Thread.new dosystem "knife chefsolo bootstrap #{params[:VM_IP]} -x#{params[:VM_username]} -P '#{params[:VM_password]}'"endendendendendWhen i start the app manually using "rackup -p 9000 config.ru",the above codeis working fine,I've added this command to /etc/rc.local file to start theservice during startup. The service has been started successfully butbootstrapping is not working. I've tried replacing the knife commands withother system commands and those are working fine.Only knife commands are notworking when i start the service in the background.Is there any specific reasonfor it?How can i modify the code to make that working?
Archive powered by MHonArc 2.6.16.