Compare commits

..

73 Commits

Author SHA1 Message Date
Felix Fontein
abc786bddd Release 1.3.11. 2021-06-28 21:02:01 +02:00
Felix Fontein
85a1eea4e6 Prepare 1.3.11 release. 2021-06-28 07:02:51 +02:00
Felix Fontein
ca385c8a45 [stable-1] fix CI (#2892)
* Make sure ruamel.yaml.clib 0.2.2 is used for Python 2.7.

* Also add to unit tests requirements.

* Don't install on Python 2.6.

* Another constraints file.
2021-06-27 15:44:37 +02:00
patchback[bot]
bb689550b3 Adjust example to remove unnecessary offensive language. (#2869) (#2870)
(cherry picked from commit d2a984ded1)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-06-25 06:49:08 +02:00
patchback[bot]
41aacb1472 Dynamically add meta/runtime.yml redirects before integration tests. (#2633) (#2853)
ci_coverage

(cherry picked from commit 07085785a3)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-06-22 09:13:49 +02:00
patchback[bot]
3f92a6b738 BOTMETA.yml: grant supershipit (#2807) (#2809)
(cherry picked from commit b1b34ee12e)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2021-06-15 19:11:18 +02:00
patchback[bot]
ebdd8c88ec BOTMETA.yml: supershipit to quidame (#2801) (#2804)
(cherry picked from commit bccf317814)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2021-06-14 20:59:08 +02:00
patchback[bot]
b24d27d4bd Make extra sanity test runner produce ansibullbot and JUnit output. (#2794) (#2798)
(cherry picked from commit a55c96d5c1)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-06-14 07:58:00 +02:00
Felix Fontein
7b3319dd81 CI: Remove scripts that are no longer needed (#2793) (#2797)
* Remove scripts that are no longer needed.

ci_complete

* Remove sanity ignores.

(cherry picked from commit d4c4d00ad1)
2021-06-14 06:42:24 +02:00
patchback[bot]
94b2e9d9ca with great powers come great responsibility (#2755) (#2757)
(cherry picked from commit eef645c3f7)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-06-08 11:04:26 +02:00
patchback[bot]
82060a7b21 Re-enable flatpak_remote tests (#2747) (#2750)
* 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:46 +02:00
patchback[bot]
580cced80a Remove aminvakil from supershipit section as it is not needed anymore (#2743) (#2744)
(cherry picked from commit 7c3f2ae4af)

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

Co-authored-by: Amin Vakil <info@aminvakil.com>
2021-06-07 16:01:22 +02:00
patchback[bot]
4e3d85798c Stop mentioning Freenode. We're on Libera.chat. (#2666) (#2667)
(cherry picked from commit 14813a6287)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-05-28 07:24:55 +02:00
patchback[bot]
28458b2477 Add CONTRIBUTING.md (#2602) (#2624)
* 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:00:14 +02:00
patchback[bot]
e21ddcb5b6 Massive adjustment in integration tests for changed and failed (#2577) (#2586)
* 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:06 +02:00
patchback[bot]
4006db89bf Add missing author name (#2570) (#2574)
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:17 +02:00
patchback[bot]
62557a0e10 removed supporting code for testing module "nuage" - no longer exists here (#2559) (#2561)
(cherry picked from commit 452a185a23)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-05-19 22:44:32 +02:00
Felix Fontein
c305178950 Fix CI. 2021-05-19 12:23:01 +02:00
patchback[bot]
8ba08ae383 Clarify Windows (non-)support. (#2476) (#2480)
(cherry picked from commit 2e58dfe52a)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-05-10 17:14:29 +02:00
Felix Fontein
ffafcb34b2 Remove shippable config. (#2440) (#2445)
(cherry picked from commit 1f41e66f09)
2021-05-03 23:07:56 +02:00
Felix Fontein
2ed03d7fb6 Copy schedule to stable branches. 2021-05-02 13:35:10 +02:00
patchback[bot]
a007eebba8 Remove programming error which prevents modules to work with devel. (#2381) (#2382)
(cherry picked from commit d9524bae93)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-30 06:03:21 +02:00
patchback[bot]
a0a5a10c67 Use Ansible's codecov uploader. (#2377) (#2378)
(cherry picked from commit b3f436aa63)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-30 05:32:16 +02:00
Felix Fontein
f01ac6f31f Next expected release is 1.3.11. 2021-04-26 14:31:12 +02:00
Felix Fontein
055b7fe4c1 Release 1.3.10. 2021-04-26 13:07:02 +02:00
Felix Fontein
906fd97c24 Update release summary to emphasize this is the last regular bugfix release. 2021-04-26 07:27:27 +02:00
patchback[bot]
e91c22bbe6 Fix Python 2 compatibility issue. (#2340) (#2351)
(cherry picked from commit 5195536bd8)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-26 07:16:53 +02:00
patchback[bot]
ab6b2346a6 Removes colin-nolan as Consul maintainer (#2342) (#2346)
(cherry picked from commit 399c0ef849)

Co-authored-by: Colin Nolan <colin-nolan@users.noreply.github.com>
2021-04-26 06:50:37 +02:00
patchback[bot]
01b47a8a1f convert string returned by plugin to unicode (#2329) (#2338)
* convert string returned by plugin to unicode

* add changelog fragment

* fix changelog format

* fix changelog format yet again

Co-authored-by: Anubhav Chakraborty <anubchak@cisco.com>
(cherry picked from commit f11f6595cc)

Co-authored-by: Anubhav Chakraborty <47817745+coderfool@users.noreply.github.com>
2021-04-24 12:51:52 +02:00
Felix Fontein
2b2386b6af BOTMETA.yml: haproxy - add a maintainer (#2331) (#2333)
(cherry picked from commit 2799cd4ac7)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2021-04-22 22:07:28 +02:00
patchback[bot]
c7736ab921 nmap: fix cache support (#2282) (#2328)
* add cache support

* pep8 e501 fix

* revert verify_file function

* revert description update

* add changelog fragment

Co-authored-by: Dennis Israelsson <github@mdh.nu>
(cherry picked from commit 31c9ed0fe6)

Co-authored-by: Dennis Israelsson <dennis.israelsson@gmail.com>
2021-04-22 07:47:45 +02:00
patchback[bot]
457c92c8e2 with_filetree:: use splitext for compatibility with template: (#2285) (#2321)
* with_filetree: use splitext for compatibility with template

The example code given deploys files with their .j2 extensions intact, which is probably not what you want.

* Explain how templates interact with splitext|first

* Update plugins/lookup/filetree.py

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

* Don't encourage setting the mode of symlinks

On ext4, maybe most filesystems, symlinks always have the artificial mode of 0777, and `chmod $mode $symlink` *writes through* the symlink to its target file.

An effect of this is that if you deploy a file and a symlink to it (e.g. this common situation: /etc/nginx/sites-available/default and /etc/nginx/sites-enabled/default -> ../sites-available/default) then `with_filetree` will forever first deploy the file with the right mode, then corrupt its mode to 0777, and every redeploy will see a change to fix, forever in a loop.

Probably `file:` should refuse `mode:` on `state: link`s, but in the meantime, avoid recommending it in `filetree`

* Use `follow: false` instead of just the mode.

This should be more cross-compatible.

https://github.com/ansible-collections/community.general/pull/2285#discussion_r616571873

* Update plugins/lookup/filetree.py

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

Co-authored-by: Nick <nick@kousu.ca>
2021-04-21 13:03:05 +00:00
Felix Fontein
79f68629ff More renames. (#2307) (#2317)
(cherry picked from commit c768060d95)
2021-04-21 13:30:39 +02:00
patchback[bot]
4167832db3 BOTMETA.yml: lxd/lxd_profile - add a new maintainer (#2310) (#2314)
(cherry picked from commit fe2757f057)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2021-04-21 13:06:44 +02:00
patchback[bot]
a57689f118 BOTMETA.yml: github/github_repo - add a new maintainer (#2309) (#2312)
(cherry picked from commit 8ab19fc50b)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2021-04-21 12:21:41 +02:00
Felix Fontein
6d804ed77a [stable-1] Backport of #2286 and #2304 (#2306)
* BOTMETA.yml: update team_virt (#2286)

(cherry picked from commit fc12eca65d)

* Update BOTMETA.yml (#2304)

(cherry picked from commit f7928d3eb7)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2021-04-20 23:03:18 +02:00
patchback[bot]
90e22b93fd BOTMETA.yml: update team_ipa (#2289) (#2301)
(cherry picked from commit 0231dad3e8)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2021-04-20 22:30:25 +02:00
patchback[bot]
b372b3241a BOTMETA.yml: java_cert - add a new maintainer (#2288) (#2294)
(cherry picked from commit 49c07dc18b)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2021-04-20 13:28:57 +02:00
patchback[bot]
5a5ed8c3f0 BOTMETA.yml: expand team_opennebula (#2292) (#2298)
(cherry picked from commit 5b4fab80e2)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2021-04-20 13:28:36 +02:00
patchback[bot]
f72029a518 BOTMETA.yml: inventory/proxmox - add a new maintainer (#2291) (#2296)
(cherry picked from commit 84a79c3da4)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2021-04-20 13:28:29 +02:00
Felix Fontein
71e894ab68 BOTMETA.yml: update team_gitlab (#2287) (#2300)
(cherry picked from commit 7aaa26b591)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2021-04-20 13:24:23 +02:00
patchback[bot]
c82bc7f041 Fix for Terraform 0.15 (#2246) (#2260)
* Fix for Terraform 0.15

removed the append of variables in terraform validate because this is deprecated in Terraform 0.15. See: https://github.com/hashicorp/terraform/blob/v0.15/CHANGELOG.md >> The -var and -var-file options are no longer available on terraform validate. These were deprecated and have had no effect since Terraform v0.12

* Create terraform-validate.yaml

* Update and rename terraform-validate.yaml to 2246-terraform-validate.yaml

* Update changelogs/fragments/2246-terraform-validate.yaml

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

* Update terraform.py

remove `-force` add `-auto-approve` on destroy as described in issue #2247

* Update and rename 2246-terraform-validate.yaml to 2246-terraform.yaml

* Update 2246-terraform.yaml

* add a function which check the used tf version

* add a function which check the used tf version

* Update changelogs/fragments/2246-terraform.yaml

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

* Update changelogs/fragments/2246-terraform.yaml

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

* add version return to function

* changed it to pass sanity check

* change variable name

* changed to a more specialized data types

* remove use_unsafe_shell=True

* Update changelogs/fragments/2246-terraform.yaml

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

* add description

* Update changelogs/fragments/2246-terraform.yaml

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

Co-authored-by: Amin Vakil <info@aminvakil.com>
Co-authored-by: Rainer Leber <rainer.leber@sva.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 1400051890)

Co-authored-by: rainerleber <39616583+rainerleber@users.noreply.github.com>
2021-04-17 22:53:50 +02:00
patchback[bot]
c28cade77e Fix problems with pip2.6 included in CentOS 6. (#2256) (#2258)
(cherry picked from commit d09bc2525b)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-17 20:16:51 +02:00
patchback[bot]
7ee401ab14 funcd connection plugin is now usable/loadable (#2235) (#2240)
* funcd connection plugin is now usable/loadable

* Update changelogs/fragments/allow_funcd_to_load.yml

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

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
2021-04-14 10:00:36 +02:00
patchback[bot]
5652423dce Use nomad_job_info in nomad_job_info examples (#2233) (#2238)
(cherry picked from commit f97d5ca701)

Co-authored-by: Amin Vakil <info@aminvakil.com>
2021-04-14 10:00:23 +02:00
patchback[bot]
0fbb0039b1 java_keystore: improve error handling and returned results (#2183) (#2226)
* java_keystore - improve error handling and returned results

* set check_rc=False to return results as documented when module fails
* set LANG, LC_ALL and LC_MESSAGES to C to rely keytool output parsing
* fix pylint's `no-else-return` and `unused-variable` hints
* update related unit tests accordingly
* add a changelog fragment

update unit test (remove stdout_lines from returned dict)

fix unit test: failure is now expected when alias does not exist

* Update changelogs/fragments/2183-java_keystore_improve_error_handling.yml

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

* fix integration test: overwrite keystore at the same location

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

Co-authored-by: quidame <quidame@poivron.org>
2021-04-12 22:13:34 +02:00
patchback[bot]
c38420d741 Grant supershipit to new maintainers (#2214) (#2221)
* Grant supershipit to a new maintainer

* Add maintainer

(cherry picked from commit 7356451aa1)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2021-04-12 11:24:10 +02:00
Felix Fontein
eb5695845e Prepare 1.3.10 release. 2021-04-11 17:31:34 +02:00
Alexei Znamensky
7481436027 [PR #2203/0cd0f0ea backport][stable-1] module_helper - fixed decorator cause_changes (#2209)
* module_helper - fixed decorator cause_changes (#2203)

* fixed decorator cause_changes

* added changelog fragment

* typo

(cherry picked from commit 0cd0f0eaf6)

* adjusted imports for stable-1
2021-04-08 19:49:50 +02:00
patchback[bot]
4b54805693 ipa_user sshpubkey can now support multi word comments in the key (#2159) (#2200)
* ipa_user sshpubkey can now support multi word comments in the key

* Add documentation fragment for pull request

* Update changelogs/fragments/2159-ipa-user-sshpubkey-multi-word-comments.yaml

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

* Cleaner implementation of multi word comments

Co-authored-by: Chris Costa <chris.costa@compellingtech.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 7f91821bcc)

Co-authored-by: justchris1 <30219018+justchris1@users.noreply.github.com>
2021-04-07 20:42:03 +02:00
patchback[bot]
5b33b0f61f Fix HAProxy draining (#1993) (#2197)
* Fix HAProxy draining by manually entering the 'MAINT' state

Inspired by rldleblanc: https://github.com/ansible/ansible/issues/37591#issuecomment-610130611

Signed-off-by: Norman Ziegner <norman.ziegner@ufz.de>

* Add changelog fragment

Signed-off-by: Norman Ziegner <norman.ziegner@ufz.de>

* Fix drain function docstring

Signed-off-by: Norman Ziegner <norman.ziegner@ufz.de>

* Fix typos

Signed-off-by: Norman Ziegner <norman.ziegner@ufz.de>

* Update changelog fragment

Signed-off-by: Norman Ziegner <norman.ziegner@ufz.de>
(cherry picked from commit 7145204594)

Co-authored-by: Norman Ziegner <normo157@gmail.com>
2021-04-07 20:06:22 +02:00
Felix Fontein
83370ee97d Restrict docker to < 5.0.0 for Python < 3.6. (#2196) 2021-04-07 14:24:56 +02:00
Alexei Znamensky
f534ecbd2c [stable-1] xfconf - state absent was not honoring check_mode (#2185) (#2187)
* xfconf - state absent was not honoring check_mode (#2185)

* state absent was not honoring check_mode

* added changelog fragment

* adjusted run_command() call for stable-1
2021-04-07 10:20:30 +02:00
Felix Fontein
e32de4841a Replace devel tests with stable-2.11. (#2131) 2021-04-06 07:40:29 +02:00
patchback[bot]
611f3ed3a9 replace inline clear password by environment variable (#2177) (#2181)
* replace inline clear password by environment variable on a per-command basis.

* add changelog fragment
* update related unit tests

* Update changelogs/fragments/2177-java_keystore_1668_dont_expose_secrets_on_cmdline.yml

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

* fix unit test: force result without lambda

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

Co-authored-by: quidame <quidame@poivron.org>
2021-04-05 18:45:08 +02:00
patchback[bot]
cf144df715 java_keystore/fix 1667 improve temp files storage (#2163) (#2175)
* improve temporary files storage (naming/removal)

* update unit tests

* Update changelogs/fragments/2163-java_keystore_1667_improve_temp_files_storage.yml

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

* add dedicated function to randomize PKCS#12 filename

fix unit tests (also mock the new function)

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

Co-authored-by: quidame <quidame@poivron.org>
2021-04-05 15:19:21 +02:00
patchback[bot]
f717c1f4fd removed unreachable code (#2157) (#2169)
* removed unreachable code

* added changelog fragment

(cherry picked from commit b81a7cdd16)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-04-05 09:50:38 +02:00
patchback[bot]
f51cdb367f rewritten as list literals (#2160) (#2167)
* rewritten as list literals

* added changelog fragment

(cherry picked from commit b97e31dd55)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-04-05 09:50:08 +02:00
patchback[bot]
12d3c4e174 fixed calls to list.extend() (#2161) (#2165)
* fixed calls to list.extend()

* added changelog fragment

* Update changelogs/fragments/2161-pkgutil-list-extend.yml

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

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

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-04-05 00:00:07 +02:00
Felix Fontein
0d1f2fd513 kibana_plugin: fixed remove call + run_command with list instead of str (#2143) (#2154)
* fixed remove call + run_command with list instead of str

* fixed the other calls to run_command()

* added changelog fragment

* adjustment on run_command params

* Update changelogs/fragments/2143-kibana_plugin-fixed-function-calls.yml

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

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

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-04-03 22:56:17 +02:00
patchback[bot]
3b6ceeba0d [WIP] Committer guidelines (#2077) (#2152)
* First idea for committer guidelines.

* Update commit-rights.md

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>

* Update commit-rights.md

Co-authored-by: John R Barker <john@johnrbarker.com>

* Apply suggestions from code review

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>

* Improve 'do not' list.

* Add improvements from ansible/ansible#73782.

* Apply suggestions from code review

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

* Apply suggestions from code review

* Update commit-rights.md

* Update commit-rights.md

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
Co-authored-by: John R Barker <john@johnrbarker.com>
Co-authored-by: Amin Vakil <info@aminvakil.com>
(cherry picked from commit 95156a11a1)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-03 11:09:32 +00:00
patchback[bot]
20939e340e using get_bin_path() on atomic modules (#2144) (#2150)
* using get_bin_path() on atomic modules

* added changelog fragment

* Update changelogs/fragments/2144-atomic_get_bin_path.yml

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

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

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-04-02 22:26:06 +02:00
patchback[bot]
69b3489527 fixed str formatting (#2139) (#2140)
(cherry picked from commit f1dbef4143)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-03-31 14:15:05 +02:00
patchback[bot]
e734cf9384 fix type information for vmadm.resolvers (#2136) (#2137)
* fix type information for vmadm.resolvers

* Update changelogs/fragments/2135-vmadm-resolvers-type-fix.yml

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

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

Co-authored-by: Gaige B Paulsen <github@gbp.gaige.net>
2021-03-31 11:54:23 +02:00
patchback[bot]
0d23047f12 remove billdodd from team_redfish (#2118) (#2119)
(cherry picked from commit 0de196413f)

Co-authored-by: Bill Dodd <billdodd@gmail.com>
2021-03-26 20:08:02 +01:00
patchback[bot]
6227260432 AZP: update default container version (#2112) (#2113)
(cherry picked from commit 0bc76c98b0)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2021-03-26 13:09:41 +01:00
patchback[bot]
3d923f06ed Bugfix: Respect PATH env variable in zypper modules (#2094) (#2108)
* Bugfix: Respect PATH env variable in zypper modules

* Improve changelogs/fragments/2094-bugfix-respect-PATH-env-variable-in-zypper-modules.yaml

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

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

Co-authored-by: Stefan Richter <sealor@users.noreply.github.com>
2021-03-25 22:49:59 +01:00
patchback[bot]
9a647554b6 Updated vdo maintainer to rhawalsh. (#2102) (#2106)
bgurney-rh does not work with VDO projects anymore.  This change re-points
maintainer pings to rhawalsh instead.

(cherry picked from commit 62cd38a9a0)

Co-authored-by: Andy Walsh <33293922+rhawalsh@users.noreply.github.com>
2021-03-25 22:48:40 +01:00
patchback[bot]
fa32c1376e ipa_service - Correct pluralisation of "hosts" in example (#2103) (#2104)
(cherry picked from commit 2558cd3f01)

Co-authored-by: Alex Willmer <al.willmer@cgi.com>
2021-03-25 22:46:08 +01:00
Felix Fontein
f7cb57677f fixed documentation for oneview modules (#2092) (#2098)
(cherry picked from commit 94cf07efbf)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-03-24 18:24:30 +01:00
patchback[bot]
bc97d291aa Add a Pulp 2 related note to pulp_repo (#2096) (#2099)
(cherry picked from commit de8e2a83e2)

Co-authored-by: Matthias Dellweg <2500@gmx.de>
2021-03-24 18:12:57 +01:00
Felix Fontein
4860420c07 Next expected release will be 1.3.10. 2021-03-23 08:46:24 +01:00
176 changed files with 1145 additions and 977 deletions

View File

@@ -14,12 +14,24 @@ pr:
schedules:
- cron: 0 8 * * *
displayName: Nightly
displayName: Nightly (main)
always: true
branches:
include:
- main
- stable-*
- cron: 0 10 * * *
displayName: Nightly (active stable branches)
always: true
branches:
include:
- stable-2
- stable-3
- cron: 0 11 * * 0
displayName: Weekly (old stable branches)
always: true
branches:
include:
- stable-1
variables:
- name: checkoutPath
@@ -36,20 +48,20 @@ variables:
resources:
containers:
- container: default
image: quay.io/ansible/azure-pipelines-test-container:1.8.0
image: quay.io/ansible/azure-pipelines-test-container:1.9.0
pool: Standard
stages:
### Sanity
- stage: Sanity_devel
displayName: Sanity devel
- stage: Sanity_2_11
displayName: Sanity 2.11
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Test {0}
testFormat: devel/sanity/{0}
testFormat: 2.11/sanity/{0}
targets:
- test: 1
- test: 2
@@ -83,14 +95,14 @@ stages:
- test: 3
- test: 4
### Units
- stage: Units_devel
displayName: Units devel
- stage: Units_2_11
displayName: Units 2.11
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Python {0}
testFormat: devel/units/{0}/1
testFormat: 2.11/units/{0}/1
targets:
- test: 2.6
- test: 2.7
@@ -132,13 +144,13 @@ stages:
- test: 3.8
## Remote
- stage: Remote_devel
displayName: Remote devel
- stage: Remote_2_11
displayName: Remote 2.11
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: devel/{0}
testFormat: 2.11/{0}
targets:
- name: macOS 11.1
test: macos/11.1
@@ -196,13 +208,13 @@ stages:
- 2
### Docker
- stage: Docker_devel
displayName: Docker devel
- stage: Docker_2_11
displayName: Docker 2.11
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: devel/linux/{0}
testFormat: 2.11/linux/{0}
targets:
- name: CentOS 6
test: centos6
@@ -270,14 +282,14 @@ stages:
- 5
### Cloud
- stage: Cloud_devel
displayName: Cloud devel
- stage: Cloud_2_11
displayName: Cloud 2.11
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Python {0}
testFormat: devel/cloud/{0}/1
testFormat: 2.11/cloud/{0}/1
targets:
- test: 2.7
- test: 3.6
@@ -304,19 +316,19 @@ stages:
- stage: Summary
condition: succeededOrFailed()
dependsOn:
- Sanity_devel
- Sanity_2_11
- Sanity_2_9
- Sanity_2_10
- Units_devel
- Units_2_11
- Units_2_9
- Units_2_10
- Remote_devel
- Remote_2_11
- Remote_2_9
- Remote_2_10
- Docker_devel
- Docker_2_11
- Docker_2_9
- Docker_2_10
- Cloud_devel
- Cloud_2_11
- Cloud_2_9
- Cloud_2_10
jobs:

View File

@@ -7,7 +7,7 @@ set -o pipefail -eu
output_path="$1"
curl --silent --show-error https://codecov.io/bash > codecov.sh
curl --silent --show-error https://ansible-ci-files.s3.us-east-1.amazonaws.com/codecov/codecov.sh > codecov.sh
for file in "${output_path}"/reports/coverage*.xml; do
name="${file}"

29
.github/BOTMETA.yml vendored
View File

@@ -1,5 +1,7 @@
automerge: true
files:
plugins/:
supershipit: quidame Ajpantuso
changelogs/fragments/:
support: community
$actions:
@@ -106,6 +108,8 @@ files:
maintainers: $team_linode
labels: cloud linode
keywords: linode dynamic inventory script
$inventories/proxmox.py:
maintainers: $team_virt ilijamt
$inventories/scaleway.py:
maintainers: $team_scaleway
labels: cloud scaleway
@@ -258,6 +262,8 @@ files:
maintainers: zbal
$modules/cloud/lxc/lxc_container.py:
maintainers: cloudnull
$modules/cloud/lxc/lxc_profile.py:
maintainers: conloos
$modules/cloud/lxd/:
ignore: hnakamur
$modules/cloud/memset/:
@@ -373,6 +379,7 @@ files:
maintainers: bvitnik
$modules/clustering/consul/:
maintainers: $team_consul
ignore: colin-nolan
$modules/clustering/etcd3.py:
maintainers: evrardjp
ignore: vfauth
@@ -523,7 +530,7 @@ files:
$modules/net_tools/dnsmadeeasy.py:
maintainers: briceburg
$modules/net_tools/haproxy.py:
maintainers: ravibhure
maintainers: ravibhure Normo
$modules/net_tools/hetzner_failover_ip.py:
maintainers: felixfontein
$modules/net_tools/hetzner_failover_ip_info.py:
@@ -821,7 +828,7 @@ files:
$modules/remote_management/oneview/oneview_fcoe_network.py:
maintainers: fgbulsoni
$modules/remote_management/redfish/:
maintainers: $team_redfish billdodd
maintainers: $team_redfish
ignore: jose-delarosa
$modules/remote_management/stacki/stacki_host.py:
maintainers: bsanders bbyhuy
@@ -846,6 +853,8 @@ files:
ignore: erydo
$modules/source_control/github/github_release.py:
maintainers: adrianmoisey
$modules/source_control/github/github_repo.py:
maintainers: atorrescogollo
$modules/source_control/github/:
maintainers: stpierre
$modules/source_control/gitlab/:
@@ -929,7 +938,7 @@ files:
$modules/system/iptables_state.py:
maintainers: quidame
$modules/system/java_cert.py:
maintainers: haad
maintainers: haad absynth76
$modules/system/java_keystore.py:
maintainers: Mogztter
$modules/system/kernel_blacklist.py:
@@ -1012,7 +1021,7 @@ files:
maintainers: ahtik ovcharenko pyykkis
labels: ufw
$modules/system/vdo.py:
maintainers: bgurney-rh
maintainers: rhawalsh
$modules/system/xfconf.py:
maintainers: russoz jbenden
labels: xfconf
@@ -1097,16 +1106,16 @@ macros:
terminals: plugins/terminal
team_aix: MorrisA bcoca d-little flynn1973 gforster kairoaraujo marvin-sinister mator molekuul ramooncamacho wtcross
team_bsd: JoergFiedler MacLemon bcoca dch jasperla mekanix opoplawski overhacked tuxillo
team_consul: colin-nolan sgargan
team_consul: sgargan
team_cyberark_conjur: jvanderhoof ryanprior
team_docker: DBendit WojciechowskiPiotr akshay196 danihodovic dariko felixfontein jwitko kassiansun tbouvet chouseknecht
team_e_spirit: MatrixCrawler getjack
team_flatpak: JayKayy oolongbrothers
team_gitlab: Lunik Shaps dj-wasabi marwatk waheedi zanssa scodeman
team_gitlab: Lunik Shaps dj-wasabi marwatk waheedi zanssa scodeman metanovii
team_google: erjohnso rambleraptor
team_hpux: bcoca davx8342
team_huawei: QijunPan TommyLike edisonxiang freesky-edward hwDCN niuzhenguo xuxiaowei0512 yanzhangi zengchen1024 zhongjun2
team_ipa: Akasurde Nosmoht fxfitz
team_ipa: Akasurde Nosmoht fxfitz justchris1
team_jboss: Wolfant jairojunior wbrefvem
team_keycloak: eikef ndclt
team_kubevirt: machacekondra mmazur pkliczewski
@@ -1115,13 +1124,13 @@ macros:
team_manageiq: abellotti cben gtanzillo yaacov zgalor dkorn evertmulder
team_netapp: amit0701 carchi8py hulquest lmprice lonico ndswartz schmots1
team_networking: NilashishC Qalthos danielmellado ganeshrn justjais trishnaguha sganesh-infoblox privateip
team_opennebula: ilicmilan meerkampdvv rsmontero xorel
team_opennebula: ilicmilan meerkampdvv rsmontero xorel nilsding
team_oracle: manojmeda mross22 nalsaber
team_postgresql: Andersson007 Dorn- andytom jbscalia kostiantyn-nemchenko matburt nerzhul sebasmannem tcraxs ilicmilan
team_purestorage: bannaych dnix101 genegr lionmax opslounge raekins sdodsley sile16
team_redfish: billdodd mraineri tomasg2012 xmadsen renxulei
team_redfish: mraineri tomasg2012 xmadsen renxulei
team_rhn: FlossWare alikins barnabycourt vritant
team_scaleway: QuentinBrosse abarbare jerome-quere kindermoumoute remyleone sieben
team_solaris: bcoca fishman jasperla jpdasma mator scathatheworm troy2914 xen0l
team_suse: commel dcermak evrardjp lrupp toabctl AnderEnder alxgu andytom
team_virt: joshainglis karmab Aversiste
team_virt: joshainglis karmab tleguern Thulium-Drake Ajpantuso

View File

@@ -5,6 +5,74 @@ Community General Release Notes
.. contents:: Topics
v1.3.11
=======
Release Summary
---------------
Maintenance release.
Bugfixes
--------
- ovirt* modules - remove bad unnecessary import for current ansible-core development version (https://github.com/ansible-collections/community.general/pull/2381).
v1.3.10
=======
Release Summary
---------------
Last regular bugfix release. There will only be new bugfix releases for security fixes and major bugfixes.
Minor Changes
-------------
- atomic_container - using ``get_bin_path()`` before calling ``run_command()`` (https://github.com/ansible-collections/community.general/pull/2144).
- atomic_host - using ``get_bin_path()`` before calling ``run_command()`` (https://github.com/ansible-collections/community.general/pull/2144).
- atomic_image - using ``get_bin_path()`` before calling ``run_command()`` (https://github.com/ansible-collections/community.general/pull/2144).
- beadm - minor refactor converting multiple statements to a single list literal (https://github.com/ansible-collections/community.general/pull/2160).
- bitbucket_pipeline_variable - removed unreachable code (https://github.com/ansible-collections/community.general/pull/2157).
- hiera lookup - minor refactor converting multiple statements to a single list literal (https://github.com/ansible-collections/community.general/pull/2160).
- ipwcli_dns - minor refactor converting multiple statements to a single list literal (https://github.com/ansible-collections/community.general/pull/2160).
- known_hosts module utils - minor refactor converting multiple statements to a single list literal (https://github.com/ansible-collections/community.general/pull/2160).
- nictagadm - minor refactor converting multiple statements to a single list literal (https://github.com/ansible-collections/community.general/pull/2160).
- ovh_ip_failover - removed unreachable code (https://github.com/ansible-collections/community.general/pull/2157).
- rhevm - removed unreachable code (https://github.com/ansible-collections/community.general/pull/2157).
- smartos_image_info - minor refactor converting multiple statements to a single list literal (https://github.com/ansible-collections/community.general/pull/2160).
- svr4pkg - minor refactor converting multiple statements to a single list literal (https://github.com/ansible-collections/community.general/pull/2160).
- xattr - minor refactor converting multiple statements to a single list literal (https://github.com/ansible-collections/community.general/pull/2160).
- zfs_facts - minor refactor converting multiple statements to a single list literal (https://github.com/ansible-collections/community.general/pull/2160).
- zpool_facts - minor refactor converting multiple statements to a single list literal (https://github.com/ansible-collections/community.general/pull/2160).
Security Fixes
--------------
- java_keystore - pass secret to keytool through an environment variable to not expose it as a commandline argument (https://github.com/ansible-collections/community.general/issues/1668).
Bugfixes
--------
- dimensiondata_network - bug when formatting message, instead of % a simple comma was used (https://github.com/ansible-collections/community.general/pull/2139).
- funcd connection plugin - can now load (https://github.com/ansible-collections/community.general/pull/2235).
- haproxy - fix a bug preventing haproxy from properly entering ``DRAIN`` mode (https://github.com/ansible-collections/community.general/issues/1913).
- hiera lookup plugin - converts the return type of plugin to unicode string (https://github.com/ansible-collections/community.general/pull/2329).
- ipa_user - allow ``sshpubkey`` to permit multiple word comments (https://github.com/ansible-collections/community.general/pull/2159).
- java_keystore - improve error handling and return ``cmd`` as documented. Force ``LANG``, ``LC_ALL`` and ``LC_MESSAGES`` environment variables to ``C`` to rely on ``keytool`` output parsing. Fix pylint's ``unused-variable`` and ``no-else-return`` hints (https://github.com/ansible-collections/community.general/pull/2183).
- java_keystore - use tempfile lib to create temporary files with randomized names, and remove the temporary PKCS#12 keystore as well as other materials (https://github.com/ansible-collections/community.general/issues/1667).
- jenkins_plugin - fixes Python 2 compatibility issue (https://github.com/ansible-collections/community.general/pull/2340).
- kibana_plugin - added missing parameter to ``remove_plugin`` when using ``state=present force=true``, and fix potential quoting errors when invoking ``kibana`` (https://github.com/ansible-collections/community.general/pull/2143).
- module_helper module utils - fixed decorator ``cause_changes`` (https://github.com/ansible-collections/community.general/pull/2203).
- nmap inventory plugin - fix cache and constructed group support (https://github.com/ansible-collections/community.general/issues/2242).
- pkgutil - fixed calls to ``list.extend()`` (https://github.com/ansible-collections/community.general/pull/2161).
- terraform - fix issue that cause the destroy to fail because from Terraform 0.15 on, the ``terraform destroy -force`` option is replaced with ``terraform destroy -auto-approve`` (https://github.com/ansible-collections/community.general/issues/2247).
- terraform - fix issue that cause the execution fail because from Terraform 0.15 on, the ``-var`` and ``-var-file`` options are no longer available on ``terraform validate`` (https://github.com/ansible-collections/community.general/pull/2246).
- terraform - remove uses of ``use_unsafe_shell=True`` (https://github.com/ansible-collections/community.general/pull/2246).
- vmadm - correct type of list elements in ``resolvers`` parameter (https://github.com/ansible-collections/community.general/issues/2135).
- xfconf - module was not honoring check mode when ``state`` was ``absent`` (https://github.com/ansible-collections/community.general/pull/2185).
- zypper, zypper_repository - respect ``PATH`` environment variable when resolving zypper executable path (https://github.com/ansible-collections/community.general/pull/2094).
v1.3.9
======

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

@@ -7,9 +7,11 @@ This repo contains the `community.general` Ansible Collection. The collection in
You can find [documentation for this collection on the Ansible docs site](https://docs.ansible.com/ansible/latest/collections/community/general/).
Please note that this collection does **not** support Windows targets. Only connection plugins included in this collection might support Windows targets, and will explicitly mention that in their documentation if they do so.
## Tested with Ansible
Tested with the current Ansible 2.9 and 2.10 releases and the current development version of Ansible. Ansible versions before 2.9.10 are not supported.
Tested with the current Ansible 2.9, ansible-base 2.10 and ansible-core 2.11 releases. Ansible versions before 2.9.10 are not supported.
## External requirements
@@ -48,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).
@@ -56,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

@@ -1627,6 +1627,108 @@ releases:
- fix_parsing_array_values_in_osx_defaults.yml
- nios_host_record-fix-aliases-removal.yml
release_date: '2020-12-21'
1.3.10:
changes:
bugfixes:
- dimensiondata_network - bug when formatting message, instead of % a simple
comma was used (https://github.com/ansible-collections/community.general/pull/2139).
- funcd connection plugin - can now load (https://github.com/ansible-collections/community.general/pull/2235).
- haproxy - fix a bug preventing haproxy from properly entering ``DRAIN`` mode
(https://github.com/ansible-collections/community.general/issues/1913).
- hiera lookup plugin - converts the return type of plugin to unicode string
(https://github.com/ansible-collections/community.general/pull/2329).
- ipa_user - allow ``sshpubkey`` to permit multiple word comments (https://github.com/ansible-collections/community.general/pull/2159).
- java_keystore - improve error handling and return ``cmd`` as documented. Force
``LANG``, ``LC_ALL`` and ``LC_MESSAGES`` environment variables to ``C`` to
rely on ``keytool`` output parsing. Fix pylint's ``unused-variable`` and ``no-else-return``
hints (https://github.com/ansible-collections/community.general/pull/2183).
- java_keystore - use tempfile lib to create temporary files with randomized
names, and remove the temporary PKCS#12 keystore as well as other materials
(https://github.com/ansible-collections/community.general/issues/1667).
- jenkins_plugin - fixes Python 2 compatibility issue (https://github.com/ansible-collections/community.general/pull/2340).
- kibana_plugin - added missing parameter to ``remove_plugin`` when using ``state=present
force=true``, and fix potential quoting errors when invoking ``kibana`` (https://github.com/ansible-collections/community.general/pull/2143).
- module_helper module utils - fixed decorator ``cause_changes`` (https://github.com/ansible-collections/community.general/pull/2203).
- nmap inventory plugin - fix cache and constructed group support (https://github.com/ansible-collections/community.general/issues/2242).
- pkgutil - fixed calls to ``list.extend()`` (https://github.com/ansible-collections/community.general/pull/2161).
- terraform - fix issue that cause the destroy to fail because from Terraform
0.15 on, the ``terraform destroy -force`` option is replaced with ``terraform
destroy -auto-approve`` (https://github.com/ansible-collections/community.general/issues/2247).
- terraform - fix issue that cause the execution fail because from Terraform
0.15 on, the ``-var`` and ``-var-file`` options are no longer available on
``terraform validate`` (https://github.com/ansible-collections/community.general/pull/2246).
- terraform - remove uses of ``use_unsafe_shell=True`` (https://github.com/ansible-collections/community.general/pull/2246).
- vmadm - correct type of list elements in ``resolvers`` parameter (https://github.com/ansible-collections/community.general/issues/2135).
- xfconf - module was not honoring check mode when ``state`` was ``absent``
(https://github.com/ansible-collections/community.general/pull/2185).
- zypper, zypper_repository - respect ``PATH`` environment variable when resolving
zypper executable path (https://github.com/ansible-collections/community.general/pull/2094).
minor_changes:
- atomic_container - using ``get_bin_path()`` before calling ``run_command()``
(https://github.com/ansible-collections/community.general/pull/2144).
- atomic_host - using ``get_bin_path()`` before calling ``run_command()`` (https://github.com/ansible-collections/community.general/pull/2144).
- atomic_image - using ``get_bin_path()`` before calling ``run_command()`` (https://github.com/ansible-collections/community.general/pull/2144).
- beadm - minor refactor converting multiple statements to a single list literal
(https://github.com/ansible-collections/community.general/pull/2160).
- bitbucket_pipeline_variable - removed unreachable code (https://github.com/ansible-collections/community.general/pull/2157).
- hiera lookup - minor refactor converting multiple statements to a single list
literal (https://github.com/ansible-collections/community.general/pull/2160).
- ipwcli_dns - minor refactor converting multiple statements to a single list
literal (https://github.com/ansible-collections/community.general/pull/2160).
- known_hosts module utils - minor refactor converting multiple statements to
a single list literal (https://github.com/ansible-collections/community.general/pull/2160).
- nictagadm - minor refactor converting multiple statements to a single list
literal (https://github.com/ansible-collections/community.general/pull/2160).
- ovh_ip_failover - removed unreachable code (https://github.com/ansible-collections/community.general/pull/2157).
- rhevm - removed unreachable code (https://github.com/ansible-collections/community.general/pull/2157).
- smartos_image_info - minor refactor converting multiple statements to a single
list literal (https://github.com/ansible-collections/community.general/pull/2160).
- svr4pkg - minor refactor converting multiple statements to a single list literal
(https://github.com/ansible-collections/community.general/pull/2160).
- xattr - minor refactor converting multiple statements to a single list literal
(https://github.com/ansible-collections/community.general/pull/2160).
- zfs_facts - minor refactor converting multiple statements to a single list
literal (https://github.com/ansible-collections/community.general/pull/2160).
- zpool_facts - minor refactor converting multiple statements to a single list
literal (https://github.com/ansible-collections/community.general/pull/2160).
release_summary: Last regular bugfix release. There will only be new bugfix
releases for security fixes and major bugfixes.
security_fixes:
- java_keystore - pass secret to keytool through an environment variable to
not expose it as a commandline argument (https://github.com/ansible-collections/community.general/issues/1668).
fragments:
- 1.3.10.yml
- 1993-haproxy-fix-draining.yml
- 2094-bugfix-respect-PATH-env-variable-in-zypper-modules.yaml
- 2135-vmadm-resolvers-type-fix.yml
- 2139-dimensiondata_network-str-format.yml
- 2143-kibana_plugin-fixed-function-calls.yml
- 2144-atomic_get_bin_path.yml
- 2157-unreachable-code.yml
- 2159-ipa-user-sshpubkey-multi-word-comments.yaml
- 2160-list-literals.yml
- 2161-pkgutil-list-extend.yml
- 2163-java_keystore_1667_improve_temp_files_storage.yml
- 2177-java_keystore_1668_dont_expose_secrets_on_cmdline.yml
- 2183-java_keystore_improve_error_handling.yml
- 2185-xfconf-absent-check-mode.yml
- 2203-modhelper-cause-changes-deco.yml
- 2246-terraform.yaml
- 2282-nmap-fix-cache-support.yml
- 2329-hiera-lookup-plugin-return-type.yaml
- 2340-jenkins_plugin-py2.yml
- allow_funcd_to_load.yml
release_date: '2021-04-26'
1.3.11:
changes:
bugfixes:
- ovirt* modules - remove bad unnecessary import for current ansible-core development
version (https://github.com/ansible-collections/community.general/pull/2381).
release_summary: Maintenance release.
fragments:
- 1.3.11.yml
- ovirt-fixup.yml
release_date: '2021-06-28'
1.3.2:
changes:
bugfixes:

74
commit-rights.md Normal file
View File

@@ -0,0 +1,74 @@
Committers Guidelines for community.general
===========================================
This document is based on the [Ansible committer guidelines](https://github.com/ansible/ansible/blob/b57444af14062ec96e0af75fdfc2098c74fe2d9a/docs/docsite/rst/community/committer_guidelines.rst) ([latest version](https://docs.ansible.com/ansible/devel/community/committer_guidelines.html)).
These are the guidelines for people with commit privileges on the Ansible Community General Collection GitHub repository. Please read the guidelines before you commit.
These guidelines apply to everyone. At the same time, this is NOT a process document. So just use good judgment. You have been given commit access because we trust your judgment.
That said, use the trust wisely.
If you abuse the trust and break components and builds, and so on, the trust level falls and you may be asked not to commit or you may lose your commit privileges.
Our workflow on GitHub
----------------------
As a committer, you may already know this, but our workflow forms a lot of our team policies. Please ensure you are aware of the following workflow steps:
* Fork the repository upon which you want to do some work to your own personal repository
* Work on the specific branch upon which you need to commit
* Create a Pull Request back to the collection repository and await reviews
* Adjust code as necessary based on the Comments provided
* Ask someone from the other committers to do a final review and merge
Sometimes, committers merge their own pull requests. This section is a set of guidelines. If you are changing a comma in a doc or making a very minor change, you can use your best judgement. This is another trust thing. The process is critical for any major change, but for little things or getting something done quickly, use your best judgement and make sure people on the team are aware of your work.
Roles
-----
* Release managers: Merge pull requests to `stable-X` branches, create tags to do releases.
* Committers: Fine to do PRs for most things, but we should have a timebox. Hanging PRs may merge on the judgement of these devs.
* Module maintainers: Module maintainers own specific modules and have indirect commit access through the current module PR mechanisms. This is primary [ansibullbot](https://github.com/ansibullbot)'s `shipit` mechanism.
General rules
-------------
Individuals with direct commit access to this collection repository are entrusted with powers that allow them to do a broad variety of things--probably more than we can write down. Rather than rules, treat these as general *guidelines*, individuals with this power are expected to use their best judgement.
* Do NOTs:
- Do not commit directly.
- Do not merge your own PRs. Someone else should have a chance to review and approve the PR merge. You have a small amount of leeway here for very minor changes.
- Do not forget about non-standard / alternate environments. Consider the alternatives. Yes, people have bad/unusual/strange environments (like binaries from multiple init systems installed), but they are the ones who need us the most.
- Do not drag your community team members down. Discuss the technical merits of any pull requests you review. Avoid negativity and personal comments. For more guidance on being a good community member, read the [Ansible Community Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html).
- Do not forget about the maintenance burden. High-maintenance features may not be worth adding.
- Do not break playbooks. Always keep backwards compatibility in mind.
- Do not forget to keep it simple. Complexity breeds all kinds of problems.
- Do not merge to branches other than `main`, especially not to `stable-X`, if you do not have explicit permission to do so.
- Do not create tags. Tags are used in the release process, and should only be created by the people responsible for managing the stable branches.
* Do:
- Squash, avoid merges whenever possible, use GitHub's squash commits or cherry pick if needed (bisect thanks you).
- Be active. Committers who have no activity on the project (through merges, triage, commits, and so on) will have their permissions suspended.
- Consider backwards compatibility (goes back to "do not break existing playbooks").
- Write tests. PRs with tests are looked at with more priority than PRs without tests that should have them included. While not all changes require tests, be sure to add them for bug fixes or functionality changes.
- Discuss with other committers, specially when you are unsure of something.
- Document! If your PR is a new feature or a change to behavior, make sure you've updated all associated documentation or have notified the right people to do so.
- Consider scope, sometimes a fix can be generalized.
- Keep it simple, then things are maintainable, debuggable and intelligible.
Committers are expected to continue to follow the same community and contribution guidelines followed by the rest of the Ansible community.
People
------
Individuals who have been asked to become a part of this group have generally been contributing in significant ways to the community.general collection for some time. Should they agree, they are requested to add their names and GitHub IDs to this file, in the section below, through a pull request. Doing so indicates that these individuals agree to act in the ways that their fellow committers trust that they will act.
| 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: 1.3.9
version: 1.3.11
readme: README.md
authors:
- Ansible (https://github.com/ansible)

View File

@@ -37,12 +37,13 @@ import tempfile
import shutil
from ansible.errors import AnsibleError
from ansible.plugins.connection import ConnectionBase
from ansible.utils.display import Display
display = Display()
class Connection(object):
class Connection(ConnectionBase):
''' Func-based connections '''
has_pipelining = False

View File

@@ -13,12 +13,32 @@ class ModuleDocFragment(object):
DOCUMENTATION = r'''
options:
config:
description:
description:
- Path to a .json configuration file containing the OneView client configuration.
The configuration file is optional and when used should be present in the host running the ansible commands.
If the file path is not provided, the configuration will be loaded from environment variables.
For links to example configuration files or how to use the environment variables verify the notes section.
type: path
type: path
api_version:
description:
- OneView API Version.
type: int
image_streamer_hostname:
description:
- IP address or hostname for the HPE Image Streamer REST API.
type: str
hostname:
description:
- IP address or hostname for the appliance.
type: str
username:
description:
- Username for API authentication.
type: str
password:
description:
- Password for API authentication.
type: str
requirements:
- python >= 2.7.9

View File

@@ -72,6 +72,25 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
self._nmap = None
super(InventoryModule, self).__init__()
def _populate(self, hosts):
# Use constructed if applicable
strict = self.get_option('strict')
for host in hosts:
hostname = host['name']
self.inventory.add_host(hostname)
for var, value in host.items():
self.inventory.set_variable(hostname, var, value)
# Composed variables
self._set_composite_vars(self.get_option('compose'), host, hostname, strict=strict)
# Complex groups based on jinja2 conditionals, hosts that meet the conditional are added to group
self._add_host_to_composed_groups(self.get_option('groups'), host, hostname, strict=strict)
# Create groups based on variable values and add the corresponding hosts to it
self._add_host_to_keyed_groups(self.get_option('keyed_groups'), host, hostname, strict=strict)
def verify_file(self, path):
valid = False
@@ -83,7 +102,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
return valid
def parse(self, inventory, loader, path, cache=False):
def parse(self, inventory, loader, path, cache=True):
try:
self._nmap = get_bin_path('nmap')
@@ -94,75 +113,101 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
self._read_config_data(path)
# setup command
cmd = [self._nmap]
if not self._options['ports']:
cmd.append('-sP')
cache_key = self.get_cache_key(path)
if self._options['ipv4'] and not self._options['ipv6']:
cmd.append('-4')
elif self._options['ipv6'] and not self._options['ipv4']:
cmd.append('-6')
elif not self._options['ipv6'] and not self._options['ipv4']:
raise AnsibleParserError('One of ipv4 or ipv6 must be enabled for this plugin')
# cache may be True or False at this point to indicate if the inventory is being refreshed
# get the user's cache option too to see if we should save the cache if it is changing
user_cache_setting = self.get_option('cache')
if self._options['exclude']:
cmd.append('--exclude')
cmd.append(','.join(self._options['exclude']))
cmd.append(self._options['address'])
try:
# execute
p = Popen(cmd, stdout=PIPE, stderr=PIPE)
stdout, stderr = p.communicate()
if p.returncode != 0:
raise AnsibleParserError('Failed to run nmap, rc=%s: %s' % (p.returncode, to_native(stderr)))
# parse results
host = None
ip = None
ports = []
# read if the user has caching enabled and the cache isn't being refreshed
attempt_to_read_cache = user_cache_setting and cache
# update if the user has caching enabled and the cache is being refreshed; update this value to True if the cache has expired below
cache_needs_update = user_cache_setting and not cache
if attempt_to_read_cache:
try:
t_stdout = to_text(stdout, errors='surrogate_or_strict')
except UnicodeError as e:
raise AnsibleParserError('Invalid (non unicode) input returned: %s' % to_native(e))
results = self._cache[cache_key]
except KeyError:
# 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
for line in t_stdout.splitlines():
hits = self.find_host.match(line)
if hits:
if host is not None:
self.inventory.set_variable(host, 'ports', ports)
if cache_needs_update:
# setup command
cmd = [self._nmap]
if not self._options['ports']:
cmd.append('-sP')
# if dns only shows arpa, just use ip instead as hostname
if hits.group(1).endswith('.in-addr.arpa'):
host = hits.group(2)
else:
host = hits.group(1)
if self._options['ipv4'] and not self._options['ipv6']:
cmd.append('-4')
elif self._options['ipv6'] and not self._options['ipv4']:
cmd.append('-6')
elif not self._options['ipv6'] and not self._options['ipv4']:
raise AnsibleParserError('One of ipv4 or ipv6 must be enabled for this plugin')
# if no reverse dns exists, just use ip instead as hostname
if hits.group(2) is not None:
ip = hits.group(2)
else:
ip = hits.group(1)
if self._options['exclude']:
cmd.append('--exclude')
cmd.append(','.join(self._options['exclude']))
if host is not None:
# update inventory
self.inventory.add_host(host)
self.inventory.set_variable(host, 'ip', ip)
ports = []
continue
cmd.append(self._options['address'])
try:
# execute
p = Popen(cmd, stdout=PIPE, stderr=PIPE)
stdout, stderr = p.communicate()
if p.returncode != 0:
raise AnsibleParserError('Failed to run nmap, rc=%s: %s' % (p.returncode, to_native(stderr)))
host_ports = self.find_port.match(line)
if host is not None and host_ports:
ports.append({'port': host_ports.group(1), 'protocol': host_ports.group(2), 'state': host_ports.group(3), 'service': host_ports.group(4)})
continue
# parse results
host = None
ip = None
ports = []
results = []
# TODO: parse more data, OS?
try:
t_stdout = to_text(stdout, errors='surrogate_or_strict')
except UnicodeError as e:
raise AnsibleParserError('Invalid (non unicode) input returned: %s' % to_native(e))
# if any leftovers
if host and ports:
self.inventory.set_variable(host, 'ports', ports)
for line in t_stdout.splitlines():
hits = self.find_host.match(line)
if hits:
if host is not None and ports:
results[-1]['ports'] = ports
except Exception as e:
raise AnsibleParserError("failed to parse %s: %s " % (to_native(path), to_native(e)))
# if dns only shows arpa, just use ip instead as hostname
if hits.group(1).endswith('.in-addr.arpa'):
host = hits.group(2)
else:
host = hits.group(1)
# if no reverse dns exists, just use ip instead as hostname
if hits.group(2) is not None:
ip = hits.group(2)
else:
ip = hits.group(1)
if host is not None:
# update inventory
results.append(dict())
results[-1]['name'] = host
results[-1]['ip'] = ip
ports = []
continue
host_ports = self.find_port.match(line)
if host is not None and host_ports:
ports.append({'port': host_ports.group(1),
'protocol': host_ports.group(2),
'state': host_ports.group(3),
'service': host_ports.group(4)})
continue
# if any leftovers
if host and ports:
results[-1]['ports'] = ports
except Exception as e:
raise AnsibleParserError("failed to parse %s: %s " % (to_native(path), to_native(e)))
self._cache[cache_key] = results
self._populate(results)

View File

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

View File

@@ -31,7 +31,9 @@ EXAMPLES = r"""
- name: Template files (explicitly skip directories in order to use the 'src' attribute)
ansible.builtin.template:
src: '{{ item.src }}'
dest: /web/{{ item.path }}
# Your template files should be stored with a .j2 file extension,
# but should not be deployed with it. splitext|first removes it.
dest: /web/{{ item.path | splitext | first }}
mode: '{{ item.mode }}'
with_community.general.filetree: web/
when: item.state == 'file'
@@ -41,6 +43,7 @@ EXAMPLES = r"""
src: '{{ item.src }}'
dest: /web/{{ item.path }}
state: link
follow: false # avoid corrupting target files if the link already exists
force: yes
mode: '{{ item.mode }}'
with_community.general.filetree: web/

View File

@@ -63,6 +63,7 @@ import os
from ansible.plugins.lookup import LookupBase
from ansible.utils.cmd_functions import run_cmd
from ansible.module_utils._text import to_text
ANSIBLE_HIERA_CFG = os.getenv('ANSIBLE_HIERA_CFG', '/etc/hiera.yaml')
ANSIBLE_HIERA_BIN = os.getenv('ANSIBLE_HIERA_BIN', '/usr/bin/hiera')
@@ -78,13 +79,11 @@ class Hiera(object):
rc, output, err = run_cmd("{0} -c {1} {2}".format(
ANSIBLE_HIERA_BIN, ANSIBLE_HIERA_CFG, hiera_key[0]))
return output.strip()
return to_text(output.strip())
class LookupModule(LookupBase):
def run(self, terms, variables=''):
hiera = Hiera()
ret = []
ret.append(hiera.get(terms))
ret = [hiera.get(terms)]
return ret

View File

@@ -87,11 +87,12 @@ def not_in_host_file(self, host):
user_host_file = "~/.ssh/known_hosts"
user_host_file = os.path.expanduser(user_host_file)
host_file_list = []
host_file_list.append(user_host_file)
host_file_list.append("/etc/ssh/ssh_known_hosts")
host_file_list.append("/etc/ssh/ssh_known_hosts2")
host_file_list.append("/etc/openssh/ssh_known_hosts")
host_file_list = [
user_host_file,
"/etc/ssh/ssh_known_hosts",
"/etc/ssh/ssh_known_hosts2",
"/etc/openssh/ssh_known_hosts",
]
hfiles_not_found = 0
for hf in host_file_list:

View File

@@ -81,18 +81,27 @@ class ArgFormat(object):
return [str(p) for p in func(value)]
def cause_changes(func, on_success=True, on_failure=False):
@wraps(func)
def wrapper(self, *args, **kwargs):
try:
func(*args, **kwargs)
if on_success:
self.changed = True
except Exception as e:
if on_failure:
self.changed = True
raise
return wrapper
def cause_changes(on_success=None, on_failure=None):
def deco(func):
if on_success is None and on_failure is None:
return func
@wraps(func)
def wrapper(*args, **kwargs):
try:
self = args[0]
func(*args, **kwargs)
if on_success is not None:
self.changed = on_success
except Exception:
if on_failure is not None:
self.changed = on_failure
raise
return wrapper
return deco
def module_fails_on_exception(func):

View File

@@ -102,7 +102,8 @@ def do_install(module, mode, rootfs, container, image, values_list, backend):
system_list = ["--system"] if mode == 'system' else []
user_list = ["--user"] if mode == 'user' else []
rootfs_list = ["--rootfs=%s" % rootfs] if rootfs else []
args = ['atomic', 'install', "--storage=%s" % backend, '--name=%s' % container] + system_list + user_list + rootfs_list + values_list + [image]
atomic_bin = module.get_bin_path('atomic')
args = [atomic_bin, 'install', "--storage=%s" % backend, '--name=%s' % container] + system_list + user_list + rootfs_list + values_list + [image]
rc, out, err = module.run_command(args, check_rc=False)
if rc != 0:
module.fail_json(rc=rc, msg=err)
@@ -112,7 +113,8 @@ def do_install(module, mode, rootfs, container, image, values_list, backend):
def do_update(module, container, image, values_list):
args = ['atomic', 'containers', 'update', "--rebase=%s" % image] + values_list + [container]
atomic_bin = module.get_bin_path('atomic')
args = [atomic_bin, 'containers', 'update', "--rebase=%s" % image] + values_list + [container]
rc, out, err = module.run_command(args, check_rc=False)
if rc != 0:
module.fail_json(rc=rc, msg=err)
@@ -122,7 +124,8 @@ def do_update(module, container, image, values_list):
def do_uninstall(module, name, backend):
args = ['atomic', 'uninstall', "--storage=%s" % backend, name]
atomic_bin = module.get_bin_path('atomic')
args = [atomic_bin, 'uninstall', "--storage=%s" % backend, name]
rc, out, err = module.run_command(args, check_rc=False)
if rc != 0:
module.fail_json(rc=rc, msg=err)
@@ -130,7 +133,8 @@ def do_uninstall(module, name, backend):
def do_rollback(module, name):
args = ['atomic', 'containers', 'rollback', name]
atomic_bin = module.get_bin_path('atomic')
args = [atomic_bin, 'containers', 'rollback', name]
rc, out, err = module.run_command(args, check_rc=False)
if rc != 0:
module.fail_json(rc=rc, msg=err)
@@ -148,14 +152,12 @@ def core(module):
backend = module.params['backend']
state = module.params['state']
atomic_bin = module.get_bin_path('atomic')
module.run_command_environ_update = dict(LANG='C', LC_ALL='C', LC_MESSAGES='C')
out = {}
err = {}
rc = 0
values_list = ["--set=%s" % x for x in values] if values else []
args = ['atomic', 'containers', 'list', '--no-trunc', '-n', '--all', '-f', 'backend=%s' % backend, '-f', 'container=%s' % name]
args = [atomic_bin, 'containers', 'list', '--no-trunc', '-n', '--all', '-f', 'backend=%s' % backend, '-f', 'container=%s' % name]
rc, out, err = module.run_command(args, check_rc=False)
if rc != 0:
module.fail_json(rc=rc, msg=err)
@@ -194,9 +196,7 @@ def main():
module.fail_json(msg="values is supported only with user or system mode")
# Verify that the platform supports atomic command
rc, out, err = module.run_command('atomic -v', check_rc=False)
if rc != 0:
module.fail_json(msg="Error in running atomic command", err=err)
dummy = module.get_bin_path('atomic', required=True)
try:
core(module)

View File

@@ -57,18 +57,14 @@ from ansible.module_utils._text import to_native
def core(module):
revision = module.params['revision']
args = []
atomic_bin = module.get_bin_path('atomic', required=True)
module.run_command_environ_update = dict(LANG='C', LC_ALL='C', LC_MESSAGES='C')
if revision == 'latest':
args = ['atomic', 'host', 'upgrade']
args = [atomic_bin, 'host', 'upgrade']
else:
args = ['atomic', 'host', 'deploy', revision]
out = {}
err = {}
rc = 0
args = [atomic_bin, 'host', 'deploy', revision]
rc, out, err = module.run_command(args, check_rc=False)

View File

@@ -73,7 +73,8 @@ from ansible.module_utils._text import to_native
def do_upgrade(module, image):
args = ['atomic', 'update', '--force', image]
atomic_bin = module.get_bin_path('atomic')
args = [atomic_bin, 'update', '--force', image]
rc, out, err = module.run_command(args, check_rc=False)
if rc != 0: # something went wrong emit the msg
module.fail_json(rc=rc, msg=err)
@@ -91,20 +92,21 @@ def core(module):
is_upgraded = False
module.run_command_environ_update = dict(LANG='C', LC_ALL='C', LC_MESSAGES='C')
atomic_bin = module.get_bin_path('atomic')
out = {}
err = {}
rc = 0
if backend:
if state == 'present' or state == 'latest':
args = ['atomic', 'pull', "--storage=%s" % backend, image]
args = [atomic_bin, 'pull', "--storage=%s" % backend, image]
rc, out, err = module.run_command(args, check_rc=False)
if rc < 0:
module.fail_json(rc=rc, msg=err)
else:
out_run = ""
if started:
args = ['atomic', 'run', "--storage=%s" % backend, image]
args = [atomic_bin, 'run', "--storage=%s" % backend, image]
rc, out_run, err = module.run_command(args, check_rc=False)
if rc < 0:
module.fail_json(rc=rc, msg=err)
@@ -112,7 +114,7 @@ def core(module):
changed = "Extracting" in out or "Copying blob" in out
module.exit_json(msg=(out + out_run), changed=changed)
elif state == 'absent':
args = ['atomic', 'images', 'delete', "--storage=%s" % backend, image]
args = [atomic_bin, 'images', 'delete', "--storage=%s" % backend, image]
rc, out, err = module.run_command(args, check_rc=False)
if rc < 0:
module.fail_json(rc=rc, msg=err)
@@ -126,11 +128,11 @@ def core(module):
is_upgraded = do_upgrade(module, image)
if started:
args = ['atomic', 'run', image]
args = [atomic_bin, 'run', image]
else:
args = ['atomic', 'install', image]
args = [atomic_bin, 'install', image]
elif state == 'absent':
args = ['atomic', 'uninstall', image]
args = [atomic_bin, 'uninstall', image]
rc, out, err = module.run_command(args, check_rc=False)
@@ -155,9 +157,7 @@ def main():
)
# Verify that the platform supports atomic command
rc, out, err = module.run_command('atomic -v', check_rc=False)
if rc != 0:
module.fail_json(msg="Error in running atomic command", err=err)
dummy = module.get_bin_path('atomic', required=True)
try:
core(module)

View File

@@ -260,7 +260,7 @@ class DimensionDataNetworkModule(DimensionDataModule):
)
self.module.fail_json(
"Unexpected failure deleting network with id %s", network.id
"Unexpected failure deleting network with id %s" % network.id
)
except DimensionDataAPIException as e:

View File

@@ -243,7 +243,6 @@ except ImportError:
HAS_OVIRTSDK = False
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.common.removed import removed_module
# ------------------------------------------------------------------- #

View File

@@ -1,7 +1,7 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: Tristan Le Guern (@Aversiste) <tleguern at bouledef.eu>
# Copyright: Tristan Le Guern (@tleguern) <tleguern at bouledef.eu>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
@@ -21,7 +21,7 @@ options:
- Restrict results to a specific authentication realm.
aliases: ['realm', 'name']
type: str
author: Tristan Le Guern (@Aversiste)
author: Tristan Le Guern (@tleguern)
extends_documentation_fragment: community.general.proxmox.documentation
'''

View File

@@ -21,7 +21,7 @@ options:
- Restrict results to a specific group.
aliases: ['groupid', 'name']
type: str
author: Tristan Le Guern (@Aversiste)
author: Tristan Le Guern (@tleguern)
extends_documentation_fragment: community.general.proxmox.documentation
'''

View File

@@ -30,7 +30,7 @@ options:
description:
- Restrict results to a specific user ID, which is a concatenation of a user and domain parts.
type: str
author: Tristan Le Guern (@Aversiste)
author: Tristan Le Guern (@tleguern)
extends_documentation_fragment: community.general.proxmox.documentation
'''

View File

@@ -1229,24 +1229,6 @@ class RHEV(object):
self.__get_conn()
return self.conn.set_VM_Host(vmname, vmhost)
# pylint: disable=unreachable
VM = self.conn.get_VM(vmname)
HOST = self.conn.get_Host(vmhost)
if VM.placement_policy.host is None:
self.conn.set_VM_Host(vmname, vmhost)
elif str(VM.placement_policy.host.id) != str(HOST.id):
self.conn.set_VM_Host(vmname, vmhost)
else:
setMsg("VM's startup host was already set to " + vmhost)
checkFail()
if str(VM.status.state) == "up":
self.conn.migrate_VM(vmname, vmhost)
checkFail()
return True
def setHost(self, hostname, cluster, ifaces):
self.__get_conn()
return self.conn.set_Host(hostname, cluster, ifaces)

View File

@@ -8,7 +8,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
DOCUMENTATION = r'''
---
module: terraform
short_description: Manages a Terraform deployment (and plans)
@@ -177,24 +177,31 @@ command:
import os
import json
import tempfile
from distutils.version import LooseVersion
from ansible.module_utils.six.moves import shlex_quote
from ansible.module_utils.basic import AnsibleModule
DESTROY_ARGS = ('destroy', '-no-color', '-force')
APPLY_ARGS = ('apply', '-no-color', '-input=false', '-auto-approve=true')
module = None
def preflight_validation(bin_path, project_path, variables_args=None, plan_file=None):
def get_version(bin_path):
extract_version = module.run_command([bin_path, 'version', '-json'])
terraform_version = (json.loads(extract_version[1]))['terraform_version']
return terraform_version
def preflight_validation(bin_path, project_path, version, variables_args=None, plan_file=None):
if project_path in [None, ''] or '/' not in project_path:
module.fail_json(msg="Path for Terraform project can not be None or ''.")
if not os.path.exists(bin_path):
module.fail_json(msg="Path for Terraform binary '{0}' doesn't exist on this host - check the path and try again please.".format(bin_path))
if not os.path.isdir(project_path):
module.fail_json(msg="Path for Terraform project '{0}' doesn't exist on this host - check the path and try again please.".format(project_path))
rc, out, err = module.run_command([bin_path, 'validate'] + variables_args, check_rc=True, cwd=project_path, use_unsafe_shell=True)
if LooseVersion(version) < LooseVersion('0.15.0'):
rc, out, err = module.run_command([bin_path, 'validate'] + variables_args, check_rc=True, cwd=project_path)
else:
rc, out, err = module.run_command([bin_path, 'validate'], check_rc=True, cwd=project_path)
def _state_args(state_file):
@@ -267,7 +274,7 @@ def build_plan(command, project_path, variables_args, state_file, targets, state
plan_command.extend(_state_args(state_file))
rc, out, err = module.run_command(plan_command + variables_args, cwd=project_path, use_unsafe_shell=True)
rc, out, err = module.run_command(plan_command + variables_args, cwd=project_path)
if rc == 0:
# no changes
@@ -326,6 +333,15 @@ def main():
else:
command = [module.get_bin_path('terraform', required=True)]
checked_version = get_version(command[0])
if LooseVersion(checked_version) < LooseVersion('0.15.0'):
DESTROY_ARGS = ('destroy', '-no-color', '-force')
APPLY_ARGS = ('apply', '-no-color', '-input=false', '-auto-approve=true')
else:
DESTROY_ARGS = ('destroy', '-no-color', '-auto-approve')
APPLY_ARGS = ('apply', '-no-color', '-input=false', '-auto-approve')
if force_init:
init_plugins(command[0], project_path, backend_config, backend_config_files, init_reconfigure)
@@ -351,7 +367,7 @@ def main():
for f in variables_files:
variables_args.extend(['-var-file', f])
preflight_validation(command[0], project_path, variables_args)
preflight_validation(command[0], project_path, checked_version, variables_args)
if module.params.get('lock') is not None:
if module.params.get('lock'):

View File

@@ -162,7 +162,6 @@ def waitForTaskDone(client, name, taskId, timeout):
currentTimeout -= 5
if currentTimeout < 0:
return False
return True
def main():

View File

@@ -111,7 +111,6 @@ ovirt_affinity_labels:
import fnmatch
import traceback
from ansible.module_utils.common.removed import removed_module
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils._ovirt import (
check_sdk,

View File

@@ -52,7 +52,6 @@ ovirt_api:
import traceback
from ansible.module_utils.common.removed import removed_module
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils._ovirt import (
check_sdk,

View File

@@ -73,7 +73,6 @@ ovirt_clusters:
import traceback
from ansible.module_utils.common.removed import removed_module
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils._ovirt import (
check_sdk,

View File

@@ -56,7 +56,6 @@ ovirt_datacenters:
import traceback
from ansible.module_utils.common.removed import removed_module
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils._ovirt import (
check_sdk,

View File

@@ -72,7 +72,6 @@ ovirt_disks:
import traceback
from ansible.module_utils.common.removed import removed_module
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils._ovirt import (
check_sdk,

View File

@@ -103,7 +103,6 @@ ovirt_events:
import traceback
from ansible.module_utils.common.removed import removed_module
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils._ovirt import (
check_sdk,

View File

@@ -87,7 +87,6 @@ ovirt_external_providers:
import fnmatch
import traceback
from ansible.module_utils.common.removed import removed_module
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils._ovirt import (
check_sdk,

View File

@@ -71,7 +71,6 @@ ovirt_groups:
import traceback
from ansible.module_utils.common.removed import removed_module
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils._ovirt import (
check_sdk,

View File

@@ -78,7 +78,6 @@ ovirt_hosts:
import traceback
from ansible.module_utils.common.removed import removed_module
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils._ovirt import (
check_sdk,

View File

@@ -92,7 +92,6 @@ try:
except ImportError:
pass
from ansible.module_utils.common.removed import removed_module
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils._ovirt import (
check_sdk,

View File

@@ -73,7 +73,6 @@ ovirt_networks:
import traceback
from ansible.module_utils.common.removed import removed_module
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils._ovirt import (
check_sdk,

View File

@@ -76,7 +76,6 @@ ovirt_nics:
import fnmatch
import traceback
from ansible.module_utils.common.removed import removed_module
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils._ovirt import (
check_sdk,

View File

@@ -88,7 +88,6 @@ try:
except ImportError:
pass
from ansible.module_utils.common.removed import removed_module
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils._ovirt import (
check_sdk,

View File

@@ -76,7 +76,6 @@ ovirt_quotas:
import fnmatch
import traceback
from ansible.module_utils.common.removed import removed_module
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils._ovirt import (
check_sdk,

View File

@@ -65,7 +65,6 @@ ovirt_snapshots:
import fnmatch
import traceback
from ansible.module_utils.common.removed import removed_module
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils._ovirt import (
check_sdk,

View File

@@ -74,7 +74,6 @@ ovirt_storage_domains:
import traceback
from ansible.module_utils.common.removed import removed_module
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils._ovirt import (
check_sdk,

View File

@@ -79,7 +79,6 @@ ovirt_storage_templates:
import traceback
from ansible.module_utils.common.removed import removed_module
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils._ovirt import (
check_sdk,

View File

@@ -79,7 +79,6 @@ ovirt_storage_vms:
import traceback
from ansible.module_utils.common.removed import removed_module
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils._ovirt import (
check_sdk,

View File

@@ -95,7 +95,6 @@ ovirt_tags:
import fnmatch
import traceback
from ansible.module_utils.common.removed import removed_module
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils._ovirt import (
check_sdk,

View File

@@ -72,7 +72,6 @@ ovirt_templates:
import traceback
from ansible.module_utils.common.removed import removed_module
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils._ovirt import (
check_sdk,

View File

@@ -71,7 +71,6 @@ ovirt_users:
import traceback
from ansible.module_utils.common.removed import removed_module
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils._ovirt import (
check_sdk,

View File

@@ -102,7 +102,6 @@ ovirt_vms:
import traceback
from ansible.module_utils.common.removed import removed_module
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils._ovirt import (
check_sdk,

View File

@@ -71,7 +71,6 @@ ovirt_vm_pools:
import traceback
from ansible.module_utils.common.removed import removed_module
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils._ovirt import (
check_sdk,

View File

@@ -119,20 +119,13 @@ class NicTag(object):
return is_mac(self.mac.lower())
def nictag_exists(self):
cmd = [self.nictagadm_bin]
cmd.append('exists')
cmd.append(self.name)
cmd = [self.nictagadm_bin, 'exists', self.name]
(rc, dummy, dummy) = self.module.run_command(cmd)
return rc == 0
def add_nictag(self):
cmd = [self.nictagadm_bin]
cmd.append('-v')
cmd.append('add')
cmd = [self.nictagadm_bin, '-v', 'add']
if self.etherstub:
cmd.append('-l')
@@ -150,10 +143,7 @@ class NicTag(object):
return self.module.run_command(cmd)
def delete_nictag(self):
cmd = [self.nictagadm_bin]
cmd.append('-v')
cmd.append('delete')
cmd = [self.nictagadm_bin, '-v', 'delete']
if self.force:
cmd.append('-f')

View File

@@ -71,10 +71,7 @@ class ImageFacts(object):
self.filters = module.params['filters']
def return_all_installed_images(self):
cmd = [self.module.get_bin_path('imgadm')]
cmd.append('list')
cmd.append('-j')
cmd = [self.module.get_bin_path('imgadm'), 'list', '-j']
if self.filters:
cmd.append(self.filters)

View File

@@ -233,7 +233,7 @@ options:
description:
- List of resolvers to be put into C(/etc/resolv.conf).
type: list
elements: dict
elements: str
routes:
required: false
description:
@@ -702,7 +702,7 @@ def main():
vnc_password=dict(type='str', no_log=True),
disks=dict(type='list', elements='dict'),
nics=dict(type='list', elements='dict'),
resolvers=dict(type='list', elements='dict'),
resolvers=dict(type='list', elements='str'),
filesystems=dict(type='list', elements='dict'),
)

View File

@@ -217,7 +217,7 @@ EXAMPLES = '''
datacenter: dal09
tags:
- ansible-module-test
- ansible-module-test-slaves
- ansible-module-test-replicas
hourly: yes
private: no
dedicated: no
@@ -235,7 +235,7 @@ EXAMPLES = '''
datacenter: dal09
tags:
- ansible-module-test
- ansible-module-test-slaves
- ansible-module-test-replicas
hourly: yes
private: no
dedicated: no

View File

@@ -36,13 +36,13 @@ seealso:
EXAMPLES = '''
- name: Get info for job awx
community.general.nomad_job:
community.general.nomad_job_info:
host: localhost
name: awx
register: result
- name: List Nomad jobs
community.general.nomad_job:
community.general.nomad_job_info:
host: localhost
register: result

View File

@@ -164,22 +164,20 @@ def install_plugin(module, plugin_bin, plugin_name, url, timeout, kibana_version
cmd_args = [plugin_bin, "plugin", PACKAGE_STATE_MAP["present"], plugin_name]
if url:
cmd_args.append("--url %s" % url)
cmd_args.extend(["--url", url])
if timeout:
cmd_args.append("--timeout %s" % timeout)
cmd = " ".join(cmd_args)
cmd_args.extend(["--timeout", timeout])
if module.check_mode:
return True, cmd, "check mode", ""
return True, " ".join(cmd_args), "check mode", ""
rc, out, err = module.run_command(cmd)
rc, out, err = module.run_command(cmd_args)
if rc != 0:
reason = parse_error(out)
module.fail_json(msg=reason)
return True, cmd, out, err
return True, " ".join(cmd_args), out, err
def remove_plugin(module, plugin_bin, plugin_name, kibana_version='4.6'):
@@ -189,23 +187,21 @@ def remove_plugin(module, plugin_bin, plugin_name, kibana_version='4.6'):
else:
cmd_args = [plugin_bin, "plugin", PACKAGE_STATE_MAP["absent"], plugin_name]
cmd = " ".join(cmd_args)
if module.check_mode:
return True, cmd, "check mode", ""
return True, " ".join(cmd_args), "check mode", ""
rc, out, err = module.run_command(cmd)
rc, out, err = module.run_command(cmd_args)
if rc != 0:
reason = parse_error(out)
module.fail_json(msg=reason)
return True, cmd, out, err
return True, " ".join(cmd_args), out, err
def get_kibana_version(module, plugin_bin):
cmd_args = [plugin_bin, '--version']
cmd = " ".join(cmd_args)
rc, out, err = module.run_command(cmd)
rc, out, err = module.run_command(cmd_args)
if rc != 0:
module.fail_json(msg="Failed to get Kibana version : %s" % err)
@@ -251,7 +247,7 @@ def main():
if state == "present":
if force:
remove_plugin(module, plugin_bin, name)
remove_plugin(module, plugin_bin, name, kibana_version)
changed, cmd, out, err = install_plugin(module, plugin_bin, name, url, timeout, kibana_version)
elif state == "absent":

View File

@@ -98,9 +98,8 @@ from ansible.module_utils._text import to_native
def get_xattr_keys(module, path, follow):
cmd = [module.get_bin_path('getfattr', True)]
# prevents warning and not sure why it's not default
cmd.append('--absolute-names')
cmd = [module.get_bin_path('getfattr', True), '--absolute-names']
if not follow:
cmd.append('-h')
cmd.append(path)
@@ -109,10 +108,8 @@ def get_xattr_keys(module, path, follow):
def get_xattr(module, path, key, follow):
cmd = [module.get_bin_path('getfattr', True), '--absolute-names']
cmd = [module.get_bin_path('getfattr', True)]
# prevents warning and not sure why it's not default
cmd.append('--absolute-names')
if not follow:
cmd.append('-h')
if key is None:

View File

@@ -63,7 +63,7 @@ EXAMPLES = r'''
- name: Changing Managing hosts list
community.general.ipa_service:
name: http/host01.example.com
host:
hosts:
- host01.example.com
- host02.example.com
ipa_host: ipa.example.com

View File

@@ -269,16 +269,18 @@ def get_user_diff(client, ipa_user, module_user):
def get_ssh_key_fingerprint(ssh_key, hash_algo='sha256'):
"""
Return the public key fingerprint of a given public SSH key
in format "[fp] [user@host] (ssh-rsa)" where fp is of the format:
in format "[fp] [comment] (ssh-rsa)" where fp is of the format:
FB:0C:AC:0A:07:94:5B:CE:75:6E:63:32:13:AD:AD:D7
for md5 or
SHA256:[base64]
for sha256
Comments are assumed to be all characters past the second
whitespace character in the sshpubkey string.
:param ssh_key:
:param hash_algo:
:return:
"""
parts = ssh_key.strip().split()
parts = ssh_key.strip().split(None, 2)
if len(parts) == 0:
return None
key_type = parts[0]
@@ -293,8 +295,8 @@ def get_ssh_key_fingerprint(ssh_key, hash_algo='sha256'):
if len(parts) < 3:
return "%s (%s)" % (key_fp, key_type)
else:
user_host = parts[2]
return "%s %s (%s)" % (key_fp, user_host, key_type)
comment = parts[2]
return "%s %s (%s)" % (key_fp, comment, key_type)
def ensure(module, client):

View File

@@ -367,10 +367,9 @@ class HAProxy(object):
# We can assume there will only be 1 element in state because both svname and pxname are always set when we get here
# When using track we get a status like this: MAINT (via pxname/svname) so we need to do substring matching
if status in state[0]['status']:
if not self._drain or (state[0]['scur'] == '0' and 'MAINT' in state):
if not self._drain or state[0]['scur'] == '0':
return True
else:
time.sleep(self.wait_interval)
time.sleep(self.wait_interval)
self.module.fail_json(msg="server %s/%s not status '%s' after %d retries. Aborting." %
(pxname, svname, status, self.wait_retries))
@@ -409,15 +408,17 @@ class HAProxy(object):
def drain(self, host, backend, status='DRAIN'):
"""
Drain action, sets the server to DRAIN mode.
In this mode mode, the server will not accept any new connections
In this mode, the server will not accept any new connections
other than those that are accepted via persistence.
"""
haproxy_version = self.discover_version()
# check if haproxy version suppots DRAIN state (starting with 1.5)
# check if haproxy version supports DRAIN state (starting with 1.5)
if haproxy_version and (1, 5) <= haproxy_version:
cmd = "set server $pxname/$svname state drain"
self.execute_for_backends(cmd, backend, host, status)
self.execute_for_backends(cmd, backend, host, "DRAIN")
if status == "MAINT":
self.disabled(host, backend, self.shutdown_sessions)
def act(self):
"""
@@ -426,7 +427,7 @@ class HAProxy(object):
# Get the state before the run
self.command_results['state_before'] = self.get_state_for(self.backend, self.host)
# toggle enable/disbale server
# toggle enable/disable server
if self.state == 'enabled':
self.enabled(self.host, self.backend, self.weight)
elif self.state == 'disabled' and self._drain:

View File

@@ -205,9 +205,11 @@ class ResourceRecord(object):
def list_record(self, record):
# check if the record exists via list on ipwcli
search = 'list %s' % (record.replace(';', '&&').replace('set', 'where'))
cmd = [self.module.get_bin_path('ipwcli', True)]
cmd.append('-user=%s' % (self.user))
cmd.append('-password=%s' % (self.password))
cmd = [
self.module.get_bin_path('ipwcli', True),
'-user=%s' % self.user,
'-password=%s' % self.password,
]
rc, out, err = self.module.run_command(cmd, data=search)
if 'Invalid username or password' in out:
@@ -222,9 +224,11 @@ class ResourceRecord(object):
def deploy_record(self, record):
# check what happens if create fails on ipworks
stdin = 'create %s' % (record)
cmd = [self.module.get_bin_path('ipwcli', True)]
cmd.append('-user=%s' % (self.user))
cmd.append('-password=%s' % (self.password))
cmd = [
self.module.get_bin_path('ipwcli', True),
'-user=%s' % self.user,
'-password=%s' % self.password,
]
rc, out, err = self.module.run_command(cmd, data=stdin)
if 'Invalid username or password' in out:
@@ -238,9 +242,11 @@ class ResourceRecord(object):
def delete_record(self, record):
# check what happens if create fails on ipworks
stdin = 'delete %s' % (record.replace(';', '&&').replace('set', 'where'))
cmd = [self.module.get_bin_path('ipwcli', True)]
cmd.append('-user=%s' % (self.user))
cmd.append('-password=%s' % (self.password))
cmd = [
self.module.get_bin_path('ipwcli', True),
'-user=%s' % self.user,
'-password=%s' % self.password,
]
rc, out, err = self.module.run_command(cmd, data=stdin)
if 'Invalid username or password' in out:

View File

@@ -130,7 +130,7 @@ def packages_not_latest(module, names, site, update_catalog):
cmd.append('-U')
cmd.append('-c')
if site is not None:
cmd.extend('-t', site)
cmd.extend(['-t', site])
if names != ['*']:
cmd.extend(names)
rc, out, err = run_command(module, cmd)
@@ -159,7 +159,7 @@ def package_install(module, state, pkgs, site, update_catalog, force):
if update_catalog:
cmd.append('-U')
if site is not None:
cmd.extend('-t', site)
cmd.extend(['-t', site])
if force:
cmd.append('-f')
cmd.extend(pkgs)
@@ -174,7 +174,7 @@ def package_upgrade(module, pkgs, site, update_catalog, force):
if update_catalog:
cmd.append('-U')
if site is not None:
cmd.extend('-t', site)
cmd.extend(['-t', site])
if force:
cmd.append('-f')
cmd += pkgs

View File

@@ -16,6 +16,7 @@ author: "Joe Adams (@sysadmind)"
short_description: Add or remove Pulp repos from a remote host.
description:
- Add or remove Pulp repos from a remote host.
- Note, this is for Pulp 2 only.
options:
add_export_distributor:
description:

View File

@@ -108,8 +108,7 @@ from ansible.module_utils.basic import AnsibleModule
def package_installed(module, name, category):
cmd = [module.get_bin_path('pkginfo', True)]
cmd.append('-q')
cmd = [module.get_bin_path('pkginfo', True), '-q']
if category:
cmd.append('-c')
cmd.append(name)

View File

@@ -336,7 +336,7 @@ def get_cmd(m, subcommand):
"puts together the basic zypper command arguments with those passed to the module"
is_install = subcommand in ['install', 'update', 'patch', 'dist-upgrade']
is_refresh = subcommand == 'refresh'
cmd = ['/usr/bin/zypper', '--quiet', '--non-interactive', '--xmlout']
cmd = [m.get_bin_path('zypper', required=True), '--quiet', '--non-interactive', '--xmlout']
if m.params['extra_args_precommand']:
args_list = m.params['extra_args_precommand'].split()
cmd.extend(args_list)

View File

@@ -141,9 +141,9 @@ from ansible.module_utils.basic import AnsibleModule, missing_required_lib
REPO_OPTS = ['alias', 'name', 'priority', 'enabled', 'autorefresh', 'gpgcheck']
def _get_cmd(*args):
def _get_cmd(module, *args):
"""Combines the non-interactive zypper command with arguments/subcommands"""
cmd = ['/usr/bin/zypper', '--quiet', '--non-interactive']
cmd = [module.get_bin_path('zypper', required=True), '--quiet', '--non-interactive']
cmd.extend(args)
return cmd
@@ -151,7 +151,7 @@ def _get_cmd(*args):
def _parse_repos(module):
"""parses the output of zypper --xmlout repos and return a parse repo dictionary"""
cmd = _get_cmd('--xmlout', 'repos')
cmd = _get_cmd(module, '--xmlout', 'repos')
if not HAS_XML:
module.fail_json(msg=missing_required_lib("python-xml"), exception=XML_IMP_ERR)
@@ -230,7 +230,7 @@ def repo_exists(module, repodata, overwrite_multiple):
def addmodify_repo(module, repodata, old_repos, zypper_version, warnings):
"Adds the repo, removes old repos before, that would conflict."
repo = repodata['url']
cmd = _get_cmd('addrepo', '--check')
cmd = _get_cmd(module, 'addrepo', '--check')
if repodata['name']:
cmd.extend(['--name', repodata['name']])
@@ -274,14 +274,14 @@ def addmodify_repo(module, repodata, old_repos, zypper_version, warnings):
def remove_repo(module, repo):
"Removes the repo."
cmd = _get_cmd('removerepo', repo)
cmd = _get_cmd(module, 'removerepo', repo)
rc, stdout, stderr = module.run_command(cmd, check_rc=True)
return rc, stdout, stderr
def get_zypper_version(module):
rc, stdout, stderr = module.run_command(['/usr/bin/zypper', '--version'])
rc, stdout, stderr = module.run_command([module.get_bin_path('zypper', required=True), '--version'])
if rc != 0 or not stdout.startswith('zypper '):
return LooseVersion('1.0')
return LooseVersion(stdout.split()[1])
@@ -290,9 +290,9 @@ def get_zypper_version(module):
def runrefreshrepo(module, auto_import_keys=False, shortname=None):
"Forces zypper to refresh repo metadata."
if auto_import_keys:
cmd = _get_cmd('--gpg-auto-import-keys', 'refresh', '--force')
cmd = _get_cmd(module, '--gpg-auto-import-keys', 'refresh', '--force')
else:
cmd = _get_cmd('refresh', '--force')
cmd = _get_cmd(module, 'refresh', '--force')
if shortname is not None:
cmd.extend(['-r', shortname])

View File

@@ -24,6 +24,7 @@ options:
name:
description:
- Data Center name.
type: str
options:
description:
- "Retrieve additional information. Options available: 'visualContent'."

View File

@@ -24,6 +24,7 @@ options:
name:
description:
- Enclosure name.
type: str
options:
description:
- "List with options to gather additional information about an Enclosure and related resources.

View File

@@ -24,11 +24,13 @@ options:
- C(present) will ensure data properties are compliant with OneView.
- C(absent) will remove the resource from OneView, if it exists.
- C(default_bandwidth_reset) will reset the network connection template to the default.
type: str
default: present
choices: [present, absent, default_bandwidth_reset]
data:
description:
- List with Ethernet Network properties.
type: dict
required: true
extends_documentation_fragment:
- community.general.oneview

View File

@@ -23,6 +23,7 @@ options:
name:
description:
- Ethernet Network name.
type: str
options:
description:
- "List with options to gather additional information about an Ethernet Network and related resources.

View File

@@ -20,11 +20,13 @@ options:
- Indicates the desired state for the Fibre Channel Network resource.
C(present) will ensure data properties are compliant with OneView.
C(absent) will remove the resource from OneView, if it exists.
type: str
choices: ['present', 'absent']
required: true
data:
description:
- List with the Fibre Channel Network properties.
type: dict
required: true
extends_documentation_fragment:

View File

@@ -23,6 +23,7 @@ options:
name:
description:
- Fibre Channel Network name.
type: str
extends_documentation_fragment:
- community.general.oneview

View File

@@ -21,11 +21,13 @@ options:
- Indicates the desired state for the FCoE Network resource.
C(present) will ensure data properties are compliant with OneView.
C(absent) will remove the resource from OneView, if it exists.
type: str
default: present
choices: ['present', 'absent']
data:
description:
- List with FCoE Network properties.
type: dict
required: true
extends_documentation_fragment:

View File

@@ -23,6 +23,7 @@ options:
name:
description:
- FCoE Network name.
type: str
extends_documentation_fragment:
- community.general.oneview
- community.general.oneview.factsparams

View File

@@ -24,11 +24,13 @@ options:
- Indicates the desired state for the Logical Interconnect Group resource.
C(absent) will remove the resource from OneView, if it exists.
C(present) will ensure data properties are compliant with OneView.
type: str
choices: [absent, present]
default: present
data:
description:
- List with the Logical Interconnect Group properties.
type: dict
required: true
extends_documentation_fragment:
- community.general.oneview

View File

@@ -24,6 +24,7 @@ options:
name:
description:
- Logical Interconnect Group name.
type: str
extends_documentation_fragment:
- community.general.oneview
- community.general.oneview.factsparams

View File

@@ -23,11 +23,13 @@ options:
- Indicates the desired state for the Network Set resource.
- C(present) will ensure data properties are compliant with OneView.
- C(absent) will remove the resource from OneView, if it exists.
type: str
default: present
choices: ['present', 'absent']
data:
description:
- List with the Network Set properties.
type: dict
required: true
extends_documentation_fragment:

View File

@@ -23,6 +23,7 @@ options:
name:
description:
- Network Set name.
type: str
options:
description:

View File

@@ -24,12 +24,14 @@ options:
- C(present) ensures data properties are compliant with OneView.
- C(absent) removes the resource from OneView, if it exists.
- C(connection_information_set) updates the connection information for the SAN Manager. This operation is non-idempotent.
type: str
default: present
choices: [present, absent, connection_information_set]
data:
description:
- List with SAN Manager properties.
required: true
description:
- List with SAN Manager properties.
type: dict
required: true
extends_documentation_fragment:
- community.general.oneview

View File

@@ -23,6 +23,7 @@ options:
provider_display_name:
description:
- Provider Display Name.
type: str
params:
description:
- List of params to delimit, filter and sort the list of resources.
@@ -31,6 +32,7 @@ options:
- C(count): The number of resources to return.
- C(query): A general query string to narrow the list of resources returned.
- C(sort): The sort order of the returned data set."
type: dict
extends_documentation_fragment:
- community.general.oneview

View File

@@ -149,8 +149,6 @@ def get_existing_pipeline_variable(module, bitbucket):
var['name'] = var.pop('key')
return var
return None
def create_pipeline_variable(module, bitbucket):
info, content = bitbucket.request(

View File

@@ -175,10 +175,7 @@ class ZFSFacts(object):
self.facts = []
def dataset_exists(self):
cmd = [self.module.get_bin_path('zfs')]
cmd.append('list')
cmd.append(self.name)
cmd = [self.module.get_bin_path('zfs'), 'list', self.name]
(rc, out, err) = self.module.run_command(cmd)
@@ -188,10 +185,7 @@ class ZFSFacts(object):
return False
def get_facts(self):
cmd = [self.module.get_bin_path('zfs')]
cmd.append('get')
cmd.append('-H')
cmd = [self.module.get_bin_path('zfs'), 'get', '-H']
if self.parsable:
cmd.append('-p')
if self.recurse:
@@ -202,10 +196,7 @@ class ZFSFacts(object):
if self.type:
cmd.append('-t')
cmd.append(self.type)
cmd.append('-o')
cmd.append('name,property,value')
cmd.append(self.properties)
cmd.append(self.name)
cmd.extend(['-o', 'name,property,value', self.properties, self.name])
(rc, out, err) = self.module.run_command(cmd)

View File

@@ -134,10 +134,7 @@ class ZPoolFacts(object):
self.facts = []
def pool_exists(self):
cmd = [self.module.get_bin_path('zpool')]
cmd.append('list')
cmd.append(self.name)
cmd = [self.module.get_bin_path('zpool'), 'list', self.name]
(rc, out, err) = self.module.run_command(cmd)
@@ -147,10 +144,7 @@ class ZPoolFacts(object):
return False
def get_facts(self):
cmd = [self.module.get_bin_path('zpool')]
cmd.append('get')
cmd.append('-H')
cmd = [self.module.get_bin_path('zpool'), 'get', '-H']
if self.parsable:
cmd.append('-p')
cmd.append('-o')

View File

@@ -154,9 +154,7 @@ class BE(object):
self.is_freebsd = os.uname()[0] == 'FreeBSD'
def _beadm_list(self):
cmd = [self.module.get_bin_path('beadm')]
cmd.append('list')
cmd.append('-H')
cmd = [self.module.get_bin_path('beadm'), 'list', '-H']
if '@' in self.name:
cmd.append('-s')
return self.module.run_command(cmd)
@@ -218,42 +216,26 @@ class BE(object):
return False
def activate_be(self):
cmd = [self.module.get_bin_path('beadm')]
cmd.append('activate')
cmd.append(self.name)
cmd = [self.module.get_bin_path('beadm'), 'activate', self.name]
return self.module.run_command(cmd)
def create_be(self):
cmd = [self.module.get_bin_path('beadm')]
cmd.append('create')
cmd = [self.module.get_bin_path('beadm'), 'create']
if self.snapshot:
cmd.append('-e')
cmd.append(self.snapshot)
cmd.extend(['-e', self.snapshot])
if not self.is_freebsd:
if self.description:
cmd.append('-d')
cmd.append(self.description)
cmd.extend(['-d', self.description])
if self.options:
cmd.append('-o')
cmd.append(self.options)
cmd.extend(['-o', self.options])
cmd.append(self.name)
return self.module.run_command(cmd)
def destroy_be(self):
cmd = [self.module.get_bin_path('beadm')]
cmd.append('destroy')
cmd.append('-F')
cmd.append(self.name)
cmd = [self.module.get_bin_path('beadm'), 'destroy', '-F', self.name]
return self.module.run_command(cmd)
def is_mounted(self):
@@ -276,10 +258,7 @@ class BE(object):
return False
def mount_be(self):
cmd = [self.module.get_bin_path('beadm')]
cmd.append('mount')
cmd.append(self.name)
cmd = [self.module.get_bin_path('beadm'), 'mount', self.name]
if self.mountpoint:
cmd.append(self.mountpoint)
@@ -287,9 +266,7 @@ class BE(object):
return self.module.run_command(cmd)
def unmount_be(self):
cmd = [self.module.get_bin_path('beadm')]
cmd.append('unmount')
cmd = [self.module.get_bin_path('beadm'), 'unmount']
if self.force:
cmd.append('-f')
cmd.append(self.name)

View File

@@ -114,13 +114,15 @@ cmd:
description: Executed command to get action done
returned: changed and failure
type: str
sample: "openssl x509 -noout -in /tmp/cert.crt -fingerprint -sha256"
sample: "/usr/bin/openssl x509 -noout -in /tmp/user/1000/tmp8jd_lh23 -fingerprint -sha256"
'''
from ansible.module_utils.basic import AnsibleModule
import os
import re
import tempfile
from ansible.module_utils.basic import AnsibleModule
def read_certificate_fingerprint(module, openssl_bin, certificate_path):
@@ -129,59 +131,70 @@ def read_certificate_fingerprint(module, openssl_bin, certificate_path):
if rc != 0:
return module.fail_json(msg=current_certificate_fingerprint_out,
err=current_certificate_fingerprint_err,
rc=rc,
cmd=current_certificate_fingerprint_cmd)
cmd=current_certificate_fingerprint_cmd,
rc=rc)
current_certificate_match = re.search(r"=([\w:]+)", current_certificate_fingerprint_out)
if not current_certificate_match:
return module.fail_json(
msg="Unable to find the current certificate fingerprint in %s" % current_certificate_fingerprint_out,
rc=rc,
cmd=current_certificate_fingerprint_err
)
return module.fail_json(msg="Unable to find the current certificate fingerprint in %s" % current_certificate_fingerprint_out,
cmd=current_certificate_fingerprint_cmd,
rc=rc)
return current_certificate_match.group(1)
def read_stored_certificate_fingerprint(module, keytool_bin, alias, keystore_path, keystore_password):
stored_certificate_fingerprint_cmd = [keytool_bin, "-list", "-alias", alias, "-keystore", keystore_path, "-storepass", keystore_password, "-v"]
(rc, stored_certificate_fingerprint_out, stored_certificate_fingerprint_err) = run_commands(module, stored_certificate_fingerprint_cmd)
stored_certificate_fingerprint_cmd = [keytool_bin, "-list", "-alias", alias, "-keystore", keystore_path, "-storepass:env", "STOREPASS", "-v"]
(rc, stored_certificate_fingerprint_out, stored_certificate_fingerprint_err) = run_commands(
module, stored_certificate_fingerprint_cmd, environ_update=dict(STOREPASS=keystore_password))
if rc != 0:
if "keytool error: java.lang.Exception: Alias <%s> does not exist" % alias not in stored_certificate_fingerprint_out:
return module.fail_json(msg=stored_certificate_fingerprint_out,
err=stored_certificate_fingerprint_err,
rc=rc,
cmd=stored_certificate_fingerprint_cmd)
else:
return None
else:
stored_certificate_match = re.search(r"SHA256: ([\w:]+)", stored_certificate_fingerprint_out)
if not stored_certificate_match:
return module.fail_json(
msg="Unable to find the stored certificate fingerprint in %s" % stored_certificate_fingerprint_out,
rc=rc,
cmd=stored_certificate_fingerprint_cmd
)
# First intention was to not fail, and overwrite the keystore instead,
# in case of alias mismatch; but an issue in error handling caused the
# module to fail anyway.
# See: https://github.com/ansible-collections/community.general/issues/1671
# And: https://github.com/ansible-collections/community.general/pull/2183
# if "keytool error: java.lang.Exception: Alias <%s> does not exist" % alias in stored_certificate_fingerprint_out:
# return "alias mismatch"
# if re.match(r'keytool error: java\.io\.IOException: [Kk]eystore( was tampered with, or)? password was incorrect',
# stored_certificate_fingerprint_out):
# return "password mismatch"
return module.fail_json(msg=stored_certificate_fingerprint_out,
err=stored_certificate_fingerprint_err,
cmd=stored_certificate_fingerprint_cmd,
rc=rc)
return stored_certificate_match.group(1)
stored_certificate_match = re.search(r"SHA256: ([\w:]+)", stored_certificate_fingerprint_out)
if not stored_certificate_match:
return module.fail_json(msg="Unable to find the stored certificate fingerprint in %s" % stored_certificate_fingerprint_out,
cmd=stored_certificate_fingerprint_cmd,
rc=rc)
return stored_certificate_match.group(1)
def run_commands(module, cmd, data=None, check_rc=True):
return module.run_command(cmd, check_rc=check_rc, data=data)
def run_commands(module, cmd, data=None, environ_update=None, check_rc=False):
return module.run_command(cmd, check_rc=check_rc, data=data, environ_update=environ_update)
def create_file(path, content):
with open(path, 'w') as f:
def create_path():
dummy, tmpfile = tempfile.mkstemp()
os.remove(tmpfile)
return tmpfile
def create_file(content):
tmpfd, tmpfile = tempfile.mkstemp()
with os.fdopen(tmpfd, 'w') as f:
f.write(content)
return path
return tmpfile
def create_tmp_certificate(module):
return create_file("/tmp/%s.crt" % module.params['name'], module.params['certificate'])
return create_file(module.params['certificate'])
def create_tmp_private_key(module):
return create_file("/tmp/%s.key" % module.params['name'], module.params['private_key'])
return create_file(module.params['private_key'])
def cert_changed(module, openssl_bin, keytool_bin, keystore_path, keystore_pass, alias):
@@ -196,59 +209,57 @@ def cert_changed(module, openssl_bin, keytool_bin, keystore_path, keystore_pass,
def create_jks(module, name, openssl_bin, keytool_bin, keystore_path, password, keypass):
if module.check_mode:
module.exit_json(changed=True)
else:
certificate_path = create_tmp_certificate(module)
private_key_path = create_tmp_private_key(module)
try:
if os.path.exists(keystore_path):
os.remove(keystore_path)
return module.exit_json(changed=True)
keystore_p12_path = "/tmp/keystore.p12"
if os.path.exists(keystore_p12_path):
os.remove(keystore_p12_path)
certificate_path = create_tmp_certificate(module)
private_key_path = create_tmp_private_key(module)
keystore_p12_path = create_path()
try:
if os.path.exists(keystore_path):
os.remove(keystore_path)
export_p12_cmd = [openssl_bin, "pkcs12", "-export", "-name", name, "-in", certificate_path,
"-inkey", private_key_path, "-out",
keystore_p12_path, "-passout", "stdin"]
export_p12_cmd = [openssl_bin, "pkcs12", "-export", "-name", name, "-in", certificate_path,
"-inkey", private_key_path, "-out", keystore_p12_path, "-passout", "stdin"]
# when keypass is provided, add -passin
cmd_stdin = ""
if keypass:
export_p12_cmd.append("-passin")
export_p12_cmd.append("stdin")
cmd_stdin = "%s\n" % keypass
# when keypass is provided, add -passin
cmd_stdin = ""
if keypass:
export_p12_cmd.append("-passin")
export_p12_cmd.append("stdin")
cmd_stdin = "%s\n" % keypass
cmd_stdin += "%s\n%s" % (password, password)
cmd_stdin += "%s\n%s" % (password, password)
(rc, export_p12_out, export_p12_err) = run_commands(module, export_p12_cmd, data=cmd_stdin)
if rc != 0:
return module.fail_json(msg=export_p12_out,
rc=rc,
cmd=export_p12_cmd)
(rc, export_p12_out, dummy) = run_commands(module, export_p12_cmd, data=cmd_stdin)
if rc != 0:
return module.fail_json(msg=export_p12_out,
cmd=export_p12_cmd,
rc=rc)
import_keystore_cmd = [keytool_bin, "-importkeystore",
"-destkeystore", keystore_path,
"-srckeystore", keystore_p12_path,
"-srcstoretype", "pkcs12",
"-alias", name,
"-deststorepass", password,
"-srcstorepass", password,
"-noprompt"]
(rc, import_keystore_out, import_keystore_err) = run_commands(module, import_keystore_cmd, data=None)
if rc == 0:
update_jks_perm(module, keystore_path)
return module.exit_json(changed=True,
msg=import_keystore_out,
rc=rc,
cmd=import_keystore_cmd,
stdout_lines=import_keystore_out)
else:
return module.fail_json(msg=import_keystore_out,
rc=rc,
cmd=import_keystore_cmd)
finally:
os.remove(certificate_path)
os.remove(private_key_path)
import_keystore_cmd = [keytool_bin, "-importkeystore",
"-destkeystore", keystore_path,
"-srckeystore", keystore_p12_path,
"-srcstoretype", "pkcs12",
"-alias", name,
"-deststorepass:env", "STOREPASS",
"-srcstorepass:env", "STOREPASS",
"-noprompt"]
(rc, import_keystore_out, dummy) = run_commands(module, import_keystore_cmd, data=None,
environ_update=dict(STOREPASS=password))
if rc != 0:
return module.fail_json(msg=import_keystore_out,
cmd=import_keystore_cmd,
rc=rc)
update_jks_perm(module, keystore_path)
return module.exit_json(changed=True,
msg=import_keystore_out,
cmd=import_keystore_cmd,
rc=rc)
finally:
os.remove(certificate_path)
os.remove(private_key_path)
os.remove(keystore_p12_path)
def update_jks_perm(module, keystore_path):
@@ -280,7 +291,7 @@ def process_jks(module):
else:
if not module.check_mode:
update_jks_perm(module, keystore_path)
return module.exit_json(changed=False)
module.exit_json(changed=False)
else:
create_jks(module, name, openssl_bin, keytool_bin, keystore_path, password, keypass)
@@ -308,6 +319,7 @@ def main():
add_file_common_args=spec.add_file_common_args,
supports_check_mode=spec.supports_check_mode
)
module.run_command_environ_update = dict(LANG='C', LC_ALL='C', LC_MESSAGES='C')
process_jks(module)

View File

@@ -219,8 +219,9 @@ class XFConfProperty(CmdMixin, StateMixin, ModuleHelper):
self.update_xfconf_output(value=self.vars.value)
def state_absent(self):
if not self.module.check_mode:
self.run_command(params=('channel', 'property', 'reset'), extra_params={"reset": True})
self.vars.value = None
self.run_command(params=('channel', 'property', 'reset'), extra_params={"reset": True})
self.update_xfconf_output(previous_value=self.vars.previous_value,
value=None)

View File

@@ -276,6 +276,7 @@ from ansible.module_utils.six import text_type, binary_type
from ansible.module_utils._text import to_native
import base64
import hashlib
import io
import json
import os
import tempfile
@@ -560,7 +561,7 @@ class JenkinsPlugin(object):
# Open the updates file
try:
f = open(updates_file, encoding='utf-8')
f = io.open(updates_file, encoding='utf-8')
except IOError as e:
self.module.fail_json(
msg="Cannot open temporal updates file.",

View File

@@ -1,43 +0,0 @@
language: python
env:
matrix:
- T=none
matrix:
exclude:
- env: T=none
include:
- env: T=devel/sanity/1
- env: T=devel/sanity/2
- env: T=devel/sanity/3
- env: T=devel/sanity/4
- env: T=2.10/sanity/1
- env: T=2.10/sanity/2
- env: T=2.10/sanity/3
- env: T=2.10/sanity/4
- env: T=2.9/sanity/1
- env: T=2.9/sanity/2
- env: T=2.9/sanity/3
- env: T=2.9/sanity/4
branches:
except:
- "*-patch-*"
- "revert-*-*"
- "patchback/backports/*"
build:
ci:
- tests/utils/shippable/timing.sh tests/utils/shippable/shippable.sh $T
integrations:
notifications:
- integrationName: email
type: email
on_success: never
on_failure: never
on_start: never
on_pull_request: never

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 == ''

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