Skip to content

Commit 54f4be1

Browse files
author
aliasgar16
committed
Added daemon option in ChefExtension for ASM commands.
Signed-off-by: aliasgar16 <[email protected]>
1 parent 4d73bd0 commit 54f4be1

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/Chef/SetAzureVMChefExtension.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,15 @@ public class SetAzureVMChefExtensionCommand : VirtualMachineChefExtensionCmdletB
104104
[ValidateNotNullOrEmpty]
105105
public string BootstrapVersion { get; set; }
106106

107+
[Parameter(
108+
ValueFromPipelineByPropertyName = true,
109+
HelpMessage = "Configures the chef-client service for unattended execution. The node platform should be Windows." +
110+
"Options: 'auto' or 'service'." +
111+
"auto - Currently prevents the chef-client service from being configured as a service." +
112+
"service - Configures the chef-client to run automatically in the background as a service.")]
113+
[ValidateNotNullOrEmpty]
114+
public string Daemon { get; set; }
115+
107116
[Parameter(
108117
Mandatory = true,
109118
ParameterSetName = LinuxParameterSetName,
@@ -176,6 +185,7 @@ private void SetPublicConfig()
176185
bool IsJsonAttributeEmpty = string.IsNullOrEmpty(this.JsonAttribute);
177186
bool IsChefServiceIntervalEmpty = string.IsNullOrEmpty(this.ChefServiceInterval);
178187
string BootstrapVersion = string.IsNullOrEmpty(this.BootstrapVersion) ? "" : this.BootstrapVersion;
188+
bool IsDaemonEmpty = string.IsNullOrEmpty(this.Daemon);
179189

180190
//Cases handled:
181191
// 1. When clientRb given by user and:
@@ -248,6 +258,11 @@ private void SetPublicConfig()
248258
hashTable.Add(ChefServiceIntervalTemplate, this.ChefServiceInterval);
249259
}
250260

261+
if (!IsDaemonEmpty)
262+
{
263+
hashTable.Add(DaemonTemplate, this.Daemon);
264+
}
265+
251266
this.PublicConfiguration = JsonConvert.SerializeObject(hashTable);
252267
}
253268

src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/Chef/VirtualMachineChefExtensionCmdletBase.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public class VirtualMachineChefExtensionCmdletBase : VirtualMachineExtensionCmdl
2828
protected const string JsonAttributeTemplate = "custom_json_attr";
2929
protected const string ChefServiceIntervalTemplate = "chef_service_interval";
3030
protected const string RunListTemplate = "runlist";
31+
protected const string DaemonTemplate = "daemon";
3132

3233
public VirtualMachineChefExtensionCmdletBase()
3334
{

src/ServiceManagement/Services/Commands.Utilities/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
- FullBackupStartHour : Specifies the hour of the day when the Sql Server Full Backup should start.
2828
- FullBackupWindowInHours : Specifies the window (in hours) when Sql Server Full Backup should occur.
2929
- LogBackupFrequencyInMinutes : Specifies the frequency of Sql Server Log Backup.
30+
* Updated Set-AzureVMChefExtension cmdlet to add following new options :
31+
- Daemon: Configures the chef-client service for unattended execution. e.g. -Daemon 'auto' or e.g. -Daemon 'service'."
3032

3133
## Version 3.3.0
3234
* Updated Set-AzureVMChefExtension cmdlet to add following new options :

0 commit comments

Comments
 (0)