ansible / ansible.builtin / v2.4.4.0-1 / module / win_dsc Invokes a PowerShell DSC configuration | "added in version" 2.4 of ansible.builtin" Authors: Trond Hindenes preview | supported by communityansible.builtin.win_dsc (v2.4.4.0-1) — module
pip
Install with pip install ansible==2.4.4.0.post1
Invokes a PowerShell DSC Configuration. Requires PowerShell version 5 (February release or newer).
Most of the parameters for this module are dynamic and will vary depending on the DSC Resource.
# Playbook example - name: Extract zip file win_dsc: resource_name: archive ensure: Present path: "C:\\Temp\\zipfile.zip" destination: "C:\\Temp\\Temp2"
- name: Invoke DSC with check mode win_dsc: resource_name: windowsfeature name: telnet-client
resource_name: description: - The DSC Resource to use. Must be accessible to PowerShell using any of the default paths. required: true module_version: default: latest description: - Can be used to configure the exact version of the dsc resource to be invoked. - Useful if the target node has multiple versions installed of the module containing the DSC resource. - If not specified, the module will follow standard Powershell convention and use the highest version available.
attributes: contains: Key: description: Attribute key Value: description: Attribute value description: The attributes/parameters passed in to the DSC resource as key/value pairs returned: always sample: null type: complex dsc_attributes: contains: Key: description: Attribute key Value: description: Attribute value description: The attributes/parameters as returned from the DSC engine in dict format returned: always type: complex message: description: any error message from invoking the DSC resource returned: error sample: Multiple DSC modules found with resource name xyz type: string module_version: description: The version of the dsc resource/module used. returned: success sample: 1.0.1 type: string reboot_required: description: flag returned from the DSC engine indicating whether or not the machine requires a reboot for the invoked changes to take effect returned: always sample: true type: boolean resource_name: description: The name of the invoked resource returned: always sample: windowsfeature type: string