[chef] RE: Re: custom json attributes to powershell variables


Chronological Thread 
  • From: Simon Hawkins < >
  • To: " " < >
  • Subject: [chef] RE: Re: custom json attributes to powershell variables
  • Date: Wed, 4 Jun 2014 13:37:46 +0000
  • Accept-language: en-GB, en-US
  • Authentication-results: spf=none (sender IP is ) ;

Hi Greg,

 

It would be both, therefore, how would I pass them when I type “knife bootstrap windows winrm 10.x.x.x –J $ipAddress  $SNMask $GW $DNS”  (if –J is the right way to do it)

 

And then in for example a recipe file called change_IP.rb I would have a powershell script declaring Powershell variables such like:

 

$ipAddress = DetailsPassedInFromBootstrap

$SNMask = DetailsPassedInFromBootstrap

$GW = DetailsPassedInFromBootstrap

$DNS = DetailsPassedInFromBootstrap

 

Which would then change the local IP once the recipe is applied.

 

If that makes sense?

 

Cheers,

Simon

From: Greg Zapp [mailto:
Sent: 04 June 2014 14:21
To:
Subject: [chef] Re: custom json attributes to powershell variables

 

Hi Simon,

 

Is your difficulty with getting the attributes into Chef or using them once they are there?

 

-Greg

 

On Wed, Jun 4, 2014 at 9:36 PM, < " target="_blank"> > wrote:

Hi,

Do you know how I would be able to save JSON custom attributes to a powershell
variable in a recipe?

When I bootstrap a Windows machine I would like to pass the IP, Subnet, GW and
DNS Servers into custom attributes and when the recipe is applied, the windows
machine sets the correct information to the network card (using powershell).

Since knife vsphere doesn't currently support vmware windows customisations I
can't think of another way.

So I would end up with something like this in the recipe (which is a powershell
script):

$ipAddress = customIPAttribute
$gateway = customGWAttribute
etc, within the recipe.

Cheers,
Simon.

 


Disclaimer

This message is intended only for the use of the person(s) ("Intended Recipient") to whom it is addressed. It may contain information which is privileged and confidential. Accordingly any dissemination, distribution, copying or other use of this message or any of its content by any person other than the Intended Recipient may constitute a breach of civil or criminal law and is strictly prohibited. If you are not the Intended Recipient, please contact the sender as soon as possible.

Totaljobs Group Limited Registered Office: Holden House, 57 Rathbone Place, London, W1T 1JU, UK Registered in England and Wales under company no. 4269861





Archive powered by MHonArc 2.6.16.

§