Compare commits

...

76 Commits
3.8.0 ... 3.8.4

Author SHA1 Message Date
Felix Fontein
f7276b152b Release 3.8.4. 2022-01-11 06:41:56 +01:00
Felix Fontein
5e503bfcc7 Prepare 3.8.4 release. 2022-01-10 23:06:20 +01:00
patchback[bot]
d2b4151b7a fix alternatives parsing when they are part of a group (#3976) (#4020)
* fix alternatives parsing when they are part of a group

* add changelog fragment

Co-authored-by: Guillaume Rousse <guillaume.rousse@renater.fr>
(cherry picked from commit a675afcba9)

Co-authored-by: Guillaume Rousse <guillomovitch@gmail.com>
2022-01-10 07:27:12 +01:00
patchback[bot]
57b73e0d5e Fix example code for flattened lookup (#4013) (#4015)
Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
(cherry picked from commit d19ab93faf)

Co-authored-by: Lee Garrett <leegarrett@users.noreply.github.com>
2022-01-09 12:29:19 +01:00
patchback[bot]
5f47d47f27 Restrict PyNaCL to 1.4.x on RHEL8 when using Python 3.6 (#4006) (#4009)
* Restrict PyNaCL to 1.4.x on RHEL8 when using Python 3.6.

* Fix typo.

(cherry picked from commit 77a930cf6b)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-01-08 15:07:00 +01:00
patchback[bot]
7e2f20f482 Fix 2.9 unit tests (#4002) (#4004)
* Fix 2.9 unit tests.

* Another try.

(cherry picked from commit 26a91e811f)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-01-08 12:40:05 +01:00
patchback[bot]
3023312334 Fix comment. (#3993) (#3994)
(cherry picked from commit a6a8cd02b6)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-01-06 15:10:46 +01:00
Felix Fontein
fe3de232f0 Fix BOTMETA and corresponding sanity test (#3989) (#3991)
* Fix BOTMETA and authors mistakes.

* Fix BOTMETA sanity test regex.

(cherry picked from commit 11205eefee)
2022-01-06 06:56:10 +01:00
patchback[bot]
2024dc37af Use vendored copy of distutils.version. (#3984) (#3986)
(cherry picked from commit cf7a33356c)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-01-05 22:05:06 +01:00
Felix Fontein
b8469a5c28 Re-enable snap tests (#3967) (#3982)
* Re-enable snap tests.

* Skip tests on RHEL 8.2 and 8.3.

* Refactor snap setup.

* Try to simplify setup.

(cherry picked from commit bb78d98f8f)
2022-01-05 18:12:03 +01:00
patchback[bot]
2a0ec9c572 Get rid of distutils.spawn and distutils.util (#3934) (#3973)
* Replace distutils.spawn.find_executable.

* Replace distutils.util.strtobool.

(cherry picked from commit 77b7b4f75b)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-01-04 07:27:02 +01:00
patchback[bot]
fa92f8efb0 slack - use UTF-8 charset in content-type header (#3933) (#3970)
* Use UTF-8 charset in content-type header

* Add changelog fragment

(cherry picked from commit a4ab85fd68)

Co-authored-by: bluikko <14869000+bluikko@users.noreply.github.com>
2022-01-03 19:43:47 +01:00
patchback[bot]
03e068e298 Restrict redis to < 4.1.0 for ansible-base 2.10. (#3955) (#3958)
(cherry picked from commit 3f2364574d)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-12-27 21:17:06 +01:00
patchback[bot]
8f084ac065 fix scaleway_user_data (#3940) (#3953)
* fix  scaleway_user_data

scaleway_user_data put cloud-init valuer with 2 unexpected " (begin and end of value)

If Content-Type is not change , it's jsonify ( file module_utils/scaleway.py ligne 131 )

fix the probleme  when "Content-Type" is used instead of "Content-type"

* Create 3940_fix_contenttype_scaleway_user_data.yml

* Update changelogs/fragments/3940_fix_contenttype_scaleway_user_data.yml

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

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

Co-authored-by: pmangin <96626847+pmangin@users.noreply.github.com>
2021-12-27 19:55:43 +01:00
Felix Fontein
e02568d28a Prepare for distutils.version being removed in Python 3.12 (#3936) (#3942)
* Prepare for distutils.version being removed in Python 2.12.

* Fix copy'n'paste error.

* Re-add Loose prefix.

* Fix Python version typos.

* Improve formulation.

* Move message into own line.

* Fix casing, now that the object is no longer called Version.

(cherry picked from commit a2f72be6c8)
2021-12-24 19:15:51 +01:00
patchback[bot]
73580d09e0 Fix filesystem tests (so they run on their own) (#3937) (#3938)
* Don't use loops for installing packages.

* Install util-linux-systemd on OpenSuSE so that findmnt is around.

(cherry picked from commit f34c454412)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-12-23 12:38:22 +01:00
Felix Fontein
093036a2ae Disable snap tests. (#3922) (#3924)
(cherry picked from commit 51838adf8c)
2021-12-20 10:59:11 +01:00
patchback[bot]
7f1de4869e Fix nrdp string arguments without an encoding (#3909) (#3911)
* Fix nrdp string arguments without an encoding

* added changelog fragment

Signed-off-by: Jesse Harris <zigford@gmail.com>

* Update changelogs/fragments/3909-nrdp_fix_string_args_without_encoding.yaml

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

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

Co-authored-by: Jesse Harris <zigford@gmail.com>
2021-12-17 22:13:50 +01:00
patchback[bot]
8df1b93531 jira - fixed 'body' dict key error (#3867) (#3913)
* fixed

* added changelog fragment

* improved fail output when placing JIRA API requests

* Update plugins/modules/web_infrastructure/jira.py

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

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

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-12-17 22:13:21 +01:00
Felix Fontein
c055ea2bcc Next expected release is 3.8.4. 2021-12-14 07:57:25 +01:00
Felix Fontein
27c094a095 Release 3.8.3. 2021-12-14 07:06:14 +01:00
patchback[bot]
86a5b4f28c proxmox - fixing onboot parameter causing module failure when not defined (#3874) (#3901)
* fixing onboot parameter when not supplied

* adding changelog fragment

(cherry picked from commit 00a1152bb1)

Co-authored-by: Andrew Pantuso <ajpantuso@gmail.com>
2021-12-14 07:00:27 +01:00
patchback[bot]
4e14c429c7 Pass missing vlan-related options (flags, ingress, egress) to nmcli (#3896) (#3898)
* Pass missing vlan-related options (flags, ingress, egress) to nmcli

Signed-off-by: Jean-Francois Panisset <panisset@gmail.com>

* Follow style: comma on last parameter

Signed-off-by: Jean-Francois Panisset <panisset@gmail.com>

* PEP8 code style fix

Signed-off-by: Jean-Francois Panisset <panisset@gmail.com>

* add missing changelog fragment

Signed-off-by: Jean-Francois Panisset <panisset@gmail.com>
(cherry picked from commit 6cec2e2f58)

Co-authored-by: Jean-Francois Panisset <32653482+jfpanisset@users.noreply.github.com>
2021-12-13 21:59:32 +01:00
Felix Fontein
c34fb01462 Docs improvements. (#3893) (#3895)
(cherry picked from commit 59bbaeed77)
2021-12-12 11:46:34 +01:00
patchback[bot]
2086977af6 Update lxd connection to use all documented vars for options (#3798) (#3880)
* Update lxd connection to use documented vars

* Add a changelog fragment

* Add clarification to changelog description

* Shorten changelog fragment description

(cherry picked from commit 8f6866dba6)

Co-authored-by: Conner Crosby <conner@cavcrosby.tech>
2021-12-09 21:58:02 +01:00
patchback[bot]
587d221376 small docs update for timezone module (#3876) (#3877)
* small docs update for timezone module
fixes #3242

* Update plugins/modules/system/timezone.py

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

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

Co-authored-by: Anatoly Pugachev <matorola@gmail.com>
2021-12-09 21:19:00 +01:00
Felix Fontein
5ed6b38477 Prepare 3.8.3 release. 2021-12-08 20:22:31 +01:00
patchback[bot]
2c0cfe4d16 update scaleway maintainers (#3472) (#3872)
* update scaleway maintainers

* Fix

* Fix sieben -> remyleone

Co-authored-by: scaleway-bot <github@scaleway.com>
(cherry picked from commit 80d650f60a)

Co-authored-by: Rémy Léone <remy.leone@gmail.com>
2021-12-08 20:21:02 +01:00
patchback[bot]
c344d20a9a interfaces_file: unit tests improved (#3863) (#3868)
* interfaces_file: fixed unit tests and added README, added test cases for #3862

* typo fix for interfaces_file unit tests README.md

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

* typo fix for interfaces_file unit tests README.md

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

* typo fix for interfaces_file unit tests README.md

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

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

Co-authored-by: Roman Belyakovsky <ihryamzik@gmail.com>
2021-12-08 12:51:21 +01:00
patchback[bot]
53480b25c8 interfaces_file - fixed dup options bug (#3862) (#3865)
* interfaces_file - fixed dup options bug

* added changelog fragment

(cherry picked from commit 3dd5b0d343)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-12-08 05:54:44 +00:00
patchback[bot]
cfffaa5b6f Add stable-4 to nightly CI jobs; make stable-2 weekly. (#3852) (#3856)
(cherry picked from commit 727c9a4032)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-12-05 17:41:08 +01:00
patchback[bot]
726918930b opentelemetry: honour ignore errors (#3837) (#3846)
* opentelemetry: honour the ignore_errors

* fix-encoding-pragma

* Add changelog fragment

* opentelemetry: ignore produces unset span status

(cherry picked from commit ce6d0a749e)

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
2021-12-04 19:55:20 +01:00
patchback[bot]
614a84d0f2 pipx - fixed --include-apps bug (#3800) (#3817)
* pipx - fixed --include-apps bug

* added changelog fragment

* skipped freebsd for the last test

(cherry picked from commit bc619bcefc)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-11-30 08:32:48 +01:00
patchback[bot]
a11022e896 ansible_galaxy_install - minor documentation fix (#3804) (#3813)
* ansible_galaxy_install - minor documentation fix

* further adjustments

(cherry picked from commit 49bdc0f218)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-11-30 06:52:55 +01:00
Andrew Pantuso
491196937d Fixing ip address without mask bug (#3784) (#3810)
* change ip6 type to list of str and fix problem with setting addresses without netmask

* change ip6 type to list of str and fix problem with setting addresses without netmask

* Add changelog fragment

* add suggestions

* fix no mask using bug

* Make change independed from feature branch

(cherry picked from commit aae3ae1a8e)

Co-authored-by: Alex Groshev <38885591+haddystuff@users.noreply.github.com>
2021-11-30 06:07:32 +01:00
Felix Fontein
af7a6dc29f Next release will be 3.8.3. 2021-11-23 07:10:11 +01:00
Felix Fontein
16ffb4ba10 Release 3.8.2. 2021-11-23 05:54:00 +01:00
Felix Fontein
31c3865251 Prepare 3.8.2 release. 2021-11-23 05:53:21 +01:00
patchback[bot]
53e0bf8297 terraform: ensuring command options are applied during build_plan (#3726) (#3777)
* Fixes parameters missing in planned state

* Added new line at end of file

* Added changelog fragment for pr 3726

* Added changes mentioned by felixfontein

* Removed blank space for pep8 validation

* Update changelogs/fragments/3726-terraform-missing-parameters-planned-fix.yml

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

* Update plugins/modules/cloud/misc/terraform.py

extend needs to be a list

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

Co-authored-by: Thomas Arringe <thomas.arringe@fouredge.se>
Co-authored-by: Thomas Arringe <Thomas.Arringe@ica.se>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 946430e1fb)

Co-authored-by: egnirra <37709886+egnirra@users.noreply.github.com>
2021-11-23 05:51:17 +01:00
patchback[bot]
9b80b14956 Fix collection dependency installation in CI. (#3753) (#3755)
(cherry picked from commit 17b4c6972f)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-11-19 06:59:47 +01:00
patchback[bot]
be763e6ed2 CI: Replace RHEL 8.4 by RHEL 8.5 for devel (#3747) (#3748)
* Replace RHEL 8.4 by RHEL 8.5 for devel.

* Install virtualenv.

* Revert "Install virtualenv."

This reverts commit 22ba0d074e.

* Just do another skip...

(cherry picked from commit 26c7995c82)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-11-17 22:30:00 +01:00
patchback[bot]
4375280497 Restrict redis version. (#3733) (#3735)
(cherry picked from commit bf7a954f00)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-11-16 07:31:25 +01:00
patchback[bot]
ebda14ba41 Enable counter_enabled.py to support batch mode (#3709) (#3731)
* Enable counter_enabled.py to support serial mode

Enable counter_enabled.py to support batch playbook executions using the serial tag in plays. Currently, the host counter gets reset at the beginning of every task. However, during batch executions we want it to keep track of the previous batch executions and print the host counter based on the previous runs. This proposal keeps track of how many servers have been updated in previous batches and starts the host counter at that tracked value.

```
- hosts: allthethings
  gather_facts: no
  serial:
    - 3
    - 15%
    - 20%
    - 35%
    - 55%
    - 90%
    - 100%
  tasks:
    - name: Ping Hello!
      ping:
        data: "Hello!!!!"
```

* Reset task counter on play start

Reset task counter on play start for batch mode playbook executions.

* Add changelog fragment

* change changelog fragment after feedback

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

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

Co-authored-by: Nabheet Sandhu <nabheet@users.noreply.github.com>
2021-11-15 22:13:12 +01:00
patchback[bot]
c16a5f3780 Allow LDAP search to run in check mode (#3667) (#3724)
* Allow ldap search to run in check mode always

* Fix indentions

* Remove Comments and Chg Fragment

* Update changelogs/fragments/3667-ldap_search.yml

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

Co-authored-by: Sebastian Trupiano <sebastian.trupiano@srpnet.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
(cherry picked from commit 115d435d2d)

Co-authored-by: sabman3 <sabman3@aol.com>
2021-11-13 15:27:43 +01:00
patchback[bot]
f6c1566924 Example command has wrong arg in redfish_command (#3711) (#3721)
Example command arg `boot_next` missing the underscore

(cherry picked from commit 4fe5d54b9e)

Co-authored-by: bluikko <14869000+bluikko@users.noreply.github.com>
2021-11-13 14:58:49 +01:00
patchback[bot]
bffed2fda5 Rework safety check on size arguments for when LV doesn't exist (#3681) (#3719)
* Rework safety check on size arguments for when LV doesn't exist

* Update changelogs/fragments/3681-lvol-fix-create.yml

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

Co-authored-by: Jake Reynolds <jake.reynolds@bidfx.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 352047314b)

Co-authored-by: jake2184 <jake2184@users.noreply.github.com>
2021-11-13 14:34:31 +01:00
Felix Fontein
440804fd62 Replace Bash codecov uploader by new Python codecov uploader. (#3713) (#3715)
ci_coverage

(cherry picked from commit 5948809162)
2021-11-13 13:22:11 +01:00
patchback[bot]
a915a4b7c5 BOTMETA.yml: add new maintainer to gitlab team (#3696) (#3704)
(cherry picked from commit 18a17acaa4)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
2021-11-13 10:37:08 +01:00
patchback[bot]
ed69bde7a9 Fix dummy interface returning changed (#3625) (#3687)
* fix dummy interface bug

* fix dummy interface bug

* Update nmcli.py

* Update nmcli.py

* Update nmcli.py

* Update nmcli.py

* adding tests and requested conditional

* Fix pylint problems and remove 2 lines from previous version of bugfix

* Fix pep8 issue

* add changelog

* Update changelogs/fragments/3625-nmcli_false_changed_mtu_fix.yml

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

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

Co-authored-by: Alex Groshev <38885591+haddystuff@users.noreply.github.com>
2021-11-10 08:00:30 +01:00
patchback[bot]
77700e7110 Fix docs issues. (#3682) (#3683)
(cherry picked from commit 146af089e9)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-11-09 20:27:28 +01:00
patchback[bot]
91d445ab35 Replace Fedora 33 with Fedora 35 for devel tests (#3674) (#3679)
* Replace Fedora 33 with Fedora 35 for devel tests.

* Skip Fedora 35 for reiserfs tests.

(cherry picked from commit fc99893f10)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-11-09 07:05:06 +01:00
patchback[bot]
19c2af03b7 Better handling of base64-encoded values in xattr module (#3675) (#3677)
* Fix exception in xattr module when existing extended attribute's value contains non-printable characters and the base64-encoded string contains a '=' sign

* Added changelog fragment for #3675

* Apply suggestions from code review

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

Co-authored-by: sc-anssi <sc-anssi@users.noreply.github.com>
2021-11-09 06:29:01 +01:00
David Moreau Simard
58a5463ddb Fix urpmi typo in changelog (#3659)
The module is urpmi, not urmpi.
2021-11-02 19:06:49 +01:00
Felix Fontein
84941d0a7f Next expected release is 3.8.2. 2021-11-02 06:49:01 +01:00
Felix Fontein
87880da6da Release 3.8.1. 2021-11-02 06:14:23 +01:00
patchback[bot]
7acc0b897a Revert "Temporarily disable yaml callback tests. (#3651)" (#3657) (#3658)
This reverts commit 2324f350bc.

(cherry picked from commit 29af59822d)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-11-01 19:19:01 +01:00
patchback[bot]
5174fc98d2 Fixed - TypeError: unexpected keyword argument (#3649) (#3654)
* Fixed - TypeError: unexpected keyword argument

- File proxmox_group_info.py creates the error "TypeError:
  get_group() got an unexpected keyword argument \'group\'\r\n'" if a
  group parameter is used.
  Issue is an argument naming conflict. After changing the argument
  name to 'groupid', as used in method ProxmoxGroupInfoAnsible::get_group,
  testing a Proxmox group name is working now.

* Changelog fragment added for #3649

changelog fragment for TypeError: unexpected keyword argument #3649

* Update changelogs/fragments/3649-proxmox_group_info_TypeError.yml

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

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

Co-authored-by: hklausing <hklausing@users.noreply.github.com>
2021-10-31 20:35:43 +01:00
patchback[bot]
d9ad386a13 Temporarily disable yaml callback tests. (#3651) (#3652)
(cherry picked from commit 2324f350bc)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-10-31 18:08:17 +00:00
patchback[bot]
739719a3b1 opennebula: fix error message when renaming an image (#3626) (#3650)
While porting this module to make use of `pyone` I have overlooked one
attribute.  Luckily the error only occurs when trying to rename an image
to a name that has already been taken.

Instead of telling the user which image ID already uses that name, the
module failed with the following error (along with a huge backtrace):

    AttributeError: 'IMAGESub' object has no attribute 'id'

With this commit the error message is much more obvous again.

(cherry picked from commit b429c520f5)

Co-authored-by: Georg Gadinger <nilsding@nilsding.org>
2021-10-31 18:50:20 +01:00
patchback[bot]
311b618016 provide more fitting description for runner timeout (#3624) (#3645)
* provide more fitting description for runner timeout

* Update plugins/modules/source_control/gitlab/gitlab_runner.py

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

Co-authored-by: Tim Herren <tim.herren@gmx.ch>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 96de25fc94)

Co-authored-by: nerrehmit <accounts+github@herren.id>
2021-10-30 17:04:18 +02:00
patchback[bot]
70820cab5d Fix CI (#3637) (#3641)
* Replace yaml.load with yaml.safe_load in unit tests.

* Remove no longer needed loader arg in two instances.

(cherry picked from commit 753df78877)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-10-30 11:22:18 +02:00
patchback[bot]
a75a12227f gitlab_project_members: improve project name matching (#3602) (#3636)
* Update gitlab_project_members.py

The actual search method doesn't accept path with namespace for project_name. If you have many project with same name, this module gitlab_project_members can't work.

* Update gitlab_project_members.py

* Update gitlab_project_members.py

* Update gitlab_project_members.py

* Create 3602-fix-gitlab_project_members-improve-search-method

* Rename 3602-fix-gitlab_project_members-improve-search-method to 3602-fix-gitlab_project_members-improve-search-method.yml

(cherry picked from commit cdfc4dcf49)

Co-authored-by: paytroff <93038288+paytroff@users.noreply.github.com>
2021-10-30 08:32:06 +02:00
patchback[bot]
6959847701 pipx - fixed bug in state=inject (#3611) (#3634)
* pipx - fixed bug in state=inject

* added changelog fragment

* copy/paste error in the integration test

* replaced injected package with simpler one

* testing force_lang = None

* disable UTF-8 emojis in pipx output

* better way to achieve the same outcome

* Adjsuted the changelog fragment

(cherry picked from commit 40ccd1501b)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-10-30 08:30:13 +02:00
patchback[bot]
ad93c40d40 fix gitlab_deploy_key task in check mode (#3622) (#3629)
fixes #3621

* running check mode used to accidentally delete the existing
  ssh key; change it so deletion is skipped in check mode

(cherry picked from commit 8ba7fd5d61)

Co-authored-by: Waldek Maleska <w.maleska@gmail.com>
2021-10-28 20:19:54 +02:00
Felix Fontein
5bfbd65115 Prepare 3.8.1 release. 2021-10-22 08:31:37 +02:00
patchback[bot]
71de1ee1d5 Fix exception in pkgin module when all packages are already installed (#3583) (#3596)
* Fix exception in pkgin module when all packages are already installed.

* Update plugins/modules/packaging/os/pkgin.py

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

* Add changelog fragment for #3583

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

Co-authored-by: Nate Coraor <nate@bx.psu.edu>
2021-10-22 08:07:10 +02:00
patchback[bot]
ad4efaeb31 Redfish: Do not set the boot source override mode if not provided by the user (#3581) (#3595)
* Redfish: Do not set the boot source override mode if not provided by the user

Signed-off-by: Mike Raineri <michael.raineri@dell.com>

* Corrected changelog file extension

Signed-off-by: Mike Raineri <michael.raineri@dell.com>

* Update changelogs/fragments/3509-redfish_utils-SetOneTimeBoot-mode-fix.yml

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

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

Co-authored-by: Mike Raineri <michael.raineri@dell.com>
2021-10-22 07:41:09 +02:00
patchback[bot]
786ea68016 nmcli: Fix ipv6.dns not being recongnized as list (#3563) (#3593)
* nmcli: Fix ipv6.dns not being recongnized as list

There was a missing comma on the previous line.

* nmcli: Add changelog fragment for #3563

* nmcli: Update changelogs/fragments/3563-nmcli-ipv6_dns.yaml

Make the fix description more descriptive

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>

* nmcli: Remove ipv4.route-metric from list-typed properties

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>

* nmcli: Update fragment 3563 with ipv4.route-metric bug

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>
(cherry picked from commit e7e2ab94da)

Co-authored-by: Matyáš Kroupa <kroupa.matyas@gmail.com>
2021-10-21 08:22:55 +02:00
patchback[bot]
dd878f931f Redfish: perform manager network interface configuration even if property is missing (#3582) (#3591)
* Redfish: perform manager network interface configuration even if property is missing

Signed-off-by: Mike Raineri <michael.raineri@dell.com>

* Update changelogs/fragments/3404-redfish_utils-skip-manager-network-check.yml

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

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

Co-authored-by: Mike Raineri <michael.raineri@dell.com>
2021-10-20 17:51:35 +02:00
patchback[bot]
8f03511d9c Remove non-working example. (#3571) (#3587)
(cherry picked from commit e8c37ca605)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-10-18 23:07:04 +02:00
patchback[bot]
004e6d06c3 Fixed typo in homebrew documentation (#3577) (#3585)
Fixed typo in community.general.homebrew documentation

(cherry picked from commit 02c534bb8e)

Co-authored-by: Premkumar Subramanian <prem_x87@outlook.com>
2021-10-18 23:04:16 +02:00
patchback[bot]
25f46caefb Misc doc issues (#3572) (#3580)
* Add names to tasks in oneview module examples

* Fix task name in github_webhook module example

* Fix trailing whitespace

* Add changelog fragment

* Remove changelog fragment

(cherry picked from commit 3731064368)

Co-authored-by: Vitaly Khabarov <vitkhab@users.noreply.github.com>
2021-10-18 14:09:34 +02:00
patchback[bot]
0a733c60ca Use correct FQCN. (#3573) (#3575)
(cherry picked from commit c3813d4533)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-10-17 18:25:50 +02:00
patchback[bot]
f006aa4cf6 Fix bug with returning results in IPA role (#3561) (#3568)
* Fix bug with returning results in IPA role

Fix #3560

* Add changelog

* Fix typo in changelog

* Update changelogs/fragments/3561-fix-ipa-host-var-detection.yml

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>

* Update changelogs/fragments/3561-fix-ipa-host-var-detection.yml

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>

* Update changelogs/fragments/3561-fix-ipa-host-var-detection.yml

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

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 191d2e08bb)

Co-authored-by: Sergey <sshnaidm@users.noreply.github.com>
2021-10-16 21:08:01 +02:00
patchback[bot]
72e0d8c310 Remove centos8 for devel from CI. (#3565) (#3566)
(cherry picked from commit 249d490f10)

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-10-16 09:27:55 +02:00
Felix Fontein
b96aaffeae Next expected release is 3.8.1. 2021-10-12 13:18:09 +02:00
212 changed files with 2603 additions and 326 deletions

View File

@@ -24,14 +24,15 @@ schedules:
always: true always: true
branches: branches:
include: include:
- stable-2
- stable-3 - stable-3
- stable-4
- cron: 0 11 * * 0 - cron: 0 11 * * 0
displayName: Weekly (old stable branches) displayName: Weekly (old stable branches)
always: true always: true
branches: branches:
include: include:
- stable-1 - stable-1
- stable-2
variables: variables:
- name: checkoutPath - name: checkoutPath
@@ -209,8 +210,8 @@ stages:
test: macos/11.1 test: macos/11.1
- name: RHEL 7.9 - name: RHEL 7.9
test: rhel/7.9 test: rhel/7.9
- name: RHEL 8.4 - name: RHEL 8.5
test: rhel/8.4 test: rhel/8.5
- name: FreeBSD 12.2 - name: FreeBSD 12.2
test: freebsd/12.2 test: freebsd/12.2
- name: FreeBSD 13.0 - name: FreeBSD 13.0
@@ -297,12 +298,10 @@ stages:
targets: targets:
- name: CentOS 7 - name: CentOS 7
test: centos7 test: centos7
- name: CentOS 8
test: centos8
- name: Fedora 33
test: fedora33
- name: Fedora 34 - name: Fedora 34
test: fedora34 test: fedora34
- name: Fedora 35
test: fedora35
- name: openSUSE 15 py2 - name: openSUSE 15 py2
test: opensuse15py2 test: opensuse15py2
- name: openSUSE 15 py3 - name: openSUSE 15 py3
@@ -325,8 +324,8 @@ stages:
targets: targets:
- name: CentOS 6 - name: CentOS 6
test: centos6 test: centos6
- name: CentOS 7 - name: CentOS 8
test: centos7 test: centos8
- name: Fedora 34 - name: Fedora 34
test: fedora34 test: fedora34
- name: openSUSE 15 py3 - name: openSUSE 15 py3
@@ -345,8 +344,8 @@ stages:
parameters: parameters:
testFormat: 2.11/linux/{0} testFormat: 2.11/linux/{0}
targets: targets:
- name: CentOS 8 - name: CentOS 7
test: centos8 test: centos7
- name: Fedora 33 - name: Fedora 33
test: fedora33 test: fedora33
- name: openSUSE 15 py2 - name: openSUSE 15 py2

View File

@@ -11,7 +11,7 @@ mkdir "${agent_temp_directory}/coverage/"
options=(--venv --venv-system-site-packages --color -v) options=(--venv --venv-system-site-packages --color -v)
ansible-test coverage combine --export "${agent_temp_directory}/coverage/" "${options[@]}" ansible-test coverage combine --group-by command --export "${agent_temp_directory}/coverage/" "${options[@]}"
if ansible-test coverage analyze targets generate --help >/dev/null 2>&1; then if ansible-test coverage analyze targets generate --help >/dev/null 2>&1; then
# Only analyze coverage if the installed version of ansible-test supports it. # Only analyze coverage if the installed version of ansible-test supports it.

View File

@@ -0,0 +1,101 @@
#!/usr/bin/env python
"""
Upload code coverage reports to codecov.io.
Multiple coverage files from multiple languages are accepted and aggregated after upload.
Python coverage, as well as PowerShell and Python stubs can all be uploaded.
"""
import argparse
import dataclasses
import pathlib
import shutil
import subprocess
import tempfile
import typing as t
import urllib.request
@dataclasses.dataclass(frozen=True)
class CoverageFile:
name: str
path: pathlib.Path
flags: t.List[str]
@dataclasses.dataclass(frozen=True)
class Args:
dry_run: bool
path: pathlib.Path
def parse_args() -> Args:
parser = argparse.ArgumentParser()
parser.add_argument('-n', '--dry-run', action='store_true')
parser.add_argument('path', type=pathlib.Path)
args = parser.parse_args()
# Store arguments in a typed dataclass
fields = dataclasses.fields(Args)
kwargs = {field.name: getattr(args, field.name) for field in fields}
return Args(**kwargs)
def process_files(directory: pathlib.Path) -> t.Tuple[CoverageFile, ...]:
processed = []
for file in directory.joinpath('reports').glob('coverage*.xml'):
name = file.stem.replace('coverage=', '')
# Get flags from name
flags = name.replace('-powershell', '').split('=') # Drop '-powershell' suffix
flags = [flag if not flag.startswith('stub') else flag.split('-')[0] for flag in flags] # Remove "-01" from stub files
processed.append(CoverageFile(name, file, flags))
return tuple(processed)
def upload_files(codecov_bin: pathlib.Path, files: t.Tuple[CoverageFile, ...], dry_run: bool = False) -> None:
for file in files:
cmd = [
str(codecov_bin),
'--name', file.name,
'--file', str(file.path),
]
for flag in file.flags:
cmd.extend(['--flags', flag])
if dry_run:
print(f'DRY-RUN: Would run command: {cmd}')
continue
subprocess.run(cmd, check=True)
def download_file(url: str, dest: pathlib.Path, flags: int, dry_run: bool = False) -> None:
if dry_run:
print(f'DRY-RUN: Would download {url} to {dest} and set mode to {flags:o}')
return
with urllib.request.urlopen(url) as resp:
with dest.open('w+b') as f:
# Read data in chunks rather than all at once
shutil.copyfileobj(resp, f, 64 * 1024)
dest.chmod(flags)
def main():
args = parse_args()
url = 'https://ansible-ci-files.s3.amazonaws.com/codecov/linux/codecov'
with tempfile.TemporaryDirectory(prefix='codecov-') as tmpdir:
codecov_bin = pathlib.Path(tmpdir) / 'codecov'
download_file(url, codecov_bin, 0o755, args.dry_run)
files = process_files(args.path)
upload_files(codecov_bin, files, args.dry_run)
if __name__ == '__main__':
main()

View File

@@ -1,27 +0,0 @@
#!/usr/bin/env bash
# Upload code coverage reports to codecov.io.
# Multiple coverage files from multiple languages are accepted and aggregated after upload.
# Python coverage, as well as PowerShell and Python stubs can all be uploaded.
set -o pipefail -eu
output_path="$1"
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}"
name="${name##*/}" # remove path
name="${name##coverage=}" # remove 'coverage=' prefix if present
name="${name%.xml}" # remove '.xml' suffix
bash codecov.sh \
-f "${file}" \
-n "${name}" \
-X coveragepy \
-X gcov \
-X fix \
-X search \
-X xcode \
|| echo "Failed to upload code coverage report to codecov.io: ${file}"
done

View File

@@ -12,4 +12,4 @@ if ! ansible-test --help >/dev/null 2>&1; then
pip install https://github.com/ansible/ansible/archive/devel.tar.gz --disable-pip-version-check pip install https://github.com/ansible/ansible/archive/devel.tar.gz --disable-pip-version-check
fi fi
ansible-test coverage xml --stub --venv --venv-system-site-packages --color -v ansible-test coverage xml --group-by command --stub --venv --venv-system-site-packages --color -v

View File

@@ -33,7 +33,7 @@ jobs:
summaryFileLocation: "$(outputPath)/reports/$(pipelinesCoverage).xml" summaryFileLocation: "$(outputPath)/reports/$(pipelinesCoverage).xml"
displayName: Publish to Azure Pipelines displayName: Publish to Azure Pipelines
condition: gt(variables.coverageFileCount, 0) condition: gt(variables.coverageFileCount, 0)
- bash: .azure-pipelines/scripts/publish-codecov.sh "$(outputPath)" - bash: .azure-pipelines/scripts/publish-codecov.py "$(outputPath)"
displayName: Publish to codecov.io displayName: Publish to codecov.io
condition: gt(variables.coverageFileCount, 0) condition: gt(variables.coverageFileCount, 0)
continueOnError: true continueOnError: true

22
.github/BOTMETA.yml vendored
View File

@@ -156,7 +156,7 @@ files:
maintainers: conloos maintainers: conloos
$inventories/nmap.py: {} $inventories/nmap.py: {}
$inventories/online.py: $inventories/online.py:
maintainers: sieben maintainers: remyleone
$inventories/opennebula.py: $inventories/opennebula.py:
maintainers: feldsam maintainers: feldsam
labels: cloud opennebula labels: cloud opennebula
@@ -164,7 +164,7 @@ files:
$inventories/proxmox.py: $inventories/proxmox.py:
maintainers: $team_virt ilijamt maintainers: $team_virt ilijamt
$inventories/icinga2.py: $inventories/icinga2.py:
maintainers: bongoeadgc6 maintainers: BongoEADGC6
$inventories/scaleway.py: $inventories/scaleway.py:
maintainers: $team_scaleway maintainers: $team_scaleway
labels: cloud scaleway labels: cloud scaleway
@@ -320,6 +320,10 @@ files:
$modules/cloud/misc/proxmox_kvm.py: $modules/cloud/misc/proxmox_kvm.py:
maintainers: helldorado maintainers: helldorado
ignore: skvidal ignore: skvidal
$modules/cloud/misc/proxmox_nic.py:
maintainers: Kogelvis
$modules/cloud/misc/proxmox_tasks_info:
maintainers: paginabianca
$modules/cloud/misc/proxmox_template.py: $modules/cloud/misc/proxmox_template.py:
maintainers: UnderGreen maintainers: UnderGreen
ignore: skvidal ignore: skvidal
@@ -339,7 +343,7 @@ files:
$modules/cloud/oneandone/: $modules/cloud/oneandone/:
maintainers: aajdinov edevenport maintainers: aajdinov edevenport
$modules/cloud/online/: $modules/cloud/online/:
maintainers: sieben maintainers: remyleone
$modules/cloud/opennebula/: $modules/cloud/opennebula/:
maintainers: $team_opennebula maintainers: $team_opennebula
$modules/cloud/opennebula/one_host.py: $modules/cloud/opennebula/one_host.py:
@@ -409,11 +413,11 @@ files:
$modules/cloud/scaleway/scaleway_ip_info.py: $modules/cloud/scaleway/scaleway_ip_info.py:
maintainers: Spredzy maintainers: Spredzy
$modules/cloud/scaleway/scaleway_organization_info.py: $modules/cloud/scaleway/scaleway_organization_info.py:
maintainers: sieben Spredzy maintainers: Spredzy
$modules/cloud/scaleway/scaleway_security_group.py: $modules/cloud/scaleway/scaleway_security_group.py:
maintainers: DenBeke maintainers: DenBeke
$modules/cloud/scaleway/scaleway_security_group_info.py: $modules/cloud/scaleway/scaleway_security_group_info.py:
maintainers: sieben Spredzy maintainers: Spredzy
$modules/cloud/scaleway/scaleway_security_group_rule.py: $modules/cloud/scaleway/scaleway_security_group_rule.py:
maintainers: DenBeke maintainers: DenBeke
$modules/cloud/scaleway/scaleway_server_info.py: $modules/cloud/scaleway/scaleway_server_info.py:
@@ -914,6 +918,10 @@ files:
$modules/remote_management/manageiq/: $modules/remote_management/manageiq/:
labels: manageiq labels: manageiq
maintainers: $team_manageiq maintainers: $team_manageiq
$modules/remote_management/manageiq/manageiq_alert_profiles.py:
maintainers: elad661
$modules/remote_management/manageiq/manageiq_alerts.py:
maintainers: elad661
$modules/remote_management/manageiq/manageiq_group.py: $modules/remote_management/manageiq/manageiq_group.py:
maintainers: evertmulder maintainers: evertmulder
$modules/remote_management/manageiq/manageiq_tenant.py: $modules/remote_management/manageiq/manageiq_tenant.py:
@@ -1221,7 +1229,7 @@ macros:
team_cyberark_conjur: jvanderhoof ryanprior team_cyberark_conjur: jvanderhoof ryanprior
team_e_spirit: MatrixCrawler getjack team_e_spirit: MatrixCrawler getjack
team_flatpak: JayKayy oolongbrothers team_flatpak: JayKayy oolongbrothers
team_gitlab: Lunik Shaps dj-wasabi marwatk waheedi zanssa scodeman metanovii team_gitlab: Lunik Shaps dj-wasabi marwatk waheedi zanssa scodeman metanovii sh0shin
team_hpux: bcoca davx8342 team_hpux: bcoca davx8342
team_huawei: QijunPan TommyLike edisonxiang freesky-edward hwDCN niuzhenguo xuxiaowei0512 yanzhangi zengchen1024 zhongjun2 team_huawei: QijunPan TommyLike edisonxiang freesky-edward hwDCN niuzhenguo xuxiaowei0512 yanzhangi zengchen1024 zhongjun2
team_ipa: Akasurde Nosmoht fxfitz justchris1 team_ipa: Akasurde Nosmoht fxfitz justchris1
@@ -1236,7 +1244,7 @@ macros:
team_purestorage: bannaych dnix101 genegr lionmax opslounge raekins sdodsley sile16 team_purestorage: bannaych dnix101 genegr lionmax opslounge raekins sdodsley sile16
team_redfish: mraineri tomasg2012 xmadsen renxulei team_redfish: mraineri tomasg2012 xmadsen renxulei
team_rhn: FlossWare alikins barnabycourt vritant team_rhn: FlossWare alikins barnabycourt vritant
team_scaleway: QuentinBrosse abarbare jerome-quere kindermoumoute remyleone sieben team_scaleway: remyleone abarbare
team_solaris: bcoca fishman jasperla jpdasma mator scathatheworm troy2914 xen0l team_solaris: bcoca fishman jasperla jpdasma mator scathatheworm troy2914 xen0l
team_suse: commel dcermak evrardjp lrupp toabctl AnderEnder alxgu andytom sealor team_suse: commel dcermak evrardjp lrupp toabctl AnderEnder alxgu andytom sealor
team_virt: joshainglis karmab tleguern Thulium-Drake Ajpantuso team_virt: joshainglis karmab tleguern Thulium-Drake Ajpantuso

View File

@@ -6,6 +6,94 @@ Community General Release Notes
This changelog describes changes after version 2.0.0. This changelog describes changes after version 2.0.0.
v3.8.4
======
Release Summary
---------------
Regular bugfix release.
Bugfixes
--------
- Various modules and plugins - use vendored version of ``distutils.version`` instead of the deprecated Python standard library ``distutils`` (https://github.com/ansible-collections/community.general/pull/3936).
- alternatives - fix output parsing for alternatives groups (https://github.com/ansible-collections/community.general/pull/3976).
- jail connection plugin - replace deprecated ``distutils.spawn.find_executable`` with Ansible's ``get_bin_path`` to find the executable (https://github.com/ansible-collections/community.general/pull/3934).
- jira - fixed bug where module returns error related to dictionary key ``body`` (https://github.com/ansible-collections/community.general/issues/3419).
- lxd connection plugin - replace deprecated ``distutils.spawn.find_executable`` with Ansible's ``get_bin_path`` to find the ``lxc`` executable (https://github.com/ansible-collections/community.general/pull/3934).
- nrdp callback plugin - fix error ``string arguments without an encoding`` (https://github.com/ansible-collections/community.general/issues/3903).
- passwordstore lookup plugin - replace deprecated ``distutils.util.strtobool`` with Ansible's ``convert_bool.boolean`` to interpret values for the ``create``, ``returnall``, ``overwrite``, 'backup``, and ``nosymbols`` options (https://github.com/ansible-collections/community.general/pull/3934).
- say callback plugin - replace deprecated ``distutils.spawn.find_executable`` with Ansible's ``get_bin_path`` to find the ``say`` resp. ``espeak`` executables (https://github.com/ansible-collections/community.general/pull/3934).
- scaleway_user_data - fix double-quote added where no double-quote is needed to user data in scaleway's server (``Content-type`` -> ``Content-Type``) (https://github.com/ansible-collections/community.general/pull/3940).
- slack - add ``charset`` to HTTP headers to avoid Slack API warning (https://github.com/ansible-collections/community.general/issues/3932).
- zone connection plugin - replace deprecated ``distutils.spawn.find_executable`` with Ansible's ``get_bin_path`` to find the executable (https://github.com/ansible-collections/community.general/pull/3934).
v3.8.3
======
Release Summary
---------------
Regular bugfix release.
Minor Changes
-------------
- lxd connection plugin - make sure that ``ansible_lxd_host``, ``ansible_executable``, and ``ansible_lxd_executable`` work (https://github.com/ansible-collections/community.general/pull/3798).
Bugfixes
--------
- interfaces_file - fixed the check for existing option in interface (https://github.com/ansible-collections/community.general/issues/3841).
- nmcli - fix returning "changed" when no mask set for IPv4 or IPv6 addresses on task rerun (https://github.com/ansible-collections/community.general/issues/3768).
- nmcli - pass ``flags``, ``ingress``, ``egress`` params to ``nmcli`` (https://github.com/ansible-collections/community.general/issues/1086).
- opentelemetry_plugin - honour ``ignore_errors`` when a task has failed instead of reporting an error (https://github.com/ansible-collections/community.general/pull/3837).
- pipx - passes the correct command line option ``--include-apps`` (https://github.com/ansible-collections/community.general/issues/3791).
- proxmox - fixed ``onboot`` parameter causing module failures when undefined (https://github.com/ansible-collections/community.general/issues/3844).
v3.8.2
======
Release Summary
---------------
Regular bugfix release.
Bugfixes
--------
- counter_enabled callback plugin - fix output to correctly display host and task counters in serial mode (https://github.com/ansible-collections/community.general/pull/3709).
- ldap_search - allow it to be used even in check mode (https://github.com/ansible-collections/community.general/issues/3619).
- lvol - allows logical volumes to be created with certain size arguments prefixed with ``+`` to preserve behavior of older versions of this module (https://github.com/ansible-collections/community.general/issues/3665).
- nmcli - fixed falsely reported changed status when ``mtu`` is omitted with ``dummy`` connections (https://github.com/ansible-collections/community.general/issues/3612, https://github.com/ansible-collections/community.general/pull/3625).
- terraform - fix command options being ignored during planned/plan in function ``build_plan`` such as ``lock`` or ``lock_timeout`` (https://github.com/ansible-collections/community.general/issues/3707, https://github.com/ansible-collections/community.general/pull/3726).
- xattr - fix exception caused by ``_run_xattr()`` raising a ``ValueError`` due to a mishandling of base64-encoded value (https://github.com/ansible-collections/community.general/issues/3673).
v3.8.1
======
Release Summary
---------------
Regular bugfix release.
Bugfixes
--------
- gitlab_deploy_key - fix the SSH Deploy Key being deleted accidentally while running task in check mode (https://github.com/ansible-collections/community.general/issues/3621, https://github.com/ansible-collections/community.general/pull/3622).
- gitlab_project_members - ``get_project_id`` return the project id by matching ``full_path`` or ``name`` (https://github.com/ansible-collections/community.general/pull/3602).
- ipa_* modules - fix environment fallback for ``ipa_host`` option (https://github.com/ansible-collections/community.general/issues/3560).
- nmcli - fixed ``dns6`` option handling so that it is treated as a list internally (https://github.com/ansible-collections/community.general/pull/3563).
- nmcli - fixed ``ipv4.route-metric`` being in properties of type list (https://github.com/ansible-collections/community.general/pull/3563).
- one_image - fix error message when renaming an image (https://github.com/ansible-collections/community.general/pull/3626).
- pipx - ``state=inject`` was failing to parse the list of injected packages (https://github.com/ansible-collections/community.general/pull/3611).
- pipx - set environment variable ``USE_EMOJI=0`` to prevent errors in platforms that do not support ``UTF-8`` (https://github.com/ansible-collections/community.general/pull/3611).
- pkgin - Fix exception encountered when all packages are already installed (https://github.com/ansible-collections/community.general/pull/3583).
- proxmox_group_info - fix module crash if a ``group`` parameter is used (https://github.com/ansible-collections/community.general/pull/3649).
- redfish_utils module utils - do not attempt to change the boot source override mode if not specified by the user (https://github.com/ansible-collections/community.general/issues/3509/).
- redfish_utils module utils - if a manager network property is not specified in the service, attempt to change the requested settings (https://github.com/ansible-collections/community.general/issues/3404/).
v3.8.0 v3.8.0
====== ======
@@ -875,7 +963,7 @@ Deprecated Features
- puppet - deprecated undocumented parameter ``show_diff``, will be removed in 7.0.0. (https://github.com/ansible-collections/community.general/pull/1927). - puppet - deprecated undocumented parameter ``show_diff``, will be removed in 7.0.0. (https://github.com/ansible-collections/community.general/pull/1927).
- runit - unused parameter ``dist`` marked for deprecation (https://github.com/ansible-collections/community.general/pull/1830). - runit - unused parameter ``dist`` marked for deprecation (https://github.com/ansible-collections/community.general/pull/1830).
- slackpkg - deprecated invalid parameter alias ``update-cache``, will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927). - slackpkg - deprecated invalid parameter alias ``update-cache``, will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).
- urmpi - deprecated invalid parameter aliases ``update-cache`` and ``no-recommends``, will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927). - urpmi - deprecated invalid parameter aliases ``update-cache`` and ``no-recommends``, will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).
- xbps - deprecated invalid parameter alias ``update-cache``, will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927). - xbps - deprecated invalid parameter alias ``update-cache``, will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).
- xfconf - returning output as facts is deprecated, this will be removed in community.general 4.0.0. Please register the task output in a variable and use it instead. You can already switch to the new behavior now by using the new ``disable_facts`` option (https://github.com/ansible-collections/community.general/pull/1747). - xfconf - returning output as facts is deprecated, this will be removed in community.general 4.0.0. Please register the task output in a variable and use it instead. You can already switch to the new behavior now by using the new ``disable_facts`` option (https://github.com/ansible-collections/community.general/pull/1747).

View File

@@ -286,7 +286,7 @@ releases:
- runit - unused parameter ``dist`` marked for deprecation (https://github.com/ansible-collections/community.general/pull/1830). - runit - unused parameter ``dist`` marked for deprecation (https://github.com/ansible-collections/community.general/pull/1830).
- slackpkg - deprecated invalid parameter alias ``update-cache``, will be removed - slackpkg - deprecated invalid parameter alias ``update-cache``, will be removed
in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927). in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).
- urmpi - deprecated invalid parameter aliases ``update-cache`` and ``no-recommends``, - urpmi - deprecated invalid parameter aliases ``update-cache`` and ``no-recommends``,
will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927). will be removed in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).
- xbps - deprecated invalid parameter alias ``update-cache``, will be removed - xbps - deprecated invalid parameter alias ``update-cache``, will be removed
in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927). in 5.0.0 (https://github.com/ansible-collections/community.general/pull/1927).
@@ -1940,3 +1940,129 @@ releases:
name: opennebula name: opennebula
namespace: null namespace: null
release_date: '2021-10-12' release_date: '2021-10-12'
3.8.1:
changes:
bugfixes:
- gitlab_deploy_key - fix the SSH Deploy Key being deleted accidentally while
running task in check mode (https://github.com/ansible-collections/community.general/issues/3621,
https://github.com/ansible-collections/community.general/pull/3622).
- gitlab_project_members - ``get_project_id`` return the project id by matching
``full_path`` or ``name`` (https://github.com/ansible-collections/community.general/pull/3602).
- ipa_* modules - fix environment fallback for ``ipa_host`` option (https://github.com/ansible-collections/community.general/issues/3560).
- nmcli - fixed ``dns6`` option handling so that it is treated as a list internally
(https://github.com/ansible-collections/community.general/pull/3563).
- nmcli - fixed ``ipv4.route-metric`` being in properties of type list (https://github.com/ansible-collections/community.general/pull/3563).
- one_image - fix error message when renaming an image (https://github.com/ansible-collections/community.general/pull/3626).
- pipx - ``state=inject`` was failing to parse the list of injected packages
(https://github.com/ansible-collections/community.general/pull/3611).
- pipx - set environment variable ``USE_EMOJI=0`` to prevent errors in platforms
that do not support ``UTF-8`` (https://github.com/ansible-collections/community.general/pull/3611).
- pkgin - Fix exception encountered when all packages are already installed
(https://github.com/ansible-collections/community.general/pull/3583).
- proxmox_group_info - fix module crash if a ``group`` parameter is used (https://github.com/ansible-collections/community.general/pull/3649).
- redfish_utils module utils - do not attempt to change the boot source override
mode if not specified by the user (https://github.com/ansible-collections/community.general/issues/3509/).
- redfish_utils module utils - if a manager network property is not specified
in the service, attempt to change the requested settings (https://github.com/ansible-collections/community.general/issues/3404/).
release_summary: Regular bugfix release.
fragments:
- 3.8.1.yml
- 3404-redfish_utils-skip-manager-network-check.yml
- 3509-redfish_utils-SetOneTimeBoot-mode-fix.yml
- 3561-fix-ipa-host-var-detection.yml
- 3563-nmcli-ipv6_dns.yaml
- 3583-fix-pkgin-exception.yml
- 3602-fix-gitlab_project_members-improve-search-method.yml
- 3611-pipx-fix-inject.yml
- 3622-fix-gitlab-deploy-key-check-mode.yml
- 3626-fix-one_image-error.yml
- 3649-proxmox_group_info_TypeError.yml
release_date: '2021-11-02'
3.8.2:
changes:
bugfixes:
- counter_enabled callback plugin - fix output to correctly display host and
task counters in serial mode (https://github.com/ansible-collections/community.general/pull/3709).
- ldap_search - allow it to be used even in check mode (https://github.com/ansible-collections/community.general/issues/3619).
- lvol - allows logical volumes to be created with certain size arguments prefixed
with ``+`` to preserve behavior of older versions of this module (https://github.com/ansible-collections/community.general/issues/3665).
- nmcli - fixed falsely reported changed status when ``mtu`` is omitted with
``dummy`` connections (https://github.com/ansible-collections/community.general/issues/3612,
https://github.com/ansible-collections/community.general/pull/3625).
- terraform - fix command options being ignored during planned/plan in function
``build_plan`` such as ``lock`` or ``lock_timeout`` (https://github.com/ansible-collections/community.general/issues/3707,
https://github.com/ansible-collections/community.general/pull/3726).
- xattr - fix exception caused by ``_run_xattr()`` raising a ``ValueError``
due to a mishandling of base64-encoded value (https://github.com/ansible-collections/community.general/issues/3673).
release_summary: Regular bugfix release.
fragments:
- 3.8.2.yml
- 3625-nmcli_false_changed_mtu_fix.yml
- 3667-ldap_search.yml
- 3675-xattr-handle-base64-values.yml
- 3681-lvol-fix-create.yml
- 3709-support-batch-mode.yml
- 3726-terraform-missing-parameters-planned-fix.yml
release_date: '2021-11-23'
3.8.3:
changes:
bugfixes:
- interfaces_file - fixed the check for existing option in interface (https://github.com/ansible-collections/community.general/issues/3841).
- nmcli - fix returning "changed" when no mask set for IPv4 or IPv6 addresses
on task rerun (https://github.com/ansible-collections/community.general/issues/3768).
- nmcli - pass ``flags``, ``ingress``, ``egress`` params to ``nmcli`` (https://github.com/ansible-collections/community.general/issues/1086).
- opentelemetry_plugin - honour ``ignore_errors`` when a task has failed instead
of reporting an error (https://github.com/ansible-collections/community.general/pull/3837).
- pipx - passes the correct command line option ``--include-apps`` (https://github.com/ansible-collections/community.general/issues/3791).
- proxmox - fixed ``onboot`` parameter causing module failures when undefined
(https://github.com/ansible-collections/community.general/issues/3844).
minor_changes:
- lxd connection plugin - make sure that ``ansible_lxd_host``, ``ansible_executable``,
and ``ansible_lxd_executable`` work (https://github.com/ansible-collections/community.general/pull/3798).
release_summary: Regular bugfix release.
fragments:
- 3.8.3.yml
- 3768-nmcli_fix_changed_when_no_mask_set.yml
- 3798-fix-lxd-connection-option-vars-support.yml
- 3800-pipx-include-apps.yaml
- 3837-opentelemetry_plugin-honour_ignore_errors.yaml
- 3862-interfaces-file-fix-dup-option.yaml
- 3874-proxmox-fix-onboot-param.yml
- 3896-nmcli_vlan_missing_options.yaml
release_date: '2021-12-14'
3.8.4:
changes:
bugfixes:
- Various modules and plugins - use vendored version of ``distutils.version``
instead of the deprecated Python standard library ``distutils`` (https://github.com/ansible-collections/community.general/pull/3936).
- alternatives - fix output parsing for alternatives groups (https://github.com/ansible-collections/community.general/pull/3976).
- jail connection plugin - replace deprecated ``distutils.spawn.find_executable``
with Ansible's ``get_bin_path`` to find the executable (https://github.com/ansible-collections/community.general/pull/3934).
- jira - fixed bug where module returns error related to dictionary key ``body``
(https://github.com/ansible-collections/community.general/issues/3419).
- lxd connection plugin - replace deprecated ``distutils.spawn.find_executable``
with Ansible's ``get_bin_path`` to find the ``lxc`` executable (https://github.com/ansible-collections/community.general/pull/3934).
- nrdp callback plugin - fix error ``string arguments without an encoding``
(https://github.com/ansible-collections/community.general/issues/3903).
- passwordstore lookup plugin - replace deprecated ``distutils.util.strtobool``
with Ansible's ``convert_bool.boolean`` to interpret values for the ``create``,
``returnall``, ``overwrite``, 'backup``, and ``nosymbols`` options (https://github.com/ansible-collections/community.general/pull/3934).
- say callback plugin - replace deprecated ``distutils.spawn.find_executable``
with Ansible's ``get_bin_path`` to find the ``say`` resp. ``espeak`` executables
(https://github.com/ansible-collections/community.general/pull/3934).
- scaleway_user_data - fix double-quote added where no double-quote is needed
to user data in scaleway's server (``Content-type`` -> ``Content-Type``) (https://github.com/ansible-collections/community.general/pull/3940).
- slack - add ``charset`` to HTTP headers to avoid Slack API warning (https://github.com/ansible-collections/community.general/issues/3932).
- zone connection plugin - replace deprecated ``distutils.spawn.find_executable``
with Ansible's ``get_bin_path`` to find the executable (https://github.com/ansible-collections/community.general/pull/3934).
release_summary: Regular bugfix release.
fragments:
- 3.8.4.yml
- 3867-jira-fix-body.yaml
- 3909-nrdp_fix_string_args_without_encoding.yaml
- 3933-slack-charset-header.yaml
- 3934-distutils.yml
- 3936-distutils.version.yml
- 3940_fix_contenttype_scaleway_user_data.yml
- 3976-fix-alternatives-parsing.yml
release_date: '2022-01-11'

View File

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

View File

@@ -45,6 +45,8 @@ class CallbackModule(CallbackBase):
_task_total = 0 _task_total = 0
_host_counter = 1 _host_counter = 1
_host_total = 0 _host_total = 0
_current_batch_total = 0
_previous_batch_total = 0
def __init__(self): def __init__(self):
super(CallbackModule, self).__init__() super(CallbackModule, self).__init__()
@@ -76,8 +78,11 @@ class CallbackModule(CallbackBase):
self._display.banner(msg) self._display.banner(msg)
self._play = play self._play = play
self._previous_batch_total = self._current_batch_total
self._current_batch_total = self._previous_batch_total + len(self._all_vars()['vars']['ansible_play_batch'])
self._host_total = len(self._all_vars()['vars']['ansible_play_hosts_all']) self._host_total = len(self._all_vars()['vars']['ansible_play_hosts_all'])
self._task_total = len(self._play.get_tasks()[0]) self._task_total = len(self._play.get_tasks()[0])
self._task_counter = 1
def v2_playbook_on_stats(self, stats): def v2_playbook_on_stats(self, stats):
self._display.banner("PLAY RECAP") self._display.banner("PLAY RECAP")
@@ -145,7 +150,7 @@ class CallbackModule(CallbackBase):
path = task.get_path() path = task.get_path()
if path: if path:
self._display.display("task path: %s" % path, color=C.COLOR_DEBUG) self._display.display("task path: %s" % path, color=C.COLOR_DEBUG)
self._host_counter = 0 self._host_counter = self._previous_batch_total
self._task_counter += 1 self._task_counter += 1
def v2_runner_on_ok(self, result): def v2_runner_on_ok(self, result):

View File

@@ -70,6 +70,7 @@ import os
import json import json
from ansible.module_utils.six.moves.urllib.parse import urlencode from ansible.module_utils.six.moves.urllib.parse import urlencode
from ansible.module_utils.common.text.converters import to_bytes
from ansible.module_utils.urls import open_url from ansible.module_utils.urls import open_url
from ansible.plugins.callback import CallbackBase from ansible.plugins.callback import CallbackBase
@@ -143,7 +144,7 @@ class CallbackModule(CallbackBase):
body = { body = {
'cmd': 'submitcheck', 'cmd': 'submitcheck',
'token': self.token, 'token': self.token,
'XMLDATA': bytes(xmldata) 'XMLDATA': to_bytes(xmldata)
} }
try: try:

View File

@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
# (C) 2021, Victor Martinez <VictorMartinezRubio@gmail.com> # (C) 2021, Victor Martinez <VictorMartinezRubio@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
@@ -263,6 +264,8 @@ class OpenTelemetrySource(object):
else: else:
message = 'skipped' message = 'skipped'
status = Status(status_code=StatusCode.UNSET) status = Status(status_code=StatusCode.UNSET)
elif host_data.status == 'ignored':
status = Status(status_code=StatusCode.UNSET)
span.set_status(status) span.set_status(status)
self.set_span_attribute(span, "ansible.task.args", task_data.args) self.set_span_attribute(span, "ansible.task.args", task_data.args)
@@ -392,10 +395,15 @@ class CallbackModule(CallbackBase):
) )
def v2_runner_on_failed(self, result, ignore_errors=False): def v2_runner_on_failed(self, result, ignore_errors=False):
self.errors += 1 if ignore_errors:
status = 'ignored'
else:
status = 'failed'
self.errors += 1
self.opentelemetry.finish_task( self.opentelemetry.finish_task(
self.tasks_data, self.tasks_data,
'failed', status,
result result
) )

View File

@@ -21,11 +21,11 @@ DOCUMENTATION = '''
- In 2.8, this callback has been renamed from C(osx_say) into M(community.general.say). - In 2.8, this callback has been renamed from C(osx_say) into M(community.general.say).
''' '''
import distutils.spawn
import platform import platform
import subprocess import subprocess
import os import os
from ansible.module_utils.common.process import get_bin_path
from ansible.plugins.callback import CallbackBase from ansible.plugins.callback import CallbackBase
@@ -47,21 +47,24 @@ class CallbackModule(CallbackBase):
self.HAPPY_VOICE = None self.HAPPY_VOICE = None
self.LASER_VOICE = None self.LASER_VOICE = None
self.synthesizer = distutils.spawn.find_executable('say') try:
if not self.synthesizer: self.synthesizer = get_bin_path('say')
self.synthesizer = distutils.spawn.find_executable('espeak') if platform.system() != 'Darwin':
if self.synthesizer: # 'say' binary available, it might be GNUstep tool which doesn't support 'voice' parameter
self._display.warning("'say' executable found but system is '%s': ignoring voice parameter" % platform.system())
else:
self.FAILED_VOICE = 'Zarvox'
self.REGULAR_VOICE = 'Trinoids'
self.HAPPY_VOICE = 'Cellos'
self.LASER_VOICE = 'Princess'
except ValueError:
try:
self.synthesizer = get_bin_path('espeak')
self.FAILED_VOICE = 'klatt' self.FAILED_VOICE = 'klatt'
self.HAPPY_VOICE = 'f5' self.HAPPY_VOICE = 'f5'
self.LASER_VOICE = 'whisper' self.LASER_VOICE = 'whisper'
elif platform.system() != 'Darwin': except ValueError:
# 'say' binary available, it might be GNUstep tool which doesn't support 'voice' parameter self.synthesizer = None
self._display.warning("'say' executable found but system is '%s': ignoring voice parameter" % platform.system())
else:
self.FAILED_VOICE = 'Zarvox'
self.REGULAR_VOICE = 'Trinoids'
self.HAPPY_VOICE = 'Cellos'
self.LASER_VOICE = 'Princess'
# plugin disable itself if say is not present # plugin disable itself if say is not present
# ansible will not call any callback if disabled is set to True # ansible will not call any callback if disabled is set to True

View File

@@ -31,7 +31,6 @@ DOCUMENTATION = '''
- name: ansible_jail_user - name: ansible_jail_user
''' '''
import distutils.spawn
import os import os
import os.path import os.path
import subprocess import subprocess
@@ -39,6 +38,7 @@ import traceback
from ansible.errors import AnsibleError from ansible.errors import AnsibleError
from ansible.module_utils.six.moves import shlex_quote from ansible.module_utils.six.moves import shlex_quote
from ansible.module_utils.common.process import get_bin_path
from ansible.module_utils.common.text.converters import to_bytes, to_native, to_text from ansible.module_utils.common.text.converters import to_bytes, to_native, to_text
from ansible.plugins.connection import ConnectionBase, BUFSIZE from ansible.plugins.connection import ConnectionBase, BUFSIZE
from ansible.utils.display import Display from ansible.utils.display import Display
@@ -75,10 +75,10 @@ class Connection(ConnectionBase):
@staticmethod @staticmethod
def _search_executable(executable): def _search_executable(executable):
cmd = distutils.spawn.find_executable(executable) try:
if not cmd: return get_bin_path(executable)
except ValueError:
raise AnsibleError("%s command not found in PATH" % executable) raise AnsibleError("%s command not found in PATH" % executable)
return cmd
def list_jails(self): def list_jails(self):
p = subprocess.Popen([self.jls_cmd, '-q', 'name'], p = subprocess.Popen([self.jls_cmd, '-q', 'name'],

View File

@@ -43,10 +43,10 @@ DOCUMENTATION = '''
''' '''
import os import os
from distutils.spawn import find_executable
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
from ansible.errors import AnsibleError, AnsibleConnectionFailure, AnsibleFileNotFound from ansible.errors import AnsibleError, AnsibleConnectionFailure, AnsibleFileNotFound
from ansible.module_utils.common.process import get_bin_path
from ansible.module_utils.common.text.converters import to_bytes, to_text from ansible.module_utils.common.text.converters import to_bytes, to_text
from ansible.plugins.connection import ConnectionBase from ansible.plugins.connection import ConnectionBase
@@ -62,9 +62,9 @@ class Connection(ConnectionBase):
super(Connection, self).__init__(play_context, new_stdin, *args, **kwargs) super(Connection, self).__init__(play_context, new_stdin, *args, **kwargs)
self._host = self._play_context.remote_addr self._host = self._play_context.remote_addr
self._lxc_cmd = find_executable("lxc") try:
self._lxc_cmd = get_bin_path("lxc")
if not self._lxc_cmd: except ValueError:
raise AnsibleError("lxc command not found in PATH") raise AnsibleError("lxc command not found in PATH")
if self._play_context.remote_user is not None and self._play_context.remote_user != 'root': if self._play_context.remote_user is not None and self._play_context.remote_user != 'root':
@@ -89,9 +89,9 @@ class Connection(ConnectionBase):
local_cmd.extend(["--project", self.get_option("project")]) local_cmd.extend(["--project", self.get_option("project")])
local_cmd.extend([ local_cmd.extend([
"exec", "exec",
"%s:%s" % (self.get_option("remote"), self._host), "%s:%s" % (self.get_option("remote"), self.get_option("remote_addr")),
"--", "--",
self._play_context.executable, "-c", cmd self.get_option("executable"), "-c", cmd
]) ])
local_cmd = [to_bytes(i, errors='surrogate_or_strict') for i in local_cmd] local_cmd = [to_bytes(i, errors='surrogate_or_strict') for i in local_cmd]
@@ -126,7 +126,7 @@ class Connection(ConnectionBase):
local_cmd.extend([ local_cmd.extend([
"file", "push", "file", "push",
in_path, in_path,
"%s:%s/%s" % (self.get_option("remote"), self._host, out_path) "%s:%s/%s" % (self.get_option("remote"), self.get_option("remote_addr"), out_path)
]) ])
local_cmd = [to_bytes(i, errors='surrogate_or_strict') for i in local_cmd] local_cmd = [to_bytes(i, errors='surrogate_or_strict') for i in local_cmd]
@@ -145,7 +145,7 @@ class Connection(ConnectionBase):
local_cmd.extend(["--project", self.get_option("project")]) local_cmd.extend(["--project", self.get_option("project")])
local_cmd.extend([ local_cmd.extend([
"file", "pull", "file", "pull",
"%s:%s/%s" % (self.get_option("remote"), self._host, in_path), "%s:%s/%s" % (self.get_option("remote"), self.get_option("remote_addr"), in_path),
out_path out_path
]) ])

View File

@@ -26,7 +26,6 @@ DOCUMENTATION = '''
- name: ansible_zone_host - name: ansible_zone_host
''' '''
import distutils.spawn
import os import os
import os.path import os.path
import subprocess import subprocess
@@ -34,6 +33,7 @@ import traceback
from ansible.errors import AnsibleError from ansible.errors import AnsibleError
from ansible.module_utils.six.moves import shlex_quote from ansible.module_utils.six.moves import shlex_quote
from ansible.module_utils.common.process import get_bin_path
from ansible.module_utils.common.text.converters import to_bytes from ansible.module_utils.common.text.converters import to_bytes
from ansible.plugins.connection import ConnectionBase, BUFSIZE from ansible.plugins.connection import ConnectionBase, BUFSIZE
from ansible.utils.display import Display from ansible.utils.display import Display
@@ -64,10 +64,10 @@ class Connection(ConnectionBase):
@staticmethod @staticmethod
def _search_executable(executable): def _search_executable(executable):
cmd = distutils.spawn.find_executable(executable) try:
if not cmd: return get_bin_path(executable)
except ValueError:
raise AnsibleError("%s command not found in PATH" % executable) raise AnsibleError("%s command not found in PATH" % executable)
return cmd
def list_zones(self): def list_zones(self):
process = subprocess.Popen([self.zoneadm_cmd, 'list', '-ip'], process = subprocess.Popen([self.zoneadm_cmd, 'list', '-ip'],

View File

@@ -5,7 +5,7 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
from distutils.version import LooseVersion from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
def version_sort(value, reverse=False): def version_sort(value, reverse=False):

View File

@@ -68,7 +68,6 @@ user: ansible-tester
password: secure password: secure
''' '''
from distutils.version import LooseVersion
import socket import socket
from ansible.errors import AnsibleError from ansible.errors import AnsibleError

View File

@@ -8,7 +8,7 @@ __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r'''
name: online name: online
author: author:
- Remy Leone (@sieben) - Remy Leone (@remyleone)
short_description: Scaleway (previously Online SAS or Online.net) inventory source short_description: Scaleway (previously Online SAS or Online.net) inventory source
description: description:
- Get inventory hosts from Scaleway (previously Online SAS or Online.net). - Get inventory hosts from Scaleway (previously Online SAS or Online.net).

View File

@@ -119,12 +119,13 @@ compose:
import re import re
from ansible.module_utils.common._collections_compat import MutableMapping from ansible.module_utils.common._collections_compat import MutableMapping
from distutils.version import LooseVersion
from ansible.errors import AnsibleError from ansible.errors import AnsibleError
from ansible.plugins.inventory import BaseInventoryPlugin, Constructable, Cacheable from ansible.plugins.inventory import BaseInventoryPlugin, Constructable, Cacheable
from ansible.module_utils.six.moves.urllib.parse import urlencode from ansible.module_utils.six.moves.urllib.parse import urlencode
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
# 3rd party imports # 3rd party imports
try: try:
import requests import requests

View File

@@ -9,7 +9,7 @@ __metaclass__ = type
DOCUMENTATION = r''' DOCUMENTATION = r'''
name: scaleway name: scaleway
author: author:
- Remy Leone (@sieben) - Remy Leone (@remyleone)
short_description: Scaleway inventory source short_description: Scaleway inventory source
description: description:
- Get inventory hosts from Scaleway. - Get inventory hosts from Scaleway.

View File

@@ -93,7 +93,7 @@ DOCUMENTATION = '''
environment variable and keep I(endpoints), I(host), and I(port) unused. environment variable and keep I(endpoints), I(host), and I(port) unused.
seealso: seealso:
- module: community.general.etcd3 - module: community.general.etcd3
- ref: etcd_lookup - ref: ansible_collections.community.general.etcd_lookup
description: The etcd v2 lookup. description: The etcd v2 lookup.
requirements: requirements:

View File

@@ -23,7 +23,7 @@ DOCUMENTATION = '''
EXAMPLES = """ EXAMPLES = """
- name: "'unnest' all elements into single list" - name: "'unnest' all elements into single list"
ansible.builtin.debug: ansible.builtin.debug:
msg: "all in one list {{lookup('community.general.flattened', [1,2,3,[5,6]], [a,b,c], [[5,6,1,3], [34,a,b,c]])}}" msg: "all in one list {{lookup('community.general.flattened', [1,2,3,[5,6]], ['a','b','c'], [[5,6,1,3], [34,'a','b','c']])}}"
""" """
RETURN = """ RETURN = """

View File

@@ -141,9 +141,9 @@ import time
import yaml import yaml
from distutils import util
from ansible.errors import AnsibleError, AnsibleAssertionError from ansible.errors import AnsibleError, AnsibleAssertionError
from ansible.module_utils.common.text.converters import to_bytes, to_native, to_text from ansible.module_utils.common.text.converters import to_bytes, to_native, to_text
from ansible.module_utils.parsing.convert_bool import boolean
from ansible.utils.display import Display from ansible.utils.display import Display
from ansible.utils.encrypt import random_password from ansible.utils.encrypt import random_password
from ansible.plugins.lookup import LookupBase from ansible.plugins.lookup import LookupBase
@@ -211,7 +211,7 @@ class LookupModule(LookupBase):
try: try:
for key in ['create', 'returnall', 'overwrite', 'backup', 'nosymbols']: for key in ['create', 'returnall', 'overwrite', 'backup', 'nosymbols']:
if not isinstance(self.paramvals[key], bool): if not isinstance(self.paramvals[key], bool):
self.paramvals[key] = util.strtobool(self.paramvals[key]) self.paramvals[key] = boolean(self.paramvals[key])
except (ValueError, AssertionError) as e: except (ValueError, AssertionError) as e:
raise AnsibleError(e) raise AnsibleError(e)
if self.paramvals['missing'] not in ['error', 'warn', 'create', 'empty']: if self.paramvals['missing'] not in ['error', 'warn', 'create', 'empty']:

View File

@@ -0,0 +1,343 @@
# Vendored copy of distutils/version.py from CPython 3.9.5
#
# Implements multiple version numbering conventions for the
# Python Module Distribution Utilities.
#
# PSF License (see licenses/PSF-license.txt or https://opensource.org/licenses/Python-2.0)
#
"""Provides classes to represent module version numbers (one class for
each style of version numbering). There are currently two such classes
implemented: StrictVersion and LooseVersion.
Every version number class implements the following interface:
* the 'parse' method takes a string and parses it to some internal
representation; if the string is an invalid version number,
'parse' raises a ValueError exception
* the class constructor takes an optional string argument which,
if supplied, is passed to 'parse'
* __str__ reconstructs the string that was passed to 'parse' (or
an equivalent string -- ie. one that will generate an equivalent
version number instance)
* __repr__ generates Python code to recreate the version number instance
* _cmp compares the current instance with either another instance
of the same class or a string (which will be parsed to an instance
of the same class, thus must follow the same rules)
"""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
try:
RE_FLAGS = re.VERBOSE | re.ASCII
except AttributeError:
RE_FLAGS = re.VERBOSE
class Version:
"""Abstract base class for version numbering classes. Just provides
constructor (__init__) and reproducer (__repr__), because those
seem to be the same for all version numbering classes; and route
rich comparisons to _cmp.
"""
def __init__(self, vstring=None):
if vstring:
self.parse(vstring)
def __repr__(self):
return "%s ('%s')" % (self.__class__.__name__, str(self))
def __eq__(self, other):
c = self._cmp(other)
if c is NotImplemented:
return c
return c == 0
def __lt__(self, other):
c = self._cmp(other)
if c is NotImplemented:
return c
return c < 0
def __le__(self, other):
c = self._cmp(other)
if c is NotImplemented:
return c
return c <= 0
def __gt__(self, other):
c = self._cmp(other)
if c is NotImplemented:
return c
return c > 0
def __ge__(self, other):
c = self._cmp(other)
if c is NotImplemented:
return c
return c >= 0
# Interface for version-number classes -- must be implemented
# by the following classes (the concrete ones -- Version should
# be treated as an abstract class).
# __init__ (string) - create and take same action as 'parse'
# (string parameter is optional)
# parse (string) - convert a string representation to whatever
# internal representation is appropriate for
# this style of version numbering
# __str__ (self) - convert back to a string; should be very similar
# (if not identical to) the string supplied to parse
# __repr__ (self) - generate Python code to recreate
# the instance
# _cmp (self, other) - compare two version numbers ('other' may
# be an unparsed version string, or another
# instance of your version class)
class StrictVersion(Version):
"""Version numbering for anal retentives and software idealists.
Implements the standard interface for version number classes as
described above. A version number consists of two or three
dot-separated numeric components, with an optional "pre-release" tag
on the end. The pre-release tag consists of the letter 'a' or 'b'
followed by a number. If the numeric components of two version
numbers are equal, then one with a pre-release tag will always
be deemed earlier (lesser) than one without.
The following are valid version numbers (shown in the order that
would be obtained by sorting according to the supplied cmp function):
0.4 0.4.0 (these two are equivalent)
0.4.1
0.5a1
0.5b3
0.5
0.9.6
1.0
1.0.4a3
1.0.4b1
1.0.4
The following are examples of invalid version numbers:
1
2.7.2.2
1.3.a4
1.3pl1
1.3c4
The rationale for this version numbering system will be explained
in the distutils documentation.
"""
version_re = re.compile(r'^(\d+) \. (\d+) (\. (\d+))? ([ab](\d+))?$',
RE_FLAGS)
def parse(self, vstring):
match = self.version_re.match(vstring)
if not match:
raise ValueError("invalid version number '%s'" % vstring)
(major, minor, patch, prerelease, prerelease_num) = \
match.group(1, 2, 4, 5, 6)
if patch:
self.version = tuple(map(int, [major, minor, patch]))
else:
self.version = tuple(map(int, [major, minor])) + (0,)
if prerelease:
self.prerelease = (prerelease[0], int(prerelease_num))
else:
self.prerelease = None
def __str__(self):
if self.version[2] == 0:
vstring = '.'.join(map(str, self.version[0:2]))
else:
vstring = '.'.join(map(str, self.version))
if self.prerelease:
vstring = vstring + self.prerelease[0] + str(self.prerelease[1])
return vstring
def _cmp(self, other):
if isinstance(other, str):
other = StrictVersion(other)
elif not isinstance(other, StrictVersion):
return NotImplemented
if self.version != other.version:
# numeric versions don't match
# prerelease stuff doesn't matter
if self.version < other.version:
return -1
else:
return 1
# have to compare prerelease
# case 1: neither has prerelease; they're equal
# case 2: self has prerelease, other doesn't; other is greater
# case 3: self doesn't have prerelease, other does: self is greater
# case 4: both have prerelease: must compare them!
if (not self.prerelease and not other.prerelease):
return 0
elif (self.prerelease and not other.prerelease):
return -1
elif (not self.prerelease and other.prerelease):
return 1
elif (self.prerelease and other.prerelease):
if self.prerelease == other.prerelease:
return 0
elif self.prerelease < other.prerelease:
return -1
else:
return 1
else:
raise AssertionError("never get here")
# end class StrictVersion
# The rules according to Greg Stein:
# 1) a version number has 1 or more numbers separated by a period or by
# sequences of letters. If only periods, then these are compared
# left-to-right to determine an ordering.
# 2) sequences of letters are part of the tuple for comparison and are
# compared lexicographically
# 3) recognize the numeric components may have leading zeroes
#
# The LooseVersion class below implements these rules: a version number
# string is split up into a tuple of integer and string components, and
# comparison is a simple tuple comparison. This means that version
# numbers behave in a predictable and obvious way, but a way that might
# not necessarily be how people *want* version numbers to behave. There
# wouldn't be a problem if people could stick to purely numeric version
# numbers: just split on period and compare the numbers as tuples.
# However, people insist on putting letters into their version numbers;
# the most common purpose seems to be:
# - indicating a "pre-release" version
# ('alpha', 'beta', 'a', 'b', 'pre', 'p')
# - indicating a post-release patch ('p', 'pl', 'patch')
# but of course this can't cover all version number schemes, and there's
# no way to know what a programmer means without asking him.
#
# The problem is what to do with letters (and other non-numeric
# characters) in a version number. The current implementation does the
# obvious and predictable thing: keep them as strings and compare
# lexically within a tuple comparison. This has the desired effect if
# an appended letter sequence implies something "post-release":
# eg. "0.99" < "0.99pl14" < "1.0", and "5.001" < "5.001m" < "5.002".
#
# However, if letters in a version number imply a pre-release version,
# the "obvious" thing isn't correct. Eg. you would expect that
# "1.5.1" < "1.5.2a2" < "1.5.2", but under the tuple/lexical comparison
# implemented here, this just isn't so.
#
# Two possible solutions come to mind. The first is to tie the
# comparison algorithm to a particular set of semantic rules, as has
# been done in the StrictVersion class above. This works great as long
# as everyone can go along with bondage and discipline. Hopefully a
# (large) subset of Python module programmers will agree that the
# particular flavour of bondage and discipline provided by StrictVersion
# provides enough benefit to be worth using, and will submit their
# version numbering scheme to its domination. The free-thinking
# anarchists in the lot will never give in, though, and something needs
# to be done to accommodate them.
#
# Perhaps a "moderately strict" version class could be implemented that
# lets almost anything slide (syntactically), and makes some heuristic
# assumptions about non-digits in version number strings. This could
# sink into special-case-hell, though; if I was as talented and
# idiosyncratic as Larry Wall, I'd go ahead and implement a class that
# somehow knows that "1.2.1" < "1.2.2a2" < "1.2.2" < "1.2.2pl3", and is
# just as happy dealing with things like "2g6" and "1.13++". I don't
# think I'm smart enough to do it right though.
#
# In any case, I've coded the test suite for this module (see
# ../test/test_version.py) specifically to fail on things like comparing
# "1.2a2" and "1.2". That's not because the *code* is doing anything
# wrong, it's because the simple, obvious design doesn't match my
# complicated, hairy expectations for real-world version numbers. It
# would be a snap to fix the test suite to say, "Yep, LooseVersion does
# the Right Thing" (ie. the code matches the conception). But I'd rather
# have a conception that matches common notions about version numbers.
class LooseVersion(Version):
"""Version numbering for anarchists and software realists.
Implements the standard interface for version number classes as
described above. A version number consists of a series of numbers,
separated by either periods or strings of letters. When comparing
version numbers, the numeric components will be compared
numerically, and the alphabetic components lexically. The following
are all valid version numbers, in no particular order:
1.5.1
1.5.2b2
161
3.10a
8.02
3.4j
1996.07.12
3.2.pl0
3.1.1.6
2g6
11g
0.960923
2.2beta29
1.13++
5.5.kw
2.0b1pl0
In fact, there is no such thing as an invalid version number under
this scheme; the rules for comparison are simple and predictable,
but may not always give the results you want (for some definition
of "want").
"""
component_re = re.compile(r'(\d+ | [a-z]+ | \.)', re.VERBOSE)
def __init__(self, vstring=None):
if vstring:
self.parse(vstring)
def parse(self, vstring):
# I've given up on thinking I can reconstruct the version string
# from the parsed tuple -- so I just store the string here for
# use by __str__
self.vstring = vstring
components = [x for x in self.component_re.split(vstring) if x and x != '.']
for i, obj in enumerate(components):
try:
components[i] = int(obj)
except ValueError:
pass
self.version = components
def __str__(self):
return self.vstring
def __repr__(self):
return "LooseVersion ('%s')" % str(self)
def _cmp(self, other):
if isinstance(other, str):
other = LooseVersion(other)
elif not isinstance(other, LooseVersion):
return NotImplemented
if self.version == other.version:
return 0
if self.version < other.version:
return -1
if self.version > other.version:
return 1
# end class LooseVersion

View File

@@ -8,12 +8,13 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import json import json
from distutils.version import StrictVersion
from ansible.module_utils.basic import missing_required_lib from ansible.module_utils.basic import missing_required_lib
from ansible.module_utils.urls import fetch_url from ansible.module_utils.urls import fetch_url
from ansible.module_utils.common.text.converters import to_native from ansible.module_utils.common.text.converters import to_native
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
try: try:
from urllib import quote_plus # Python 2.X from urllib import quote_plus # Python 2.X
except ImportError: except ImportError:
@@ -90,7 +91,7 @@ def gitlabAuthentication(module):
# python-gitlab library remove support for username/password authentication since 1.13.0 # python-gitlab library remove support for username/password authentication since 1.13.0
# Changelog : https://github.com/python-gitlab/python-gitlab/releases/tag/v1.13.0 # Changelog : https://github.com/python-gitlab/python-gitlab/releases/tag/v1.13.0
# This condition allow to still support older version of the python-gitlab library # This condition allow to still support older version of the python-gitlab library
if StrictVersion(gitlab.__version__) < StrictVersion("1.13.0"): if LooseVersion(gitlab.__version__) < LooseVersion("1.13.0"):
gitlab_instance = gitlab.Gitlab(url=gitlab_url, ssl_verify=validate_certs, email=gitlab_user, password=gitlab_password, gitlab_instance = gitlab.Gitlab(url=gitlab_url, ssl_verify=validate_certs, email=gitlab_user, password=gitlab_password,
private_token=gitlab_token, api_version=4) private_token=gitlab_token, api_version=4)
else: else:

View File

@@ -9,7 +9,8 @@ __metaclass__ = type
import traceback import traceback
from ansible.module_utils.basic import missing_required_lib from ansible.module_utils.basic import missing_required_lib
from distutils.version import LooseVersion
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
REQUESTS_IMP_ERR = None REQUESTS_IMP_ERR = None
try: try:

View File

@@ -31,6 +31,7 @@ def _env_then_dns_fallback(*args, **kwargs):
result = env_fallback(*args, **kwargs) result = env_fallback(*args, **kwargs)
if result == '': if result == '':
raise AnsibleFallbackNotFound raise AnsibleFallbackNotFound
return result
except AnsibleFallbackNotFound: except AnsibleFallbackNotFound:
# If no host was given, we try to guess it from IPA. # If no host was given, we try to guess it from IPA.
# The ipa-ca entry is a standard entry that IPA will have set for # The ipa-ca entry is a standard entry that IPA will have set for

View File

@@ -54,6 +54,17 @@ def proxmox_to_ansible_bool(value):
return True if value == 1 else False return True if value == 1 else False
def ansible_to_proxmox_bool(value):
'''Convert Ansible representation of a boolean to be proxmox-friendly'''
if value is None:
return None
if not isinstance(value, bool):
raise ValueError("%s must be of type bool not %s" % (value, type(value)))
return 1 if value else 0
class ProxmoxAnsible(object): class ProxmoxAnsible(object):
"""Base class for Proxmox modules""" """Base class for Proxmox modules"""
def __init__(self, module): def __init__(self, module):

View File

@@ -1605,9 +1605,6 @@ class RedfishUtils(object):
cur_boot_next = boot.get('BootNext') cur_boot_next = boot.get('BootNext')
cur_override_mode = boot.get('BootSourceOverrideMode') cur_override_mode = boot.get('BootSourceOverrideMode')
if not boot_override_mode:
boot_override_mode = cur_override_mode
if override_enabled == 'Disabled': if override_enabled == 'Disabled':
payload = { payload = {
'Boot': { 'Boot': {
@@ -1643,16 +1640,18 @@ class RedfishUtils(object):
} }
} }
else: else:
if cur_enabled == override_enabled and target == bootdevice and cur_override_mode == boot_override_mode: if (cur_enabled == override_enabled and target == bootdevice and
(cur_override_mode == boot_override_mode or not boot_override_mode)):
# If properties are already set, no changes needed # If properties are already set, no changes needed
return {'ret': True, 'changed': False} return {'ret': True, 'changed': False}
payload = { payload = {
'Boot': { 'Boot': {
'BootSourceOverrideEnabled': override_enabled, 'BootSourceOverrideEnabled': override_enabled,
'BootSourceOverrideMode': boot_override_mode,
'BootSourceOverrideTarget': bootdevice 'BootSourceOverrideTarget': bootdevice
} }
} }
if boot_override_mode:
payload['Boot']['BootSourceOverrideMode'] = boot_override_mode
response = self.patch_request(self.root_uri + self.systems_uri, payload) response = self.patch_request(self.root_uri + self.systems_uri, payload)
if response['ret'] is False: if response['ret'] is False:
@@ -2762,7 +2761,9 @@ class RedfishUtils(object):
if isinstance(set_value, dict): if isinstance(set_value, dict):
for subprop in payload[property].keys(): for subprop in payload[property].keys():
if subprop not in target_ethernet_current_setting[property]: if subprop not in target_ethernet_current_setting[property]:
return {'ret': False, 'msg': "Sub-property %s in nic_config is invalid" % subprop} # Not configured already; need to apply the request
need_change = True
break
sub_set_value = payload[property][subprop] sub_set_value = payload[property][subprop]
sub_cur_value = target_ethernet_current_setting[property][subprop] sub_cur_value = target_ethernet_current_setting[property][subprop]
if sub_set_value != sub_cur_value: if sub_set_value != sub_cur_value:
@@ -2776,7 +2777,9 @@ class RedfishUtils(object):
for i in range(len(set_value)): for i in range(len(set_value)):
for subprop in payload[property][i].keys(): for subprop in payload[property][i].keys():
if subprop not in target_ethernet_current_setting[property][i]: if subprop not in target_ethernet_current_setting[property][i]:
return {'ret': False, 'msg': "Sub-property %s in nic_config is invalid" % subprop} # Not configured already; need to apply the request
need_change = True
break
sub_set_value = payload[property][i][subprop] sub_set_value = payload[property][i][subprop]
sub_cur_value = target_ethernet_current_setting[property][i][subprop] sub_cur_value = target_ethernet_current_setting[property][i][subprop]
if sub_set_value != sub_cur_value: if sub_set_value != sub_cur_value:

View File

@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
# Copyright: (c) 2021, Felix Fontein <felix@fontein.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""Provide version object to compare version numbers."""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
# Once we drop support for Ansible 2.9, ansible-base 2.10, and ansible-core 2.11, we can
# remove the _version.py file, and replace the following import by
#
# from ansible.module_utils.compat.version import LooseVersion
from ._version import LooseVersion

View File

@@ -120,7 +120,7 @@ __version__ = '${version}'
import os import os
import traceback import traceback
from distutils.version import LooseVersion from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
REQUESTS_IMP_ERR = None REQUESTS_IMP_ERR = None
try: try:

View File

@@ -161,7 +161,8 @@ __version__ = '${version}'
import json import json
import os import os
import traceback import traceback
from distutils.version import LooseVersion
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
REQUESTS_IMP_ERR = None REQUESTS_IMP_ERR = None
try: try:

View File

@@ -89,7 +89,8 @@ __version__ = '${version}'
import os import os
import traceback import traceback
from distutils.version import LooseVersion
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
REQUESTS_IMP_ERR = None REQUESTS_IMP_ERR = None
try: try:
@@ -132,8 +133,7 @@ class ClcBlueprintPackage:
self.module.fail_json(msg=missing_required_lib('clc-sdk'), exception=CLC_IMP_ERR) self.module.fail_json(msg=missing_required_lib('clc-sdk'), exception=CLC_IMP_ERR)
if not REQUESTS_FOUND: if not REQUESTS_FOUND:
self.module.fail_json(msg=missing_required_lib('requests'), exception=REQUESTS_IMP_ERR) self.module.fail_json(msg=missing_required_lib('requests'), exception=REQUESTS_IMP_ERR)
if requests.__version__ and LooseVersion( if requests.__version__ and LooseVersion(requests.__version__) < LooseVersion('2.5.0'):
requests.__version__) < LooseVersion('2.5.0'):
self.module.fail_json( self.module.fail_json(
msg='requests library version should be >= 2.5.0') msg='requests library version should be >= 2.5.0')

View File

@@ -162,7 +162,8 @@ import os
import traceback import traceback
from ansible.module_utils.six.moves.urllib.parse import urlparse from ansible.module_utils.six.moves.urllib.parse import urlparse
from time import sleep from time import sleep
from distutils.version import LooseVersion
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
REQUESTS_IMP_ERR = None REQUESTS_IMP_ERR = None
try: try:
@@ -203,8 +204,7 @@ class ClcFirewallPolicy:
self.module.fail_json(msg=missing_required_lib('clc-sdk'), exception=CLC_IMP_ERR) self.module.fail_json(msg=missing_required_lib('clc-sdk'), exception=CLC_IMP_ERR)
if not REQUESTS_FOUND: if not REQUESTS_FOUND:
self.module.fail_json(msg=missing_required_lib('requests'), exception=REQUESTS_IMP_ERR) self.module.fail_json(msg=missing_required_lib('requests'), exception=REQUESTS_IMP_ERR)
if requests.__version__ and LooseVersion( if requests.__version__ and LooseVersion(requests.__version__) < LooseVersion('2.5.0'):
requests.__version__) < LooseVersion('2.5.0'):
self.module.fail_json( self.module.fail_json(
msg='requests library version should be >= 2.5.0') msg='requests library version should be >= 2.5.0')

View File

@@ -207,7 +207,8 @@ __version__ = '${version}'
import os import os
import traceback import traceback
from distutils.version import LooseVersion
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
REQUESTS_IMP_ERR = None REQUESTS_IMP_ERR = None
try: try:

View File

@@ -210,7 +210,8 @@ import json
import os import os
import traceback import traceback
from time import sleep from time import sleep
from distutils.version import LooseVersion
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
REQUESTS_IMP_ERR = None REQUESTS_IMP_ERR = None
try: try:
@@ -255,8 +256,7 @@ class ClcLoadBalancer:
self.module.fail_json(msg=missing_required_lib('clc-sdk'), exception=CLC_IMP_ERR) self.module.fail_json(msg=missing_required_lib('clc-sdk'), exception=CLC_IMP_ERR)
if not REQUESTS_FOUND: if not REQUESTS_FOUND:
self.module.fail_json(msg=missing_required_lib('requests'), exception=REQUESTS_IMP_ERR) self.module.fail_json(msg=missing_required_lib('requests'), exception=REQUESTS_IMP_ERR)
if requests.__version__ and LooseVersion( if requests.__version__ and LooseVersion(requests.__version__) < LooseVersion('2.5.0'):
requests.__version__) < LooseVersion('2.5.0'):
self.module.fail_json( self.module.fail_json(
msg='requests library version should be >= 2.5.0') msg='requests library version should be >= 2.5.0')

View File

@@ -311,7 +311,8 @@ __version__ = '${version}'
import json import json
import os import os
import traceback import traceback
from distutils.version import LooseVersion
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
REQUESTS_IMP_ERR = None REQUESTS_IMP_ERR = None
try: try:
@@ -355,8 +356,7 @@ class ClcModifyServer:
self.module.fail_json(msg=missing_required_lib('clc-sdk'), exception=CLC_IMP_ERR) self.module.fail_json(msg=missing_required_lib('clc-sdk'), exception=CLC_IMP_ERR)
if not REQUESTS_FOUND: if not REQUESTS_FOUND:
self.module.fail_json(msg=missing_required_lib('requests'), exception=REQUESTS_IMP_ERR) self.module.fail_json(msg=missing_required_lib('requests'), exception=REQUESTS_IMP_ERR)
if requests.__version__ and LooseVersion( if requests.__version__ and LooseVersion(requests.__version__) < LooseVersion('2.5.0'):
requests.__version__) < LooseVersion('2.5.0'):
self.module.fail_json( self.module.fail_json(
msg='requests library version should be >= 2.5.0') msg='requests library version should be >= 2.5.0')

View File

@@ -117,7 +117,8 @@ __version__ = '${version}'
import os import os
import traceback import traceback
from distutils.version import LooseVersion
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
REQUESTS_IMP_ERR = None REQUESTS_IMP_ERR = None
try: try:

View File

@@ -433,7 +433,8 @@ import json
import os import os
import time import time
import traceback import traceback
from distutils.version import LooseVersion
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
REQUESTS_IMP_ERR = None REQUESTS_IMP_ERR = None
try: try:
@@ -478,8 +479,7 @@ class ClcServer:
self.module.fail_json(msg=missing_required_lib('clc-sdk'), exception=CLC_IMP_ERR) self.module.fail_json(msg=missing_required_lib('clc-sdk'), exception=CLC_IMP_ERR)
if not REQUESTS_FOUND: if not REQUESTS_FOUND:
self.module.fail_json(msg=missing_required_lib('requests'), exception=REQUESTS_IMP_ERR) self.module.fail_json(msg=missing_required_lib('requests'), exception=REQUESTS_IMP_ERR)
if requests.__version__ and LooseVersion( if requests.__version__ and LooseVersion(requests.__version__) < LooseVersion('2.5.0'):
requests.__version__) < LooseVersion('2.5.0'):
self.module.fail_json( self.module.fail_json(
msg='requests library version should be >= 2.5.0') msg='requests library version should be >= 2.5.0')

View File

@@ -101,7 +101,8 @@ __version__ = '${version}'
import os import os
import traceback import traceback
from distutils.version import LooseVersion
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
REQUESTS_IMP_ERR = None REQUESTS_IMP_ERR = None
try: try:
@@ -145,8 +146,7 @@ class ClcSnapshot:
self.module.fail_json(msg=missing_required_lib('clc-sdk'), exception=CLC_IMP_ERR) self.module.fail_json(msg=missing_required_lib('clc-sdk'), exception=CLC_IMP_ERR)
if not REQUESTS_FOUND: if not REQUESTS_FOUND:
self.module.fail_json(msg=missing_required_lib('requests'), exception=REQUESTS_IMP_ERR) self.module.fail_json(msg=missing_required_lib('requests'), exception=REQUESTS_IMP_ERR)
if requests.__version__ and LooseVersion( if requests.__version__ and LooseVersion(requests.__version__) < LooseVersion('2.5.0'):
requests.__version__) < LooseVersion('2.5.0'):
self.module.fail_json( self.module.fail_json(
msg='requests library version should be >= 2.5.0') msg='requests library version should be >= 2.5.0')

View File

@@ -363,7 +363,8 @@ EXAMPLES = r'''
import time import time
import traceback import traceback
from distutils.version import LooseVersion
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
try: try:
from proxmoxer import ProxmoxAPI from proxmoxer import ProxmoxAPI
@@ -374,6 +375,10 @@ except ImportError:
from ansible.module_utils.basic import AnsibleModule, env_fallback from ansible.module_utils.basic import AnsibleModule, env_fallback
from ansible.module_utils.common.text.converters import to_native from ansible.module_utils.common.text.converters import to_native
from ansible_collections.community.general.plugins.module_utils.proxmox import (
ansible_to_proxmox_bool
)
VZ_TYPE = None VZ_TYPE = None
@@ -627,14 +632,14 @@ def main():
netif=module.params['netif'], netif=module.params['netif'],
mounts=module.params['mounts'], mounts=module.params['mounts'],
ip_address=module.params['ip_address'], ip_address=module.params['ip_address'],
onboot=int(module.params['onboot']), onboot=ansible_to_proxmox_bool(module.params['onboot']),
cpuunits=module.params['cpuunits'], cpuunits=module.params['cpuunits'],
nameserver=module.params['nameserver'], nameserver=module.params['nameserver'],
searchdomain=module.params['searchdomain'], searchdomain=module.params['searchdomain'],
force=int(module.params['force']), force=ansible_to_proxmox_bool(module.params['force']),
pubkey=module.params['pubkey'], pubkey=module.params['pubkey'],
features=",".join(module.params['features']) if module.params['features'] is not None else None, features=",".join(module.params['features']) if module.params['features'] is not None else None,
unprivileged=int(module.params['unprivileged']), unprivileged=ansible_to_proxmox_bool(module.params['unprivileged']),
description=module.params['description'], description=module.params['description'],
hookscript=module.params['hookscript']) hookscript=module.params['hookscript'])

View File

@@ -131,7 +131,7 @@ def main():
group = module.params['group'] group = module.params['group']
if group: if group:
groups = [proxmox.get_group(group=group)] groups = [proxmox.get_group(groupid=group)]
else: else:
groups = proxmox.get_groups() groups = proxmox.get_groups()
result['proxmox_groups'] = [group.group for group in groups] result['proxmox_groups'] = [group.group for group in groups]

View File

@@ -761,9 +761,10 @@ msg:
import re import re
import time import time
import traceback import traceback
from distutils.version import LooseVersion
from ansible.module_utils.six.moves.urllib.parse import quote from ansible.module_utils.six.moves.urllib.parse import quote
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
try: try:
from proxmoxer import ProxmoxAPI from proxmoxer import ProxmoxAPI
HAS_PROXMOXER = True HAS_PROXMOXER = True

View File

@@ -230,11 +230,12 @@ command:
import os import os
import json import json
import tempfile import tempfile
from distutils.version import LooseVersion
from ansible.module_utils.six.moves import shlex_quote from ansible.module_utils.six.moves import shlex_quote
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
module = None module = None
@@ -319,11 +320,25 @@ def remove_workspace(bin_path, project_path, workspace):
_workspace_cmd(bin_path, project_path, 'delete', workspace) _workspace_cmd(bin_path, project_path, 'delete', workspace)
def build_plan(command, project_path, variables_args, state_file, targets, state, plan_path=None): def build_plan(command, project_path, variables_args, state_file, targets, state, apply_args, plan_path=None):
if plan_path is None: if plan_path is None:
f, plan_path = tempfile.mkstemp(suffix='.tfplan') f, plan_path = tempfile.mkstemp(suffix='.tfplan')
plan_command = [command[0], 'plan', '-input=false', '-no-color', '-detailed-exitcode', '-out', plan_path] local_command = command.copy()
plan_command = [command[0], 'plan']
if state == "planned":
for c in local_command[1:]:
plan_command.append(c)
if state == "present":
for a in apply_args:
local_command.remove(a)
for c in local_command[1:]:
plan_command.append(c)
plan_command.extend(['-input=false', '-no-color', '-detailed-exitcode', '-out', plan_path])
for t in targets: for t in targets:
plan_command.extend(['-target', t]) plan_command.extend(['-target', t])
@@ -461,7 +476,7 @@ def main():
module.fail_json(msg='Could not find plan_file "{0}", check the path and try again.'.format(plan_file)) module.fail_json(msg='Could not find plan_file "{0}", check the path and try again.'.format(plan_file))
else: else:
plan_file, needs_application, out, err, command = build_plan(command, project_path, variables_args, state_file, plan_file, needs_application, out, err, command = build_plan(command, project_path, variables_args, state_file,
module.params.get('targets'), state, plan_file) module.params.get('targets'), state, APPLY_ARGS, plan_file)
if state == 'present' and check_destroy and '- destroy' in out: if state == 'present' and check_destroy and '- destroy' in out:
module.fail_json(msg="Aborting command because it would destroy some resources. " module.fail_json(msg="Aborting command because it would destroy some resources. "
"Consider switching the 'check_destroy' to false to suppress this error") "Consider switching the 'check_destroy' to false to suppress this error")

View File

@@ -15,7 +15,7 @@ description:
- Gather information about the servers. - Gather information about the servers.
- U(https://www.online.net/en/dedicated-server) - U(https://www.online.net/en/dedicated-server)
author: author:
- "Remy Leone (@sieben)" - "Remy Leone (@remyleone)"
extends_documentation_fragment: extends_documentation_fragment:
- community.general.online - community.general.online

View File

@@ -12,7 +12,7 @@ short_description: Gather information about Online user.
description: description:
- Gather information about the user. - Gather information about the user.
author: author:
- "Remy Leone (@sieben)" - "Remy Leone (@remyleone)"
extends_documentation_fragment: extends_documentation_fragment:
- community.general.online - community.general.online
''' '''

View File

@@ -306,7 +306,7 @@ def rename_image(module, client, image, new_name):
tmp_image = get_image_by_name(module, client, new_name) tmp_image = get_image_by_name(module, client, new_name)
if tmp_image: if tmp_image:
module.fail_json(msg="Name '" + new_name + "' is already taken by IMAGE with id=" + str(tmp_image.id)) module.fail_json(msg="Name '" + new_name + "' is already taken by IMAGE with id=" + str(tmp_image.ID))
if not module.check_mode: if not module.check_mode:
client.image.rename(image.ID, new_name) client.image.rename(image.ID, new_name)

View File

@@ -97,7 +97,7 @@ EXAMPLES = '''
register: my_volume register: my_volume
''' '''
from distutils.version import LooseVersion from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
try: try:
import pyrax import pyrax

View File

@@ -16,7 +16,7 @@ DOCUMENTATION = '''
--- ---
module: scaleway_compute module: scaleway_compute
short_description: Scaleway compute management module short_description: Scaleway compute management module
author: Remy Leone (@sieben) author: Remy Leone (@remyleone)
description: description:
- "This module manages compute instances on Scaleway." - "This module manages compute instances on Scaleway."
extends_documentation_fragment: extends_documentation_fragment:

View File

@@ -15,7 +15,7 @@ description:
- Gather information about the Scaleway images available. - Gather information about the Scaleway images available.
author: author:
- "Yanis Guenane (@Spredzy)" - "Yanis Guenane (@Spredzy)"
- "Remy Leone (@sieben)" - "Remy Leone (@remyleone)"
extends_documentation_fragment: extends_documentation_fragment:
- community.general.scaleway - community.general.scaleway

View File

@@ -13,7 +13,7 @@ DOCUMENTATION = '''
--- ---
module: scaleway_ip module: scaleway_ip
short_description: Scaleway IP management module short_description: Scaleway IP management module
author: Remy Leone (@sieben) author: Remy Leone (@remyleone)
description: description:
- This module manages IP on Scaleway account - This module manages IP on Scaleway account
U(https://developer.scaleway.com) U(https://developer.scaleway.com)

View File

@@ -15,7 +15,7 @@ description:
- Gather information about the Scaleway ips available. - Gather information about the Scaleway ips available.
author: author:
- "Yanis Guenane (@Spredzy)" - "Yanis Guenane (@Spredzy)"
- "Remy Leone (@sieben)" - "Remy Leone (@remyleone)"
extends_documentation_fragment: extends_documentation_fragment:
- community.general.scaleway - community.general.scaleway

View File

@@ -16,7 +16,7 @@ DOCUMENTATION = '''
--- ---
module: scaleway_lb module: scaleway_lb
short_description: Scaleway load-balancer management module short_description: Scaleway load-balancer management module
author: Remy Leone (@sieben) author: Remy Leone (@remyleone)
description: description:
- "This module manages load-balancers on Scaleway." - "This module manages load-balancers on Scaleway."
extends_documentation_fragment: extends_documentation_fragment:

View File

@@ -15,7 +15,7 @@ description:
- Gather information about the Scaleway organizations available. - Gather information about the Scaleway organizations available.
author: author:
- "Yanis Guenane (@Spredzy)" - "Yanis Guenane (@Spredzy)"
- "Remy Leone (@sieben)" - "Remy Leone (@remyleone)"
options: options:
api_url: api_url:
description: description:

View File

@@ -15,7 +15,7 @@ description:
- Gather information about the Scaleway security groups available. - Gather information about the Scaleway security groups available.
author: author:
- "Yanis Guenane (@Spredzy)" - "Yanis Guenane (@Spredzy)"
- "Remy Leone (@sieben)" - "Remy Leone (@remyleone)"
options: options:
region: region:
type: str type: str

View File

@@ -15,7 +15,7 @@ description:
- Gather information about the Scaleway servers available. - Gather information about the Scaleway servers available.
author: author:
- "Yanis Guenane (@Spredzy)" - "Yanis Guenane (@Spredzy)"
- "Remy Leone (@sieben)" - "Remy Leone (@remyleone)"
extends_documentation_fragment: extends_documentation_fragment:
- community.general.scaleway - community.general.scaleway

View File

@@ -15,7 +15,7 @@ description:
- Gather information about the Scaleway snapshot available. - Gather information about the Scaleway snapshot available.
author: author:
- "Yanis Guenane (@Spredzy)" - "Yanis Guenane (@Spredzy)"
- "Remy Leone (@sieben)" - "Remy Leone (@remyleone)"
extends_documentation_fragment: extends_documentation_fragment:
- community.general.scaleway - community.general.scaleway

View File

@@ -16,7 +16,7 @@ DOCUMENTATION = '''
--- ---
module: scaleway_sshkey module: scaleway_sshkey
short_description: Scaleway SSH keys management module short_description: Scaleway SSH keys management module
author: Remy Leone (@sieben) author: Remy Leone (@remyleone)
description: description:
- This module manages SSH keys on Scaleway account - This module manages SSH keys on Scaleway account
U(https://developer.scaleway.com) U(https://developer.scaleway.com)

View File

@@ -16,7 +16,7 @@ DOCUMENTATION = '''
--- ---
module: scaleway_user_data module: scaleway_user_data
short_description: Scaleway user_data management module short_description: Scaleway user_data management module
author: Remy Leone (@sieben) author: Remy Leone (@remyleone)
description: description:
- "This module manages user_data on compute instances on Scaleway." - "This module manages user_data on compute instances on Scaleway."
- "It can be used to configure cloud-init for instance" - "It can be used to configure cloud-init for instance"
@@ -75,7 +75,7 @@ def patch_user_data(compute_api, server_id, key, value):
compute_api.module.debug("Starting patching user_data attributes") compute_api.module.debug("Starting patching user_data attributes")
path = "servers/%s/user_data/%s" % (server_id, key) path = "servers/%s/user_data/%s" % (server_id, key)
response = compute_api.patch(path=path, data=value, headers={"Content-type": "text/plain"}) response = compute_api.patch(path=path, data=value, headers={"Content-Type": "text/plain"})
if not response.ok: if not response.ok:
msg = 'Error during user_data patching: %s %s' % (response.status_code, response.body) msg = 'Error during user_data patching: %s %s' % (response.status_code, response.body)
compute_api.module.fail_json(msg=msg) compute_api.module.fail_json(msg=msg)

View File

@@ -15,7 +15,7 @@ description:
- Gather information about the Scaleway volumes available. - Gather information about the Scaleway volumes available.
author: author:
- "Yanis Guenane (@Spredzy)" - "Yanis Guenane (@Spredzy)"
- "Remy Leone (@sieben)" - "Remy Leone (@remyleone)"
extends_documentation_fragment: extends_documentation_fragment:
- community.general.scaleway - community.general.scaleway

View File

@@ -84,7 +84,7 @@ options:
description: description:
- the address to advertise that the service will be listening on. - the address to advertise that the service will be listening on.
This value will be passed as the I(address) parameter to Consul's This value will be passed as the I(address) parameter to Consul's
U(/v1/agent/service/register) API method, so refer to the Consul API C(/v1/agent/service/register) API method, so refer to the Consul API
documentation for further details. documentation for further details.
tags: tags:
type: list type: list

View File

@@ -117,9 +117,10 @@ state:
''' '''
import os import os
from distutils.version import LooseVersion
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
PACKAGE_STATE_MAP = dict( PACKAGE_STATE_MAP = dict(
present="--install", present="--install",

View File

@@ -26,6 +26,7 @@ extends_documentation_fragment:
- community.general.redis - community.general.redis
seealso: seealso:
- module: community.general.redis_data
- module: community.general.redis_info - module: community.general.redis_info
- module: community.general.redis - module: community.general.redis
''' '''

View File

@@ -158,7 +158,7 @@ def _run_xattr(module, cmd, check_rc=True):
if line.startswith('#') or line == '': if line.startswith('#') or line == '':
pass pass
elif '=' in line: elif '=' in line:
(key, val) = line.split('=') (key, val) = line.split('=', 1)
result[key] = val.strip('"') result[key] = val.strip('"')
else: else:
result[line] = '' result[line] = ''

View File

@@ -356,9 +356,10 @@ import os
import re import re
import traceback import traceback
from distutils.version import LooseVersion
from io import BytesIO from io import BytesIO
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
LXML_IMP_ERR = None LXML_IMP_ERR = None
try: try:
from lxml import etree, objectify from lxml import etree, objectify

View File

@@ -74,11 +74,12 @@ subca:
type: dict type: dict
''' '''
from distutils.version import LooseVersion
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.ipa import IPAClient, ipa_argument_spec from ansible_collections.community.general.plugins.module_utils.ipa import IPAClient, ipa_argument_spec
from ansible.module_utils.common.text.converters import to_native from ansible.module_utils.common.text.converters import to_native
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
class SubCAIPAClient(IPAClient): class SubCAIPAClient(IPAClient):
def __init__(self, module, host, port, protocol): def __init__(self, module, host, port, protocol):

View File

@@ -143,7 +143,8 @@ annotation:
import json import json
import time import time
import traceback import traceback
from distutils.version import LooseVersion
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
REQUESTS_IMP_ERR = None REQUESTS_IMP_ERR = None
try: try:

View File

@@ -92,13 +92,6 @@ EXAMPLES = '''
account_api_token: dummyapitoken account_api_token: dummyapitoken
delegate_to: localhost delegate_to: localhost
- name: Fetch my.com domain records
community.general.dnsimple:
domain: my.com
state: present
delegate_to: localhost
register: records
- name: Delete a domain - name: Delete a domain
community.general.dnsimple: community.general.dnsimple:
domain: my.com domain: my.com
@@ -153,9 +146,10 @@ EXAMPLES = '''
RETURN = r"""# """ RETURN = r"""# """
import traceback import traceback
from distutils.version import LooseVersion
import re import re
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
class DNSimpleV1(): class DNSimpleV1():
"""class which uses dnsimple-python < 2""" """class which uses dnsimple-python < 2"""

View File

@@ -106,11 +106,10 @@ def main():
module.fail_json(msg=missing_required_lib('python-ldap'), module.fail_json(msg=missing_required_lib('python-ldap'),
exception=LDAP_IMP_ERR) exception=LDAP_IMP_ERR)
if not module.check_mode: try:
try: LdapSearch(module).main()
LdapSearch(module).main() except Exception as exception:
except Exception as exception: module.fail_json(msg="Attribute action failed.", details=to_native(exception))
module.fail_json(msg="Attribute action failed.", details=to_native(exception))
module.exit_json(changed=False) module.exit_json(changed=False)

View File

@@ -70,7 +70,7 @@ options:
ip4: ip4:
description: description:
- The IPv4 address to this interface. - The IPv4 address to this interface.
- Use the format C(192.0.2.24/24). - Use the format C(192.0.2.24/24) or C(192.0.2.24).
- If defined and I(method4) is not specified, automatically set C(ipv4.method) to C(manual). - If defined and I(method4) is not specified, automatically set C(ipv4.method) to C(manual).
type: str type: str
gw4: gw4:
@@ -143,7 +143,7 @@ options:
ip6: ip6:
description: description:
- The IPv6 address to this interface. - The IPv6 address to this interface.
- Use the format C(abbe::cafe). - Use the format C(abbe::cafe/128 or abbe::cafe).
- If defined and I(method6) is not specified, automatically set C(ipv6.method) to C(manual). - If defined and I(method6) is not specified, automatically set C(ipv6.method) to C(manual).
type: str type: str
gw6: gw6:
@@ -1241,7 +1241,7 @@ class Nmcli(object):
# IP address options. # IP address options.
if self.ip_conn_type and not self.master: if self.ip_conn_type and not self.master:
options.update({ options.update({
'ipv4.addresses': self.ip4, 'ipv4.addresses': self.enforce_ipv4_cidr_notation(self.ip4),
'ipv4.dhcp-client-id': self.dhcp_client_id, 'ipv4.dhcp-client-id': self.dhcp_client_id,
'ipv4.dns': self.dns4, 'ipv4.dns': self.dns4,
'ipv4.dns-search': self.dns4_search, 'ipv4.dns-search': self.dns4_search,
@@ -1254,7 +1254,7 @@ class Nmcli(object):
'ipv4.never-default': self.never_default4, 'ipv4.never-default': self.never_default4,
'ipv4.method': self.ipv4_method, 'ipv4.method': self.ipv4_method,
'ipv4.may-fail': self.may_fail4, 'ipv4.may-fail': self.may_fail4,
'ipv6.addresses': self.ip6, 'ipv6.addresses': self.enforce_ipv6_cidr_notation(self.ip6),
'ipv6.dns': self.dns6, 'ipv6.dns': self.dns6,
'ipv6.dns-search': self.dns6_search, 'ipv6.dns-search': self.dns6_search,
'ipv6.ignore-auto-dns': self.dns6_ignore_auto, 'ipv6.ignore-auto-dns': self.dns6_ignore_auto,
@@ -1332,6 +1332,9 @@ class Nmcli(object):
options.update({ options.update({
'vlan.id': self.vlanid, 'vlan.id': self.vlanid,
'vlan.parent': self.vlandev, 'vlan.parent': self.vlandev,
'vlan.flags': self.flags,
'vlan.ingress': self.ingress,
'vlan.egress': self.egress,
}) })
elif self.type == 'vxlan': elif self.type == 'vxlan':
options.update({ options.update({
@@ -1444,6 +1447,22 @@ class Nmcli(object):
'sit', 'sit',
) )
@staticmethod
def enforce_ipv4_cidr_notation(ip4_address):
if ip4_address is None or '/' in ip4_address:
return ip4_address
return ip4_address + '/32'
@staticmethod
def enforce_ipv6_cidr_notation(ip6_address):
if ip6_address is None:
return None
elif '/' in ip6_address:
return ip6_address
else:
return ip6_address + '/128'
@staticmethod @staticmethod
def bool_to_string(boolean): def bool_to_string(boolean):
if boolean: if boolean:
@@ -1472,7 +1491,6 @@ class Nmcli(object):
'ipv4.dns-search', 'ipv4.dns-search',
'ipv4.routes', 'ipv4.routes',
'ipv4.routing-rules', 'ipv4.routing-rules',
'ipv4.route-metric'
'ipv6.dns', 'ipv6.dns',
'ipv6.dns-search', 'ipv6.dns-search',
'802-11-wireless-security.group', '802-11-wireless-security.group',
@@ -1696,6 +1714,8 @@ class Nmcli(object):
# Depending on version nmcli adds double-qoutes to gsm.apn # Depending on version nmcli adds double-qoutes to gsm.apn
# Need to strip them in order to compare both # Need to strip them in order to compare both
current_value = current_value.strip('"') current_value = current_value.strip('"')
if key == self.mtu_setting and self.mtu is None:
self.mtu = 0
else: else:
# parameter does not exist # parameter does not exist
current_value = None current_value = None
@@ -1704,6 +1724,8 @@ class Nmcli(object):
# compare values between two lists # compare values between two lists
if sorted(current_value) != sorted(value): if sorted(current_value) != sorted(value):
changed = True changed = True
elif all([key == self.mtu_setting, self.type == 'dummy', current_value is None, value == 'auto', self.mtu is None]):
value = None
else: else:
if current_value != to_text(value): if current_value != to_text(value):
changed = True changed = True

View File

@@ -127,7 +127,7 @@ ansible_sysname:
type: str type: str
sample: ubuntu-user sample: ubuntu-user
ansible_syslocation: ansible_syslocation:
description: The physical location of this node (e.g., `telephone closet, 3rd floor'). description: The physical location of this node (e.g., C(telephone closet, 3rd floor)).
returned: success returned: success
type: str type: str
sample: Sitting on the Dock of the Bay sample: Sitting on the Dock of the Bay

View File

@@ -124,7 +124,8 @@ import os
import ssl import ssl
import traceback import traceback
import platform import platform
from distutils.version import LooseVersion
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
HAS_PAHOMQTT = True HAS_PAHOMQTT = True
PAHOMQTT_IMP_ERR = None PAHOMQTT_IMP_ERR = None
@@ -207,7 +208,7 @@ def main():
if tls_version: if tls_version:
tls_version = tls_map.get(tls_version, ssl.PROTOCOL_SSLv23) tls_version = tls_map.get(tls_version, ssl.PROTOCOL_SSLv23)
else: else:
if LooseVersion(platform.python_version()) <= "3.5.2": if LooseVersion(platform.python_version()) <= LooseVersion("3.5.2"):
# Specifying `None` on later versions of python seems sufficient to # Specifying `None` on later versions of python seems sufficient to
# instruct python to autonegotiate the SSL/TLS connection. On versions # instruct python to autonegotiate the SSL/TLS connection. On versions
# 3.5.2 and lower though we need to specify the version. # 3.5.2 and lower though we need to specify the version.

View File

@@ -124,7 +124,7 @@ EXAMPLES = r'''
import os import os
import traceback import traceback
from distutils.version import LooseVersion from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
SENDGRID_IMP_ERR = None SENDGRID_IMP_ERR = None
try: try:

View File

@@ -346,7 +346,7 @@ def build_payload_for_slack(text, channel, thread_id, username, icon_url, icon_e
def get_slack_message(module, token, channel, ts): def get_slack_message(module, token, channel, ts):
headers = { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json; charset=UTF-8',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': 'Bearer ' + token 'Authorization': 'Bearer ' + token
} }
@@ -383,7 +383,7 @@ def do_notify_slack(module, domain, token, payload):
slack_uri = OLD_SLACK_INCOMING_WEBHOOK % (domain, token) slack_uri = OLD_SLACK_INCOMING_WEBHOOK % (domain, token)
headers = { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json; charset=UTF-8',
'Accept': 'application/json', 'Accept': 'application/json',
} }
if use_webapi: if use_webapi:

View File

@@ -10,7 +10,7 @@ __metaclass__ = type
DOCUMENTATION = """ DOCUMENTATION = """
module: ansible_galaxy_install module: ansible_galaxy_install
author: author:
- "Alexei Znamensky (@russoz)" - "Alexei Znamensky (@russoz)"
short_description: Install Ansible roles or collections using ansible-galaxy short_description: Install Ansible roles or collections using ansible-galaxy
version_added: 3.5.0 version_added: 3.5.0
description: description:
@@ -24,44 +24,46 @@ requirements:
options: options:
type: type:
description: description:
- The type of installation performed by C(ansible-galaxy). - The type of installation performed by C(ansible-galaxy).
- If I(type) is C(both), then I(requirements_file) must be passed and it may contain both roles and collections. - If I(type) is C(both), then I(requirements_file) must be passed and it may contain both roles and collections.
- "Note however that the opposite is not true: if using a I(requirements_file), then I(type) can be any of the three choices." - "Note however that the opposite is not true: if using a I(requirements_file), then I(type) can be any of the three choices."
- "B(Ansible 2.9): The option C(both) will have the same effect as C(role)." - "B(Ansible 2.9): The option C(both) will have the same effect as C(role)."
type: str type: str
choices: [collection, role, both] choices: [collection, role, both]
required: true required: true
name: name:
description: description:
- Name of the collection or role being installed. - Name of the collection or role being installed.
- Versions can be specified with C(ansible-galaxy) usual formats. For example, C(community.docker:1.6.1) or C(ansistrano.deploy,3.8.0). - >
- I(name) and I(requirements_file) are mutually exclusive. Versions can be specified with C(ansible-galaxy) usual formats.
For example, the collection C(community.docker:1.6.1) or the role C(ansistrano.deploy,3.8.0).
- I(name) and I(requirements_file) are mutually exclusive.
type: str type: str
requirements_file: requirements_file:
description: description:
- Path to a file containing a list of requirements to be installed. - Path to a file containing a list of requirements to be installed.
- It works for I(type) equals to C(collection) and C(role). - It works for I(type) equals to C(collection) and C(role).
- I(name) and I(requirements_file) are mutually exclusive. - I(name) and I(requirements_file) are mutually exclusive.
- "B(Ansible 2.9): It can only be used to install either I(type=role) or I(type=collection), but not both at the same run." - "B(Ansible 2.9): It can only be used to install either I(type=role) or I(type=collection), but not both at the same run."
type: path type: path
dest: dest:
description: description:
- The path to the directory containing your collections or roles, according to the value of I(type). - The path to the directory containing your collections or roles, according to the value of I(type).
- > - >
Please notice that C(ansible-galaxy) will not install collections with I(type=both), when I(requirements_file) Please notice that C(ansible-galaxy) will not install collections with I(type=both), when I(requirements_file)
contains both roles and collections and I(dest) is specified. contains both roles and collections and I(dest) is specified.
type: path type: path
force: force:
description: description:
- Force overwriting an existing role or collection. - Force overwriting an existing role or collection.
- Using I(force=true) is mandatory when downgrading. - Using I(force=true) is mandatory when downgrading.
- "B(Ansible 2.9 and 2.10): Must be C(true) to upgrade roles and collections." - "B(Ansible 2.9 and 2.10): Must be C(true) to upgrade roles and collections."
type: bool type: bool
default: false default: false
ack_ansible29: ack_ansible29:
description: description:
- Acknowledge using Ansible 2.9 with its limitations, and prevents the module from generating warnings about them. - Acknowledge using Ansible 2.9 with its limitations, and prevents the module from generating warnings about them.
- This option is completely ignored if using a version Ansible greater than C(2.9.x). - This option is completely ignored if using a version of Ansible greater than C(2.9.x).
type: bool type: bool
default: false default: false
""" """
@@ -114,9 +116,9 @@ RETURN = """
returned: always returned: always
installed_roles: installed_roles:
description: description:
- If I(requirements_file) is specified instead, returns dictionary with all the roles installed per path. - If I(requirements_file) is specified instead, returns dictionary with all the roles installed per path.
- If I(name) is specified, returns that role name and the version installed per path. - If I(name) is specified, returns that role name and the version installed per path.
- "B(Ansible 2.9): Returns empty because C(ansible-galaxy) has no C(list) subcommand." - "B(Ansible 2.9): Returns empty because C(ansible-galaxy) has no C(list) subcommand."
type: dict type: dict
returned: always when installing roles returned: always when installing roles
contains: contains:
@@ -131,9 +133,9 @@ RETURN = """
ansistrano.deploy: 3.8.0 ansistrano.deploy: 3.8.0
installed_collections: installed_collections:
description: description:
- If I(requirements_file) is specified instead, returns dictionary with all the collections installed per path. - If I(requirements_file) is specified instead, returns dictionary with all the collections installed per path.
- If I(name) is specified, returns that collection name and the version installed per path. - If I(name) is specified, returns that collection name and the version installed per path.
- "B(Ansible 2.9): Returns empty because C(ansible-galaxy) has no C(list) subcommand." - "B(Ansible 2.9): Returns empty because C(ansible-galaxy) has no C(list) subcommand."
type: dict type: dict
returned: always when installing collections returned: always when installing collections
contains: contains:

View File

@@ -167,7 +167,7 @@ class PipX(CmdStateModuleHelper):
command_args_formats = dict( command_args_formats = dict(
state=dict(fmt=lambda v: [_state_map.get(v, v)]), state=dict(fmt=lambda v: [_state_map.get(v, v)]),
name_source=dict(fmt=lambda n, s: [s] if s else [n], stars=1), name_source=dict(fmt=lambda n, s: [s] if s else [n], stars=1),
install_deps=dict(fmt="--install-deps", style=ArgFormat.BOOLEAN), install_deps=dict(fmt="--include-deps", style=ArgFormat.BOOLEAN),
inject_packages=dict(fmt=lambda v: v), inject_packages=dict(fmt=lambda v: v),
force=dict(fmt="--force", style=ArgFormat.BOOLEAN), force=dict(fmt="--force", style=ArgFormat.BOOLEAN),
include_injected=dict(fmt="--include-injected", style=ArgFormat.BOOLEAN), include_injected=dict(fmt="--include-injected", style=ArgFormat.BOOLEAN),
@@ -176,6 +176,9 @@ class PipX(CmdStateModuleHelper):
_list=dict(fmt=('list', '--include-injected', '--json'), style=ArgFormat.BOOLEAN), _list=dict(fmt=('list', '--include-injected', '--json'), style=ArgFormat.BOOLEAN),
) )
check_rc = True check_rc = True
run_command_fixed_options = dict(
environ_update={'USE_EMOJI': '0'}
)
def _retrieve_installed(self): def _retrieve_installed(self):
def process_list(rc, out, err): def process_list(rc, out, err):
@@ -188,7 +191,7 @@ class PipX(CmdStateModuleHelper):
results[venv_name] = { results[venv_name] = {
'version': venv['metadata']['main_package']['package_version'], 'version': venv['metadata']['main_package']['package_version'],
'injected': dict( 'injected': dict(
(k, v['package_version']) for k, v in venv['metadata']['injected_packages'] (k, v['package_version']) for k, v in venv['metadata']['injected_packages'].items()
), ),
} }
return results return results

View File

@@ -152,11 +152,11 @@ stdout:
sample: "org.gnome.Calendar/x86_64/stable\tcurrent\norg.gnome.gitg/x86_64/stable\tcurrent\n" sample: "org.gnome.Calendar/x86_64/stable\tcurrent\norg.gnome.gitg/x86_64/stable\tcurrent\n"
''' '''
from distutils.version import StrictVersion
from ansible.module_utils.six.moves.urllib.parse import urlparse from ansible.module_utils.six.moves.urllib.parse import urlparse
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
OUTDATED_FLATPAK_VERSION_ERROR_MESSAGE = "Unknown option --columns=application" OUTDATED_FLATPAK_VERSION_ERROR_MESSAGE = "Unknown option --columns=application"
@@ -172,7 +172,7 @@ def install_flat(module, binary, remote, names, method, no_dependencies):
id_names.append(name) id_names.append(name)
base_command = [binary, "install", "--{0}".format(method)] base_command = [binary, "install", "--{0}".format(method)]
flatpak_version = _flatpak_version(module, binary) flatpak_version = _flatpak_version(module, binary)
if StrictVersion(flatpak_version) < StrictVersion('1.1.3'): if LooseVersion(flatpak_version) < LooseVersion('1.1.3'):
base_command += ["-y"] base_command += ["-y"]
else: else:
base_command += ["--noninteractive"] base_command += ["--noninteractive"]
@@ -196,7 +196,7 @@ def uninstall_flat(module, binary, names, method):
] ]
command = [binary, "uninstall"] command = [binary, "uninstall"]
flatpak_version = _flatpak_version(module, binary) flatpak_version = _flatpak_version(module, binary)
if StrictVersion(flatpak_version) < StrictVersion('1.1.3'): if LooseVersion(flatpak_version) < LooseVersion('1.1.3'):
command += ["-y"] command += ["-y"]
else: else:
command += ["--noninteractive"] command += ["--noninteractive"]

View File

@@ -132,10 +132,10 @@ EXAMPLES = '''
name: homebrew/cask/foo name: homebrew/cask/foo
state: present state: present
- name: Use ignored-pinned option while upgrading all - name: Use ignore-pinned option while upgrading all
community.general.homebrew: community.general.homebrew:
upgrade_all: yes upgrade_all: yes
upgrade_options: ignored-pinned upgrade_options: ignore-pinned
''' '''
RETURN = ''' RETURN = '''

View File

@@ -140,7 +140,8 @@ EXAMPLES = '''
import os import os
import re import re
import tempfile import tempfile
from distutils import version
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
from ansible.module_utils.common.text.converters import to_bytes from ansible.module_utils.common.text.converters import to_bytes
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
@@ -493,7 +494,7 @@ class HomebrewCask(object):
def _brew_cask_command_is_deprecated(self): def _brew_cask_command_is_deprecated(self):
# The `brew cask` replacements were fully available in 2.6.0 (https://brew.sh/2020/12/01/homebrew-2.6.0/) # The `brew cask` replacements were fully available in 2.6.0 (https://brew.sh/2020/12/01/homebrew-2.6.0/)
return version.LooseVersion(self._get_brew_version()) >= version.LooseVersion('2.6.0') return LooseVersion(self._get_brew_version()) >= LooseVersion('2.6.0')
# /checks ------------------------------------------------------ }}} # /checks ------------------------------------------------------ }}}
# commands ----------------------------------------------------- {{{ # commands ----------------------------------------------------- {{{

View File

@@ -97,9 +97,10 @@ RETURN = r''' # '''
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.common.text.converters import to_native from ansible.module_utils.common.text.converters import to_native
from distutils.version import StrictVersion
import os import os
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
class Mas(object): class Mas(object):
@@ -145,7 +146,7 @@ class Mas(object):
# Is the version recent enough? # Is the version recent enough?
rc, out, err = self.run(['version']) rc, out, err = self.run(['version'])
if rc != 0 or not out.strip() or StrictVersion(out.strip()) < StrictVersion('1.5.0'): if rc != 0 or not out.strip() or LooseVersion(out.strip()) < LooseVersion('1.5.0'):
self.module.fail_json(msg='`mas` tool in version 1.5.0+ needed, got ' + out.strip()) self.module.fail_json(msg='`mas` tool in version 1.5.0+ needed, got ' + out.strip())
def check_signin(self): def check_signin(self):

View File

@@ -135,10 +135,10 @@ import re
import shlex import shlex
import sqlite3 import sqlite3
from distutils.version import StrictVersion
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
# Function used for executing commands. # Function used for executing commands.
def execute_command(cmd, module): def execute_command(cmd, module):
@@ -435,7 +435,7 @@ def parse_package_name(names, pkg_spec, module):
if pkg_spec[name]['branch']: if pkg_spec[name]['branch']:
branch_release = "6.0" branch_release = "6.0"
if StrictVersion(platform.release()) < StrictVersion(branch_release): if LooseVersion(platform.release()) < LooseVersion(branch_release):
module.fail_json(msg="package name using 'branch' syntax requires at least OpenBSD %s: %s" % (branch_release, name)) module.fail_json(msg="package name using 'branch' syntax requires at least OpenBSD %s: %s" % (branch_release, name))
# Sanity check that there are no trailing dashes in flavor. # Sanity check that there are no trailing dashes in flavor.

View File

@@ -281,9 +281,9 @@ def install_packages(module, packages):
install_c += 1 install_c += 1
if install_c > 0: if install_c > 0:
module.exit_json(changed=True, msg=format_action_message(module, "installed", install_c)) module.exit_json(changed=True, msg=format_action_message(module, "installed", install_c), stdout=out, stderr=err)
module.exit_json(changed=False, msg="package(s) already present", stdout=out, stderr=err) module.exit_json(changed=False, msg="package(s) already present")
def update_package_db(module): def update_package_db(module):

View File

@@ -133,8 +133,6 @@ except ImportError:
XML_IMP_ERR = traceback.format_exc() XML_IMP_ERR = traceback.format_exc()
HAS_XML = False HAS_XML = False
from distutils.version import LooseVersion
from ansible.module_utils.basic import AnsibleModule, missing_required_lib from ansible.module_utils.basic import AnsibleModule, missing_required_lib
from ansible.module_utils.urls import fetch_url from ansible.module_utils.urls import fetch_url
@@ -142,6 +140,8 @@ from ansible.module_utils.common.text.converters import to_text
from ansible.module_utils.six.moves import configparser, StringIO from ansible.module_utils.six.moves import configparser, StringIO
from io import open from io import open
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
REPO_OPTS = ['alias', 'name', 'priority', 'enabled', 'autorefresh', 'gpgcheck'] REPO_OPTS = ['alias', 'name', 'priority', 'enabled', 'autorefresh', 'gpgcheck']

View File

@@ -47,7 +47,9 @@ EXAMPLES = '''
api_version: 500 api_version: 500
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug:
- name: Print fetched information about Data Centers
ansible.builtin.debug:
msg: "{{ result.datacenters }}" msg: "{{ result.datacenters }}"
- name: Gather paginated, filtered and sorted information about Data Centers - name: Gather paginated, filtered and sorted information about Data Centers
@@ -62,7 +64,9 @@ EXAMPLES = '''
sort: 'name:descending' sort: 'name:descending'
filter: 'state=Unmanaged' filter: 'state=Unmanaged'
register: result register: result
- ansible.builtin.debug:
- name: Print fetched information about paginated, filtered and sorted list of Data Centers
ansible.builtin.debug:
msg: "{{ result.datacenters }}" msg: "{{ result.datacenters }}"
- name: Gather information about a Data Center by name - name: Gather information about a Data Center by name
@@ -74,7 +78,9 @@ EXAMPLES = '''
name: "My Data Center" name: "My Data Center"
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug:
- name: Print fetched information about Data Center found by name
ansible.builtin.debug:
msg: "{{ result.datacenters }}" msg: "{{ result.datacenters }}"
- name: Gather information about the Data Center Visual Content - name: Gather information about the Data Center Visual Content
@@ -88,9 +94,13 @@ EXAMPLES = '''
- visualContent - visualContent
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug:
- name: Print fetched information about Data Center found by name
ansible.builtin.debug:
msg: "{{ result.datacenters }}" msg: "{{ result.datacenters }}"
- ansible.builtin.debug:
- name: Print fetched information about Data Center Visual Content
ansible.builtin.debug:
msg: "{{ result.datacenter_visual_content }}" msg: "{{ result.datacenter_visual_content }}"
''' '''

View File

@@ -50,7 +50,9 @@ EXAMPLES = '''
no_log: true no_log: true
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug:
- name: Print fetched information about Enclosures
ansible.builtin.debug:
msg: "{{ result.enclosures }}" msg: "{{ result.enclosures }}"
- name: Gather paginated, filtered and sorted information about Enclosures - name: Gather paginated, filtered and sorted information about Enclosures
@@ -67,7 +69,9 @@ EXAMPLES = '''
no_log: true no_log: true
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug:
- name: Print fetched information about paginated, filtered ans sorted list of Enclosures
ansible.builtin.debug:
msg: "{{ result.enclosures }}" msg: "{{ result.enclosures }}"
- name: Gather information about an Enclosure by name - name: Gather information about an Enclosure by name
@@ -80,7 +84,9 @@ EXAMPLES = '''
no_log: true no_log: true
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug:
- name: Print fetched information about Enclosure found by name
ansible.builtin.debug:
msg: "{{ result.enclosures }}" msg: "{{ result.enclosures }}"
- name: Gather information about an Enclosure by name with options - name: Gather information about an Enclosure by name with options
@@ -97,13 +103,21 @@ EXAMPLES = '''
no_log: true no_log: true
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug:
- name: Print fetched information about Enclosure found by name
ansible.builtin.debug:
msg: "{{ result.enclosures }}" msg: "{{ result.enclosures }}"
- ansible.builtin.debug:
- name: Print fetched information about Enclosure Script
ansible.builtin.debug:
msg: "{{ result.enclosure_script }}" msg: "{{ result.enclosure_script }}"
- ansible.builtin.debug:
- name: Print fetched information about Enclosure Environmental Configuration
ansible.builtin.debug:
msg: "{{ result.enclosure_environmental_configuration }}" msg: "{{ result.enclosure_environmental_configuration }}"
- ansible.builtin.debug:
- name: Print fetched information about Enclosure Utilization
ansible.builtin.debug:
msg: "{{ result.enclosure_utilization }}" msg: "{{ result.enclosure_utilization }}"
- name: "Gather information about an Enclosure with temperature data at a resolution of one sample per day, between two - name: "Gather information about an Enclosure with temperature data at a resolution of one sample per day, between two
@@ -125,9 +139,13 @@ EXAMPLES = '''
no_log: true no_log: true
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug:
- name: Print fetched information about Enclosure found by name
ansible.builtin.debug:
msg: "{{ result.enclosures }}" msg: "{{ result.enclosures }}"
- ansible.builtin.debug:
- name: Print fetched information about Enclosure Utilization
ansible.builtin.debug:
msg: "{{ result.enclosure_utilization }}" msg: "{{ result.enclosure_utilization }}"
''' '''

View File

@@ -44,7 +44,8 @@ EXAMPLES = '''
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug: - name: Print fetched information about Ethernet Networks
ansible.builtin.debug:
msg: "{{ result.ethernet_networks }}" msg: "{{ result.ethernet_networks }}"
- name: Gather paginated and filtered information about Ethernet Networks - name: Gather paginated and filtered information about Ethernet Networks
@@ -58,7 +59,8 @@ EXAMPLES = '''
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug: - name: Print fetched information about paginated and filtered list of Ethernet Networks
ansible.builtin.debug:
msg: "{{ result.ethernet_networks }}" msg: "{{ result.ethernet_networks }}"
- name: Gather information about an Ethernet Network by name - name: Gather information about an Ethernet Network by name
@@ -68,7 +70,8 @@ EXAMPLES = '''
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug: - name: Print fetched information about Ethernet Network found by name
ansible.builtin.debug:
msg: "{{ result.ethernet_networks }}" msg: "{{ result.ethernet_networks }}"
- name: Gather information about an Ethernet Network by name with options - name: Gather information about an Ethernet Network by name with options
@@ -81,9 +84,12 @@ EXAMPLES = '''
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug: - name: Print fetched information about Ethernet Network Associated Profiles
ansible.builtin.debug:
msg: "{{ result.enet_associated_profiles }}" msg: "{{ result.enet_associated_profiles }}"
- ansible.builtin.debug:
- name: Print fetched information about Ethernet Network Associated Uplink Groups
ansible.builtin.debug:
msg: "{{ result.enet_associated_uplink_groups }}" msg: "{{ result.enet_associated_uplink_groups }}"
''' '''

View File

@@ -39,7 +39,8 @@ EXAMPLES = '''
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug: - name: Print fetched information about Fibre Channel Networks
ansible.builtin.debug:
msg: "{{ result.fc_networks }}" msg: "{{ result.fc_networks }}"
- name: Gather paginated, filtered and sorted information about Fibre Channel Networks - name: Gather paginated, filtered and sorted information about Fibre Channel Networks
@@ -52,7 +53,9 @@ EXAMPLES = '''
filter: 'fabricType=FabricAttach' filter: 'fabricType=FabricAttach'
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug:
- name: Print fetched information about paginated, filtered and sorted list of Fibre Channel Networks
ansible.builtin.debug:
msg: "{{ result.fc_networks }}" msg: "{{ result.fc_networks }}"
- name: Gather information about a Fibre Channel Network by name - name: Gather information about a Fibre Channel Network by name
@@ -62,7 +65,8 @@ EXAMPLES = '''
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug: - name: Print fetched information about Fibre Channel Network found by name
ansible.builtin.debug:
msg: "{{ result.fc_networks }}" msg: "{{ result.fc_networks }}"
''' '''

View File

@@ -38,7 +38,8 @@ EXAMPLES = '''
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug: - name: Print fetched information about FCoE Networks
ansible.builtin.debug:
msg: "{{ result.fcoe_networks }}" msg: "{{ result.fcoe_networks }}"
- name: Gather paginated, filtered and sorted information about FCoE Networks - name: Gather paginated, filtered and sorted information about FCoE Networks
@@ -52,7 +53,8 @@ EXAMPLES = '''
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug: - name: Print fetched information about paginated, filtered and sorted list of FCoE Networks
ansible.builtin.debug:
msg: "{{ result.fcoe_networks }}" msg: "{{ result.fcoe_networks }}"
- name: Gather information about a FCoE Network by name - name: Gather information about a FCoE Network by name
@@ -62,7 +64,8 @@ EXAMPLES = '''
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug: - name: Print fetched information about FCoE Network found by name
ansible.builtin.debug:
msg: "{{ result.fcoe_networks }}" msg: "{{ result.fcoe_networks }}"
''' '''

View File

@@ -43,7 +43,8 @@ EXAMPLES = '''
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug: - name: Print fetched information about Logical Interconnect Groups
ansible.builtin.debug:
msg: "{{ result.logical_interconnect_groups }}" msg: "{{ result.logical_interconnect_groups }}"
- name: Gather paginated, filtered and sorted information about Logical Interconnect Groups - name: Gather paginated, filtered and sorted information about Logical Interconnect Groups
@@ -61,7 +62,8 @@ EXAMPLES = '''
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug: - name: Print fetched information about paginated, filtered and sorted list of Logical Interconnect Groups
ansible.builtin.debug:
msg: "{{ result.logical_interconnect_groups }}" msg: "{{ result.logical_interconnect_groups }}"
- name: Gather information about a Logical Interconnect Group by name - name: Gather information about a Logical Interconnect Group by name
@@ -75,7 +77,8 @@ EXAMPLES = '''
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug: - name: Print fetched information about Logical Interconnect Group found by name
ansible.builtin.debug:
msg: "{{ result.logical_interconnect_groups }}" msg: "{{ result.logical_interconnect_groups }}"
''' '''

View File

@@ -51,10 +51,11 @@ EXAMPLES = '''
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug: - name: Print fetched information about Network Sets
ansible.builtin.debug:
msg: "{{ result.network_sets }}" msg: "{{ result.network_sets }}"
- name: Gather paginated, filtered, and sorted information about Network Sets - name: Gather paginated, filtered and sorted information about Network Sets
community.general.oneview_network_set_info: community.general.oneview_network_set_info:
hostname: 172.16.101.48 hostname: 172.16.101.48
username: administrator username: administrator
@@ -69,7 +70,8 @@ EXAMPLES = '''
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug: - name: Print fetched information about paginated, filtered and sorted list of Network Sets
ansible.builtin.debug:
msg: "{{ result.network_sets }}" msg: "{{ result.network_sets }}"
- name: Gather information about all Network Sets, excluding Ethernet networks - name: Gather information about all Network Sets, excluding Ethernet networks
@@ -84,7 +86,8 @@ EXAMPLES = '''
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug: - name: Print fetched information about Network Sets, excluding Ethernet networks
ansible.builtin.debug:
msg: "{{ result.network_sets }}" msg: "{{ result.network_sets }}"
- name: Gather information about a Network Set by name - name: Gather information about a Network Set by name
@@ -98,7 +101,8 @@ EXAMPLES = '''
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug: - name: Print fetched information about Network Set found by name
ansible.builtin.debug:
msg: "{{ result.network_sets }}" msg: "{{ result.network_sets }}"
- name: Gather information about a Network Set by name, excluding Ethernet networks - name: Gather information about a Network Set by name, excluding Ethernet networks
@@ -114,7 +118,8 @@ EXAMPLES = '''
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug: - name: Print fetched information about Network Set found by name, excluding Ethernet networks
ansible.builtin.debug:
msg: "{{ result.network_sets }}" msg: "{{ result.network_sets }}"
''' '''

View File

@@ -46,7 +46,8 @@ EXAMPLES = '''
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug: - name: Print fetched information about SAN Managers
ansible.builtin.debug:
msg: "{{ result.san_managers }}" msg: "{{ result.san_managers }}"
- name: Gather paginated, filtered and sorted information about SAN Managers - name: Gather paginated, filtered and sorted information about SAN Managers
@@ -60,7 +61,8 @@ EXAMPLES = '''
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug: - name: Print fetched information about paginated, filtered and sorted list of SAN Managers
ansible.builtin.debug:
msg: "{{ result.san_managers }}" msg: "{{ result.san_managers }}"
- name: Gather information about a SAN Manager by provider display name - name: Gather information about a SAN Manager by provider display name
@@ -70,7 +72,8 @@ EXAMPLES = '''
delegate_to: localhost delegate_to: localhost
register: result register: result
- ansible.builtin.debug: - name: Print fetched information about SAN Manager found by provider display name
ansible.builtin.debug:
msg: "{{ result.san_managers }}" msg: "{{ result.san_managers }}"
''' '''

View File

@@ -307,7 +307,7 @@ EXAMPLES = '''
community.general.redfish_command: community.general.redfish_command:
category: Systems category: Systems
command: SetOneTimeBoot command: SetOneTimeBoot
bootnext: BiosSetup boot_next: BiosSetup
boot_override_mode: Legacy boot_override_mode: Legacy
baseuri: "{{ baseuri }}" baseuri: "{{ baseuri }}"
username: "{{ username }}" username: "{{ username }}"

View File

@@ -97,7 +97,7 @@ author:
''' '''
EXAMPLES = ''' EXAMPLES = '''
- name: create a new webhook that triggers on push (password auth) - name: Create a new webhook that triggers on push (password auth)
community.general.github_webhook: community.general.github_webhook:
repository: ansible/ansible repository: ansible/ansible
url: https://www.example.com/hooks/ url: https://www.example.com/hooks/

View File

@@ -149,7 +149,8 @@ class GitLabDeployKey(object):
# GitLab REST API, so for that case we need to delete and # GitLab REST API, so for that case we need to delete and
# than recreate the key # than recreate the key
if self.deployKeyObject and self.deployKeyObject.key != key_key: if self.deployKeyObject and self.deployKeyObject.key != key_key:
self.deployKeyObject.delete() if not self._module.check_mode:
self.deployKeyObject.delete()
self.deployKeyObject = None self.deployKeyObject = None
# Because we have already call existsDeployKey in main() # Because we have already call existsDeployKey in main()

View File

@@ -48,7 +48,7 @@ options:
type: str type: str
project: project:
description: description:
- The name of the GitLab project the member is added to/removed from. - The name (or full path) of the GitLab project the member is added to/removed from.
required: true required: true
type: str type: str
gitlab_user: gitlab_user:
@@ -194,9 +194,13 @@ class GitLabProjectMembers(object):
self._gitlab = gl self._gitlab = gl
def get_project(self, project_name): def get_project(self, project_name):
project_exists = self._gitlab.projects.list(search=project_name) try:
if project_exists: project_exists = self._gitlab.projects.get(project_name)
return project_exists[0].id return project_exists.id
except gitlab.exceptions.GitlabGetError as e:
project_exists = self._gitlab.projects.list(search=project_name)
if project_exists:
return project_exists[0].id
def get_user_id(self, gitlab_user): def get_user_id(self, gitlab_user):
user_exists = self._gitlab.users.list(username=gitlab_user) user_exists = self._gitlab.users.list(username=gitlab_user)

View File

@@ -77,7 +77,8 @@ import traceback
from ansible.module_utils.basic import AnsibleModule, missing_required_lib from ansible.module_utils.basic import AnsibleModule, missing_required_lib
from ansible.module_utils.api import basic_auth_argument_spec from ansible.module_utils.api import basic_auth_argument_spec
from distutils.version import LooseVersion
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
GITLAB_IMP_ERR = None GITLAB_IMP_ERR = None
try: try:

View File

@@ -92,7 +92,7 @@ options:
type: str type: str
maximum_timeout: maximum_timeout:
description: description:
- The maximum timeout that a runner has to pick up a specific job. - The maximum time that a runner has to complete a specific job.
required: False required: False
default: 3600 default: 3600
type: int type: int

View File

@@ -104,7 +104,7 @@ def main():
# available alternatives # available alternatives
current_path_regex = re.compile(r'^\s*link currently points to (.*)$', current_path_regex = re.compile(r'^\s*link currently points to (.*)$',
re.MULTILINE) re.MULTILINE)
alternative_regex = re.compile(r'^(\/.*)\s-\spriority', re.MULTILINE) alternative_regex = re.compile(r'^(\/.*)\s-\s(?:family\s\S+\s)?priority', re.MULTILINE)
match = current_path_regex.search(display_output) match = current_path_regex.search(display_output)
if match: if match:

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