Compare commits

..

39 Commits
4.8.3 ... 4.8.6

Author SHA1 Message Date
Felix Fontein
9e319610c3 Release 4.8.6. 2022-08-22 14:04:41 +02:00
Felix Fontein
92db683b08 Prepare 4.8.6 release. 2022-08-21 22:10:53 +02:00
patchback[bot]
81966e8900 Increase xfs size to 300 MB. This seems to be new minimal size. (#5133) (#5135)
(cherry picked from commit 98ea27847f)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-08-20 14:18:51 +02:00
patchback[bot]
465b0c72a6 Fix nsupdate when updating NS record (#5112) (#5131)
* Fix nsupdate when updating NS record

* Changelog fragment

* Update changelogs/fragments/5112-fix-nsupdate-ns-entry.yaml

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

* Switch to fallback to AUTHORITY instead of using with NS type.

* Update plugins/modules/net_tools/nsupdate.py

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

* Update plugins/modules/net_tools/nsupdate.py

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

Co-authored-by: jonathan lung <lungj@heresjono.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit ad8965218d)

Co-authored-by: Jonathan Lung <lungj@users.noreply.github.com>
2022-08-20 13:34:16 +02:00
patchback[bot]
37fc85b03a Remove Fedora 35 from devel CI runs. (#5121) (#5122)
(cherry picked from commit ad0c7095d4)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-08-16 22:21:18 +02:00
patchback[bot]
efcaf57da8 Try to install virtualenv via pip on Arch. (#5116) (#5118)
ci_complete

(cherry picked from commit 3dcff121c4)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-08-13 12:50:41 +02:00
Felix Fontein
e4eead189b Fix linting errors; fix some real bugs (#5111) (#5115)
* Fix linting errors.

* Fix bugs.

* Another linter error ignored.

* More fixes.

* Ignore sanity errors with older versions.

ci_complete

* Forgot to commit more changes.

(cherry picked from commit a54af8909c)
2022-08-12 14:37:34 +02:00
Felix Fontein
54bf6ef6de Add MIT-license.txt (#5072)
(partially cherry picked from commit b5eae69e36)
2022-08-05 12:47:18 +02:00
patchback[bot]
a63b8b14bc aix_filesystem: Fix examples (#5067) (#5070)
`community.general.filesystem` is not a valid argument to
aix_filesystem.

(cherry picked from commit 8f37638480)

Co-authored-by: Maxwell G <9920591+gotmax23@users.noreply.github.com>
2022-08-05 12:46:54 +02:00
patchback[bot]
2e335f3876 Set CARGO_NET_GIT_FETCH_WITH_CLI=true for cargo on Alpine. (#5053) (#5054)
(cherry picked from commit b5eae69e36)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-08-01 23:18:10 +02:00
Felix Fontein
9d770169cc Next release will be 4.8.6. 2022-08-01 20:52:50 +02:00
Felix Fontein
d6c9c0c49a Release 4.8.5. 2022-08-01 09:30:30 +02:00
patchback[bot]
9f1e976b9f Slack: Add support for (some) groups (#5019) (#5043)
* Slack: Add support for (some) groups

Some of the older private channels in the workspace I'm working in have channel ID's starting with `G0` and `GF` and this resulted to false positive `channel_not_found` errors.
I've added these prefixes to the list to maintain as much backwards compatibility as possible.

Ideally the auto-prefix of the channel name with `#` is dropped entirely, given the Channel ID's have become more dominant in the Slack API over the past years.

* Add changelog fragment for slack channel prefix fix

* Update changelogs/fragments/5019-slack-support-more-groups.yml

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

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

Co-authored-by: Richard Tuin <richardtuin@gmail.com>
2022-07-31 23:52:45 +02:00
Felix Fontein
e309707e22 Prepare 4.8.5 release. 2022-07-31 22:56:31 +02:00
patchback[bot]
7503c69b53 Pacman: Improve url integrity test (#4968) (#5010)
* Fix typo

* Host url package

* Delete cached files

* Add cases for cached url package

* Rename file_pkg for clarification

* Change port to 8080, as 80 is already used in pipeline

* Added fragment

* Change port to 8000, as 8080 is already used in pipeline

* Fixed changelog fragment

* Change port to 53280, as 8000 is already used in pipeline

* Change port to 27617 (copied from get_url), as 53280 is already used in pipeline

* Also download the signature of url package

Co-authored-by: Jean Raby <jean@raby.sh>

* Fix duplication errors

Co-authored-by: Jean Raby <jean@raby.sh>

* Copied waiting from get_url; applyed output redirection from jraby

* Fix signature filename

* Use correct cache dir

* Add missing assertions for uninstall_1c

* Fix typo

* Delete changelog fragment

* Make python server true async with 90 sec timeout

Copied from ainsible.builtin.get_url

Co-authored-by: Jean Raby <jean@raby.sh>
(cherry picked from commit 76b235c6b3)

Co-authored-by: Minei3oat <Minei3oat@users.noreply.github.com>
2022-07-27 07:41:37 +02:00
patchback[bot]
34d7369293 fixing minor documentation flaws (#5000) (#5003)
Co-authored-by: Thomas Blaesing <thomas.blaesing@erwinhymergroup.com>
(cherry picked from commit 037c75db4f)

Co-authored-by: Thomas <3999809+tehtbl@users.noreply.github.com>
2022-07-26 12:48:45 +02:00
patchback[bot]
91c37a79f4 Update to new Github account for notifications (#4986) (#4988)
* Update to new Github account for notifications

* Update to new Github account for notifications

(cherry picked from commit 3204905e5c)

Co-authored-by: Florian <100365291+florianpaulhoberg@users.noreply.github.com>
2022-07-23 14:23:31 +02:00
patchback[bot]
24c706ca1b python-daemon 2.3.1 requires Python 3+. (#4977) (#4980)
(cherry picked from commit e1cfa13a1b)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-07-23 13:32:59 +02:00
patchback[bot]
851dec44c5 Temporarily disable the yum_versionlock tests. (#4978) (#4984)
(cherry picked from commit 8f5a8cf4ba)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-07-23 12:22:49 +02:00
patchback[bot]
22773418d2 Pacman: Fix name of URL packages (#4959) (#4970)
* Strip downloading... of unseen URLs

* Added changelog fragment

* Added integration tests for reason and reason_for

Inspired by the integration tests for url packages

* Revert "Added integration tests for reason and reason_for"

This reverts commit f60d92f0d7.

Accidentally commited to the wrong branch.

(cherry picked from commit 788cfb624a)

Co-authored-by: Minei3oat <Minei3oat@users.noreply.github.com>
2022-07-21 20:16:24 +02:00
patchback[bot]
8854f4d948 proxmox module_utils: fix get_vm int parse handling (#4945) (#4966)
* add int parse handling

* Revert "add int parse handling"

This reverts commit db2aac4254.

* fix: vmid check if state is absent

* add changelogs fragments

* Update changelogs/fragments/4945-fix-get_vm-int-parse-handling.yaml

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

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

Co-authored-by: miyuk <enough7531@gmail.com>
2022-07-21 08:14:36 +02:00
patchback[bot]
35092aa7f9 Adjust to b1dd2af4ca. (#4949) (#4951)
(cherry picked from commit ade54bceb8)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-07-12 17:17:08 +02:00
patchback[bot]
5bbcfa5644 proxmox inventory: fix for agent enabled (#4910) (#4946)
* Update proxmox.py

* Forgot a debug print.

* pep

* Check if int, old school way.

* pep, once again.

* Create 4910-fix-for-agent-enabled.yml

* Must check the first listentry for enabled=1

* Update changelogs/fragments/4910-fix-for-agent-enabled.yml

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

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

Co-authored-by: ube <ube@alienautopsy.net>
2022-07-12 11:17:44 +02:00
Felix Fontein
8f6a4e0028 Next release will be 4.8.5. 2022-07-12 08:56:49 +02:00
Felix Fontein
1a185608bd Release 4.8.4. 2022-07-12 06:59:54 +02:00
Felix Fontein
69ba89db0d Prepare 4.8.4 release. 2022-07-11 22:07:57 +02:00
patchback[bot]
07798c3169 Fix syntax in rax_clb_nodes that breaks in Python3 (#4933) (#4936)
* Use syntax that works in both Python 2 and 3 when iterating through a
    dict that's going to be mutated during iteration
  * Fixes `dictionary changed size during iteration` error
  * Fixes #4932

(cherry picked from commit 9a928d5ffb)

Co-authored-by: Teddy Caddy <tcaddy@users.noreply.github.com>
2022-07-07 22:37:04 +02:00
patchback[bot]
44009a72d3 fix lxd connection plugin inventory_hostname (#4912) (#4934)
* fixes lxd connection plugin issue #4886

remote_addr value was set to literal string 'inventory_hostname' instead
of the value for inventory_hostname variable. solution found in PR
ansible/ansible#77894

* changelog fragment - bugfix - lxd connection plugin

* correct changelog fragment

* Update changelogs/fragments/4886-fix-lxd-inventory-hostname.yml

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

* replace _host instance variable with calls to get 'remote_addr' option

suggested by felixfontein

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

Co-authored-by: antonc42 <antonc42@users.noreply.github.com>
2022-07-07 22:36:55 +02:00
patchback[bot]
ab176acacf Fix license filenames. (#4923) (#4924)
(cherry picked from commit 1c06e237c8)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-07-04 20:12:07 +00:00
patchback[bot]
0372fdf150 Do not ignore tld option in DSV lookup plugin (#4911) (#4920)
* Do not ignore tld option in DSV lookup plugin

* add changelog fragment

* Update changelogs/fragments/4911-dsv-honor-tld-option.yml

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

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

Co-authored-by: andrii-zakurenyi <85106843+andrii-zakurenyi@users.noreply.github.com>
2022-07-04 20:59:28 +02:00
patchback[bot]
96c80fe478 Fix GetChassisPower when multiple chassis are present (#4902) (#4914)
* Fix GetChassisPower when multiple chassis are present

When multiple chassis are present, and one or more of those chassis do _not_
report power information, the GetChassisPower command will fail. To address
that, only report a failure if _all_ of the Chassis objects lack power
power reporting functionality.

Fixes #4901

* Update changelogs/fragments/4901-fix-redfish-chassispower.yml

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

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

Co-authored-by: Jacob Yundt <jyundt@gmail.com>
2022-06-30 21:01:40 +02:00
patchback[bot]
bf42b48d5d Improve hwclock support test. (#4904) (#4908)
(cherry picked from commit 674b1da8bf)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-06-30 07:41:59 +02:00
patchback[bot]
29145b15de Fix command variable usage in CmdRunner (#4903) (#4905)
* Fix command variable usage

* Add changelog fragment for cmd-runner bugfix (#4903)

(cherry picked from commit 265c052c27)

Co-authored-by: Álvaro García Jaén <garciajaenalvaro@gmail.com>
2022-06-30 07:18:38 +02:00
Felix Fontein
35c4de1e80 Fix various module docs. (#4887) (#4889)
(cherry picked from commit 2dcdd2faca)
2022-06-22 23:01:49 +02:00
patchback[bot]
37d25436e8 Fix docs. (#4881) (#4883)
(cherry picked from commit aa4c994dfd)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-06-22 14:44:30 +02:00
patchback[bot]
2a36e20465 Added additional maintainers for TSS and DSV lookup plugins (#4870) (#4874)
(cherry picked from commit cb58867b57)

Co-authored-by: Ricky White <ricky@migusgroup.com>
2022-06-21 22:55:53 +02:00
patchback[bot]
b5fb390274 Disable opentelemetry installation for unit tests. (#4871) (#4872)
(cherry picked from commit 1eee35dffb)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-06-21 21:39:30 +02:00
patchback[bot]
bc0bb0cfc5 Fix CI due to pycdlib dropping Python 2 support. (#4865) (#4868)
(cherry picked from commit 297de3011c)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-06-21 15:03:49 +02:00
Felix Fontein
b85107e289 Next expected release is 4.8.4. 2022-06-20 21:42:25 +02:00
115 changed files with 493 additions and 220 deletions

View File

@@ -327,8 +327,6 @@ stages:
targets:
- name: CentOS 7
test: centos7
- name: Fedora 35
test: fedora35
- name: Fedora 36
test: fedora36
- name: openSUSE 15

6
.github/BOTMETA.yml vendored
View File

@@ -220,7 +220,7 @@ files:
$lookups/dnstxt.py:
maintainers: jpmens
$lookups/dsv.py:
maintainers: amigus endlesstrax
maintainers: amigus endlesstrax delineaKrehl tylerezimmerman
$lookups/etcd3.py:
maintainers: eric-belhomme
$lookups/etcd.py:
@@ -257,7 +257,7 @@ files:
maintainers: RevBits
$lookups/shelvefile.py: {}
$lookups/tss.py:
maintainers: amigus endlesstrax
maintainers: amigus endlesstrax delineaKrehl tylerezimmerman
$module_utils/:
labels: module_utils
$module_utils/gitlab.py:
@@ -921,7 +921,7 @@ files:
$modules/packaging/os/xbps.py:
maintainers: dinoocch the-maldridge
$modules/packaging/os/yum_versionlock.py:
maintainers: florianpaulhoberg aminvakil
maintainers: gyptazy aminvakil
$modules/packaging/os/zypper.py:
maintainers: $team_suse
labels: zypper

View File

@@ -6,6 +6,64 @@ Community General Release Notes
This changelog describes changes after version 3.0.0.
v4.8.6
======
Release Summary
---------------
Bugfix and maintenance release.
Minor Changes
-------------
- Added MIT license as ``MIT-license.txt`` for ``tests/unit/plugins/modules/packaging/language/test_gem.py`` (https://github.com/ansible-collections/community.general/pull/5065, https://github.com/ansible-collections/community.general/pull/5072).
Bugfixes
--------
- apache2_mod_proxy - avoid crash when reporting inability to parse balancer_member_page HTML caused by using an undefined variable in the error message (https://github.com/ansible-collections/community.general/pull/5111).
- dnsimple_info - correctly report missing library as ``requests`` and not ``another_library`` (https://github.com/ansible-collections/community.general/pull/5111).
- funcd connection plugin - fix signature of ``exec_command`` (https://github.com/ansible-collections/community.general/pull/5111).
- manageiq_alert_profiles - avoid crash when reporting unknown profile caused by trying to return an undefined variable (https://github.com/ansible-collections/community.general/pull/5111).
- nsupdate - compatibility with NS records (https://github.com/ansible-collections/community.general/pull/5112).
- packet_ip_subnet - fix error reporting in case of invalid CIDR prefix lengths (https://github.com/ansible-collections/community.general/pull/5111).
- pip_package_info - remove usage of global variable (https://github.com/ansible-collections/community.general/pull/5111).
v4.8.5
======
Release Summary
---------------
Regular bugfix release.
Bugfixes
--------
- pacman - fixed name resolution of URL packages (https://github.com/ansible-collections/community.general/pull/4959).
- proxmox - fix error handling when getting VM by name when ``state=absent`` (https://github.com/ansible-collections/community.general/pull/4945).
- proxmox inventory plugin - fix crash when ``enabled=1`` is used in agent config string (https://github.com/ansible-collections/community.general/pull/4910).
- proxmox_kvm - fix error handling when getting VM by name when ``state=absent`` (https://github.com/ansible-collections/community.general/pull/4945).
- slack - fix incorrect channel prefix ``#`` caused by incomplete pattern detection by adding ``G0`` and ``GF`` as channel ID patterns (https://github.com/ansible-collections/community.general/pull/5019).
v4.8.4
======
Release Summary
---------------
Regular bugfix release.
Bugfixes
--------
- cmd_runner module utils - fix bug caused by using the ``command`` variable instead of ``self.command`` when looking for binary path (https://github.com/ansible-collections/community.general/pull/4903).
- dsv lookup plugin - do not ignore the ``tld`` parameter (https://github.com/ansible-collections/community.general/pull/4911).
- lxd connection plugin - fix incorrect ``inventory_hostname`` in ``remote_addr``. This is needed for compatibility with ansible-core 2.13 (https://github.com/ansible-collections/community.general/issues/4886).
- rax_clb_nodes - fix code to be compatible with Python 3 (https://github.com/ansible-collections/community.general/pull/4933).
- redfish_info - fix to ``GetChassisPower`` to correctly report power information when multiple chassis exist, but not all chassis report power information (https://github.com/ansible-collections/community.general/issues/4901).
v4.8.3
======

9
MIT-license.txt Normal file
View File

@@ -0,0 +1,9 @@
MIT License
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -1856,3 +1856,68 @@ releases:
- 4814-sudoers-file-permissions.yml
- 4852-sudoers-state-absent.yml
release_date: '2022-06-20'
4.8.4:
changes:
bugfixes:
- cmd_runner module utils - fix bug caused by using the ``command`` variable
instead of ``self.command`` when looking for binary path (https://github.com/ansible-collections/community.general/pull/4903).
- dsv lookup plugin - do not ignore the ``tld`` parameter (https://github.com/ansible-collections/community.general/pull/4911).
- lxd connection plugin - fix incorrect ``inventory_hostname`` in ``remote_addr``.
This is needed for compatibility with ansible-core 2.13 (https://github.com/ansible-collections/community.general/issues/4886).
- rax_clb_nodes - fix code to be compatible with Python 3 (https://github.com/ansible-collections/community.general/pull/4933).
- redfish_info - fix to ``GetChassisPower`` to correctly report power information
when multiple chassis exist, but not all chassis report power information
(https://github.com/ansible-collections/community.general/issues/4901).
release_summary: Regular bugfix release.
fragments:
- 4.8.4.yml
- 4886-fix-lxd-inventory-hostname.yml
- 4901-fix-redfish-chassispower.yml
- 4903-cmdrunner-bugfix.yaml
- 4911-dsv-honor-tld-option.yml
- 4933-fix-rax-clb-nodes.yaml
release_date: '2022-07-12'
4.8.5:
changes:
bugfixes:
- pacman - fixed name resolution of URL packages (https://github.com/ansible-collections/community.general/pull/4959).
- proxmox - fix error handling when getting VM by name when ``state=absent``
(https://github.com/ansible-collections/community.general/pull/4945).
- proxmox inventory plugin - fix crash when ``enabled=1`` is used in agent config
string (https://github.com/ansible-collections/community.general/pull/4910).
- proxmox_kvm - fix error handling when getting VM by name when ``state=absent``
(https://github.com/ansible-collections/community.general/pull/4945).
- slack - fix incorrect channel prefix ``#`` caused by incomplete pattern detection
by adding ``G0`` and ``GF`` as channel ID patterns (https://github.com/ansible-collections/community.general/pull/5019).
release_summary: Regular bugfix release.
fragments:
- 4.8.5.yml
- 4910-fix-for-agent-enabled.yml
- 4945-fix-get_vm-int-parse-handling.yaml
- 4959-pacman-fix-url-packages-name.yaml
- 5019-slack-support-more-groups.yml
release_date: '2022-08-01'
4.8.6:
changes:
bugfixes:
- apache2_mod_proxy - avoid crash when reporting inability to parse balancer_member_page
HTML caused by using an undefined variable in the error message (https://github.com/ansible-collections/community.general/pull/5111).
- dnsimple_info - correctly report missing library as ``requests`` and not ``another_library``
(https://github.com/ansible-collections/community.general/pull/5111).
- funcd connection plugin - fix signature of ``exec_command`` (https://github.com/ansible-collections/community.general/pull/5111).
- manageiq_alert_profiles - avoid crash when reporting unknown profile caused
by trying to return an undefined variable (https://github.com/ansible-collections/community.general/pull/5111).
- nsupdate - compatibility with NS records (https://github.com/ansible-collections/community.general/pull/5112).
- packet_ip_subnet - fix error reporting in case of invalid CIDR prefix lengths
(https://github.com/ansible-collections/community.general/pull/5111).
- pip_package_info - remove usage of global variable (https://github.com/ansible-collections/community.general/pull/5111).
minor_changes:
- Added MIT license as ``MIT-license.txt`` for ``tests/unit/plugins/modules/packaging/language/test_gem.py``
(https://github.com/ansible-collections/community.general/pull/5065, https://github.com/ansible-collections/community.general/pull/5072).
release_summary: Bugfix and maintenance release.
fragments:
- 4.8.6.yml
- 5111-fixes.yml
- 5112-fix-nsupdate-ns-entry.yaml
- licenses.yml
release_date: '2022-08-22'

View File

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

View File

@@ -8,9 +8,9 @@ DOCUMENTATION = """
name: sudosu
short_description: Run tasks using sudo su -
description:
- This become plugins allows your remote/login user to execute commands as another user via the C(sudo) and C(su) utilities combined.
- This become plugin allows your remote/login user to execute commands as another user via the C(sudo) and C(su) utilities combined.
author:
- Dag Wieers (@dagwieers)
- Dag Wieers (@dagwieers)
version_added: 2.4.0
options:
become_user:

View File

@@ -232,13 +232,13 @@ class CallbackModule(CallbackModule_default):
# Remove non-essential attributes
for attr in self.removed_attributes:
if attr in result:
del(result[attr])
del result[attr]
# Remove empty attributes (list, dict, str)
for attr in result.copy():
if isinstance(result[attr], (MutableSequence, MutableMapping, binary_type, text_type)):
if not result[attr]:
del(result[attr])
del result[attr]
def _handle_exceptions(self, result):
if 'exception' in result:

View File

@@ -12,7 +12,7 @@ DOCUMENTATION = '''
type: notification
short_description: write playbook output to log file
description:
- This callback writes playbook output to a file per host in the `/var/log/ansible/hosts` directory
- This callback writes playbook output to a file per host in the C(/var/log/ansible/hosts) directory
requirements:
- Whitelist in configuration
- A writeable /var/log/ansible/hosts directory by the user executing Ansible on the controller

View File

@@ -14,9 +14,9 @@ DOCUMENTATION = '''
- set as main display callback
short_description: only print certain tasks
description:
- This callback only prints tasks that have been tagged with `print_action` or that have failed.
- This callback only prints tasks that have been tagged with C(print_action) or that have failed.
This allows operators to focus on the tasks that provide value only.
- Tasks that are not printed are placed with a '.'.
- Tasks that are not printed are placed with a C(.).
- If you increase verbosity all tasks are printed.
options:
nocolor:

View File

@@ -63,7 +63,7 @@ class Connection(ConnectionBase):
self.client = fc.Client(self.host)
return self
def exec_command(self, cmd, become_user=None, sudoable=False, executable='/bin/sh', in_data=None):
def exec_command(self, cmd, in_data=None, sudoable=True):
""" run a command on the remote minion """
if in_data:

View File

@@ -18,6 +18,7 @@ DOCUMENTATION = '''
- Container identifier.
default: inventory_hostname
vars:
- name: inventory_hostname
- name: ansible_host
- name: ansible_lxd_host
executable:
@@ -61,7 +62,6 @@ class Connection(ConnectionBase):
def __init__(self, play_context, new_stdin, *args, **kwargs):
super(Connection, self).__init__(play_context, new_stdin, *args, **kwargs)
self._host = self._play_context.remote_addr
try:
self._lxc_cmd = get_bin_path("lxc")
except ValueError:
@@ -75,14 +75,14 @@ class Connection(ConnectionBase):
super(Connection, self)._connect()
if not self._connected:
self._display.vvv(u"ESTABLISH LXD CONNECTION FOR USER: root", host=self._host)
self._display.vvv(u"ESTABLISH LXD CONNECTION FOR USER: root", host=self.get_option('remote_addr'))
self._connected = True
def exec_command(self, cmd, in_data=None, sudoable=True):
""" execute a command on the lxd host """
super(Connection, self).exec_command(cmd, in_data=in_data, sudoable=sudoable)
self._display.vvv(u"EXEC {0}".format(cmd), host=self._host)
self._display.vvv(u"EXEC {0}".format(cmd), host=self.get_option('remote_addr'))
local_cmd = [self._lxc_cmd]
if self.get_option("project"):
@@ -104,10 +104,10 @@ class Connection(ConnectionBase):
stderr = to_text(stderr)
if stderr == "error: Container is not running.\n":
raise AnsibleConnectionFailure("container not running: %s" % self._host)
raise AnsibleConnectionFailure("container not running: %s" % self.get_option('remote_addr'))
if stderr == "error: not found\n":
raise AnsibleConnectionFailure("container not found: %s" % self._host)
raise AnsibleConnectionFailure("container not found: %s" % self.get_option('remote_addr'))
return process.returncode, stdout, stderr
@@ -115,7 +115,7 @@ class Connection(ConnectionBase):
""" put a file from local to lxd """
super(Connection, self).put_file(in_path, out_path)
self._display.vvv(u"PUT {0} TO {1}".format(in_path, out_path), host=self._host)
self._display.vvv(u"PUT {0} TO {1}".format(in_path, out_path), host=self.get_option('remote_addr'))
if not os.path.isfile(to_bytes(in_path, errors='surrogate_or_strict')):
raise AnsibleFileNotFound("input path is not a file: %s" % in_path)
@@ -138,7 +138,7 @@ class Connection(ConnectionBase):
""" fetch a file from lxd to local """
super(Connection, self).fetch_file(in_path, out_path)
self._display.vvv(u"FETCH {0} TO {1}".format(in_path, out_path), host=self._host)
self._display.vvv(u"FETCH {0} TO {1}".format(in_path, out_path), host=self.get_option('remote_addr'))
local_cmd = [self._lxc_cmd]
if self.get_option("project"):

View File

@@ -400,12 +400,20 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
properties[parsed_key] = [tag.strip() for tag in stripped_value.split(",")]
# The first field in the agent string tells you whether the agent is enabled
# the rest of the comma separated string is extra config for the agent
if config == 'agent' and int(value.split(',')[0]):
agent_iface_value = self._get_agent_network_interfaces(node, vmid, vmtype)
if agent_iface_value:
agent_iface_key = self.to_safe('%s%s' % (key, "_interfaces"))
properties[agent_iface_key] = agent_iface_value
# the rest of the comma separated string is extra config for the agent.
# In some (newer versions of proxmox) instances it can be 'enabled=1'.
if config == 'agent':
agent_enabled = 0
try:
agent_enabled = int(value.split(',')[0])
except ValueError:
if value.split(',')[0] == "enabled=1":
agent_enabled = 1
if agent_enabled:
agent_iface_value = self._get_agent_network_interfaces(node, vmid, vmtype)
if agent_iface_value:
agent_iface_key = self.to_safe('%s%s' % (key, "_interfaces"))
properties[agent_iface_key] = agent_iface_value
if config == 'lxc':
out_val = {}

View File

@@ -16,7 +16,7 @@ DOCUMENTATION = '''
The lookup order mirrors the one from Chef, all folders in the base path are walked back looking for the following configuration
file in order : .chef/knife.rb, ~/.chef/knife.rb, /etc/chef/client.rb"
requirements:
- "pychef (python library https://pychef.readthedocs.io `pip install pychef`)"
- "pychef (L(Python library, https://pychef.readthedocs.io), C(pip install pychef))"
options:
name:
description:

View File

@@ -122,6 +122,7 @@ class LookupModule(LookupBase):
"tenant": self.get_option("tenant"),
"client_id": self.get_option("client_id"),
"client_secret": self.get_option("client_secret"),
"tld": self.get_option("tld"),
"url_template": self.get_option("url_template"),
}
)

View File

@@ -191,7 +191,7 @@ class CmdRunner(object):
environ_update = {}
self.environ_update = environ_update
self.command[0] = module.get_bin_path(command[0], opt_dirs=path_prefix, required=True)
self.command[0] = module.get_bin_path(self.command[0], opt_dirs=path_prefix, required=True)
for mod_param_name, spec in iteritems(module.argument_spec):
if mod_param_name not in self.arg_formats:

View File

@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021-2022 Hewlett Packard Enterprise, Inc. All rights reserved.
# GNU General Public License v3.0+ (see LICENSE 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)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
@@ -91,7 +91,7 @@ class iLORedfishUtils(RedfishUtils):
data = response['data']
ntp_list = data[setkey]
if(len(ntp_list) == 2):
if len(ntp_list) == 2:
ntp_list.pop(0)
ntp_list.append(mgr_attributes['mgr_attr_value'])

View File

@@ -78,7 +78,7 @@ def memset_api_call(api_key, api_method, payload=None):
if msg is None:
msg = response.json()
return(has_failed, msg, response)
return has_failed, msg, response
def check_zone_domain(data, domain):
@@ -92,7 +92,7 @@ def check_zone_domain(data, domain):
if zone_domain['domain'] == domain:
exists = True
return(exists)
return exists
def check_zone(data, name):
@@ -109,7 +109,7 @@ def check_zone(data, name):
if counter == 1:
exists = True
return(exists, counter)
return exists, counter
def get_zone_id(zone_name, current_zones):
@@ -135,4 +135,4 @@ def get_zone_id(zone_name, current_zones):
zone_id = None
msg = 'Zone ID could not be returned as duplicate zone names were detected'
return(zone_exists, msg, counter, zone_id)
return zone_exists, msg, counter, zone_id

View File

@@ -122,8 +122,7 @@ def rax_find_image(module, rax_module, image, exit=True):
except ValueError:
try:
image = cs.images.find(human_id=image)
except(cs.exceptions.NotFound,
cs.exceptions.NoUniqueMatch):
except (cs.exceptions.NotFound, cs.exceptions.NoUniqueMatch):
try:
image = cs.images.find(name=image)
except (cs.exceptions.NotFound,

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017-2018 Dell EMC Inc.
# GNU General Public License v3.0+ (see LICENSE 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)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
@@ -1883,14 +1883,13 @@ class RedfishUtils(object):
for property in properties:
if property in data:
chassis_power_result[property] = data[property]
else:
return {'ret': False, 'msg': 'Key PowerControl not found.'}
chassis_power_results.append(chassis_power_result)
else:
return {'ret': False, 'msg': 'Key Power not found.'}
result['entries'] = chassis_power_results
return result
if len(chassis_power_results) > 0:
result['entries'] = chassis_power_results
return result
else:
return {'ret': False, 'msg': 'Power information not found.'}
def get_chassis_thermals(self):
result = {}
@@ -2056,7 +2055,7 @@ class RedfishUtils(object):
if property in data:
nic[property] = data[property]
result['entries'] = nic
return(result)
return result
def get_nic_inventory(self, resource_uri):
result = {}

View File

@@ -15,6 +15,7 @@ try:
from redis import Redis
from redis import __version__ as redis_version
HAS_REDIS_PACKAGE = True
REDIS_IMP_ERR = None
except ImportError:
REDIS_IMP_ERR = traceback.format_exc()
HAS_REDIS_PACKAGE = False
@@ -22,6 +23,7 @@ except ImportError:
try:
import certifi
HAS_CERTIFI_PACKAGE = True
CERTIFI_IMPORT_ERROR = None
except ImportError:
CERTIFI_IMPORT_ERROR = traceback.format_exc()
HAS_CERTIFI_PACKAGE = False

View File

@@ -191,10 +191,10 @@ notes:
2.1, the later requires python to be installed in the instance which can
be done with the command module.
- You can copy a file from the host to the instance
with the Ansible M(ansible.builtin.copy) and M(ansible.builtin.template) module and the `lxd` connection plugin.
with the Ansible M(ansible.builtin.copy) and M(ansible.builtin.template) module and the C(community.general.lxd) connection plugin.
See the example below.
- You can copy a file in the created instance to the localhost
with `command=lxc file pull instance_name/dir/filename filename`.
with C(command=lxc file pull instance_name/dir/filename filename).
See the first example below.
'''

View File

@@ -111,7 +111,7 @@ def poll_reload_status(api_key=None, job_id=None, payload=None):
memset_api = response.json()
msg = None
return(memset_api, msg, stderr)
return memset_api, msg, stderr
def reload_dns(args=None):
@@ -133,7 +133,7 @@ def reload_dns(args=None):
retvals['failed'] = has_failed
retvals['memset_api'] = response.json()
retvals['msg'] = msg
return(retvals)
return retvals
# set changed to true if the reload request was accepted.
has_changed = True
@@ -153,7 +153,7 @@ def reload_dns(args=None):
if val is not None:
retvals[val] = eval(val)
return(retvals)
return retvals
def main():

View File

@@ -127,7 +127,7 @@ def get_facts(args=None):
retvals['failed'] = has_failed
retvals['msg'] = msg
retvals['stderr'] = "API returned an error: {0}" . format(response.status_code)
return(retvals)
return retvals
# we don't want to return the same thing twice
msg = None
@@ -139,7 +139,7 @@ def get_facts(args=None):
if val is not None:
retvals[val] = eval(val)
return(retvals)
return retvals
def main():

View File

@@ -252,7 +252,7 @@ def get_facts(args=None):
retvals['failed'] = has_failed
retvals['msg'] = msg
retvals['stderr'] = "API returned an error: {0}" . format(response.status_code)
return(retvals)
return retvals
# we don't want to return the same thing twice
msg = None
@@ -264,7 +264,7 @@ def get_facts(args=None):
if val is not None:
retvals[val] = eval(val)
return(retvals)
return retvals
def main():

View File

@@ -139,7 +139,7 @@ def check(args=None):
retvals['changed'] = has_changed
retvals['failed'] = has_failed
return(retvals)
return retvals
def create_zone(args=None, zone_exists=None, payload=None):
@@ -185,7 +185,7 @@ def create_zone(args=None, zone_exists=None, payload=None):
_has_failed, _msg, response = memset_api_call(api_key=args['api_key'], api_method=api_method, payload=payload)
memset_api = response.json()
return(has_failed, has_changed, memset_api, msg)
return has_failed, has_changed, memset_api, msg
def delete_zone(args=None, zone_exists=None, payload=None):
@@ -233,7 +233,7 @@ def delete_zone(args=None, zone_exists=None, payload=None):
else:
has_failed, has_changed = False, False
return(has_failed, has_changed, memset_api, msg)
return has_failed, has_changed, memset_api, msg
def create_or_delete(args=None):
@@ -255,7 +255,7 @@ def create_or_delete(args=None):
retvals['failed'] = _has_failed
retvals['msg'] = _msg
return(retvals)
return retvals
zone_exists, _msg, counter, _zone_id = get_zone_id(zone_name=args['name'], current_zones=response.json())
@@ -271,7 +271,7 @@ def create_or_delete(args=None):
if val is not None:
retvals[val] = eval(val)
return(retvals)
return retvals
def main():

View File

@@ -110,7 +110,7 @@ def check(args=None):
retvals['changed'] = has_changed
retvals['failed'] = has_failed
return(retvals)
return retvals
def create_zone_domain(args=None, zone_exists=None, zone_id=None, payload=None):
@@ -138,7 +138,7 @@ def create_zone_domain(args=None, zone_exists=None, zone_id=None, payload=None):
if not has_failed:
has_changed = True
return(has_failed, has_changed, msg)
return has_failed, has_changed, msg
def delete_zone_domain(args=None, payload=None):
@@ -165,7 +165,7 @@ def delete_zone_domain(args=None, payload=None):
# unset msg as we don't want to return unnecessary info to the user.
msg = None
return(has_failed, has_changed, memset_api, msg)
return has_failed, has_changed, memset_api, msg
def create_or_delete_domain(args=None):
@@ -188,7 +188,7 @@ def create_or_delete_domain(args=None):
retvals['failed'] = has_failed
retvals['msg'] = msg
retvals['stderr'] = "API returned an error: {0}" . format(response.status_code)
return(retvals)
return retvals
zone_exists, msg, counter, zone_id = get_zone_id(zone_name=args['zone'], current_zones=response.json())
@@ -203,7 +203,7 @@ def create_or_delete_domain(args=None):
retvals['failed'] = has_failed
retvals['msg'] = stderr
return(retvals)
return retvals
if args['state'] == 'present':
has_failed, has_changed, msg = create_zone_domain(args=args, zone_exists=zone_exists, zone_id=zone_id, payload=payload)
@@ -217,7 +217,7 @@ def create_or_delete_domain(args=None):
if val is not None:
retvals[val] = eval(val)
return(retvals)
return retvals
def main():

View File

@@ -221,7 +221,7 @@ def create_zone_record(args=None, zone_id=None, records=None, payload=None):
# nothing to do; record is already correct so we populate
# the return var with the existing record's details.
memset_api = zone_record
return(has_changed, has_failed, memset_api, msg)
return has_changed, has_failed, memset_api, msg
else:
# merge dicts ensuring we change any updated values
payload = zone_record.copy()
@@ -231,7 +231,7 @@ def create_zone_record(args=None, zone_id=None, records=None, payload=None):
has_changed = True
# return the new record to the user in the returned var.
memset_api = new_record
return(has_changed, has_failed, memset_api, msg)
return has_changed, has_failed, memset_api, msg
has_failed, msg, response = memset_api_call(api_key=args['api_key'], api_method=api_method, payload=payload)
if not has_failed:
has_changed = True
@@ -246,7 +246,7 @@ def create_zone_record(args=None, zone_id=None, records=None, payload=None):
has_changed = True
# populate the return var with the new record's details.
memset_api = new_record
return(has_changed, has_failed, memset_api, msg)
return has_changed, has_failed, memset_api, msg
has_failed, msg, response = memset_api_call(api_key=args['api_key'], api_method=api_method, payload=payload)
if not has_failed:
has_changed = True
@@ -254,7 +254,7 @@ def create_zone_record(args=None, zone_id=None, records=None, payload=None):
# empty msg as we don't want to return a boatload of json to the user.
msg = None
return(has_changed, has_failed, memset_api, msg)
return has_changed, has_failed, memset_api, msg
def delete_zone_record(args=None, records=None, payload=None):
@@ -270,7 +270,7 @@ def delete_zone_record(args=None, records=None, payload=None):
for zone_record in records:
if args['check_mode']:
has_changed = True
return(has_changed, has_failed, memset_api, msg)
return has_changed, has_failed, memset_api, msg
payload['id'] = zone_record['id']
api_method = 'dns.zone_record_delete'
has_failed, msg, response = memset_api_call(api_key=args['api_key'], api_method=api_method, payload=payload)
@@ -280,7 +280,7 @@ def delete_zone_record(args=None, records=None, payload=None):
# empty msg as we don't want to return a boatload of json to the user.
msg = None
return(has_changed, has_failed, memset_api, msg)
return has_changed, has_failed, memset_api, msg
def create_or_delete(args=None):
@@ -304,7 +304,7 @@ def create_or_delete(args=None):
retvals['failed'] = _has_failed
retvals['msg'] = msg
retvals['stderr'] = "API returned an error: {0}" . format(response.status_code)
return(retvals)
return retvals
zone_exists, _msg, counter, zone_id = get_zone_id(zone_name=args['zone'], current_zones=response.json())
@@ -317,7 +317,7 @@ def create_or_delete(args=None):
retvals['failed'] = has_failed
retvals['msg'] = stderr
retvals['stderr'] = stderr
return(retvals)
return retvals
# get a list of all records ( as we can't limit records by zone)
api_method = 'dns.zone_record_list'
@@ -339,7 +339,7 @@ def create_or_delete(args=None):
if val is not None:
retvals[val] = eval(val)
return(retvals)
return retvals
def main():

View File

@@ -743,6 +743,8 @@ def main():
module.fail_json(msg="restarting of VM %s failed with exception: %s" % (vmid, e))
elif state == 'absent':
if not vmid:
module.exit_json(changed=False, msg='VM with hostname = %s is already absent' % hostname)
try:
vm = proxmox.get_vm(vmid, ignore_missing=True)
if not vm:

View File

@@ -1370,6 +1370,8 @@ def main():
elif state == 'absent':
status = {}
if not vmid:
module.exit_json(changed=False, msg='VM with name = %s is already absent' % name)
try:
vm = proxmox.get_vm(vmid, ignore_missing=True)
if not vm:

View File

@@ -1252,7 +1252,6 @@ def setChanged():
def setMsg(message):
global failed
msg.append(message)

View File

@@ -115,7 +115,7 @@ state:
returned: always
command:
type: str
description: Full `serverless` command run by this module, in case you want to re-run the command outside the module.
description: Full C(serverless) command run by this module, in case you want to re-run the command outside the module.
returned: always
sample: serverless deploy --stage production
'''

View File

@@ -67,7 +67,7 @@ options:
state_file:
description:
- The path to an existing Terraform state file to use when building plan.
If this is not specified, the default `terraform.tfstate` will be used.
If this is not specified, the default C(terraform.tfstate) will be used.
- This option is ignored when plan is specified.
type: path
variables_files:
@@ -103,7 +103,7 @@ options:
force_init:
description:
- To avoid duplicating infra, if a state file can't be found this will
force a `terraform init`. Generally, this should be turned off unless
force a C(terraform init). Generally, this should be turned off unless
you intend to provision an entirely new Terraform deployment.
default: false
type: bool
@@ -149,7 +149,7 @@ options:
type: int
version_added: '3.8.0'
notes:
- To just run a `terraform plan`, use check mode.
- To just run a C(terraform plan), use check mode.
requirements: [ "terraform" ]
author: "Ryan Scott Brown (@ryansb)"
'''
@@ -205,7 +205,7 @@ EXAMPLES = """
RETURN = """
outputs:
type: complex
description: A dictionary of all the TF outputs by their assigned name. Use `.outputs.MyOutputName.value` to access the value.
description: A dictionary of all the TF outputs by their assigned name. Use C(.outputs.MyOutputName.value) to access the value.
returned: on success
sample: '{"bukkit_arn": {"sensitive": false, "type": "string", "value": "arn:aws:s3:::tf-test-bukkit"}'
contains:
@@ -223,12 +223,12 @@ outputs:
description: The value of the output as interpolated by Terraform
stdout:
type: str
description: Full `terraform` command stdout, in case you want to display it or examine the event log
description: Full C(terraform) command stdout, in case you want to display it or examine the event log
returned: always
sample: ''
command:
type: str
description: Full `terraform` command built by this module, in case you want to re-run the command outside the module or debug a problem.
description: Full C(terraform) command built by this module, in case you want to re-run the command outside the module or debug a problem.
returned: always
sample: terraform apply ...
"""

View File

@@ -346,7 +346,7 @@ def get_connection_info(module):
if not password:
password = os.environ.get('ONE_PASSWORD')
if not(url and username and password):
if not (url and username and password):
module.fail_json(msg="One or more connection parameters (api_url, api_username, api_password) were not specified")
from collections import namedtuple

View File

@@ -240,7 +240,7 @@ def get_connection_info(module):
if not password:
password = os.environ.get('ONE_PASSWORD')
if not(url and username and password):
if not (url and username and password):
module.fail_json(msg="One or more connection parameters (api_url, api_username, api_password) were not specified")
from collections import namedtuple

View File

@@ -660,7 +660,7 @@ def get_connection_info(module):
if not password:
password = os.environ.get('ONEFLOW_PASSWORD')
if not(url and username and password):
if not (url and username and password):
module.fail_json(msg="One or more connection parameters (api_url, api_username, api_password) were not specified")
from collections import namedtuple

View File

@@ -216,7 +216,7 @@ def parse_subnet_cidr(cidr):
try:
prefixlen = int(prefixlen)
except ValueError:
raise("Wrong prefix length in CIDR expression {0}".format(cidr))
raise Exception("Wrong prefix length in CIDR expression {0}".format(cidr))
return addr, prefixlen

View File

@@ -183,7 +183,7 @@ def remove_datacenter(module, profitbricks):
name = module.params.get('name')
changed = False
if(uuid_match.match(name)):
if uuid_match.match(name):
_remove_datacenter(module, profitbricks, name)
changed = True
else:

View File

@@ -324,7 +324,7 @@ def delete_volume(module, profitbricks):
break
for n in instance_ids:
if(uuid_match.match(n)):
if uuid_match.match(n):
_delete_volume(module, profitbricks, datacenter, n)
changed = True
else:

View File

@@ -252,7 +252,8 @@ def main():
'weight': weight,
}
for name, value in mutable.items():
for name in list(mutable):
value = mutable[name]
if value is None or value == getattr(node, name):
mutable.pop(name)

View File

@@ -75,15 +75,15 @@ options:
target_hostname:
type: str
description:
- One of `target_hostname` and `target_alias` is required for remote.* checks,
- One of I(target_hostname) and I(target_alias) is required for remote.* checks,
but prohibited for agent.* checks. The hostname this check should target.
Must be a valid IPv4, IPv6, or FQDN.
target_alias:
type: str
description:
- One of `target_alias` and `target_hostname` is required for remote.* checks,
- One of I(target_alias) and I(target_hostname) is required for remote.* checks,
but prohibited for agent.* checks. Use the corresponding key in the entity's
`ip_addresses` hash to resolve an IP address to target.
I(ip_addresses) hash to resolve an IP address to target.
details:
type: dict
description:

View File

@@ -143,6 +143,7 @@ except ImportError:
IPADDRESS_IMP_ERR = traceback.format_exc()
HAS_IPADDRESS = False
else:
IPADDRESS_IMP_ERR = None
HAS_IPADDRESS = True

View File

@@ -35,7 +35,7 @@ options:
user_data:
type: dict
description:
- User defined data. Typically used with `cloud-init`.
- User defined data. Typically used with C(cloud-init).
- Pass your cloud-init script here as a string
required: false

View File

@@ -28,14 +28,14 @@ author:
options:
state:
description:
- The action to take with the supplied key and value. If the state is 'present' and `value` is set, the key
contents will be set to the value supplied and `changed` will be set to `true` only if the value was
different to the current contents. If the state is 'present' and `value` is not set, the existing value
associated to the key will be returned. The state 'absent' will remove the key/value pair,
again 'changed' will be set to true only if the key actually existed
- The action to take with the supplied key and value. If the state is C(present) and I(value) is set, the key
contents will be set to the value supplied and C(changed) will be set to C(true) only if the value was
different to the current contents. If the state is C(present) and I(value) is not set, the existing value
associated to the key will be returned. The state C(absent) will remove the key/value pair,
again C(changed) will be set to true only if the key actually existed
prior to the removal. An attempt can be made to obtain or free the
lock associated with a key/value pair with the states 'acquire' or
'release' respectively. a valid session must be supplied to make the
lock associated with a key/value pair with the states C(acquire) or
C(release) respectively. a valid session must be supplied to make the
attempt changed will be true if the attempt is successful, false
otherwise.
type: str

View File

@@ -126,6 +126,7 @@ from ansible.module_utils.common.text.converters import to_native
try:
import etcd3
HAS_ETCD = True
ETCD_IMP_ERR = None
except ImportError:
ETCD_IMP_ERR = traceback.format_exc()
HAS_ETCD = False

View File

@@ -309,7 +309,7 @@ def do_ini(module, filename, section=None, option=None, values=None,
# override option with no value to option with value if not allow_no_value
if len(values) > 0:
for index, line in enumerate(section_lines):
if not changed_lines[index] and match_active_opt(option, section_lines[index]):
if not changed_lines[index] and match_active_opt(option, section_lines[index]): # pylint: disable=unnecessary-list-index-lookup
newline = assignment_format % (option, values.pop(0))
(changed, msg) = update_section_line(changed, section_lines, index, changed_lines, newline, msg)
if len(values) == 0:

View File

@@ -445,8 +445,8 @@ def ensure(module, client):
module_otptoken['all'] = True
ipa_otptoken = client.otptoken_add(name=uniqueid, item=module_otptoken)
else:
if not(validate_modifications(ansible_to_ipa, module, ipa_otptoken,
module_otptoken, unmodifiable_after_creation)):
if not validate_modifications(ansible_to_ipa, module, ipa_otptoken,
module_otptoken, unmodifiable_after_creation):
module.fail_json(msg="Modifications requested in module are not valid")
# IPA will reject 'modifications' that do not actually modify anything

View File

@@ -20,7 +20,7 @@ description:
- "Allows to post events to Datadog (www.datadoghq.com) service."
- "Uses http://docs.datadoghq.com/api/#events API."
author:
- "Artūras `arturaz` Šlajus (@arturaz)"
- "Artūras 'arturaz' Šlajus (@arturaz)"
- "Naoya Nakazawa (@n0ts)"
options:
api_key:

View File

@@ -86,6 +86,7 @@ from os import path
try:
from pdpyras import APISession
HAS_PD_PY = True
PD_IMPORT_ERR = None
except ImportError:
HAS_PD_PY = False
PD_IMPORT_ERR = traceback.format_exc()
@@ -93,6 +94,7 @@ except ImportError:
try:
from pdpyras import PDClientError
HAS_PD_CLIENT_ERR = True
PD_CLIENT_ERR_IMPORT_ERR = None
except ImportError:
HAS_PD_CLIENT_ERR = False
PD_CLIENT_ERR_IMPORT_ERR = traceback.format_exc()

View File

@@ -233,10 +233,11 @@ import json
try:
from requests import Request, Session
except ImportError:
HAS_ANOTHER_LIBRARY = False
ANOTHER_LIBRARY_IMPORT_ERROR = traceback.format_exc()
HAS_REQUESTS = False
REQUESTS_IMPORT_ERROR = traceback.format_exc()
else:
HAS_ANOTHER_LIBRARY = True
HAS_REQUESTS = True
REQUESTS_IMPORT_ERROR = None
def build_url(account, key, is_sandbox):
@@ -261,7 +262,7 @@ def iterate_data(module, request_object):
request_object.url = base_url + '&page=' + str(page)
new_results = Session().send(request_object)
data = data + new_results.json()["data"]
return(data)
return data
else:
module.fail_json('API Call failed, check ID, key and sandbox values')
@@ -305,11 +306,10 @@ def main():
params['api_key'],
params['sandbox'])
if not HAS_ANOTHER_LIBRARY:
# Needs: from ansible.module_utils.basic import missing_required_lib
if not HAS_REQUESTS:
module.exit_json(
msg=missing_required_lib('another_library'),
exception=ANOTHER_LIBRARY_IMPORT_ERROR)
msg=missing_required_lib('requests'),
exception=REQUESTS_IMPORT_ERROR)
# At minimum we need account and key
if params['account_id'] and params['api_key']:

View File

@@ -99,7 +99,7 @@ options:
weight:
description:
- The value passed in argument.
- If the value ends with the `%` sign, then the new weight will be
- If the value ends with the C(%) sign, then the new weight will be
relative to the initially configured weight.
- Relative weights are only permitted between 0 and 100% and absolute
weights are permitted between 0 and 256.

View File

@@ -426,7 +426,10 @@ class RecordManager(object):
if lookup.rcode() != dns.rcode.NOERROR:
self.module.fail_json(msg='Failed to lookup TTL of existing matching record.')
current_ttl = lookup.answer[0].ttl
if self.module.params['type'] == 'NS':
current_ttl = lookup.answer[0].ttl if lookup.answer else lookup.authority[0].ttl
else:
current_ttl = lookup.answer[0].ttl
return current_ttl != self.module.params['ttl']

View File

@@ -293,7 +293,7 @@ def build_payload_for_slack(text, channel, thread_id, username, icon_url, icon_e
# With a custom color we have to set the message as attachment, and explicitly turn markdown parsing on for it.
payload = dict(attachments=[dict(text=escape_quotes(text), color=color, mrkdwn_in=["text"])])
if channel is not None:
if channel.startswith(('#', '@', 'C0')):
if channel.startswith(('#', '@', 'C0', 'GF', 'G0')):
payload['channel'] = channel
else:
payload['channel'] = '#' + channel

View File

@@ -17,7 +17,7 @@ options:
clients:
description:
- A list of the pip executables that will be used to get the packages.
They can be supplied with the full path or just the executable name, i.e `pip3.7`.
They can be supplied with the full path or just the executable name, for example C(pip3.7).
default: ['pip']
required: False
type: list
@@ -97,13 +97,13 @@ from ansible.module_utils.facts.packages import CLIMgr
class PIP(CLIMgr):
def __init__(self, pip):
def __init__(self, pip, module):
self.CLI = pip
self.module = module
def list_installed(self):
global module
rc, out, err = module.run_command([self._cli, 'list', '-l', '--format=json'])
rc, out, err = self.module.run_command([self._cli, 'list', '-l', '--format=json'])
if rc != 0:
raise Exception("Unable to list packages rc=%s : %s" % (rc, err))
return json.loads(out)
@@ -116,7 +116,6 @@ class PIP(CLIMgr):
def main():
# start work
global module
module = AnsibleModule(
argument_spec=dict(
clients=dict(type='list', elements='path', default=['pip']),
@@ -133,7 +132,7 @@ def main():
module.warn('Skipping invalid pip client: %s' % (pip))
continue
try:
pip_mgr = PIP(pip)
pip_mgr = PIP(pip, module)
if pip_mgr.is_available():
found += 1
packages[pip] = pip_mgr.get_packages()

View File

@@ -224,7 +224,7 @@ class Yarn(object):
rc, out, err = self.module.run_command(cmd, check_rc=check_rc, cwd=cwd)
return out, err
return(None, None)
return None, None
def list(self):
cmd = ['list', '--depth=0', '--json']

View File

@@ -62,8 +62,8 @@ options:
type: bool
default: no
notes:
- '"name" and "upgrade" are mutually exclusive.'
- When used with a `loop:` each package will be processed individually, it is much more efficient to pass the list directly to the `name` option.
- 'I(name) and I(upgrade) are mutually exclusive.'
- When used with a C(loop:) each package will be processed individually, it is much more efficient to pass the list directly to the I(name) option.
'''
EXAMPLES = '''

View File

@@ -84,6 +84,7 @@ try:
import dnf.repodict
from dnf.conf import Conf
HAS_DNF_PACKAGES = True
DNF_IMP_ERR = None
except ImportError:
DNF_IMP_ERR = traceback.format_exc()
HAS_DNF_PACKAGES = False

View File

@@ -162,7 +162,7 @@ OUTDATED_FLATPAK_VERSION_ERROR_MESSAGE = "Unknown option --columns=application"
def install_flat(module, binary, remote, names, method, no_dependencies):
"""Add new flatpaks."""
global result
global result # pylint: disable=global-variable-not-assigned
uri_names = []
id_names = []
for name in names:
@@ -189,7 +189,7 @@ def install_flat(module, binary, remote, names, method, no_dependencies):
def uninstall_flat(module, binary, names, method):
"""Remove existing flatpaks."""
global result
global result # pylint: disable=global-variable-not-assigned
installed_flat_names = [
_match_installed_flat_name(module, binary, name, method)
for name in names
@@ -224,7 +224,7 @@ def _match_installed_flat_name(module, binary, name, method):
# This is a difficult function, since if the user supplies a flatpakref url,
# we have to rely on a naming convention:
# The flatpakref file name needs to match the flatpak name
global result
global result # pylint: disable=global-variable-not-assigned
parsed_name = _parse_flatpak_name(name)
# Try running flatpak list with columns feature
command = [binary, "list", "--{0}".format(method), "--app", "--columns=application"]
@@ -248,7 +248,7 @@ def _match_installed_flat_name(module, binary, name, method):
def _match_flat_using_outdated_flatpak_format(module, binary, parsed_name, method):
global result
global result # pylint: disable=global-variable-not-assigned
command = [binary, "list", "--{0}".format(method), "--app", "--columns=application"]
output = _flatpak_command(module, False, command)
for row in output.split('\n'):
@@ -257,7 +257,7 @@ def _match_flat_using_outdated_flatpak_format(module, binary, parsed_name, metho
def _match_flat_using_flatpak_column_feature(module, binary, parsed_name, method):
global result
global result # pylint: disable=global-variable-not-assigned
command = [binary, "list", "--{0}".format(method), "--app"]
output = _flatpak_command(module, False, command)
for row in output.split('\n'):
@@ -276,7 +276,7 @@ def _parse_flatpak_name(name):
def _flatpak_version(module, binary):
global result
global result # pylint: disable=global-variable-not-assigned
command = [binary, "--version"]
output = _flatpak_command(module, False, command)
version_number = output.split()[1]
@@ -284,7 +284,7 @@ def _flatpak_version(module, binary):
def _flatpak_command(module, noop, command, ignore_failure=False):
global result
global result # pylint: disable=global-variable-not-assigned
result['command'] = ' '.join(command)
if noop:
result['rc'] = 0

View File

@@ -124,7 +124,7 @@ from ansible.module_utils.common.text.converters import to_bytes, to_native
def add_remote(module, binary, name, flatpakrepo_url, method):
"""Add a new remote."""
global result
global result # pylint: disable=global-variable-not-assigned
command = [binary, "remote-add", "--{0}".format(method), name, flatpakrepo_url]
_flatpak_command(module, module.check_mode, command)
result['changed'] = True
@@ -132,7 +132,7 @@ def add_remote(module, binary, name, flatpakrepo_url, method):
def remove_remote(module, binary, name, method):
"""Remove an existing remote."""
global result
global result # pylint: disable=global-variable-not-assigned
command = [binary, "remote-delete", "--{0}".format(method), "--force", name]
_flatpak_command(module, module.check_mode, command)
result['changed'] = True
@@ -153,7 +153,7 @@ def remote_exists(module, binary, name, method):
def _flatpak_command(module, noop, command):
global result
global result # pylint: disable=global-variable-not-assigned
result['command'] = ' '.join(command)
if noop:
result['rc'] = 0

View File

@@ -35,7 +35,7 @@ options:
elements: str
path:
description:
- "A ':' separated list of paths to search for 'brew' executable.
- "A C(:) separated list of paths to search for C(brew) executable.
Since a package (I(formula) in homebrew parlance) location is prefixed relative to the actual path of I(brew) command,
providing an alternative I(brew) path enables managing different set of packages in an alternative location in the system."
default: '/usr/local/bin:/opt/homebrew/bin'
@@ -72,8 +72,8 @@ options:
elements: str
version_added: '0.2.0'
notes:
- When used with a `loop:` each package will be processed individually,
it is much more efficient to pass the list directly to the `name` option.
- When used with a C(loop:) each package will be processed individually,
it is much more efficient to pass the list directly to the I(name) option.
'''
EXAMPLES = '''

View File

@@ -70,8 +70,8 @@ options:
type: bool
default: no
notes:
- When used with a `loop:` each package will be processed individually,
it is much more efficient to pass the list directly to the `name` option.
- When used with a C(loop:) each package will be processed individually,
it is much more efficient to pass the list directly to the I(name) option.
'''
EXAMPLES = '''

View File

@@ -636,8 +636,9 @@ class Pacman(object):
stderr=stderr,
rc=rc,
)
# With Pacman v6.0.1 - libalpm v13.0.1, --upgrade outputs "loading packages..." on stdout. strip that
stdout = stdout.replace("loading packages...\n", "")
# With Pacman v6.0.1 - libalpm v13.0.1, --upgrade outputs " filename_without_extension downloading..." if the URL is unseen.
# In all cases, pacman outputs "loading packages..." on stdout. strip both
stdout = stdout.splitlines()[-1]
is_URL = True
pkg_name = stdout.strip()
pkg_list.append(Package(name=pkg_name, source=pkg, source_is_URL=is_URL))

View File

@@ -102,8 +102,8 @@ options:
author: "bleader (@bleader)"
notes:
- When using pkgsite, be careful that already in cache packages won't be downloaded again.
- When used with a `loop:` each package will be processed individually,
it is much more efficient to pass the list directly to the `name` option.
- When used with a C(loop:) each package will be processed individually,
it is much more efficient to pass the list directly to the I(name) option.
'''
EXAMPLES = '''

View File

@@ -119,7 +119,7 @@ options:
repoview:
description:
- Whether to generate repoview files for a published repository. Setting
this to "yes" automatically activates `generate_sqlite`.
this to "yes" automatically activates C(generate_sqlite).
required: false
type: bool
default: no

View File

@@ -160,7 +160,7 @@ def upgrade(module, xbps_path):
rc, stdout, stderr = module.run_command(cmdneedupgrade, check_rc=False)
if rc == 0:
if(len(stdout.splitlines()) == 0):
if len(stdout.splitlines()) == 0:
module.exit_json(changed=False, msg='Nothing to upgrade')
elif module.check_mode:
module.exit_json(changed=True, msg='Would have performed upgrade')

View File

@@ -1,6 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Florian Paul Hoberg <florian.hoberg@credativ.de>
# Copyright: (c) 2018, Florian Paul Azim Hoberg <florian.hoberg@credativ.de>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
@@ -35,7 +35,7 @@ requirements:
- yum
- yum-versionlock
author:
- Florian Paul Hoberg (@florianpaulhoberg)
- Florian Paul Azim Hoberg (@gyptazy)
- Amin Vakil (@aminvakil)
'''

View File

@@ -136,8 +136,8 @@ options:
- Adds C(--clean-deps) option to I(zypper) remove command.
version_added: '4.6.0'
notes:
- When used with a `loop:` each package will be processed individually,
it is much more efficient to pass the list directly to the `name` option.
- When used with a C(loop:) each package will be processed individually,
it is much more efficient to pass the list directly to the I(name) option.
# informational: requirements for nodes
requirements:
- "zypper >= 1.0 # included in openSUSE >= 11.1 or SUSE Linux Enterprise Server/Desktop >= 11.0"

View File

@@ -27,7 +27,7 @@ options:
required: false
executable:
description:
- Path to the hponcfg executable (`hponcfg` which uses $PATH).
- Path to the hponcfg executable (C(hponcfg) which uses $PATH).
default: hponcfg
verbose:
description:

View File

@@ -1,7 +1,7 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# GNU General Public License v3.0+ (see LICENSE 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)
from __future__ import absolute_import, division, print_function
__metaclass__ = type

View File

@@ -238,7 +238,7 @@ class ManageIQAlertProfiles(object):
except Exception as e:
msg = "Updating profile '{name}' failed: {error}"
msg = msg.format(name=old_profile['name'], error=e)
self.module.fail_json(msg=msg, result=result)
self.module.fail_json(msg=msg)
if changed:
msg = "Profile {name} updated successfully".format(name=desired_profile['name'])

View File

@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2018 Dell EMC Inc.
# GNU General Public License v3.0+ (see LICENSE 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)
from __future__ import absolute_import, division, print_function
__metaclass__ = type

View File

@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2019 Dell EMC Inc.
# GNU General Public License v3.0+ (see LICENSE 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)
from __future__ import absolute_import, division, print_function
__metaclass__ = type

View File

@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2019 Dell EMC Inc.
# GNU General Public License v3.0+ (see LICENSE 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)
from __future__ import absolute_import, division, print_function
__metaclass__ = type

View File

@@ -1,7 +1,7 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2021-2022 Hewlett Packard Enterprise, Inc. All rights reserved.
# GNU General Public License v3.0+ (see LICENSE 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)
from __future__ import absolute_import, division, print_function
__metaclass__ = type

View File

@@ -1,7 +1,7 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2021-2022 Hewlett Packard Enterprise, Inc. All rights reserved.
# GNU General Public License v3.0+ (see LICENSE 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)
from __future__ import absolute_import, division, print_function
__metaclass__ = type

View File

@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017-2018 Dell EMC Inc.
# GNU General Public License v3.0+ (see LICENSE 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)
from __future__ import absolute_import, division, print_function
__metaclass__ = type

View File

@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017-2018 Dell EMC Inc.
# GNU General Public License v3.0+ (see LICENSE 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)
from __future__ import absolute_import, division, print_function
__metaclass__ = type

View File

@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017-2018 Dell EMC Inc.
# GNU General Public License v3.0+ (see LICENSE 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)
from __future__ import absolute_import, division, print_function
__metaclass__ = type

View File

@@ -160,6 +160,7 @@ import traceback
try:
import gitlab
HAS_PY_GITLAB = True
GITLAB_IMP_ERR = None
except ImportError:
GITLAB_IMP_ERR = traceback.format_exc()
HAS_PY_GITLAB = False

View File

@@ -163,6 +163,7 @@ import traceback
try:
import gitlab
HAS_PY_GITLAB = True
GITLAB_IMP_ERR = None
except ImportError:
GITLAB_IMP_ERR = traceback.format_exc()
HAS_PY_GITLAB = False

View File

@@ -188,7 +188,7 @@ from ansible.module_utils.common.text.converters import to_native
from ansible_collections.community.general.plugins.module_utils.gitlab import auth_argument_spec, gitlab_authentication
try:
cmp
cmp # pylint: disable=used-before-assignment
except NameError:
def cmp(a, b):
return (a > b) - (a < b)

View File

@@ -36,7 +36,7 @@ options:
force:
description:
- Discards uncommitted changes. Runs C(hg update -C). Prior to
1.9, the default was `yes`.
1.9, the default was C(yes).
type: bool
default: 'no'
purge:

View File

@@ -211,6 +211,7 @@ except ImportError:
XMLTODICT_LIBRARY_IMPORT_ERROR = traceback.format_exc()
else:
HAS_XMLTODICT_LIBRARY = True
XMLTODICT_LIBRARY_IMPORT_ERROR = None
class PersistentMemory(object):

View File

@@ -17,7 +17,7 @@ description:
- See the C(zfs allow) section of C(zfs(1M)) for detailed explanations of options.
- This module attempts to adhere to the behavior of the command line tool as much as possible.
requirements:
- "A ZFS/OpenZFS implementation that supports delegation with `zfs allow`, including: Solaris >= 10, illumos (all
- "A ZFS/OpenZFS implementation that supports delegation with C(zfs allow), including: Solaris >= 10, illumos (all
versions), FreeBSD >= 8.0R, ZFS on Linux >= 0.7.0."
options:
name:

View File

@@ -105,55 +105,55 @@ EXAMPLES = r'''
- name: Create filesystem in a previously defined logical volume.
community.general.aix_filesystem:
device: testlv
community.general.filesystem: /testfs
filesystem: /testfs
state: present
- name: Creating NFS filesystem from nfshost.
community.general.aix_filesystem:
device: /home/ftp
nfs_server: nfshost
community.general.filesystem: /home/ftp
filesystem: /home/ftp
state: present
- name: Creating a new file system without a previously logical volume.
community.general.aix_filesystem:
community.general.filesystem: /newfs
filesystem: /newfs
size: 1G
state: present
vg: datavg
- name: Unmounting /testfs.
community.general.aix_filesystem:
community.general.filesystem: /testfs
filesystem: /testfs
state: unmounted
- name: Resizing /mksysb to +512M.
community.general.aix_filesystem:
community.general.filesystem: /mksysb
filesystem: /mksysb
size: +512M
state: present
- name: Resizing /mksysb to 11G.
community.general.aix_filesystem:
community.general.filesystem: /mksysb
filesystem: /mksysb
size: 11G
state: present
- name: Resizing /mksysb to -2G.
community.general.aix_filesystem:
community.general.filesystem: /mksysb
filesystem: /mksysb
size: -2G
state: present
- name: Remove NFS filesystem /home/ftp.
community.general.aix_filesystem:
community.general.filesystem: /home/ftp
filesystem: /home/ftp
rm_mount_point: yes
state: absent
- name: Remove /newfs.
community.general.aix_filesystem:
community.general.filesystem: /newfs
filesystem: /newfs
rm_mount_point: yes
state: absent
'''

View File

@@ -164,10 +164,10 @@ class BE(object):
for line in out.splitlines():
if self.is_freebsd:
check = line.split()
if(check == []):
if check == []:
continue
full_name = check[0].split('/')
if(full_name == []):
if full_name == []:
continue
check[0] = full_name[len(full_name) - 1]
if check[0] == self.name:

View File

@@ -328,7 +328,7 @@ class Homectl(object):
cmd = [self.module.get_bin_path('homectl', True)]
cmd.append('create')
cmd.append('--identity=-') # Read the user record from standard input.
return(self.module.run_command(cmd, data=record))
return self.module.run_command(cmd, data=record)
def _hash_password(self, password):
method = crypt.METHOD_SHA512

View File

@@ -129,7 +129,7 @@ state:
type: str
sample: "reloaded"
status:
description: a dictionary with the key=value pairs returned by `system-control show-json` or C(None) if the service is not loaded
description: A dictionary with the key=value pairs returned by C(system-control show-json) or C(None) if the service is not loaded
returned: success
type: complex
contains:

View File

@@ -362,7 +362,7 @@ def format_disk_size(size_bytes, unit):
This function has been adapted from https://github.com/Distrotech/parted/blo
b/279d9d869ff472c52b9ec2e180d568f0c99e30b0/libparted/unit.c
"""
global units_si, units_iec
global units_si, units_iec # pylint: disable=global-variable-not-assigned
unit = unit.lower()
@@ -458,7 +458,7 @@ def get_device_info(device, unit):
Fetches information about a disk and its partitions and it returns a
dictionary.
"""
global module, parted_exec
global module, parted_exec # pylint: disable=global-variable-not-assigned
# If parted complains about missing labels, it means there are no partitions.
# In this case only, use a custom function to fetch information and emulate
@@ -485,7 +485,7 @@ def check_parted_label(device):
to 3.1 don't return data when there is no label. For more information see:
http://upstream.rosalinux.ru/changelogs/libparted/3.1/changelog.html
"""
global parted_exec
global parted_exec # pylint: disable=global-variable-not-assigned
# Check the version
parted_major, parted_minor, dummy = parted_version()
@@ -531,7 +531,7 @@ def parted_version():
"""
Returns the major and minor version of parted installed on the system.
"""
global module, parted_exec
global module, parted_exec # pylint: disable=global-variable-not-assigned
rc, out, err = module.run_command("%s --version" % parted_exec)
if rc != 0:
@@ -550,7 +550,7 @@ def parted(script, device, align):
"""
Runs a parted script.
"""
global module, parted_exec
global module, parted_exec # pylint: disable=global-variable-not-assigned
align_option = '-a %s' % align
if align == 'undefined':
@@ -601,7 +601,7 @@ def check_size_format(size_str):
def main():
global module, units_si, units_iec, parted_exec
global module, units_si, units_iec, parted_exec # pylint: disable=global-variable-not-assigned
changed = False
output_script = ""

View File

@@ -187,6 +187,7 @@ except ImportError:
PYRFC_LIBRARY_IMPORT_ERROR = traceback.format_exc()
else:
HAS_PYRFC_LIBRARY = True
PYRFC_LIBRARY_IMPORT_ERROR = None
try:
import xmltodict
except ImportError:
@@ -194,6 +195,7 @@ except ImportError:
XMLTODICT_LIBRARY_IMPORT_ERROR = traceback.format_exc()
else:
HAS_XMLTODICT_LIBRARY = True
XMLTODICT_LIBRARY_IMPORT_ERROR = None
def call_rfc_method(connection, method_name, kwargs):

View File

@@ -261,8 +261,8 @@ class BalancerMember(object):
else:
try:
soup = BeautifulSoup(balancer_member_page[0])
except TypeError:
self.module.fail_json(msg="Cannot parse balancer_member_page HTML! " + str(soup))
except TypeError as exc:
self.module.fail_json(msg="Cannot parse balancer_member_page HTML! " + str(exc))
else:
subsoup = soup.findAll('table')[1].findAll('tr')
keys = subsoup[0].findAll('th')

View File

@@ -186,7 +186,7 @@ options:
validate_certs:
required: false
description:
- Require valid SSL certificates (set to `false` if you'd like to use self-signed certificates)
- Require valid SSL certificates (set to C(false) if you'd like to use self-signed certificates)
default: true
type: bool

View File

@@ -1,5 +1,15 @@
- import_tasks: setup.yml
- name: Set default environment
set_fact:
cargo_environment: {}
- name: Set special environment to work around cargo bugs
set_fact:
cargo_environment:
# See https://github.com/rust-lang/cargo/issues/10230#issuecomment-1201662729:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
when: has_cargo | default(false) and ansible_distribution == 'Alpine'
- block:
- import_tasks: test_general.yml
- import_tasks: test_version.yml
environment: "{{ cargo_environment }}"
when: has_cargo | default(false)

View File

@@ -6,5 +6,8 @@ set -eux
# Run connection tests with both the default and C locale.
ansible-playbook test_connection.yml -i "${INVENTORY}" "$@"
LC_ALL=C LANG=C ansible-playbook test_connection.yml -i "${INVENTORY}" "$@"
ansible-playbook test_connection.yml -i "${INVENTORY}" "$@"
if ansible --version | grep ansible | grep -E ' 2\.(9|10|11|12|13)\.'; then
LC_ALL=C LANG=C ansible-playbook test_connection.yml -i "${INVENTORY}" "$@"
fi

View File

@@ -8,15 +8,15 @@
suffix: .django_manage
register: tmp_django_root
- name: Install virtualenv
- name: Install virtualenv on CentOS 8
package:
name: virtualenv
state: present
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '8'
- name: Install virtualenv
package:
name: python-virtualenv
- name: Install virtualenv on Arch Linux
pip:
name: virtualenv
state: present
when: ansible_os_family == 'Archlinux'

View File

@@ -15,7 +15,7 @@ tested_filesystems:
ext4dev: {fssize: 10, grow: True}
ext3: {fssize: 10, grow: True}
ext2: {fssize: 10, grow: True}
xfs: {fssize: 20, grow: False} # grow requires a mounted filesystem
xfs: {fssize: 300, grow: False} # grow requires a mounted filesystem
btrfs: {fssize: 150, grow: False} # grow requires a mounted filesystem
reiserfs: {fssize: 33, grow: False} # grow not implemented
vfat: {fssize: 20, grow: True}

View File

@@ -1,3 +1,4 @@
dependencies:
- setup_pkg_mgr
- setup_remote_tmp_dir
- setup_remote_constraints

View File

@@ -10,6 +10,7 @@
pip:
name: pycdlib
# state: latest
extra_args: "-c {{ remote_constraints }}"
register: install_pycdlib
- debug: var=install_pycdlib

View File

@@ -61,7 +61,7 @@ if HAS_TLS and ssl_ctx is not None:
smtp_server2 = smtpd_tls.DebuggingServer(('127.0.0.1', port2), None, ssl_ctx=ssl_ctx, starttls=False)
else:
print('Start SMTP server on port', port1)
smtp_server1 = smtpd.DebuggingServer(('127.0.0.1', port1), None)
smtp_server1 = smtpd.DebuggingServer(('127.0.0.1', port1), None) # pylint: disable=used-before-assignment
if port2:
print('WARNING: TLS is NOT supported on this system, not listening on port %s.' % port2)

View File

@@ -1,2 +1,3 @@
dependencies:
- setup_pkg_mgr
- setup_remote_constraints

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