< Back

Set-AzureVMChefExtension

Wed Jan 30, 2019 5:54 pm

NAME Set-AzureVMChefExtension



SYNOPSIS

Adds the Chef extension to the virtual machine.





SYNTAX

Set-AzureVMChefExtension [-Version <String>] -ValidationPem <String> [-ClientRb <String>] [-BootstrapOptions <String>] [-JsonAttribute <String>]

[-ChefDaemonInterval <String>] [-Daemon <String>] [-Secret <String>] [-SecretFile <String>] [-RunList <String>] [-ChefServerUrl <String>]

[-ValidationClientName <String>] [-OrganizationName <String>] [-BootstrapVersion <String>] -Windows -VM <IPersistentVM> [-Profile <AzureSMProfile>]

[-InformationAction <ActionPreference>] [-InformationVariable <String>] [<CommonParameters>]



Set-AzureVMChefExtension [-Version <String>] -ValidationPem <String> [-ClientRb <String>] [-BootstrapOptions <String>] [-JsonAttribute <String>]

[-ChefDaemonInterval <String>] [-Secret <String>] [-SecretFile <String>] [-RunList <String>] [-ChefServerUrl <String>] [-ValidationClientName <String>]

[-OrganizationName <String>] [-BootstrapVersion <String>] -VM <IPersistentVM> [-Profile <AzureSMProfile>] [-InformationAction <ActionPreference>]

[-InformationVariable <String>] -Linux [<CommonParameters>]





DESCRIPTION

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





PARAMETERS

-Version <String>

Specifies the version number of the Chef extension.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ValidationPem <String>

Specifies the Chef validator .pem file path



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ClientRb <String>

Specifies the full path of the Chef client.rb.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-BootstrapOptions <String>





Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-JsonAttribute <String>

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



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ChefDaemonInterval <String>

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.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Daemon <String>

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.



Required? false

Position? named

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Secret <String>

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



Required? false

Position? named

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-SecretFile <String>

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



Required? false

Position? named

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-RunList <String>

Specifies the Chef node run list.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ChefServerUrl <String>





Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ValidationClientName <String>





Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-OrganizationName <String>

Specifies the organization name of the Chef extension.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-BootstrapVersion <String>

Specifies the version of chef-client to be installed with the extension.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Windows [<SwitchParameter>]

Indicates that this cmdlet creates a Windows virtual machine.



Required? true

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-VM <IPersistentVM>

Specifies the persistent virtual machine object.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue, ByPropertyName)

Accept wildcard characters? false



-Profile <AzureSMProfile>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationAction <ActionPreference>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationVariable <String>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Linux [<SwitchParameter>]

Indicates that this cmdlet creates a Linux based virtual machine.



Required? true

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES









-------------------------- 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.

-------------------------- Example 5: Add a Chef extension to a Windows virtual machine with option -JsonAttribute --------------------------



PS C:\\>Set-AzureVMChefExtension -VM $VM -ValidationPem "C:\\\\myorg-validator.pem" -JsonAttribute '{"your_custom_attribute":"your_custom_attr_value"}'

-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. Adds custom json attributes at first run of chef-client.



RELATED LINKS

Get-AzureVMChefExtension

Remove-AzureVMChefExtension

Azure Service Cmdlets