Edit

Share via


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 Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.

The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.

Syntax

Windows (Default)

Set-AzureVMChefExtension
    -ValidationPem <String>
    -VM <IPersistentVM>
    [-Version <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]
    [-Profile <AzureSMProfile>]
    [-InformationAction <ActionPreference>]
    [-InformationVariable <String>]
    [<CommonParameters>]

Linux

Set-AzureVMChefExtension
    -ValidationPem <String>
    -VM <IPersistentVM>
    [-Version <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]
    [-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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-BootstrapVersion

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments: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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ChefServiceInterval

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ChefServerUrl

Specifies the URL of the Chef server.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ClientRb

Specifies the full path of the Chef client.rb.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments: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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-InformationAction

Specifies how this cmdlet responds to an information event.

The acceptable values for this parameter are:

  • Continue
  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend

Parameter properties

Type:ActionPreference
Default value:None
Supports wildcards:False
DontShow:False
Aliases:infa

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InformationVariable

Specifies an information variable.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:iv

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-JsonAttribute

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Linux

Indicates that this cmdlet creates a Linux based virtual machine.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Linux
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-OrganizationName

Specifies the organization name of the Chef extension.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments: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.

Parameter properties

Type:AzureSMProfile
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RunList

Specifies the Chef node run list.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Secret

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-SecretFile

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ValidationClientName

Specifies the name of the validation client.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ValidationPem

Specifies the Chef validator .pem file path.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Version

Specifies the version number of the Chef extension.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-VM

Specifies the persistent virtual machine object.

Parameter properties

Type:IPersistentVM
Default value:None
Supports wildcards:False
DontShow:False
Aliases:InputObject

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-Windows

Indicates that this cmdlet creates a Windows virtual machine.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Windows
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.