Set-​Azure​Rm​VM​Chef​Extension

Adds a Chef extension to a virtual machine.

Syntax

Set-AzureRmVMChefExtension
   [-ResourceGroupName] <String>
   [[-TypeHandlerVersion] <String>]
   [[-AutoUpgradeMinorVersion] <Boolean>]
   [-VMName] <String>
   [[-Location] <String>]
   [[-Name] <String>]
   [-BootstrapOptions <String>]
   [-BootstrapVersion <String>]
   [-ChefServerUrl <String>]
   [-ChefServiceInterval <String>]
   [-ClientRb <String>]
   [-JsonAttribute <String>]
   [-Linux]
   [-OrganizationName <String>]
   [-RunList <String>]
   [-ValidationClientName <String>]
   -ValidationPem <String>
   [-Secret <String>]
   [-SecretFile <String>]
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]
Set-AzureRmVMChefExtension
   [-ResourceGroupName] <String>
   [[-TypeHandlerVersion] <String>]
   [[-AutoUpgradeMinorVersion] <Boolean>]
   [-VMName] <String>
   [[-Location] <String>]
   [[-Name] <String>]
   [-BootstrapOptions <String>]
   [-BootstrapVersion <String>]
   [-ChefServerUrl <String>]
   [-ChefServiceInterval <String>]
   [-ClientRb <String>]
   [-JsonAttribute <String>]
   [-OrganizationName <String>]
   [-RunList <String>]
   [-ValidationClientName <String>]
   -ValidationPem <String>
   [-Daemon <String>]
   [-Secret <String>]
   [-SecretFile <String>]
   [-Windows]
   [-Confirm]
   [-WhatIf]
   [<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-AzureRmVMChefExtension -ResourceGroupName "ResourceGroup001" -VMName "WindowsVM001" -ValidationPem "C:\my-org-validator.pem" -ClientRb "C:\client.rb" -RunList "Apache" -Daemon "service" -SecretFile "C:\my_encrypted_data_bag_secret" -Windows

This command adds a Chef extension to a Windows virtual machine named WindowsVM001. When the virtual machine starts, Chef bootstraps the virtual machine to run Apache.

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

PS C:\>Set-AzureRmVMChefExtension -ResourceGroupName "ResourceGroup002" -VMName "LinuxVM001" -ValidationPem "C:\my-org-validator.pem" -ClientRb "C:\client.rb" -RunList "Apache" -Secret "my_secret" -Linux

This command adds a Chef extension to a Linux virtual machine named LinuxVM001. When the virtual machine starts, Chef bootstraps the virtual machine to run Apache.

Example 3: Add a Chef extension to a Windows virtual machine with bootstrap options

PS C:\>Set-AzureRmVMChefExtension -ResourceGroupName "ResourceGroup003" -VMName "WindowsVM002" -ValidationPem C:\my-org-validator.pem -ClientRb C:\client.rb -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 named WindowsVM002. When the virtual machine starts, Chef bootstraps the virtual machine to run Apache. After bootstrapping, the virtual machine refers to the BootstrapOptions specified in JSON format.

Required Parameters

-Linux

Indicates that this cmdlet creates a Windows virtual machine.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResourceGroupName

Specifies the name of the resource group that contains the virtual machine.

Type:String
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-VMName

Specifies the name of a virtual machine. This cmdlet adds the Chef extension for the virtual machine that this parameter specifies.

Type:String
Aliases:ResourceName
Position:2
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ValidationPem

Specifies the Chef validator .pem file path

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Windows

Indicates that this cmdlet creates a Windows virtual machine.

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

Optional Parameters

-AutoUpgradeMinorVersion
Type:Boolean
Position:11
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-BootstrapOptions

Specifies configuration settings in the client_rb option.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-BootstrapVersion

Specifies the version of the bootstrap configuration.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ChefServerUrl

Specifies the Chef server link, as a URL.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ChefServiceInterval

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
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ClientRb

Specifies the full path of the Chef client.rb.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
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
Accept pipeline input:True (ByPropertyName)
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
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Location

Specifies the location of the virtual machine.

Type:String
Position:8
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Name

Specifies the name of the Chef extension.

Type:String
Aliases:ExtensionName
Position:9
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-OrganizationName

Specifies the organization name of the Chef extension.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-RunList

Specifies the Chef node run list.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
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
Accept pipeline input:True (ByPropertyName)
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
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-TypeHandlerVersion

Specifies the version of the extension to use for this virtual machine.

Type:String
Aliases:HandlerVersion, Version
Position:10
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ValidationClientName
Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs.The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False