-
Notifications
You must be signed in to change notification settings - Fork 163
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
base: main
Are you sure you want to change the base?
Add force option to win psrepository copy #599
Conversation
add logic on ps1 file
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. 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">["*"]</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">["*"]</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
There was a problem hiding this 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;
- A changelog fragment documenting this new feature - https://docs.ansible.com/ansible/latest/community/development_process.html#creating-changelog-fragments
- An integration test added to make sure this new feature is idempotent and does what it should be doing
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
- import_tasks: test_include_repo.yml |
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 |
There was a problem hiding this comment.
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.
default: False | |
default: False | |
version_added: 2.4.0 |
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
COMPONENT NAME
win_psrepository_copy
ADDITIONAL INFORMATION