Repository navigation
Conversation
Docs Build 📝Thank you for contribution!✨ The docsite for this PR is available for download as an artifact from this run: You can compare to the docs for the File changes:
Click to see the diff comparison.NOTE: only file modifications are shown here. New and deleted files are excluded. The diff output was truncated because it exceeded the maximum size. diff --git a/home/runner/work/ansible.windows/ansible.windows/docsbuild/base/async_status_module.html b/home/runner/work/ansible.windows/ansible.windows/docsbuild/head/async_status_module.html
index bdb27ab..ce7172a 100644
--- a/home/runner/work/ansible.windows/ansible.windows/docsbuild/base/async_status_module.html
+++ b/home/runner/work/ansible.windows/ansible.windows/docsbuild/head/async_status_module.html
@@ -104,8 +104,10 @@
<li class="toctree-l1"><a class="reference internal" href="win_copy_module.html">ansible.windows.win_copy module – Copies files to remote locations on windows hosts</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_credential_module.html">ansible.windows.win_credential module – Manages Windows Credentials in the Credential Manager</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_dhcp_lease_module.html">ansible.windows.win_dhcp_lease module – Manage Windows Server DHCP Leases</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_disk_info_module.html">ansible.windows.win_disk_info module – Gather disk, partition, and volume information on Windows</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_dns_client_module.html">ansible.windows.win_dns_client module – Configures DNS lookup on Windows hosts</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_dns_record_module.html">ansible.windows.win_dns_record module – Manage Windows Server DNS records</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_dns_record_info_module.html">ansible.windows.win_dns_record_info module – Get Windows Server DNS records</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_dns_zone_module.html">ansible.windows.win_dns_zone module – Manage Windows Server DNS Zones</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_dsc_module.html">ansible.windows.win_dsc module – Invokes a PowerShell DSC configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_environment_module.html">ansible.windows.win_environment module – Modify environment variables on windows hosts</a></li>
@@ -116,6 +118,10 @@
<li class="toctree-l1"><a class="reference internal" href="win_file_compression_module.html">ansible.windows.win_file_compression module – Alters the compression of files and directories on NTFS partitions.</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_find_module.html">ansible.windows.win_find module – Return a list of files based on specific criteria</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_firewall_module.html">ansible.windows.win_firewall module – Enable or disable the Windows Firewall</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_firewall_rule_module.html">ansible.windows.win_firewall_rule module – Windows firewall automation</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_firewall_rule_info_module.html">ansible.windows.win_firewall_rule_info module – Gather information about Windows firewall rules</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_format_module.html">ansible.windows.win_format module – Formats an existing volume or a new volume on an existing partition on Windows</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_format_info_module.html">ansible.windows.win_format_info module – Gather information about Windows volumes</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_get_url_module.html">ansible.windows.win_get_url module – Downloads file from HTTP, HTTPS, or FTP to node</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_group_module.html">ansible.windows.win_group module – Add and remove local groups</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_group_membership_module.html">ansible.windows.win_group_membership module – Manage Windows local group membership</a></li>
@@ -124,11 +130,17 @@
<li class="toctree-l1"><a class="reference internal" href="win_hotfix_module.html">ansible.windows.win_hotfix module – Install and uninstalls Windows hotfixes</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_http_proxy_module.html">ansible.windows.win_http_proxy module – Manages proxy settings for WinHTTP</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_inet_proxy_module.html">ansible.windows.win_inet_proxy module – Manages proxy settings for WinINet and Internet Explorer</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_inf_printer_driver_module.html">ansible.windows.win_inf_printer_driver module – Manage INF-based Windows printer drivers</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_initialize_disk_module.html">ansible.windows.win_initialize_disk module – Initializes disks on Windows Server</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_initialize_disk_info_module.html">ansible.windows.win_initialize_disk_info module – Gather information about disks on Windows Server</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_lineinfile_module.html">ansible.windows.win_lineinfile module – Ensure a particular line is in a file, or replace an existing line using a back-referenced regular expression</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_listen_ports_facts_module.html">ansible.windows.win_listen_ports_facts module – Recopilates the facts of the listening ports of the machine</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_mapped_drive_module.html">ansible.windows.win_mapped_drive module – Map network drives for users</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_optional_feature_module.html">ansible.windows.win_optional_feature module – Manage optional Windows features</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_owner_module.html">ansible.windows.win_owner module – Set owner</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_package_module.html">ansible.windows.win_package module – Installs/uninstalls an installable package</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_partition_module.html">ansible.windows.win_partition module – Creates, changes and removes partitions on Windows Server</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_partition_info_module.html">ansible.windows.win_partition_info module – Gather information about Windows disk partitions</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_path_module.html">ansible.windows.win_path module – Manage Windows path environment variables</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_ping_module.html">ansible.windows.win_ping module – A windows version of the classic ping module</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_powershell_module.html">ansible.windows.win_powershell module – Run PowerShell scripts</a></li>
@@ -139,6 +151,8 @@
<li class="toctree-l1"><a class="reference internal" href="win_regedit_module.html">ansible.windows.win_regedit module – Add, change, or remove registry keys and values</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_region_module.html">ansible.windows.win_region module – Set the region and format settings</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_route_module.html">ansible.windows.win_route module – Add or remove a static route</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_scheduled_task_module.html">ansible.windows.win_scheduled_task module – Manage scheduled tasks</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_scheduled_task_info_module.html">ansible.windows.win_scheduled_task_info module – Get information about Windows Scheduled Tasks</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_service_module.html">ansible.windows.win_service module – Manage Windows services</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_service_info_module.html">ansible.windows.win_service_info module – Gather information about Windows services</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_share_module.html">ansible.windows.win_share module – Manage Windows shares</a></li>
@@ -191,7 +205,7 @@
<h1>ansible.windows.async_status module – Obtain status of asynchronous task<a class="headerlink" href="#ansible-windows-async-status-module-obtain-status-of-asynchronous-task" title="Link to this heading"></a></h1>
<div class="admonition note">
<p class="admonition-title">Note</p>
-<p>This module is part of the <a class="reference external" href="https://galaxy.ansible.com/ui/repo/published/ansible/windows/">ansible.windows collection</a> (version 3.8.0).</p>
+<p>This module is part of the <a class="reference external" href="https://galaxy.ansible.com/ui/repo/published/ansible/windows/">ansible.windows collection</a> (version 3.9.2).</p>
<p>It is not included in <code class="docutils literal notranslate"><span class="pre">ansible-core</span></code>.
To check whether it is installed, run <code class="code docutils literal notranslate"><span class="pre">ansible-galaxy</span> <span class="pre">collection</span> <span class="pre">list</span></code>.</p>
<p>To install it, use: <code class="code docutils literal notranslate"><span class="pre">ansible-galaxy</span> <span class="pre">collection</span> <span class="pre">install</span> <span class="pre">ansible.windows</span></code>.</p>
diff --git a/home/runner/work/ansible.windows/ansible.windows/docsbuild/base/dsc3_module.html b/home/runner/work/ansible.windows/ansible.windows/docsbuild/head/dsc3_module.html
index 6c81a99..f746003 100644
--- a/home/runner/work/ansible.windows/ansible.windows/docsbuild/base/dsc3_module.html
+++ b/home/runner/work/ansible.windows/ansible.windows/docsbuild/head/dsc3_module.html
@@ -78,6 +78,8 @@
<li class="toctree-l1 current"><a class="current reference internal" href="#">ansible.windows.dsc3 module – Sets or checks DSC v3 configuration state</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#synopsis">Synopsis</a></li>
<li class="toctree-l2"><a class="reference internal" href="#parameters">Parameters</a></li>
+<li class="toctree-l2"><a class="reference internal" href="#notes">Notes</a></li>
+<li class="toctree-l2"><a class="reference internal" href="#see-also">See Also</a></li>
<li class="toctree-l2"><a class="reference internal" href="#examples">Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="#return-values">Return Values</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#authors">Authors</a></li>
@@ -102,8 +104,10 @@
<li class="toctree-l1"><a class="reference internal" href="win_copy_module.html">ansible.windows.win_copy module – Copies files to remote locations on windows hosts</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_credential_module.html">ansible.windows.win_credential module – Manages Windows Credentials in the Credential Manager</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_dhcp_lease_module.html">ansible.windows.win_dhcp_lease module – Manage Windows Server DHCP Leases</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_disk_info_module.html">ansible.windows.win_disk_info module – Gather disk, partition, and volume information on Windows</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_dns_client_module.html">ansible.windows.win_dns_client module – Configures DNS lookup on Windows hosts</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_dns_record_module.html">ansible.windows.win_dns_record module – Manage Windows Server DNS records</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_dns_record_info_module.html">ansible.windows.win_dns_record_info module – Get Windows Server DNS records</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_dns_zone_module.html">ansible.windows.win_dns_zone module – Manage Windows Server DNS Zones</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_dsc_module.html">ansible.windows.win_dsc module – Invokes a PowerShell DSC configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_environment_module.html">ansible.windows.win_environment module – Modify environment variables on windows hosts</a></li>
@@ -114,6 +118,10 @@
<li class="toctree-l1"><a class="reference internal" href="win_file_compression_module.html">ansible.windows.win_file_compression module – Alters the compression of files and directories on NTFS partitions.</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_find_module.html">ansible.windows.win_find module – Return a list of files based on specific criteria</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_firewall_module.html">ansible.windows.win_firewall module – Enable or disable the Windows Firewall</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_firewall_rule_module.html">ansible.windows.win_firewall_rule module – Windows firewall automation</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_firewall_rule_info_module.html">ansible.windows.win_firewall_rule_info module – Gather information about Windows firewall rules</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_format_module.html">ansible.windows.win_format module – Formats an existing volume or a new volume on an existing partition on Windows</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_format_info_module.html">ansible.windows.win_format_info module – Gather information about Windows volumes</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_get_url_module.html">ansible.windows.win_get_url module – Downloads file from HTTP, HTTPS, or FTP to node</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_group_module.html">ansible.windows.win_group module – Add and remove local groups</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_group_membership_module.html">ansible.windows.win_group_membership module – Manage Windows local group membership</a></li>
@@ -122,11 +130,17 @@
<li class="toctree-l1"><a class="reference internal" href="win_hotfix_module.html">ansible.windows.win_hotfix module – Install and uninstalls Windows hotfixes</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_http_proxy_module.html">ansible.windows.win_http_proxy module – Manages proxy settings for WinHTTP</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_inet_proxy_module.html">ansible.windows.win_inet_proxy module – Manages proxy settings for WinINet and Internet Explorer</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_inf_printer_driver_module.html">ansible.windows.win_inf_printer_driver module – Manage INF-based Windows printer drivers</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_initialize_disk_module.html">ansible.windows.win_initialize_disk module – Initializes disks on Windows Server</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_initialize_disk_info_module.html">ansible.windows.win_initialize_disk_info module – Gather information about disks on Windows Server</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_lineinfile_module.html">ansible.windows.win_lineinfile module – Ensure a particular line is in a file, or replace an existing line using a back-referenced regular expression</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_listen_ports_facts_module.html">ansible.windows.win_listen_ports_facts module – Recopilates the facts of the listening ports of the machine</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_mapped_drive_module.html">ansible.windows.win_mapped_drive module – Map network drives for users</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_optional_feature_module.html">ansible.windows.win_optional_feature module – Manage optional Windows features</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_owner_module.html">ansible.windows.win_owner module – Set owner</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_package_module.html">ansible.windows.win_package module – Installs/uninstalls an installable package</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_partition_module.html">ansible.windows.win_partition module – Creates, changes and removes partitions on Windows Server</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_partition_info_module.html">ansible.windows.win_partition_info module – Gather information about Windows disk partitions</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_path_module.html">ansible.windows.win_path module – Manage Windows path environment variables</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_ping_module.html">ansible.windows.win_ping module – A windows version of the classic ping module</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_powershell_module.html">ansible.windows.win_powershell module – Run PowerShell scripts</a></li>
@@ -137,6 +151,8 @@
<li class="toctree-l1"><a class="reference internal" href="win_regedit_module.html">ansible.windows.win_regedit module – Add, change, or remove registry keys and values</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_region_module.html">ansible.windows.win_region module – Set the region and format settings</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_route_module.html">ansible.windows.win_route module – Add or remove a static route</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_scheduled_task_module.html">ansible.windows.win_scheduled_task module – Manage scheduled tasks</a></li>
+<li class="toctree-l1"><a class="reference internal" href="win_scheduled_task_info_module.html">ansible.windows.win_scheduled_task_info module – Get information about Windows Scheduled Tasks</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_service_module.html">ansible.windows.win_service module – Manage Windows services</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_service_info_module.html">ansible.windows.win_service_info module – Gather information about Windows services</a></li>
<li class="toctree-l1"><a class="reference internal" href="win_share_module.html">ansible.windows.win_share module – Manage Windows shares</a></li>
@@ -189,7 +205,7 @@
<h1>ansible.windows.dsc3 module – Sets or checks DSC v3 configuration state<a class="headerlink" href="#ansible-windows-dsc3-module-sets-or-checks-dsc-v3-configuration-state" title="Link to this heading"></a></h1>
<div class="admonition note">
<p class="admonition-title">Note</p>
-<p>This module is part of the <a class="reference external" href="https://galaxy.ansible.com/ui/repo/published/ansible/windows/">ansible.windows collection</a> (version 3.8.0).</p>
+<p>This module is part of the <a class="reference external" href="https://galaxy.ansible.com/ui/repo/published/ansible/windows/">ansible.windows collection</a> (version 3.9.2).</p>
<p>It is not included in <code class="docutils literal notranslate"><span class="pre">ansible-core</span></code>.
To check whether it is installed, run <code class="code docutils literal notranslate"><span class="pre">ansible-galaxy</span> <span class="pre">collection</span> <span class="pre">list</span></code>.</p>
<p>To install it, use: <code class="code docutils literal notranslate"><span class="pre">ansible-galaxy</span> <span class="pre">collection</span> <span class="pre">install</span> <span class="pre">ansible.windows</span></code>.</p>
@@ -200,15 +216,18 @@ To check whether it is installed, run <code class="code docutils literal notrans
<ul class="simple">
<li><p><a class="reference internal" href="#synopsis" id="id1">Synopsis</a></p></li>
<li><p><a class="reference internal" href="#parameters" id="id2">Parameters</a></p></li>
-<li><p><a class="reference internal" href="#examples" id="id3">Examples</a></p></li>
-<li><p><a class="reference internal" href="#return-values" id="id4">Return Values</a></p></li>
+<li><p><a class="reference internal" href="#notes" id="id3">Notes</a></p></li>
+<li><p><a class="reference internal" href="#see-also" id="id4">See Also</a></p></li>
+<li><p><a class="reference internal" href="#examples" id="id5">Examples</a></p></li>
+<li><p><a class="reference internal" href="#return-values" id="id6">Return Values</a></p></li>
</ul>
</nav>
<section id="synopsis">
<h2><a class="toc-backref" href="#id1" role="doc-backlink">Synopsis</a><a class="headerlink" href="#synopsis" title="Link to this heading"></a></h2>
<ul class="simple">
-<li><p>Calls <code class="docutils literal notranslate"><span class="pre">dsc</span> <span class="pre">config</span> <span class="pre">set</span></code> or <code class="docutils literal notranslate"><span class="pre">dsc</span> <span class="pre">config</span> <span class="pre">test</span></code> using <code class="ansible-option docutils literal notranslate"><strong><a class="reference internal" href="#ansible-collections-ansible-windows-dsc3-module-parameter-config"><span class="std std-ref"><span class="pre">config</span></span></a></strong></code> as the configuration document.</p></li>
-<li><p>This module assumes that <code class="docutils literal notranslate"><span class="pre">dsc</span></code> can be found using <code class="xref std std-envvar docutils literal notranslate"><span class="pre">PATH</span></code> environment variable, and <code class="docutils literal notranslate"><span class="pre">dsc</span></code> itself relies on <code class="xref std std-envvar docutils literal notranslate"><span class="pre">PATH</span></code> for resource discovery. Manipulate the environment variable directly if <code class="docutils literal notranslate"><span class="pre">dsc</span></code> is not already discoverable using <code class="xref std std-envvar docutils literal notranslate"><span class="pre">PATH</span></code>.</p></li>
+<li><p>Calls <code class="docutils literal notranslate"><span class="pre">dsc</span> <span class="pre">config</span> <span class="pre">set</span></code> using <code class="ansible-option docutils literal notranslate"><strong><a class="reference internal" href="#ansible-collections-ansible-windows-dsc3-module-parameter-config"><span class="std std-ref"><span class="pre">config</span></span></a></strong></code> or <code class="ansible-option docutils literal notranslate"><strong><a class="reference internal" href="#ansible-collections-ansible-windows-dsc3-module-parameter-config-file"><span class="std std-ref"><span class="pre">config_file</span></span></a></strong></code> as the configuration document.</p></li>
+<li><p>The module is tested against Microsoft DSC 3.3. Older 3.x releases work as long as the options that map to newer DSC features, such as <code class="ansible-option docutils literal notranslate"><strong><a class="reference internal" href="#ansible-collections-ansible-windows-dsc3-module-parameter-ignore-settings-file"><span class="std std-ref"><span class="pre">ignore_settings_file</span></span></a></strong></code>, are not used.</p></li>
+<li><p>By default <code class="docutils literal notranslate"><span class="pre">dsc</span></code> must be discoverable through the <code class="xref std std-envvar docutils literal notranslate"><span class="pre">PATH</span></code> environment variable, which <code class="docutils literal notranslate"><span class="pre">dsc</span></code> itself also uses to discover resources. Use <code class="ansible-option docutils literal notranslate"><strong><a class="reference internal" href="#ansible-collections-ansible-windows-dsc3-module-parameter-executable"><span class="std std-ref"><span class="pre">executable</span></span></a></strong></code> to run a specific <code class="docutils literal notranslate"><span class="pre">dsc.exe</span></code> and <code class="ansible-option docutils literal notranslate"><strong><a class="reference internal" href="#ansible-collections-ansible-windows-dsc3-module-parameter-resource-path"><span class="std std-ref"><span class="pre">resource_path</span></span></a></strong></code> to control where resources are discovered.</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
@@ -225,16 +244,25 @@ To check whether it is installed, run <code class="code docutils literal notrans
</thead>
<tbody>
<tr class="row-even"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="parameter-chdir"></div><p class="ansible-option-title" id="ansible-collections-ansible-windows-dsc3-module-parameter-chdir"><strong>chdir</strong></p>
+<a class="ansibleOptionLink" href="#parameter-chdir" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">path</span></p>
+<p><em class="ansible-option-versionadded">added in ansible.windows 3.9.0</em></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>Set the specified path as the working directory of the <code class="docutils literal notranslate"><span class="pre">dsc</span></code> process.</p>
+<p>When <code class="ansible-option docutils literal notranslate"><strong><a class="reference internal" href="#ansible-collections-ansible-windows-dsc3-module-parameter-config"><span class="std std-ref"><span class="pre">config</span></span></a></strong></code> is used, <code class="docutils literal notranslate"><span class="pre">dsc</span></code> reads the document from stdin and sets <code class="xref std std-envvar docutils literal notranslate"><span class="pre">DSC_CONFIG_ROOT</span></code> to this directory, so relative paths of <code class="docutils literal notranslate"><span class="pre">Microsoft.DSC/Include</span></code> resources are resolved from here. When <code class="ansible-option docutils literal notranslate"><strong><a class="reference internal" href="#ansible-collections-ansible-windows-dsc3-module-parameter-config-file"><span class="std std-ref"><span class="pre">config_file</span></span></a></strong></code> is used, they are resolved from the directory containing the file instead.</p>
+</div></td>
+</tr>
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-config"></div><p class="ansible-option-title" id="ansible-collections-ansible-windows-dsc3-module-parameter-config"><strong>config</strong></p>
<a class="ansibleOptionLink" href="#parameter-config" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">dictionary</span></p>
</div></td>
<td><div class="ansible-option-cell"><p>The DSC configuration document to set or test.</p>
<p>See <a class="reference external" href="https://learn.microsoft.com/en-us/powershell/dsc/concepts/configuration-documents/overview?view=dsc-3.0">https://learn.microsoft.com/en-us/powershell/dsc/concepts/configuration-documents/overview?view=dsc-3.0</a> for an overview of how to author a configuration document.</p>
-<p>The <code class="docutils literal notranslate"><span class="pre">$schema</span></code> top-level property may be omitted. If so, it will default to <code class="docutils literal notranslate"><span class="pre">https://aka.ms/dsc/schemas/v3/bundled/config/document.json</span></code></p>
+<p>The <code class="docutils literal notranslate"><span class="pre">$schema</span></code> top-level property may be omitted. If so, it will default to <code class="docutils literal notranslate"><span class="pre">https://aka.ms/dsc/schemas/v3/bundled/config/document.json</span></code>. Nested configuration documents, for example the properties of a <code class="docutils literal notranslate"><span class="pre">Microsoft.DSC/Group</span></code> resource, must include their own <code class="docutils literal notranslate"><span class="pre">$schema</span></code>.</p>
<p>One of <code class="ansible-option docutils literal notranslate"><strong><a class="reference internal" href="#ansible-collections-ansible-windows-dsc3-module-parameter-config"><span class="std std-ref"><span class="pre">config</span></span></a></strong></code> or <code class="ansible-option docutils literal notranslate"><strong><a class="reference internal" href="#ansible-collections-ansible-windows-dsc3-module-parameter-config-file"><span class="std std-ref"><span class="pre">config_file</span></span></a></strong></code> must be specified.</p>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-config_file"></div><p class="ansible-option-title" id="ansible-collections-ansible-windows-dsc3-module-parameter-config-file"><strong>config_file</strong></p>
<a class="ansibleOptionLink" href="#parameter-config_file" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">path</span></p>
</div></td>
@@ -244,12 +272,47 @@ To check whether it is installed, run <code class="code docutils literal notrans
<p>One of <code class="ansible-option docutils literal notranslate"><strong><a class="reference internal" href="#ansible-collections-ansible-windows-dsc3-module-parameter-config"><span class="std std-ref"><span class="pre">config</span></span></a></strong></code> or <code class="ansible-option docutils literal notranslate"><strong><a class="reference internal" href="#ansible-collections-ansible-windows-dsc3-module-parameter-config-file"><span class="std std-ref"><span class="pre">config_file</span></span></a></strong></code> must be specified.</p>
</div></td>
</tr>
+<tr class="row-odd"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="parameter-executable"></div><p class="ansible-option-title" id="ansible-collections-ansible-windows-dsc3-module-parameter-executable"><strong>executable</strong></p>
+<a class="ansibleOptionLink" href="#parameter-executable" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">path</span></p>
+<p><em class="ansible-option-versionadded">added in ansible.windows 3.9.0</em></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>Path to the <code class="docutils literal notranslate"><span class="pre">dsc</span></code> executable to run.</p>
+<p>By default <code class="docutils literal notranslate"><span class="pre">dsc.exe</span></code> is searched for through the <code class="xref std std-envvar docutils literal notranslate"><span class="pre">PATH</span></code> environment variable. Installations through WinGet place it in <code class="docutils literal notranslate"><span class="pre">%LOCALAPPDATA%\Microsoft\WinGet\Links</span></code>, which may not be part of <code class="xref std std-envvar docutils literal notranslate"><span class="pre">PATH</span></code> for a remote session.</p>
+<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">"dsc.exe"</span></code></p>
+</div></td>
+</tr>
<tr class="row-even"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="parameter-ignore_settings_file"></div><p class="ansible-option-title" id="ansible-collections-ansible-windows-dsc3-module-parameter-ignore-settings-file"><strong>ignore_settings_file</strong></p>
+<a class="ansibleOptionLink" href="#parameter-ignore_settings_file" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
+<p><em class="ansible-option-versionadded">added in ansible.windows 3.9.0</em></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>Ignore the DSC settings and policy files when running the command.</p>
+<p>This corresponds to the <code class="docutils literal notranslate"><span class="pre">--ignore-settings-file</span></code> DSC commandline option and requires DSC 3.3.0 or later, older releases fail with exit code 2 when this is set.</p>
+<p class="ansible-option-line"><strong class="ansible-option-choices">Choices:</strong></p>
+<ul class="simple">
+<li><p><code class="ansible-option-default-bold docutils literal notranslate"><strong><span class="pre">false</span></strong></code> <span class="ansible-option-choices-default-mark">← (default)</span></p></li>
+<li><p><code class="ansible-option-choices-entry docutils literal notranslate"><span class="pre">true</span></code></p></li>
+</ul>
+</div></td>
+</tr>
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-parameters"></div><p class="ansible-option-title" id="ansible-collections-ansible-windows-dsc3-module-parameter-parameters"><strong>parameters</strong></p>
<a class="ansibleOptionLink" href="#parameter-parameters" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">dictionary</span></p>
</div></td>
<td><div class="ansible-option-cell"><p>Runtime parameter values.</p>
<p>This corresponds to the <code class="docutils literal notranslate"><span class="pre">--parameters</span></code> commandline option.</p>
+<p>Can be combined with <code class="ansible-option docutils literal notranslate"><strong><a class="reference internal" href="#ansible-collections-ansible-windows-dsc3-module-parameter-parameters-file"><span class="std std-ref"><span class="pre">parameters_file</span></span></a></strong></code> on DSC 3.2.0 or later, the values set here take precedence for parameters that are defined in both.</p>
+</div></td>
+</tr>
+<tr class="row-even"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="parameter-parameters_file"></div><p class="ansible-option-title" id="ansible-collections-ansible-windows-dsc3-module-parameter-parameters-file"><strong>parameters_file</strong></p>
+<a class="ansibleOptionLink" href="#parameter-parameters_file" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">path</span></p>
+<p><em class="ansible-option-versionadded">added in ansible.windows 3.9.0</em></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>Path on the target host to a JSON or YAML file with runtime parameter values.</p>
+<p>The file must contain a top-level <code class="docutils literal notranslate"><span class="pre">parameters</span></code> object with the values.</p>
+<p>This corresponds to the <code class="docutils literal notranslate"><span class="pre">--parameters-file</span></code> DSC commandline option.</p>
</div></td>
</tr>
<tr class="row-odd"><td><div class="ansible-option-cell">
@@ -261,16 +324,35 @@ To check whether it is installed, run <code class="code docutils literal notrans
<p>A local <code class="ansible-option docutils literal notranslate"><strong><a class="reference internal" href="#ansible-collections-ansible-windows-dsc3-module-parameter-config-file"><span class="std std-ref"><span class="pre">config_file</span></span></a></strong></code> cannot be used with async tasks, the file will need to be pre-transferred to the target host.</p>
<p class="ansible-option-line"><strong class="ansible-option-choices">Choices:</strong></p>
<ul class="simple">
-<li><p><code class="ansible-option-choices-entry docutils literal notranslate"><span class="pre">false</span></code></p></li>
-<li><p><code class="ansible-option-default-bold docutils literal notranslate"><strong><span class="pre">true</span></strong></code> <span class="ansible-option-choices-default-mark">← (default)</span></p></li>
+<li><p><code class="ansible-option-default-bold docutils literal notranslate"><strong><span class="pre">false</span></strong></code> <span class="ansible-option-choices-default-mark">← (default)</span></p></li>
+<li><p><code class="ansible-option-choices-entry docutils literal notranslate"><span class="pre">true</span></code></p></li>
</ul>
</div></td>
</tr>
<tr class="row-even"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="parameter-resource_path"></div><p class="ansible-option-title" id="ansible-collections-ansible-windows-dsc3-module-parameter-resource-path"><strong>resource_path</strong></p>
+<a class="ansibleOptionLink" href="#parameter-resource_path" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">list</span> / <span class="ansible-option-elements">elements=path</span></p>
+<p><em class="ansible-option-versionadded">added in ansible.windows 3.9.0</em></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>List of directories <code class="docutils literal notranslate"><span class="pre">dsc</span></code> searches for resource manifests, set as the <code class="xref std std-envvar docutils literal notranslate"><span class="pre">DSC_RESOURCE_PATH</span></code> environment variable of the <code class="docutils literal notranslate"><span class="pre">dsc</span></code> process.</p>
+<p>When set, <code class="docutils literal notranslate"><span class="pre">dsc</span></code> only discovers resource manifests in these directories, include the DSC installation directory if the built-in resources are needed. The executables of resources are still located through <code class="xref std std-envvar docutils literal notranslate"><span class="pre">PATH</span></code> on DSC 3.3.0 or later, older releases only look for them in these directories.</p>
+</div></td>
+</tr>
+<tr class="row-odd"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="parameter-system_root"></div><p class="ansible-option-title" id="ansible-collections-ansible-windows-dsc3-module-parameter-system-root"><strong>system_root</strong></p>
+<a class="ansibleOptionLink" href="#parameter-system_root" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">path</span></p>
+<p><em class="ansible-option-versionadded">added in ansible.windows 3.9.0</em></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>Path to the root of the operating system to target when it is not the running one, for example an offline image.</p>
+<p>This corresponds to the <code class="docutils literal notranslate"><span class="pre">--system-root</span></code> DSC commandline option.</p>
+</div></td>
+</tr>
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-trace_level"></div><p class="ansible-option-title" id="ansible-collections-ansible-windows-dsc3-module-parameter-trace-level"><strong>trace_level</strong></p>
<a class="ansibleOptionLink" href="#parameter-trace_level" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
-<td><div class="ansible-option-cell"><p>Specify level of tracing output, which are returned in <code class="ansible-return-value docutils literal notranslate"><a class="reference internal" href="#ansible-collections-ansible-windows-dsc3-module-return-stderr-lines"><span class="std std-ref"><span class="pre">stderr_lines</span></span></a></code>.</p>
+<td><div class="ansible-option-cell"><p>Specify level of tracing output, which is returned in <code class="ansible-return-value docutils literal notranslate"><a class="reference internal" href="#ansible-collections-ansible-windows-dsc3-module-return-stderr-lines"><span class="std std-ref"><span class="pre">stderr_lines</span></span></a></code>.</p>
+<p>Messages of level <code class="docutils literal notranslate"><span class="pre">WARN</span></code> are also reported as Ansible warnings.</p>
<p>This corresponds to the <code class="docutils literal notranslate"><span class="pre">--trace-level</span></code> DSC commandline option.</p>
<p class="ansible-option-line"><strong class="ansible-option-choices">Choices:</strong></p>
<ul class="simple">
@@ -285,8 +367,34 @@ To check whether it is installed, run <code class="code docutils literal notrans
</tbody>
</table>
</section>
+<section id="notes">
+<h2><a class="toc-backref" href="#id3" role="doc-backlink">Notes</a><a class="headerlink" href="#notes" title="Link to this heading"></a></h2>
+<div class="admonition note">
+<p class="admonition-title">Note</p>
+<ul class="simple">
+<li><p>The <code class="docutils literal notranslate"><span class="pre">dsc</span></code> process runs as the user Ansible connects with. If that user does not have the rights a resource needs, <code class="docutils literal notranslate"><span class="pre">become</span></code> may be able to help.</p></li>
+<li><p>A configuration document can require a security context through the <code class="docutils literal notranslate"><span class="pre">securityContext</span></code> key of its top-level <code class="docutils literal notranslate"><span class="pre">directives</span></code> property, with the value <code class="ansible-value docutils literal notranslate"><span class="pre">elevated</span></code> or <code class="ansible-value docutils literal notranslate"><span class="pre">restricted</span></code>. <code class="docutils literal notranslate"><span class="pre">dsc</span></code> checks this before it invokes any resource and the task fails with exit code 2 when the <code class="docutils literal notranslate"><span class="pre">dsc</span></code> process does not run in that context.</p></li>
+<li><p>In check mode the module runs <code class="docutils literal notranslate"><span class="pre">dsc</span> <span class="pre">config</span> <span class="pre">set</span> <span class="pre">--what-if</span></code>, which reports the changes that would be made without changing the system. This requires DSC 3.1.0 or later. Resources without native what-if support are simulated from their test operation, but group resources such as <code class="docutils literal notranslate"><span class="pre">Microsoft.DSC/Group</span></code> and <code class="docutils literal notranslate"><span class="pre">Microsoft.DSC/Include</span></code> and resources that declare <code class="docutils literal notranslate"><span class="pre">implementsPretest</span></code> do not support what-if and fail the task with exit code 2.</p></li>
+<li><p>The changed status is derived from the <code class="docutils literal notranslate"><span class="pre">changedProperties</span></code> of each resource. The nested results of group resources such as <code class="docutils literal notranslate"><span class="pre">Microsoft.DSC/Group</span></code> and <code class="docutils literal notranslate"><span class="pre">Microsoft.DSC/Include</span></code> are walked recursively so a group is only reported as changed when one of its resources changed.</p></li>
+<li><p>When run with diff mode, the diff lists every resource with its name and type. Resources that changed also include the properties that changed and group resources contain a nested <code class="docutils literal notranslate"><span class="pre">resources</span></code> list.</p></li>
+<li><p>Warnings emitted by <code class="docutils literal notranslate"><span class="pre">dsc</span></code> are reported as Ansible warnings and the last error emitted by <code class="docutils literal notranslate"><span class="pre">dsc</span></code> is included in <code class="ansible-return-value docutils literal notranslate"><a class="reference internal" href="#ansible-collections-ansible-windows-dsc3-module-return-msg"><span class="std std-ref"><span class="pre">msg</span></span></a></code> when the command fails.</p></li>
+</ul>
+</div>
+</section>
+<section id="see-also">
+<h2><a class="toc-backref" href="#id4" role="doc-backlink">See Also</a><a class="headerlink" href="#see-also" title="Link to this heading"></a></h2>
+<div class="admonition seealso">
+<p class="admonition-title">See also</p>
+<dl class="simple">
+<dt><a class="reference internal" href="win_dsc_module.html#ansible-collections-ansible-windows-win-dsc-module"><span class="std std-ref">ansible.windows.win_dsc</span></a></dt><dd><p>Invokes a PowerShell DSC configuration.</p>
+</dd>
+<dt><a class="reference external" href="https://learn.microsoft.com/en-us/powershell/dsc/reference/schemas/config/document?view=dsc-3.0">DSC configuration document schema</a></dt><dd><p>Reference documentation for configuration documents, including the <code class="docutils literal notranslate"><span class="pre">directives</span></code> property.</p>
+</dd>
+</dl>
+</div>
+</section>
<section id="examples">
-<h2><a class="toc-backref" href="#id3" role="doc-backlink">Examples</a><a class="headerlink" href="#examples" title="Link to this heading"></a></h2>
+<h2><a class="toc-backref" href="#id5" role="doc-backlink">Examples</a><a class="headerlink" href="#examples" title="Link to this heading"></a></h2>
<div class="highlight-yaml+jinja notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Install DSC3 using WinGet</span>
<span class="w"> </span><span class="nt">ansible.windows.win_command</span><span class="p">:</span>
<span class="w"> </span><span class="nt">argv</span><span class="p">:</span>
@@ -331,11 +439,68 @@ To check whether it is installed, run <code class="code docutils literal notrans
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Microsoft.VisualStudio.Component.Windows11SDK.22621</span>
<span class="w"> </span><span class="nt">vars</span><span class="p">:</span>
<span class="w"> </span><span class="nt">vs_product</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">BuildTools</span>
+
+<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Require an elevated session and DSC 3.3 or later before configuring the registry</span>
+<span class="w"> </span><span class="nt">ansible.windows.dsc3</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">config</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">directives</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">securityContext</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">elevated</span>
+<span class="w"> </span><span class="nt">version</span><span class="p">:</span><span class="w"> </span><span class="s">'>=3.3.0'</span>
+<span class="w"> </span><span class="nt">resources</span><span class="p">:</span>
+<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Example key</span>
+<span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Microsoft.Windows/Registry</span>
+<span class="w"> </span><span class="nt">properties</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">keyPath</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">HKLM\Software\Example</span>
+<span class="w"> </span><span class="nt">_exist</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
+<span class="w"> </span><span class="nt">register</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">dsc_result</span>
+
+<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Reboot when a resource requires it</span>
+<span class="w"> </span><span class="nt">ansible.windows.win_reboot</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">when</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">dsc_result.reboot_required</span>
+
+<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Run a specific dsc executable with additional resource directories</span>
+<span class="w"> </span><span class="nt">ansible.windows.dsc3</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">executable</span><span class="p">:</span><span class="w"> </span><span class="s">'</span><span class="cp">{{</span> <span class="nv">ansible_env.ProgramFiles</span> <span class="cp">}}</span><span class="s">\WinGet\Links\dsc.exe'</span>
+<span class="w"> </span><span class="nt">resource_path</span><span class="p">:</span>
+<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="s">'</span><span class="cp">{{</span> <span class="nv">ansible_env.ProgramFiles</span> <span class="cp">}}</span><span class="s">\DSC'</span>
+<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">C:\DscResources</span>
+<span class="w"> </span><span class="nt">config</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">resources</span><span class="p">:</span>
+<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Custom resource</span>
+<span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Contoso/Example</span>
+<span class="w"> </span><span class="nt">properties</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">enabled</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
+
+<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Include a configuration document from a directory on the target</span>
+<span class="w"> </span><span class="nt">ansible.windows.dsc3</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">chdir</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">C:\dsc\configs</span>
+<span class="w"> </span><span class="nt">config</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">resources</span><span class="p">:</span>
+<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Base configuration</span>
+<span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Microsoft.DSC/Include</span>
+<span class="w"> </span><span class="nt">properties</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">configurationFile</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">base.dsc.config.yaml</span>
+<span class="w"> </span><span class="nt">parametersFile</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">base.parameters.yaml</span>
+
+<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Apply a configuration with parameters from a file and the playbook</span>
+<span class="w"> </span><span class="nt">ansible.windows.dsc3</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">config_file</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">C:\dsc\configs\web.dsc.config.yaml</span>
+<span class="w"> </span><span class="nt">remote_config_file</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
+<span class="w"> </span><span class="nt">parameters_file</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">C:\dsc\configs\web.parameters.yaml</span>
+<span class="w"> </span><span class="nt">parameters</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">siteName</span><span class="p">:</span><span class="w"> </span><span class="s">'</span><span class="cp">{{</span> <span class="nv">inventory_hostname</span> <span class="cp">}}</span><span class="s">'</span>
+
+<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Preview the changes DSC would make without applying them</span>
+<span class="w"> </span><span class="nt">ansible.windows.dsc3</span><span class="p">:</span>
+<span class="w"> </span><span class="nt">config_file</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">files/baseline.dsc.config.yaml</span>
+<span class="w"> </span><span class="nt">check_mode</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
+<span class="w"> </span><span class="nt">diff</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
+<span class="w"> </span><span class="nt">register</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">dsc_preview</span>
</pre></div>
</div>
</section>
<section id="return-values">
-<h2><a class="toc-backref" href="#id4" role="doc-backlink">Return Values</a><a class="headerlink" href="#return-values" title="Link to this heading"></a></h2>
+<h2><a class="toc-backref" href="#id6" role="doc-backlink">Return Values</a><a class="headerlink" href="#return-values" title="Link to this heading"></a></h2>
<p>Common return values are documented <a class="reference external" href="https://docs.ansible.com/projects/ansible/devel/reference_appendices/common_return_values.html#common-return-values" title="(in Ansible devel)"><span class="xref std std-ref">here</span></a>, the following are the fields unique to this module:</p>
<table class="longtable ansible-option-table docutils align-default" style="width: 100%">
<thead>
@@ -345,6 +510,27 @@ To check whether it is installed, run <code class="code docutils literal notrans
</thead>
<tbody>
<tr class="row-even"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="return-execution_type"></div><p class="ansible-option-title" id="ansible-collections-ansible-windows-dsc3-module-return-execution-type"><strong>execution_type</strong></p>
+<a class="ansibleOptionLink" href="#return-execution_type" title="Permalink to this return value"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
+<p><em class="ansible-option-versionadded">added in ansible.windows 3.9.0</em></p>
+</div></td>
+<td><div class="ansible-option-cell"><p><code class="ansible-value docutils literal notranslate"><span class="pre">actual</span></code> when the configuration was set and <code class="ansible-value docutils literal notranslate"><span class="pre">whatIf</span></code> when the module ran in check mode.</p>
+<p>Not returned by DSC releases before 3.2.0.</p>
+<p class="ansible-option-line"><strong class="ansible-option-returned-bold">Returned:</strong> success</p>
+<p class="ansible-option-line ansible-option-sample"><strong class="ansible-option-sample-bold">Sample:</strong> <code class="ansible-option-sample docutils literal notranslate"><span class="pre">"actual"</span></code></p>
+</div></td>
+</tr>
+<tr class="row-odd"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="return-msg"></div><p class="ansible-option-title" id="ansible-collections-ansible-windows-dsc3-module-return-msg"><strong>msg</strong></p>
+<a class="ansibleOptionLink" href="#return-msg" title="Permalink to this return value"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>Error message when <code class="docutils literal notranslate"><span class="pre">dsc</span></code> fails.</p>
+<p>Contains the exit code with its meaning and the last error message emitted by <code class="docutils literal notranslate"><span class="pre">dsc</span></code>.</p>
+<p class="ansible-option-line"><strong class="ansible-option-returned-bold">Returned:</strong> failure</p>
+<p class="ansible-option-line ansible-option-sample"><strong class="ansible-option-sample-bold">Sample:</strong> <code class="ansible-option-sample docutils literal notranslate"><span class="pre">"dsc</span> <span class="pre">config</span> <span class="pre">set</span> <span class="pre">failed</span> <span class="pre">with</span> <span class="pre">exit</span> <span class="pre">code</span> <span class="pre">2</span> <span class="pre">(DSC</span> <span class="pre">error):</span> <span class="pre">Security</span> <span class="pre">context:</span> <span class="pre">Elevated</span> <span class="pre">security</span> <span class="pre">context</span> <span class="pre">required"</span></code></p>
+</div></td>
+</tr>
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="return-rc"></div><p class="ansible-option-title" id="ansible-collections-ansible-windows-dsc3-module-return-rc"><strong>rc</strong></p>
<a class="ansibleOptionLink" href="#return-rc" title="Permalink to this return value"></a><p class="ansible-option-type-line"><span class="ansible-option-type">integer</span></p>
</div></td>
@@ -353,33 +539,82 @@ To check whether it is installed, run <code class="code docutils literal notrans
</div></td>
</tr>
<tr class="row-odd"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="return-reboot_required"></div><p class="ansible-option-title" id="ansible-collections-ansible-windows-dsc3-module-return-reboot-required"><strong>reboot_required</strong></p>
+<a class="ansibleOptionLink" href="#return-reboot_required" title="Permalink to this return value"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
+<p><em class="ansible-option-versionadded">added in ansible.windows 3.9.0</em></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>Whether a resource reported that the system needs to be restarted to complete the configuration.</p>
+<p class="ansibl |
Yaish25491
left a comment
There was a problem hiding this comment.
Combined module audit and PR review of win_inf_printer_driver at 3722897efad2d69166bb5bed34db439fa6a3434a.
Request changes. Audit score: 72/100 — needs targeted work. The basic lifecycle tests make useful independent state assertions and cover check mode and repeated installation/removal. Before merging, the driver lookup and package-removal targeting need correction, and the shared-INF/driver-store tests need to be enabled and strengthened. The inline comments describe those issues.
Module audit
| Dimension | Score | Evidence and remaining gaps |
|---|---|---|
| Platform operation coverage | 17/25 | Implements lookup, installation, unregistration, and shared-INF removal. Lookup can interpret names as patterns or suppress operational errors, and package removal loses architecture scoping. Existing drivers bypass INF/version comparison. |
| Shared utility use | 20/20 | Uses Ansible.Basic for validation, check mode, results, errors, and diff. Reviewed collection utilities and compared win_feature, win_optional_feature, and win_capability; no applicable printer helper or needless utility duplication found. |
| Integration-test coverage | 15/25 | Enabled tests cover the inbox-driver lifecycle, idempotency, check-mode non-mutation, and missing inf_file. Shared-INF/package tests are disabled; architecture isolation, diff, invalid-INF, and operational-error cases are missing. |
| Test cleanup | 8/15 | Both suites use always; third-party driver cleanup continues after errors. Neither independently verifies final cleanup, and driver-store removal is never asserted. |
| Test reuse and maintainability | 12/15 | Reuses setup_remote_tmp_dir, module defaults, and query anchors. Clarify presence-only behavior, required privileges, and package-removal limitations. |
| Total | 72/100 | Needs targeted work |
| Resource operation | Assessment |
|---|---|
| Read installed drivers | Implemented internally with Get-PrinterDriver; no separate info interface is required for this module's stated scope. |
| Install from INF | Implemented with Win32_PrinterDriver.AddPrinterDriver(); enabled integration tests exercise an inbox INF, leaving arbitrary third-party installation unverified. |
| Update an existing driver | Not implemented: a matching name/environment is a no-op even with a different requested INF. This is a scope/documentation issue rather than a blocker by itself, since the interface promises presence/absence. |
| Unregister a driver | Implemented with Remove-PrinterDriver. |
| Purge a package/shared-INF drivers | Implemented for a registered target, but targeting and test coverage need work. A package left after the named driver is unregistered is not discoverable through the current lookup; document that limitation or provide a supported recovery path. |
| Manage queues, ports, or printer settings | Outside this module's scope. |
Additional documentation and cleanup feedback
plugins/modules/win_inf_printer_driver.py:42: explain thatstate=presentensures name/environment presence and does not upgrade or replace an existing driver when another INF is supplied.plugins/modules/win_inf_printer_driver.py:17: document administrator/driver-loading privilege requirements. Microsoft documentsSeLoadDriverPrivilegefor AddPrinterDriver.tests/integration/targets/win_inf_printer_driver/tasks/builtin.yml:120andtasks/thirdparty.yml:130: independently verify final cleanup, including driver-store package absence where applicable. The third-party cleanup currently ignores driver-removal errors without checking whether resources remain.
PR checklist
| Category | Status | Notes |
|---|---|---|
| Collection Metadata | PASS | No new dependencies or minimum-Ansible increase needed. |
| Module Documentation | PASS | ansible-doc loads the parameters and examples; clarifications above recommended. |
| Naming and Style | PASS | Follows collection conventions. |
| Idempotency | PASS | Basic repeated installation/removal covered; no upgrade contract assumed. |
| Sensitive Data | N/A | No sensitive parameters added. |
| Error Handling | FAIL | Operational lookup errors can be suppressed as absence. |
| Testing | FAIL | Shared-INF/package coverage disabled and actual package state unasserted. |
| Backwards Compatibility | N/A | New module; existing interfaces unchanged. |
| Changelog Fragment | N/A | New modules are automatically included by the changelog generator through version_added. |
| Code Quality | FAIL | Wildcard selection and architecture-scope issues described inline. |
New modules do not require a separate changelog fragment. Windows PowerShell modules are also exempt from the usual unit-test requirement; the missing Python unit tests are not a finding here.
Validation and limits
All 70 reported PR checks were successful at the reviewed head. Locally, PowerShell parsing, the Python documentation stub, all five integration YAML files, and ansible-doc succeeded. Isolated probes exercised the original module branches using mocked printer commands and documented parameter metadata; they reproduced wildcard selection, lost purge-environment binding, and successful absence after a suppressed query error.
These probes are not Windows integration validation. I did not run Windows tests, and Docker sanity could not be rerun because Docker is unavailable locally. Exact Windows effects of the unscoped purge, third-party INF compatibility, and recovery after partial removal still need integration validation.
| # -RemoveFromDriverStore on the final removal, once the package is unreferenced. | ||
| for ($i = 0; $i -lt $drivers_to_remove.Count; $i++) { | ||
| if ($remove_from_driver_store -and ($i -eq ($drivers_to_remove.Count - 1))) { | ||
| $drivers_to_remove[$i] | Remove-PrinterDriver -RemoveFromDriverStore |
There was a problem hiding this comment.
[P1] Preserve the printer environment when purging the package
-RemoveFromDriverStore selects the Query parameter set. In that set, the piped driver's Name can bind by property, but PrinterEnvironment does not. Consequently, this last removal no longer carries the environment used for lookup: an x86 target or same-name drivers across architectures can be addressed beyond the intended scope. Pass -Name and -PrinterEnvironment explicitly from the current driver, and add a same-name x86/x64 isolation test. This binding was reproduced with the documented parameter metadata; the precise Windows removal effects still need an integration test. See Remove-PrinterDriver parameter definitions.
There was a problem hiding this comment.
This should be resolved in the current code
| return $drivers_to_remove | ||
| } | ||
|
|
||
| $existing_driver = Get-PrinterDriver -Name $driver_name -PrinterEnvironment $printer_environment -ErrorAction SilentlyContinue |
There was a problem hiding this comment.
[P1] Match driver_name literally before deciding what to remove
The documentation requires an exact INF driver name, but Get-PrinterDriver -Name accepts wildcard patterns. For example, driver_name: 'HP*' with state: absent selects multiple HP drivers and passes them to the removal loop even when remove_all=false and package removal is disabled. Escape wildcard characters for the lookup or enumerate and filter by exact name before mutation, and test that pattern characters cannot select unrelated drivers. Microsoft explicitly demonstrates wildcard lookup in Get-PrinterDriver.
There was a problem hiding this comment.
This should be resolved in the current code - Also this was a great catch, i was not aware of the default wildcarding behavior
| return $drivers_to_remove | ||
| } | ||
|
|
||
| $existing_driver = Get-PrinterDriver -Name $driver_name -PrinterEnvironment $printer_environment -ErrorAction SilentlyContinue |
There was a problem hiding this comment.
[P2] Distinguish an unsuccessful query from an absent driver
-ErrorAction SilentlyContinue suppresses all nonterminating lookup errors, including operational failures, rather than just an expected no-match result. If the query errors and returns no objects, state=absent exits successfully with changed=false without establishing absence. Preserve and inspect query errors, suppress only the expected not-found condition, and fail descriptively for other failures. Add an error-path test alongside the legitimate no-result/idempotent-removal case.
There was a problem hiding this comment.
This should be resolved in the current code
|
|
||
| # Third-party tests require a hosted INF package, re-enable once it is available. | ||
| # - name: Test third-party driver-store removal and remove_all | ||
| # ansible.builtin.include_tasks: thirdparty.yml |
There was a problem hiding this comment.
[P2] Enable coverage for the shared-INF and driver-store behavior
This commented include leaves the new remove_all and remove_from_driver_store behavior entirely outside the enabled integration suite. Make the fixture available and enable the suite before merging. Also strengthen tasks/thirdparty.yml:124-128: Get-PrinterDriver verifies registration names, not whether the package was removed from the Windows driver store. Verify package retention for ordinary unregistration, package deletion for purge, and non-mutation after check mode/refused shared removal, using an independent package inventory. Include architecture isolation and final-cleanup assertions.
There was a problem hiding this comment.
I had noted in the PR description and comments that in order to enable the third party driver tests I would need to know how to get a file hosted (i saw ansible-ci-files used for similar tests), but couldnt find information on how that should be requested/added. Is there a process that I would need to follow for that?
There was a problem hiding this comment.
Can you use something from here instead? https://github.com/microsoft/Windows-driver-samples
You can then write tasks in the integration test to get the driver from the repo directly
There was a problem hiding this comment.
It looks like the print drivers were removed from that repo a few years ago - microsoft/Windows-driver-samples#1017
There was a problem hiding this comment.
Thanks for checking that, @ch0nx. You’re right—the printer samples were removed from Microsoft’s repository, so that suggestion doesn’t resolve the test fixture requirement.
@jborean93 @Yaish25491, could you clarify the process for adding a fixture to ansible-ci-files, or recommend an existing package suitable for these tests? The contributor flagged this dependency in the original PR description.
Once a fixture is available, the tests should verify both shared-INF driver removal and actual package removal from the driver store; checking registered driver names alone won’t establish that the package was deleted.
There was a problem hiding this comment.
We are trying to discourage the ansible-ci-files in favour of other sources. Best would be to be able to recreate it from source in CI but failing that a stable location to download it from with checksum and retries is the next best thing.
There was a problem hiding this comment.
ok - i have it retrieving from the MS update catalog and validating it by checksum, if theres a different way to make the files accessible in this CI please let me know and I can point it that way instead
| register: no_inf | ||
| failed_when: "no_inf.msg != 'state is present but all of the following are missing: inf_file'" | ||
|
|
||
| - name: Fail to install from a missing INF file |
There was a problem hiding this comment.
The missing-INF test depends on the driver initially being absent.
requests Generic / Text Only with a missing INF, but initial cleanup happens at line 54. If that driver is already installed, the module correctly returns an unchanged result without validating the INF, and the test fails when reading missing_inf.msg.
Fix: use a guaranteed-absent test driver name for this negative case, or establish absence before running it.
There was a problem hiding this comment.
Changed the missing-INF test to use a driver name that's never installed like the invalid-INF test does), so it no longer depends on the host's existing drivers.
| - remove_again is not changed | ||
| - state.result.drivers == [] | ||
|
|
||
| always: |
There was a problem hiding this comment.
Cleanup verification is skipped when removal fails.
A failed cleanup loop prevents the subsequent inventory and assertions from running. Loop iterations are still attempted, but independent verification is lost.
Fix: register cleanup failures, continue to independent inventory, then fail with both removal errors and remaining resources. Consider a fixture-specific fallback for orphaned packages, since the module explicitly cannot purge a package once every driver registration is gone.
There was a problem hiding this comment.
Cleanup errors are now registered to ignore_errors, and the final check always runs. The assertion should fail if cleanup failed or anything remains, and the failure message includes the removal errors and the remaining drivers.
| - state.result.drivers == [series_ii_x86] | ||
| - state.result.packages == ['x86'] | ||
|
|
||
| always: |
There was a problem hiding this comment.
Cleanup verification is skipped when removal fails.
A failed cleanup loop prevents the subsequent inventory and assertions from running. Loop iterations are still attempted, but independent verification is lost.
Fix: register cleanup failures, continue to independent inventory, then fail with both removal errors and remaining resources. Consider a fixture-specific fallback for orphaned packages, since the module explicitly cannot purge a package once every driver registration is gone.
There was a problem hiding this comment.
Same cleanup changes applied here, though I didn't add a pnputil fallback though since this is specific to tests and the runners should be ephemeral/disposable as far as I am aware. If it is imperative to take it 100% back to baseline from the test case I can add that but it would be adding functionality to the test that the module itself does not have at this point.
|
|
||
| - name: Test that a failed driver query is not reported as an absent driver | ||
| block: | ||
| - name: Stop the print spooler |
There was a problem hiding this comment.
forcibly stops Spooler and its dependent services, then only starts Spooler. Capture and restore the affected services’ initial states if the target should be safe outside disposable CI hosts.
There was a problem hiding this comment.
The test now gets the spooler's currently running dependent services before stopping it, and the always block restarts the spooler plus exactly those services. Also made sure it throws a terminating error if it encounters one.
SUMMARY
NOTE: This is pending the availability of a third party INF file using the ansible-ci-files method that other tests in this repo use, but I am not sure about how to get the files published. hoping @jborean93 can provide information on how to get a file uploaded there
win_inf_printer_driverto install and remove Windows printer drivers directly from an INF file.ansible.windowsmodule. Original authors are preserved in the copyright header.Win32_PrinterDriverWMI provider'sAddPrinterDriver()method, becauseAdd-PrinterDrivercan only register a driver already staged in the driver store, whereas this installs straight from an arbitrary.infpath in one step.Remove-PrinterDriver. By default only the driver is unregistered and the package stays in the store.remove_from_driver_store=truealso deletes the package, but since one INF can back multiple drivers, the module errors unlessremove_all=true, passing-RemoveFromDriverStoreonly after the individual drivers are removed.ISSUE TYPE
COMPONENT NAME
win_inf_printer_driver
ADDITIONAL INFORMATION
Generic / Text Onlydriver (runs in CI) — install, idempotency, check mode, and theinf_file-required-when-present path; no downloads.remove_from_driver_storeandremove_all. Currently implemented but commented out untiltest/integration/targets/win_inf_printer_driver/HP-Color-LaserJet-Series-II.zipis hosted on ansible-ci-files. Looking for some guidance on how to get it hosted there so that the third party test integration can be enabled.Command Output (pulled from CI check)