-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fixes #5313: redhat_subscription module is not idempotent when pool_ids are used #5314
Fixes #5313: redhat_subscription module is not idempotent when pool_ids are used #5314
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
4426a0e
to
2acb64a
Compare
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 your contribution! Can you please add a changelog fragment? Thanks.
…otent when pool_ids This fix ensures the idempotency of the redhat_subscription module when pool_ids are used. The main problem was, that a 'None' quantity was not properly handled and that the quantity check compared a string with an integer. Signed-off-by: Christoph Fiehe <[email protected]>
66e8710
to
a7ad6e5
Compare
I have added the missing changelog fragment. Sorry! |
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.
I cannot judge the code change itself, I hope that one of the maintainers can take a look at it.
@@ -0,0 +1,2 @@ | |||
bugfixes: | |||
- redhat_subscription - fix redhat_subscription module is not idempotent when pool_ids are used (https://github.com/ansible-collections/community.general/issues/5313). |
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.
- redhat_subscription - fix redhat_subscription module is not idempotent when pool_ids are used (https://github.com/ansible-collections/community.general/issues/5313). | |
- redhat_subscription - make module idempotent when ``pool_ids`` are used (https://github.com/ansible-collections/community.general/issues/5313). |
…nsible-collections#5274) * module_utils.proxmox: new `api_task_ok` helper + integrated with existing modules * proxmox_snap: add `unbind` param to snapshot containers with mountpoints * [fix] errors reported by 'test sanity pep8' at ansible-collections#5274 (comment) * module_utils.proxmox.api_task_ok: small improvement * proxmox_snap.unbind: version_added, formatting errors, changelog fragment * Apply suggestions from code review Co-authored-by: Felix Fontein <[email protected]> * proxmox_snap.unbind: update version_added tag Co-authored-by: Felix Fontein <[email protected]> Co-authored-by: Felix Fontein <[email protected]>
…ollections#5291) * fix ansible-collections#5290 * add changelog fragment * remove unnecessary braces * Update changelogs/fragments/5291-fix-nmcli-error-when-setting-unset-mac-address.yaml Co-authored-by: Felix Fontein <[email protected]> Co-authored-by: Felix Fontein <[email protected]>
@cfiehe this PR contains the following merge commits: Please rebase your branch to remove these commits. |
Docs Build 📝Thank you for contribution!✨ The docsite for this PR is available for download as an artifact from this run: 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.general/community.general/docsbuild/base/collections/community/general/proxmox_snap_module.html b/home/runner/work/community.general/community.general/docsbuild/head/collections/community/general/proxmox_snap_module.html
index 84fb108..90e9154 100644
--- a/home/runner/work/community.general/community.general/docsbuild/base/collections/community/general/proxmox_snap_module.html
+++ b/home/runner/work/community.general/community.general/docsbuild/head/collections/community/general/proxmox_snap_module.html
@@ -271,6 +271,24 @@ see <a class="reference internal" href="#ansible-collections-community-general-p
</div></td>
</tr>
<tr class="row-odd"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="parameter-unbind"></div><p class="ansible-option-title" id="ansible-collections-community-general-proxmox-snap-module-parameter-unbind"><strong>unbind</strong></p>
+<a class="ansibleOptionLink" href="#parameter-unbind" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
+<p><span class="ansible-option-versionadded">added in community.general 5.7.0</span></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>This option only applies to LXC containers.</p>
+<p>Allows to snapshot a container even if it has configured mountpoints.</p>
+<p>Temporarily disables all configured mountpoints, takes snapshot, and finally restores original configuration.</p>
+<p>If running, the container will be stopped and restarted to apply config changes.</p>
+<p>Due to restrictions in the Proxmox API this option can only be used authenticating as <code class="docutils literal notranslate"><span class="pre">root@pam</span></code> with <em>api_password</em>, API tokens do not work either.</p>
+<p>See <a class="reference external" href="https://pve.proxmox.com/pve-docs/api-viewer/#/nodes">https://pve.proxmox.com/pve-docs/api-viewer/#/nodes</a>/{node}/lxc/{vmid}/config (PUT tab) for more details.</p>
+<p class="ansible-option-line"><span class="ansible-option-choices">Choices:</span></p>
+<ul class="simple">
+<li><p><span class="ansible-option-default-bold">false</span> <span class="ansible-option-default">← (default)</span></p></li>
+<li><p><span class="ansible-option-choices-entry">true</span></p></li>
+</ul>
+</div></td>
+</tr>
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-validate_certs"></div><p class="ansible-option-title" id="ansible-collections-community-general-proxmox-snap-module-parameter-validate-certs"><strong>validate_certs</strong></p>
<a class="ansibleOptionLink" href="#parameter-validate_certs" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
</div></td>
@@ -283,7 +301,7 @@ see <a class="reference internal" href="#ansible-collections-community-general-p
</ul>
</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-vmid"></div><p class="ansible-option-title" id="ansible-collections-community-general-proxmox-snap-module-parameter-vmid"><strong>vmid</strong></p>
<a class="ansibleOptionLink" href="#parameter-vmid" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
@@ -291,7 +309,7 @@ see <a class="reference internal" href="#ansible-collections-community-general-p
<p>If not set, will be fetched from PromoxAPI based on the hostname.</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-vmstate"></div><p class="ansible-option-title" id="ansible-collections-community-general-proxmox-snap-module-parameter-vmstate"><strong>vmstate</strong></p>
<a class="ansibleOptionLink" href="#parameter-vmstate" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
</div></td>
@@ -327,6 +345,16 @@ see <a class="reference internal" href="#ansible-collections-community-general-p
<span class="w"> </span><span class="nt">state</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">present</span><span class="w"></span>
<span class="w"> </span><span class="nt">snapname</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">pre-updates</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">Create new snapshot for a container with configured mountpoints</span><span class="w"></span>
+<span class="w"> </span><span class="nt">community.general.proxmox_snap</span><span class="p">:</span><span class="w"></span>
+<span class="w"> </span><span class="nt">api_user</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">root@pam</span><span class="w"></span>
+<span class="w"> </span><span class="nt">api_password</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">1q2w3e</span><span class="w"></span>
+<span class="w"> </span><span class="nt">api_host</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">node1</span><span class="w"></span>
+<span class="w"> </span><span class="nt">vmid</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">100</span><span class="w"></span>
+<span class="w"> </span><span class="nt">state</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">present</span><span class="w"></span>
+<span class="w"> </span><span class="nt">unbind</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="c1"># requires root@pam+password auth, API tokens are not supported</span><span class="w"></span>
+<span class="w"> </span><span class="nt">snapname</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">pre-updates</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">Remove container snapshot</span><span class="w"></span>
<span class="w"> </span><span class="nt">community.general.proxmox_snap</span><span class="p">:</span><span class="w"></span>
<span class="w"> </span><span class="nt">api_user</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">root@pam</span><span class="w"></span>
|
Signed-off-by: Christoph Fiehe <[email protected]>
93d05ba
to
2646d76
Compare
Continued in #5319. |
This fix ensures the idempotency of the redhat_subscription module when pool_ids are used. The main problem was, that a 'None' quantity was not properly handled and that the quantity check compared a string with an integer.
Signed-off-by: Christoph Fiehe [email protected]
SUMMARY
ISSUE TYPE
COMPONENT NAME
redhat_subscription
ADDITIONAL INFORMATION