Skip to content

Added bootstrap_version option #1440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 22, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ public class SetAzureVMChefExtensionCommand : VirtualMachineChefExtensionCmdletB
[ValidateNotNullOrEmpty]
public SwitchParameter DeleteChefConfig { get; set; }

[Parameter(
ValueFromPipelineByPropertyName = true,
HelpMessage = "Chef client version to be installed with the extension")]
[ValidateNotNullOrEmpty]
public string BootstrapVersion { get; set; }

[Parameter(
Mandatory = true,
ParameterSetName = LinuxParameterSetName,
Expand Down Expand Up @@ -167,6 +173,7 @@ private void SetPublicConfig()
bool IsBootstrapOptionsEmpty = string.IsNullOrEmpty(this.BootstrapOptions);
string AutoUpdateChefClient = this.AutoUpdateChefClient.IsPresent ? "true" : "false";
string DeleteChefConfig = this.DeleteChefConfig.IsPresent ? "true" : "false";
string BootstrapVersion = this.BootstrapVersion;

//Cases handled:
// 1. When clientRb given by user and:
Expand Down Expand Up @@ -220,41 +227,44 @@ private void SetPublicConfig()
{
if (IsBootstrapOptionsEmpty)
{
this.PublicConfiguration = string.Format("{{{0},{1},{2}}}",
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3}}}",
string.Format(AutoUpdateTemplate, AutoUpdateChefClient),
string.Format(DeleteChefConfigTemplate, DeleteChefConfig),
string.Format(ClientRbTemplate, ClientConfig));
string.Format(ClientRbTemplate, ClientConfig),
string.Format(BootstrapVersionTemplate, BootstrapVersion));
}
else
{
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3}}}",
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4}}}",
string.Format(AutoUpdateTemplate, AutoUpdateChefClient),
string.Format(DeleteChefConfigTemplate, DeleteChefConfig),
string.Format(ClientRbTemplate, ClientConfig),
string.Format(BootStrapOptionsTemplate, this.BootstrapOptions));
string.Format(BootStrapOptionsTemplate, this.BootstrapOptions),
string.Format(BootstrapVersionTemplate, BootstrapVersion));
}
}
else
{
if (IsBootstrapOptionsEmpty)
{
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3}}}",
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4}}}",
string.Format(AutoUpdateTemplate, AutoUpdateChefClient),
string.Format(DeleteChefConfigTemplate, DeleteChefConfig),
string.Format(ClientRbTemplate, ClientConfig),
string.Format(RunListTemplate, this.RunList));
string.Format(RunListTemplate, this.RunList),
string.Format(BootstrapVersionTemplate, BootstrapVersion));
}
else
{
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4}}}",
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4},{5}}}",
string.Format(AutoUpdateTemplate, AutoUpdateChefClient),
string.Format(DeleteChefConfigTemplate, DeleteChefConfig),
string.Format(ClientRbTemplate, ClientConfig),
string.Format(RunListTemplate, this.RunList),
string.Format(BootStrapOptionsTemplate, this.BootstrapOptions));
string.Format(BootStrapOptionsTemplate, this.BootstrapOptions),
string.Format(BootstrapVersionTemplate, BootstrapVersion));
}
}

}

protected override void ValidateParameters()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class VirtualMachineChefExtensionCmdletBase : VirtualMachineExtensionCmdl
protected const string AutoUpdateTemplate = "\"autoUpdateClient\":\"{0}\"";
protected const string DeleteChefConfigTemplate = "\"deleteChefConfig\":\"{0}\"";
protected const string ClientRbTemplate = "\"client_rb\":\"{0}\"";
protected const string BootstrapVersionTemplate = "\"bootstrap_version\":\"{0}\"";
protected const string BootStrapOptionsTemplate = "\"bootstrap_options\":{0}";
protected const string RunListTemplate = "\"runlist\": \"\\\"{0}\\\"\"";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35125,6 +35125,12 @@ If this parameter is not specified, the default value is Standard_GRS. </maml:pa
<maml:para>Indicates that this cmdlet deletes the Chef configuration on the virtual machine.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true(ByPropertyName)" position="named" aliases="none">
<maml:name>BootstrapVersion</maml:name>
<maml:description>
<maml:para>Specifies the version of chef-client to be installed with the extension.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true(ByPropertyName)" position="named" aliases="none">
<maml:name>OrganizationName</maml:name>
<maml:description>
Expand Down Expand Up @@ -35214,6 +35220,12 @@ If this parameter is not specified, the default value is Standard_GRS. </maml:pa
<maml:para>Indicates that this cmdlet deletes the Chef configuration on the virtual machine.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true(ByPropertyName)" position="named" aliases="none">
<maml:name>BootstrapVersion</maml:name>
<maml:description>
<maml:para>Specifies the version of chef-client to be installed with the extension.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true(ByPropertyName)" position="named" aliases="none">
<maml:name>OrganizationName</maml:name>
<maml:description>
Expand Down Expand Up @@ -35330,6 +35342,18 @@ If this parameter is not specified, the default value is Standard_GRS. </maml:pa
</dev:type>
<dev:defaultValue>none</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true(ByPropertyName)" position="named" aliases="none">
<maml:name>BootstrapVersion</maml:name>
<maml:description>
<maml:para>Specifies the version of chef-client to be installed with the extension.</maml:para>
</maml:description>
<command:parameterValue required="false" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>none</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none">
<maml:name>Linux</maml:name>
<maml:description>
Expand Down