@@ -33,6 +33,8 @@ public class SetAzureVMChefExtensionCommand : VirtualMachineExtensionBaseCmdlet
33
33
private string PrivateConfigurationTemplate = "validation_key" ;
34
34
private string AutoUpdateTemplate = "autoUpdateClient" ;
35
35
private string DeleteChefConfigTemplate = "deleteChefConfig" ;
36
+ private string BootstrapVersionTemplate = "bootstrap_version" ;
37
+ private string UninstallChefClientTemplate = "uninstallChefClient" ;
36
38
private string ClientRbTemplate = "client_rb" ;
37
39
private string BootStrapOptionsTemplate = "bootstrap_options" ;
38
40
private string RunListTemplate = "runlist" ;
@@ -128,6 +130,18 @@ public string TypeHandlerVersion
128
130
[ ValidateNotNullOrEmpty ]
129
131
public SwitchParameter DeleteChefConfig { get ; set ; }
130
132
133
+ [ Parameter (
134
+ ValueFromPipelineByPropertyName = true ,
135
+ HelpMessage = "Chef client version to be installed with the extension. Works for only linux." ) ]
136
+ [ ValidateNotNullOrEmpty ]
137
+ public string BootstrapVersion { get ; set ; }
138
+
139
+ [ Parameter (
140
+ ValueFromPipelineByPropertyName = true ,
141
+ HelpMessage = "Uninstall Chef client during update/uninstall extension. Default is false." ) ]
142
+ [ ValidateNotNullOrEmpty ]
143
+ public SwitchParameter UninstallChefClient { get ; set ; }
144
+
131
145
[ Parameter (
132
146
Mandatory = true ,
133
147
ParameterSetName = LinuxParameterSetName ,
@@ -210,6 +224,8 @@ private Hashtable PublicConfiguration
210
224
bool IsBootstrapOptionsEmpty = string . IsNullOrEmpty ( this . BootstrapOptions ) ;
211
225
string AutoUpdateChefClient = this . AutoUpdateChefClient . IsPresent ? "true" : "false" ;
212
226
string DeleteChefConfig = this . DeleteChefConfig . IsPresent ? "true" : "false" ;
227
+ string BootstrapVersion = this . BootstrapVersion ;
228
+ string UninstallChefClient = this . UninstallChefClient . IsPresent ? "true" : "false" ;
213
229
214
230
//Cases handled:
215
231
// 1. When clientRb given by user and:
@@ -264,6 +280,8 @@ private Hashtable PublicConfiguration
264
280
var hashTable = new Hashtable ( ) ;
265
281
hashTable . Add ( AutoUpdateTemplate , AutoUpdateChefClient ) ;
266
282
hashTable . Add ( DeleteChefConfigTemplate , DeleteChefConfig ) ;
283
+ hashTable . Add ( BootstrapVersionTemplate , BootstrapVersion ) ;
284
+ hashTable . Add ( UninstallChefClientTemplate , UninstallChefClient ) ;
267
285
hashTable . Add ( ClientRbTemplate , ClientConfig ) ;
268
286
this . publicConfiguration = hashTable ;
269
287
}
@@ -272,6 +290,8 @@ private Hashtable PublicConfiguration
272
290
var hashTable = new Hashtable ( ) ;
273
291
hashTable . Add ( AutoUpdateTemplate , AutoUpdateChefClient ) ;
274
292
hashTable . Add ( DeleteChefConfigTemplate , DeleteChefConfig ) ;
293
+ hashTable . Add ( BootstrapVersionTemplate , BootstrapVersion ) ;
294
+ hashTable . Add ( UninstallChefClientTemplate , UninstallChefClient ) ;
275
295
hashTable . Add ( ClientRbTemplate , ClientConfig ) ;
276
296
hashTable . Add ( BootStrapOptionsTemplate , this . BootstrapOptions ) ;
277
297
this . publicConfiguration = hashTable ;
@@ -284,6 +304,8 @@ private Hashtable PublicConfiguration
284
304
var hashTable = new Hashtable ( ) ;
285
305
hashTable . Add ( AutoUpdateTemplate , AutoUpdateChefClient ) ;
286
306
hashTable . Add ( DeleteChefConfigTemplate , DeleteChefConfig ) ;
307
+ hashTable . Add ( BootstrapVersionTemplate , BootstrapVersion ) ;
308
+ hashTable . Add ( UninstallChefClientTemplate , UninstallChefClient ) ;
287
309
hashTable . Add ( ClientRbTemplate , ClientConfig ) ;
288
310
hashTable . Add ( RunListTemplate , this . RunList ) ;
289
311
this . publicConfiguration = hashTable ;
@@ -293,6 +315,8 @@ private Hashtable PublicConfiguration
293
315
var hashTable = new Hashtable ( ) ;
294
316
hashTable . Add ( AutoUpdateTemplate , AutoUpdateChefClient ) ;
295
317
hashTable . Add ( DeleteChefConfigTemplate , DeleteChefConfig ) ;
318
+ hashTable . Add ( BootstrapVersionTemplate , BootstrapVersion ) ;
319
+ hashTable . Add ( UninstallChefClientTemplate , UninstallChefClient ) ;
296
320
hashTable . Add ( ClientRbTemplate , ClientConfig ) ;
297
321
hashTable . Add ( RunListTemplate , this . RunList ) ;
298
322
hashTable . Add ( BootStrapOptionsTemplate , this . BootstrapOptions ) ;
0 commit comments