[chef] Re: unable to run a powershell to create a failover cluster using chef.


Chronological Thread 
  • From: Kenneth Barry < >
  • To: " " < >
  • Subject: [chef] Re: unable to run a powershell to create a failover cluster using chef.
  • Date: Mon, 27 Apr 2015 07:12:33 -0700

This may be a case of scope.
Someone else can get more technical, but my experience has been that when a powershell script is part of a chef recipe, it doesn't always go that if it does not go as intended, that chef will know. 

To some degree, Chef only knows to run the script, not what the script will do. So, its like handing a note to a man at a door with instruction to ..... Yell for [someone] to come to the door. "Chef" takes the note, Yells into the other room for [someone] to come to the door, then turns back to you and says "OK, I did it", irregardless of someone coming to the door or not, irregardless of there even being anyone in the room or not, "You asked it to yell for someone to come to the door", and it did that.

You may want to put some debugging in place, or look into some of the features for powershell logging. I suspect you may have a syntax problem "needing to escape a character, so its being passed in incorrectly, etc.), but your not seeing the error.

On Mon, Apr 27, 2015 at 5:49 AM, Pradeep Kumar < " target="_blank"> > wrote:
Hi Every one,

hope someone could help me on this.

im trying to create a failover windows cluster using chef. im running the following

powershell_script "Validate and Create cluster" do
  code <<-EOH
  import-module failoverclusters
  New-Cluster –Name TestCluster –Node node1,node2  –StaticAddress "IP"
  EOH
  flags '-NoLogo, -NonInteractive, -NoProfile, -ExecutionPolicy Unrestricted, -InputFormat None'
end

the new-cluster command does not seem to run.

my chef run ends with a success! with no errors.

i have previously run various powershell scripts through chef and have been successfull. but no luck with this one. 


--
pradeep



--

Kenneth Barry 

TuneIn | Build and Release Engineer
M: 409-673-0544



Archive powered by MHonArc 2.6.16.

§