Compare commits

...

46 Commits
2.5.2 ... 2.5.3

Author SHA1 Message Date
Felix Fontein
eac1dfdc78 Release 2.5.3. 2021-06-08 13:00:19 +02:00
patchback[bot]
930b64226c with great powers come great responsibility (#2755) (#2758)
(cherry picked from commit eef645c3f7)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-06-08 10:58:47 +02:00
Felix Fontein
885bb73cc6 ModuleHelper - also uses LC_ALL to force language (#2731) (#2737)
* also uses LC_ALL to force language

* adjusted test_xfconf and test_cpanm

* added changelog fragment

* Update changelogs/fragments/2731-mh-cmd-locale.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* adjusted chglog frag per PR

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 6a41fba2f8)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-06-08 10:54:46 +02:00
Felix Fontein
6afde82f2c Prepare 2.5.3 release. 2021-06-08 09:26:18 +02:00
patchback[bot]
62d53eb3cf zypper_repository: fix idempotency on adding repo with releasever and basearch variables (#2722) (#2752)
* zypper_repository: Check idempotency on adding repo with releasever

* Name required when adding non-repo files.

* Initial try to fix releasever

* Replace re.sub with .replace

* name releaseverrepo releaseverrepo

* Change  to ansible_distribution_version for removing repo

* improve asserts format

* add changelog

* Fix changelog formatting

Co-authored-by: Felix Fontein <felix@fontein.de>

* improve command used for retrieving releasever variable

Co-authored-by: Felix Fontein <felix@fontein.de>

* add basearch replace

* Add basearch to changelog fragment

* Check for releasever and basearch only when they are there

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 94a53adff1)

Co-authored-by: Amin Vakil <info@aminvakil.com>
2021-06-08 08:47:11 +02:00
patchback[bot]
1ae9bcc2dd Re-enable flatpak_remote tests (#2747) (#2748)
* Automate test repo creation, re-enable flatpak_remote tests.

* Linting.

* Another try.

(cherry picked from commit 4c50f1add7)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-06-07 21:48:40 +02:00
patchback[bot]
1533b5b244 Remove aminvakil from supershipit section as it is not needed anymore (#2743) (#2745)
(cherry picked from commit 7c3f2ae4af)

Co-authored-by: Amin Vakil <info@aminvakil.com>
2021-06-07 17:02:21 +02:00
patchback[bot]
99295fac75 Add aminvakil to committers (#2739) (#2741)
(cherry picked from commit 1e34df7ca0)

Co-authored-by: Amin Vakil <info@aminvakil.com>
2021-06-07 16:01:26 +02:00
patchback[bot]
434ff80ec6 iptables_state: fix async status call (-> action plugin) (#2711) (#2728)
* fix call to async_status (-> action plugin)

* add changelog fragment

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

* rename a local variable for readability

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 463c576a67)

Co-authored-by: quidame <quidame@poivron.org>
2021-06-06 18:10:26 +02:00
patchback[bot]
be6d3e9aa1 Wire token param into consul_api #2124 (#2126) (#2725)
* Wire token param into consul_api #2124

* Update changelogs/fragments/2124-consul_kv-pass-token.yml

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>

* #2124 renamed release fragment to match pr, removed parse_params.

* putting look back in, do some linting   #2124

* try more linting

* linting

* try overwriting defaults in parse_params with get_option vals, instead of removing that function completely.

* Revert "back to start, from 2nd approach: allow keyword arguments via parse_params for compatibility."

This reverts commit 748be8e366.

* Revert " linting"

This reverts commit 1d57374c3e.

* Revert " try more linting"

This reverts commit 91c8d06e6a.

* Revert "putting look back in, do some linting   #2124"

This reverts commit 87eeec7180.

* Revert " #2124 renamed release fragment to match pr, removed parse_params."

This reverts commit d2869b2f22.

* Revert "Update changelogs/fragments/2124-consul_kv-pass-token.yml"

This reverts commit c50b1cf9d4.

* Revert "Wire token param into consul_api #2124"

This reverts commit b60b6433a8.

* minimal chnages for this PR relative to current upstream.

* superfluous newline in changlog fragment.

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
(cherry picked from commit 0e6d70697c)

Co-authored-by: fkuep <flo.kuepper@gmail.com>
2021-06-05 23:03:48 +02:00
patchback[bot]
b06d46f4d1 Reduce stormssh searches based on host (#2568) (#2723)
* Reduce stormssh searches based on host

Due to the stormssh searches in the whole config values, we need to reduce the search results based on the full matching of the hosts

* Removed whitespaces in the blank line

* Added changelog fragment and tests for the fix.

* Added newline at the end of the changelog fragment

* Added newline at the end of the tests

* Fixed bug with name in tests

* Changed assertion for the existing host

* Update changelogs/fragments/2568-ssh_config-reduce-stormssh-searches-based-on-host.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Adjusted tests

* New line at the end of the tests

Co-authored-by: Anton Nikolaev <anikolaev@apple.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 1a4af9bfc3)

Co-authored-by: Anton Nikolaev <drenout@gmail.com>
2021-06-05 16:03:10 +00:00
patchback[bot]
acea90ceec Terraform: ensure workspace is reset to current value (#2634) (#2721)
* fix: ensure workspace is reset to current value

* chore: linter

* chore: changelog

(cherry picked from commit c49a384a65)

Co-authored-by: christophemorio <49184206+christophemorio@users.noreply.github.com>
2021-06-04 21:12:50 +02:00
patchback[bot]
034d09532e Fix repeated word in description of fs_type (#2717) (#2718)
(cherry picked from commit a343756e6f)

Co-authored-by: Alex Willmer <al.willmer@cgi.com>
2021-06-04 21:12:37 +02:00
patchback[bot]
f815bef3d1 Fix action plugin BOTMETA entries. (#2707) (#2713)
(cherry picked from commit 4396ec9631)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-06-04 11:13:25 +02:00
patchback[bot]
e205494c8c BOTMETA.yml: remove myself from zypper_repository (#2701) (#2702)
(cherry picked from commit d93bc039b2)

Co-authored-by: Matthias Vogelgesang <matthias.vogelgesang@gmail.com>
2021-06-04 06:40:28 +02:00
patchback[bot]
1541eecd0e iptables_state: fix broken query of async_status result (#2671) (#2675)
* use get() rather than querying the key directly

* add a changelog fragment

* re-enable CI tests

* Update changelog fragment

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit f09c39b71e)

Co-authored-by: quidame <quidame@poivron.org>
2021-05-29 13:54:32 +02:00
patchback[bot]
6cd87580da proxmox_kvm - Fixed vmid result when VM with name exists (#2648) (#2673)
* Fixed vmid result when VM with name exists

* Adding changelog fragment

(cherry picked from commit b281d3d699)

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>
2021-05-29 08:50:06 +00:00
patchback[bot]
d227ace4a0 Stop mentioning Freenode. We're on Libera.chat. (#2666) (#2668)
(cherry picked from commit 14813a6287)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-05-28 07:26:22 +02:00
patchback[bot]
e7770b9132 Add extra docs tests (#2663) (#2664)
* Add extra docs tests.

* Linting.

* Fix copy'n'paste error.

(cherry picked from commit 14f13904d6)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-05-28 06:48:57 +02:00
patchback[bot]
d0f1d9efd9 xml: Add an example for absent (#2644) (#2655)
Element node can be deleted based upon the attribute
value.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 795125fec4)

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-27 20:19:39 +02:00
patchback[bot]
22f0747e03 Fix drain example with correct wait values (#2603) (#2657)
(cherry picked from commit 95794f31e3)

Co-authored-by: Merouane Atig <merwan@users.noreply.github.com>
2021-05-27 20:15:28 +02:00
patchback[bot]
2ee7de681a fix a regression in initialization_from_null_state() (iptables-nft > 1.8.2) (#2604) (#2645)
(cherry picked from commit 909e9fe950)

Co-authored-by: quidame <quidame@poivron.org>
2021-05-27 07:16:34 +00:00
patchback[bot]
2e20e9bb8f Temporarily disable iptables_state tests. (#2641) (#2642)
(cherry picked from commit b45298bc43)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-05-27 08:28:43 +02:00
patchback[bot]
9d9e2bd797 Add one-liner lookup example (#2615) (#2637)
* Add one-liner lookup example

* Remove trailing whitespace

* Update plugins/lookup/tss.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/lookup/tss.py

Co-authored-by: Amin Vakil <info@aminvakil.com>

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Amin Vakil <info@aminvakil.com>
(cherry picked from commit 26757edfb2)

Co-authored-by: Sylvia van Os <sylvia@hackerchick.me>
2021-05-27 08:25:44 +02:00
patchback[bot]
d9aa9e8021 influxdb_user: Fix bug introduced by PR 2499 (#2614) (#2639)
* Update influxdb_user.py

Fixed function name

* Create 2614-influxdb_user-fix-issue-introduced-in-PR#2499

Added changelog

* Rename 2614-influxdb_user-fix-issue-introduced-in-PR#2499 to 2614-influxdb_user-fix-issue-introduced-in-PR#2499.yml

Fixed extension

* Update changelogs/fragments/2614-influxdb_user-fix-issue-introduced-in-PR#2499.yml

Co-authored-by: Amin Vakil <info@aminvakil.com>

Co-authored-by: Amin Vakil <info@aminvakil.com>
(cherry picked from commit 4aa50962cb)

Co-authored-by: sgalea87 <43749726+sgalea87@users.noreply.github.com>
2021-05-27 08:23:11 +02:00
patchback[bot]
a9eeced6d7 Use become test framework for sudosu tests. (#2629) (#2630)
(cherry picked from commit 0b4a2bea01)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-05-26 10:47:02 +02:00
patchback[bot]
066b306deb Add CONTRIBUTING.md (#2602) (#2625)
* Initial file shamelessly copied from community.mysql

* Add some notes on pull requests

* Add CONTRIBUTING.md link to README.md

* Add quick-start development guide link

* Apply felixfontein's suggestions

Co-authored-by: Felix Fontein <felix@fontein.de>

* add note about rebasing and merge commits

Co-authored-by: Felix Fontein <felix@fontein.de>

* add note about easyfix and waiting_on_contributor tags

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit d0f8eac7fd)

Co-authored-by: Amin Vakil <info@aminvakil.com>
2021-05-26 10:09:19 +02:00
patchback[bot]
7426c3839e redis cache - better parsing of connection uri (#2579) (#2621)
* better parsing of connection uri

* added changelog fragment

* fixed tests for ansible 2.9

* Update tests/unit/plugins/cache/test_redis.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update tests/unit/plugins/cache/test_redis.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Adjustments from PR

* Update test_redis.py

* Update test_redis.py

* Update plugins/cache/redis.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/cache/redis.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update tests/unit/plugins/cache/test_redis.py

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 4764a5deba)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-05-26 09:59:58 +02:00
patchback[bot]
4d6735bebf jenkins_plugin: HTTP Error 405: Method Not Allowed on disable/enable plugin #2510 (#2511) (#2618)
* define POST method for pluginManager api requests

Jenkins makeEnable/makeDisable api requests requires to use POST method

* add changelog fragment

* fix my yoda lang thx to aminvakil

Co-authored-by: Amin Vakil <info@aminvakil.com>

* update changelog fragment

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Amin Vakil <info@aminvakil.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 6df3685d42)

Co-authored-by: Alexander Moiseenko <brainsam@yandex.ru>
2021-05-26 07:29:09 +02:00
patchback[bot]
1ceed02048 Use str() to get exception message (#2590) (#2610)
(cherry picked from commit 63012eef82)

Co-authored-by: DasSkelett <dasskelett@gmail.com>
2021-05-25 13:59:51 +02:00
patchback[bot]
6dc31b13c3 json_query, no more 'unknown type' errors (#2607) (#2612)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit d871399220)

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
2021-05-25 13:59:01 +02:00
patchback[bot]
c7899e384a rhsm_release: Fix the issue that rhsm_release module considers 8, 7Client and 7Workstation as invalid releases (#2571) (#2605)
* rhsm_release: Fix the issue that rhsm_release module considers 8, 7Client and 7Workstation as invalid releases.

* Fix the unit test error: The new release_matcher could pass a wider range of patterns but that would not cause extra issue to the whole module.

* Submit the changelog fragment.

* Update changelogs/fragments/2571-rhsm_release-fix-release_matcher.yaml

Co-authored-by: Amin Vakil <info@aminvakil.com>

Co-authored-by: Amin Vakil <info@aminvakil.com>
(cherry picked from commit 593d622438)

Co-authored-by: Tong He <68936428+unnecessary-username@users.noreply.github.com>
2021-05-24 20:28:22 +00:00
patchback[bot]
35c8bbec8a Massive adjustment in integration tests for changed and failed (#2577) (#2585)
* Replaced ".changed ==" with "is [not] changed". Same for failed

* Mr Quote refused to go

(cherry picked from commit d7e55db99b)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-05-22 14:53:10 +02:00
patchback[bot]
87c37ea441 ovir4 inventory script (#2461) (#2582)
* update configparser

* changelog

* handle multiple python version

* Update changelogs/fragments/2461-ovirt4-fix-configparser.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update ovirt4.py

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 3100c32a00)

Co-authored-by: abikouo <79859644+abikouo@users.noreply.github.com>
2021-05-22 14:36:44 +02:00
patchback[bot]
0f7e39fa1a java_cert - fix incorrect certificate alias on pkcs12 import (#2560) (#2580)
* fix wrong certificate alias used when importing pkcs12, modify error output, stdout is more relevant than stderr

* add changelog fragment

* fix changelog fragment

(cherry picked from commit 8f083d5d85)

Co-authored-by: absynth76 <58172580+absynth76@users.noreply.github.com>
2021-05-22 13:51:24 +02:00
patchback[bot]
cde48c3c03 Add missing author name (#2570) (#2575)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 852e240525)

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-21 19:44:05 +02:00
patchback[bot]
778c91caa7 removed supporting code for testing module "nuage" - no longer exists here (#2559) (#2562)
(cherry picked from commit 452a185a23)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-05-19 22:23:33 +02:00
patchback[bot]
61258c9216 iptables_state: fix per-table initialization command (#2525) (#2552)
* refactor initialize_from_null_state()

* Use a more neutral command (iptables -L) to load per-table needed modules.

* fix 'FutureWarning: Possible nested set at position ...' (re.sub)

* fix pylints (module + action plugin)

* unsubscriptable-object
* superfluous-parens
* consider-using-in
* unused-variable
* unused-import
* no-else-break

* cleanup other internal module_args if they exist

* add changelog fragment

* Apply suggestions from code review (changelog fragment)

Co-authored-by: Felix Fontein <felix@fontein.de>

* Remove useless plugin type in changelog fragment

Co-authored-by: Amin Vakil <info@aminvakil.com>

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Amin Vakil <info@aminvakil.com>
(cherry picked from commit 2c1ab2d384)

Co-authored-by: quidame <quidame@poivron.org>
2021-05-18 12:27:34 +02:00
patchback[bot]
99e0f8a3a0 influxdb_user: allow creation of first user with auth enabled (#2364) (#2368) (#2547)
* influxdb_user: allow creation of first user with auth enabled (#2364)

* handle potential exceptions while parsing influxdb client error

* fix changelog

Co-authored-by: Felix Fontein <felix@fontein.de>

* influxdb_user: use generic exceptions to be compatible with python 2.7

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit b89eb87ad6)

Co-authored-by: Xabier Napal <xabiernapal@pm.me>
2021-05-17 19:18:46 +00:00
patchback[bot]
2dd159493b yum_versionlock: disable fedora34 integration test (#2536) (#2537)
* Disable yum_versionlock integration test on Fedora 34

* Remove --assumeyes and add a comment regarding this

* Update update task name

(cherry picked from commit da7e4e1dc2)

Co-authored-by: Amin Vakil <info@aminvakil.com>
2021-05-17 10:45:34 +02:00
patchback[bot]
28caeff7bd Use --assumeyes with explicit yum call. (#2533) (#2534)
(cherry picked from commit 2cc848fe1a)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-05-17 08:27:22 +02:00
patchback[bot]
76cf21a05b fix error when cache is disabled (#2518) (#2531)
(cherry picked from commit 448b8cbcda)

Co-authored-by: Dennis Israelsson <dennis.israelsson@gmail.com>
2021-05-17 08:09:56 +02:00
patchback[bot]
64248acce6 Update influxdb_user.py Fixed Multiple No Privileges (#2499) (#2529)
* Update influxdb_user.py

Fixed Multiple No Privileges

* Update influxdb_user.py

Fixed line spaces

* Update influxdb_user.py

Fixed whitespace

* Create 2499-influxdb_user-fix-multiple-no-privileges.yml

Added changelog

(cherry picked from commit ea200c9d8c)

Co-authored-by: sgalea87 <43749726+sgalea87@users.noreply.github.com>
2021-05-17 08:09:46 +02:00
patchback[bot]
8ed5beb978 1085 updating the hcl whitelist to include all supported options (#2495) (#2527)
* 1085 updating the hcl whitelist to include all supported options

* Update changelogs/fragments/1085-consul-acl-hcl-whitelist-update.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Dillon Gilmore <dgilmor@rei.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 5b77515308)

Co-authored-by: iridian <442359+iridian-ks@users.noreply.github.com>
2021-05-17 08:09:17 +02:00
patchback[bot]
9b7194be53 Run unit tests also with Python 3.10. (#2486) (#2487)
ci_complete

(cherry picked from commit 624eb7171e)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-05-11 08:31:12 +02:00
Felix Fontein
984d9d91b8 Next expected release will be 2.5.3. 2021-05-11 07:52:00 +02:00
114 changed files with 916 additions and 434 deletions

View File

@@ -124,6 +124,7 @@ stages:
- test: 3.7
- test: 3.8
- test: 3.9
- test: '3.10'
- stage: Units_2_11
displayName: Units 2.11
dependsOn: []

16
.github/BOTMETA.yml vendored
View File

@@ -1,17 +1,12 @@
automerge: true
files:
plugins/:
supershipit: aminvakil russoz
changelogs/fragments/:
support: community
$actions:
labels: action
$actions/aireos.py:
labels: aireos cisco networking
$actions/ironware.py:
maintainers: paulquack
labels: ironware networking
$actions/shutdown.py:
$actions/system/iptables_state.py:
maintainers: quidame
$actions/system/shutdown.py:
maintainers: nitzmahone samdoran aminvakil
$becomes/:
labels: become
@@ -711,8 +706,9 @@ files:
labels: zypper
ignore: dirtyharrycallahan robinro
$modules/packaging/os/zypper_repository.py:
maintainers: $team_suse matze
maintainers: $team_suse
labels: zypper
ignore: matze
$modules/remote_management/cobbler/:
maintainers: dagwieers
$modules/remote_management/dellemc/:
@@ -858,6 +854,8 @@ files:
labels: interfaces_file
$modules/system/iptables_state.py:
maintainers: quidame
$modules/system/shutdown.py:
maintainers: nitzmahone samdoran aminvakil
$modules/system/java_cert.py:
maintainers: haad absynth76
$modules/system/java_keystore.py:

View File

@@ -6,6 +6,41 @@ Community General Release Notes
This changelog describes changes after version 1.0.0.
v2.5.3
======
Release Summary
---------------
Regular bugfix release.
Bugfixes
--------
- consul_acl - update the hcl allowlist to include all supported options (https://github.com/ansible-collections/community.general/pull/2495).
- consul_kv lookup plugin - allow to set ``recurse``, ``index``, ``datacenter`` and ``token`` as keyword arguments (https://github.com/ansible-collections/community.general/issues/2124).
- influxdb_user - allow creation of admin users when InfluxDB authentication is enabled but no other user exists on the database. In this scenario, InfluxDB 1.x allows only ``CREATE USER`` queries and rejects any other query (https://github.com/ansible-collections/community.general/issues/2364).
- influxdb_user - fix bug where an influxdb user has no privileges for 2 or more databases (https://github.com/ansible-collections/community.general/pull/2499).
- influxdb_user - fix bug which removed current privileges instead of appending them to existing ones (https://github.com/ansible-collections/community.general/issues/2609, https://github.com/ansible-collections/community.general/pull/2614).
- iptables_state - call ``async_status`` action plugin rather than its module (https://github.com/ansible-collections/community.general/issues/2700).
- iptables_state - fix a 'FutureWarning' in a regex and do some basic code clean up (https://github.com/ansible-collections/community.general/pull/2525).
- iptables_state - fix a broken query of ``async_status`` result with current ansible-core development version (https://github.com/ansible-collections/community.general/issues/2627, https://github.com/ansible-collections/community.general/pull/2671).
- iptables_state - fix initialization of iptables from null state when adressing more than one table (https://github.com/ansible-collections/community.general/issues/2523).
- java_cert - fix issue with incorrect alias used on PKCS#12 certificate import (https://github.com/ansible-collections/community.general/pull/2560).
- jenkins_plugin - use POST method for sending request to jenkins API when ``state`` option is one of ``enabled``, ``disabled``, ``pinned``, ``unpinned``, or ``absent`` (https://github.com/ansible-collections/community.general/issues/2510).
- json_query filter plugin - avoid 'unknown type' errors for more Ansible internal types (https://github.com/ansible-collections/community.general/pull/2607).
- module_helper module utils - ``CmdMixin`` must also use ``LC_ALL`` to enforce locale choice (https://github.com/ansible-collections/community.general/pull/2731).
- netcup_dns - use ``str(ex)`` instead of unreliable ``ex.message`` in exception handling to fix ``AttributeError`` in error cases (https://github.com/ansible-collections/community.general/pull/2590).
- nmap inventory plugin - fix local variable error when cache is disabled (https://github.com/ansible-collections/community.general/issues/2512).
- ovir4 inventory script - improve configparser creation to avoid crashes for options without values (https://github.com/ansible-collections/community.general/issues/674).
- proxmox_kvm - fixed ``vmid`` return value when VM with ``name`` already exists (https://github.com/ansible-collections/community.general/issues/2648).
- redis cache - improved connection string parsing (https://github.com/ansible-collections/community.general/issues/497).
- rhsm_release - fix the issue that module considers 8, 7Client and 7Workstation as invalid releases (https://github.com/ansible-collections/community.general/pull/2571).
- ssh_config - reduce stormssh searches based on host (https://github.com/ansible-collections/community.general/pull/2568/).
- terraform - ensure the workspace is set back to its previous value when the apply fails (https://github.com/ansible-collections/community.general/pull/2634).
- xfconf - also use ``LC_ALL`` to enforce locale choice (https://github.com/ansible-collections/community.general/issues/2715).
- zypper_repository - fix idempotency on adding repository with ``$releasever`` and ``$basearch`` variables (https://github.com/ansible-collections/community.general/issues/1985).
v2.5.2
======

32
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,32 @@
# Contributing
We follow [Ansible Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html) in all our contributions and interactions within this repository.
If you are a committer, also refer to the [collection's committer guidelines](https://github.com/ansible-collections/community.general/blob/main/commit-rights.md).
## Issue tracker
Whether you are looking for an opportunity to contribute or you found a bug and already know how to solve it, please go to the [issue tracker](https://github.com/ansible-collections/community.general/issues).
There you can find feature ideas to implement, reports about bugs to solve, or submit an issue to discuss your idea before implementing it which can help choose a right direction at the beginning of your work and potentially save a lot of time and effort.
Also somebody may already have started discussing or working on implementing the same or a similar idea,
so you can cooperate to create a better solution together.
* If you are interested in starting with an easy issue, look for [issues with an `easyfix` label](https://github.com/ansible-collections/community.general/labels/easyfix).
* Often issues that are waiting for contributors to pick up have [the `waiting_on_contributor` label](https://github.com/ansible-collections/community.general/labels/waiting_on_contributor).
## Open pull requests
Look through currently [open pull requests](https://github.com/ansible-collections/community.general/pulls).
You can help by reviewing them. Reviews help move pull requests to merge state. Some good pull requests cannot be merged only due to a lack of reviews. And it is always worth saying that good reviews are often more valuable than pull requests themselves.
Note that reviewing does not only mean code review, but also offering comments on new interfaces added to existing plugins/modules, interfaces of new plugins/modules, improving language (not everyone is a native english speaker), or testing bugfixes and new features!
Also, consider taking up a valuable, reviewed, but abandoned pull request which you could politely ask the original authors to complete yourself.
* Try committing your changes with an informative but short commit message.
* All commits of a pull request branch will be squashed into one commit at last. That does not mean you must have only one commit on your pull request, though!
* Please try not to force-push if it is not needed, so reviewers and other users looking at your pull request later can see the pull request commit history.
* Do not add merge commits to your PR. The bot will complain and you will have to rebase ([instructions for rebasing](https://docs.ansible.com/ansible/latest/dev_guide/developing_rebasing.html)) to remove them before your PR can be merged. To avoid that git automatically does merges during pulls, you can configure it to do rebases instead by running `git config pull.rebase true` inside the respository checkout.
You can also read [our Quick-start development guide](https://github.com/ansible/community-docs/blob/main/create_pr_quick_start_guide.rst).
If you find any inconsistencies or places in this document which can be improved, feel free to raise an issue or pull request to fix it.

View File

@@ -50,6 +50,8 @@ export COLLECTIONS_PATH=$(pwd)/collections:$COLLECTIONS_PATH
You can find more information in the [developer guide for collections](https://docs.ansible.com/ansible/devel/dev_guide/developing_collections.html#contributing-to-collections), and in the [Ansible Community Guide](https://docs.ansible.com/ansible/latest/community/index.html).
Also for some notes specific to this collection see [our CONTRIBUTING documentation](https://github.com/ansible-collections/community.general/blob/main/CONTRIBUTING.md).
### Running tests
See [here](https://docs.ansible.com/ansible/devel/dev_guide/developing_collections.html#testing-collections).
@@ -58,10 +60,10 @@ See [here](https://docs.ansible.com/ansible/devel/dev_guide/developing_collectio
We have a dedicated Working Group for Ansible development.
You can find other people interested on the following Freenode IRC channels -
You can find other people interested on the following [Libera.chat](https://libera.chat/) IRC channels -
- `#ansible` - For general use questions and support.
- `#ansible-devel` - For discussions on developer topics and code related to features or bugs.
- `#ansible-community` - For discussions on community topics and community meetings.
- `#ansible-devel` - For discussions on developer topics and code related to features or bugs in ansible-core.
- `#ansible-community` - For discussions on community topics and community meetings, and for general development questions for community collections.
For more information about communities, meetings and agendas see [Community Wiki](https://github.com/ansible/community/wiki/Community).

View File

@@ -1882,3 +1882,76 @@ releases:
- 2454-detect_zfs_changed.yml
- ovirt-fixup.yml
release_date: '2021-05-11'
2.5.3:
changes:
bugfixes:
- consul_acl - update the hcl allowlist to include all supported options (https://github.com/ansible-collections/community.general/pull/2495).
- consul_kv lookup plugin - allow to set ``recurse``, ``index``, ``datacenter``
and ``token`` as keyword arguments (https://github.com/ansible-collections/community.general/issues/2124).
- influxdb_user - allow creation of admin users when InfluxDB authentication
is enabled but no other user exists on the database. In this scenario, InfluxDB
1.x allows only ``CREATE USER`` queries and rejects any other query (https://github.com/ansible-collections/community.general/issues/2364).
- influxdb_user - fix bug where an influxdb user has no privileges for 2 or
more databases (https://github.com/ansible-collections/community.general/pull/2499).
- influxdb_user - fix bug which removed current privileges instead of appending
them to existing ones (https://github.com/ansible-collections/community.general/issues/2609,
https://github.com/ansible-collections/community.general/pull/2614).
- iptables_state - call ``async_status`` action plugin rather than its module
(https://github.com/ansible-collections/community.general/issues/2700).
- iptables_state - fix a 'FutureWarning' in a regex and do some basic code clean
up (https://github.com/ansible-collections/community.general/pull/2525).
- iptables_state - fix a broken query of ``async_status`` result with current
ansible-core development version (https://github.com/ansible-collections/community.general/issues/2627,
https://github.com/ansible-collections/community.general/pull/2671).
- iptables_state - fix initialization of iptables from null state when adressing
more than one table (https://github.com/ansible-collections/community.general/issues/2523).
- java_cert - fix issue with incorrect alias used on PKCS#12 certificate import
(https://github.com/ansible-collections/community.general/pull/2560).
- jenkins_plugin - use POST method for sending request to jenkins API when ``state``
option is one of ``enabled``, ``disabled``, ``pinned``, ``unpinned``, or ``absent``
(https://github.com/ansible-collections/community.general/issues/2510).
- json_query filter plugin - avoid 'unknown type' errors for more Ansible internal
types (https://github.com/ansible-collections/community.general/pull/2607).
- module_helper module utils - ``CmdMixin`` must also use ``LC_ALL`` to enforce
locale choice (https://github.com/ansible-collections/community.general/pull/2731).
- netcup_dns - use ``str(ex)`` instead of unreliable ``ex.message`` in exception
handling to fix ``AttributeError`` in error cases (https://github.com/ansible-collections/community.general/pull/2590).
- nmap inventory plugin - fix local variable error when cache is disabled (https://github.com/ansible-collections/community.general/issues/2512).
- ovir4 inventory script - improve configparser creation to avoid crashes for
options without values (https://github.com/ansible-collections/community.general/issues/674).
- proxmox_kvm - fixed ``vmid`` return value when VM with ``name`` already exists
(https://github.com/ansible-collections/community.general/issues/2648).
- redis cache - improved connection string parsing (https://github.com/ansible-collections/community.general/issues/497).
- rhsm_release - fix the issue that module considers 8, 7Client and 7Workstation
as invalid releases (https://github.com/ansible-collections/community.general/pull/2571).
- ssh_config - reduce stormssh searches based on host (https://github.com/ansible-collections/community.general/pull/2568/).
- terraform - ensure the workspace is set back to its previous value when the
apply fails (https://github.com/ansible-collections/community.general/pull/2634).
- xfconf - also use ``LC_ALL`` to enforce locale choice (https://github.com/ansible-collections/community.general/issues/2715).
- zypper_repository - fix idempotency on adding repository with ``$releasever``
and ``$basearch`` variables (https://github.com/ansible-collections/community.general/issues/1985).
release_summary: Regular bugfix release.
fragments:
- 1085-consul-acl-hcl-whitelist-update.yml
- 2.5.3.yml
- 2126-consul_kv-pass-token.yml
- 2364-influxdb_user-first_user.yml
- 2461-ovirt4-fix-configparser.yml
- 2499-influxdb_user-fix-multiple-no-privileges.yml
- 2510-jenkins_plugin_use_post_method.yml
- 2518-nmap-fix-cache-disabled.yml
- 2525-iptables_state-fix-initialization-command.yml
- 2560-java_cert-pkcs12-alias-bugfix.yml
- 2568-ssh_config-reduce-stormssh-searches-based-on-host.yml
- 2571-rhsm_release-fix-release_matcher.yaml
- 2579-redis-cache-ipv6.yml
- 2590-netcup_dns-exception-no-message-attr.yml
- 2614-influxdb_user-fix-issue-introduced-in-PR#2499.yml
- 2634-terraform-switch-workspace.yml
- 2648-proxmox_kvm-fix-vmid-return-value.yml
- 2671-fix-broken-query-of-async_status-result.yml
- 2711-fix-iptables_state-2700-async_status-call.yml
- 2722-zypper_repository-fix_idempotency_on_adding_repo_with_releasever.yml
- 2731-mh-cmd-locale.yml
- json_query_more_types.yml
release_date: '2021-06-08'

View File

@@ -67,6 +67,8 @@ Individuals who have been asked to become a part of this group have generally be
| Name | GitHub ID | IRC Nick | Other |
| ------------------- | -------------------- | ------------------ | -------------------- |
| Alexei Znamensky | russoz | russoz | |
| Amin Vakil | aminvakil | aminvakil | |
| Andrew Klychkov | andersson007 | andersson007_ | |
| Felix Fontein | felixfontein | felixfontein | |
| John R Barker | gundalow | gundalow | |

View File

@@ -1,6 +1,6 @@
namespace: community
name: general
version: 2.5.2
version: 2.5.3
readme: README.md
authors:
- Ansible (https://github.com/ansible)

View File

@@ -7,7 +7,7 @@ __metaclass__ = type
import time
from ansible.plugins.action import ActionBase
from ansible.errors import AnsibleError, AnsibleActionFail, AnsibleConnectionFailure
from ansible.errors import AnsibleActionFail, AnsibleConnectionFailure
from ansible.utils.vars import merge_hash
from ansible.utils.display import Display
@@ -40,19 +40,27 @@ class ActionModule(ActionBase):
"(=%s) to 0, and 'async' (=%s) to a value >2 and not greater than "
"'ansible_timeout' (=%s) (recommended).")
def _async_result(self, module_args, task_vars, timeout):
def _async_result(self, async_status_args, task_vars, timeout):
'''
Retrieve results of the asynchonous task, and display them in place of
the async wrapper results (those with the ansible_job_id key).
'''
async_status = self._task.copy()
async_status.args = async_status_args
async_status.action = 'ansible.builtin.async_status'
async_status.async_val = 0
async_action = self._shared_loader_obj.action_loader.get(
async_status.action, task=async_status, connection=self._connection,
play_context=self._play_context, loader=self._loader, templar=self._templar,
shared_loader_obj=self._shared_loader_obj)
if async_status.args['mode'] == 'cleanup':
return async_action.run(task_vars=task_vars)
# At least one iteration is required, even if timeout is 0.
for i in range(max(1, timeout)):
async_result = self._execute_module(
module_name='ansible.builtin.async_status',
module_args=module_args,
task_vars=task_vars,
wrap_async=False)
if async_result['finished'] == 1:
for dummy in range(max(1, timeout)):
async_result = async_action.run(task_vars=task_vars)
if async_result.get('finished', 0) == 1:
break
time.sleep(min(1, timeout))
@@ -76,7 +84,6 @@ class ActionModule(ActionBase):
task_async = self._task.async_val
check_mode = self._play_context.check_mode
max_timeout = self._connection._play_context.timeout
module_name = self._task.action
module_args = self._task.args
if module_args.get('state', None) == 'restored':
@@ -107,7 +114,7 @@ class ActionModule(ActionBase):
# longer on the controller); and set a backup file path.
module_args['_timeout'] = task_async
module_args['_back'] = '%s/iptables.state' % async_dir
async_status_args = dict(_async_dir=async_dir)
async_status_args = dict(mode='status')
confirm_cmd = 'rm -f %s' % module_args['_back']
starter_cmd = 'touch %s.starter' % module_args['_back']
remaining_time = max(task_async, max_timeout)
@@ -133,7 +140,7 @@ class ActionModule(ActionBase):
# The module is aware to not process the main iptables-restore
# command before finding (and deleting) the 'starter' cookie on
# the host, so the previous query will not reach ssh timeout.
garbage = self._low_level_execute_command(starter_cmd, sudoable=self.DEFAULT_SUDOABLE)
dummy = self._low_level_execute_command(starter_cmd, sudoable=self.DEFAULT_SUDOABLE)
# As the main command is not yet executed on the target, here
# 'finished' means 'failed before main command be executed'.
@@ -143,7 +150,7 @@ class ActionModule(ActionBase):
except AttributeError:
pass
for x in range(max_timeout):
for dummy in range(max_timeout):
time.sleep(1)
remaining_time -= 1
# - AnsibleConnectionFailure covers rejected requests (i.e.
@@ -151,7 +158,7 @@ class ActionModule(ActionBase):
# - ansible_timeout is able to cover dropped requests (due
# to a rule or policy DROP) if not lower than async_val.
try:
garbage = self._low_level_execute_command(confirm_cmd, sudoable=self.DEFAULT_SUDOABLE)
dummy = self._low_level_execute_command(confirm_cmd, sudoable=self.DEFAULT_SUDOABLE)
break
except AnsibleConnectionFailure:
continue
@@ -164,16 +171,12 @@ class ActionModule(ActionBase):
del result[key]
if result.get('invocation', {}).get('module_args'):
if '_timeout' in result['invocation']['module_args']:
del result['invocation']['module_args']['_back']
del result['invocation']['module_args']['_timeout']
for key in ('_back', '_timeout', '_async_dir', 'jid'):
if result['invocation']['module_args'].get(key):
del result['invocation']['module_args'][key]
async_status_args['mode'] = 'cleanup'
garbage = self._execute_module(
module_name='ansible.builtin.async_status',
module_args=async_status_args,
task_vars=task_vars,
wrap_async=False)
dummy = self._async_result(async_status_args, task_vars, 0)
if not wrap_async:
# remove a temporary path we created

View File

@@ -61,6 +61,7 @@ DOCUMENTATION = '''
type: integer
'''
import re
import time
import json
@@ -91,6 +92,8 @@ class CacheModule(BaseCacheModule):
performance.
"""
_sentinel_service_name = None
re_url_conn = re.compile(r'^([^:]+|\[[^]]+\]):(\d+):(\d+)(?::(.*))?$')
re_sent_conn = re.compile(r'^(.*):(\d+)$')
def __init__(self, *args, **kwargs):
uri = ''
@@ -130,11 +133,18 @@ class CacheModule(BaseCacheModule):
self._db = self._get_sentinel_connection(uri, kw)
# normal connection
else:
connection = uri.split(':')
connection = self._parse_connection(self.re_url_conn, uri)
self._db = StrictRedis(*connection, **kw)
display.vv('Redis connection: %s' % self._db)
@staticmethod
def _parse_connection(re_patt, uri):
match = re_patt.match(uri)
if not match:
raise AnsibleError("Unable to parse connection string")
return match.groups()
def _get_sentinel_connection(self, uri, kw):
"""
get sentinel connection details from _uri
@@ -158,7 +168,7 @@ class CacheModule(BaseCacheModule):
except IndexError:
pass # password is optional
sentinels = [tuple(shost.split(':')) for shost in connections]
sentinels = [self._parse_connection(self.re_sent_conn, shost) for shost in connections]
display.vv('\nUsing redis sentinels: %s' % sentinels)
scon = Sentinel(sentinels, **kw)
try:

View File

@@ -35,9 +35,11 @@ def json_query(data, expr):
raise AnsibleError('You need to install "jmespath" prior to running '
'json_query filter')
# Hack to handle Ansible String Types
# Hack to handle Ansible Unsafe text, AnsibleMapping and AnsibleSequence
# See issue: https://github.com/ansible-collections/community.general/issues/320
jmespath.functions.REVERSE_TYPES_MAP['string'] = jmespath.functions.REVERSE_TYPES_MAP['string'] + ('AnsibleUnicode', 'AnsibleUnsafeText', )
jmespath.functions.REVERSE_TYPES_MAP['array'] = jmespath.functions.REVERSE_TYPES_MAP['array'] + ('AnsibleSequence', )
jmespath.functions.REVERSE_TYPES_MAP['object'] = jmespath.functions.REVERSE_TYPES_MAP['object'] + ('AnsibleMapping', )
try:
return jmespath.search(expr, data)
except jmespath.exceptions.JMESPathError as e:

View File

@@ -130,7 +130,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
# This occurs if the cache_key is not in the cache or if the cache_key expired, so the cache needs to be updated
cache_needs_update = True
if cache_needs_update:
if not user_cache_setting or cache_needs_update:
# setup command
cmd = [self._nmap]
if not self._options['ports']:
@@ -207,6 +207,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
except Exception as e:
raise AnsibleParserError("failed to parse %s: %s " % (to_native(path), to_native(e)))
if cache_needs_update:
self._cache[cache_key] = results
self._populate(results)

View File

@@ -10,6 +10,8 @@ DOCUMENTATION = '''
name: stackpath_compute
short_description: StackPath Edge Computing inventory source
version_added: 1.2.0
author:
- UNKNOWN (@shayrybak)
extends_documentation_fragment:
- inventory_cache
- constructed

View File

@@ -171,10 +171,10 @@ class LookupModule(LookupBase):
paramvals = {
'key': params[0],
'token': None,
'recurse': False,
'index': None,
'datacenter': None
'token': self.get_option('token'),
'recurse': self.get_option('recurse'),
'index': self.get_option('index'),
'datacenter': self.get_option('datacenter')
}
# parameters specified?

View File

@@ -103,6 +103,14 @@ EXAMPLES = r"""
| items2dict(key_name='slug',
value_name='itemValue'))['password']
}}
- hosts: localhost
vars:
secret_password: >-
{{ ((lookup('community.general.tss', 1) | from_json).get('items') | items2dict(key_name='slug', value_name='itemValue'))['password'] }}"
tasks:
- ansible.builtin.debug:
msg: the password is {{ secret_password }}
"""
from ansible.errors import AnsibleError, AnsibleOptionsError

View File

@@ -487,13 +487,16 @@ class CmdMixin(object):
def run_command(self, extra_params=None, params=None, *args, **kwargs):
self.vars.cmd_args = self._calculate_args(extra_params, params)
options = dict(self.run_command_fixed_options)
env_update = dict(options.get('environ_update', {}))
options['check_rc'] = options.get('check_rc', self.check_rc)
options.update(kwargs)
env_update = dict(options.get('environ_update', {}))
if self.force_lang:
env_update.update({'LANGUAGE': self.force_lang})
env_update.update({
'LANGUAGE': self.force_lang,
'LC_ALL': self.force_lang,
})
self.update_output(force_lang=self.force_lang)
options['environ_update'] = env_update
options.update(kwargs)
rc, out, err = self.module.run_command(self.vars.cmd_args, *args, **options)
self.update_output(rc=rc, stdout=out, stderr=err)
return self.process_command_output(rc, out, err)

View File

@@ -1226,7 +1226,7 @@ def main():
if get_vm(proxmox, vmid) and not (update or clone):
module.exit_json(changed=False, vmid=vmid, msg="VM with vmid <%s> already exists" % vmid)
elif get_vmid(proxmox, name) and not (update or clone):
module.exit_json(changed=False, vmid=vmid, msg="VM with name <%s> already exists" % name)
module.exit_json(changed=False, vmid=get_vmid(proxmox, name)[0], msg="VM with name <%s> already exists" % name)
elif not (node, name):
module.fail_json(msg='node, name is mandatory for creating/updating vm')
elif not node_check(proxmox, node):

View File

@@ -398,7 +398,14 @@ def main():
command.append(plan_file)
if needs_application and not module.check_mode and not state == 'planned':
rc, out, err = module.run_command(command, check_rc=True, cwd=project_path)
rc, out, err = module.run_command(command, check_rc=False, cwd=project_path)
if rc != 0:
if workspace_ctx["current"] != workspace:
select_workspace(command[0], project_path, workspace_ctx["current"])
module.fail_json(msg=err.rstrip(), rc=rc, stdout=out,
stdout_lines=out.splitlines(), stderr=err,
stderr_lines=err.splitlines(),
cmd=' '.join(command))
# checks out to decide if changes were made during execution
if ' 0 added, 0 changed' not in out and not state == "absent" or ' 0 destroyed' not in out:
changed = True

View File

@@ -189,7 +189,24 @@ from collections import defaultdict
from ansible.module_utils.basic import to_text, AnsibleModule
RULE_SCOPES = ["agent", "event", "key", "keyring", "node", "operator", "query", "service", "session"]
RULE_SCOPES = [
"agent",
"agent_prefix",
"event",
"event_prefix",
"key",
"key_prefix",
"keyring",
"node",
"node_prefix",
"operator",
"query",
"query_prefix",
"service",
"service_prefix",
"session",
"session_prefix",
]
MANAGEMENT_PARAMETER_NAME = "mgmt_token"
HOST_PARAMETER_NAME = "host"

View File

@@ -100,6 +100,8 @@ RETURN = r'''
#only defaults
'''
import json
from ansible.module_utils.urls import ConnectionError
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils._text import to_native
@@ -115,7 +117,7 @@ def find_user(module, client, user_name):
if user['user'] == user_name:
user_result = user
break
except (ConnectionError, influx.exceptions.InfluxDBClientError) as e:
except ConnectionError as e:
module.fail_json(msg=to_native(e))
return user_result
@@ -166,16 +168,16 @@ def set_user_grants(module, client, user_name, grants):
try:
current_grants = client.get_list_privileges(user_name)
parsed_grants = []
# Fix privileges wording
for i, v in enumerate(current_grants):
if v['privilege'] == 'ALL PRIVILEGES':
v['privilege'] = 'ALL'
current_grants[i] = v
elif v['privilege'] == 'NO PRIVILEGES':
del(current_grants[i])
if v['privilege'] != 'NO PRIVILEGES':
if v['privilege'] == 'ALL PRIVILEGES':
v['privilege'] = 'ALL'
parsed_grants.append(v)
# check if the current grants are included in the desired ones
for current_grant in current_grants:
for current_grant in parsed_grants:
if current_grant not in grants:
if not module.check_mode:
client.revoke_privilege(current_grant['privilege'],
@@ -185,7 +187,7 @@ def set_user_grants(module, client, user_name, grants):
# check if the desired grants are included in the current ones
for grant in grants:
if grant not in current_grants:
if grant not in parsed_grants:
if not module.check_mode:
client.grant_privilege(grant['privilege'],
grant['database'],
@@ -198,6 +200,9 @@ def set_user_grants(module, client, user_name, grants):
return changed
INFLUX_AUTH_FIRST_USER_REQUIRED = "error authorizing query: create admin user first or disable authentication"
def main():
argument_spec = influx.InfluxDb.influxdb_argument_spec()
argument_spec.update(
@@ -219,7 +224,23 @@ def main():
grants = module.params['grants']
influxdb = influx.InfluxDb(module)
client = influxdb.connect_to_influxdb()
user = find_user(module, client, user_name)
user = None
try:
user = find_user(module, client, user_name)
except influx.exceptions.InfluxDBClientError as e:
if e.code == 403:
reason = None
try:
msg = json.loads(e.content)
reason = msg["error"]
except (KeyError, ValueError):
module.fail_json(msg=to_native(e))
if reason != INFLUX_AUTH_FIRST_USER_REQUIRED:
module.fail_json(msg=to_native(e))
else:
module.fail_json(msg=to_native(e))
changed = False

View File

@@ -301,6 +301,23 @@ EXAMPLES = r'''
- floor: Grog storage
- construction_date: "1990" # Only strings are valid
- building: Grog factory
# Consider this XML for following example -
#
# <config>
# <element name="test1">
# <text>part to remove</text>
# </element>
# <element name="test2">
# <text>part to keep</text>
# </element>
# </config>
- name: Delete element node based upon attribute
community.general.xml:
path: bar.xml
xpath: /config/element[@name='test1']
state: absent
'''
RETURN = r'''

View File

@@ -150,7 +150,7 @@ EXAMPLES = r'''
backend: www
wait: yes
drain: yes
wait_interval: 1
wait_interval: 60
wait_retries: 60
- name: Disable backend server in 'www' backend pool and drop open sessions to it

View File

@@ -255,7 +255,7 @@ def main():
has_changed = True
except Exception as ex:
module.fail_json(msg=ex.message)
module.fail_json(msg=str(ex))
module.exit_json(changed=has_changed, result={"records": [record_data(r) for r in all_records]})

View File

@@ -56,9 +56,9 @@ from ansible.module_utils.basic import AnsibleModule
import re
# Matches release-like values such as 7.2, 6.10, 10Server,
# but rejects unlikely values, like 100Server, 100.0, 1.100, etc.
release_matcher = re.compile(r'\b\d{1,2}(?:\.\d{1,2}|Server)\b')
# Matches release-like values such as 7.2, 5.10, 6Server, 8
# but rejects unlikely values, like 100Server, 1.100, 7server etc.
release_matcher = re.compile(r'\b\d{1,2}(?:\.\d{1,2}|Server|Client|Workstation|)\b')
def _sm_release(module, *args):

View File

@@ -175,7 +175,7 @@ def _parse_repos(module):
module.fail_json(msg='Failed to execute "%s"' % " ".join(cmd), rc=rc, stdout=stdout, stderr=stderr)
def _repo_changes(realrepo, repocmp):
def _repo_changes(module, realrepo, repocmp):
"Check whether the 2 given repos have different settings."
for k in repocmp:
if repocmp[k] and k not in realrepo:
@@ -186,6 +186,16 @@ def _repo_changes(realrepo, repocmp):
valold = str(repocmp[k] or "")
valnew = v or ""
if k == "url":
if '$releasever' in valold or '$releasever' in valnew:
cmd = ['rpm', '-q', '--qf', '%{version}', '-f', '/etc/os-release']
rc, stdout, stderr = module.run_command(cmd, check_rc=True)
valnew = valnew.replace('$releasever', stdout)
valold = valold.replace('$releasever', stdout)
if '$basearch' in valold or '$basearch' in valnew:
cmd = ['rpm', '-q', '--qf', '%{arch}', '-f', '/etc/os-release']
rc, stdout, stderr = module.run_command(cmd, check_rc=True)
valnew = valnew.replace('$basearch', stdout)
valold = valold.replace('$basearch', stdout)
valold, valnew = valold.rstrip("/"), valnew.rstrip("/")
if valold != valnew:
return True
@@ -215,7 +225,7 @@ def repo_exists(module, repodata, overwrite_multiple):
return (False, False, None)
elif len(repos) == 1:
# Found an existing repo, look for changes
has_changes = _repo_changes(repos[0], repodata)
has_changes = _repo_changes(module, repos[0], repodata)
return (True, has_changes, repos)
elif len(repos) >= 2:
if overwrite_multiple:

View File

@@ -232,7 +232,7 @@ import filecmp
import shutil
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils._text import to_bytes, to_native, to_text
from ansible.module_utils._text import to_bytes, to_native
IPTABLES = dict(
@@ -262,7 +262,7 @@ def read_state(b_path):
lines = text.splitlines()
while '' in lines:
lines.remove('')
return (lines)
return lines
def write_state(b_path, lines, changed):
@@ -282,9 +282,9 @@ def write_state(b_path, lines, changed):
if b_destdir and not os.path.exists(b_destdir) and not module.check_mode:
try:
os.makedirs(b_destdir)
except Exception as e:
except Exception as err:
module.fail_json(
msg='Error creating %s. Error code: %s. Error description: %s' % (destdir, e[0], e[1]),
msg='Error creating %s: %s' % (destdir, to_native(err)),
initial_state=lines)
changed = True
@@ -295,16 +295,16 @@ def write_state(b_path, lines, changed):
if changed and not module.check_mode:
try:
shutil.copyfile(tmpfile, b_path)
except Exception as e:
except Exception as err:
path = to_native(b_path, errors='surrogate_or_strict')
module.fail_json(
msg='Error saving state into %s. Error code: %s. Error description: %s' % (path, e[0], e[1]),
msg='Error saving state into %s: %s' % (path, to_native(err)),
initial_state=lines)
return changed
def initialize_from_null_state(initializer, initcommand, table):
def initialize_from_null_state(initializer, initcommand, fallbackcmd, table):
'''
This ensures iptables-state output is suitable for iptables-restore to roll
back to it, i.e. iptables-save output is not empty. This also works for the
@@ -313,14 +313,17 @@ def initialize_from_null_state(initializer, initcommand, table):
if table is None:
table = 'filter'
tmpfd, tmpfile = tempfile.mkstemp()
with os.fdopen(tmpfd, 'w') as f:
f.write('*%s\nCOMMIT\n' % table)
initializer.append(tmpfile)
(rc, out, err) = module.run_command(initializer, check_rc=True)
commandline = list(initializer)
commandline += ['-t', table]
dummy = module.run_command(commandline, check_rc=True)
(rc, out, err) = module.run_command(initcommand, check_rc=True)
return (rc, out, err)
if '*%s' % table not in out.splitlines():
# The last resort.
iptables_input = '*%s\n:OUTPUT ACCEPT\nCOMMIT\n' % table
dummy = module.run_command(fallbackcmd, data=iptables_input, check_rc=True)
(rc, out, err) = module.run_command(initcommand, check_rc=True)
return rc, out, err
def filter_and_format_state(string):
@@ -328,13 +331,13 @@ def filter_and_format_state(string):
Remove timestamps to ensure idempotence between runs. Also remove counters
by default. And return the result as a list.
'''
string = re.sub('((^|\n)# (Generated|Completed)[^\n]*) on [^\n]*', '\\1', string)
string = re.sub(r'((^|\n)# (Generated|Completed)[^\n]*) on [^\n]*', r'\1', string)
if not module.params['counters']:
string = re.sub('[[][0-9]+:[0-9]+[]]', '[0:0]', string)
string = re.sub(r'\[[0-9]+:[0-9]+\]', r'[0:0]', string)
lines = string.splitlines()
while '' in lines:
lines.remove('')
return (lines)
return lines
def per_table_state(command, state):
@@ -347,14 +350,14 @@ def per_table_state(command, state):
COMMAND = list(command)
if '*%s' % t in state.splitlines():
COMMAND.extend(['--table', t])
(rc, out, err) = module.run_command(COMMAND, check_rc=True)
out = re.sub('(^|\n)(# Generated|# Completed|[*]%s|COMMIT)[^\n]*' % t, '', out)
out = re.sub(' *[[][0-9]+:[0-9]+[]] *', '', out)
dummy, out, dummy = module.run_command(COMMAND, check_rc=True)
out = re.sub(r'(^|\n)(# Generated|# Completed|[*]%s|COMMIT)[^\n]*' % t, r'', out)
out = re.sub(r' *\[[0-9]+:[0-9]+\] *', r'', out)
table = out.splitlines()
while '' in table:
table.remove('')
tables[t] = table
return (tables)
return tables
def main():
@@ -402,8 +405,9 @@ def main():
changed = False
COMMANDARGS = []
INITCOMMAND = [bin_iptables_save]
INITIALIZER = [bin_iptables_restore]
INITIALIZER = [bin_iptables, '-L', '-n']
TESTCOMMAND = [bin_iptables_restore, '--test']
FALLBACKCMD = [bin_iptables_restore]
if counters:
COMMANDARGS.append('--counters')
@@ -428,6 +432,7 @@ def main():
INITIALIZER.extend(['--modprobe', modprobe])
INITCOMMAND.extend(['--modprobe', modprobe])
TESTCOMMAND.extend(['--modprobe', modprobe])
FALLBACKCMD.extend(['--modprobe', modprobe])
SAVECOMMAND = list(COMMANDARGS)
SAVECOMMAND.insert(0, bin_iptables_save)
@@ -461,15 +466,15 @@ def main():
for t in TABLES:
if '*%s' % t in state_to_restore:
if len(stdout) == 0 or '*%s' % t not in stdout.splitlines():
(rc, stdout, stderr) = initialize_from_null_state(INITIALIZER, INITCOMMAND, t)
(rc, stdout, stderr) = initialize_from_null_state(INITIALIZER, INITCOMMAND, FALLBACKCMD, t)
elif len(stdout) == 0:
(rc, stdout, stderr) = initialize_from_null_state(INITIALIZER, INITCOMMAND, 'filter')
(rc, stdout, stderr) = initialize_from_null_state(INITIALIZER, INITCOMMAND, FALLBACKCMD, 'filter')
elif state == 'restored' and '*%s' % table not in state_to_restore:
module.fail_json(msg="Table %s to restore not defined in %s" % (table, path))
elif len(stdout) == 0 or '*%s' % table not in stdout.splitlines():
(rc, stdout, stderr) = initialize_from_null_state(INITIALIZER, INITCOMMAND, table)
(rc, stdout, stderr) = initialize_from_null_state(INITIALIZER, INITCOMMAND, FALLBACKCMD, table)
initial_state = filter_and_format_state(stdout)
if initial_state is None:
@@ -502,7 +507,7 @@ def main():
if _back is not None:
b_back = to_bytes(_back, errors='surrogate_or_strict')
garbage = write_state(b_back, initref_state, changed)
dummy = write_state(b_back, initref_state, changed)
BACKCOMMAND = list(MAINCOMMAND)
BACKCOMMAND.append(_back)
@@ -559,9 +564,7 @@ def main():
if os.path.exists(b_starter):
os.remove(b_starter)
break
else:
time.sleep(0.01)
continue
time.sleep(0.01)
(rc, stdout, stderr) = module.run_command(MAINCOMMAND)
if 'Another app is currently holding the xtables lock' in stderr:
@@ -579,7 +582,7 @@ def main():
(rc, stdout, stderr) = module.run_command(SAVECOMMAND, check_rc=True)
restored_state = filter_and_format_state(stdout)
if restored_state != initref_state and restored_state != initial_state:
if restored_state not in (initref_state, initial_state):
if module.check_mode:
changed = True
else:
@@ -609,7 +612,7 @@ def main():
# timeout
# * task attribute 'poll' equals 0
#
for x in range(_timeout):
for dummy in range(_timeout):
if os.path.exists(b_back):
time.sleep(1)
continue

View File

@@ -278,7 +278,7 @@ def _export_public_cert_from_pkcs12(module, executable, pkcs_file, alias, passwo
(export_rc, export_stdout, export_err) = module.run_command(export_cmd, data=password, check_rc=False)
if export_rc != 0:
module.fail_json(msg="Internal module failure, cannot extract public certificate from pkcs12, error: %s" % export_err,
module.fail_json(msg="Internal module failure, cannot extract public certificate from pkcs12, error: %s" % export_stdout,
rc=export_rc)
with open(dest, 'w') as f:
@@ -498,7 +498,7 @@ def main():
if pkcs12_path:
# Extracting certificate with openssl
_export_public_cert_from_pkcs12(module, executable, pkcs12_path, cert_alias, pkcs12_pass, new_certificate)
_export_public_cert_from_pkcs12(module, executable, pkcs12_path, pkcs12_alias, pkcs12_pass, new_certificate)
elif path:
# Extracting the X509 digest is a bit easier. Keytool will print the PEM

View File

@@ -100,7 +100,7 @@ options:
fs_type:
description:
- If specified and the partition does not exist, will set filesystem type to given partition.
- Parameter optional, but see notes below about negative negative C(part_start) values.
- Parameter optional, but see notes below about negative C(part_start) values.
type: str
version_added: '0.2.0'
resize:

View File

@@ -209,6 +209,8 @@ class SSHConfig():
hosts_removed = []
hosts_added = []
hosts_result = [host for host in hosts_result if host['host'] == self.host]
if hosts_result:
for host in hosts_result:
if state == 'absent':

View File

@@ -696,7 +696,8 @@ class JenkinsPlugin(object):
self._get_url_data(
url,
msg_status="Plugin not found. %s" % url,
msg_exception="%s has failed." % msg)
msg_exception="%s has failed." % msg,
method="POST")
def main():

View File

@@ -56,6 +56,7 @@ import sys
from collections import defaultdict
from ansible.module_utils.six.moves import configparser
from ansible.module_utils.six import PY2
import json
@@ -106,14 +107,24 @@ def create_connection():
config_path = os.environ.get('OVIRT_INI_PATH', default_path)
# Create parser and add ovirt section if it doesn't exist:
config = configparser.SafeConfigParser(
defaults={
'ovirt_url': os.environ.get('OVIRT_URL'),
'ovirt_username': os.environ.get('OVIRT_USERNAME'),
'ovirt_password': os.environ.get('OVIRT_PASSWORD'),
'ovirt_ca_file': os.environ.get('OVIRT_CAFILE', ''),
}
)
if PY2:
config = configparser.SafeConfigParser(
defaults={
'ovirt_url': os.environ.get('OVIRT_URL'),
'ovirt_username': os.environ.get('OVIRT_USERNAME'),
'ovirt_password': os.environ.get('OVIRT_PASSWORD'),
'ovirt_ca_file': os.environ.get('OVIRT_CAFILE', ''),
}, allow_no_value=True
)
else:
config = configparser.ConfigParser(
defaults={
'ovirt_url': os.environ.get('OVIRT_URL'),
'ovirt_username': os.environ.get('OVIRT_USERNAME'),
'ovirt_password': os.environ.get('OVIRT_PASSWORD'),
'ovirt_ca_file': os.environ.get('OVIRT_CAFILE', ''),
}, allow_no_value=True
)
if not config.has_section('ovirt'):
config.add_section('ovirt')
config.read(config_path)

View File

@@ -174,7 +174,7 @@
- name: Test that the file modes were changed
assert:
that:
- "archive_02_gz_stat.changed == False "
- archive_02_gz_stat is not changed
- "archive_02_gz_stat.stat.mode == '0600'"
- "'archived' in archive_bz2_result_02"
- "{{ archive_bz2_result_02['archived']| length}} == 3"
@@ -199,7 +199,7 @@
- name: Test that the file modes were changed
assert:
that:
- "archive_02_zip_stat.changed == False"
- archive_02_zip_stat is not changed
- "archive_02_zip_stat.stat.mode == '0600'"
- "'archived' in archive_zip_result_02"
- "{{ archive_zip_result_02['archived']| length}} == 3"
@@ -224,7 +224,7 @@
- name: Test that the file modes were changed
assert:
that:
- "archive_02_bz2_stat.changed == False"
- archive_02_bz2_stat is not changed
- "archive_02_bz2_stat.stat.mode == '0600'"
- "'archived' in archive_bz2_result_02"
- "{{ archive_bz2_result_02['archived']| length}} == 3"
@@ -248,7 +248,7 @@
- name: Test that the file modes were changed
assert:
that:
- "archive_02_xz_stat.changed == False"
- archive_02_xz_stat is not changed
- "archive_02_xz_stat.stat.mode == '0600'"
- "'archived' in archive_xz_result_02"
- "{{ archive_xz_result_02['archived']| length}} == 3"
@@ -294,7 +294,7 @@
- name: Assert that nonascii tests succeeded
assert:
that:
- "nonascii_result_0.changed == true"
- nonascii_result_0 is changed
- "nonascii_stat0.stat.exists == true"
- name: remove nonascii test
@@ -315,7 +315,7 @@
- name: Assert that nonascii tests succeeded
assert:
that:
- "nonascii_result_1.changed == true"
- nonascii_result_1 is changed
- "nonascii_stat_1.stat.exists == true"
- name: remove nonascii test
@@ -336,7 +336,7 @@
- name: Assert that nonascii tests succeeded
assert:
that:
- "nonascii_result_1.changed == true"
- nonascii_result_1 is changed
- "nonascii_stat_1.stat.exists == true"
- name: remove nonascii test
@@ -357,7 +357,7 @@
- name: Assert that nonascii tests succeeded
assert:
that:
- "nonascii_result_2.changed == true"
- nonascii_result_2 is changed
- "nonascii_stat_2.stat.exists == true"
- name: remove nonascii test

View File

@@ -13,7 +13,7 @@
- name: Verify addition of absent flatpak test result (check mode)
assert:
that:
- "addition_result.changed == true"
- addition_result is changed
msg: "Adding an absent flatpak shall mark module execution as changed"
- name: Test non-existent idempotency of addition of absent flatpak (check mode)
@@ -27,7 +27,7 @@
- name: Verify non-existent idempotency of addition of absent flatpak test result (check mode)
assert:
that:
- "double_addition_result.changed == true"
- double_addition_result is changed
msg: |
Adding an absent flatpak a second time shall still mark module execution
as changed in check mode
@@ -44,7 +44,7 @@
- name: Verify removal of absent flatpak test result (check mode)
assert:
that:
- "removal_result.changed == false"
- removal_result is not changed
msg: "Removing an absent flatpak shall mark module execution as not changed"
# state=present with url on absent flatpak
@@ -60,7 +60,7 @@
- name: Verify addition of absent flatpak with url test result (check mode)
assert:
that:
- "url_addition_result.changed == true"
- url_addition_result is changed
msg: "Adding an absent flatpak from URL shall mark module execution as changed"
- name: Test non-existent idempotency of addition of absent flatpak with url (check mode)
@@ -76,7 +76,7 @@
result (check mode)
assert:
that:
- "double_url_addition_result.changed == true"
- double_url_addition_result is changed
msg: |
Adding an absent flatpak from URL a second time shall still mark module execution
as changed in check mode
@@ -93,7 +93,7 @@
- name: Verify removal of absent flatpak with url test result (check mode)
assert:
that:
- "url_removal_result.changed == false"
- url_removal_result is not changed
msg: "Removing an absent flatpak shall mark module execution as not changed"
@@ -112,7 +112,7 @@
- name: Verify addition test result of present flatpak (check mode)
assert:
that:
- "addition_present_result.changed == false"
- addition_present_result is not changed
msg: "Adding an present flatpak shall mark module execution as not changed"
# state=absent on present flatpak
@@ -127,7 +127,7 @@
- name: Verify removal of present flatpak test result (check mode)
assert:
that:
- "removal_present_result.changed == true"
- removal_present_result is changed
msg: "Removing a present flatpak shall mark module execution as changed"
- name: Test non-existent idempotency of removal (check mode)
@@ -140,7 +140,7 @@
- name: Verify non-existent idempotency of removal (check mode)
assert:
that:
- "double_removal_present_result.changed == true"
- double_removal_present_result is changed
msg: |
Removing a present flatpak a second time shall still mark module execution
as changed in check mode
@@ -158,7 +158,7 @@
- name: Verify addition with url of present flatpak test result (check mode)
assert:
that:
- "url_addition_present_result.changed == false"
- url_addition_present_result is not changed
msg: "Adding a present flatpak from URL shall mark module execution as not changed"
# state=absent with url on present flatpak
@@ -173,7 +173,7 @@
- name: Verify removal with url of present flatpak test result (check mode)
assert:
that:
- "url_removal_present_result.changed == true"
- url_removal_present_result is changed
msg: "Removing an absent flatpak shall mark module execution as not changed"
- name: Test non-existent idempotency of removal with url of present flatpak (check mode)
@@ -189,5 +189,5 @@
flatpak test result (check mode)
assert:
that:
- "double_url_removal_present_result.changed == true"
- double_url_removal_present_result is changed
msg: Removing an absent flatpak a second time shall still mark module execution as changed

View File

@@ -40,8 +40,8 @@
- name: Verify executable override test result
assert:
that:
- "executable_override_result.failed == true"
- "executable_override_result.changed == false"
- executable_override_result is failed
- executable_override_result is not changed
msg: "Specifying non-existing executable shall fail module execution"
- import_tasks: check_mode.yml

View File

@@ -11,7 +11,7 @@
- name: Verify addition test result - {{ method }}
assert:
that:
- "addition_result.changed == true"
- addition_result is changed
msg: "state=present shall add flatpak when absent"
- name: Test idempotency of addition - {{ method }}
@@ -25,7 +25,7 @@
- name: Verify idempotency of addition test result - {{ method }}
assert:
that:
- "double_addition_result.changed == false"
- double_addition_result is not changed
msg: "state=present shall not do anything when flatpak is already present"
# state=absent
@@ -40,7 +40,7 @@
- name: Verify removal test result - {{ method }}
assert:
that:
- "removal_result.changed == true"
- removal_result is changed
msg: "state=absent shall remove flatpak when present"
- name: Test idempotency of removal - {{ method }}
@@ -53,7 +53,7 @@
- name: Verify idempotency of removal test result - {{ method }}
assert:
that:
- "double_removal_result.changed == false"
- double_removal_result is not changed
msg: "state=absent shall not do anything when flatpak is not present"
# state=present with url as name
@@ -69,7 +69,7 @@
- name: Verify addition test result - {{ method }}
assert:
that:
- "url_addition_result.changed == true"
- url_addition_result is changed
msg: "state=present with url as name shall add flatpak when absent"
- name: Test idempotency of addition with url - {{ method }}
@@ -83,7 +83,7 @@
- name: Verify idempotency of addition with url test result - {{ method }}
assert:
that:
- "double_url_addition_result.changed == false"
- double_url_addition_result is not changed
msg: "state=present with url as name shall not do anything when flatpak is already present"
# state=absent with url as name
@@ -98,7 +98,7 @@
- name: Verify removal test result - {{ method }}
assert:
that:
- "url_removal_result.changed == true"
- url_removal_result is changed
msg: "state=absent with url as name shall remove flatpak when present"
- name: Test idempotency of removal with url - {{ method }}
@@ -111,5 +111,5 @@
- name: Verify idempotency of removal with url test result - {{ method }}
assert:
that:
- "double_url_removal_result.changed == false"
- double_url_removal_result is not changed
msg: "state=absent with url as name shall not do anything when flatpak is not present"

View File

@@ -6,4 +6,3 @@ skip/osx
skip/macos
skip/rhel
needs/root
disabled # FIXME

View File

@@ -13,7 +13,7 @@
- name: Verify addition of absent flatpak remote test result (check mode)
assert:
that:
- "addition_result.changed == true"
- addition_result is changed
msg: "Adding an absent flatpak remote shall mark module execution as changed"
- name: Test non-existent idempotency of addition of absent flatpak remote (check mode)
@@ -29,7 +29,7 @@
test result (check mode)
assert:
that:
- "double_addition_result.changed == true"
- double_addition_result is changed
msg: |
Adding an absent flatpak remote a second time shall still mark module execution
as changed in check mode
@@ -46,7 +46,7 @@
- name: Verify removal of absent flatpak remote test result (check mode)
assert:
that:
- "removal_result.changed == false"
- removal_result is not changed
msg: "Removing an absent flatpak remote shall mark module execution as not changed"
@@ -65,7 +65,7 @@
- name: Verify addition of present flatpak remote test result (check mode)
assert:
that:
- "addition_result.changed == false"
- addition_result is not changed
msg: "Adding a present flatpak remote shall mark module execution as not changed"
# state=absent
@@ -80,7 +80,7 @@
- name: Verify removal of present flatpak remote test result (check mode)
assert:
that:
- "removal_result.changed == true"
- removal_result is changed
msg: "Removing a present flatpak remote shall mark module execution as changed"
- name: Test non-existent idempotency of removal of present flatpak remote (check mode)
@@ -95,7 +95,7 @@
test result (check mode)
assert:
that:
- "double_removal_result.changed == true"
- double_removal_result is changed
msg: |
Removing a present flatpak remote a second time shall still mark module execution
as changed in check mode

View File

@@ -40,8 +40,8 @@
- name: Verify executable override test result
assert:
that:
- "executable_override_result.failed == true"
- "executable_override_result.changed == false"
- executable_override_result is failed
- executable_override_result is not changed
msg: "Specifying non-existing executable shall fail module execution"
- import_tasks: check_mode.yml

View File

@@ -11,7 +11,7 @@
- name: Verify addition test result - {{ method }}
assert:
that:
- "addition_result.changed == true"
- addition_result is changed
msg: "state=present shall add flatpak when absent"
- name: Test idempotency of addition - {{ method }}
@@ -25,7 +25,7 @@
- name: Verify idempotency of addition test result - {{ method }}
assert:
that:
- "double_addition_result.changed == false"
- double_addition_result is not changed
msg: "state=present shall not do anything when flatpak is already present"
- name: Test updating remote url does not do anything - {{ method }}
@@ -39,7 +39,7 @@
- name: Verify updating remote url does not do anything - {{ method }}
assert:
that:
- "url_update_result.changed == false"
- url_update_result is not changed
msg: "Trying to update the URL of an existing flatpak remote shall not do anything"
@@ -55,7 +55,7 @@
- name: Verify removal test result - {{ method }}
assert:
that:
- "removal_result.changed == true"
- removal_result is changed
msg: "state=absent shall remove flatpak when present"
- name: Test idempotency of removal - {{ method }}
@@ -68,5 +68,5 @@
- name: Verify idempotency of removal test result - {{ method }}
assert:
that:
- "double_removal_result.changed == false"
- double_removal_result is not changed
msg: "state=absent shall not do anything when flatpak is not present"

View File

@@ -17,9 +17,9 @@
- name: assert set changed and value is correct
assert:
that:
- set_result.changed == true
- set_result is changed
- set_result.diff.before == "\n"
- set_result.diff.after == option_value + "\n"
- get_result.changed == false
- get_result is not changed
- get_result.config_value == option_value
...

View File

@@ -19,9 +19,9 @@
- name: assert set changed and value is correct with state=present
assert:
that:
- set_result.changed == true
- set_result is changed
- set_result.diff.before == "\n"
- set_result.diff.after == option_value + "\n"
- get_result.changed == false
- get_result is not changed
- get_result.config_value == option_value
...

View File

@@ -18,7 +18,7 @@
- name: assert unset changed and deleted value
assert:
that:
- unset_result.changed == true
- unset_result is changed
- unset_result.diff.before == option_value + "\n"
- unset_result.diff.after == "\n"
- get_result.config_value == ''

View File

@@ -18,7 +18,7 @@
- name: assert unset changed but dit not delete value
assert:
that:
- unset_result.changed == true
- unset_result is changed
- unset_result.diff.before == option_value + "\n"
- unset_result.diff.after == "\n"
- get_result.config_value == option_value

View File

@@ -17,7 +17,7 @@
- name: assert unsetting didn't change
assert:
that:
- unset_result.changed == false
- unset_result is not changed
- unset_result.msg == 'no setting to unset'
- get_result.config_value == ''
...

View File

@@ -17,7 +17,7 @@
- name: assert unset changed and deleted value
assert:
that:
- unset_result.changed == true
- unset_result is changed
- unset_result.diff.before == option_value + "\n"
- unset_result.diff.after == "\n"
- get_result.config_value == ''

View File

@@ -18,8 +18,8 @@
- assert:
that:
- "{{ get_status_0002.changed == True }}"
- "{{ get_status_0002.issue_status == 'closed' }}"
- get_status_0002 is changed
- get_status_0002.issue_status == 'closed'
- name: Check if GitHub issue is closed or not
github_issue:
@@ -32,6 +32,6 @@
- assert:
that:
- "{{ get_status_0003.changed == False }}"
- "{{ get_status_0003.failed == True }}"
- "{{ 'Failed' in get_status_0003.msg }}"
- get_status_0003 is not changed
- get_status_0003 is failed
- "'Failed' in get_status_0003.msg"

View File

@@ -167,8 +167,8 @@
- name: assert changed is false
assert:
that:
- result.failed == 0
- result.changed == false
- result is not failed
- result is not changed
#----------------------------------------------------------
- name: delete a instance (check mode)
hwc_ecs_instance:
@@ -277,8 +277,8 @@
- name: assert changed is false
assert:
that:
- result.failed == 0
- result.changed == false
- result is not failed
- result is not changed
#---------------------------------------------------------
# Post-test teardown
- name: delete a disk

View File

@@ -50,8 +50,8 @@
- name: assert changed is false
assert:
that:
- result.failed == 0
- result.changed == false
- result is not failed
- result is not changed
#----------------------------------------------------------
- name: delete a disk (check mode)
hwc_evs_disk:
@@ -92,7 +92,7 @@
- name: assert changed is false
assert:
that:
- result.changed == false
- result is not changed
# ----------------------------------------------------------------------------
- name: delete a disk that does not exist
hwc_evs_disk:
@@ -105,5 +105,5 @@
- name: assert changed is false
assert:
that:
- result.failed == 0
- result.changed == false
- result is not failed
- result is not changed

View File

@@ -62,8 +62,8 @@
- name: assert changed is false
assert:
that:
- result.failed == 0
- result.changed == false
- result is not failed
- result is not changed
#----------------------------------------------------------
- name: delete a vpc
hwc_network_vpc:
@@ -97,5 +97,5 @@
- name: assert changed is false
assert:
that:
- result.failed == 0
- result.changed == false
- result is not failed
- result is not changed

View File

@@ -44,8 +44,8 @@
- name: assert changed is false
assert:
that:
- result.failed == 0
- result.changed == false
- result is not failed
- result is not changed
#----------------------------------------------------------
- name: delete a smn topic
hwc_smn_topic:
@@ -77,5 +77,5 @@
- name: assert changed is false
assert:
that:
- result.failed == 0
- result.changed == false
- result is not failed
- result is not changed

View File

@@ -96,8 +96,8 @@
- name: assert changed is false
assert:
that:
- result.failed == 0
- result.changed == false
- result is not failed
- result is not changed
#----------------------------------------------------------
- name: delete a eip (check mode)
hwc_vpc_eip:
@@ -159,8 +159,8 @@
- name: assert changed is false
assert:
that:
- result.failed == 0
- result.changed == false
- result is not failed
- result is not changed
#---------------------------------------------------------
# Post-test teardown
- name: delete a port

View File

@@ -78,8 +78,8 @@
- name: assert changed is false
assert:
that:
- result.failed == 0
- result.changed == false
- result is not failed
- result is not changed
#----------------------------------------------------------
- name: delete a peering connect (check mode)
hwc_vpc_peering_connect:
@@ -133,8 +133,8 @@
- name: assert changed is false
assert:
that:
- result.failed == 0
- result.changed == false
- result is not failed
- result is not changed
#---------------------------------------------------------
# Post-test teardown
- name: delete a vpc

View File

@@ -69,8 +69,8 @@
- name: assert changed is false
assert:
that:
- result.failed == 0
- result.changed == false
- result is not failed
- result is not changed
#----------------------------------------------------------
- name: delete a port (check mode)
hwc_vpc_port:
@@ -116,8 +116,8 @@
- name: assert changed is false
assert:
that:
- result.failed == 0
- result.changed == false
- result is not failed
- result is not changed
#---------------------------------------------------------
# Post-test teardown
- name: delete a subnet

View File

@@ -70,8 +70,8 @@
- name: assert changed is false
assert:
that:
- result.failed == 0
- result.changed == false
- result is not failed
- result is not changed
#----------------------------------------------------------
- name: delete a private ip (check mode)
hwc_vpc_private_ip:
@@ -117,8 +117,8 @@
- name: assert changed is false
assert:
that:
- result.failed == 0
- result.changed == false
- result is not failed
- result is not changed
#---------------------------------------------------------
# Post-test teardown
- name: delete a subnet

View File

@@ -81,8 +81,8 @@
- name: assert changed is false
assert:
that:
- result.failed == 0
- result.changed == false
- result is not failed
- result is not changed
#----------------------------------------------------------
- name: delete a route (check mode)
hwc_vpc_route:
@@ -127,8 +127,8 @@
- name: assert changed is false
assert:
that:
- result.failed == 0
- result.changed == false
- result is not failed
- result is not changed
#---------------------------------------------------------
# Post-test teardown
- name: delete a peering connect

View File

@@ -51,8 +51,8 @@
- name: assert changed is false
assert:
that:
- result.failed == 0
- result.changed == false
- result is not failed
- result is not changed
#----------------------------------------------------------
- name: delete a security group (check mode)
hwc_vpc_security_group:
@@ -83,5 +83,5 @@
- name: assert changed is false
assert:
that:
- result.failed == 0
- result.changed == false
- result is not failed
- result is not changed

View File

@@ -85,8 +85,8 @@
- name: assert changed is false
assert:
that:
- result.failed == 0
- result.changed == false
- result is not failed
- result is not changed
#----------------------------------------------------------
- name: delete a security group rule (check mode)
hwc_vpc_security_group_rule:
@@ -151,8 +151,8 @@
- name: assert changed is false
assert:
that:
- result.failed == 0
- result.changed == false
- result is not failed
- result is not changed
#---------------------------------------------------------
# Post-test teardown
- name: delete a security group

View File

@@ -77,8 +77,8 @@
- name: assert changed is false
assert:
that:
- result.failed == 0
- result.changed == false
- result is not failed
- result is not changed
#----------------------------------------------------------
- name: delete a subnet (check mode)
hwc_vpc_subnet:
@@ -136,8 +136,8 @@
- name: assert changed is false
assert:
that:
- result.failed == 0
- result.changed == false
- result is not failed
- result is not changed
#---------------------------------------------------------
# Post-test teardown
- name: delete a vpc

View File

@@ -13,7 +13,7 @@
- name: Check that admin user adding succeeds with a change
assert:
that:
- add_admin_user.changed == true
- add_admin_user is changed
- name: Test add admin user
block:
@@ -24,7 +24,7 @@
- name: Check that admin user adding succeeds with a change
assert:
that:
- add_admin_user.changed == true
- add_admin_user is changed
- name: Test add admin user idempotence
block:
@@ -35,7 +35,7 @@
- name: Check that admin user adding succeeds without a change
assert:
that:
- add_admin_user.changed == false
- add_admin_user is not changed
- name: Enable authentication and restart service
block:
@@ -58,7 +58,7 @@
- name: Check that adding user with enabled authentication succeeds with a change
assert:
that:
- add_user_with_auth_enabled.changed == true
- add_user_with_auth_enabled is changed
- name: Test add user when authentication enabled
block:
@@ -69,7 +69,7 @@
- name: Check that adding user with enabled authentication succeeds with a change
assert:
that:
- add_user_with_auth_enabled.changed == true
- add_user_with_auth_enabled is changed
- name: Test add user when authentication enabled idempotence
block:
@@ -80,7 +80,7 @@
- name: Check that adding same user succeeds without a change
assert:
that:
- same_user.changed == false
- same_user is not changed
- name: Test change user password in check mode
block:
@@ -92,7 +92,7 @@
- name: Check that password changing succeeds with a change
assert:
that:
- change_password.changed == true
- change_password is changed
- name: Test change user password
block:
@@ -103,7 +103,7 @@
- name: Check that password changing succeeds with a change
assert:
that:
- change_password.changed == true
- change_password is changed
- name: Test remove user in check mode
block:
@@ -115,7 +115,7 @@
- name: Check that removing user succeeds with a change
assert:
that:
- remove_user.changed == true
- remove_user is changed
- name: Test remove user
block:
@@ -126,7 +126,7 @@
- name: Check that removing user succeeds with a change
assert:
that:
- remove_user.changed == true
- remove_user is changed
- name: Test remove user idempotence
block:
@@ -137,4 +137,4 @@
- name: Check that removing user succeeds without a change
assert:
that:
- remove_user.changed == false
- remove_user is not changed

View File

@@ -41,6 +41,6 @@
- name: check if task was successful
assert:
that:
- "{{ external_ip.changed == false }}"
- "{{ external_ip['ansible_facts'] is defined }}"
- "{{ external_ip['ansible_facts']['ipify_public_ip'] is defined }}"
- external_ip is not changed
- external_ip.ansible_facts is defined
- external_ip.ansible_facts.ipify_public_ip is defined

View File

@@ -35,7 +35,7 @@
- debug: var=iso_file
- assert:
that:
- iso_result.changed == True
- iso_result is changed
- iso_file.stat.exists == False
- name: Create iso file with a specified file
@@ -54,7 +54,7 @@
- assert:
that:
- iso_result.changed == True
- iso_result is changed
- iso_file.stat.exists == True
- name: Create iso file with a specified file and folder
@@ -74,10 +74,10 @@
- assert:
that:
- iso_result.changed == True
- iso_result is changed
- iso_file.stat.exists == True
- name: Create iso file with volume identification string
- name: Create iso file with volume identification string
iso_create:
src_files:
- "{{ role_path }}/files/test1.cfg"
@@ -93,7 +93,7 @@
- assert:
that:
- iso_result.changed == True
- iso_result is changed
- iso_file.stat.exists == True
- name: Create iso file with Rock Ridge extention
@@ -112,7 +112,7 @@
- assert:
that:
- iso_result.changed == True
- iso_result is changed
- iso_file.stat.exists == True
- name: Create iso file with Joliet extention
@@ -131,7 +131,7 @@
- assert:
that:
- iso_result.changed == True
- iso_result is changed
- iso_file.stat.exists == True
- name: Create iso file with UDF enabled
@@ -150,5 +150,5 @@
- assert:
that:
- iso_result.changed == True
- iso_result is changed
- iso_file.stat.exists == True

View File

@@ -28,7 +28,7 @@
- assert:
that:
- iso_extract_test0 is changed == true
- iso_extract_test0 is changed
- name: Extract the iso again
iso_extract:
@@ -42,11 +42,11 @@
- name: Test iso_extract_test0_again (normal mode)
assert:
that:
- iso_extract_test0_again is changed == false
- iso_extract_test0_again is not changed
when: not in_check_mode
- name: Test iso_extract_test0_again (check-mode)
assert:
that:
- iso_extract_test0_again is changed == true
- iso_extract_test0_again is changed
when: in_check_mode

View File

@@ -4,52 +4,11 @@
args:
creates: "{{ test_key_path }}"
- name: Create the test keystore
java_keystore:
name: placeholder
dest: "{{ test_keystore2_path }}"
password: "{{ test_keystore2_password }}"
private_key: "{{ lookup('file', '{{ test_key_path }}') }}"
certificate: "{{ lookup('file', '{{ test_cert_path }}') }}"
- name: Generate the self signed cert we will use for testing
command: openssl req -x509 -newkey rsa:4096 -keyout '{{ test_key2_path }}' -out '{{ test_cert2_path }}' -days 365 -nodes -subj '/CN=localhost'
args:
creates: "{{ test_key2_path }}"
- name: |
Import the newly created certificate. This is our main test.
If the java_cert has been updated properly, then this task will report changed each time
since the module will be comparing the hash of the certificate instead of validating that the alias
simply exists
java_cert:
cert_alias: test_cert
cert_path: "{{ test_cert2_path }}"
keystore_path: "{{ test_keystore2_path }}"
keystore_pass: "{{ test_keystore2_password }}"
state: present
register: result_x509_changed
- name: Verify the x509 status has changed
assert:
that:
- result_x509_changed is changed
- name: |
We also want to make sure that the status doesnt change if we import the same cert
java_cert:
cert_alias: test_cert
cert_path: "{{ test_cert2_path }}"
keystore_path: "{{ test_keystore2_path }}"
keystore_pass: "{{ test_keystore2_password }}"
state: present
register: result_x509_succeeded
- name: Verify the x509 status is ok
assert:
that:
- result_x509_succeeded is succeeded
- name: Create the pkcs12 archive from the test x509 cert
command: >
openssl pkcs12
@@ -70,6 +29,97 @@
-out {{ test_pkcs2_path }}
-passout pass:"{{ test_keystore2_password }}"
- name: try to create the test keystore based on the just created pkcs12, keystore_create flag not enabled
java_cert:
cert_alias: test_pkcs12_cert
pkcs12_alias: test_pkcs12_cert
pkcs12_path: "{{ test_pkcs_path }}"
pkcs12_password: "{{ test_keystore2_password }}"
keystore_path: "{{ test_keystore2_path }}"
keystore_pass: "{{ test_keystore2_password }}"
ignore_errors: true
register: result_x509_changed
- name: Verify the x509 status is failed
assert:
that:
- result_x509_changed is failed
- name: Create the test keystore based on the just created pkcs12
java_cert:
cert_alias: test_pkcs12_cert
pkcs12_alias: test_pkcs12_cert
pkcs12_path: "{{ test_pkcs_path }}"
pkcs12_password: "{{ test_keystore2_password }}"
keystore_path: "{{ test_keystore2_path }}"
keystore_pass: "{{ test_keystore2_password }}"
keystore_create: yes
- name: try to import from pkcs12 a non existing alias
java_cert:
cert_alias: test_pkcs12_cert
pkcs12_alias: non_existing_alias
pkcs12_path: "{{ test_pkcs_path }}"
pkcs12_password: "{{ test_keystore2_password }}"
keystore_path: "{{ test_keystore2_path }}"
keystore_pass: "{{ test_keystore2_password }}"
keystore_create: yes
ignore_errors: yes
register: result_x509_changed
- name: Verify the x509 status is failed
assert:
that:
- result_x509_changed is failed
- name: import initial test certificate from file path
java_cert:
cert_alias: test_cert
cert_path: "{{ test_cert_path }}"
keystore_path: "{{ test_keystore2_path }}"
keystore_pass: "{{ test_keystore2_password }}"
keystore_create: yes
state: present
register: result_x509_changed
- name: Verify the x509 status is changed
assert:
that:
- result_x509_changed is changed
- name: |
Import the newly created certificate. This is our main test.
If the java_cert has been updated properly, then this task will report changed each time
since the module will be comparing the hash of the certificate instead of validating that the alias
simply exists
java_cert:
cert_alias: test_cert
cert_path: "{{ test_cert2_path }}"
keystore_path: "{{ test_keystore2_path }}"
keystore_pass: "{{ test_keystore2_password }}"
state: present
register: result_x509_changed
- name: Verify the x509 status is changed
assert:
that:
- result_x509_changed is changed
- name: |
We also want to make sure that the status doesnt change if we import the same cert
java_cert:
cert_alias: test_cert
cert_path: "{{ test_cert2_path }}"
keystore_path: "{{ test_keystore2_path }}"
keystore_pass: "{{ test_keystore2_password }}"
state: present
register: result_x509_succeeded
- name: Verify the x509 status is ok
assert:
that:
- result_x509_succeeded is succeeded
- name: >
Ensure the original pkcs12 cert is in the keystore
java_cert:
@@ -83,7 +133,7 @@
- name: |
Perform the same test, but we will now be testing the pkcs12 functionality
If we add a different pkcs12 cert with the same alias, we should have a chnaged result, NOT the same
If we add a different pkcs12 cert with the same alias, we should have a changed result, NOT the same
java_cert:
cert_alias: test_pkcs12_cert
pkcs12_alias: test_pkcs12_cert
@@ -94,7 +144,7 @@
state: present
register: result_pkcs12_changed
- name: Verify the pkcs12 status has changed
- name: Verify the pkcs12 status is changed
assert:
that:
- result_pkcs12_changed is changed
@@ -155,7 +205,7 @@
that:
- result_x509_absent is changed
- name: Ensure we can remove the pkcs12 archive
- name: Ensure we can remove the certificate imported from pkcs12 archive
java_cert:
cert_alias: test_pkcs12_cert
keystore_path: "{{ test_keystore2_path }}"

View File

@@ -177,7 +177,7 @@
- name: "assert test_{{test_number}} worked"
assert:
that:
- result.changed == false
- result is not changed
# HOST DISABLEMENT

View File

@@ -1,24 +0,0 @@
####################################################################
# WARNING: These are designed specifically for Ansible tests #
# and should not be used as examples of how to write Ansible roles #
####################################################################
- block:
- name: Install Nuage VSD API Simulator
pip:
name: nuage-vsd-sim
- name: Start Nuage VSD API Simulator
shell: "(cd /; nuage-vsd-sim >/dev/null 2>&1)"
async: 1800
poll: 0
- name: Wait for API to be ready
uri:
url: http://localhost:5000
register: api
delay: 3
retries: 10
until: api.status == 200
when: "ansible_python_version is version('2.7', '>=')"

View File

@@ -0,0 +1,51 @@
#!/usr/bin/env bash
set -eux
flatpak install -y --system flathub org.freedesktop.Platform//1.6 org.freedesktop.Sdk//1.6
echo $'#!/bin/sh\necho hello world' > hello.sh
export NUM=1
flatpak build-init appdir$NUM com.dummy.App$NUM org.freedesktop.Sdk org.freedesktop.Platform 1.6;
flatpak build appdir$NUM mkdir /app/bin;
flatpak build appdir$NUM install --mode=750 hello.sh /app/bin;
flatpak build-finish --command=hello.sh appdir$NUM
flatpak build-export repo appdir$NUM stable
mkdir -p gpg
chmod 0700 gpg
gpg --homedir gpg --batch --passphrase '' --quick-gen-key test@dummy.com future-default default 10y
KEY_ID=$(gpg --homedir=gpg --list-keys --with-colons test@dummy.com | grep fpr: | head -1 | cut -d ':' -f 10)
gpg --homedir=gpg --export "${KEY_ID}" > dummy-repo.gpg
BASE64_PUBLIC_KEY=$(base64 dummy-repo.gpg | tr -d '\n')
cat > repo/com.dummy.App1.flatpakref <<EOF
[Flatpak Ref]
Title=Dummy App$NUM
Name=com.dummy.App$NUM
Branch=stable
Url=file:///tmp/flatpak/repo
GPGKey=${BASE64_PUBLIC_KEY}
IsRuntime=false
RuntimeRepo=https://flathub.org/repo/flathub.flatpakrepo
EOF
cat > repo/dummy-repo.flatpakrepo <<EOF
[Flatpak Repo]
Title=Dummy Repo
Url=file:///tmp/flatpak/repo
Comment=Dummy repo for ansible module integration testing
Description=Dummy repo for ansible module integration testing
GPGKey=${BASE64_PUBLIC_KEY}
EOF
flatpak build-sign repo --gpg-sign="${KEY_ID}" --gpg-homedir=gpg
flatpak build-update-repo repo --gpg-sign="${KEY_ID}" --gpg-homedir=gpg
tar cvfJ repo.tar.xz repo/
mv repo.tar.xz files/
rm -rf appdir* dummy-repo.gpg gpg hello.sh repo

View File

@@ -183,3 +183,39 @@
that:
- not mut_ex.changed
- "'parameters are mutually exclusive' in mut_ex.msg"
- name: Add a full name host
community.general.ssh_config:
ssh_config_file: "{{ ssh_config_test }}"
host: "full_name"
hostname: full_name.com
identity_file: '{{ ssh_private_key }}'
port: '2223'
state: present
register: full_name
- name: Check if changes are made
assert:
that:
- full_name is changed
- full_name.hosts_added == ["full_name"]
- full_name.hosts_changed == []
- full_name.hosts_removed == []
- name: Add a host with name which is contained in full name host
community.general.ssh_config:
ssh_config_file: "{{ ssh_config_test }}"
host: "full"
hostname: full.com
identity_file: '{{ ssh_private_key }}'
port: '2223'
state: present
register: short_name
- name: Check that short name host is added and full name host is not updated
assert:
that:
- short_name is changed
- short_name.hosts_added == ["full"]
- short_name.hosts_changed == []
- short_name.hosts_removed == []

View File

@@ -40,7 +40,7 @@
- assert:
that:
- "'changed' in sync_result"
- "sync_result.changed == true"
- sync_result is changed
- "'cmd' in sync_result"
- "'rsync' in sync_result.cmd"
- "'msg' in sync_result"
@@ -63,7 +63,7 @@
- assert:
that:
- "sync_result.changed == False"
- sync_result is not changed
- name: cleanup old files
file:

View File

@@ -24,6 +24,6 @@
- name: Test expected result
assert:
that:
- add_children_elements_unicode.changed == true
- comparison.changed == false # identical
- add_children_elements_unicode is changed
- comparison is not changed # identical
#command: diff -u {{ role_path }}/results/test-add-children-elements-unicode.xml /tmp/ansible-xml-beers.xml

View File

@@ -24,6 +24,6 @@
- name: Test expected result
assert:
that:
- add_children_elements.changed == true
- comparison.changed == false # identical
- add_children_elements is changed
- comparison is not changed # identical
#command: diff -u {{ role_path }}/results/test-add-children-elements.xml /tmp/ansible-xml-beers.xml

View File

@@ -23,6 +23,6 @@
- name: Test expected result
assert:
that:
- add_children_from_groupvars.changed == true
- comparison.changed == false # identical
- add_children_from_groupvars is changed
- comparison is not changed # identical
#command: diff -u {{ role_path }}/results/test-add-children-from-groupvars.xml /tmp/ansible-xml-beers.xml

View File

@@ -28,5 +28,5 @@
- name: Test expected result
assert:
that:
- add_children_insertafter.changed == true
- comparison.changed == false # identical
- add_children_insertafter is changed
- comparison is not changed # identical

View File

@@ -28,5 +28,5 @@
- name: Test expected result
assert:
that:
- add_children_insertbefore.changed == true
- comparison.changed == false # identical
- add_children_insertbefore is changed
- comparison is not changed # identical

View File

@@ -26,6 +26,6 @@
- name: Test expected result
assert:
that:
- add_children_with_attributes_unicode.changed == true
- comparison.changed == false # identical
- add_children_with_attributes_unicode is changed
- comparison is not changed # identical
#command: diff -u {{ role_path }}/results/test-add-children-with-attributes-unicode.xml /tmp/ansible-xml-beers.xml

View File

@@ -29,7 +29,7 @@
- name: Test expected result
assert:
that:
- add_children_with_attributes.changed == true
- comparison.changed == false # identical
- add_children_with_attributes is changed
- comparison is not changed # identical
when: lxml_predictable_attribute_order
#command: diff -u {{ role_path }}/results/test-add-children-with-attributes.xml /tmp/ansible-xml-beers.xml

View File

@@ -108,7 +108,7 @@
- name: Test expected result
assert:
that:
- comparison.changed == false # identical
- comparison is not changed # identical
#command: diff -u {{ role_path }}/results/test-add-element-implicitly.yml /tmp/ansible-xml-beers-implicit.xml

View File

@@ -21,12 +21,12 @@
src: results/test-add-namespaced-children-elements.xml
dest: /tmp/ansible-xml-namespaced-beers.xml
check_mode: yes
diff: yes
diff: yes
register: comparison
- name: Test expected result
assert:
that:
- add_namespaced_children_elements.changed == true
- comparison.changed == false # identical
- add_namespaced_children_elements is changed
- comparison is not changed # identical
#command: diff -u {{ role_path }}/results/test-add-namespaced-children-elements.xml /tmp/ansible-xml-namespaced-beers.xml

View File

@@ -25,6 +25,6 @@
- name: Test expected result
assert:
that:
- children_elements.changed == true
- comparison.changed == false # identical
- children_elements is changed
- comparison is not changed # identical
#command: diff -u {{ role_path }}/results/test-add-children-elements.xml /tmp/ansible-xml-beers.xml

View File

@@ -15,5 +15,5 @@
- name: Test expected result
assert:
that:
- beers.changed == false
- beers is not changed
- beers.count == 2

View File

@@ -15,5 +15,5 @@
- name: Test expected result
assert:
that:
- beers.changed == false
- beers is not changed
- beers.count == 3

View File

@@ -15,7 +15,7 @@
- name: Test expected result
assert:
that:
- get_element_attribute.changed == false
- get_element_attribute is not changed
- get_element_attribute.matches[0]['rating'] is defined and get_element_attribute.matches[0]['rating']['subjective'] == 'да'
- name: Get element text
@@ -28,5 +28,5 @@
- name: Test expected result
assert:
that:
- get_element_text.changed == false
- get_element_text is not changed
- get_element_text.matches[0]['rating'] == 'десять'

View File

@@ -15,7 +15,7 @@
- name: Test expected result
assert:
that:
- get_element_attribute.changed == false
- get_element_attribute is not changed
- get_element_attribute.matches[0]['rating'] is defined
- get_element_attribute.matches[0]['rating']['subjective'] == 'true'
@@ -43,5 +43,5 @@
- name: Test expected result
assert:
that:
- get_element_text.changed == false
- get_element_text is not changed
- get_element_text.matches[0]['rating'] == '10'

View File

@@ -18,5 +18,5 @@
- name: Test expected result
assert:
that:
- module_output.changed == false
- module_output.failed == true
- module_output is not changed
- module_output is failed

View File

@@ -24,6 +24,6 @@
- name: Test expected result
assert:
that:
- pretty_print_only.changed == true
- comparison.changed == false # identical
- pretty_print_only is changed
- comparison is not changed # identical
#command: diff -u {{ role_path }}/results/test-pretty-print-only.xml /tmp/ansible-xml-beers.xml

View File

@@ -25,6 +25,6 @@
- name: Test expected result
assert:
that:
- pretty_print.changed == true
- comparison.changed == false # identical
- pretty_print is changed
- comparison is not changed # identical
#command: diff -u {{ role_path }}/results/test-pretty-print.xml /tmp/ansible-xml-beers.xml

View File

@@ -23,6 +23,6 @@
- name: Test expected result
assert:
that:
- remove_attribute.changed == false
- comparison.changed == false # identical
- remove_attribute is not changed
- comparison is not changed # identical
#command: diff -u {{ role_path }}/results/test-remove-attribute.xml /tmp/ansible-xml-beers.xml

View File

@@ -23,6 +23,6 @@
- name: Test expected result
assert:
that:
- remove_attribute.changed == true
- comparison.changed == false # identical
- remove_attribute is changed
- comparison is not changed # identical
#command: diff -u {{ role_path }}/results/test-remove-attribute.xml /tmp/ansible-xml-beers.xml

View File

@@ -23,6 +23,6 @@
- name: Test expected result
assert:
that:
- remove_element.changed == false
- comparison.changed == false # identical
- remove_element is not changed
- comparison is not changed # identical
#command: diff -u {{ role_path }}/results/test-remove-element.xml /tmp/ansible-xml-beers.xml

View File

@@ -23,6 +23,6 @@
- name: Test expected result
assert:
that:
- remove_element.changed == true
- comparison.changed == false # identical
- remove_element is changed
- comparison is not changed # identical
#command: diff -u {{ role_path }}/results/test-remove-element.xml /tmp/ansible-xml-beers.xml

View File

@@ -28,6 +28,6 @@
- name: Test expected result
assert:
that:
- remove_namespaced_attribute.changed == false
- comparison.changed == false # identical
- remove_namespaced_attribute is not changed
- comparison is not changed # identical
#command: diff -u {{ role_path }}/results/test-remove-namespaced-attribute.xml /tmp/ansible-xml-namespaced-beers.xml

View File

@@ -28,6 +28,6 @@
- name: Test expected result
assert:
that:
- remove_namespaced_attribute.changed == true
- comparison.changed == false # identical
- remove_namespaced_attribute is changed
- comparison is not changed # identical
#command: diff -u {{ role_path }}/results/test-remove-namespaced-attribute.xml /tmp/ansible-xml-namespaced-beers.xml

View File

@@ -28,6 +28,6 @@
- name: Test expected result
assert:
that:
- remove_namespaced_element.changed == false
- comparison.changed == false # identical
- remove_namespaced_element is not changed
- comparison is not changed # identical
#command: diff -u {{ role_path }}/results/test-remove-element.xml /tmp/ansible-xml-namespaced-beers.xml

View File

@@ -28,6 +28,6 @@
- name: Test expected result
assert:
that:
- remove_namespaced_element.changed == true
- comparison.changed == false # identical
- remove_namespaced_element is changed
- comparison is not changed # identical
#command: diff -u {{ role_path }}/results/test-remove-element.xml /tmp/ansible-xml-namespaced-beers.xml

View File

@@ -24,6 +24,6 @@
- name: Test expected result
assert:
that:
- set_attribute_value_unicode.changed == true
- comparison.changed == false # identical
- set_attribute_value_unicode is changed
- comparison is not changed # identical
#command: diff -u {{ role_path }}/results/test-set-attribute-value-unicode.xml /tmp/ansible-xml-beers.xml

View File

@@ -24,6 +24,6 @@
- name: Test expected result
assert:
that:
- set_attribute_value.changed == true
- comparison.changed == false # identical
- set_attribute_value is changed
- comparison is not changed # identical
#command: diff -u {{ role_path }}/results/test-set-attribute-value.xml /tmp/ansible-xml-beers.xml

View File

@@ -47,8 +47,8 @@
- name: Test expected result
assert:
that:
- set_children_elements_level.changed == true
- comparison.changed == false # identical
- set_children_elements_level is changed
- comparison is not changed # identical
#command: diff -u {{ role_path }}/results/test-set-children-elements-level.xml /tmp/ansible-xml-beers.xml
@@ -70,5 +70,5 @@
- name: Test expected result
assert:
that:
- set_children_again.changed == false
- comparison.changed == false # identical
- set_children_again is not changed
- comparison is not changed # identical

View File

@@ -25,8 +25,8 @@
- name: Test expected result
assert:
that:
- set_children_elements_unicode.changed == true
- comparison.changed == false # identical
- set_children_elements_unicode is changed
- comparison is not changed # identical
#command: diff -u {{ role_path }}/results/test-set-children-elements-unicode.xml /tmp/ansible-xml-beers.xml
@@ -41,6 +41,6 @@
- name: Test expected result
assert:
that:
- set_children_again.changed == false
- comparison.changed == false # identical
- set_children_again is not changed
- comparison is not changed # identical
#command: diff -u {{ role_path }}/results/test-set-children-elements-unicode.xml /tmp/ansible-xml-beers.xml

View File

@@ -25,8 +25,8 @@
- name: Test expected result
assert:
that:
- set_children_elements.changed == true
- comparison.changed == false # identical
- set_children_elements is changed
- comparison is not changed # identical
#command: diff -u {{ role_path }}/results/test-set-children-elements.xml /tmp/ansible-xml-beers.xml
@@ -48,6 +48,6 @@
- name: Test expected result
assert:
that:
- set_children_again.changed == false
- comparison.changed == false # identical
- set_children_again is not changed
- comparison is not changed # identical
#command: diff -u {{ role_path }}/results/test-set-children-elements.xml /tmp/ansible-xml-beers.xml

View File

@@ -23,6 +23,6 @@
- name: Test expected result
assert:
that:
- set_element_value_empty.changed == true
- comparison.changed == false # identical
- set_element_value_empty is changed
- comparison is not changed # identical
#command: diff -u {{ role_path }}/results/test-set-element-value-empty.xml /tmp/ansible-xml-beers.xml

Some files were not shown because too many files have changed in this diff Show More