Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add force option to win psrepository copy #599

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tgoetheyn
Copy link
Contributor

SUMMARY

Adds a force option to the win_psrepository_copy module.
The current module only had the option to append. This addition also lets you 'set' the repository list identically tot the source

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

win_psrepository_copy

ADDITIONAL INFORMATION

Copy link

github-actions bot commented Jan 10, 2025

Docs Build 📝

Thank you for contribution!✨

The docsite for this PR is available for download as an artifact from this run:
https://github.com/ansible-collections/community.windows/actions/runs/12713443768

You can compare to the docs for the main branch here:
https://ansible-collections.github.io/community.windows/branch/main

File changes:

  • M collections/community/windows/win_psrepository_copy_module.html
Click to see the diff comparison.

NOTE: only file modifications are shown here. New and deleted files are excluded.
See the file list and check the published docs to see those files.

diff --git a/home/runner/work/community.windows/community.windows/docsbuild/base/collections/community/windows/win_psrepository_copy_module.html b/home/runner/work/community.windows/community.windows/docsbuild/head/collections/community/windows/win_psrepository_copy_module.html
index 680a1d0..fe7a3e0 100644
--- a/home/runner/work/community.windows/community.windows/docsbuild/base/collections/community/windows/win_psrepository_copy_module.html
+++ b/home/runner/work/community.windows/community.windows/docsbuild/head/collections/community/windows/win_psrepository_copy_module.html
@@ -187,6 +187,18 @@ To check whether it is installed, run <code class="code docutils literal notrans
 </div></td>
 </tr>
 <tr class="row-even"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="parameter-force"></div><p class="ansible-option-title" id="ansible-collections-community-windows-win-psrepository-copy-module-parameter-force"><strong>force</strong></p>
+<a class="ansibleOptionLink" href="#parameter-force" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>If <code class="docutils literal notranslate"><span class="pre">True</span></code>, this deletes repositories that are not present in the source.</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-name"></div><p class="ansible-option-title" id="ansible-collections-community-windows-win-psrepository-copy-module-parameter-name"><strong>name</strong></p>
 <a class="ansibleOptionLink" href="#parameter-name" 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=string</span></p>
 </div></td>
@@ -195,7 +207,7 @@ To check whether it is installed, run <code class="code docutils literal notrans
 <p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">[&quot;*&quot;]</span></code></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-profiles"></div><p class="ansible-option-title" id="ansible-collections-community-windows-win-psrepository-copy-module-parameter-profiles"><strong>profiles</strong></p>
 <a class="ansibleOptionLink" href="#parameter-profiles" 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=string</span></p>
 </div></td>
@@ -206,7 +218,7 @@ To check whether it is installed, run <code class="code docutils literal notrans
 <p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">[&quot;*&quot;]</span></code></p>
 </div></td>
 </tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-source"></div><p class="ansible-option-title" id="ansible-collections-community-windows-win-psrepository-copy-module-parameter-source"><strong>source</strong></p>
 <a class="ansibleOptionLink" href="#parameter-source" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">path</span></p>
 </div></td>

remove trailing whitespace
Copy link
Collaborator

@jborean93 jborean93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, there are two more things we would need to see;

The current integration tests are located https://github.com/ansible-collections/community.windows/tree/main/tests/integration/targets/win_psrepository_copy/tasks. I think adding a new test_force_profiles.yml and importing it at

would be ideal. The test_force_profiles.yml file would be like test_include_repo.yml but with the force option and updated expectation at the bottom.

description:
- If C(True), this deletes repositories that are not present in the source.
type: bool
default: False
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to include the version when this new option was first present in which will be 2.4.0.

Suggested change
default: False
default: False
version_added: 2.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants