Set-AzureVMChefExtension

Adds the Chef extension to the virtual machine.

Note

The cmdlets referenced in this documentation are for managing legacy Azure resources that use Service Management APIs. See the Az PowerShell module for cmdlets to manage Azure Resource Manager resources.

Syntax

Set-AzureVMChefExtension
   [-Version <String>]
   -ValidationPem <String>
   [-ClientRb <String>]
   [-BootstrapOptions <String>]
   [-RunList <String>]
   [-JsonAttribute <String>]
   [-ChefDaemonInterval <String>]
   [-ChefServerUrl <String>]
   [-ValidationClientName <String>]
   [-OrganizationName <String>]
   [-BootstrapVersion <String>]
   [-Daemon <String>]
   [-Secret <String>]
   [-SecretFile <String>]
   [-Windows]
   -VM <IPersistentVM>
   [-Profile <AzureSMProfile>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]
Set-AzureVMChefExtension
   [-Version <String>]
   -ValidationPem <String>
   [-ClientRb <String>]
   [-BootstrapOptions <String>]
   [-RunList <String>]
   [-JsonAttribute <String>]
   [-ChefDaemonInterval <String>]
   [-ChefServerUrl <String>]
   [-ValidationClientName <String>]
   [-OrganizationName <String>]
   [-BootstrapVersion <String>]
   [-Daemon <String>]
   [-Secret <String>]
   [-SecretFile <String>]
   [-Linux]
   -VM <IPersistentVM>
   [-Profile <AzureSMProfile>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]

Description

The Set-AzureVMChefExtension cmdlet adds the Chef extension to the virtual machine.

Examples

Example 1: Add a Chef extension to a Windows virtual machine

PS C:\> Set-AzureVMChefExtension -VM $VM -ValidationPem "C:\\myorg-validator.pem" -ClientRb "C:\\client.rb" -RunList "Apache" -Windows;

This command adds a Chef extension to a Windows virtual machine. When the virtual machine comes up, it is bootstrapped with Chef and runs Apache on it.

Example 2: Add a Chef extension to a Windows virtual machine with bootstrapping

PS C:\> Set-AzureVMChefExtension -VM $VM -ValidationPem "C:\\myorg-validator.pem" -BootstrapOptions '{"chef_node_name":"your_node_name","chef_server_url":"https://api.opscode.com/organizations/some-org", "validation_client_name":"some-org-validator"}' -RunList "Apache" -Windows;

This command adds the Chef extension to a Windows virtual machine. When the virtual machine launches, it is bootstrapped with Chef and runs Apache on it. After bootstrapping, the virtual machine refers to the BootstrapOptions specified in JSON format.

Example 3: Add a Chef extension to a Windows virtual machine and install Apache and GIT

PS C:\> Set-AzureVMChefExtension -VM $VM -ValidationPem "C:\\myorg-validator.pem" -ChefServerUrl "http://ipaddress:port" -ValidationClientName "MyOrg-Validator" -RunList "apache, git" -Windows;

This command adds the Chef extension to a Windows virtual machine. When the virtual machine launches, it is bootstrapped with Chef and have Apache and GIT installed. If you do not provide the client.rb, you need to provide the Chef server URL and validation client name.

Example 4: Add a Chef extension to a Linux virtual machine

PS C:\> Set-AzureVMChefExtension -VM $VM -ValidationPem "C:\\myorg-validator.pem" -ChefServerUrl "http://ipaddress:port" -OrganizationName "MyOrg" -Linux;

This command adds the Chef extension to a Linux virtual machine. When the virtual machine launches, it is bootstrapped with Chef. If you do not provide the client.rb, you need to provide the Chef server URL and organization.

Parameters

-BootstrapOptions

Specifies bootstrap options in JavaScript Object Notation (JSON) format.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-BootstrapVersion

Specifies the version of the Chef client that is installed together with the extension.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ChefDaemonInterval

Specifies the frequency (in minutes) at which the chef-service runs. If in case you don't want the chef-service to be installed on the Azure VM then set value as 0 in this field.

Type:String
Aliases:ChefServiceInterval
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ChefServerUrl

Specifies the URL of the Chef server.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ClientRb

Specifies the full path of the Chef client.rb.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Daemon

Configures the chef-client service for unattended execution. The node platform should be Windows. Allowed options: 'none','service' and 'task'. none - Currently prevents the chef-client service from being configured as a service. service - Configures the chef-client to run automatically in the background as a service. task - Configures the chef-client to run automatically in the background as a secheduled task.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-InformationAction

Specifies how this cmdlet responds to an information event.

The acceptable values for this parameter are:

  • Continue
  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend
Type:ActionPreference
Aliases:infa
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InformationVariable

Specifies an information variable.

Type:String
Aliases:iv
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-JsonAttribute

A JSON string to be added to the first run of chef-client. e.g. -JsonAttribute '{"foo" : "bar"}'

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Linux

Indicates that this cmdlet creates a Linux based virtual machine.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-OrganizationName

Specifies the organization name of the Chef extension.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Profile

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

Type:AzureSMProfile
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RunList

Specifies the Chef node run list.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Secret

The encryption key used to encrypt and decrypt the data bag item values.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-SecretFile

The path to the file that contains the encryption key used to encrypt and decrypt the data bag item values.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ValidationClientName

Specifies the name of the validation client.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ValidationPem

Specifies the Chef validator .pem file path.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Version

Specifies the version number of the Chef extension.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-VM

Specifies the persistent virtual machine object.

Type:IPersistentVM
Aliases:InputObject
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Windows

Indicates that this cmdlet creates a Windows virtual machine.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False