![]() Module before being passed to the DSC engine.A couple of weeks ago I blogged about my first experiences with the new Desired State Configuration (DSC) feature that is part of Windows Server 2012-R2 and Windows 8.1 Preview (and will also be available for Windows 8/2012 and Windows 7/2008-R2). Is recommended because the values are not manually parsed by the win_dsc Or as a comma-separated string which is then cast to their type. Simple type arrays like ] or ] are defined as a list A ] is defined withĮmbeddedInstance("MSFT_KeyValuePair") in a DSC resource MOF definition. HashTable Type Ī object is also a dictionary but does not have a strict set of TheĬlass definition is typically located in the. To determine the keys that can be used and the types of each key value. Please read through the documentation of the resource This class accepts four boolean variables, Anonymous, Basic,ĭigest, and Windows. In the above example, the CIM instance is a representation of the class # AuthenticationInfo = MSFT_xWebAuthenticationInformation AuthenticationInfo : Anonymous : false Basic : true Digest : false Windows : true _username and _password for the username and password, respectively. The definition of that parameter should have two entries that are suffixed with Will try to convert the defined options to the correct type during execution.įor simple types like and, this is a simple operation,īut complex types like or arrays (like ])Ī object is used to store credentials in a secure way, butĪnsible has no way to serialize this over JSON. Property Types Įach DSC resource property has a type that is associated with it. On the task to stop all task output from being logged. Reasons if there are any other sensitive module options, set no_log: True Any *_password option will be masked in the output for security Show the default value for a DSC property, only what was set from the Ansible Well as other possible values that were not set. The invocation.module_args key shows the actual values that were set as Resource as an example, this is the DSC definition as documented by Microsoft:Ĭhanged : => ![]() The win_dsc module takes in a free-form of options so that it changesĪccording to the resource it is managing. If you have more experience with DSC over AnsibleĪnd it does the job, just use DSC for that task. In the end, it doesn’t matter whether the task is performed with DSC or anĪnsible module what matters is that the task is performed correctly and the There are bugs in an existing Ansible module The Ansible module does not support a feature present in a DSC resource Reasons for using a DSC resource over an Ansible module: There are bugs in a DSC resource where an Ansible module works Win_regedit can manage the REG_NONE property type, while the DSCĭSC resources have limited check mode support, while some Ansible modules haveĭSC resources do not support diff mode, while some Ansible modules doĬustom resources require further installation steps to be run on the hostīeforehand, while Ansible modules are built-in to Ansible The DSC resource does not offer a feature present in an Ansible module. The host does not support PowerShell v5.0, or it cannot easily be upgraded Reasons for using an Ansible module over a DSC resource: This, resources like the DSC File resourceĪnd Ansible win_file can be used to achieve the same result. Why Use DSC? ĭSC and Ansible modules have a common goal which is to define and ensure the state of a Once the PowerShell requirements have been met, using DSC is as simple asĬreating a task with the win_dsc module. All supported hosts can be upgraded to PowerShell v5. To use the win_dsc module, a Windows host must have PowerShell v5.0 or More details on DSC can be viewed at DSC Overview. SinceĪnsible 2.4, the win_dsc module has been added and can be used to take advantage ofĮxisting DSC resources when interacting with a Windows host. Is the same as Ansible, it is just executed in a different manner. Controlling how Ansible behaves: precedence rulesĭesired State Configuration, or DSC, is a tool built into PowerShell that canīe used to define a Windows host setup through code.Virtualization and Containerization Guides. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |