diff --git a/.azure-pipelines/README.md b/.azure-pipelines/README.md
index 385e70bac5..9e8ad74104 100644
--- a/.azure-pipelines/README.md
+++ b/.azure-pipelines/README.md
@@ -1,3 +1,9 @@
+
+
## Azure Pipelines Configuration
Please see the [Documentation](https://github.com/ansible/community/wiki/Testing:-Azure-Pipelines) for more information.
diff --git a/.azure-pipelines/azure-pipelines.yml b/.azure-pipelines/azure-pipelines.yml
index 7cfa691e4a..60b9e31023 100644
--- a/.azure-pipelines/azure-pipelines.yml
+++ b/.azure-pipelines/azure-pipelines.yml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
trigger:
batch: true
branches:
@@ -48,7 +53,7 @@ variables:
resources:
containers:
- container: default
- image: quay.io/ansible/azure-pipelines-test-container:1.9.0
+ image: quay.io/ansible/azure-pipelines-test-container:3.0.0
pool: Standard
@@ -177,12 +182,12 @@ stages:
test: macos/12.0
- name: RHEL 7.9
test: rhel/7.9
- - name: RHEL 8.5
- test: rhel/8.5
+ - name: RHEL 9.0
+ test: rhel/9.0
- name: FreeBSD 12.3
test: freebsd/12.3
- - name: FreeBSD 13.0
- test: freebsd/13.0
+ - name: FreeBSD 13.1
+ test: freebsd/13.1
groups:
- 1
- 2
@@ -251,16 +256,14 @@ stages:
targets:
- name: CentOS 7
test: centos7
- - name: Fedora 34
- test: fedora34
- - name: Fedora 35
- test: fedora35
+ - name: Fedora 36
+ test: fedora36
- name: openSUSE 15
test: opensuse15
- - name: Ubuntu 18.04
- test: ubuntu1804
- name: Ubuntu 20.04
test: ubuntu2004
+ - name: Ubuntu 22.04
+ test: ubuntu2204
- name: Alpine 3
test: alpine3
groups:
@@ -297,8 +300,8 @@ stages:
test: centos6
- name: Fedora 34
test: fedora34
- - name: Ubuntu 20.04
- test: ubuntu2004
+ - name: Ubuntu 18.04
+ test: ubuntu1804
groups:
- 1
- 2
diff --git a/.azure-pipelines/scripts/aggregate-coverage.sh b/.azure-pipelines/scripts/aggregate-coverage.sh
index 1ccfcf2073..ca2b19de97 100755
--- a/.azure-pipelines/scripts/aggregate-coverage.sh
+++ b/.azure-pipelines/scripts/aggregate-coverage.sh
@@ -1,4 +1,8 @@
#!/usr/bin/env bash
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
# Aggregate code coverage results for later processing.
set -o pipefail -eu
diff --git a/.azure-pipelines/scripts/combine-coverage.py b/.azure-pipelines/scripts/combine-coverage.py
index 506ade6460..3b2fd993db 100755
--- a/.azure-pipelines/scripts/combine-coverage.py
+++ b/.azure-pipelines/scripts/combine-coverage.py
@@ -1,4 +1,8 @@
#!/usr/bin/env python
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
"""
Combine coverage data from multiple jobs, keeping the data only from the most recent attempt from each job.
Coverage artifacts must be named using the format: "Coverage $(System.JobAttempt) {StableUniqueNameForEachJob}"
diff --git a/.azure-pipelines/scripts/process-results.sh b/.azure-pipelines/scripts/process-results.sh
index f3f1d1bae8..1f4b8e4f10 100755
--- a/.azure-pipelines/scripts/process-results.sh
+++ b/.azure-pipelines/scripts/process-results.sh
@@ -1,4 +1,8 @@
#!/usr/bin/env bash
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
# Check the test results and set variables for use in later steps.
set -o pipefail -eu
diff --git a/.azure-pipelines/scripts/publish-codecov.py b/.azure-pipelines/scripts/publish-codecov.py
index ab947f9810..58e32f6d37 100755
--- a/.azure-pipelines/scripts/publish-codecov.py
+++ b/.azure-pipelines/scripts/publish-codecov.py
@@ -1,4 +1,8 @@
#!/usr/bin/env python
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
"""
Upload code coverage reports to codecov.io.
Multiple coverage files from multiple languages are accepted and aggregated after upload.
diff --git a/.azure-pipelines/scripts/report-coverage.sh b/.azure-pipelines/scripts/report-coverage.sh
index c039f7dcbd..c08154b6f8 100755
--- a/.azure-pipelines/scripts/report-coverage.sh
+++ b/.azure-pipelines/scripts/report-coverage.sh
@@ -1,4 +1,8 @@
#!/usr/bin/env bash
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
# Generate code coverage reports for uploading to Azure Pipelines and codecov.io.
set -o pipefail -eu
diff --git a/.azure-pipelines/scripts/run-tests.sh b/.azure-pipelines/scripts/run-tests.sh
index a947fdf013..2cfdcf61ef 100755
--- a/.azure-pipelines/scripts/run-tests.sh
+++ b/.azure-pipelines/scripts/run-tests.sh
@@ -1,4 +1,8 @@
#!/usr/bin/env bash
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
# Configure the test environment and run the tests.
set -o pipefail -eu
diff --git a/.azure-pipelines/scripts/time-command.py b/.azure-pipelines/scripts/time-command.py
index 5e8eb8d4c8..85a7c3c171 100755
--- a/.azure-pipelines/scripts/time-command.py
+++ b/.azure-pipelines/scripts/time-command.py
@@ -1,4 +1,8 @@
#!/usr/bin/env python
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
"""Prepends a relative timestamp to each input line from stdin and writes it to stdout."""
from __future__ import (absolute_import, division, print_function)
diff --git a/.azure-pipelines/templates/coverage.yml b/.azure-pipelines/templates/coverage.yml
index 1b36ea45a4..3c8841aa26 100644
--- a/.azure-pipelines/templates/coverage.yml
+++ b/.azure-pipelines/templates/coverage.yml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
# This template adds a job for processing code coverage data.
# It will upload results to Azure Pipelines and codecov.io.
# Use it from a job stage that completes after all other jobs have completed.
diff --git a/.azure-pipelines/templates/matrix.yml b/.azure-pipelines/templates/matrix.yml
index 4e9555dd3b..4876375855 100644
--- a/.azure-pipelines/templates/matrix.yml
+++ b/.azure-pipelines/templates/matrix.yml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
# This template uses the provided targets and optional groups to generate a matrix which is then passed to the test template.
# If this matrix template does not provide the required functionality, consider using the test template directly instead.
diff --git a/.azure-pipelines/templates/test.yml b/.azure-pipelines/templates/test.yml
index 5250ed8023..700cf629d7 100644
--- a/.azure-pipelines/templates/test.yml
+++ b/.azure-pipelines/templates/test.yml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
# This template uses the provided list of jobs to create test one or more test jobs.
# It can be used directly if needed, or through the matrix template.
diff --git a/.github/BOTMETA.yml b/.github/BOTMETA.yml
index ecedff1e81..5ae2935209 100644
--- a/.github/BOTMETA.yml
+++ b/.github/BOTMETA.yml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
notifications: true
automerge: true
files:
@@ -120,6 +125,8 @@ files:
labels: xenserver
$filters/counter.py:
maintainers: keilr
+ $filters/crc32.py:
+ maintainers: jouir
$filters/dict.py:
maintainers: felixfontein
$filters/dict_kv.py:
@@ -197,6 +204,8 @@ files:
$inventories/virtualbox.py: {}
$lookups/:
labels: lookups
+ $lookups/bitwarden.py:
+ maintainers: lungj
$lookups/cartesian.py: {}
$lookups/chef_databag.py: {}
$lookups/collection_version.py:
@@ -214,7 +223,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:
@@ -251,9 +260,12 @@ files:
maintainers: RevBits
$lookups/shelvefile.py: {}
$lookups/tss.py:
- maintainers: amigus endlesstrax
+ maintainers: amigus endlesstrax delineaKrehl tylerezimmerman
$module_utils/:
labels: module_utils
+ $module_utils/gconftool2.py:
+ maintainers: russoz
+ labels: gconftool2
$module_utils/gitlab.py:
notify: jlozadad
maintainers: $team_gitlab
@@ -285,6 +297,9 @@ files:
$module_utils/oracle/oci_utils.py:
maintainers: $team_oracle
labels: cloud
+ $module_utils/pipx.py:
+ maintainers: russoz
+ labels: pipx
$module_utils/pure.py:
maintainers: $team_purestorage
labels: pure pure_storage
@@ -301,9 +316,15 @@ files:
$module_utils/utm_utils.py:
maintainers: $team_e_spirit
labels: utm_utils
+ $module_utils/wdc_redfish_utils.py:
+ maintainers: $team_wdc
+ labels: wdc_redfish_utils
$module_utils/xenserver.py:
maintainers: bvitnik
labels: xenserver
+ $module_utils/xfconf.py:
+ maintainers: russoz
+ labels: xfconf
$modules/cloud/alicloud/:
maintainers: xiaozhu36
$modules/cloud/atomic/atomic_container.py:
@@ -434,6 +455,8 @@ files:
maintainers: claco
$modules/cloud/scaleway/:
maintainers: $team_scaleway
+ $modules/cloud/scaleway/scaleway_compute_private_network.py:
+ maintainers: pastral
$modules/cloud/scaleway/scaleway_database_backup.py:
maintainers: guillaume_ro_fr
$modules/cloud/scaleway/scaleway_image_info.py:
@@ -615,7 +638,7 @@ files:
$modules/monitoring/nagios.py:
maintainers: tbielawa tgoetheyn
$modules/monitoring/newrelic_deployment.py:
- maintainers: mcodd
+ ignore: mcodd
$modules/monitoring/pagerduty.py:
maintainers: suprememoocow thaumos
labels: pagerduty
@@ -707,7 +730,7 @@ files:
$modules/notification/discord.py:
maintainers: cwollinger
$modules/notification/flowdock.py:
- maintainers: mcodd
+ ignore: mcodd
$modules/notification/grove.py:
maintainers: zimbatm
$modules/notification/hipchat.py:
@@ -915,7 +938,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
@@ -960,6 +983,10 @@ files:
$modules/remote_management/redfish/:
maintainers: $team_redfish
ignore: jose-delarosa
+ $modules/remote_management/redfish/wdc_redfish_command.py:
+ maintainers: $team_wdc
+ $modules/remote_management/redfish/wdc_redfish_info.py:
+ maintainers: $team_wdc
$modules/remote_management/stacki/stacki_host.py:
maintainers: bsanders bbyhuy
labels: stacki_host
@@ -1024,7 +1051,7 @@ files:
$modules/system/alternatives.py:
maintainers: mulby
labels: alternatives
- ignore: DavidWittman
+ ignore: DavidWittman jiuka
$modules/system/aix_lvol.py:
maintainers: adejoux
$modules/system/awall.py:
@@ -1052,6 +1079,9 @@ files:
$modules/system/gconftool2.py:
maintainers: Akasurde kevensen
labels: gconftool2
+ $modules/system/gconftool2_info.py:
+ maintainers: russoz
+ labels: gconftool2
$modules/system/homectl.py:
maintainers: jameslivulpi
$modules/system/interfaces_file.py:
@@ -1059,6 +1089,10 @@ files:
labels: interfaces_file
$modules/system/iptables_state.py:
maintainers: quidame
+ $modules/system/keyring.py:
+ maintainers: ahussey-redhat
+ $modules/system/keyring_info.py:
+ maintainers: ahussey-redhat
$modules/system/shutdown.py:
maintainers: nitzmahone samdoran aminvakil
$modules/system/java_cert.py:
@@ -1281,5 +1315,6 @@ macros:
team_rhn: FlossWare alikins barnabycourt vritant
team_scaleway: remyleone abarbare
team_solaris: bcoca fishman jasperla jpdasma mator scathatheworm troy2914 xen0l
- team_suse: commel dcermak evrardjp lrupp toabctl AnderEnder alxgu andytom sealor
+ team_suse: commel evrardjp lrupp toabctl AnderEnder alxgu andytom sealor
team_virt: joshainglis karmab tleguern Thulium-Drake Ajpantuso
+ team_wdc: mikemoerk
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
index d640b9aae4..bd5030f2c2 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -1,4 +1,8 @@
---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
name: Bug report
description: Create a report to help us improve
@@ -105,7 +109,7 @@ body:
attributes:
label: Steps to Reproduce
description: |
- Describe exactly how to reproduce the problem, using a minimal test-case. It would *really* help us understand your problem if you could also pased any playbooks, configs and commands you used.
+ Describe exactly how to reproduce the problem, using a minimal test-case. It would *really* help us understand your problem if you could also passed any playbooks, configs and commands you used.
**HINT:** You can paste https://gist.github.com links for larger files.
value: |
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
index f90bd1ad86..0cc2db058c 100644
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -1,4 +1,8 @@
---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
# Ref: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
blank_issues_enabled: false # default: true
contact_links:
diff --git a/.github/ISSUE_TEMPLATE/documentation_report.yml b/.github/ISSUE_TEMPLATE/documentation_report.yml
index cd88343d06..3a2777f207 100644
--- a/.github/ISSUE_TEMPLATE/documentation_report.yml
+++ b/.github/ISSUE_TEMPLATE/documentation_report.yml
@@ -1,4 +1,8 @@
---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
name: Documentation Report
description: Ask us about docs
# NOTE: issue body is enabled to allow screenshots
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml
index e676ff25ef..9630b67e12 100644
--- a/.github/ISSUE_TEMPLATE/feature_request.yml
+++ b/.github/ISSUE_TEMPLATE/feature_request.yml
@@ -1,4 +1,8 @@
---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
name: Feature request
description: Suggest an idea for this project
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 23c4cb3b50..2f4ff900d8 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -1,4 +1,8 @@
---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
version: 2
updates:
- package-ecosystem: "github-actions"
diff --git a/.github/patchback.yml b/.github/patchback.yml
index 33ad6e84a6..5ee7812edb 100644
--- a/.github/patchback.yml
+++ b/.github/patchback.yml
@@ -1,4 +1,8 @@
---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
backport_branch_prefix: patchback/backports/
backport_label_prefix: backport-
target_branch_prefix: stable-
diff --git a/.github/settings.yml b/.github/settings.yml
index 8a5b8d32f2..3e8a5f9ad8 100644
--- a/.github/settings.yml
+++ b/.github/settings.yml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
# DO NOT MODIFY
# Settings: https://probot.github.io/apps/settings/
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index dfaf617752..f7ab9450cc 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
name: "Code scanning - action"
on:
diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml
new file mode 100644
index 0000000000..a63b325f6c
--- /dev/null
+++ b/.github/workflows/reuse.yml
@@ -0,0 +1,32 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+name: Verify REUSE
+
+on:
+ push:
+ branches: [main]
+ pull_request:
+ branches: [main]
+ # Run CI once per day (at 07:30 UTC)
+ schedule:
+ - cron: '30 7 * * *'
+
+jobs:
+ check:
+ permissions:
+ contents: read
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Install dependencies
+ run: |
+ pip install reuse
+
+ - name: Check REUSE compliance
+ run: |
+ reuse lint
diff --git a/.gitignore b/.gitignore
index b95546f623..c39969326d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,6 @@
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
# Created by https://www.toptal.com/developers/gitignore/api/vim,git,macos,linux,pydev,emacs,dotenv,python,windows,webstorm,pycharm+all,jupyternotebooks
# Edit at https://www.toptal.com/developers/gitignore?templates=vim,git,macos,linux,pydev,emacs,dotenv,python,windows,webstorm,pycharm+all,jupyternotebooks
@@ -505,4 +508,4 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk
-# End of https://www.toptal.com/developers/gitignore/api/vim,git,macos,linux,pydev,emacs,dotenv,python,windows,webstorm,pycharm+all,jupyternotebooks
\ No newline at end of file
+# End of https://www.toptal.com/developers/gitignore/api/vim,git,macos,linux,pydev,emacs,dotenv,python,windows,webstorm,pycharm+all,jupyternotebooks
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 0342e8054a..7e3d19094b 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,4 +1,8 @@
---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
diff --git a/.reuse/dep5 b/.reuse/dep5
new file mode 100644
index 0000000000..0c3745ebf8
--- /dev/null
+++ b/.reuse/dep5
@@ -0,0 +1,5 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+
+Files: changelogs/fragments/*
+Copyright: Ansible Project
+License: GPL-3.0-or-later
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 48944c099e..05af1bc345 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -6,13 +6,264 @@ Community General Release Notes
This changelog describes changes after version 4.0.0.
-v5.0.0-a1
-=========
+v5.5.0
+======
Release Summary
---------------
-Alpha release for community.general 5.0.0.
+Feature and bugfix release.
+
+Minor Changes
+-------------
+
+- Added MIT license as ``LICENSES/MIT.txt`` for tests/unit/plugins/modules/packaging/language/test_gem.py (https://github.com/ansible-collections/community.general/pull/5065).
+- All software licenses are now in the ``LICENSES/`` directory of the collection root (https://github.com/ansible-collections/community.general/pull/5065, https://github.com/ansible-collections/community.general/pull/5079, https://github.com/ansible-collections/community.general/pull/5080, https://github.com/ansible-collections/community.general/pull/5083, https://github.com/ansible-collections/community.general/pull/5087, https://github.com/ansible-collections/community.general/pull/5095, https://github.com/ansible-collections/community.general/pull/5098, https://github.com/ansible-collections/community.general/pull/5106).
+- The collection repository conforms to the `REUSE specification `__ except for the changelog fragments (https://github.com/ansible-collections/community.general/pull/5138).
+- pipx - added state ``latest`` to the module (https://github.com/ansible-collections/community.general/pull/5105).
+- pipx - changed implementation to use ``cmd_runner`` (https://github.com/ansible-collections/community.general/pull/5085).
+- pipx - module fails faster when ``name`` is missing for states ``upgrade`` and ``reinstall`` (https://github.com/ansible-collections/community.general/pull/5100).
+- pipx module utils - created new module util ``pipx`` providing a ``cmd_runner`` specific for the ``pipx`` module (https://github.com/ansible-collections/community.general/pull/5085).
+- proxmox_kvm - allow ``agent`` argument to be a string (https://github.com/ansible-collections/community.general/pull/5107).
+- wdc_redfish_command - add ``IndicatorLedOn`` and ``IndicatorLedOff`` commands for ``Chassis`` category (https://github.com/ansible-collections/community.general/pull/5059).
+
+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).
+- dig lookup plugin - fix evaluation of falsy values for boolean parameters ``fail_on_error`` and ``retry_servfail`` (https://github.com/ansible-collections/community.general/pull/5129).
+- 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).
+- proxmox_kvm - fix wrong condition (https://github.com/ansible-collections/community.general/pull/5108).
+
+v5.4.0
+======
+
+Release Summary
+---------------
+
+Regular bugfix and feature release.
+
+Minor Changes
+-------------
+
+- ModuleHelper module utils - added property ``verbosity`` to base class (https://github.com/ansible-collections/community.general/pull/5035).
+- apk - add ``world`` parameter for supporting a custom world file (https://github.com/ansible-collections/community.general/pull/4976).
+- consul - adds ``ttl`` parameter for session (https://github.com/ansible-collections/community.general/pull/4996).
+- dig lookup plugin - add option ``fail_on_error`` to allow stopping execution on lookup failures (https://github.com/ansible-collections/community.general/pull/4973).
+- keycloak_* modules - add ``http_agent`` parameter with default value ``Ansible`` (https://github.com/ansible-collections/community.general/issues/5023).
+- lastpass - use config manager for handling plugin options (https://github.com/ansible-collections/community.general/pull/5022).
+- listen_ports_facts - add new ``include_non_listening`` option which adds ``-a`` option to ``netstat`` and ``ss``. This shows both listening and non-listening (for TCP this means established connections) sockets, and returns ``state`` and ``foreign_address`` (https://github.com/ansible-collections/community.general/issues/4762, https://github.com/ansible-collections/community.general/pull/4953).
+- maven_artifact - add a new ``unredirected_headers`` option that can be used with ansible-core 2.12 and above. The default value is to not use ``Authorization`` and ``Cookie`` headers on redirects for security reasons. With ansible-core 2.11, all headers are still passed on for redirects (https://github.com/ansible-collections/community.general/pull/4812).
+- pacman - added parameters ``reason`` and ``reason_for`` to set/change the install reason of packages (https://github.com/ansible-collections/community.general/pull/4956).
+- xfconf - add ``stdout``, ``stderr`` and ``cmd`` to the module results (https://github.com/ansible-collections/community.general/pull/5037).
+- xfconf - use ``do_raise()`` instead of defining custom exception class (https://github.com/ansible-collections/community.general/pull/4975).
+- xfconf_info - use ``do_raise()`` instead of defining custom exception class (https://github.com/ansible-collections/community.general/pull/4975).
+
+Bugfixes
+--------
+
+- keyring_info - fix the result from the keyring library never getting returned (https://github.com/ansible-collections/community.general/pull/4964).
+- pacman - fixed name resolution of URL packages (https://github.com/ansible-collections/community.general/pull/4959).
+- passwordstore lookup plugin - fix ``returnall`` for gopass (https://github.com/ansible-collections/community.general/pull/5027).
+- passwordstore lookup plugin - fix password store path detection for gopass (https://github.com/ansible-collections/community.general/pull/4955).
+- proxmox - fix error handling when getting VM by name when ``state=absent`` (https://github.com/ansible-collections/community.general/pull/4945).
+- 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).
+- xfconf - fix setting of boolean values (https://github.com/ansible-collections/community.general/issues/4999, https://github.com/ansible-collections/community.general/pull/5007).
+
+New Plugins
+-----------
+
+Lookup
+~~~~~~
+
+- bitwarden - Retrieve secrets from Bitwarden
+
+New Modules
+-----------
+
+Remote Management
+~~~~~~~~~~~~~~~~~
+
+redfish
+^^^^^^^
+
+- wdc_redfish_command - Manages WDC UltraStar Data102 Out-Of-Band controllers using Redfish APIs
+- wdc_redfish_info - Manages WDC UltraStar Data102 Out-Of-Band controllers using Redfish APIs
+
+v5.3.0
+======
+
+Release Summary
+---------------
+
+Regular bugfix and feature release.
+
+Minor Changes
+-------------
+
+- machinectl become plugin - can now be used with a password from another user than root, if a polkit rule is present (https://github.com/ansible-collections/community.general/pull/4849).
+- opentelemetry callback plugin - allow configuring opentelementry callback via config file (https://github.com/ansible-collections/community.general/pull/4916).
+- redfish_info - add ``GetManagerInventory`` to report list of Manager inventory information (https://github.com/ansible-collections/community.general/issues/4899).
+
+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).
+- proxmox inventory plugin - fix crash when ``enabled=1`` is used in agent config string (https://github.com/ansible-collections/community.general/pull/4910).
+- 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).
+
+v5.2.0
+======
+
+Release Summary
+---------------
+
+Regular bugfix and feature release.
+
+Minor Changes
+-------------
+
+- cmd_runner module utils - add ``__call__`` method to invoke context (https://github.com/ansible-collections/community.general/pull/4791).
+- passwordstore lookup plugin - allow using alternative password managers by detecting wrapper scripts, allow explicit configuration of pass and gopass backends (https://github.com/ansible-collections/community.general/issues/4766).
+- sudoers - will attempt to validate the proposed sudoers rule using visudo if available, optionally skipped, or required (https://github.com/ansible-collections/community.general/pull/4794, https://github.com/ansible-collections/community.general/issues/4745).
+
+Bugfixes
+--------
+
+- Include ``PSF-license.txt`` file for ``plugins/module_utils/_mount.py``.
+- redfish_command - fix the check if a virtual media is unmounted to just check for ``instered= false`` caused by Supermicro hardware that does not clear the ``ImageName`` (https://github.com/ansible-collections/community.general/pull/4839).
+- redfish_command - the Supermicro Redfish implementation only supports the ``image_url`` parameter in the underlying API calls to ``VirtualMediaInsert`` and ``VirtualMediaEject``. Any values set (or the defaults) for ``write_protected`` or ``inserted`` will be ignored (https://github.com/ansible-collections/community.general/pull/4839).
+- sudoers - fix incorrect handling of ``state: absent`` (https://github.com/ansible-collections/community.general/issues/4852).
+
+New Modules
+-----------
+
+Cloud
+~~~~~
+
+scaleway
+^^^^^^^^
+
+- scaleway_compute_private_network - Scaleway compute - private network management
+
+System
+~~~~~~
+
+- keyring - Set or delete a passphrase using the Operating System's native keyring
+- keyring_info - Get a passphrase using the Operating System's native keyring
+
+v5.1.1
+======
+
+Release Summary
+---------------
+
+Bugfix release.
+
+Bugfixes
+--------
+
+- alternatives - do not set the priority if the priority was not set by the user (https://github.com/ansible-collections/community.general/pull/4810).
+- alternatives - only pass subcommands when they are specified as module arguments (https://github.com/ansible-collections/community.general/issues/4803, https://github.com/ansible-collections/community.general/issues/4804, https://github.com/ansible-collections/community.general/pull/4836).
+- alternatives - when ``subcommands`` is specified, ``link`` must be given for every subcommand. This was already mentioned in the documentation, but not enforced by the code (https://github.com/ansible-collections/community.general/pull/4836).
+- nmcli - fix error caused by adding undefined module arguments for list options (https://github.com/ansible-collections/community.general/issues/4373, https://github.com/ansible-collections/community.general/pull/4813).
+- proxmox inventory plugin - fixed extended status detection for qemu (https://github.com/ansible-collections/community.general/pull/4816).
+- redhat_subscription - fix unsubscribing on RHEL 9 (https://github.com/ansible-collections/community.general/issues/4741).
+- sudoers - ensure sudoers config files are created with the permissions requested by sudoers (0440) (https://github.com/ansible-collections/community.general/pull/4814).
+
+v5.1.0
+======
+
+Release Summary
+---------------
+
+Regular bugfix and feature release.
+
+Minor Changes
+-------------
+
+- ModuleHelper module utils - improved ``ModuleHelperException``, using ``to_native()`` for the exception message (https://github.com/ansible-collections/community.general/pull/4755).
+- alternatives - add ``state=absent`` to be able to remove an alternative (https://github.com/ansible-collections/community.general/pull/4654).
+- alternatives - add ``subcommands`` parameter (https://github.com/ansible-collections/community.general/pull/4654).
+- ansible_galaxy_install - minor refactoring using latest ``ModuleHelper`` updates (https://github.com/ansible-collections/community.general/pull/4752).
+- cmd_runner module util - added parameters ``check_mode_skip`` and ``check_mode_return`` to ``CmdRunner.context()``, so that the command is not executed when ``check_mode=True`` (https://github.com/ansible-collections/community.general/pull/4736).
+- nmcli - adds ``vpn`` type and parameter for supporting VPN with service type L2TP and PPTP (https://github.com/ansible-collections/community.general/pull/4746).
+- proxmox inventory plugin - added new flag ``qemu_extended_statuses`` and new groups ``prelaunch``, ``paused``. They will be populated only when ``want_facts=true``, ``qemu_extended_statuses=true`` and only for ``QEMU`` machines (https://github.com/ansible-collections/community.general/pull/4723).
+- puppet - adds ``confdir`` parameter to configure a custom confir location (https://github.com/ansible-collections/community.general/pull/4740).
+- xfconf - changed implementation to use ``cmd_runner`` (https://github.com/ansible-collections/community.general/pull/4776).
+- xfconf module utils - created new module util ``xfconf`` providing a ``cmd_runner`` specific for ``xfconf`` modules (https://github.com/ansible-collections/community.general/pull/4776).
+- xfconf_info - changed implementation to use ``cmd_runner`` (https://github.com/ansible-collections/community.general/pull/4776).
+
+Deprecated Features
+-------------------
+
+- cmd_runner module utils - deprecated ``fmt`` in favour of ``cmd_runner_fmt`` as the parameter format object (https://github.com/ansible-collections/community.general/pull/4777).
+
+New Modules
+-----------
+
+System
+~~~~~~
+
+- gconftool2_info - Retrieve GConf configurations
+
+v5.0.2
+======
+
+Release Summary
+---------------
+
+Maintenance and bugfix release for Ansible 6.0.0.
+
+Bugfixes
+--------
+
+- Include ``simplified_bsd.txt`` license file for various module utils, the ``lxca_common`` docs fragment, and the ``utm_utils`` unit tests.
+
+v5.0.1
+======
+
+Release Summary
+---------------
+
+Regular bugfix release for inclusion in Ansible 6.0.0.
+
+Minor Changes
+-------------
+
+- cpanm - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived modules (https://github.com/ansible-collections/community.general/pull/4674).
+- mksysb - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived modules (https://github.com/ansible-collections/community.general/pull/4674).
+- pipx - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived modules (https://github.com/ansible-collections/community.general/pull/4674).
+- snap - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived modules (https://github.com/ansible-collections/community.general/pull/4674).
+- xfconf - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived modules (https://github.com/ansible-collections/community.general/pull/4674).
+
+Bugfixes
+--------
+
+- consul - fixed bug introduced in PR 4590 (https://github.com/ansible-collections/community.general/issues/4680).
+- filesystem - handle ``fatresize --info`` output lines without ``:`` (https://github.com/ansible-collections/community.general/pull/4700).
+- filesystem - improve error messages when output cannot be parsed by including newlines in escaped form (https://github.com/ansible-collections/community.general/pull/4700).
+- keycloak_realm - fix default groups and roles (https://github.com/ansible-collections/community.general/issues/4241).
+- redis* modules - fix call to ``module.fail_json`` when failing because of missing Python libraries (https://github.com/ansible-collections/community.general/pull/4733).
+- xcc_redfish_command - for compatibility due to Redfish spec changes the virtualMedia resource location changed from Manager to System (https://github.com/ansible-collections/community.general/pull/4682).
+- zfs - fix wrong quoting of properties (https://github.com/ansible-collections/community.general/issues/4707, https://github.com/ansible-collections/community.general/pull/4726).
+
+v5.0.0
+======
+
+Release Summary
+---------------
+
+This is release 5.0.0 of ``community.general``, released on 2022-05-17.
Major Changes
-------------
@@ -23,6 +274,8 @@ Minor Changes
-------------
- Avoid internal ansible-core module_utils in favor of equivalent public API available since at least Ansible 2.9. This fixes some instances added since the last time this was fixed (https://github.com/ansible-collections/community.general/pull/4232).
+- ModuleHelper module utils - ``ModuleHelperBase` now delegates the attributes ``check_mode``, ``get_bin_path``, ``warn``, and ``deprecate`` to the underlying ``AnsibleModule`` instance (https://github.com/ansible-collections/community.general/pull/4600).
+- ModuleHelper module utils - ``ModuleHelperBase`` now has a convenience method ``do_raise`` (https://github.com/ansible-collections/community.general/pull/4660).
- Remove vendored copy of ``distutils.version`` in favor of vendored copy included with ansible-core 2.12+. For ansible-core 2.11, uses ``distutils.version`` for Python < 3.12. There is no support for ansible-core 2.11 with Python 3.12+ (https://github.com/ansible-collections/community.general/pull/3988).
- aix_filesystem - calling ``run_command`` with arguments as ``list`` instead of ``str`` (https://github.com/ansible-collections/community.general/pull/3833).
- aix_lvg - calling ``run_command`` with arguments as ``list`` instead of ``str`` (https://github.com/ansible-collections/community.general/pull/3834).
@@ -48,6 +301,7 @@ Minor Changes
- icinga2 inventory plugin - implemented constructed interface (https://github.com/ansible-collections/community.general/pull/4088).
- icinga2 inventory plugin - inventory object names are changable using ``inventory_attr`` in your config file to the host object name, address, or display_name fields (https://github.com/ansible-collections/community.general/issues/3875, https://github.com/ansible-collections/community.general/pull/3906).
- ip_netns - calling ``run_command`` with arguments as ``list`` instead of ``str`` (https://github.com/ansible-collections/community.general/pull/3822).
+- ipa_dnsrecord - add new argument ``record_values``, mutually exclusive to ``record_value``, which supports multiple values for one record (https://github.com/ansible-collections/community.general/pull/4578).
- ipa_dnszone - ``dynamicupdate`` is now a boolean parameter, instead of a string parameter accepting ``"true"`` and ``"false"``. Also the module is now idempotent with respect to ``dynamicupdate`` (https://github.com/ansible-collections/community.general/pull/3374).
- ipa_dnszone - add DNS zone synchronization support (https://github.com/ansible-collections/community.general/pull/3374).
- ipa_service - add ``skip_host_check`` parameter. (https://github.com/ansible-collections/community.general/pull/4417).
@@ -106,6 +360,7 @@ Minor Changes
- pacman - the module has been rewritten and is now much faster when using ``state=latest``. Operations are now done all packages at once instead of package per package and the configured output format of ``pacman`` no longer affect the module's operation. (https://github.com/ansible-collections/community.general/pull/3907, https://github.com/ansible-collections/community.general/issues/3783, https://github.com/ansible-collections/community.general/issues/4079)
- passwordstore lookup plugin - add configurable ``lock`` and ``locktimeout`` options to avoid race conditions in itself and in the ``pass`` utility it calls. By default, the plugin now locks on write operations (https://github.com/ansible-collections/community.general/pull/4194).
- pipx - added options ``editable`` and ``pip_args`` (https://github.com/ansible-collections/community.general/issues/4300).
+- pritunl_user - add ``mac_addresses`` parameter (https://github.com/ansible-collections/community.general/pull/4535).
- profitbricks - minor refactoring (https://github.com/ansible-collections/community.general/pull/4567).
- proxmox - add ``clone`` parameter (https://github.com/ansible-collections/community.general/pull/3930).
- proxmox - minor refactoring (https://github.com/ansible-collections/community.general/pull/4567).
@@ -121,6 +376,8 @@ Minor Changes
- proxmox_snap - fixed timeout value to correctly reflect time in seconds. The timeout was off by one second (https://github.com/ansible-collections/community.general/pull/4377).
- puppet - remove deprecation for ``show_diff`` parameter. Its alias ``show-diff`` is still deprecated and will be removed in community.general 7.0.0 (https://github.com/ansible-collections/community.general/pull/3980).
- python_requirements_info - returns python version broken down into its components, and some minor refactoring (https://github.com/ansible-collections/community.general/pull/3797).
+- rax_files_objects - minor refactoring improving code quality (https://github.com/ansible-collections/community.general/pull/4649).
+- redfish_* modules - the contents of ``@Message.ExtendedInfo`` will be returned as a string in the event that ``@Message.ExtendedInfo.Messages`` does not exist. This is likely more useful than the standard HTTP error (https://github.com/ansible-collections/community.general/pull/4596).
- redfish_command - add ``GetHostInterfaces`` command to enable reporting Redfish Host Interface information (https://github.com/ansible-collections/community.general/issues/3693).
- redfish_command - add ``IndicatorLedOn``, ``IndicatorLedOff``, and ``IndicatorLedBlink`` commands to the Systems category for controling system LEDs (https://github.com/ansible-collections/community.general/issues/4084).
- redfish_command - add ``SetHostInterface`` command to enable configuring the Redfish Host Interface (https://github.com/ansible-collections/community.general/issues/3632).
@@ -135,14 +392,18 @@ Minor Changes
- svc - calling ``run_command`` with arguments as ``list`` instead of ``str`` (https://github.com/ansible-collections/community.general/pull/3829).
- syslog_json - add option to skip logging of ``gather_facts`` playbook tasks; use v2 callback API (https://github.com/ansible-collections/community.general/pull/4223).
- terraform - adds ``terraform_upgrade`` parameter which allows ``terraform init`` to satisfy new provider constraints in an existing Terraform project (https://github.com/ansible-collections/community.general/issues/4333).
+- to_time_unit filter plugins - the time filters has been extended to also allow ``0`` as input (https://github.com/ansible-collections/community.general/pull/4612).
- udm_group - minor refactoring (https://github.com/ansible-collections/community.general/pull/4556).
- udm_share - minor refactoring (https://github.com/ansible-collections/community.general/pull/4556).
- vmadm - minor refactoring (https://github.com/ansible-collections/community.general/pull/4567).
+- vmadm - minor refactoring and improvement on the module (https://github.com/ansible-collections/community.general/pull/4581).
+- vmadm - minor refactoring and improvement on the module (https://github.com/ansible-collections/community.general/pull/4648).
- webfaction_app - minor refactoring (https://github.com/ansible-collections/community.general/pull/4567).
- webfaction_db - minor refactoring (https://github.com/ansible-collections/community.general/pull/4567).
- xattr - calling ``run_command`` with arguments as ``list`` instead of ``str`` (https://github.com/ansible-collections/community.general/pull/3806).
- xfconf - added missing value types ``char``, ``uchar``, ``int64`` and ``uint64`` (https://github.com/ansible-collections/community.general/pull/4534).
- xfconf - minor refactor on the base class for the module (https://github.com/ansible-collections/community.general/pull/3919).
+- zfs - minor refactoring in the code (https://github.com/ansible-collections/community.general/pull/4650).
- zypper - add support for ``--clean-deps`` option to remove packages that depend on a package being removed (https://github.com/ansible-collections/community.general/pull/4195).
Breaking Changes / Porting Guide
@@ -154,15 +415,19 @@ Breaking Changes / Porting Guide
- archive - remove Ansible 2.9 compatibility code (https://github.com/ansible-collections/community.general/pull/4548).
- git_config - remove Ansible 2.9 and early ansible-base 2.10 compatibility code (https://github.com/ansible-collections/community.general/pull/4548).
- java_keystore - remove Ansible 2.9 compatibility code (https://github.com/ansible-collections/community.general/pull/4548).
+- lists_mergeby and groupby_as_dict filter plugins - adjust filter plugin filename. This change is not visible to end-users, it only affects possible other collections importing Python paths (https://github.com/ansible-collections/community.general/pull/4625).
- lists_mergeby filter plugin - remove Ansible 2.9 compatibility code (https://github.com/ansible-collections/community.general/pull/4548).
- maven_artifact - remove Ansible 2.9 compatibility code (https://github.com/ansible-collections/community.general/pull/4548).
- memcached cache plugin - remove Ansible 2.9 compatibility code (https://github.com/ansible-collections/community.general/pull/4548).
- path_join filter plugin shim - remove Ansible 2.9 compatibility code (https://github.com/ansible-collections/community.general/pull/4548).
- redis cache plugin - remove Ansible 2.9 compatibility code (https://github.com/ansible-collections/community.general/pull/4548).
+- yarn - remove unsupported and unnecessary ``--no-emoji`` flag (https://github.com/ansible-collections/community.general/pull/4662).
Deprecated Features
-------------------
+- ansible_galaxy_install - deprecated support for ``ansible`` 2.9 and ``ansible-base`` 2.10 (https://github.com/ansible-collections/community.general/pull/4601).
+- dig lookup plugin - the ``DLV`` record type has been decommissioned in 2017 and support for it will be removed from community.general 6.0.0 (https://github.com/ansible-collections/community.general/pull/4618).
- gem - the default of the ``norc`` option has been deprecated and will change to ``true`` in community.general 6.0.0. Explicitly specify a value to avoid a deprecation warning (https://github.com/ansible-collections/community.general/pull/4517).
- mail callback plugin - not specifying ``sender`` is deprecated and will be disallowed in community.general 6.0.0 (https://github.com/ansible-collections/community.general/pull/4140).
- module_helper module utils - deprecated the attribute ``ModuleHelper.VarDict`` (https://github.com/ansible-collections/community.general/pull/3801).
@@ -200,11 +465,13 @@ Bugfixes
- alternatives - fix output parsing for alternatives groups (https://github.com/ansible-collections/community.general/pull/3976).
- cargo - fix detection of outdated packages when ``state=latest`` (https://github.com/ansible-collections/community.general/pull/4052).
- cargo - fix incorrectly reported changed status for packages with a name containing a hyphen (https://github.com/ansible-collections/community.general/issues/4044, https://github.com/ansible-collections/community.general/pull/4052).
+- consul - fixed bug where class ``ConsulService`` was overwriting the field ``checks``, preventing the addition of checks to a service (https://github.com/ansible-collections/community.general/pull/4590).
- 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).
- dconf - skip processes that disappeared while we inspected them (https://github.com/ansible-collections/community.general/issues/4151).
- dnsmadeeasy - fix failure on deleting DNS entries when API response does not contain monitor value (https://github.com/ansible-collections/community.general/issues/3620).
- dsv lookup plugin - raise an Ansible error if the wrong ``python-dsv-sdk`` version is installed (https://github.com/ansible-collections/community.general/pull/4422).
- filesize - add support for busybox dd implementation, that is used by default on Alpine linux (https://github.com/ansible-collections/community.general/pull/4288, https://github.com/ansible-collections/community.general/issues/4259).
+- gconftool2 - properly escape values when passing them to ``gconftool-2`` (https://github.com/ansible-collections/community.general/pull/4647).
- git_branch - remove deprecated and unnecessary branch ``unprotect`` method (https://github.com/ansible-collections/community.general/pull/4496).
- github_repo - ``private`` and ``description`` attributes should not be set to default values when the repo already exists (https://github.com/ansible-collections/community.general/pull/2386).
- gitlab_group - improve searching for projects inside group on deletion (https://github.com/ansible-collections/community.general/pull/4491).
@@ -212,6 +479,7 @@ Bugfixes
- gitlab_group_variable - add missing documentation about GitLab versions that support ``environment_scope`` and ``variable_type`` (https://github.com/ansible-collections/community.general/pull/4038).
- gitlab_group_variable - allow to set same variable name under different environment scopes. Due this change, the return value ``group_variable`` differs from previous version in check mode. It was counting ``updated`` values, because it was accidentally overwriting environment scopes (https://github.com/ansible-collections/community.general/pull/4038).
- gitlab_group_variable - fix idempotent change behaviour for float and integer variables (https://github.com/ansible-collections/community.general/pull/4038).
+- gitlab_hook - avoid errors during idempotency check when an attribute does not exist (https://github.com/ansible-collections/community.general/pull/4668).
- gitlab_hook - handle more than 20 hooks when finding a hook (https://github.com/ansible-collections/community.general/pull/4491).
- gitlab_project - handle more than 20 namespaces when finding a namespace (https://github.com/ansible-collections/community.general/pull/4491).
- gitlab_project_members - handle more than 20 projects and users when finding a project resp. user (https://github.com/ansible-collections/community.general/pull/4491).
@@ -248,8 +516,11 @@ Bugfixes
- 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).
- nmcli - pass ``flags``, ``ingress``, ``egress`` params to ``nmcli`` (https://github.com/ansible-collections/community.general/issues/1086).
- nrdp callback plugin - fix error ``string arguments without an encoding`` (https://github.com/ansible-collections/community.general/issues/3903).
+- onepassword - search all valid configuration locations and use the first found (https://github.com/ansible-collections/community.general/pull/4640).
- opennebula inventory plugin - complete the implementation of ``constructable`` for opennebula inventory plugin. Now ``keyed_groups``, ``compose``, ``groups`` actually work (https://github.com/ansible-collections/community.general/issues/4497).
- opentelemetry - fix generating a trace with a task containing ``no_log: true`` (https://github.com/ansible-collections/community.general/pull/4043).
+- opentelemetry callback plugin - fix task message attribute that is reported failed regardless of the task result (https://github.com/ansible-collections/community.general/pull/4624).
+- opentelemetry callback plugin - fix warning for the include_tasks (https://github.com/ansible-collections/community.general/pull/4623).
- opentelemetry_plugin - honour ``ignore_errors`` when a task has failed instead of reporting an error (https://github.com/ansible-collections/community.general/pull/3837).
- pacman - Use ``--groups`` instead of ``--group`` (https://github.com/ansible-collections/community.general/pull/4312).
- pacman - fix URL based package installation (https://github.com/ansible-collections/community.general/pull/4286, https://github.com/ansible-collections/community.general/issues/4285).
@@ -272,10 +543,12 @@ Bugfixes
- proxmox_kvm - fix error when checking whether Proxmox VM exists (https://github.com/ansible-collections/community.general/pull/4287).
- python_requirements_info - fails if version operator used without version (https://github.com/ansible-collections/community.general/pull/3785).
- python_requirements_info - store ``mismatched`` return values per package as documented in the module (https://github.com/ansible-collections/community.general/pull/4078).
+- redfish_command - the iLO4 Redfish implementation only supports the ``image_url`` parameter in the underlying API calls to ``VirtualMediaInsert`` and ``VirtualMediaEject``. Any values set (or the defaults) for ``write_protected`` or ``inserted`` will be ignored (https://github.com/ansible-collections/community.general/pull/4596).
- 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).
- 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).
+- terraform - fix list initialization to support both Python 2 and Python 3 (https://github.com/ansible-collections/community.general/issues/4531).
- vdo - fix options error (https://github.com/ansible-collections/community.general/pull/4163).
- 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).
- xbps - fix error message that is reported when installing packages fails (https://github.com/ansible-collections/community.general/pull/4438).
@@ -284,6 +557,7 @@ Bugfixes
- yarn - fix missing ``~`` expansion in yarn global install folder which resulted in incorrect task status (https://github.com/ansible-collections/community.general/issues/4045, https://github.com/ansible-collections/community.general/pull/4048).
- yum_versionlock - fix matching of existing entries with names passed to the module. Match yum and dnf lock format (https://github.com/ansible-collections/community.general/pull/4183).
- 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).
+- zypper - fix undefined variable when running in check mode (https://github.com/ansible-collections/community.general/pull/4667).
- zypper - fixed bug that caused zypper to always report [ok] and do nothing on ``state=present`` when all packages in ``name`` had a version specification (https://github.com/ansible-collections/community.general/issues/4371, https://github.com/ansible-collections/community.general/pull/4421).
Known Issues
diff --git a/CHANGELOG.rst.license b/CHANGELOG.rst.license
new file mode 100644
index 0000000000..edff8c7685
--- /dev/null
+++ b/CHANGELOG.rst.license
@@ -0,0 +1,3 @@
+GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+SPDX-License-Identifier: GPL-3.0-or-later
+SPDX-FileCopyrightText: Ansible Project
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 6ea1547f96..ae10c4afc4 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,3 +1,9 @@
+
+
# Contributing
We follow [Ansible Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html) in all our contributions and interactions within this repository.
diff --git a/LICENSES/BSD-2-Clause.txt b/LICENSES/BSD-2-Clause.txt
new file mode 100644
index 0000000000..6810e04e32
--- /dev/null
+++ b/LICENSES/BSD-2-Clause.txt
@@ -0,0 +1,8 @@
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/LICENSES/GPL-3.0-or-later.txt b/LICENSES/GPL-3.0-or-later.txt
new file mode 120000
index 0000000000..012065c853
--- /dev/null
+++ b/LICENSES/GPL-3.0-or-later.txt
@@ -0,0 +1 @@
+../COPYING
\ No newline at end of file
diff --git a/LICENSES/MIT.txt b/LICENSES/MIT.txt
new file mode 100644
index 0000000000..2071b23b0e
--- /dev/null
+++ b/LICENSES/MIT.txt
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c)
+
+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.
diff --git a/LICENSES/PSF-2.0.txt b/LICENSES/PSF-2.0.txt
new file mode 100644
index 0000000000..35acd7fb5f
--- /dev/null
+++ b/LICENSES/PSF-2.0.txt
@@ -0,0 +1,48 @@
+PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
+--------------------------------------------
+
+1. This LICENSE AGREEMENT is between the Python Software Foundation
+("PSF"), and the Individual or Organization ("Licensee") accessing and
+otherwise using this software ("Python") in source or binary form and
+its associated documentation.
+
+2. Subject to the terms and conditions of this License Agreement, PSF hereby
+grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
+analyze, test, perform and/or display publicly, prepare derivative works,
+distribute, and otherwise use Python alone or in any derivative version,
+provided, however, that PSF's License Agreement and PSF's notice of copyright,
+i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Python Software Foundation;
+All Rights Reserved" are retained in Python alone or in any derivative version
+prepared by Licensee.
+
+3. In the event Licensee prepares a derivative work that is based on
+or incorporates Python or any part thereof, and wants to make
+the derivative work available to others as provided herein, then
+Licensee hereby agrees to include in any such work a brief summary of
+the changes made to Python.
+
+4. PSF is making Python available to Licensee on an "AS IS"
+basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
+IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
+INFRINGE ANY THIRD PARTY RIGHTS.
+
+5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
+FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
+A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
+OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
+
+6. This License Agreement will automatically terminate upon a material
+breach of its terms and conditions.
+
+7. Nothing in this License Agreement shall be deemed to create any
+relationship of agency, partnership, or joint venture between PSF and
+Licensee. This License Agreement does not grant permission to use PSF
+trademarks or trade name in a trademark sense to endorse or promote
+products or services of Licensee, or any third party.
+
+8. By copying, installing or otherwise using Python, Licensee
+agrees to be bound by the terms and conditions of this License
+Agreement.
diff --git a/README.md b/README.md
index e064b5f378..14d9ac95eb 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,12 @@
+
+
# Community General Collection
-[](https://dev.azure.com/ansible/community.general/_build?definitionId=31)
+[](https://dev.azure.com/ansible/community.general/_build?definitionId=31)
[](https://codecov.io/gh/ansible-collections/community.general)
This repository contains the `community.general` Ansible Collection. The collection is a part of the Ansible package and includes many modules and plugins supported by Ansible community which are not part of more specialized community collections.
@@ -110,7 +116,7 @@ See the [Releasing guidelines](https://github.com/ansible/community-docs/blob/ma
## Release notes
-See the [changelog](https://github.com/ansible-collections/community.general/blob/main/CHANGELOG.rst).
+See the [changelog](https://github.com/ansible-collections/community.general/blob/stable-5/CHANGELOG.rst).
## Roadmap
@@ -127,6 +133,10 @@ See [this issue](https://github.com/ansible-collections/community.general/issues
## Licensing
-GNU General Public License v3.0 or later.
+This collection is primarily licensed and distributed as a whole under the GNU General Public License v3.0 or later.
-See [COPYING](https://www.gnu.org/licenses/gpl-3.0.txt) to see the full text.
+See [LICENSES/GPL-3.0-or-later.txt](https://github.com/ansible-collections/community.general/blob/main/COPYING) for the full text.
+
+Parts of the collection are licensed under the [BSD 2-Clause license](https://github.com/ansible-collections/community.general/blob/main/LICENSES/BSD-2-Clause.txt), the [MIT license](https://github.com/ansible-collections/community.general/blob/main/LICENSES/MIT.txt), and the [PSF 2.0 license](https://github.com/ansible-collections/community.general/blob/main/LICENSES/PSF-2.0.txt).
+
+All files have a machine readable `SDPX-License-Identifier:` comment denoting its respective license(s) or an equivalent entry in an accompanying `.license` file. Only changelog fragments (which will not be part of a release) are covered by a blanket statement in `.reuse/dep5`. This conforms to the [REUSE specification](https://reuse.software/spec/).
diff --git a/changelogs/.gitignore b/changelogs/.gitignore
index 6be6b5331d..3d7ad8262c 100644
--- a/changelogs/.gitignore
+++ b/changelogs/.gitignore
@@ -1 +1,5 @@
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
/.plugin-cache.yaml
diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml
index 4ae5ea7c43..a631499e37 100644
--- a/changelogs/changelog.yaml
+++ b/changelogs/changelog.yaml
@@ -1,5 +1,80 @@
ancestor: 4.0.0
releases:
+ 5.0.0:
+ changes:
+ breaking_changes:
+ - lists_mergeby and groupby_as_dict filter plugins - adjust filter plugin filename.
+ This change is not visible to end-users, it only affects possible other collections
+ importing Python paths (https://github.com/ansible-collections/community.general/pull/4625).
+ - yarn - remove unsupported and unnecessary ``--no-emoji`` flag (https://github.com/ansible-collections/community.general/pull/4662).
+ bugfixes:
+ - consul - fixed bug where class ``ConsulService`` was overwriting the field
+ ``checks``, preventing the addition of checks to a service (https://github.com/ansible-collections/community.general/pull/4590).
+ - gconftool2 - properly escape values when passing them to ``gconftool-2`` (https://github.com/ansible-collections/community.general/pull/4647).
+ - gitlab_hook - avoid errors during idempotency check when an attribute does
+ not exist (https://github.com/ansible-collections/community.general/pull/4668).
+ - onepassword - search all valid configuration locations and use the first found
+ (https://github.com/ansible-collections/community.general/pull/4640).
+ - opentelemetry callback plugin - fix task message attribute that is reported
+ failed regardless of the task result (https://github.com/ansible-collections/community.general/pull/4624).
+ - opentelemetry callback plugin - fix warning for the include_tasks (https://github.com/ansible-collections/community.general/pull/4623).
+ - redfish_command - the iLO4 Redfish implementation only supports the ``image_url``
+ parameter in the underlying API calls to ``VirtualMediaInsert`` and ``VirtualMediaEject``.
+ Any values set (or the defaults) for ``write_protected`` or ``inserted`` will
+ be ignored (https://github.com/ansible-collections/community.general/pull/4596).
+ - terraform - fix list initialization to support both Python 2 and Python 3
+ (https://github.com/ansible-collections/community.general/issues/4531).
+ - zypper - fix undefined variable when running in check mode (https://github.com/ansible-collections/community.general/pull/4667).
+ deprecated_features:
+ - ansible_galaxy_install - deprecated support for ``ansible`` 2.9 and ``ansible-base``
+ 2.10 (https://github.com/ansible-collections/community.general/pull/4601).
+ - dig lookup plugin - the ``DLV`` record type has been decommissioned in 2017
+ and support for it will be removed from community.general 6.0.0 (https://github.com/ansible-collections/community.general/pull/4618).
+ minor_changes:
+ - ModuleHelper module utils - ``ModuleHelperBase` now delegates the attributes
+ ``check_mode``, ``get_bin_path``, ``warn``, and ``deprecate`` to the underlying
+ ``AnsibleModule`` instance (https://github.com/ansible-collections/community.general/pull/4600).
+ - ModuleHelper module utils - ``ModuleHelperBase`` now has a convenience method
+ ``do_raise`` (https://github.com/ansible-collections/community.general/pull/4660).
+ - ipa_dnsrecord - add new argument ``record_values``, mutually exclusive to
+ ``record_value``, which supports multiple values for one record (https://github.com/ansible-collections/community.general/pull/4578).
+ - pritunl_user - add ``mac_addresses`` parameter (https://github.com/ansible-collections/community.general/pull/4535).
+ - rax_files_objects - minor refactoring improving code quality (https://github.com/ansible-collections/community.general/pull/4649).
+ - redfish_* modules - the contents of ``@Message.ExtendedInfo`` will be returned
+ as a string in the event that ``@Message.ExtendedInfo.Messages`` does not
+ exist. This is likely more useful than the standard HTTP error (https://github.com/ansible-collections/community.general/pull/4596).
+ - to_time_unit filter plugins - the time filters has been extended to also allow
+ ``0`` as input (https://github.com/ansible-collections/community.general/pull/4612).
+ - vmadm - minor refactoring and improvement on the module (https://github.com/ansible-collections/community.general/pull/4581).
+ - vmadm - minor refactoring and improvement on the module (https://github.com/ansible-collections/community.general/pull/4648).
+ - zfs - minor refactoring in the code (https://github.com/ansible-collections/community.general/pull/4650).
+ release_summary: This is release 5.0.0 of ``community.general``, released on
+ 2022-05-17.
+ fragments:
+ - 4065-onepassword-config.yml
+ - 4535-pritunl-add-mac_addresses-parameter.yml
+ - 4578-ipa_dnsrecord-add_multiple_record_support.yml
+ - 4581-vmadm-improvements.yaml
+ - 4590-consul-fix-service-checks.yaml
+ - 4595-fix-VirtualMediaInsert-iLO4.yml
+ - 4600-mh-delegate.yaml
+ - 4601-ansible-galaxy-install-deprecate-ansible29-and-210.yaml
+ - 4612-time_filter_zero.yml
+ - 4618-dig-dlv.yml
+ - 4621-terraform-py2-compat.yml
+ - 4623-opentelemetry_bug_fix_include_tasks.yml
+ - 4624-opentelemetry_bug_fix_hardcoded_value.yml
+ - 4625-fix-filter-filenames.yml
+ - 4647-gconftool2-command-arg.yaml
+ - 4648-vmadm-improvements-2.yaml
+ - 4649-rax-files-objects-improvements.yaml
+ - 4650-zfs-improvements.yaml
+ - 4651-zypper-checkmode-fix.yaml
+ - 4660-mh-added-do-raise.yaml
+ - 4662-yarn-emoji.yml
+ - 4668-gitlab_hook-use-None-for-non-existent-attr.yml
+ - 5.0.0.yml
+ release_date: '2022-05-17'
5.0.0-a1:
changes:
breaking_changes:
@@ -680,3 +755,324 @@ releases:
name: counter
namespace: null
release_date: '2022-04-29'
+ 5.0.1:
+ changes:
+ bugfixes:
+ - consul - fixed bug introduced in PR 4590 (https://github.com/ansible-collections/community.general/issues/4680).
+ - filesystem - handle ``fatresize --info`` output lines without ``:`` (https://github.com/ansible-collections/community.general/pull/4700).
+ - filesystem - improve error messages when output cannot be parsed by including
+ newlines in escaped form (https://github.com/ansible-collections/community.general/pull/4700).
+ - keycloak_realm - fix default groups and roles (https://github.com/ansible-collections/community.general/issues/4241).
+ - redis* modules - fix call to ``module.fail_json`` when failing because of
+ missing Python libraries (https://github.com/ansible-collections/community.general/pull/4733).
+ - xcc_redfish_command - for compatibility due to Redfish spec changes the virtualMedia
+ resource location changed from Manager to System (https://github.com/ansible-collections/community.general/pull/4682).
+ - zfs - fix wrong quoting of properties (https://github.com/ansible-collections/community.general/issues/4707,
+ https://github.com/ansible-collections/community.general/pull/4726).
+ minor_changes:
+ - cpanm - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived
+ modules (https://github.com/ansible-collections/community.general/pull/4674).
+ - mksysb - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived
+ modules (https://github.com/ansible-collections/community.general/pull/4674).
+ - pipx - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived
+ modules (https://github.com/ansible-collections/community.general/pull/4674).
+ - snap - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived
+ modules (https://github.com/ansible-collections/community.general/pull/4674).
+ - xfconf - using ``do_raise()`` to raise exceptions in ``ModuleHelper`` derived
+ modules (https://github.com/ansible-collections/community.general/pull/4674).
+ release_summary: Regular bugfix release for inclusion in Ansible 6.0.0.
+ fragments:
+ - 4674-use-mh-raise.yaml
+ - 4682-compatibility-virtualmedia-resource-location.yaml
+ - 4700-code-changes.yml
+ - 4712-consul-bugfix.yaml
+ - 4719-fix-keycloak-realm.yaml
+ - 4726-zfs.yml
+ - 4733-redis-fail.yml
+ - 5.0.1.yml
+ release_date: '2022-05-30'
+ 5.0.2:
+ changes:
+ bugfixes:
+ - Include ``simplified_bsd.txt`` license file for various module utils, the
+ ``lxca_common`` docs fragment, and the ``utm_utils`` unit tests.
+ release_summary: Maintenance and bugfix release for Ansible 6.0.0.
+ fragments:
+ - 5.0.2.yml
+ - simplified-bsd-license.yml
+ release_date: '2022-06-06'
+ 5.1.0:
+ changes:
+ deprecated_features:
+ - cmd_runner module utils - deprecated ``fmt`` in favour of ``cmd_runner_fmt``
+ as the parameter format object (https://github.com/ansible-collections/community.general/pull/4777).
+ minor_changes:
+ - ModuleHelper module utils - improved ``ModuleHelperException``, using ``to_native()``
+ for the exception message (https://github.com/ansible-collections/community.general/pull/4755).
+ - alternatives - add ``state=absent`` to be able to remove an alternative (https://github.com/ansible-collections/community.general/pull/4654).
+ - alternatives - add ``subcommands`` parameter (https://github.com/ansible-collections/community.general/pull/4654).
+ - ansible_galaxy_install - minor refactoring using latest ``ModuleHelper`` updates
+ (https://github.com/ansible-collections/community.general/pull/4752).
+ - cmd_runner module util - added parameters ``check_mode_skip`` and ``check_mode_return``
+ to ``CmdRunner.context()``, so that the command is not executed when ``check_mode=True``
+ (https://github.com/ansible-collections/community.general/pull/4736).
+ - nmcli - adds ``vpn`` type and parameter for supporting VPN with service type
+ L2TP and PPTP (https://github.com/ansible-collections/community.general/pull/4746).
+ - proxmox inventory plugin - added new flag ``qemu_extended_statuses`` and new
+ groups ``prelaunch``, ``paused``. They will be
+ populated only when ``want_facts=true``, ``qemu_extended_statuses=true`` and
+ only for ``QEMU`` machines (https://github.com/ansible-collections/community.general/pull/4723).
+ - puppet - adds ``confdir`` parameter to configure a custom confir location
+ (https://github.com/ansible-collections/community.general/pull/4740).
+ - xfconf - changed implementation to use ``cmd_runner`` (https://github.com/ansible-collections/community.general/pull/4776).
+ - xfconf module utils - created new module util ``xfconf`` providing a ``cmd_runner``
+ specific for ``xfconf`` modules (https://github.com/ansible-collections/community.general/pull/4776).
+ - xfconf_info - changed implementation to use ``cmd_runner`` (https://github.com/ansible-collections/community.general/pull/4776).
+ release_summary: Regular bugfix and feature release.
+ fragments:
+ - 4654-alternatives-add-subcommands.yml
+ - 4724-proxmox-qemu-extend.yaml
+ - 4736-cmd-runner-skip-if-check.yml
+ - 4740-puppet-feature.yaml
+ - 4746-add-vpn-support-nmcli.yaml
+ - 4752-ansible-galaxy-install-mh-updates.yml
+ - 4755-mhexception-improvement.yml
+ - 4776-xfconf-cmd-runner.yaml
+ - 4777-cmd-runner-deprecate-fmt.yaml
+ - 5.1.0.yml
+ modules:
+ - description: Retrieve GConf configurations
+ name: gconftool2_info
+ namespace: system
+ release_date: '2022-06-07'
+ 5.1.1:
+ changes:
+ bugfixes:
+ - alternatives - do not set the priority if the priority was not set by the
+ user (https://github.com/ansible-collections/community.general/pull/4810).
+ - alternatives - only pass subcommands when they are specified as module arguments
+ (https://github.com/ansible-collections/community.general/issues/4803, https://github.com/ansible-collections/community.general/issues/4804,
+ https://github.com/ansible-collections/community.general/pull/4836).
+ - alternatives - when ``subcommands`` is specified, ``link`` must be given for
+ every subcommand. This was already mentioned in the documentation, but not
+ enforced by the code (https://github.com/ansible-collections/community.general/pull/4836).
+ - nmcli - fix error caused by adding undefined module arguments for list options
+ (https://github.com/ansible-collections/community.general/issues/4373, https://github.com/ansible-collections/community.general/pull/4813).
+ - proxmox inventory plugin - fixed extended status detection for qemu (https://github.com/ansible-collections/community.general/pull/4816).
+ - redhat_subscription - fix unsubscribing on RHEL 9 (https://github.com/ansible-collections/community.general/issues/4741).
+ - sudoers - ensure sudoers config files are created with the permissions requested
+ by sudoers (0440) (https://github.com/ansible-collections/community.general/pull/4814).
+ release_summary: Bugfix release.
+ fragments:
+ - 4809-redhat_subscription-unsubscribe.yaml
+ - 4810-alternatives-bug.yml
+ - 4813-fix-nmcli-convert-list.yaml
+ - 4814-sudoers-file-permissions.yml
+ - 4816-proxmox-fix-extended-status.yaml
+ - 4836-alternatives.yml
+ - 5.1.1.yml
+ release_date: '2022-06-14'
+ 5.2.0:
+ changes:
+ bugfixes:
+ - Include ``PSF-license.txt`` file for ``plugins/module_utils/_mount.py``.
+ - redfish_command - fix the check if a virtual media is unmounted to just check
+ for ``instered= false`` caused by Supermicro hardware that does not clear
+ the ``ImageName`` (https://github.com/ansible-collections/community.general/pull/4839).
+ - redfish_command - the Supermicro Redfish implementation only supports the
+ ``image_url`` parameter in the underlying API calls to ``VirtualMediaInsert``
+ and ``VirtualMediaEject``. Any values set (or the defaults) for ``write_protected``
+ or ``inserted`` will be ignored (https://github.com/ansible-collections/community.general/pull/4839).
+ - 'sudoers - fix incorrect handling of ``state: absent`` (https://github.com/ansible-collections/community.general/issues/4852).'
+ minor_changes:
+ - cmd_runner module utils - add ``__call__`` method to invoke context (https://github.com/ansible-collections/community.general/pull/4791).
+ - passwordstore lookup plugin - allow using alternative password managers by
+ detecting wrapper scripts, allow explicit configuration of pass and gopass
+ backends (https://github.com/ansible-collections/community.general/issues/4766).
+ - sudoers - will attempt to validate the proposed sudoers rule using visudo
+ if available, optionally skipped, or required (https://github.com/ansible-collections/community.general/pull/4794,
+ https://github.com/ansible-collections/community.general/issues/4745).
+ release_summary: Regular bugfix and feature release.
+ fragments:
+ - 4780-passwordstore-wrapper-compat.yml
+ - 4791-cmd-runner-callable.yaml
+ - 4794-sudoers-validation.yml
+ - 4839-fix-VirtualMediaInsert-Supermicro.yml
+ - 4852-sudoers-state-absent.yml
+ - 5.2.0.yml
+ - psf-license.yml
+ modules:
+ - description: Set or delete a passphrase using the Operating System's native
+ keyring
+ name: keyring
+ namespace: system
+ - description: Get a passphrase using the Operating System's native keyring
+ name: keyring_info
+ namespace: system
+ - description: Scaleway compute - private network management
+ name: scaleway_compute_private_network
+ namespace: cloud.scaleway
+ release_date: '2022-06-21'
+ 5.3.0:
+ 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).
+ - proxmox inventory plugin - fix crash when ``enabled=1`` is used in agent config
+ string (https://github.com/ansible-collections/community.general/pull/4910).
+ - 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).
+ minor_changes:
+ - machinectl become plugin - can now be used with a password from another user
+ than root, if a polkit rule is present (https://github.com/ansible-collections/community.general/pull/4849).
+ - opentelemetry callback plugin - allow configuring opentelementry callback
+ via config file (https://github.com/ansible-collections/community.general/pull/4916).
+ - redfish_info - add ``GetManagerInventory`` to report list of Manager inventory
+ information (https://github.com/ansible-collections/community.general/issues/4899).
+ release_summary: Regular bugfix and feature release.
+ fragments:
+ - 4849-add-password-prompt-support-for-machinectl.yml
+ - 4886-fix-lxd-inventory-hostname.yml
+ - 4899-add-GetManagerInventory-for-redfish_info.yml
+ - 4901-fix-redfish-chassispower.yml
+ - 4903-cmdrunner-bugfix.yaml
+ - 4910-fix-for-agent-enabled.yml
+ - 4911-dsv-honor-tld-option.yml
+ - 4916-opentelemetry-ini-options.yaml
+ - 4933-fix-rax-clb-nodes.yaml
+ - 5.3.0.yml
+ release_date: '2022-07-12'
+ 5.4.0:
+ changes:
+ bugfixes:
+ - keyring_info - fix the result from the keyring library never getting returned
+ (https://github.com/ansible-collections/community.general/pull/4964).
+ - pacman - fixed name resolution of URL packages (https://github.com/ansible-collections/community.general/pull/4959).
+ - passwordstore lookup plugin - fix ``returnall`` for gopass (https://github.com/ansible-collections/community.general/pull/5027).
+ - passwordstore lookup plugin - fix password store path detection for gopass
+ (https://github.com/ansible-collections/community.general/pull/4955).
+ - proxmox - fix error handling when getting VM by name when ``state=absent``
+ (https://github.com/ansible-collections/community.general/pull/4945).
+ - 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).
+ - xfconf - fix setting of boolean values (https://github.com/ansible-collections/community.general/issues/4999,
+ https://github.com/ansible-collections/community.general/pull/5007).
+ minor_changes:
+ - ModuleHelper module utils - added property ``verbosity`` to base class (https://github.com/ansible-collections/community.general/pull/5035).
+ - apk - add ``world`` parameter for supporting a custom world file (https://github.com/ansible-collections/community.general/pull/4976).
+ - consul - adds ``ttl`` parameter for session (https://github.com/ansible-collections/community.general/pull/4996).
+ - dig lookup plugin - add option ``fail_on_error`` to allow stopping execution
+ on lookup failures (https://github.com/ansible-collections/community.general/pull/4973).
+ - keycloak_* modules - add ``http_agent`` parameter with default value ``Ansible``
+ (https://github.com/ansible-collections/community.general/issues/5023).
+ - lastpass - use config manager for handling plugin options (https://github.com/ansible-collections/community.general/pull/5022).
+ - listen_ports_facts - add new ``include_non_listening`` option which adds ``-a``
+ option to ``netstat`` and ``ss``. This shows both listening and non-listening
+ (for TCP this means established connections) sockets, and returns ``state``
+ and ``foreign_address`` (https://github.com/ansible-collections/community.general/issues/4762,
+ https://github.com/ansible-collections/community.general/pull/4953).
+ - maven_artifact - add a new ``unredirected_headers`` option that can be used
+ with ansible-core 2.12 and above. The default value is to not use ``Authorization``
+ and ``Cookie`` headers on redirects for security reasons. With ansible-core
+ 2.11, all headers are still passed on for redirects (https://github.com/ansible-collections/community.general/pull/4812).
+ - pacman - added parameters ``reason`` and ``reason_for`` to set/change the
+ install reason of packages (https://github.com/ansible-collections/community.general/pull/4956).
+ - xfconf - add ``stdout``, ``stderr`` and ``cmd`` to the module results (https://github.com/ansible-collections/community.general/pull/5037).
+ - xfconf - use ``do_raise()`` instead of defining custom exception class (https://github.com/ansible-collections/community.general/pull/4975).
+ - xfconf_info - use ``do_raise()`` instead of defining custom exception class
+ (https://github.com/ansible-collections/community.general/pull/4975).
+ release_summary: Regular bugfix and feature release.
+ fragments:
+ - 4812-expose-unredirected-headers.yml
+ - 4945-fix-get_vm-int-parse-handling.yaml
+ - 4953-listen-ports-facts-extend-output.yaml
+ - 4955-fix-path-detection-for-gopass.yaml
+ - 4956-pacman-install-reason.yaml
+ - 4959-pacman-fix-url-packages-name.yaml
+ - 4964-fix-keyring-info.yml
+ - 4973-introduce-dig-lookup-argument.yaml
+ - 4975-xfconf-use-do-raise.yaml
+ - 4976-apk-add-support-for-a-custom-world-file.yaml
+ - 4996-consul-session-ttl.yml
+ - 4999-xfconf-bool.yml
+ - 5.4.0.yml
+ - 5019-slack-support-more-groups.yml
+ - 5022-lastpass-lookup-cleanup.yml
+ - 5023-http-agent-param-keycloak.yml
+ - 5027-fix-returnall-for-gopass.yaml
+ - 5035-mh-base-verbosity.yaml
+ - 5037-xfconf-add-cmd-output.yaml
+ modules:
+ - description: Manages WDC UltraStar Data102 Out-Of-Band controllers using Redfish
+ APIs
+ name: wdc_redfish_command
+ namespace: remote_management.redfish
+ - description: Manages WDC UltraStar Data102 Out-Of-Band controllers using Redfish
+ APIs
+ name: wdc_redfish_info
+ namespace: remote_management.redfish
+ plugins:
+ lookup:
+ - description: Retrieve secrets from Bitwarden
+ name: bitwarden
+ namespace: null
+ release_date: '2022-08-02'
+ 5.5.0:
+ 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).
+ - dig lookup plugin - fix evaluation of falsy values for boolean parameters
+ ``fail_on_error`` and ``retry_servfail`` (https://github.com/ansible-collections/community.general/pull/5129).
+ - 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).
+ - proxmox_kvm - fix wrong condition (https://github.com/ansible-collections/community.general/pull/5108).
+ minor_changes:
+ - Added MIT license as ``LICENSES/MIT.txt`` for tests/unit/plugins/modules/packaging/language/test_gem.py
+ (https://github.com/ansible-collections/community.general/pull/5065).
+ - All software licenses are now in the ``LICENSES/`` directory of the collection
+ root (https://github.com/ansible-collections/community.general/pull/5065,
+ https://github.com/ansible-collections/community.general/pull/5079, https://github.com/ansible-collections/community.general/pull/5080,
+ https://github.com/ansible-collections/community.general/pull/5083, https://github.com/ansible-collections/community.general/pull/5087,
+ https://github.com/ansible-collections/community.general/pull/5095, https://github.com/ansible-collections/community.general/pull/5098,
+ https://github.com/ansible-collections/community.general/pull/5106).
+ - The collection repository conforms to the `REUSE specification `__
+ except for the changelog fragments (https://github.com/ansible-collections/community.general/pull/5138).
+ - pipx - added state ``latest`` to the module (https://github.com/ansible-collections/community.general/pull/5105).
+ - pipx - changed implementation to use ``cmd_runner`` (https://github.com/ansible-collections/community.general/pull/5085).
+ - pipx - module fails faster when ``name`` is missing for states ``upgrade``
+ and ``reinstall`` (https://github.com/ansible-collections/community.general/pull/5100).
+ - pipx module utils - created new module util ``pipx`` providing a ``cmd_runner``
+ specific for the ``pipx`` module (https://github.com/ansible-collections/community.general/pull/5085).
+ - proxmox_kvm - allow ``agent`` argument to be a string (https://github.com/ansible-collections/community.general/pull/5107).
+ - wdc_redfish_command - add ``IndicatorLedOn`` and ``IndicatorLedOff`` commands
+ for ``Chassis`` category (https://github.com/ansible-collections/community.general/pull/5059).
+ release_summary: Feature and bugfix release.
+ fragments:
+ - 5.5.0.yml
+ - 5059-wdc_redfish_command-indicator-leds.yml
+ - 5085-pipx-use-cmd-runner.yaml
+ - 5100-pipx-req-if.yaml
+ - 5105-pipx-state-latest.yaml
+ - 5107-proxmox-agent-argument.yaml
+ - 5108-proxmox-node-name-condition.yml
+ - 5111-fixes.yml
+ - 5112-fix-nsupdate-ns-entry.yaml
+ - 5129-dig-boolean-params-fix.yml
+ - licenses-2.yml
+ - licenses.yml
+ release_date: '2022-08-23'
diff --git a/changelogs/changelog.yaml.license b/changelogs/changelog.yaml.license
new file mode 100644
index 0000000000..edff8c7685
--- /dev/null
+++ b/changelogs/changelog.yaml.license
@@ -0,0 +1,3 @@
+GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+SPDX-License-Identifier: GPL-3.0-or-later
+SPDX-FileCopyrightText: Ansible Project
diff --git a/changelogs/config.yaml b/changelogs/config.yaml
index fd0b422a5b..52e101e11f 100644
--- a/changelogs/config.yaml
+++ b/changelogs/config.yaml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
changelog_filename_template: ../CHANGELOG.rst
changelog_filename_version_depth: 0
changes_file: changelog.yaml
diff --git a/changelogs/fragments/4065-onepassword-config.yml b/changelogs/fragments/4065-onepassword-config.yml
deleted file mode 100644
index 9d58a0e57f..0000000000
--- a/changelogs/fragments/4065-onepassword-config.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-bugfixes:
- - onepassword - search all valid configuration locations and use the first found (https://github.com/ansible-collections/community.general/pull/4640).
diff --git a/changelogs/fragments/4535-pritunl-add-mac_addresses-parameter.yml b/changelogs/fragments/4535-pritunl-add-mac_addresses-parameter.yml
deleted file mode 100644
index 8a0626865d..0000000000
--- a/changelogs/fragments/4535-pritunl-add-mac_addresses-parameter.yml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-minor_changes:
- - pritunl_user - add ``mac_addresses`` parameter (https://github.com/ansible-collections/community.general/pull/4535).
diff --git a/changelogs/fragments/4578-ipa_dnsrecord-add_multiple_record_support.yml b/changelogs/fragments/4578-ipa_dnsrecord-add_multiple_record_support.yml
deleted file mode 100644
index aef02c83d3..0000000000
--- a/changelogs/fragments/4578-ipa_dnsrecord-add_multiple_record_support.yml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-minor_changes:
- - ipa_dnsrecord - add new argument ``record_values``, mutually exclusive to ``record_value``, which supports multiple values for one record (https://github.com/ansible-collections/community.general/pull/4578).
diff --git a/changelogs/fragments/4581-vmadm-improvements.yaml b/changelogs/fragments/4581-vmadm-improvements.yaml
deleted file mode 100644
index e6b1778e0e..0000000000
--- a/changelogs/fragments/4581-vmadm-improvements.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-minor_changes:
- - vmadm - minor refactoring and improvement on the module (https://github.com/ansible-collections/community.general/pull/4581).
diff --git a/changelogs/fragments/4590-consul-fix-service-checks.yaml b/changelogs/fragments/4590-consul-fix-service-checks.yaml
deleted file mode 100644
index 42a5562a0e..0000000000
--- a/changelogs/fragments/4590-consul-fix-service-checks.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-bugfixes:
- - consul - fixed bug where class ``ConsulService`` was overwriting the field ``checks``, preventing the addition of checks to a service (https://github.com/ansible-collections/community.general/pull/4590).
diff --git a/changelogs/fragments/4595-fix-VirtualMediaInsert-iLO4.yml b/changelogs/fragments/4595-fix-VirtualMediaInsert-iLO4.yml
deleted file mode 100644
index ae632e08a4..0000000000
--- a/changelogs/fragments/4595-fix-VirtualMediaInsert-iLO4.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-bugfixes:
- - redfish_command - the iLO4 Redfish implementation only supports the ``image_url`` parameter in
- the underlying API calls to ``VirtualMediaInsert`` and ``VirtualMediaEject``. Any values set
- (or the defaults) for ``write_protected`` or ``inserted`` will be ignored
- (https://github.com/ansible-collections/community.general/pull/4596).
-minor_changes:
- - redfish_* modules - the contents of ``@Message.ExtendedInfo`` will be returned as a string in the event
- that ``@Message.ExtendedInfo.Messages`` does not exist. This is likely more useful than the
- standard HTTP error
- (https://github.com/ansible-collections/community.general/pull/4596).
diff --git a/changelogs/fragments/4600-mh-delegate.yaml b/changelogs/fragments/4600-mh-delegate.yaml
deleted file mode 100644
index dadaefb0d7..0000000000
--- a/changelogs/fragments/4600-mh-delegate.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-minor_changes:
- - ModuleHelper module utils - ``ModuleHelperBase` now delegates the attributes ``check_mode``, ``get_bin_path``, ``warn``, and ``deprecate`` to the underlying ``AnsibleModule`` instance (https://github.com/ansible-collections/community.general/pull/4600).
diff --git a/changelogs/fragments/4601-ansible-galaxy-install-deprecate-ansible29-and-210.yaml b/changelogs/fragments/4601-ansible-galaxy-install-deprecate-ansible29-and-210.yaml
deleted file mode 100644
index 40b67375d6..0000000000
--- a/changelogs/fragments/4601-ansible-galaxy-install-deprecate-ansible29-and-210.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-deprecated_features:
- - ansible_galaxy_install - deprecated support for ``ansible`` 2.9 and ``ansible-base`` 2.10 (https://github.com/ansible-collections/community.general/pull/4601).
diff --git a/changelogs/fragments/4612-time_filter_zero.yml b/changelogs/fragments/4612-time_filter_zero.yml
deleted file mode 100644
index 8129725055..0000000000
--- a/changelogs/fragments/4612-time_filter_zero.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-minor_changes:
- - to_time_unit filter plugins - the time filters has been extended to also allow ``0`` as input (https://github.com/ansible-collections/community.general/pull/4612).
diff --git a/changelogs/fragments/4618-dig-dlv.yml b/changelogs/fragments/4618-dig-dlv.yml
deleted file mode 100644
index bc082d4093..0000000000
--- a/changelogs/fragments/4618-dig-dlv.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-deprecated_features:
- - "dig lookup plugin - the ``DLV`` record type has been decommissioned in 2017 and support for it will be removed from community.general 6.0.0 (https://github.com/ansible-collections/community.general/pull/4618)."
diff --git a/changelogs/fragments/4621-terraform-py2-compat.yml b/changelogs/fragments/4621-terraform-py2-compat.yml
deleted file mode 100644
index 4bceafba6c..0000000000
--- a/changelogs/fragments/4621-terraform-py2-compat.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-bugfixes:
- - terraform - fix list initialization to support both Python 2 and Python 3 (https://github.com/ansible-collections/community.general/issues/4531).
diff --git a/changelogs/fragments/4623-opentelemetry_bug_fix_include_tasks.yml b/changelogs/fragments/4623-opentelemetry_bug_fix_include_tasks.yml
deleted file mode 100644
index a18ba62ef5..0000000000
--- a/changelogs/fragments/4623-opentelemetry_bug_fix_include_tasks.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-bugfixes:
- - opentelemetry callback plugin - fix warning for the include_tasks (https://github.com/ansible-collections/community.general/pull/4623).
diff --git a/changelogs/fragments/4624-opentelemetry_bug_fix_hardcoded_value.yml b/changelogs/fragments/4624-opentelemetry_bug_fix_hardcoded_value.yml
deleted file mode 100644
index 53d241eca8..0000000000
--- a/changelogs/fragments/4624-opentelemetry_bug_fix_hardcoded_value.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-bugfixes:
- - opentelemetry callback plugin - fix task message attribute that is reported failed regardless of the task result (https://github.com/ansible-collections/community.general/pull/4624).
diff --git a/changelogs/fragments/4625-fix-filter-filenames.yml b/changelogs/fragments/4625-fix-filter-filenames.yml
deleted file mode 100644
index d3c0eb5f92..0000000000
--- a/changelogs/fragments/4625-fix-filter-filenames.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-breaking_changes:
- - "lists_mergeby and groupby_as_dict filter plugins - adjust filter plugin filename. This change is not visible to end-users, it only affects possible other collections importing Python paths (https://github.com/ansible-collections/community.general/pull/4625)."
diff --git a/changelogs/fragments/4647-gconftool2-command-arg.yaml b/changelogs/fragments/4647-gconftool2-command-arg.yaml
deleted file mode 100644
index 12913a0b90..0000000000
--- a/changelogs/fragments/4647-gconftool2-command-arg.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-bugfixes:
- - gconftool2 - properly escape values when passing them to ``gconftool-2`` (https://github.com/ansible-collections/community.general/pull/4647).
diff --git a/changelogs/fragments/4648-vmadm-improvements-2.yaml b/changelogs/fragments/4648-vmadm-improvements-2.yaml
deleted file mode 100644
index 180173e779..0000000000
--- a/changelogs/fragments/4648-vmadm-improvements-2.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-minor_changes:
- - vmadm - minor refactoring and improvement on the module (https://github.com/ansible-collections/community.general/pull/4648).
diff --git a/changelogs/fragments/4649-rax-files-objects-improvements.yaml b/changelogs/fragments/4649-rax-files-objects-improvements.yaml
deleted file mode 100644
index f32f744620..0000000000
--- a/changelogs/fragments/4649-rax-files-objects-improvements.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-minor_changes:
- - rax_files_objects - minor refactoring improving code quality (https://github.com/ansible-collections/community.general/pull/4649).
diff --git a/changelogs/fragments/4650-zfs-improvements.yaml b/changelogs/fragments/4650-zfs-improvements.yaml
deleted file mode 100644
index 96df5f5bcd..0000000000
--- a/changelogs/fragments/4650-zfs-improvements.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-minor_changes:
- - zfs - minor refactoring in the code (https://github.com/ansible-collections/community.general/pull/4650).
diff --git a/changelogs/fragments/4651-zypper-checkmode-fix.yaml b/changelogs/fragments/4651-zypper-checkmode-fix.yaml
deleted file mode 100644
index 403e4eead6..0000000000
--- a/changelogs/fragments/4651-zypper-checkmode-fix.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-bugfixes:
- - zypper - fix undefined variable when running in check mode (https://github.com/ansible-collections/community.general/pull/4667).
diff --git a/changelogs/fragments/4660-mh-added-do-raise.yaml b/changelogs/fragments/4660-mh-added-do-raise.yaml
deleted file mode 100644
index 01585afb96..0000000000
--- a/changelogs/fragments/4660-mh-added-do-raise.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-minor_changes:
- - ModuleHelper module utils - ``ModuleHelperBase`` now has a convenience method ``do_raise`` (https://github.com/ansible-collections/community.general/pull/4660).
diff --git a/changelogs/fragments/4662-yarn-emoji.yml b/changelogs/fragments/4662-yarn-emoji.yml
deleted file mode 100644
index 696188dd9b..0000000000
--- a/changelogs/fragments/4662-yarn-emoji.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-breaking_changes:
- - yarn - remove unsupported and unnecessary ``--no-emoji`` flag (https://github.com/ansible-collections/community.general/pull/4662).
diff --git a/changelogs/fragments/4668-gitlab_hook-use-None-for-non-existent-attr.yml b/changelogs/fragments/4668-gitlab_hook-use-None-for-non-existent-attr.yml
deleted file mode 100644
index 45a3f9f0b9..0000000000
--- a/changelogs/fragments/4668-gitlab_hook-use-None-for-non-existent-attr.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-bugfixes:
- - gitlab_hook - avoid errors during idempotency check when an attribute does not exist (https://github.com/ansible-collections/community.general/pull/4668).
diff --git a/changelogs/fragments/5.0.0.yml b/changelogs/fragments/5.0.0.yml
deleted file mode 100644
index 781eb782c8..0000000000
--- a/changelogs/fragments/5.0.0.yml
+++ /dev/null
@@ -1 +0,0 @@
-release_summary: This is release 5.0.0 of ``community.general``, released on 2022-05-17.
diff --git a/commit-rights.md b/commit-rights.md
index 43836350c5..196565eca7 100644
--- a/commit-rights.md
+++ b/commit-rights.md
@@ -1,3 +1,9 @@
+
+
Committers Guidelines for community.general
===========================================
diff --git a/docs/docsite/extra-docs.yml b/docs/docsite/extra-docs.yml
index 83f533ec08..2171031ac1 100644
--- a/docs/docsite/extra-docs.yml
+++ b/docs/docsite/extra-docs.yml
@@ -1,4 +1,8 @@
---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
sections:
- title: Guides
toctree:
diff --git a/docs/docsite/helper/lists_mergeby/default-common.yml b/docs/docsite/helper/lists_mergeby/default-common.yml
index 69227fbe44..fd874e5c91 100644
--- a/docs/docsite/helper/lists_mergeby/default-common.yml
+++ b/docs/docsite/helper/lists_mergeby/default-common.yml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
list1:
- name: foo
extra: true
diff --git a/docs/docsite/helper/lists_mergeby/default-recursive-true.yml b/docs/docsite/helper/lists_mergeby/default-recursive-true.yml
index 7d8a7cf640..133c8f2aec 100644
--- a/docs/docsite/helper/lists_mergeby/default-recursive-true.yml
+++ b/docs/docsite/helper/lists_mergeby/default-recursive-true.yml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
list1:
- name: myname01
param01:
diff --git a/docs/docsite/helper/lists_mergeby/example-001.yml b/docs/docsite/helper/lists_mergeby/example-001.yml
index d1cbb4b3b4..0cf6a9b8a7 100644
--- a/docs/docsite/helper/lists_mergeby/example-001.yml
+++ b/docs/docsite/helper/lists_mergeby/example-001.yml
@@ -1,4 +1,8 @@
---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
- name: 1. Merge two lists by common attribute 'name'
include_vars:
dir: example-001_vars
diff --git a/docs/docsite/helper/lists_mergeby/example-001_vars/list3.yml b/docs/docsite/helper/lists_mergeby/example-001_vars/list3.yml
index 4ecfb0a6c6..0604feccbd 100644
--- a/docs/docsite/helper/lists_mergeby/example-001_vars/list3.yml
+++ b/docs/docsite/helper/lists_mergeby/example-001_vars/list3.yml
@@ -1,2 +1,7 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
list3: "{{ list1|
community.general.lists_mergeby(list2, 'name') }}"
diff --git a/docs/docsite/helper/lists_mergeby/example-002.yml b/docs/docsite/helper/lists_mergeby/example-002.yml
index d21441a8df..5e6e0315df 100644
--- a/docs/docsite/helper/lists_mergeby/example-002.yml
+++ b/docs/docsite/helper/lists_mergeby/example-002.yml
@@ -1,4 +1,8 @@
---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
- name: 2. Merge two lists by common attribute 'name'
include_vars:
dir: example-002_vars
diff --git a/docs/docsite/helper/lists_mergeby/example-002_vars/list3.yml b/docs/docsite/helper/lists_mergeby/example-002_vars/list3.yml
index 9eb6775f44..8ad7524072 100644
--- a/docs/docsite/helper/lists_mergeby/example-002_vars/list3.yml
+++ b/docs/docsite/helper/lists_mergeby/example-002_vars/list3.yml
@@ -1,2 +1,7 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
list3: "{{ [list1, list2]|
community.general.lists_mergeby('name') }}"
diff --git a/docs/docsite/helper/lists_mergeby/example-003.yml b/docs/docsite/helper/lists_mergeby/example-003.yml
index 7692278609..2f93ab8a27 100644
--- a/docs/docsite/helper/lists_mergeby/example-003.yml
+++ b/docs/docsite/helper/lists_mergeby/example-003.yml
@@ -1,4 +1,8 @@
---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
- name: 3. Merge recursive by 'name', replace lists (default)
include_vars:
dir: example-003_vars
diff --git a/docs/docsite/helper/lists_mergeby/example-003_vars/list3.yml b/docs/docsite/helper/lists_mergeby/example-003_vars/list3.yml
index 6d6bf8a478..d5374eece5 100644
--- a/docs/docsite/helper/lists_mergeby/example-003_vars/list3.yml
+++ b/docs/docsite/helper/lists_mergeby/example-003_vars/list3.yml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
list3: "{{ [list1, list2]|
community.general.lists_mergeby('name',
recursive=true) }}"
diff --git a/docs/docsite/helper/lists_mergeby/example-004.yml b/docs/docsite/helper/lists_mergeby/example-004.yml
index 8a473a7328..3ef067faf3 100644
--- a/docs/docsite/helper/lists_mergeby/example-004.yml
+++ b/docs/docsite/helper/lists_mergeby/example-004.yml
@@ -1,4 +1,8 @@
---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
- name: 4. Merge recursive by 'name', keep lists
include_vars:
dir: example-004_vars
diff --git a/docs/docsite/helper/lists_mergeby/example-004_vars/list3.yml b/docs/docsite/helper/lists_mergeby/example-004_vars/list3.yml
index a525ae4f69..a054ea1e73 100644
--- a/docs/docsite/helper/lists_mergeby/example-004_vars/list3.yml
+++ b/docs/docsite/helper/lists_mergeby/example-004_vars/list3.yml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
list3: "{{ [list1, list2]|
community.general.lists_mergeby('name',
recursive=true,
diff --git a/docs/docsite/helper/lists_mergeby/example-005.yml b/docs/docsite/helper/lists_mergeby/example-005.yml
index 8bdf92c359..57e7a779d9 100644
--- a/docs/docsite/helper/lists_mergeby/example-005.yml
+++ b/docs/docsite/helper/lists_mergeby/example-005.yml
@@ -1,4 +1,8 @@
---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
- name: 5. Merge recursive by 'name', append lists
include_vars:
dir: example-005_vars
diff --git a/docs/docsite/helper/lists_mergeby/example-005_vars/list3.yml b/docs/docsite/helper/lists_mergeby/example-005_vars/list3.yml
index 650686104b..3480bf6581 100644
--- a/docs/docsite/helper/lists_mergeby/example-005_vars/list3.yml
+++ b/docs/docsite/helper/lists_mergeby/example-005_vars/list3.yml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
list3: "{{ [list1, list2]|
community.general.lists_mergeby('name',
recursive=true,
diff --git a/docs/docsite/helper/lists_mergeby/example-006.yml b/docs/docsite/helper/lists_mergeby/example-006.yml
index 9dcb9b684d..41fc88e496 100644
--- a/docs/docsite/helper/lists_mergeby/example-006.yml
+++ b/docs/docsite/helper/lists_mergeby/example-006.yml
@@ -1,4 +1,8 @@
---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
- name: 6. Merge recursive by 'name', prepend lists
include_vars:
dir: example-006_vars
diff --git a/docs/docsite/helper/lists_mergeby/example-006_vars/list3.yml b/docs/docsite/helper/lists_mergeby/example-006_vars/list3.yml
index d880dfa9f0..97513b5593 100644
--- a/docs/docsite/helper/lists_mergeby/example-006_vars/list3.yml
+++ b/docs/docsite/helper/lists_mergeby/example-006_vars/list3.yml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
list3: "{{ [list1, list2]|
community.general.lists_mergeby('name',
recursive=true,
diff --git a/docs/docsite/helper/lists_mergeby/example-007.yml b/docs/docsite/helper/lists_mergeby/example-007.yml
index e1a6f2c7e3..3de7158447 100644
--- a/docs/docsite/helper/lists_mergeby/example-007.yml
+++ b/docs/docsite/helper/lists_mergeby/example-007.yml
@@ -1,4 +1,8 @@
---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
- name: 7. Merge recursive by 'name', append lists 'remove present'
include_vars:
dir: example-007_vars
diff --git a/docs/docsite/helper/lists_mergeby/example-007_vars/list3.yml b/docs/docsite/helper/lists_mergeby/example-007_vars/list3.yml
index af71d6dfd5..cb51653b49 100644
--- a/docs/docsite/helper/lists_mergeby/example-007_vars/list3.yml
+++ b/docs/docsite/helper/lists_mergeby/example-007_vars/list3.yml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
list3: "{{ [list1, list2]|
community.general.lists_mergeby('name',
recursive=true,
diff --git a/docs/docsite/helper/lists_mergeby/example-008.yml b/docs/docsite/helper/lists_mergeby/example-008.yml
index 18a598864a..e33828bf9a 100644
--- a/docs/docsite/helper/lists_mergeby/example-008.yml
+++ b/docs/docsite/helper/lists_mergeby/example-008.yml
@@ -1,4 +1,8 @@
---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
- name: 8. Merge recursive by 'name', prepend lists 'remove present'
include_vars:
dir: example-008_vars
diff --git a/docs/docsite/helper/lists_mergeby/example-008_vars/list3.yml b/docs/docsite/helper/lists_mergeby/example-008_vars/list3.yml
index 8a20578507..af7001fc4a 100644
--- a/docs/docsite/helper/lists_mergeby/example-008_vars/list3.yml
+++ b/docs/docsite/helper/lists_mergeby/example-008_vars/list3.yml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
list3: "{{ [list1, list2]|
community.general.lists_mergeby('name',
recursive=true,
diff --git a/docs/docsite/helper/lists_mergeby/examples.yml b/docs/docsite/helper/lists_mergeby/examples.yml
index 1e798cb8dc..83b985084e 100644
--- a/docs/docsite/helper/lists_mergeby/examples.yml
+++ b/docs/docsite/helper/lists_mergeby/examples.yml
@@ -1,4 +1,8 @@
---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
examples:
- label: 'In the example below the lists are merged by the attribute ``name``:'
file: example-001_vars/list3.yml
diff --git a/docs/docsite/helper/lists_mergeby/examples_all.rst.j2 b/docs/docsite/helper/lists_mergeby/examples_all.rst.j2
index 014ff2d112..95a0fafddc 100644
--- a/docs/docsite/helper/lists_mergeby/examples_all.rst.j2
+++ b/docs/docsite/helper/lists_mergeby/examples_all.rst.j2
@@ -1,3 +1,8 @@
+..
+ Copyright (c) Ansible Project
+ GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+ SPDX-License-Identifier: GPL-3.0-or-later
+
{% for i in examples %}
{{ i.label }}
diff --git a/docs/docsite/helper/lists_mergeby/filter_guide_abstract_informations_merging_lists_of_dictionaries.rst.j2 b/docs/docsite/helper/lists_mergeby/filter_guide_abstract_informations_merging_lists_of_dictionaries.rst.j2
index 23cb6de07c..71d0d5da6c 100644
--- a/docs/docsite/helper/lists_mergeby/filter_guide_abstract_informations_merging_lists_of_dictionaries.rst.j2
+++ b/docs/docsite/helper/lists_mergeby/filter_guide_abstract_informations_merging_lists_of_dictionaries.rst.j2
@@ -1,3 +1,8 @@
+..
+ Copyright (c) Ansible Project
+ GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+ SPDX-License-Identifier: GPL-3.0-or-later
+
Merging lists of dictionaries
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/docs/docsite/helper/lists_mergeby/list3.out.j2 b/docs/docsite/helper/lists_mergeby/list3.out.j2
index 764ce3bd1d..b51f6b8681 100644
--- a/docs/docsite/helper/lists_mergeby/list3.out.j2
+++ b/docs/docsite/helper/lists_mergeby/list3.out.j2
@@ -1,2 +1,7 @@
+{#
+Copyright (c) Ansible Project
+GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+SPDX-License-Identifier: GPL-3.0-or-later
+#}
list3:
{{ list3|to_nice_yaml(indent=0) }}
diff --git a/docs/docsite/helper/lists_mergeby/playbook.yml b/docs/docsite/helper/lists_mergeby/playbook.yml
index ae82932275..793d233485 100644
--- a/docs/docsite/helper/lists_mergeby/playbook.yml
+++ b/docs/docsite/helper/lists_mergeby/playbook.yml
@@ -1,4 +1,7 @@
---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# 1) Run all examples and create example-XXX.out
diff --git a/docs/docsite/links.yml b/docs/docsite/links.yml
index b5a1720974..bd954c4096 100644
--- a/docs/docsite/links.yml
+++ b/docs/docsite/links.yml
@@ -1,4 +1,8 @@
---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
edit_on_github:
repository: ansible-collections/community.general
branch: main
diff --git a/docs/docsite/rst/filter_guide.rst b/docs/docsite/rst/filter_guide.rst
index bab223d344..1c6468ddec 100644
--- a/docs/docsite/rst/filter_guide.rst
+++ b/docs/docsite/rst/filter_guide.rst
@@ -1,3 +1,7 @@
+..
+ Copyright (c) Ansible Project
+ GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+ SPDX-License-Identifier: GPL-3.0-or-later
.. _ansible_collections.community.general.docsite.filter_guide:
diff --git a/docs/docsite/rst/filter_guide_abstract_informations.rst b/docs/docsite/rst/filter_guide_abstract_informations.rst
index 04fb49bdb0..8f997f1637 100644
--- a/docs/docsite/rst/filter_guide_abstract_informations.rst
+++ b/docs/docsite/rst/filter_guide_abstract_informations.rst
@@ -1,3 +1,8 @@
+..
+ Copyright (c) Ansible Project
+ GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+ SPDX-License-Identifier: GPL-3.0-or-later
+
Abstract transformations
------------------------
diff --git a/docs/docsite/rst/filter_guide_abstract_informations_counting_elements_in_sequence.rst b/docs/docsite/rst/filter_guide_abstract_informations_counting_elements_in_sequence.rst
index c4282abab1..dcadd5a793 100644
--- a/docs/docsite/rst/filter_guide_abstract_informations_counting_elements_in_sequence.rst
+++ b/docs/docsite/rst/filter_guide_abstract_informations_counting_elements_in_sequence.rst
@@ -1,3 +1,8 @@
+..
+ Copyright (c) Ansible Project
+ GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+ SPDX-License-Identifier: GPL-3.0-or-later
+
Counting elements in a sequence
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/docs/docsite/rst/filter_guide_abstract_informations_dictionaries.rst b/docs/docsite/rst/filter_guide_abstract_informations_dictionaries.rst
index 944eda2ba4..840bd1542c 100644
--- a/docs/docsite/rst/filter_guide_abstract_informations_dictionaries.rst
+++ b/docs/docsite/rst/filter_guide_abstract_informations_dictionaries.rst
@@ -1,3 +1,8 @@
+..
+ Copyright (c) Ansible Project
+ GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+ SPDX-License-Identifier: GPL-3.0-or-later
+
Dictionaries
^^^^^^^^^^^^
diff --git a/docs/docsite/rst/filter_guide_abstract_informations_grouping.rst b/docs/docsite/rst/filter_guide_abstract_informations_grouping.rst
index 8a46c10ebf..2cea7f9bab 100644
--- a/docs/docsite/rst/filter_guide_abstract_informations_grouping.rst
+++ b/docs/docsite/rst/filter_guide_abstract_informations_grouping.rst
@@ -1,3 +1,8 @@
+..
+ Copyright (c) Ansible Project
+ GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+ SPDX-License-Identifier: GPL-3.0-or-later
+
Grouping
^^^^^^^^
diff --git a/docs/docsite/rst/filter_guide_abstract_informations_merging_lists_of_dictionaries.rst b/docs/docsite/rst/filter_guide_abstract_informations_merging_lists_of_dictionaries.rst
index de60869059..9b56e98d7e 100644
--- a/docs/docsite/rst/filter_guide_abstract_informations_merging_lists_of_dictionaries.rst
+++ b/docs/docsite/rst/filter_guide_abstract_informations_merging_lists_of_dictionaries.rst
@@ -1,3 +1,8 @@
+..
+ Copyright (c) Ansible Project
+ GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+ SPDX-License-Identifier: GPL-3.0-or-later
+
Merging lists of dictionaries
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/docs/docsite/rst/filter_guide_conversions.rst b/docs/docsite/rst/filter_guide_conversions.rst
index 3214736dcb..78970c17b9 100644
--- a/docs/docsite/rst/filter_guide_conversions.rst
+++ b/docs/docsite/rst/filter_guide_conversions.rst
@@ -1,3 +1,8 @@
+..
+ Copyright (c) Ansible Project
+ GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+ SPDX-License-Identifier: GPL-3.0-or-later
+
Conversions
-----------
diff --git a/docs/docsite/rst/filter_guide_creating_identifiers.rst b/docs/docsite/rst/filter_guide_creating_identifiers.rst
index 4e29f72fcb..af0a8b7bab 100644
--- a/docs/docsite/rst/filter_guide_creating_identifiers.rst
+++ b/docs/docsite/rst/filter_guide_creating_identifiers.rst
@@ -1,3 +1,8 @@
+..
+ Copyright (c) Ansible Project
+ GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+ SPDX-License-Identifier: GPL-3.0-or-later
+
Creating identifiers
--------------------
diff --git a/docs/docsite/rst/filter_guide_paths.rst b/docs/docsite/rst/filter_guide_paths.rst
index b853909b23..dac8931454 100644
--- a/docs/docsite/rst/filter_guide_paths.rst
+++ b/docs/docsite/rst/filter_guide_paths.rst
@@ -1,3 +1,8 @@
+..
+ Copyright (c) Ansible Project
+ GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+ SPDX-License-Identifier: GPL-3.0-or-later
+
Paths
-----
diff --git a/docs/docsite/rst/filter_guide_selecting_json_data.rst b/docs/docsite/rst/filter_guide_selecting_json_data.rst
index c3e52c87fa..d8de07b926 100644
--- a/docs/docsite/rst/filter_guide_selecting_json_data.rst
+++ b/docs/docsite/rst/filter_guide_selecting_json_data.rst
@@ -1,3 +1,8 @@
+..
+ Copyright (c) Ansible Project
+ GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+ SPDX-License-Identifier: GPL-3.0-or-later
+
.. _ansible_collections.community.general.docsite.json_query_filter:
Selecting JSON data: JSON queries
diff --git a/docs/docsite/rst/filter_guide_working_with_times.rst b/docs/docsite/rst/filter_guide_working_with_times.rst
index f218c9972e..dc68f2a2e3 100644
--- a/docs/docsite/rst/filter_guide_working_with_times.rst
+++ b/docs/docsite/rst/filter_guide_working_with_times.rst
@@ -1,3 +1,8 @@
+..
+ Copyright (c) Ansible Project
+ GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+ SPDX-License-Identifier: GPL-3.0-or-later
+
Working with times
------------------
diff --git a/docs/docsite/rst/filter_guide_working_with_unicode.rst b/docs/docsite/rst/filter_guide_working_with_unicode.rst
index 25e7ba123d..2e5a67f8fa 100644
--- a/docs/docsite/rst/filter_guide_working_with_unicode.rst
+++ b/docs/docsite/rst/filter_guide_working_with_unicode.rst
@@ -1,3 +1,8 @@
+..
+ Copyright (c) Ansible Project
+ GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+ SPDX-License-Identifier: GPL-3.0-or-later
+
Working with Unicode
---------------------
diff --git a/docs/docsite/rst/filter_guide_working_with_versions.rst b/docs/docsite/rst/filter_guide_working_with_versions.rst
index 91cc6aca18..2488427b73 100644
--- a/docs/docsite/rst/filter_guide_working_with_versions.rst
+++ b/docs/docsite/rst/filter_guide_working_with_versions.rst
@@ -1,3 +1,8 @@
+..
+ Copyright (c) Ansible Project
+ GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+ SPDX-License-Identifier: GPL-3.0-or-later
+
Working with versions
---------------------
diff --git a/docs/docsite/rst/test_guide.rst b/docs/docsite/rst/test_guide.rst
index 2df0ed04cd..b0b7885f9b 100644
--- a/docs/docsite/rst/test_guide.rst
+++ b/docs/docsite/rst/test_guide.rst
@@ -1,3 +1,8 @@
+..
+ Copyright (c) Ansible Project
+ GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+ SPDX-License-Identifier: GPL-3.0-or-later
+
.. _ansible_collections.community.general.docsite.test_guide:
community.general Test (Plugin) Guide
diff --git a/galaxy.yml b/galaxy.yml
index 6dc58b3f0f..e2f868d53b 100644
--- a/galaxy.yml
+++ b/galaxy.yml
@@ -1,6 +1,11 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
namespace: community
name: general
-version: 5.0.0
+version: 5.5.0
readme: README.md
authors:
- Ansible (https://github.com/ansible)
diff --git a/meta/runtime.yml b/meta/runtime.yml
index c3a439b6f3..cbb131346d 100644
--- a/meta/runtime.yml
+++ b/meta/runtime.yml
@@ -1,4 +1,8 @@
---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
requires_ansible: '>=2.11.0'
plugin_routing:
connection:
@@ -292,6 +296,8 @@ plugin_routing:
redirect: community.google.gce_tag
gconftool2:
redirect: community.general.system.gconftool2
+ gconftool2_info:
+ redirect: community.general.system.gconftool2_info
gcp_backend_service:
tombstone:
removal_version: 2.0.0
@@ -606,6 +612,10 @@ plugin_routing:
redirect: community.general.identity.keycloak.keycloak_role
keycloak_user_federation:
redirect: community.general.identity.keycloak.keycloak_user_federation
+ keyring:
+ redirect: community.general.system.keyring
+ keyring_info:
+ redirect: community.general.system.keyring_info
kibana_plugin:
redirect: community.general.database.misc.kibana_plugin
kubevirt_cdi_upload:
@@ -1355,6 +1365,8 @@ plugin_routing:
redirect: community.general.notification.say
scaleway_compute:
redirect: community.general.cloud.scaleway.scaleway_compute
+ scaleway_compute_private_network:
+ redirect: community.general.cloud.scaleway.scaleway_compute_private_network
scaleway_database_backup:
redirect: community.general.cloud.scaleway.scaleway_database_backup
scaleway_image_facts:
@@ -1597,6 +1609,10 @@ plugin_routing:
redirect: community.general.cloud.smartos.vmadm
wakeonlan:
redirect: community.general.remote_management.wakeonlan
+ wdc_redfish_command:
+ redirect: community.general.remote_management.redfish.wdc_redfish_command
+ wdc_redfish_info:
+ redirect: community.general.remote_management.redfish.wdc_redfish_info
webfaction_app:
redirect: community.general.cloud.webfaction.webfaction_app
webfaction_db:
diff --git a/plugins/action/system/iptables_state.py b/plugins/action/system/iptables_state.py
index b8ae1a5dea..f59a7298b6 100644
--- a/plugins/action/system/iptables_state.py
+++ b/plugins/action/system/iptables_state.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2020, quidame
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2020, quidame
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
__metaclass__ = type
diff --git a/plugins/action/system/shutdown.py b/plugins/action/system/shutdown.py
index 19813b0847..c2860f1d6f 100644
--- a/plugins/action/system/shutdown.py
+++ b/plugins/action/system/shutdown.py
@@ -1,8 +1,9 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2020, Amin Vakil
-# Copyright: (c) 2016-2018, Matt Davis
-# Copyright: (c) 2018, Sam Doran
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2020, Amin Vakil
+# Copyright (c) 2016-2018, Matt Davis
+# Copyright (c) 2018, Sam Doran
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/become/doas.py b/plugins/become/doas.py
index 7cf4a79c7b..d282e96851 100644
--- a/plugins/become/doas.py
+++ b/plugins/become/doas.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2018, Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2018, Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/become/dzdo.py b/plugins/become/dzdo.py
index 1aef8edb69..b3c34f377c 100644
--- a/plugins/become/dzdo.py
+++ b/plugins/become/dzdo.py
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2018, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2018, Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/become/ksu.py b/plugins/become/ksu.py
index 1ee47b0fa3..29731d95d5 100644
--- a/plugins/become/ksu.py
+++ b/plugins/become/ksu.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2018, Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2018, Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/become/machinectl.py b/plugins/become/machinectl.py
index aebb0891b0..4b533baba0 100644
--- a/plugins/become/machinectl.py
+++ b/plugins/become/machinectl.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2018, Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2018, Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
@@ -66,15 +67,46 @@ DOCUMENTATION = '''
ini:
- section: machinectl_become_plugin
key: password
+ notes:
+ - When not using this plugin with user C(root), it only works correctly with a polkit rule which will alter
+ the behaviour of machinectl. This rule must alter the prompt behaviour to ask directly for the user credentials,
+ if the user is allowed to perform the action (take a look at the examples section).
+ If such a rule is not present the plugin only work if it is used in context with the root user,
+ because then no further prompt will be shown by machinectl.
'''
+EXAMPLES = r'''
+# A polkit rule needed to use the module with a non-root user.
+# See the Notes section for details.
+60-machinectl-fast-user-auth.rules: |
+ polkit.addRule(function(action, subject) {
+ if(action.id == "org.freedesktop.machine1.host-shell" && subject.isInGroup("wheel")) {
+ return polkit.Result.AUTH_SELF_KEEP;
+ }
+ });
+'''
+
+from re import compile as re_compile
+
from ansible.plugins.become import BecomeBase
+from ansible.module_utils._text import to_bytes
+
+
+ansi_color_codes = re_compile(to_bytes(r'\x1B\[[0-9;]+m'))
class BecomeModule(BecomeBase):
name = 'community.general.machinectl'
+ prompt = 'Password: '
+ fail = ('==== AUTHENTICATION FAILED ====',)
+ success = ('==== AUTHENTICATION COMPLETE ====',)
+
+ @staticmethod
+ def remove_ansi_codes(line):
+ return ansi_color_codes.sub(b"", line)
+
def build_become_command(self, cmd, shell):
super(BecomeModule, self).build_become_command(cmd, shell)
@@ -86,3 +118,15 @@ class BecomeModule(BecomeBase):
flags = self.get_option('become_flags')
user = self.get_option('become_user')
return '%s -q shell %s %s@ %s' % (become, flags, user, cmd)
+
+ def check_success(self, b_output):
+ b_output = self.remove_ansi_codes(b_output)
+ return super().check_success(b_output)
+
+ def check_incorrect_password(self, b_output):
+ b_output = self.remove_ansi_codes(b_output)
+ return super().check_incorrect_password(b_output)
+
+ def check_missing_password(self, b_output):
+ b_output = self.remove_ansi_codes(b_output)
+ return super().check_missing_password(b_output)
diff --git a/plugins/become/pbrun.py b/plugins/become/pbrun.py
index fe28e61c2b..3645e95fec 100644
--- a/plugins/become/pbrun.py
+++ b/plugins/become/pbrun.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2018, Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2018, Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/become/pfexec.py b/plugins/become/pfexec.py
index 2b37044c93..f14c22e68f 100644
--- a/plugins/become/pfexec.py
+++ b/plugins/become/pfexec.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2018, Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2018, Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/become/pmrun.py b/plugins/become/pmrun.py
index 8cb24fa937..bb384aeedf 100644
--- a/plugins/become/pmrun.py
+++ b/plugins/become/pmrun.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2018, Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2018, Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/become/sesu.py b/plugins/become/sesu.py
index 7113b19442..751163d19e 100644
--- a/plugins/become/sesu.py
+++ b/plugins/become/sesu.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2018, Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2018, Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/become/sudosu.py b/plugins/become/sudosu.py
index 410b881b96..60bb2aa517 100644
--- a/plugins/become/sudosu.py
+++ b/plugins/become/sudosu.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2021, Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2021, Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
@@ -8,9 +9,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:
diff --git a/plugins/cache/memcached.py b/plugins/cache/memcached.py
index f2ea098d4d..77f1717e45 100644
--- a/plugins/cache/memcached.py
+++ b/plugins/cache/memcached.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2014, Brian Coca, Josh Drake, et al
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2014, Brian Coca, Josh Drake, et al
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/cache/pickle.py b/plugins/cache/pickle.py
index 1e549d4d66..10295bb5d2 100644
--- a/plugins/cache/pickle.py
+++ b/plugins/cache/pickle.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2017, Brian Coca
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2017, Brian Coca
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
diff --git a/plugins/cache/redis.py b/plugins/cache/redis.py
index 6c2edb5f61..121f9b22f4 100644
--- a/plugins/cache/redis.py
+++ b/plugins/cache/redis.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2014, Brian Coca, Josh Drake, et al
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2014, Brian Coca, Josh Drake, et al
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/cache/yaml.py b/plugins/cache/yaml.py
index e5062b16d1..08620816b6 100644
--- a/plugins/cache/yaml.py
+++ b/plugins/cache/yaml.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2017, Brian Coca
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2017, Brian Coca
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
diff --git a/plugins/callback/cgroup_memory_recap.py b/plugins/callback/cgroup_memory_recap.py
index 0334bee664..a894336c8f 100644
--- a/plugins/callback/cgroup_memory_recap.py
+++ b/plugins/callback/cgroup_memory_recap.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-# (c) 2018 Matt Martz
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2018 Matt Martz
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
diff --git a/plugins/callback/context_demo.py b/plugins/callback/context_demo.py
index c85cc60cda..9c3c9c5afc 100644
--- a/plugins/callback/context_demo.py
+++ b/plugins/callback/context_demo.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (C) 2012, Michael DeHaan,
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (C) 2012, Michael DeHaan,
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/callback/counter_enabled.py b/plugins/callback/counter_enabled.py
index 38d71df69e..e0e040c9d4 100644
--- a/plugins/callback/counter_enabled.py
+++ b/plugins/callback/counter_enabled.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-# (c) 2018, Ivan Aragones Muniesa
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2018, Ivan Aragones Muniesa
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
'''
Counter enabled Ansible callback plugin (See DOCUMENTATION for more information)
'''
diff --git a/plugins/callback/dense.py b/plugins/callback/dense.py
index af8464631c..18e4f162ff 100644
--- a/plugins/callback/dense.py
+++ b/plugins/callback/dense.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2016, Dag Wieers
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2016, Dag Wieers
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
@@ -232,13 +233,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:
diff --git a/plugins/callback/diy.py b/plugins/callback/diy.py
index b288ee4b97..ed194b5cb8 100644
--- a/plugins/callback/diy.py
+++ b/plugins/callback/diy.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2019, Trevor Highfill
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2019, Trevor Highfill
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/callback/elastic.py b/plugins/callback/elastic.py
index 095c0993ca..37526c155d 100644
--- a/plugins/callback/elastic.py
+++ b/plugins/callback/elastic.py
@@ -1,5 +1,6 @@
-# (C) 2021, Victor Martinez
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2021, Victor Martinez
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/callback/hipchat.py b/plugins/callback/hipchat.py
index c64b892d9b..dc70789dbe 100644
--- a/plugins/callback/hipchat.py
+++ b/plugins/callback/hipchat.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (C) 2014, Matt Martz
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2014, Matt Martz
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/callback/jabber.py b/plugins/callback/jabber.py
index b535fa9540..3fd0b6fb97 100644
--- a/plugins/callback/jabber.py
+++ b/plugins/callback/jabber.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2016 maxn nikolaev.makc@gmail.com
# Copyright (c) 2017 Ansible Project
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/callback/log_plays.py b/plugins/callback/log_plays.py
index 2539bd9ade..b1dc69364c 100644
--- a/plugins/callback/log_plays.py
+++ b/plugins/callback/log_plays.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (C) 2012, Michael DeHaan,
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2012, Michael DeHaan,
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
@@ -12,7 +13,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
diff --git a/plugins/callback/loganalytics.py b/plugins/callback/loganalytics.py
index 04fc646dc4..54acf846a3 100644
--- a/plugins/callback/loganalytics.py
+++ b/plugins/callback/loganalytics.py
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) Ansible project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/callback/logdna.py b/plugins/callback/logdna.py
index 138b612de8..c84054c592 100644
--- a/plugins/callback/logdna.py
+++ b/plugins/callback/logdna.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-# (c) 2018, Samir Musali
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2018, Samir Musali
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/callback/logentries.py b/plugins/callback/logentries.py
index ad71a6d448..945757edd6 100644
--- a/plugins/callback/logentries.py
+++ b/plugins/callback/logentries.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2015, Logentries.com, Jimmy Tang
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2015, Logentries.com, Jimmy Tang
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/callback/logstash.py b/plugins/callback/logstash.py
index 133010cbdb..5d3c1e50b8 100644
--- a/plugins/callback/logstash.py
+++ b/plugins/callback/logstash.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (C) 2020, Yevhen Khmelenko
-# (C) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2020, Yevhen Khmelenko
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/callback/mail.py b/plugins/callback/mail.py
index 3805bae508..d20600e710 100644
--- a/plugins/callback/mail.py
+++ b/plugins/callback/mail.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2012, Dag Wieers
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2012, Dag Wieers
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/callback/nrdp.py b/plugins/callback/nrdp.py
index 08096cab72..8295bf9759 100644
--- a/plugins/callback/nrdp.py
+++ b/plugins/callback/nrdp.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-# (c) 2018 Remi Verchere
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2018 Remi Verchere
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
diff --git a/plugins/callback/null.py b/plugins/callback/null.py
index 13ea65b438..01f5f6ca06 100644
--- a/plugins/callback/null.py
+++ b/plugins/callback/null.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
diff --git a/plugins/callback/opentelemetry.py b/plugins/callback/opentelemetry.py
index 1ea6e79622..d9faa4d729 100644
--- a/plugins/callback/opentelemetry.py
+++ b/plugins/callback/opentelemetry.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-# (C) 2021, Victor Martinez
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2021, Victor Martinez
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
@@ -24,6 +25,10 @@ DOCUMENTATION = '''
- Hide the arguments for a task.
env:
- name: ANSIBLE_OPENTELEMETRY_HIDE_TASK_ARGUMENTS
+ ini:
+ - section: callback_opentelemetry
+ key: hide_task_arguments
+ version_added: 5.3.0
enable_from_environment:
type: str
description:
@@ -34,6 +39,10 @@ DOCUMENTATION = '''
and if set to true this plugin will be enabled.
env:
- name: ANSIBLE_OPENTELEMETRY_ENABLE_FROM_ENVIRONMENT
+ ini:
+ - section: callback_opentelemetry
+ key: enable_from_environment
+ version_added: 5.3.0
version_added: 3.8.0
otel_service_name:
default: ansible
@@ -42,6 +51,10 @@ DOCUMENTATION = '''
- The service name resource attribute.
env:
- name: OTEL_SERVICE_NAME
+ ini:
+ - section: callback_opentelemetry
+ key: otel_service_name
+ version_added: 5.3.0
traceparent:
default: None
type: str
@@ -61,11 +74,14 @@ examples: |
Enable the plugin in ansible.cfg:
[defaults]
callbacks_enabled = community.general.opentelemetry
+ [callback_opentelemetry]
+ enable_from_environment = ANSIBLE_OPENTELEMETRY_ENABLED
Set the environment variable:
export OTEL_EXPORTER_OTLP_ENDPOINT=
export OTEL_EXPORTER_OTLP_HEADERS="authorization=Bearer your_otel_token"
export OTEL_SERVICE_NAME=your_service_name
+ export ANSIBLE_OPENTELEMETRY_ENABLED=true
'''
import getpass
diff --git a/plugins/callback/say.py b/plugins/callback/say.py
index 8d67e4336a..03d7060352 100644
--- a/plugins/callback/say.py
+++ b/plugins/callback/say.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2012, Michael DeHaan,
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2012, Michael DeHaan,
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
diff --git a/plugins/callback/selective.py b/plugins/callback/selective.py
index 403eb84b33..78c28ec7a5 100644
--- a/plugins/callback/selective.py
+++ b/plugins/callback/selective.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) Fastly, inc 2016
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) Fastly, inc 2016
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
@@ -14,9 +15,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:
diff --git a/plugins/callback/slack.py b/plugins/callback/slack.py
index 5cb402b109..46340ee44c 100644
--- a/plugins/callback/slack.py
+++ b/plugins/callback/slack.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (C) 2014-2015, Matt Martz
-# (C) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2014-2015, Matt Martz
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
diff --git a/plugins/callback/splunk.py b/plugins/callback/splunk.py
index cb63d3b23f..701cbfdebd 100644
--- a/plugins/callback/splunk.py
+++ b/plugins/callback/splunk.py
@@ -1,18 +1,7 @@
# -*- coding: utf-8 -*-
-# This file is part of Ansible
-#
-# Ansible is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Ansible is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Ansible. If not, see .
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/callback/sumologic.py b/plugins/callback/sumologic.py
index b1ce85af77..0b6c9b6fee 100644
--- a/plugins/callback/sumologic.py
+++ b/plugins/callback/sumologic.py
@@ -1,18 +1,7 @@
# -*- coding: utf-8 -*-
-# This file is part of Ansible
-#
-# Ansible is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Ansible is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Ansible. If not, see .
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/callback/syslog_json.py b/plugins/callback/syslog_json.py
index e6fc1ee261..7ca99a9edd 100644
--- a/plugins/callback/syslog_json.py
+++ b/plugins/callback/syslog_json.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
diff --git a/plugins/callback/unixy.py b/plugins/callback/unixy.py
index fd00fae71b..fa26be8238 100644
--- a/plugins/callback/unixy.py
+++ b/plugins/callback/unixy.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2017, Allyson Bowles <@akatch>
-# Copyright: (c) 2012-2014, Michael DeHaan
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2017, Allyson Bowles <@akatch>
+# Copyright (c) 2012-2014, Michael DeHaan
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
diff --git a/plugins/callback/yaml.py b/plugins/callback/yaml.py
index 59fb350934..81d59e2e70 100644
--- a/plugins/callback/yaml.py
+++ b/plugins/callback/yaml.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
diff --git a/plugins/connection/chroot.py b/plugins/connection/chroot.py
index 295bd4046b..cbbf9612e9 100644
--- a/plugins/connection/chroot.py
+++ b/plugins/connection/chroot.py
@@ -4,7 +4,8 @@
# (c) 2013, Maykel Moya
# (c) 2015, Toshio Kuratomi
# Copyright (c) 2017 Ansible Project
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/connection/funcd.py b/plugins/connection/funcd.py
index 94d1a3bd9c..9f37f791de 100644
--- a/plugins/connection/funcd.py
+++ b/plugins/connection/funcd.py
@@ -3,7 +3,8 @@
# Based on chroot.py (c) 2013, Maykel Moya
# Copyright (c) 2013, Michael Scherer
# Copyright (c) 2017 Ansible Project
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
@@ -63,7 +64,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:
diff --git a/plugins/connection/iocage.py b/plugins/connection/iocage.py
index 2fd74313bc..2e2a6f0937 100644
--- a/plugins/connection/iocage.py
+++ b/plugins/connection/iocage.py
@@ -4,7 +4,8 @@
# (c) 2015, Toshio Kuratomi
# (c) 2016, Stephan Lohse
# Copyright (c) 2017 Ansible Project
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/connection/jail.py b/plugins/connection/jail.py
index 3c820be175..d813780136 100644
--- a/plugins/connection/jail.py
+++ b/plugins/connection/jail.py
@@ -4,7 +4,8 @@
# Copyright (c) 2013, Michael Scherer
# Copyright (c) 2015, Toshio Kuratomi
# Copyright (c) 2017 Ansible Project
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/connection/lxc.py b/plugins/connection/lxc.py
index 2aaf1619dc..adf3eec1c1 100644
--- a/plugins/connection/lxc.py
+++ b/plugins/connection/lxc.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
# (c) 2015, Joerg Thalheim
# Copyright (c) 2017 Ansible Project
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/connection/lxd.py b/plugins/connection/lxd.py
index f3b06e6e39..affb87dfd0 100644
--- a/plugins/connection/lxd.py
+++ b/plugins/connection/lxd.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2016 Matt Clay
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2016 Matt Clay
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
@@ -18,6 +19,7 @@ DOCUMENTATION = '''
- Container identifier.
default: inventory_hostname
vars:
+ - name: inventory_hostname
- name: ansible_host
- name: ansible_lxd_host
executable:
@@ -61,7 +63,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 +76,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 +105,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 +116,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 +139,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"):
diff --git a/plugins/connection/qubes.py b/plugins/connection/qubes.py
index 1de9e10011..25594e952b 100644
--- a/plugins/connection/qubes.py
+++ b/plugins/connection/qubes.py
@@ -2,7 +2,8 @@
# Based on the buildah connection plugin
# Copyright (c) 2017 Ansible Project
# 2018 Kushal Das
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
#
#
# Written by: Kushal Das (https://github.com/kushaldas)
diff --git a/plugins/connection/saltstack.py b/plugins/connection/saltstack.py
index 95870ad2d0..1dbc7296c7 100644
--- a/plugins/connection/saltstack.py
+++ b/plugins/connection/saltstack.py
@@ -2,9 +2,10 @@
# Based on local.py (c) 2012, Michael DeHaan
# Based on chroot.py (c) 2013, Maykel Moya
# Based on func.py
-# (c) 2014, Michael Scherer
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2014, Michael Scherer
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/connection/zone.py b/plugins/connection/zone.py
index d7e127ca38..34827c7e37 100644
--- a/plugins/connection/zone.py
+++ b/plugins/connection/zone.py
@@ -5,7 +5,8 @@
# (c) 2015, Dagobert Michelsen
# (c) 2015, Toshio Kuratomi
# Copyright (c) 2017 Ansible Project
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/alicloud.py b/plugins/doc_fragments/alicloud.py
index f9c9640b61..f464e178c7 100644
--- a/plugins/doc_fragments/alicloud.py
+++ b/plugins/doc_fragments/alicloud.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017-present Alibaba Group Holding Limited. He Guimin
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/auth_basic.py b/plugins/doc_fragments/auth_basic.py
index 6f590611d9..e05311af03 100644
--- a/plugins/doc_fragments/auth_basic.py
+++ b/plugins/doc_fragments/auth_basic.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) Ansible project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/bitbucket.py b/plugins/doc_fragments/bitbucket.py
index 28489356b1..9ab6fe318d 100644
--- a/plugins/doc_fragments/bitbucket.py
+++ b/plugins/doc_fragments/bitbucket.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2019, Evgeniy Krysanov
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2019, Evgeniy Krysanov
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/dimensiondata.py b/plugins/doc_fragments/dimensiondata.py
index 02435e25cc..f754f9cc76 100644
--- a/plugins/doc_fragments/dimensiondata.py
+++ b/plugins/doc_fragments/dimensiondata.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
#
-# Copyright: (c) 2016, Dimension Data
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2016, Dimension Data
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/dimensiondata_wait.py b/plugins/doc_fragments/dimensiondata_wait.py
index ac3deab154..509f5c56fb 100644
--- a/plugins/doc_fragments/dimensiondata_wait.py
+++ b/plugins/doc_fragments/dimensiondata_wait.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
#
-# Copyright: (c) 2016, Dimension Data
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2016, Dimension Data
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/emc.py b/plugins/doc_fragments/emc.py
index cce76823fe..e9e57a2c10 100644
--- a/plugins/doc_fragments/emc.py
+++ b/plugins/doc_fragments/emc.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2018, Luca Lorenzetto (@remix_tj)
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2018, Luca Lorenzetto (@remix_tj)
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/gitlab.py b/plugins/doc_fragments/gitlab.py
index 21e4584fe1..705a93c023 100644
--- a/plugins/doc_fragments/gitlab.py
+++ b/plugins/doc_fragments/gitlab.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) Ansible project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/hpe3par.py b/plugins/doc_fragments/hpe3par.py
index ad445205d8..96e53846e1 100644
--- a/plugins/doc_fragments/hpe3par.py
+++ b/plugins/doc_fragments/hpe3par.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2018, Hewlett Packard Enterprise Development LP
-# GNU General Public License v3.0+
-# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2018, Hewlett Packard Enterprise Development LP
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/hwc.py b/plugins/doc_fragments/hwc.py
index ecba2adde8..d3cebb6dbc 100644
--- a/plugins/doc_fragments/hwc.py
+++ b/plugins/doc_fragments/hwc.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2018, Huawei Inc.
-# GNU General Public License v3.0+
-# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2018, Huawei Inc.
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/ibm_storage.py b/plugins/doc_fragments/ibm_storage.py
index 0d8eb5fe22..ec3b0a0e05 100644
--- a/plugins/doc_fragments/ibm_storage.py
+++ b/plugins/doc_fragments/ibm_storage.py
@@ -1,8 +1,9 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2018, IBM CORPORATION
+# Copyright (c) 2018, IBM CORPORATION
# Author(s): Tzur Eliyahu
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
__metaclass__ = type
diff --git a/plugins/doc_fragments/influxdb.py b/plugins/doc_fragments/influxdb.py
index a31c84cbb1..133041a628 100644
--- a/plugins/doc_fragments/influxdb.py
+++ b/plugins/doc_fragments/influxdb.py
@@ -1,8 +1,9 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2017, Ansible Project
-# Copyright: (c) 2017, Abhijeet Kasurde (akasurde@redhat.com)
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2017, Ansible Project
+# Copyright (c) 2017, Abhijeet Kasurde (akasurde@redhat.com)
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/ipa.py b/plugins/doc_fragments/ipa.py
index 47bcee60ba..d799bac184 100644
--- a/plugins/doc_fragments/ipa.py
+++ b/plugins/doc_fragments/ipa.py
@@ -1,8 +1,9 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2017-18, Ansible Project
-# Copyright: (c) 2017-18, Abhijeet Kasurde (akasurde@redhat.com)
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2017-18, Ansible Project
+# Copyright (c) 2017-18, Abhijeet Kasurde (akasurde@redhat.com)
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/keycloak.py b/plugins/doc_fragments/keycloak.py
index fab9a6e894..3ef0aeb9e3 100644
--- a/plugins/doc_fragments/keycloak.py
+++ b/plugins/doc_fragments/keycloak.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2017, Eike Frost
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2017, Eike Frost
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
@@ -68,4 +69,10 @@ options:
type: int
default: 10
version_added: 4.5.0
+ http_agent:
+ description:
+ - Configures the HTTP User-Agent header.
+ type: str
+ default: Ansible
+ version_added: 5.4.0
'''
diff --git a/plugins/doc_fragments/ldap.py b/plugins/doc_fragments/ldap.py
index e79fe3a681..d5c8107d35 100644
--- a/plugins/doc_fragments/ldap.py
+++ b/plugins/doc_fragments/ldap.py
@@ -1,9 +1,10 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2016, Peter Sagerson
-# Copyright: (c) 2016, Jiri Tyr
-# Copyright: (c) 2017-2018 Keller Fuchs (@KellerFuchs)
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2016, Peter Sagerson
+# Copyright (c) 2016, Jiri Tyr
+# Copyright (c) 2017-2018 Keller Fuchs (@KellerFuchs)
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/lxca_common.py b/plugins/doc_fragments/lxca_common.py
index c55eca16ac..b5e7d72948 100644
--- a/plugins/doc_fragments/lxca_common.py
+++ b/plugins/doc_fragments/lxca_common.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2017 Lenovo, Inc.
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/manageiq.py b/plugins/doc_fragments/manageiq.py
index b610b512b7..be0dd70694 100644
--- a/plugins/doc_fragments/manageiq.py
+++ b/plugins/doc_fragments/manageiq.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2017, Daniel Korn
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2017, Daniel Korn
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/nomad.py b/plugins/doc_fragments/nomad.py
index 3845c54120..b19404e830 100644
--- a/plugins/doc_fragments/nomad.py
+++ b/plugins/doc_fragments/nomad.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2020 FERREIRA Christophe
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2020 FERREIRA Christophe
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/oneview.py b/plugins/doc_fragments/oneview.py
index 0d385e99aa..0ab50e637b 100644
--- a/plugins/doc_fragments/oneview.py
+++ b/plugins/doc_fragments/oneview.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
#
-# Copyright: (c) 2016-2017, Hewlett Packard Enterprise Development LP
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2016-2017, Hewlett Packard Enterprise Development LP
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/online.py b/plugins/doc_fragments/online.py
index 4ad35bab20..c0757ca6a1 100644
--- a/plugins/doc_fragments/online.py
+++ b/plugins/doc_fragments/online.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) Ansible project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/opennebula.py b/plugins/doc_fragments/opennebula.py
index 08b614a6fc..91bfd09529 100644
--- a/plugins/doc_fragments/opennebula.py
+++ b/plugins/doc_fragments/opennebula.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2018, www.privaz.io Valletech AB
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2018, www.privaz.io Valletech AB
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/openswitch.py b/plugins/doc_fragments/openswitch.py
index 7ab7c15540..317ec904e5 100644
--- a/plugins/doc_fragments/openswitch.py
+++ b/plugins/doc_fragments/openswitch.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2015, Peter Sprygada
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2015, Peter Sprygada
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/oracle.py b/plugins/doc_fragments/oracle.py
index 94999c04ec..9ca4706baa 100644
--- a/plugins/doc_fragments/oracle.py
+++ b/plugins/doc_fragments/oracle.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2018, Oracle and/or its affiliates.
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/oracle_creatable_resource.py b/plugins/doc_fragments/oracle_creatable_resource.py
index 211ca6f9c1..7c1551ec06 100644
--- a/plugins/doc_fragments/oracle_creatable_resource.py
+++ b/plugins/doc_fragments/oracle_creatable_resource.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2018, Oracle and/or its affiliates.
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/oracle_display_name_option.py b/plugins/doc_fragments/oracle_display_name_option.py
index ff70d45dd9..eae5f44593 100644
--- a/plugins/doc_fragments/oracle_display_name_option.py
+++ b/plugins/doc_fragments/oracle_display_name_option.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2018, Oracle and/or its affiliates.
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/oracle_name_option.py b/plugins/doc_fragments/oracle_name_option.py
index 8c4f9c1e39..362071f946 100644
--- a/plugins/doc_fragments/oracle_name_option.py
+++ b/plugins/doc_fragments/oracle_name_option.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2018, Oracle and/or its affiliates.
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/oracle_tags.py b/plugins/doc_fragments/oracle_tags.py
index f95b22c8ed..3789dbe912 100644
--- a/plugins/doc_fragments/oracle_tags.py
+++ b/plugins/doc_fragments/oracle_tags.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2018, Oracle and/or its affiliates.
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/oracle_wait_options.py b/plugins/doc_fragments/oracle_wait_options.py
index 0312755ffa..6ca2a8c033 100644
--- a/plugins/doc_fragments/oracle_wait_options.py
+++ b/plugins/doc_fragments/oracle_wait_options.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2018, Oracle and/or its affiliates.
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/pritunl.py b/plugins/doc_fragments/pritunl.py
index e2eaff2889..51ab979b54 100644
--- a/plugins/doc_fragments/pritunl.py
+++ b/plugins/doc_fragments/pritunl.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2021, Florian Dambrine
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2021, Florian Dambrine
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
diff --git a/plugins/doc_fragments/proxmox.py b/plugins/doc_fragments/proxmox.py
index 165a78527a..50fe6ea0e6 100644
--- a/plugins/doc_fragments/proxmox.py
+++ b/plugins/doc_fragments/proxmox.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) Ansible project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/purestorage.py b/plugins/doc_fragments/purestorage.py
index f35f026711..8db8c3b3da 100644
--- a/plugins/doc_fragments/purestorage.py
+++ b/plugins/doc_fragments/purestorage.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2017, Simon Dodsley
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2017, Simon Dodsley
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/rackspace.py b/plugins/doc_fragments/rackspace.py
index 0f57dd8899..9e22316022 100644
--- a/plugins/doc_fragments/rackspace.py
+++ b/plugins/doc_fragments/rackspace.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2014, Matt Martz
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2014, Matt Martz
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/redis.py b/plugins/doc_fragments/redis.py
index e7af25ec8f..2d40330519 100644
--- a/plugins/doc_fragments/redis.py
+++ b/plugins/doc_fragments/redis.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2021, Andreas Botzner
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2021, Andreas Botzner
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/rundeck.py b/plugins/doc_fragments/rundeck.py
index 056a54f37f..62c8648e96 100644
--- a/plugins/doc_fragments/rundeck.py
+++ b/plugins/doc_fragments/rundeck.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2021, Phillipe Smith
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2021, Phillipe Smith
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/scaleway.py b/plugins/doc_fragments/scaleway.py
index c1e1b13d9d..187288fbf8 100644
--- a/plugins/doc_fragments/scaleway.py
+++ b/plugins/doc_fragments/scaleway.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2018, Yanis Guenane
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2018, Yanis Guenane
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/utm.py b/plugins/doc_fragments/utm.py
index 413fb49675..6700ac5320 100644
--- a/plugins/doc_fragments/utm.py
+++ b/plugins/doc_fragments/utm.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2018, Johannes Brunswicker
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2018, Johannes Brunswicker
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/vexata.py b/plugins/doc_fragments/vexata.py
index d541d5ad85..31e2f24f74 100644
--- a/plugins/doc_fragments/vexata.py
+++ b/plugins/doc_fragments/vexata.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
#
-# Copyright: (c) 2019, Sandeep Kasargod
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2019, Sandeep Kasargod
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/doc_fragments/xenserver.py b/plugins/doc_fragments/xenserver.py
index 747bf02f1b..66522fcf4c 100644
--- a/plugins/doc_fragments/xenserver.py
+++ b/plugins/doc_fragments/xenserver.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2018, Bojan Vitnik
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2018, Bojan Vitnik
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/filter/counter.py b/plugins/filter/counter.py
index 5d7f365f94..1b79294b59 100644
--- a/plugins/filter/counter.py
+++ b/plugins/filter/counter.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Remy Keil
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
@@ -21,7 +22,7 @@ DOCUMENTATION = '''
'''
EXAMPLES = '''
-- name: Count occurences
+- name: Count occurrences
ansible.builtin.debug:
msg: >-
{{ [1, 'a', 2, 2, 'a', 'b', 'a'] | community.general.counter }}
@@ -30,7 +31,7 @@ EXAMPLES = '''
RETURN = '''
_value:
- description: A dictionary with the elements of the sequence as keys, and their number of occurance in the sequence as values.
+ description: A dictionary with the elements of the sequence as keys, and their number of occurrences in the sequence as values.
type: dictionary
'''
diff --git a/plugins/filter/crc32.py b/plugins/filter/crc32.py
new file mode 100644
index 0000000000..1f0aa2e9b0
--- /dev/null
+++ b/plugins/filter/crc32.py
@@ -0,0 +1,64 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2022, Julien Riou
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
+from ansible.errors import AnsibleFilterError
+from ansible.module_utils.common.text.converters import to_bytes
+from ansible.module_utils.common.collections import is_string
+
+try:
+ from zlib import crc32
+ HAS_ZLIB = True
+except ImportError:
+ HAS_ZLIB = False
+
+
+DOCUMENTATION = '''
+ name: crc32
+ short_description: Generate a CRC32 checksum
+ version_added: 5.4.0
+ description:
+ - Checksum a string using CRC32 algorithm and return its hexadecimal representation.
+ options:
+ _input:
+ description:
+ - The string to checksum.
+ type: string
+ required: true
+ author:
+ - Julien Riou
+'''
+
+EXAMPLES = '''
+ - name: Checksum a test string
+ ansible.builtin.debug:
+ msg: "{{ 'test' | community.general.crc32 }}"
+'''
+
+RETURN = '''
+ _value:
+ description: CRC32 checksum.
+ type: string
+'''
+
+
+def crc32s(value):
+ if not is_string(value):
+ raise AnsibleFilterError('Invalid value type (%s) for crc32 (%r)' %
+ (type(value), value))
+
+ if not HAS_ZLIB:
+ raise AnsibleFilterError('Failed to import zlib module')
+
+ data = to_bytes(value, errors='surrogate_or_strict')
+ return "{0:x}".format(crc32(data) & 0xffffffff)
+
+
+class FilterModule:
+ def filters(self):
+ return {
+ 'crc32': crc32s,
+ }
diff --git a/plugins/filter/dict.py b/plugins/filter/dict.py
index 866e8f8dc2..720c9def96 100644
--- a/plugins/filter/dict.py
+++ b/plugins/filter/dict.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2021, Felix Fontein
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2021, Felix Fontein
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
__metaclass__ = type
diff --git a/plugins/filter/dict_kv.py b/plugins/filter/dict_kv.py
index 1a0957819e..59595f9573 100644
--- a/plugins/filter/dict_kv.py
+++ b/plugins/filter/dict_kv.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2020 Stanislav German-Evtushenko (@giner)
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/filter/from_csv.py b/plugins/filter/from_csv.py
index 269cba046f..6472b67b1a 100644
--- a/plugins/filter/from_csv.py
+++ b/plugins/filter/from_csv.py
@@ -1,8 +1,9 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2021, Andrew Pantuso (@ajpantuso)
-# Copyright: (c) 2018, Dag Wieers (@dagwieers)
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2021, Andrew Pantuso (@ajpantuso)
+# Copyright (c) 2018, Dag Wieers (@dagwieers)
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
__metaclass__ = type
diff --git a/plugins/filter/groupby_as_dict.py b/plugins/filter/groupby_as_dict.py
index 386a8b44cf..4a8f4c6dc1 100644
--- a/plugins/filter/groupby_as_dict.py
+++ b/plugins/filter/groupby_as_dict.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Felix Fontein
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/filter/hashids.py b/plugins/filter/hashids.py
index c4735afeae..45fba83c03 100644
--- a/plugins/filter/hashids.py
+++ b/plugins/filter/hashids.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2021, Andrew Pantuso (@ajpantuso)
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2021, Andrew Pantuso (@ajpantuso)
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
__metaclass__ = type
diff --git a/plugins/filter/hashids_decode.yml b/plugins/filter/hashids_decode.yml
index 50e07abc8c..3d2144f725 100644
--- a/plugins/filter/hashids_decode.yml
+++ b/plugins/filter/hashids_decode.yml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
DOCUMENTATION:
name: hashids_decode
short_description: Decodes a sequence of numbers from a YouTube-like hash
diff --git a/plugins/filter/hashids_encode.yml b/plugins/filter/hashids_encode.yml
index 69816aac30..af19522d0a 100644
--- a/plugins/filter/hashids_encode.yml
+++ b/plugins/filter/hashids_encode.yml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
DOCUMENTATION:
name: hashids_encode
short_description: Encodes YouTube-like hashes from a sequence of integers
diff --git a/plugins/filter/jc.py b/plugins/filter/jc.py
index 094da26632..8f83871407 100644
--- a/plugins/filter/jc.py
+++ b/plugins/filter/jc.py
@@ -1,20 +1,7 @@
# -*- coding: utf-8 -*-
-# (c) 2015, Filipe Niero Felisbino
-#
-# This file is part of Ansible
-#
-# Ansible is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Ansible is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Ansible. If not, see .
+# Copyright (c) 2015, Filipe Niero Felisbino
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
#
# contributed by Kelly Brazil
@@ -38,7 +25,7 @@ DOCUMENTATION = '''
parser:
description:
- The correct parser for the input data.
- - For exmaple C(ifconfig).
+ - For example C(ifconfig).
- See U(https://github.com/kellyjonbrazil/jc#parsers) for the latest list of parsers.
type: string
required: true
diff --git a/plugins/filter/json_query.py b/plugins/filter/json_query.py
index 7b04455181..9e8fa4ef2e 100644
--- a/plugins/filter/json_query.py
+++ b/plugins/filter/json_query.py
@@ -1,20 +1,7 @@
# -*- coding: utf-8 -*-
-# (c) 2015, Filipe Niero Felisbino
-#
-# This file is part of Ansible
-#
-# Ansible is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Ansible is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Ansible. If not, see .
+# Copyright (c) 2015, Filipe Niero Felisbino
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/filter/lists_mergeby.py b/plugins/filter/lists_mergeby.py
index 4848cc8785..a89039ed89 100644
--- a/plugins/filter/lists_mergeby.py
+++ b/plugins/filter/lists_mergeby.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020-2022, Vladimir Botka
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/filter/random_mac.py b/plugins/filter/random_mac.py
index 544cd0aa0b..662c62b07c 100644
--- a/plugins/filter/random_mac.py
+++ b/plugins/filter/random_mac.py
@@ -1,20 +1,7 @@
# -*- coding: utf-8 -*-
-# (c) 2020 Ansible Project
-#
-# This file is part of Ansible
-#
-# Ansible is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Ansible is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Ansible. If not, see .
+# Copyright (c) 2020 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
diff --git a/plugins/filter/time.py b/plugins/filter/time.py
index f069780fe7..25970cd260 100644
--- a/plugins/filter/time.py
+++ b/plugins/filter/time.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020, René Moser
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/filter/to_days.yml b/plugins/filter/to_days.yml
index e06c9463dc..19bc8faf23 100644
--- a/plugins/filter/to_days.yml
+++ b/plugins/filter/to_days.yml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
DOCUMENTATION:
name: to_days
short_description: Converte a duration string to days
diff --git a/plugins/filter/to_hours.yml b/plugins/filter/to_hours.yml
index 976c3a6adf..83826a5908 100644
--- a/plugins/filter/to_hours.yml
+++ b/plugins/filter/to_hours.yml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
DOCUMENTATION:
name: to_hours
short_description: Converte a duration string to hours
diff --git a/plugins/filter/to_milliseconds.yml b/plugins/filter/to_milliseconds.yml
index a4c59ce958..b6bb7e4be0 100644
--- a/plugins/filter/to_milliseconds.yml
+++ b/plugins/filter/to_milliseconds.yml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
DOCUMENTATION:
name: to_milliseconds
short_description: Converte a duration string to milliseconds
diff --git a/plugins/filter/to_minutes.yml b/plugins/filter/to_minutes.yml
index 7dfeada29f..3b85dadc43 100644
--- a/plugins/filter/to_minutes.yml
+++ b/plugins/filter/to_minutes.yml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
DOCUMENTATION:
name: to_minutes
short_description: Converte a duration string to minutes
diff --git a/plugins/filter/to_months.yml b/plugins/filter/to_months.yml
index 84a94d2526..f13cee918e 100644
--- a/plugins/filter/to_months.yml
+++ b/plugins/filter/to_months.yml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
DOCUMENTATION:
name: to_months
short_description: Converte a duration string to months
diff --git a/plugins/filter/to_seconds.yml b/plugins/filter/to_seconds.yml
index 0b09e98456..d6e6c4e467 100644
--- a/plugins/filter/to_seconds.yml
+++ b/plugins/filter/to_seconds.yml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
DOCUMENTATION:
name: to_seconds
short_description: Converte a duration string to seconds
diff --git a/plugins/filter/to_time_unit.yml b/plugins/filter/to_time_unit.yml
index 436a4d6a80..c0149f0acd 100644
--- a/plugins/filter/to_time_unit.yml
+++ b/plugins/filter/to_time_unit.yml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
DOCUMENTATION:
name: to_time_unit
short_description: Converte a duration string to the given time unit
diff --git a/plugins/filter/to_weeks.yml b/plugins/filter/to_weeks.yml
index 4626e35662..499c386276 100644
--- a/plugins/filter/to_weeks.yml
+++ b/plugins/filter/to_weeks.yml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
DOCUMENTATION:
name: to_weeks
short_description: Converte a duration string to weeks
diff --git a/plugins/filter/to_years.yml b/plugins/filter/to_years.yml
index 4fb54b8753..1a244a276f 100644
--- a/plugins/filter/to_years.yml
+++ b/plugins/filter/to_years.yml
@@ -1,3 +1,8 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
DOCUMENTATION:
name: to_years
short_description: Converte a duration string to years
diff --git a/plugins/filter/unicode_normalize.py b/plugins/filter/unicode_normalize.py
index 30aed2005a..dfbf20c573 100644
--- a/plugins/filter/unicode_normalize.py
+++ b/plugins/filter/unicode_normalize.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2021, Andrew Pantuso (@ajpantuso)
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2021, Andrew Pantuso (@ajpantuso)
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
__metaclass__ = type
diff --git a/plugins/filter/version_sort.py b/plugins/filter/version_sort.py
index 9d21691085..09eedbf563 100644
--- a/plugins/filter/version_sort.py
+++ b/plugins/filter/version_sort.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2021 Eric Lavarde
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/inventory/cobbler.py b/plugins/inventory/cobbler.py
index d50acd0c55..b3288b27d4 100644
--- a/plugins/inventory/cobbler.py
+++ b/plugins/inventory/cobbler.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2020 Orion Poplawski
# Copyright (c) 2020 Ansible Project
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
@@ -213,7 +214,7 @@ class InventoryModule(BaseInventoryPlugin, Cacheable):
self.inventory.add_child(parent_group_name, group_name)
else:
self.display.vvvv('Processing profile %s without parent\n' % profile['name'])
- # Create a heirarchy of profile names
+ # Create a hierarchy of profile names
profile_elements = profile['name'].split('-')
i = 0
while i < len(profile_elements) - 1:
diff --git a/plugins/inventory/gitlab_runners.py b/plugins/inventory/gitlab_runners.py
index ac0fa21ad9..8279d8e781 100644
--- a/plugins/inventory/gitlab_runners.py
+++ b/plugins/inventory/gitlab_runners.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2018, Stefan Heitmueller
# Copyright (c) 2018 Ansible Project
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
diff --git a/plugins/inventory/icinga2.py b/plugins/inventory/icinga2.py
index 5ae565beb9..70e0f57332 100644
--- a/plugins/inventory/icinga2.py
+++ b/plugins/inventory/icinga2.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Cliff Hults
# Copyright (c) 2021 Ansible Project
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/inventory/linode.py b/plugins/inventory/linode.py
index 33ecc5135c..8790da7079 100644
--- a/plugins/inventory/linode.py
+++ b/plugins/inventory/linode.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Ansible Project
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/inventory/lxd.py b/plugins/inventory/lxd.py
index 912638509d..291d12b037 100644
--- a/plugins/inventory/lxd.py
+++ b/plugins/inventory/lxd.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2021, Frank Dornheim
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2021, Frank Dornheim
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
@@ -522,7 +523,7 @@ class InventoryModule(BaseInventoryPlugin):
"""Helper to save data
Helper to save the data in self.data
- Detect if data is allready in branch and use dict_merge() to prevent that branch is overwritten.
+ Detect if data is already in branch and use dict_merge() to prevent that branch is overwritten.
Args:
str(instance_name): name of instance
diff --git a/plugins/inventory/nmap.py b/plugins/inventory/nmap.py
index 6d1779bb48..3c3b3f8e41 100644
--- a/plugins/inventory/nmap.py
+++ b/plugins/inventory/nmap.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Ansible Project
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/inventory/online.py b/plugins/inventory/online.py
index 00454f558c..f0424ea5e8 100644
--- a/plugins/inventory/online.py
+++ b/plugins/inventory/online.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2018 Ansible Project
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/inventory/opennebula.py b/plugins/inventory/opennebula.py
index 7822240627..f46ad73c57 100644
--- a/plugins/inventory/opennebula.py
+++ b/plugins/inventory/opennebula.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020, FELDSAM s.r.o. - FeldHost™
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
diff --git a/plugins/inventory/proxmox.py b/plugins/inventory/proxmox.py
index e0734b33e3..e13a08a55c 100644
--- a/plugins/inventory/proxmox.py
+++ b/plugins/inventory/proxmox.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2016 Guido Günther , Daniel Lobato Garcia
# Copyright (c) 2018 Ansible Project
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
@@ -92,9 +93,21 @@ DOCUMENTATION = '''
default: proxmox_
type: str
want_facts:
- description: Gather LXC/QEMU configuration facts.
+ description:
+ - Gather LXC/QEMU configuration facts.
+ - When I(want_facts) is set to C(true) more details about QEMU VM status are possible, besides the running and stopped states.
+ Currently if the VM is running and it is suspended, the status will be running and the machine will be in C(running) group,
+ but its actual state will be paused. See I(qemu_extended_statuses) for how to retrieve the real status.
default: no
type: bool
+ qemu_extended_statuses:
+ description:
+ - Requires I(want_facts) to be set to C(true) to function. This will allow you to differentiate betweend C(paused) and C(prelaunch)
+ statuses of the QEMU VMs.
+ - This introduces multiple groups [prefixed with I(group_prefix)] C(prelaunch) and C(paused).
+ default: no
+ type: bool
+ version_added: 5.1.0
want_proxmox_nodes_ansible_host:
version_added: 3.0.0
description:
@@ -400,12 +413,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 = {}
@@ -431,6 +452,8 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
def _get_vm_status(self, properties, node, vmid, vmtype, name):
ret = self._get_json("%s/api2/json/nodes/%s/%s/%s/status/current" % (self.proxmox_url, node, vmtype, vmid))
properties[self._fact('status')] = ret['status']
+ if vmtype == 'qemu':
+ properties[self._fact('qmpstatus')] = ret['qmpstatus']
def _get_vm_snapshots(self, properties, node, vmid, vmtype, name):
ret = self._get_json("%s/api2/json/nodes/%s/%s/%s/snapshot" % (self.proxmox_url, node, vmtype, vmid))
@@ -489,7 +512,8 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
name, vmid = item['name'], item['vmid']
# get status, config and snapshots if want_facts == True
- if self.get_option('want_facts'):
+ want_facts = self.get_option('want_facts')
+ if want_facts:
self._get_vm_status(properties, node, vmid, ittype, name)
self._get_vm_config(properties, node, vmid, ittype, name)
self._get_vm_snapshots(properties, node, vmid, ittype, name)
@@ -503,10 +527,13 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
node_type_group = self._group('%s_%s' % (node, ittype))
self.inventory.add_child(self._group('all_' + ittype), name)
self.inventory.add_child(node_type_group, name)
- if item['status'] == 'stopped':
- self.inventory.add_child(self._group('all_stopped'), name)
- elif item['status'] == 'running':
- self.inventory.add_child(self._group('all_running'), name)
+
+ item_status = item['status']
+ if item_status == 'running':
+ if want_facts and ittype == 'qemu' and self.get_option('qemu_extended_statuses'):
+ # get more details about the status of the qemu VM
+ item_status = properties.get(self._fact('qmpstatus'), item_status)
+ self.inventory.add_child(self._group('all_%s' % (item_status, )), name)
return name
@@ -528,10 +555,14 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
def _populate(self):
# create common groups
- self.inventory.add_group(self._group('all_lxc'))
- self.inventory.add_group(self._group('all_qemu'))
- self.inventory.add_group(self._group('all_running'))
- self.inventory.add_group(self._group('all_stopped'))
+ default_groups = ['lxc', 'qemu', 'running', 'stopped']
+
+ if self.get_option('qemu_extended_statuses'):
+ default_groups.extend(['prelaunch', 'paused'])
+
+ for group in default_groups:
+ self.inventory.add_group(self._group('all_%s' % (group)))
+
nodes_group = self._group('nodes')
self.inventory.add_group(nodes_group)
@@ -621,6 +652,9 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
if proxmox_password is None and (proxmox_token_id is None or proxmox_token_secret is None):
raise AnsibleError('You must specify either a password or both token_id and token_secret.')
+ if self.get_option('qemu_extended_statuses') and not self.get_option('want_facts'):
+ raise AnsibleError('You must set want_facts to True if you want to use qemu_extended_statuses.')
+
self.cache_key = self.get_cache_key(path)
self.use_cache = cache and self.get_option('cache')
self.host_filters = self.get_option('filters')
diff --git a/plugins/inventory/scaleway.py b/plugins/inventory/scaleway.py
index d48cc97a1d..4404038270 100644
--- a/plugins/inventory/scaleway.py
+++ b/plugins/inventory/scaleway.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
diff --git a/plugins/inventory/stackpath_compute.py b/plugins/inventory/stackpath_compute.py
index d777875578..39f880e820 100644
--- a/plugins/inventory/stackpath_compute.py
+++ b/plugins/inventory/stackpath_compute.py
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 Shay Rybak
# Copyright (c) 2020 Ansible Project
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/inventory/virtualbox.py b/plugins/inventory/virtualbox.py
index 89a77c88bb..a8d186bb30 100644
--- a/plugins/inventory/virtualbox.py
+++ b/plugins/inventory/virtualbox.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Ansible Project
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/inventory/xen_orchestra.py b/plugins/inventory/xen_orchestra.py
index cc2346a1aa..0b064b14db 100644
--- a/plugins/inventory/xen_orchestra.py
+++ b/plugins/inventory/xen_orchestra.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021 Ansible Project
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/lookup/bitwarden.py b/plugins/lookup/bitwarden.py
new file mode 100644
index 0000000000..124c139c78
--- /dev/null
+++ b/plugins/lookup/bitwarden.py
@@ -0,0 +1,119 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2022, Jonathan Lung
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
+DOCUMENTATION = """
+ name: bitwarden
+ author:
+ - Jonathan Lung (@lungj)
+ requirements:
+ - bw (command line utility)
+ - be logged into bitwarden
+ short_description: Retrieve secrets from Bitwarden
+ version_added: 5.4.0
+ description:
+ - Retrieve secrets from Bitwarden.
+ options:
+ _terms:
+ description: Key(s) to fetch values for from login info.
+ required: true
+ type: list
+ elements: str
+ field:
+ description: Field to fetch; leave unset to fetch whole response.
+ type: str
+"""
+
+EXAMPLES = """
+- name: "Get 'password' from Bitwarden record named 'a_test'"
+ ansible.builtin.debug:
+ msg: >-
+ {{ lookup('community.general.bitwarden', 'a_test', field='password') }}
+
+- name: "Get full Bitwarden record named 'a_test'"
+ ansible.builtin.debug:
+ msg: >-
+ {{ lookup('community.general.bitwarden', 'a_test') }}
+"""
+
+RETURN = """
+ _raw:
+ description: List of requested field or JSON object of list of matches.
+ type: list
+ elements: raw
+"""
+
+from subprocess import Popen, PIPE
+
+from ansible.errors import AnsibleError
+from ansible.module_utils.common.text.converters import to_bytes, to_text
+from ansible.parsing.ajson import AnsibleJSONDecoder
+from ansible.plugins.lookup import LookupBase
+
+
+class BitwardenException(AnsibleError):
+ pass
+
+
+class Bitwarden(object):
+
+ def __init__(self, path='bw'):
+ self._cli_path = path
+
+ @property
+ def cli_path(self):
+ return self._cli_path
+
+ @property
+ def logged_in(self):
+ out, err = self._run(['status'], stdin="")
+ decoded = AnsibleJSONDecoder().raw_decode(out)[0]
+ return decoded['status'] == 'unlocked'
+
+ def _run(self, args, stdin=None, expected_rc=0):
+ p = Popen([self.cli_path] + args, stdout=PIPE, stderr=PIPE, stdin=PIPE)
+ out, err = p.communicate(to_bytes(stdin))
+ rc = p.wait()
+ if rc != expected_rc:
+ raise BitwardenException(err)
+ return to_text(out, errors='surrogate_or_strict'), to_text(err, errors='surrogate_or_strict')
+
+ def _get_matches(self, search_value, search_field="name"):
+ """Return matching records whose search_field is equal to key.
+ """
+ out, err = self._run(['list', 'items', '--search', search_value])
+
+ # This includes things that matched in different fields.
+ initial_matches = AnsibleJSONDecoder().raw_decode(out)[0]
+
+ # Filter to only include results from the right field.
+ return [item for item in initial_matches if item[search_field] == search_value]
+
+ def get_field(self, field, search_value, search_field="name"):
+ """Return a list of the specified field for records whose search_field match search_value.
+
+ If field is None, return the whole record for each match.
+ """
+ matches = self._get_matches(search_value)
+
+ if field:
+ return [match['login'][field] for match in matches]
+
+ return matches
+
+
+class LookupModule(LookupBase):
+
+ def run(self, terms, variables=None, **kwargs):
+ self.set_options(var_options=variables, direct=kwargs)
+ field = self.get_option('field')
+ if not _bitwarden.logged_in:
+ raise AnsibleError("Not logged into Bitwarden. Run 'bw login'.")
+
+ return [_bitwarden.get_field(field, term) for term in terms]
+
+
+_bitwarden = Bitwarden()
diff --git a/plugins/lookup/cartesian.py b/plugins/lookup/cartesian.py
index 98043eba34..6d98c271ee 100644
--- a/plugins/lookup/cartesian.py
+++ b/plugins/lookup/cartesian.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2013, Bradley Young
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2013, Bradley Young
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/lookup/chef_databag.py b/plugins/lookup/chef_databag.py
index f5ccc766c2..04ef7ee41d 100644
--- a/plugins/lookup/chef_databag.py
+++ b/plugins/lookup/chef_databag.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2016, Josh Bradley
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2016, Josh Bradley
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
@@ -16,7 +17,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:
diff --git a/plugins/lookup/collection_version.py b/plugins/lookup/collection_version.py
index bb67b3b153..4d25585b81 100644
--- a/plugins/lookup/collection_version.py
+++ b/plugins/lookup/collection_version.py
@@ -1,5 +1,6 @@
-# (c) 2021, Felix Fontein
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2021, Felix Fontein
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/lookup/consul_kv.py b/plugins/lookup/consul_kv.py
index 3ad03bfe40..794df197fc 100644
--- a/plugins/lookup/consul_kv.py
+++ b/plugins/lookup/consul_kv.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2015, Steve Gargan
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2015, Steve Gargan
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/lookup/credstash.py b/plugins/lookup/credstash.py
index 143c66c112..a783f8ba08 100644
--- a/plugins/lookup/credstash.py
+++ b/plugins/lookup/credstash.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2015, Ensighten
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2015, Ensighten
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/lookup/cyberarkpassword.py b/plugins/lookup/cyberarkpassword.py
index 663ec38808..a0e36d3efe 100644
--- a/plugins/lookup/cyberarkpassword.py
+++ b/plugins/lookup/cyberarkpassword.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2017, Edward Nunez
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2017, Edward Nunez
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/lookup/dependent.py b/plugins/lookup/dependent.py
index 1fb75ece66..0bd234c1b4 100644
--- a/plugins/lookup/dependent.py
+++ b/plugins/lookup/dependent.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2015-2021, Felix Fontein
-# (c) 2018 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2015-2021, Felix Fontein
+# Copyright (c) 2018 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/lookup/dig.py b/plugins/lookup/dig.py
index 291bac5e45..b64b9e4de8 100644
--- a/plugins/lookup/dig.py
+++ b/plugins/lookup/dig.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2015, Jan-Piet Mens
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2015, Jan-Piet Mens
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
@@ -42,6 +43,15 @@ DOCUMENTATION = '''
default: false
type: bool
version_added: 3.6.0
+ fail_on_error:
+ description:
+ - Abort execution on lookup errors.
+ - The default for this option will likely change to C(true) in the future.
+ The current default, C(false), is used for backwards compatibility, and will result in empty strings
+ or the string C(NXDOMAIN) in the result in case of errors.
+ default: false
+ type: bool
+ version_added: 5.4.0
notes:
- ALL is not a record per-se, merely the listed fields are available for any record results you retrieve in the form of a dictionary.
- While the 'dig' lookup plugin supports anything which dnspython supports out of the box, only a subset can be converted into a dictionary.
@@ -165,6 +175,7 @@ RETURN = """
from ansible.errors import AnsibleError
from ansible.plugins.lookup import LookupBase
from ansible.module_utils.common.text.converters import to_native
+from ansible.module_utils.parsing.convert_bool import boolean
from ansible.utils.display import Display
import socket
@@ -279,6 +290,7 @@ class LookupModule(LookupBase):
domain = None
qtype = 'A'
flat = True
+ fail_on_error = False
rdclass = dns.rdataclass.from_text('IN')
for t in terms:
@@ -316,7 +328,9 @@ class LookupModule(LookupBase):
except Exception as e:
raise AnsibleError("dns lookup illegal CLASS: %s" % to_native(e))
elif opt == 'retry_servfail':
- myres.retry_servfail = bool(arg)
+ myres.retry_servfail = boolean(arg)
+ elif opt == 'fail_on_error':
+ fail_on_error = boolean(arg)
continue
@@ -364,16 +378,24 @@ class LookupModule(LookupBase):
rd['class'] = dns.rdataclass.to_text(rdata.rdclass)
ret.append(rd)
- except Exception as e:
- ret.append(str(e))
+ except Exception as err:
+ if fail_on_error:
+ raise AnsibleError("Lookup failed: %s" % str(err))
+ ret.append(str(err))
- except dns.resolver.NXDOMAIN:
+ except dns.resolver.NXDOMAIN as err:
+ if fail_on_error:
+ raise AnsibleError("Lookup failed: %s" % str(err))
ret.append('NXDOMAIN')
- except dns.resolver.NoAnswer:
+ except dns.resolver.NoAnswer as err:
+ if fail_on_error:
+ raise AnsibleError("Lookup failed: %s" % str(err))
ret.append("")
- except dns.resolver.Timeout:
+ except dns.resolver.Timeout as err:
+ if fail_on_error:
+ raise AnsibleError("Lookup failed: %s" % str(err))
ret.append('')
- except dns.exception.DNSException as e:
- raise AnsibleError("dns.resolver unhandled exception %s" % to_native(e))
+ except dns.exception.DNSException as err:
+ raise AnsibleError("dns.resolver unhandled exception %s" % to_native(err))
return ret
diff --git a/plugins/lookup/dnstxt.py b/plugins/lookup/dnstxt.py
index e724f8c8f7..7f4516ce5b 100644
--- a/plugins/lookup/dnstxt.py
+++ b/plugins/lookup/dnstxt.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2012, Jan-Piet Mens
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2012, Jan-Piet Mens
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/lookup/dsv.py b/plugins/lookup/dsv.py
index 1cd9041a2e..91a9d99212 100644
--- a/plugins/lookup/dsv.py
+++ b/plugins/lookup/dsv.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2020, Adam Migus
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2020, Adam Migus
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
__metaclass__ = type
@@ -122,6 +123,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"),
}
)
diff --git a/plugins/lookup/etcd.py b/plugins/lookup/etcd.py
index 0c81d0215b..8f7c4954d1 100644
--- a/plugins/lookup/etcd.py
+++ b/plugins/lookup/etcd.py
@@ -1,22 +1,10 @@
# -*- coding: utf-8 -*-
-# (c) 2013, Jan-Piet Mens
+# Copyright (c) 2013, Jan-Piet Mens
# (m) 2016, Mihai Moldovanu
# (m) 2017, Juan Manuel Parrilla
-#
-# This file is part of Ansible
-#
-# Ansible is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Ansible is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Ansible. If not, see .
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/lookup/etcd3.py b/plugins/lookup/etcd3.py
index a34fae7bf3..901d602174 100644
--- a/plugins/lookup/etcd3.py
+++ b/plugins/lookup/etcd3.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
#
-# (c) 2020, SCC France, Eric Belhomme
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2020, SCC France, Eric Belhomme
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
__metaclass__ = type
diff --git a/plugins/lookup/filetree.py b/plugins/lookup/filetree.py
index 1c83486b05..2979257640 100644
--- a/plugins/lookup/filetree.py
+++ b/plugins/lookup/filetree.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2016 Dag Wieers
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2016 Dag Wieers
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/lookup/flattened.py b/plugins/lookup/flattened.py
index edc546ff83..0e802d369c 100644
--- a/plugins/lookup/flattened.py
+++ b/plugins/lookup/flattened.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2013, Serge van Ginderachter
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2013, Serge van Ginderachter
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/lookup/hiera.py b/plugins/lookup/hiera.py
index 5b440469eb..d3aa8b99b4 100644
--- a/plugins/lookup/hiera.py
+++ b/plugins/lookup/hiera.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2017, Juan Manuel Parrilla
-# (c) 2012-17 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2017, Juan Manuel Parrilla
+# Copyright (c) 2012-17 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/lookup/keyring.py b/plugins/lookup/keyring.py
index 73f9c5f4a9..56718c32e9 100644
--- a/plugins/lookup/keyring.py
+++ b/plugins/lookup/keyring.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2016, Samuel Boucher
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2016, Samuel Boucher
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
@@ -18,7 +19,7 @@ DOCUMENTATION = '''
'''
EXAMPLES = """
-- name : output secrets to screen (BAD IDEA)
+- name: output secrets to screen (BAD IDEA)
ansible.builtin.debug:
msg: "Password: {{item}}"
with_community.general.keyring:
diff --git a/plugins/lookup/lastpass.py b/plugins/lookup/lastpass.py
index 920d33176f..8eb3090b76 100644
--- a/plugins/lookup/lastpass.py
+++ b/plugins/lookup/lastpass.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2016, Andrew Zenk
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2016, Andrew Zenk
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
@@ -11,21 +12,24 @@ DOCUMENTATION = '''
- Andrew Zenk (!UNKNOWN)
requirements:
- lpass (command line utility)
- - must have already logged into lastpass
- short_description: fetch data from lastpass
+ - must have already logged into LastPass
+ short_description: fetch data from LastPass
description:
- - use the lpass command line utility to fetch specific fields from lastpass
+ - Use the lpass command line utility to fetch specific fields from LastPass.
options:
_terms:
- description: key from which you want to retrieve the field
- required: True
+ description: Key from which you want to retrieve the field.
+ required: true
+ type: list
+ elements: str
field:
- description: field to return from lastpass
+ description: Field to return from LastPass.
default: 'password'
+ type: str
'''
EXAMPLES = """
-- name: get 'custom_field' from lastpass entry 'entry-name'
+- name: get 'custom_field' from LastPass entry 'entry-name'
ansible.builtin.debug:
msg: "{{ lookup('community.general.lastpass', 'entry-name', field='custom_field') }}"
"""
@@ -88,12 +92,14 @@ class LPass(object):
class LookupModule(LookupBase):
def run(self, terms, variables=None, **kwargs):
+ self.set_options(var_options=variables, direct=kwargs)
+ field = self.get_option('field')
+
lp = LPass()
if not lp.logged_in:
- raise AnsibleError("Not logged into lastpass: please run 'lpass login' first")
+ raise AnsibleError("Not logged into LastPass: please run 'lpass login' first")
- field = kwargs.get('field', 'password')
values = []
for term in terms:
values.append(lp.get_field(term, field))
diff --git a/plugins/lookup/lmdb_kv.py b/plugins/lookup/lmdb_kv.py
index 9dd46e338a..569a49a5f0 100644
--- a/plugins/lookup/lmdb_kv.py
+++ b/plugins/lookup/lmdb_kv.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2017-2018, Jan-Piet Mens
-# (c) 2018 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2017-2018, Jan-Piet Mens
+# Copyright (c) 2018 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/lookup/manifold.py b/plugins/lookup/manifold.py
index 01bb13cf0b..f83104d93b 100644
--- a/plugins/lookup/manifold.py
+++ b/plugins/lookup/manifold.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2018, Arigato Machine Inc.
-# (c) 2018, Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2018, Arigato Machine Inc.
+# Copyright (c) 2018, Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/lookup/onepassword.py b/plugins/lookup/onepassword.py
index e0be0cd27e..b6b9374eba 100644
--- a/plugins/lookup/onepassword.py
+++ b/plugins/lookup/onepassword.py
@@ -1,8 +1,9 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2018, Scott Buchanan
-# Copyright: (c) 2016, Andrew Zenk (lastpass.py used as starting point)
-# Copyright: (c) 2018, Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2018, Scott Buchanan
+# Copyright (c) 2016, Andrew Zenk (lastpass.py used as starting point)
+# Copyright (c) 2018, Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/lookup/onepassword_raw.py b/plugins/lookup/onepassword_raw.py
index d1958f78cd..d9abaf645e 100644
--- a/plugins/lookup/onepassword_raw.py
+++ b/plugins/lookup/onepassword_raw.py
@@ -1,8 +1,9 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2018, Scott Buchanan
-# Copyright: (c) 2016, Andrew Zenk (lastpass.py used as starting point)
-# Copyright: (c) 2018, Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2018, Scott Buchanan
+# Copyright (c) 2016, Andrew Zenk (lastpass.py used as starting point)
+# Copyright (c) 2018, Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/lookup/passwordstore.py b/plugins/lookup/passwordstore.py
index a221e49625..6330671f58 100644
--- a/plugins/lookup/passwordstore.py
+++ b/plugins/lookup/passwordstore.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2017, Patrick Deelman
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2017, Patrick Deelman
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
@@ -21,8 +22,14 @@ DOCUMENTATION = '''
description: query key.
required: True
passwordstore:
- description: location of the password store.
- default: '~/.password-store'
+ description:
+ - Location of the password store.
+ - 'The value is decided by checking the following in order:'
+ - If set, this value is used.
+ - If C(directory) is set, that value will be used.
+ - If I(backend=pass), then C(~/.password-store) is used.
+ - If I(backend=gopass), then the C(path) field in C(~/.config/gopass/config.yml) is used,
+ falling back to C(~/.local/share/gopass/stores/root) if not defined.
directory:
description: The directory of the password store.
env:
@@ -106,6 +113,22 @@ DOCUMENTATION = '''
type: str
default: 15m
version_added: 4.5.0
+ backend:
+ description:
+ - Specify which backend to use.
+ - Defaults to C(pass), passwordstore.org's original pass utility.
+ - C(gopass) support is incomplete.
+ ini:
+ - section: passwordstore_lookup
+ key: backend
+ vars:
+ - name: passwordstore_backend
+ type: str
+ default: pass
+ choices:
+ - pass
+ - gopass
+ version_added: 5.2.0
'''
EXAMPLES = """
ansible.cfg: |
@@ -231,6 +254,24 @@ def check_output2(*popenargs, **kwargs):
class LookupModule(LookupBase):
+ def __init__(self, loader=None, templar=None, **kwargs):
+
+ super(LookupModule, self).__init__(loader, templar, **kwargs)
+ self.realpass = None
+
+ def is_real_pass(self):
+ if self.realpass is None:
+ try:
+ passoutput = to_text(
+ check_output2([self.pass_cmd, "--version"], env=self.env),
+ errors='surrogate_or_strict'
+ )
+ self.realpass = 'pass: the standard unix password manager' in passoutput
+ except (subprocess.CalledProcessError) as e:
+ raise AnsibleError(e)
+
+ return self.realpass
+
def parse_params(self, term):
# I went with the "traditional" param followed with space separated KV pairs.
# Waiting for final implementation of lookup parameter parsing.
@@ -270,10 +311,12 @@ class LookupModule(LookupBase):
self.env = os.environ.copy()
self.env['LANGUAGE'] = 'C' # make sure to get errors in English as required by check_output2
- # Set PASSWORD_STORE_DIR
- if os.path.isdir(self.paramvals['directory']):
+ if self.backend == 'gopass':
+ self.env['GOPASS_NO_REMINDER'] = "YES"
+ elif os.path.isdir(self.paramvals['directory']):
+ # Set PASSWORD_STORE_DIR
self.env['PASSWORD_STORE_DIR'] = self.paramvals['directory']
- else:
+ elif self.is_real_pass():
raise AnsibleError('Passwordstore directory \'{0}\' does not exist'.format(self.paramvals['directory']))
# Set PASSWORD_STORE_UMASK if umask is set
@@ -288,7 +331,8 @@ class LookupModule(LookupBase):
def check_pass(self):
try:
self.passoutput = to_text(
- check_output2(["pass", "show", self.passname], env=self.env),
+ check_output2([self.pass_cmd, 'show'] +
+ [self.passname], env=self.env),
errors='surrogate_or_strict'
).splitlines()
self.password = self.passoutput[0]
@@ -302,8 +346,10 @@ class LookupModule(LookupBase):
if ':' in line:
name, value = line.split(':', 1)
self.passdict[name.strip()] = value.strip()
- if os.path.isfile(os.path.join(self.paramvals['directory'], self.passname + ".gpg")):
- # Only accept password as found, if there a .gpg file for it (might be a tree node otherwise)
+ if (self.backend == 'gopass' or
+ os.path.isfile(os.path.join(self.paramvals['directory'], self.passname + ".gpg"))
+ or not self.is_real_pass()):
+ # When using real pass, only accept password as found if there is a .gpg file for it (might be a tree node otherwise)
return True
except (subprocess.CalledProcessError) as e:
# 'not in password store' is the expected error if a password wasn't found
@@ -339,7 +385,7 @@ class LookupModule(LookupBase):
if self.paramvals['backup']:
msg += "lookup_pass: old password was {0} (Updated on {1})\n".format(self.password, datetime)
try:
- check_output2(['pass', 'insert', '-f', '-m', self.passname], input=msg, env=self.env)
+ check_output2([self.pass_cmd, 'insert', '-f', '-m', self.passname], input=msg, env=self.env)
except (subprocess.CalledProcessError) as e:
raise AnsibleError(e)
return newpass
@@ -351,7 +397,7 @@ class LookupModule(LookupBase):
datetime = time.strftime("%d/%m/%Y %H:%M:%S")
msg = newpass + '\n' + "lookup_pass: First generated by ansible on {0}\n".format(datetime)
try:
- check_output2(['pass', 'insert', '-f', '-m', self.passname], input=msg, env=self.env)
+ check_output2([self.pass_cmd, 'insert', '-f', '-m', self.passname], input=msg, env=self.env)
except (subprocess.CalledProcessError) as e:
raise AnsibleError(e)
return newpass
@@ -380,17 +426,30 @@ class LookupModule(LookupBase):
yield
def setup(self, variables):
+ self.backend = self.get_option('backend')
+ self.pass_cmd = self.backend # pass and gopass are commands as well
self.locked = None
timeout = self.get_option('locktimeout')
if not re.match('^[0-9]+[smh]$', timeout):
raise AnsibleError("{0} is not a correct value for locktimeout".format(timeout))
unit_to_seconds = {"s": 1, "m": 60, "h": 3600}
self.lock_timeout = int(timeout[:-1]) * unit_to_seconds[timeout[-1]]
+
+ directory = variables.get('passwordstore', os.environ.get('PASSWORD_STORE_DIR', None))
+
+ if directory is None:
+ if self.backend == 'gopass':
+ try:
+ with open(os.path.expanduser('~/.config/gopass/config.yml')) as f:
+ directory = yaml.safe_load(f)['path']
+ except (FileNotFoundError, KeyError, yaml.YAMLError):
+ directory = os.path.expanduser('~/.local/share/gopass/stores/root')
+ else:
+ directory = os.path.expanduser('~/.password-store')
+
self.paramvals = {
'subkey': 'password',
- 'directory': variables.get('passwordstore', os.environ.get(
- 'PASSWORD_STORE_DIR',
- os.path.expanduser('~/.password-store'))),
+ 'directory': directory,
'create': False,
'returnall': False,
'overwrite': False,
@@ -402,6 +461,7 @@ class LookupModule(LookupBase):
}
def run(self, terms, variables, **kwargs):
+ self.set_options(var_options=variables, direct=kwargs)
self.setup(variables)
result = []
diff --git a/plugins/lookup/random_pet.py b/plugins/lookup/random_pet.py
index 6caf178e4b..71a62cbca0 100644
--- a/plugins/lookup/random_pet.py
+++ b/plugins/lookup/random_pet.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2021, Abhijeet Kasurde
-# Copyright: (c) 2018, Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2021, Abhijeet Kasurde
+# Copyright (c) 2018, Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
diff --git a/plugins/lookup/random_string.py b/plugins/lookup/random_string.py
index d67a75ed99..199aa13964 100644
--- a/plugins/lookup/random_string.py
+++ b/plugins/lookup/random_string.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2021, Abhijeet Kasurde
-# Copyright: (c) 2018, Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2021, Abhijeet Kasurde
+# Copyright (c) 2018, Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
diff --git a/plugins/lookup/random_words.py b/plugins/lookup/random_words.py
index a2381aa38f..a4aa1b3178 100644
--- a/plugins/lookup/random_words.py
+++ b/plugins/lookup/random_words.py
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) Ansible project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
"""The community.general.random_words Ansible lookup plugin."""
diff --git a/plugins/lookup/redis.py b/plugins/lookup/redis.py
index 8de7e04cce..490751a398 100644
--- a/plugins/lookup/redis.py
+++ b/plugins/lookup/redis.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2012, Jan-Piet Mens
-# (c) 2017 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2012, Jan-Piet Mens
+# Copyright (c) 2017 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/lookup/revbitspss.py b/plugins/lookup/revbitspss.py
index b5be15f7a6..552970804e 100644
--- a/plugins/lookup/revbitspss.py
+++ b/plugins/lookup/revbitspss.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2021, RevBits
-# GNU General Public License v3.0+ (see COPYING or
-# https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2021, RevBits
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
__metaclass__ = type
diff --git a/plugins/lookup/shelvefile.py b/plugins/lookup/shelvefile.py
index 56cfdf1143..ee84a40027 100644
--- a/plugins/lookup/shelvefile.py
+++ b/plugins/lookup/shelvefile.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2015, Alejandro Guirao
-# (c) 2012-17 Ansible Project
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2015, Alejandro Guirao
+# Copyright (c) 2012-17 Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/lookup/tss.py b/plugins/lookup/tss.py
index 880e6e3833..756f168e5b 100644
--- a/plugins/lookup/tss.py
+++ b/plugins/lookup/tss.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2020, Adam Migus
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2020, Adam Migus
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
__metaclass__ = type
diff --git a/plugins/module_utils/_mount.py b/plugins/module_utils/_mount.py
index 391d468178..63de457d7d 100644
--- a/plugins/module_utils/_mount.py
+++ b/plugins/module_utils/_mount.py
@@ -2,52 +2,11 @@
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is based on
# Lib/posixpath.py of cpython
+#
+# Copyright (c) 2001-2022 Python Software Foundation. All rights reserved.
# It is licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
-#
-# 1. This LICENSE AGREEMENT is between the Python Software Foundation
-# ("PSF"), and the Individual or Organization ("Licensee") accessing and
-# otherwise using this software ("Python") in source or binary form and
-# its associated documentation.
-#
-# 2. Subject to the terms and conditions of this License Agreement, PSF hereby
-# grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
-# analyze, test, perform and/or display publicly, prepare derivative works,
-# distribute, and otherwise use Python alone or in any derivative version,
-# provided, however, that PSF's License Agreement and PSF's notice of copyright,
-# i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-# 2011, 2012, 2013, 2014, 2015 Python Software Foundation; All Rights Reserved"
-# are retained in Python alone or in any derivative version prepared by Licensee.
-#
-# 3. In the event Licensee prepares a derivative work that is based on
-# or incorporates Python or any part thereof, and wants to make
-# the derivative work available to others as provided herein, then
-# Licensee hereby agrees to include in any such work a brief summary of
-# the changes made to Python.
-#
-# 4. PSF is making Python available to Licensee on an "AS IS"
-# basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
-# IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
-# DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
-# FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
-# INFRINGE ANY THIRD PARTY RIGHTS.
-#
-# 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
-# FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
-# A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
-# OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
-#
-# 6. This License Agreement will automatically terminate upon a material
-# breach of its terms and conditions.
-#
-# 7. Nothing in this License Agreement shall be deemed to create any
-# relationship of agency, partnership, or joint venture between PSF and
-# Licensee. This License Agreement does not grant permission to use PSF
-# trademarks or trade name in a trademark sense to endorse or promote
-# products or services of Licensee, or any third party.
-#
-# 8. By copying, installing or otherwise using Python, Licensee
-# agrees to be bound by the terms and conditions of this License
-# Agreement.
+# (See LICENSES/PSF-2.0.txt in this collection)
+# SPDX-License-Identifier: PSF-2.0
from __future__ import absolute_import, division, print_function
diff --git a/plugins/module_utils/alicloud_ecs.py b/plugins/module_utils/alicloud_ecs.py
index d4d3bf76c9..8532d25c1c 100644
--- a/plugins/module_utils/alicloud_ecs.py
+++ b/plugins/module_utils/alicloud_ecs.py
@@ -7,7 +7,8 @@
#
# Copyright (c) 2017-present Alibaba Group Holding Limited. He Guimin
#
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/module_utils/cloud.py b/plugins/module_utils/cloud.py
index 7619023a3c..092fe16ada 100644
--- a/plugins/module_utils/cloud.py
+++ b/plugins/module_utils/cloud.py
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
#
-# (c) 2016 Allen Sanabria,
-#
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2016 Allen Sanabria,
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/module_utils/cmd_runner.py b/plugins/module_utils/cmd_runner.py
index 8048ed25ca..141a6be9b2 100644
--- a/plugins/module_utils/cmd_runner.py
+++ b/plugins/module_utils/cmd_runner.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-# (c) 2022, Alexei Znamensky
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2022, Alexei Znamensky
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
__metaclass__ = type
@@ -191,13 +192,13 @@ 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:
self.arg_formats[mod_param_name] = _Format.as_default_type(spec['type'], mod_param_name)
- def context(self, args_order=None, output_process=None, ignore_value_none=True, **kwargs):
+ def __call__(self, args_order=None, output_process=None, ignore_value_none=True, check_mode_skip=False, check_mode_return=None, **kwargs):
if output_process is None:
output_process = _process_as_is
if args_order is None:
@@ -209,18 +210,25 @@ class CmdRunner(object):
return _CmdRunnerContext(runner=self,
args_order=args_order,
output_process=output_process,
- ignore_value_none=ignore_value_none, **kwargs)
+ ignore_value_none=ignore_value_none,
+ check_mode_skip=check_mode_skip,
+ check_mode_return=check_mode_return, **kwargs)
def has_arg_format(self, arg):
return arg in self.arg_formats
+ # not decided whether to keep it or not, but if deprecating it will happen in a farther future.
+ context = __call__
+
class _CmdRunnerContext(object):
- def __init__(self, runner, args_order, output_process, ignore_value_none, **kwargs):
+ def __init__(self, runner, args_order, output_process, ignore_value_none, check_mode_skip, check_mode_return, **kwargs):
self.runner = runner
self.args_order = tuple(args_order)
self.output_process = output_process
self.ignore_value_none = ignore_value_none
+ self.check_mode_skip = check_mode_skip
+ self.check_mode_return = check_mode_return
self.run_command_args = dict(kwargs)
self.environ_update = runner.environ_update
@@ -260,6 +268,8 @@ class _CmdRunnerContext(object):
except Exception as e:
raise FormatError(arg_name, value, runner.arg_formats[arg_name], e)
+ if self.check_mode_skip and module.check_mode:
+ return self.check_mode_return
results = module.run_command(self.cmd, **self.run_command_args)
self.results_rc, self.results_out, self.results_err = results
self.results_processed = self.output_process(*results)
@@ -288,4 +298,12 @@ class _CmdRunnerContext(object):
return False
-fmt = _Format()
+cmd_runner_fmt = _Format()
+
+#
+# The fmt form is deprecated and will be removed in community.general 7.0.0
+# Please use:
+# cmd_runner_fmt
+# Or, to retain the same effect, use:
+# from ansible_collections.community.general.plugins.module_utils.cmd_runner import cmd_runner_fmt as fmt
+fmt = cmd_runner_fmt
diff --git a/plugins/module_utils/csv.py b/plugins/module_utils/csv.py
index 86c4694524..50d2cb3868 100644
--- a/plugins/module_utils/csv.py
+++ b/plugins/module_utils/csv.py
@@ -1,8 +1,9 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2021, Andrew Pantuso (@ajpantuso)
-# Copyright: (c) 2018, Dag Wieers (@dagwieers)
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2021, Andrew Pantuso (@ajpantuso)
+# Copyright (c) 2018, Dag Wieers (@dagwieers)
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
__metaclass__ = type
diff --git a/plugins/module_utils/database.py b/plugins/module_utils/database.py
index 825d3a2be9..db1dc9c23d 100644
--- a/plugins/module_utils/database.py
+++ b/plugins/module_utils/database.py
@@ -7,7 +7,8 @@
#
# Copyright (c) 2014, Toshio Kuratomi
#
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/module_utils/dimensiondata.py b/plugins/module_utils/dimensiondata.py
index bcb02e8476..308615bfe4 100644
--- a/plugins/module_utils/dimensiondata.py
+++ b/plugins/module_utils/dimensiondata.py
@@ -2,7 +2,8 @@
#
# Copyright (c) 2016 Dimension Data
#
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
#
# Authors:
# - Aimon Bustardo
diff --git a/plugins/module_utils/gandi_livedns_api.py b/plugins/module_utils/gandi_livedns_api.py
index 2c785353ad..53245d44d0 100644
--- a/plugins/module_utils/gandi_livedns_api.py
+++ b/plugins/module_utils/gandi_livedns_api.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2019 Gregory Thiemonge
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Copyright (c) 2019 Gregory Thiemonge
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import absolute_import, division, print_function
__metaclass__ = type
diff --git a/plugins/module_utils/gconftool2.py b/plugins/module_utils/gconftool2.py
new file mode 100644
index 0000000000..cd9de57695
--- /dev/null
+++ b/plugins/module_utils/gconftool2.py
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2022, Alexei Znamensky
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+from __future__ import absolute_import, division, print_function
+__metaclass__ = type
+
+from ansible_collections.community.general.plugins.module_utils.cmd_runner import CmdRunner, cmd_runner_fmt as fmt
+
+
+def gconftool2_runner(module, **kwargs):
+ return CmdRunner(
+ module,
+ command='gconftool-2',
+ arg_formats=dict(
+ key=fmt.as_list(),
+ value_type=fmt.as_opt_val("--type"),
+ value=fmt.as_list(),
+ direct=fmt.as_bool("--direct"),
+ config_source=fmt.as_opt_val("--config-source"),
+ get=fmt.as_bool("--get"),
+ set_arg=fmt.as_bool("--set"),
+ unset=fmt.as_bool("--unset"),
+ ),
+ **kwargs
+ )
diff --git a/plugins/module_utils/gitlab.py b/plugins/module_utils/gitlab.py
index 21af10b5cd..d3c74f5c3b 100644
--- a/plugins/module_utils/gitlab.py
+++ b/plugins/module_utils/gitlab.py
@@ -1,8 +1,9 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr)
-# Copyright: (c) 2018, Marcus Watkins
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr)
+# Copyright (c) 2018, Marcus Watkins
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/module_utils/heroku.py b/plugins/module_utils/heroku.py
index 70b144c077..f5ed3e2b89 100644
--- a/plugins/module_utils/heroku.py
+++ b/plugins/module_utils/heroku.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2018, Ansible Project
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Copyright (c) 2018, Ansible Project
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import absolute_import, division, print_function
__metaclass__ = type
diff --git a/plugins/module_utils/hwc_utils.py b/plugins/module_utils/hwc_utils.py
index 489e90dd3c..a21cc8e48f 100644
--- a/plugins/module_utils/hwc_utils.py
+++ b/plugins/module_utils/hwc_utils.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (c), Google Inc, 2017
-# Simplified BSD License (see licenses/simplified_bsd.txt or
-# https://opensource.org/licenses/BSD-2-Clause)
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
@@ -351,7 +351,7 @@ def wait_to_finish(target, pending, refresh, timeout, min_interval=1, delay=3):
if pending and status not in pending:
raise HwcModuleException(
- "unexpect status(%s) occured" % status)
+ "unexpect status(%s) occurred" % status)
if not is_last_time:
wait *= 2
diff --git a/plugins/module_utils/ibm_sa_utils.py b/plugins/module_utils/ibm_sa_utils.py
index 4f70f844cd..abbb57f520 100644
--- a/plugins/module_utils/ibm_sa_utils.py
+++ b/plugins/module_utils/ibm_sa_utils.py
@@ -2,7 +2,8 @@
# Copyright (C) 2018 IBM CORPORATION
# Author(s): Tzur Eliyahu
#
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import absolute_import, division, print_function
__metaclass__ = type
diff --git a/plugins/module_utils/identity/keycloak/keycloak.py b/plugins/module_utils/identity/keycloak/keycloak.py
index 8051c946e2..1769d6c48f 100644
--- a/plugins/module_utils/identity/keycloak/keycloak.py
+++ b/plugins/module_utils/identity/keycloak/keycloak.py
@@ -1,30 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017, Eike Frost
-#
-# This code is part of Ansible, but is an independent component.
-# This particular file snippet, and this file snippet only, is BSD licensed.
-# Modules you write using this snippet, which is embedded dynamically by Ansible
-# still belong to the author of the module, and may assign their own license
-# to the complete work.
-#
-# Redistribution and use in source and binary forms, with or without modification,
-# are permitted provided that the following conditions are met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following disclaimer in the documentation
-# and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
-# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# BSD 2-Clause license (see LICENSES/BSD-2-Clause.txt)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import absolute_import, division, print_function
@@ -104,6 +81,7 @@ def keycloak_argument_spec():
validate_certs=dict(type='bool', default=True),
connection_timeout=dict(type='int', default=10),
token=dict(type='str', no_log=True),
+ http_agent=dict(type='str', default='Ansible'),
)
@@ -123,6 +101,7 @@ def get_token(module_params):
"""
token = module_params.get('token')
base_url = module_params.get('auth_keycloak_url')
+ http_agent = module_params.get('http_agent')
if not base_url.lower().startswith(('http', 'https')):
raise KeycloakError("auth_url '%s' should either start with 'http' or 'https'." % base_url)
@@ -149,7 +128,7 @@ def get_token(module_params):
(k, v) for k, v in temp_payload.items() if v is not None)
try:
r = json.loads(to_native(open_url(auth_url, method='POST',
- validate_certs=validate_certs, timeout=connection_timeout,
+ validate_certs=validate_certs, http_agent=http_agent, timeout=connection_timeout,
data=urlencode(payload)).read()))
except ValueError as e:
raise KeycloakError(
@@ -233,6 +212,7 @@ class KeycloakAPI(object):
self.validate_certs = self.module.params.get('validate_certs')
self.connection_timeout = self.module.params.get('connection_timeout')
self.restheaders = connection_header
+ self.http_agent = self.module.params.get('http_agent')
def get_realm_info_by_id(self, realm='master'):
""" Obtain realm public info by id
@@ -243,7 +223,8 @@ class KeycloakAPI(object):
realm_info_url = URL_REALM_INFO.format(url=self.baseurl, realm=realm)
try:
- return json.loads(to_native(open_url(realm_info_url, method='GET', headers=self.restheaders, timeout=self.connection_timeout,
+ return json.loads(to_native(open_url(realm_info_url, method='GET', http_agent=self.http_agent, headers=self.restheaders,
+ timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except HTTPError as e:
@@ -268,7 +249,7 @@ class KeycloakAPI(object):
realm_url = URL_REALM.format(url=self.baseurl, realm=realm)
try:
- return json.loads(to_native(open_url(realm_url, method='GET', headers=self.restheaders, timeout=self.connection_timeout,
+ return json.loads(to_native(open_url(realm_url, method='GET', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except HTTPError as e:
@@ -293,7 +274,7 @@ class KeycloakAPI(object):
realm_url = URL_REALM.format(url=self.baseurl, realm=realm)
try:
- return open_url(realm_url, method='PUT', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(realm_url, method='PUT', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
data=json.dumps(realmrep), validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Could not update realm %s: %s' % (realm, str(e)),
@@ -307,7 +288,7 @@ class KeycloakAPI(object):
realm_url = URL_REALMS.format(url=self.baseurl)
try:
- return open_url(realm_url, method='POST', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(realm_url, method='POST', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
data=json.dumps(realmrep), validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Could not create realm %s: %s' % (realmrep['id'], str(e)),
@@ -322,7 +303,7 @@ class KeycloakAPI(object):
realm_url = URL_REALM.format(url=self.baseurl, realm=realm)
try:
- return open_url(realm_url, method='DELETE', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(realm_url, method='DELETE', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Could not delete realm %s: %s' % (realm, str(e)),
@@ -340,7 +321,8 @@ class KeycloakAPI(object):
clientlist_url += '?clientId=%s' % filter
try:
- return json.loads(to_native(open_url(clientlist_url, method='GET', headers=self.restheaders, timeout=self.connection_timeout,
+ return json.loads(to_native(open_url(clientlist_url, http_agent=self.http_agent, method='GET', headers=self.restheaders,
+ timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except ValueError as e:
self.module.fail_json(msg='API returned incorrect JSON when trying to obtain list of clients for realm %s: %s'
@@ -371,7 +353,8 @@ class KeycloakAPI(object):
client_url = URL_CLIENT.format(url=self.baseurl, realm=realm, id=id)
try:
- return json.loads(to_native(open_url(client_url, method='GET', headers=self.restheaders, timeout=self.connection_timeout,
+ return json.loads(to_native(open_url(client_url, method='GET', http_agent=self.http_agent, headers=self.restheaders,
+ timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except HTTPError as e:
@@ -410,7 +393,7 @@ class KeycloakAPI(object):
client_url = URL_CLIENT.format(url=self.baseurl, realm=realm, id=id)
try:
- return open_url(client_url, method='PUT', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(client_url, method='PUT', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
data=json.dumps(clientrep), validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Could not update client %s in realm %s: %s'
@@ -425,7 +408,7 @@ class KeycloakAPI(object):
client_url = URL_CLIENTS.format(url=self.baseurl, realm=realm)
try:
- return open_url(client_url, method='POST', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(client_url, method='POST', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
data=json.dumps(clientrep), validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Could not create client %s in realm %s: %s'
@@ -441,7 +424,7 @@ class KeycloakAPI(object):
client_url = URL_CLIENT.format(url=self.baseurl, realm=realm, id=id)
try:
- return open_url(client_url, method='DELETE', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(client_url, method='DELETE', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Could not delete client %s in realm %s: %s'
@@ -456,7 +439,8 @@ class KeycloakAPI(object):
"""
client_roles_url = URL_CLIENT_ROLES.format(url=self.baseurl, realm=realm, id=cid)
try:
- return json.loads(to_native(open_url(client_roles_url, method="GET", headers=self.restheaders, timeout=self.connection_timeout,
+ return json.loads(to_native(open_url(client_roles_url, method="GET", http_agent=self.http_agent, headers=self.restheaders,
+ timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except Exception as e:
self.module.fail_json(msg="Could not fetch rolemappings for client %s in realm %s: %s"
@@ -488,7 +472,8 @@ class KeycloakAPI(object):
"""
rolemappings_url = URL_CLIENT_ROLEMAPPINGS.format(url=self.baseurl, realm=realm, id=gid, client=cid)
try:
- rolemappings = json.loads(to_native(open_url(rolemappings_url, method="GET", headers=self.restheaders, timeout=self.connection_timeout,
+ rolemappings = json.loads(to_native(open_url(rolemappings_url, method="GET", http_agent=self.http_agent, headers=self.restheaders,
+ timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
for role in rolemappings:
if rid == role['id']:
@@ -508,7 +493,8 @@ class KeycloakAPI(object):
"""
available_rolemappings_url = URL_CLIENT_ROLEMAPPINGS_AVAILABLE.format(url=self.baseurl, realm=realm, id=gid, client=cid)
try:
- return json.loads(to_native(open_url(available_rolemappings_url, method="GET", headers=self.restheaders, timeout=self.connection_timeout,
+ return json.loads(to_native(open_url(available_rolemappings_url, method="GET", http_agent=self.http_agent, headers=self.restheaders,
+ timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except Exception as e:
self.module.fail_json(msg="Could not fetch available rolemappings for client %s in group %s, realm %s: %s"
@@ -524,7 +510,8 @@ class KeycloakAPI(object):
"""
available_rolemappings_url = URL_CLIENT_ROLEMAPPINGS_COMPOSITE.format(url=self.baseurl, realm=realm, id=gid, client=cid)
try:
- return json.loads(to_native(open_url(available_rolemappings_url, method="GET", headers=self.restheaders, timeout=self.connection_timeout,
+ return json.loads(to_native(open_url(available_rolemappings_url, method="GET", http_agent=self.http_agent, headers=self.restheaders,
+ timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except Exception as e:
self.module.fail_json(msg="Could not fetch available rolemappings for client %s in group %s, realm %s: %s"
@@ -541,7 +528,7 @@ class KeycloakAPI(object):
"""
available_rolemappings_url = URL_CLIENT_ROLEMAPPINGS.format(url=self.baseurl, realm=realm, id=gid, client=cid)
try:
- open_url(available_rolemappings_url, method="POST", headers=self.restheaders, data=json.dumps(role_rep),
+ open_url(available_rolemappings_url, method="POST", http_agent=self.http_agent, headers=self.restheaders, data=json.dumps(role_rep),
validate_certs=self.validate_certs, timeout=self.connection_timeout)
except Exception as e:
self.module.fail_json(msg="Could not fetch available rolemappings for client %s in group %s, realm %s: %s"
@@ -558,7 +545,7 @@ class KeycloakAPI(object):
"""
available_rolemappings_url = URL_CLIENT_ROLEMAPPINGS.format(url=self.baseurl, realm=realm, id=gid, client=cid)
try:
- open_url(available_rolemappings_url, method="DELETE", headers=self.restheaders,
+ open_url(available_rolemappings_url, method="DELETE", http_agent=self.http_agent, headers=self.restheaders,
validate_certs=self.validate_certs, timeout=self.connection_timeout)
except Exception as e:
self.module.fail_json(msg="Could not delete available rolemappings for client %s in group %s, realm %s: %s"
@@ -573,7 +560,7 @@ class KeycloakAPI(object):
url = URL_CLIENTTEMPLATES.format(url=self.baseurl, realm=realm)
try:
- return json.loads(to_native(open_url(url, method='GET', headers=self.restheaders, timeout=self.connection_timeout,
+ return json.loads(to_native(open_url(url, method='GET', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except ValueError as e:
self.module.fail_json(msg='API returned incorrect JSON when trying to obtain list of client templates for realm %s: %s'
@@ -592,7 +579,7 @@ class KeycloakAPI(object):
url = URL_CLIENTTEMPLATE.format(url=self.baseurl, id=id, realm=realm)
try:
- return json.loads(to_native(open_url(url, method='GET', headers=self.restheaders, timeout=self.connection_timeout,
+ return json.loads(to_native(open_url(url, method='GET', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except ValueError as e:
self.module.fail_json(msg='API returned incorrect JSON when trying to obtain client templates %s for realm %s: %s'
@@ -638,7 +625,7 @@ class KeycloakAPI(object):
url = URL_CLIENTTEMPLATE.format(url=self.baseurl, realm=realm, id=id)
try:
- return open_url(url, method='PUT', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(url, method='PUT', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
data=json.dumps(clienttrep), validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Could not update client template %s in realm %s: %s'
@@ -653,7 +640,7 @@ class KeycloakAPI(object):
url = URL_CLIENTTEMPLATES.format(url=self.baseurl, realm=realm)
try:
- return open_url(url, method='POST', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(url, method='POST', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
data=json.dumps(clienttrep), validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Could not create client template %s in realm %s: %s'
@@ -669,7 +656,7 @@ class KeycloakAPI(object):
url = URL_CLIENTTEMPLATE.format(url=self.baseurl, realm=realm, id=id)
try:
- return open_url(url, method='DELETE', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(url, method='DELETE', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Could not delete client template %s in realm %s: %s'
@@ -686,7 +673,8 @@ class KeycloakAPI(object):
"""
clientscopes_url = URL_CLIENTSCOPES.format(url=self.baseurl, realm=realm)
try:
- return json.loads(to_native(open_url(clientscopes_url, method="GET", headers=self.restheaders, timeout=self.connection_timeout,
+ return json.loads(to_native(open_url(clientscopes_url, method="GET", http_agent=self.http_agent, headers=self.restheaders,
+ timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except Exception as e:
self.module.fail_json(msg="Could not fetch list of clientscopes in realm %s: %s"
@@ -703,7 +691,8 @@ class KeycloakAPI(object):
"""
clientscope_url = URL_CLIENTSCOPE.format(url=self.baseurl, realm=realm, id=cid)
try:
- return json.loads(to_native(open_url(clientscope_url, method="GET", headers=self.restheaders, timeout=self.connection_timeout,
+ return json.loads(to_native(open_url(clientscope_url, method="GET", http_agent=self.http_agent, headers=self.restheaders,
+ timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except HTTPError as e:
@@ -748,7 +737,7 @@ class KeycloakAPI(object):
"""
clientscopes_url = URL_CLIENTSCOPES.format(url=self.baseurl, realm=realm)
try:
- return open_url(clientscopes_url, method='POST', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(clientscopes_url, method='POST', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
data=json.dumps(clientscoperep), validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg="Could not create clientscope %s in realm %s: %s"
@@ -763,7 +752,7 @@ class KeycloakAPI(object):
clientscope_url = URL_CLIENTSCOPE.format(url=self.baseurl, realm=realm, id=clientscoperep['id'])
try:
- return open_url(clientscope_url, method='PUT', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(clientscope_url, method='PUT', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
data=json.dumps(clientscoperep), validate_certs=self.validate_certs)
except Exception as e:
@@ -801,7 +790,7 @@ class KeycloakAPI(object):
# should have a good cid by here.
clientscope_url = URL_CLIENTSCOPE.format(realm=realm, id=cid, url=self.baseurl)
try:
- return open_url(clientscope_url, method='DELETE', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(clientscope_url, method='DELETE', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
validate_certs=self.validate_certs)
except Exception as e:
@@ -819,7 +808,8 @@ class KeycloakAPI(object):
"""
protocolmappers_url = URL_CLIENTSCOPE_PROTOCOLMAPPERS.format(id=cid, url=self.baseurl, realm=realm)
try:
- return json.loads(to_native(open_url(protocolmappers_url, method="GET", headers=self.restheaders, timeout=self.connection_timeout,
+ return json.loads(to_native(open_url(protocolmappers_url, method="GET", http_agent=self.http_agent, headers=self.restheaders,
+ timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except Exception as e:
self.module.fail_json(msg="Could not fetch list of protocolmappers in realm %s: %s"
@@ -838,7 +828,8 @@ class KeycloakAPI(object):
"""
protocolmapper_url = URL_CLIENTSCOPE_PROTOCOLMAPPER.format(url=self.baseurl, realm=realm, id=cid, mapper_id=pid)
try:
- return json.loads(to_native(open_url(protocolmapper_url, method="GET", headers=self.restheaders, timeout=self.connection_timeout,
+ return json.loads(to_native(open_url(protocolmapper_url, method="GET", http_agent=self.http_agent, headers=self.restheaders,
+ timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except HTTPError as e:
@@ -885,7 +876,7 @@ class KeycloakAPI(object):
"""
protocolmappers_url = URL_CLIENTSCOPE_PROTOCOLMAPPERS.format(url=self.baseurl, id=cid, realm=realm)
try:
- return open_url(protocolmappers_url, method='POST', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(protocolmappers_url, method='POST', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
data=json.dumps(mapper_rep), validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg="Could not create protocolmapper %s in realm %s: %s"
@@ -901,7 +892,7 @@ class KeycloakAPI(object):
protocolmapper_url = URL_CLIENTSCOPE_PROTOCOLMAPPER.format(url=self.baseurl, realm=realm, id=cid, mapper_id=mapper_rep['id'])
try:
- return open_url(protocolmapper_url, method='PUT', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(protocolmapper_url, method='PUT', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
data=json.dumps(mapper_rep), validate_certs=self.validate_certs)
except Exception as e:
@@ -918,7 +909,8 @@ class KeycloakAPI(object):
"""
groups_url = URL_GROUPS.format(url=self.baseurl, realm=realm)
try:
- return json.loads(to_native(open_url(groups_url, method="GET", headers=self.restheaders, timeout=self.connection_timeout,
+ return json.loads(to_native(open_url(groups_url, method="GET", http_agent=self.http_agent, headers=self.restheaders,
+ timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except Exception as e:
self.module.fail_json(msg="Could not fetch list of groups in realm %s: %s"
@@ -935,7 +927,8 @@ class KeycloakAPI(object):
"""
groups_url = URL_GROUP.format(url=self.baseurl, realm=realm, groupid=gid)
try:
- return json.loads(to_native(open_url(groups_url, method="GET", headers=self.restheaders, timeout=self.connection_timeout,
+ return json.loads(to_native(open_url(groups_url, method="GET", http_agent=self.http_agent, headers=self.restheaders,
+ timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except HTTPError as e:
@@ -981,7 +974,7 @@ class KeycloakAPI(object):
"""
groups_url = URL_GROUPS.format(url=self.baseurl, realm=realm)
try:
- return open_url(groups_url, method='POST', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(groups_url, method='POST', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
data=json.dumps(grouprep), validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg="Could not create group %s in realm %s: %s"
@@ -996,7 +989,7 @@ class KeycloakAPI(object):
group_url = URL_GROUP.format(url=self.baseurl, realm=realm, groupid=grouprep['id'])
try:
- return open_url(group_url, method='PUT', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(group_url, method='PUT', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
data=json.dumps(grouprep), validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Could not update group %s in realm %s: %s'
@@ -1033,7 +1026,7 @@ class KeycloakAPI(object):
# should have a good groupid by here.
group_url = URL_GROUP.format(realm=realm, groupid=groupid, url=self.baseurl)
try:
- return open_url(group_url, method='DELETE', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(group_url, method='DELETE', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg="Unable to delete group %s: %s" % (groupid, str(e)))
@@ -1046,7 +1039,8 @@ class KeycloakAPI(object):
"""
rolelist_url = URL_REALM_ROLES.format(url=self.baseurl, realm=realm)
try:
- return json.loads(to_native(open_url(rolelist_url, method='GET', headers=self.restheaders, timeout=self.connection_timeout,
+ return json.loads(to_native(open_url(rolelist_url, method='GET', http_agent=self.http_agent, headers=self.restheaders,
+ timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except ValueError as e:
self.module.fail_json(msg='API returned incorrect JSON when trying to obtain list of roles for realm %s: %s'
@@ -1064,7 +1058,7 @@ class KeycloakAPI(object):
"""
role_url = URL_REALM_ROLE.format(url=self.baseurl, realm=realm, name=quote(name))
try:
- return json.loads(to_native(open_url(role_url, method="GET", headers=self.restheaders, timeout=self.connection_timeout,
+ return json.loads(to_native(open_url(role_url, method="GET", http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except HTTPError as e:
if e.code == 404:
@@ -1084,7 +1078,7 @@ class KeycloakAPI(object):
"""
roles_url = URL_REALM_ROLES.format(url=self.baseurl, realm=realm)
try:
- return open_url(roles_url, method='POST', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(roles_url, method='POST', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
data=json.dumps(rolerep), validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Could not create role %s in realm %s: %s'
@@ -1098,7 +1092,7 @@ class KeycloakAPI(object):
"""
role_url = URL_REALM_ROLE.format(url=self.baseurl, realm=realm, name=quote(rolerep['name']))
try:
- return open_url(role_url, method='PUT', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(role_url, method='PUT', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
data=json.dumps(rolerep), validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Could not update role %s in realm %s: %s'
@@ -1112,7 +1106,7 @@ class KeycloakAPI(object):
"""
role_url = URL_REALM_ROLE.format(url=self.baseurl, realm=realm, name=quote(name))
try:
- return open_url(role_url, method='DELETE', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(role_url, method='DELETE', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Unable to delete role %s in realm %s: %s'
@@ -1131,7 +1125,8 @@ class KeycloakAPI(object):
% (clientid, realm))
rolelist_url = URL_CLIENT_ROLES.format(url=self.baseurl, realm=realm, id=cid)
try:
- return json.loads(to_native(open_url(rolelist_url, method='GET', headers=self.restheaders, timeout=self.connection_timeout,
+ return json.loads(to_native(open_url(rolelist_url, method='GET', http_agent=self.http_agent, headers=self.restheaders,
+ timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except ValueError as e:
self.module.fail_json(msg='API returned incorrect JSON when trying to obtain list of roles for client %s in realm %s: %s'
@@ -1155,7 +1150,7 @@ class KeycloakAPI(object):
% (clientid, realm))
role_url = URL_CLIENT_ROLE.format(url=self.baseurl, realm=realm, id=cid, name=quote(name))
try:
- return json.loads(to_native(open_url(role_url, method="GET", headers=self.restheaders, timeout=self.connection_timeout,
+ return json.loads(to_native(open_url(role_url, method="GET", http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except HTTPError as e:
if e.code == 404:
@@ -1181,7 +1176,7 @@ class KeycloakAPI(object):
% (clientid, realm))
roles_url = URL_CLIENT_ROLES.format(url=self.baseurl, realm=realm, id=cid)
try:
- return open_url(roles_url, method='POST', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(roles_url, method='POST', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
data=json.dumps(rolerep), validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Could not create role %s for client %s in realm %s: %s'
@@ -1201,7 +1196,7 @@ class KeycloakAPI(object):
% (clientid, realm))
role_url = URL_CLIENT_ROLE.format(url=self.baseurl, realm=realm, id=cid, name=quote(rolerep['name']))
try:
- return open_url(role_url, method='PUT', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(role_url, method='PUT', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
data=json.dumps(rolerep), validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Could not update role %s for client %s in realm %s: %s'
@@ -1220,7 +1215,7 @@ class KeycloakAPI(object):
% (clientid, realm))
role_url = URL_CLIENT_ROLE.format(url=self.baseurl, realm=realm, id=cid, name=quote(name))
try:
- return open_url(role_url, method='DELETE', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(role_url, method='DELETE', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Unable to delete role %s for client %s in realm %s: %s'
@@ -1237,7 +1232,8 @@ class KeycloakAPI(object):
authentication_flow = {}
# Check if the authentication flow exists on the Keycloak serveraders
authentications = json.load(open_url(URL_AUTHENTICATION_FLOWS.format(url=self.baseurl, realm=realm), method='GET',
- headers=self.restheaders, timeout=self.connection_timeout, validate_certs=self.validate_certs))
+ http_agent=self.http_agent, headers=self.restheaders,
+ timeout=self.connection_timeout, validate_certs=self.validate_certs))
for authentication in authentications:
if authentication["alias"] == alias:
authentication_flow = authentication
@@ -1256,7 +1252,7 @@ class KeycloakAPI(object):
flow_url = URL_AUTHENTICATION_FLOW.format(url=self.baseurl, realm=realm, id=id)
try:
- return open_url(flow_url, method='DELETE', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(flow_url, method='DELETE', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Could not delete authentication flow %s in realm %s: %s'
@@ -1279,7 +1275,7 @@ class KeycloakAPI(object):
realm=realm,
copyfrom=quote(config["copyFrom"])),
method='POST',
- headers=self.restheaders,
+ http_agent=self.http_agent, headers=self.restheaders,
data=json.dumps(new_name),
timeout=self.connection_timeout,
validate_certs=self.validate_certs)
@@ -1288,7 +1284,7 @@ class KeycloakAPI(object):
URL_AUTHENTICATION_FLOWS.format(url=self.baseurl,
realm=realm),
method='GET',
- headers=self.restheaders,
+ http_agent=self.http_agent, headers=self.restheaders,
timeout=self.connection_timeout,
validate_certs=self.validate_certs))
for flow in flow_list:
@@ -1318,7 +1314,7 @@ class KeycloakAPI(object):
url=self.baseurl,
realm=realm),
method='POST',
- headers=self.restheaders,
+ http_agent=self.http_agent, headers=self.restheaders,
data=json.dumps(new_flow),
timeout=self.connection_timeout,
validate_certs=self.validate_certs)
@@ -1328,7 +1324,7 @@ class KeycloakAPI(object):
url=self.baseurl,
realm=realm),
method='GET',
- headers=self.restheaders,
+ http_agent=self.http_agent, headers=self.restheaders,
timeout=self.connection_timeout,
validate_certs=self.validate_certs))
for flow in flow_list:
@@ -1353,7 +1349,7 @@ class KeycloakAPI(object):
realm=realm,
flowalias=quote(flowAlias)),
method='PUT',
- headers=self.restheaders,
+ http_agent=self.http_agent, headers=self.restheaders,
data=json.dumps(updatedExec),
timeout=self.connection_timeout,
validate_certs=self.validate_certs)
@@ -1374,7 +1370,7 @@ class KeycloakAPI(object):
realm=realm,
id=executionId),
method='POST',
- headers=self.restheaders,
+ http_agent=self.http_agent, headers=self.restheaders,
data=json.dumps(authenticationConfig),
timeout=self.connection_timeout,
validate_certs=self.validate_certs)
@@ -1399,7 +1395,7 @@ class KeycloakAPI(object):
realm=realm,
flowalias=quote(flowAlias)),
method='POST',
- headers=self.restheaders,
+ http_agent=self.http_agent, headers=self.restheaders,
data=json.dumps(newSubFlow),
timeout=self.connection_timeout,
validate_certs=self.validate_certs)
@@ -1423,7 +1419,7 @@ class KeycloakAPI(object):
realm=realm,
flowalias=quote(flowAlias)),
method='POST',
- headers=self.restheaders,
+ http_agent=self.http_agent, headers=self.restheaders,
data=json.dumps(newExec),
timeout=self.connection_timeout,
validate_certs=self.validate_certs)
@@ -1447,7 +1443,7 @@ class KeycloakAPI(object):
realm=realm,
id=executionId),
method='POST',
- headers=self.restheaders,
+ http_agent=self.http_agent, headers=self.restheaders,
timeout=self.connection_timeout,
validate_certs=self.validate_certs)
elif diff < 0:
@@ -1458,7 +1454,7 @@ class KeycloakAPI(object):
realm=realm,
id=executionId),
method='POST',
- headers=self.restheaders,
+ http_agent=self.http_agent, headers=self.restheaders,
timeout=self.connection_timeout,
validate_certs=self.validate_certs)
except Exception as e:
@@ -1480,7 +1476,7 @@ class KeycloakAPI(object):
realm=realm,
flowalias=quote(config["alias"])),
method='GET',
- headers=self.restheaders,
+ http_agent=self.http_agent, headers=self.restheaders,
timeout=self.connection_timeout,
validate_certs=self.validate_certs))
for execution in executions:
@@ -1493,7 +1489,7 @@ class KeycloakAPI(object):
realm=realm,
id=execConfigId),
method='GET',
- headers=self.restheaders,
+ http_agent=self.http_agent, headers=self.restheaders,
timeout=self.connection_timeout,
validate_certs=self.validate_certs))
execution["authenticationConfig"] = execConfig
@@ -1509,7 +1505,7 @@ class KeycloakAPI(object):
"""
idps_url = URL_IDENTITY_PROVIDERS.format(url=self.baseurl, realm=realm)
try:
- return json.loads(to_native(open_url(idps_url, method='GET', headers=self.restheaders, timeout=self.connection_timeout,
+ return json.loads(to_native(open_url(idps_url, method='GET', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except ValueError as e:
self.module.fail_json(msg='API returned incorrect JSON when trying to obtain list of identity providers for realm %s: %s'
@@ -1526,7 +1522,7 @@ class KeycloakAPI(object):
"""
idp_url = URL_IDENTITY_PROVIDER.format(url=self.baseurl, realm=realm, alias=alias)
try:
- return json.loads(to_native(open_url(idp_url, method="GET", headers=self.restheaders, timeout=self.connection_timeout,
+ return json.loads(to_native(open_url(idp_url, method="GET", http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except HTTPError as e:
if e.code == 404:
@@ -1546,7 +1542,7 @@ class KeycloakAPI(object):
"""
idps_url = URL_IDENTITY_PROVIDERS.format(url=self.baseurl, realm=realm)
try:
- return open_url(idps_url, method='POST', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(idps_url, method='POST', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
data=json.dumps(idprep), validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Could not create identity provider %s in realm %s: %s'
@@ -1560,7 +1556,7 @@ class KeycloakAPI(object):
"""
idp_url = URL_IDENTITY_PROVIDER.format(url=self.baseurl, realm=realm, alias=idprep['alias'])
try:
- return open_url(idp_url, method='PUT', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(idp_url, method='PUT', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
data=json.dumps(idprep), validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Could not update identity provider %s in realm %s: %s'
@@ -1573,7 +1569,7 @@ class KeycloakAPI(object):
"""
idp_url = URL_IDENTITY_PROVIDER.format(url=self.baseurl, realm=realm, alias=alias)
try:
- return open_url(idp_url, method='DELETE', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(idp_url, method='DELETE', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Unable to delete identity provider %s in realm %s: %s'
@@ -1587,7 +1583,8 @@ class KeycloakAPI(object):
"""
mappers_url = URL_IDENTITY_PROVIDER_MAPPERS.format(url=self.baseurl, realm=realm, alias=alias)
try:
- return json.loads(to_native(open_url(mappers_url, method='GET', headers=self.restheaders, timeout=self.connection_timeout,
+ return json.loads(to_native(open_url(mappers_url, method='GET', http_agent=self.http_agent, headers=self.restheaders,
+ timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except ValueError as e:
self.module.fail_json(msg='API returned incorrect JSON when trying to obtain list of identity provider mappers for idp %s in realm %s: %s'
@@ -1605,7 +1602,8 @@ class KeycloakAPI(object):
"""
mapper_url = URL_IDENTITY_PROVIDER_MAPPER.format(url=self.baseurl, realm=realm, alias=alias, id=mid)
try:
- return json.loads(to_native(open_url(mapper_url, method="GET", headers=self.restheaders, timeout=self.connection_timeout,
+ return json.loads(to_native(open_url(mapper_url, method="GET", http_agent=self.http_agent, headers=self.restheaders,
+ timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except HTTPError as e:
if e.code == 404:
@@ -1626,7 +1624,7 @@ class KeycloakAPI(object):
"""
mappers_url = URL_IDENTITY_PROVIDER_MAPPERS.format(url=self.baseurl, realm=realm, alias=alias)
try:
- return open_url(mappers_url, method='POST', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(mappers_url, method='POST', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
data=json.dumps(mapper), validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Could not create identity provider mapper %s for idp %s in realm %s: %s'
@@ -1641,7 +1639,7 @@ class KeycloakAPI(object):
"""
mapper_url = URL_IDENTITY_PROVIDER_MAPPER.format(url=self.baseurl, realm=realm, alias=alias, id=mapper['id'])
try:
- return open_url(mapper_url, method='PUT', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(mapper_url, method='PUT', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
data=json.dumps(mapper), validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Could not update mapper %s for identity provider %s in realm %s: %s'
@@ -1655,7 +1653,7 @@ class KeycloakAPI(object):
"""
mapper_url = URL_IDENTITY_PROVIDER_MAPPER.format(url=self.baseurl, realm=realm, alias=alias, id=mid)
try:
- return open_url(mapper_url, method='DELETE', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(mapper_url, method='DELETE', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Unable to delete mapper %s for identity provider %s in realm %s: %s'
@@ -1672,7 +1670,7 @@ class KeycloakAPI(object):
comps_url += '?%s' % filter
try:
- return json.loads(to_native(open_url(comps_url, method='GET', headers=self.restheaders, timeout=self.connection_timeout,
+ return json.loads(to_native(open_url(comps_url, method='GET', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except ValueError as e:
self.module.fail_json(msg='API returned incorrect JSON when trying to obtain list of components for realm %s: %s'
@@ -1689,7 +1687,7 @@ class KeycloakAPI(object):
"""
comp_url = URL_COMPONENT.format(url=self.baseurl, realm=realm, id=cid)
try:
- return json.loads(to_native(open_url(comp_url, method="GET", headers=self.restheaders, timeout=self.connection_timeout,
+ return json.loads(to_native(open_url(comp_url, method="GET", http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except HTTPError as e:
if e.code == 404:
@@ -1709,13 +1707,13 @@ class KeycloakAPI(object):
"""
comps_url = URL_COMPONENTS.format(url=self.baseurl, realm=realm)
try:
- resp = open_url(comps_url, method='POST', headers=self.restheaders, timeout=self.connection_timeout,
+ resp = open_url(comps_url, method='POST', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
data=json.dumps(comprep), validate_certs=self.validate_certs)
comp_url = resp.getheader('Location')
if comp_url is None:
self.module.fail_json(msg='Could not create component in realm %s: %s'
% (realm, 'unexpected response'))
- return json.loads(to_native(open_url(comp_url, method="GET", headers=self.restheaders, timeout=self.connection_timeout,
+ return json.loads(to_native(open_url(comp_url, method="GET", http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
validate_certs=self.validate_certs).read()))
except Exception as e:
self.module.fail_json(msg='Could not create component in realm %s: %s'
@@ -1732,7 +1730,7 @@ class KeycloakAPI(object):
self.module.fail_json(msg='Cannot update component without id')
comp_url = URL_COMPONENT.format(url=self.baseurl, realm=realm, id=cid)
try:
- return open_url(comp_url, method='PUT', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(comp_url, method='PUT', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
data=json.dumps(comprep), validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Could not update component %s in realm %s: %s'
@@ -1745,7 +1743,7 @@ class KeycloakAPI(object):
"""
comp_url = URL_COMPONENT.format(url=self.baseurl, realm=realm, id=cid)
try:
- return open_url(comp_url, method='DELETE', headers=self.restheaders, timeout=self.connection_timeout,
+ return open_url(comp_url, method='DELETE', http_agent=self.http_agent, headers=self.restheaders, timeout=self.connection_timeout,
validate_certs=self.validate_certs)
except Exception as e:
self.module.fail_json(msg='Unable to delete component %s in realm %s: %s'
diff --git a/plugins/module_utils/ilo_redfish_utils.py b/plugins/module_utils/ilo_redfish_utils.py
index 04b08ae52f..2d4d999cef 100644
--- a/plugins/module_utils/ilo_redfish_utils.py
+++ b/plugins/module_utils/ilo_redfish_utils.py
@@ -1,7 +1,8 @@
# -*- 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
__metaclass__ = type
@@ -91,7 +92,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'])
diff --git a/plugins/module_utils/influxdb.py b/plugins/module_utils/influxdb.py
index c171131a95..9a30e76428 100644
--- a/plugins/module_utils/influxdb.py
+++ b/plugins/module_utils/influxdb.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2017, Ansible Project
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Copyright (c) 2017, Ansible Project
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import absolute_import, division, print_function
__metaclass__ = type
diff --git a/plugins/module_utils/ipa.py b/plugins/module_utils/ipa.py
index 3d8c2580d8..eda9b4132b 100644
--- a/plugins/module_utils/ipa.py
+++ b/plugins/module_utils/ipa.py
@@ -7,7 +7,8 @@
#
# Copyright (c) 2016 Thomas Krahn (@Nosmoht)
#
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/module_utils/known_hosts.py b/plugins/module_utils/known_hosts.py
index ea6c95b6e2..25dd3e174e 100644
--- a/plugins/module_utils/known_hosts.py
+++ b/plugins/module_utils/known_hosts.py
@@ -7,7 +7,8 @@
#
# Copyright (c), Michael DeHaan , 2012-2013
#
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/module_utils/ldap.py b/plugins/module_utils/ldap.py
index 30dbaf7640..daf89f16d1 100644
--- a/plugins/module_utils/ldap.py
+++ b/plugins/module_utils/ldap.py
@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2016, Peter Sagerson
-# Copyright: (c) 2016, Jiri Tyr
-# Copyright: (c) 2017-2018 Keller Fuchs (@KellerFuchs)
+# Copyright (c) 2016, Peter Sagerson
+# Copyright (c) 2016, Jiri Tyr
+# Copyright (c) 2017-2018 Keller Fuchs (@KellerFuchs)
#
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
__metaclass__ = type
diff --git a/plugins/module_utils/linode.py b/plugins/module_utils/linode.py
index 9d7c37e68d..cedd3e0d5c 100644
--- a/plugins/module_utils/linode.py
+++ b/plugins/module_utils/linode.py
@@ -7,7 +7,8 @@
#
# Copyright (c), Luke Murphy @decentral1se
#
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/module_utils/lxd.py b/plugins/module_utils/lxd.py
index e25caf11f3..bdf026313a 100644
--- a/plugins/module_utils/lxd.py
+++ b/plugins/module_utils/lxd.py
@@ -1,14 +1,8 @@
# -*- coding: utf-8 -*-
-# (c) 2016, Hiroaki Nakamura
-#
-# This code is part of Ansible, but is an independent component.
-# This particular file snippet, and this file snippet only, is BSD licensed.
-# Modules you write using this snippet, which is embedded dynamically by Ansible
-# still belong to the author of the module, and may assign their own license
-# to the complete work.
-#
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Copyright (c) 2016, Hiroaki Nakamura
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/module_utils/manageiq.py b/plugins/module_utils/manageiq.py
index 98e5590cc6..fd2652e3b4 100644
--- a/plugins/module_utils/manageiq.py
+++ b/plugins/module_utils/manageiq.py
@@ -8,7 +8,8 @@
# still belong to the author of the module, and may assign their own license
# to the complete work.
#
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/module_utils/memset.py b/plugins/module_utils/memset.py
index 7813290a72..671a8de308 100644
--- a/plugins/module_utils/memset.py
+++ b/plugins/module_utils/memset.py
@@ -7,7 +7,8 @@
#
# Copyright (c) 2018, Simon Weald
#
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
@@ -78,7 +79,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 +93,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 +110,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 +136,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
diff --git a/plugins/module_utils/mh/base.py b/plugins/module_utils/mh/base.py
index 0871a527be..b10762eaba 100644
--- a/plugins/module_utils/mh/base.py
+++ b/plugins/module_utils/mh/base.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
# (c) 2020, Alexei Znamensky
-# Copyright: (c) 2020, Ansible Project
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Copyright (c) 2020, Ansible Project
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import absolute_import, division, print_function
__metaclass__ = type
@@ -31,6 +32,10 @@ class ModuleHelperBase(object):
def diff_mode(self):
return self.module._diff
+ @property
+ def verbosity(self):
+ return self.module._verbosity
+
def do_raise(self, *args, **kwargs):
raise _MHE(*args, **kwargs)
diff --git a/plugins/module_utils/mh/deco.py b/plugins/module_utils/mh/deco.py
index 62d460b4e6..3073e4e9e7 100644
--- a/plugins/module_utils/mh/deco.py
+++ b/plugins/module_utils/mh/deco.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
# (c) 2020, Alexei Znamensky
-# Copyright: (c) 2020, Ansible Project
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Copyright (c) 2020, Ansible Project
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import absolute_import, division, print_function
__metaclass__ = type
diff --git a/plugins/module_utils/mh/exceptions.py b/plugins/module_utils/mh/exceptions.py
index 558dcca05f..68af5ba672 100644
--- a/plugins/module_utils/mh/exceptions.py
+++ b/plugins/module_utils/mh/exceptions.py
@@ -1,22 +1,19 @@
# -*- coding: utf-8 -*-
# (c) 2020, Alexei Znamensky
-# Copyright: (c) 2020, Ansible Project
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Copyright (c) 2020, Ansible Project
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import absolute_import, division, print_function
__metaclass__ = type
+from ansible.module_utils.common.text.converters import to_native
+
class ModuleHelperException(Exception):
- @staticmethod
- def _get_remove(key, kwargs):
- if key in kwargs:
- result = kwargs[key]
- del kwargs[key]
- return result
- return None
-
- def __init__(self, *args, **kwargs):
- self.msg = self._get_remove('msg', kwargs) or "Module failed with exception: {0}".format(self)
- self.update_output = self._get_remove('update_output', kwargs) or {}
+ def __init__(self, msg, update_output=None, *args, **kwargs):
+ self.msg = to_native(msg or "Module failed with exception: {0}".format(self))
+ if update_output is None:
+ update_output = {}
+ self.update_output = update_output
super(ModuleHelperException, self).__init__(*args)
diff --git a/plugins/module_utils/mh/mixins/cmd.py b/plugins/module_utils/mh/mixins/cmd.py
index 58d50fbdf8..da2629f9fe 100644
--- a/plugins/module_utils/mh/mixins/cmd.py
+++ b/plugins/module_utils/mh/mixins/cmd.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
# (c) 2020, Alexei Znamensky
-# Copyright: (c) 2020, Ansible Project
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Copyright (c) 2020, Ansible Project
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import absolute_import, division, print_function
__metaclass__ = type
diff --git a/plugins/module_utils/mh/mixins/deprecate_attrs.py b/plugins/module_utils/mh/mixins/deprecate_attrs.py
index fb440aba4c..c3bfb06c66 100644
--- a/plugins/module_utils/mh/mixins/deprecate_attrs.py
+++ b/plugins/module_utils/mh/mixins/deprecate_attrs.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
# (c) 2020, Alexei Znamensky
-# Copyright: (c) 2020, Ansible Project
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Copyright (c) 2020, Ansible Project
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import absolute_import, division, print_function
__metaclass__ = type
diff --git a/plugins/module_utils/mh/mixins/deps.py b/plugins/module_utils/mh/mixins/deps.py
index 1c6c9ae484..bab8c090bb 100644
--- a/plugins/module_utils/mh/mixins/deps.py
+++ b/plugins/module_utils/mh/mixins/deps.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
# (c) 2020, Alexei Znamensky
-# Copyright: (c) 2020, Ansible Project
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Copyright (c) 2020, Ansible Project
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import absolute_import, division, print_function
__metaclass__ = type
diff --git a/plugins/module_utils/mh/mixins/state.py b/plugins/module_utils/mh/mixins/state.py
index b946090ac9..4e29379890 100644
--- a/plugins/module_utils/mh/mixins/state.py
+++ b/plugins/module_utils/mh/mixins/state.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
# (c) 2020, Alexei Znamensky
-# Copyright: (c) 2020, Ansible Project
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Copyright (c) 2020, Ansible Project
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import absolute_import, division, print_function
__metaclass__ = type
diff --git a/plugins/module_utils/mh/mixins/vars.py b/plugins/module_utils/mh/mixins/vars.py
index a11110ed60..6dfb29bab8 100644
--- a/plugins/module_utils/mh/mixins/vars.py
+++ b/plugins/module_utils/mh/mixins/vars.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
# (c) 2020, Alexei Znamensky
-# Copyright: (c) 2020, Ansible Project
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Copyright (c) 2020, Ansible Project
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import absolute_import, division, print_function
__metaclass__ = type
diff --git a/plugins/module_utils/mh/module_helper.py b/plugins/module_utils/mh/module_helper.py
index 71731411e0..4251285751 100644
--- a/plugins/module_utils/mh/module_helper.py
+++ b/plugins/module_utils/mh/module_helper.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
# (c) 2020, Alexei Znamensky
-# Copyright: (c) 2020, Ansible Project
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Copyright (c) 2020, Ansible Project
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import absolute_import, division, print_function
__metaclass__ = type
diff --git a/plugins/module_utils/module_helper.py b/plugins/module_utils/module_helper.py
index a6b35bdd33..4cda4175c7 100644
--- a/plugins/module_utils/module_helper.py
+++ b/plugins/module_utils/module_helper.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
# (c) 2020, Alexei Znamensky
-# Copyright: (c) 2020, Ansible Project
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Copyright (c) 2020, Ansible Project
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import absolute_import, division, print_function
__metaclass__ = type
diff --git a/plugins/module_utils/net_tools/pritunl/api.py b/plugins/module_utils/net_tools/pritunl/api.py
index 91f97ecc96..cd2abc568e 100644
--- a/plugins/module_utils/net_tools/pritunl/api.py
+++ b/plugins/module_utils/net_tools/pritunl/api.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2021, Florian Dambrine
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2021, Florian Dambrine
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
"""
Pritunl API that offers CRUD operations on Pritunl Organizations and Users
diff --git a/plugins/module_utils/oneandone.py b/plugins/module_utils/oneandone.py
index 5f65b670f3..bbad2eaa05 100644
--- a/plugins/module_utils/oneandone.py
+++ b/plugins/module_utils/oneandone.py
@@ -1,11 +1,7 @@
# -*- coding: utf-8 -*-
-# This code is part of Ansible, but is an independent component.
-# This particular file snippet, and this file snippet only, is BSD licensed.
-# Modules you write using this snippet, which is embedded dynamically by Ansible
-# still belong to the author of the module, and may assign their own license
-# to the complete work.
-#
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Copyright (c) Ansible project
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/module_utils/onepassword.py b/plugins/module_utils/onepassword.py
index 3a86e22e16..3023165b1a 100644
--- a/plugins/module_utils/onepassword.py
+++ b/plugins/module_utils/onepassword.py
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Copyright (c) Ansible project
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/module_utils/oneview.py b/plugins/module_utils/oneview.py
index 6d786b0b80..dfd00c514e 100644
--- a/plugins/module_utils/oneview.py
+++ b/plugins/module_utils/oneview.py
@@ -7,7 +7,8 @@
#
# Copyright (2016-2017) Hewlett Packard Enterprise Development LP
#
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/module_utils/online.py b/plugins/module_utils/online.py
index b5acbcc017..a2f6e77a03 100644
--- a/plugins/module_utils/online.py
+++ b/plugins/module_utils/online.py
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Copyright (c) Ansible project
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/module_utils/opennebula.py b/plugins/module_utils/opennebula.py
index c896a9c6fa..b27ec229bf 100644
--- a/plugins/module_utils/opennebula.py
+++ b/plugins/module_utils/opennebula.py
@@ -2,7 +2,8 @@
#
# Copyright 2018 www.privaz.io Valletech AB
#
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
@@ -83,12 +84,12 @@ class OpenNebulaModule:
if self.module.params.get("api_username"):
username = self.module.params.get("api_username")
else:
- self.fail("Either api_username or the environment vairable ONE_USERNAME must be provided")
+ self.fail("Either api_username or the environment variable ONE_USERNAME must be provided")
if self.module.params.get("api_password"):
password = self.module.params.get("api_password")
else:
- self.fail("Either api_password or the environment vairable ONE_PASSWORD must be provided")
+ self.fail("Either api_password or the environment variable ONE_PASSWORD must be provided")
session = "%s:%s" % (username, password)
diff --git a/plugins/module_utils/oracle/oci_utils.py b/plugins/module_utils/oracle/oci_utils.py
index 88e577af5c..76fb45324b 100644
--- a/plugins/module_utils/oracle/oci_utils.py
+++ b/plugins/module_utils/oracle/oci_utils.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017, 2018, 2019 Oracle and/or its affiliates.
-# 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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
@@ -691,7 +692,7 @@ def check_and_create_resource(
:param model: Model used to create a resource.
:param exclude_attributes: The attributes which should not be used to distinguish the resource. e.g. display_name,
dns_label.
- :param dead_states: List of states which can't transition to any of the usable states of the resource. This deafults
+ :param dead_states: List of states which can't transition to any of the usable states of the resource. This defaults
to ["TERMINATING", "TERMINATED", "FAULTY", "FAILED", "DELETING", "DELETED", "UNKNOWN_ENUM_VALUE"]
:param default_attribute_values: A dictionary containing default values for attributes.
:return: A dictionary containing the resource & the "changed" status. e.g. {"vcn":{x:y}, "changed":True}
@@ -1189,7 +1190,7 @@ def are_dicts_equal(
def should_dict_attr_be_excluded(map_option_name, option_key, exclude_list):
- """An entry for the Exclude list for excluding a map's key is specifed as a dict with the map option name as the
+ """An entry for the Exclude list for excluding a map's key is specified as a dict with the map option name as the
key, and the value as a list of keys to be excluded within that map. For example, if the keys "k1" and "k2" of a map
option named "m1" needs to be excluded, the exclude list must have an entry {'m1': ['k1','k2']} """
for exclude_item in exclude_list:
diff --git a/plugins/module_utils/pipx.py b/plugins/module_utils/pipx.py
new file mode 100644
index 0000000000..5dd02c0422
--- /dev/null
+++ b/plugins/module_utils/pipx.py
@@ -0,0 +1,50 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2022, Alexei Znamensky
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+from __future__ import absolute_import, division, print_function
+__metaclass__ = type
+
+from ansible.module_utils.parsing.convert_bool import boolean
+from ansible_collections.community.general.plugins.module_utils.cmd_runner import CmdRunner, cmd_runner_fmt as fmt
+
+
+_state_map = dict(
+ install='install',
+ present='install',
+ uninstall='uninstall',
+ absent='uninstall',
+ uninstall_all='uninstall-all',
+ inject='inject',
+ upgrade='upgrade',
+ upgrade_all='upgrade-all',
+ reinstall='reinstall',
+ reinstall_all='reinstall-all',
+)
+
+
+def pipx_runner(module, command, **kwargs):
+ runner = CmdRunner(
+ module,
+ command=command,
+ arg_formats=dict(
+
+ state=fmt.as_map(_state_map),
+ name=fmt.as_list(),
+ name_source=fmt.as_func(fmt.unpack_args(lambda n, s: [s] if s else [n])),
+ install_deps=fmt.as_bool("--include-deps"),
+ inject_packages=fmt.as_list(),
+ force=fmt.as_bool("--force"),
+ include_injected=fmt.as_bool("--include-injected"),
+ index_url=fmt.as_opt_val('--index-url'),
+ python=fmt.as_opt_val('--python'),
+ _list=fmt.as_fixed(['list', '--include-injected', '--json']),
+ editable=fmt.as_bool("--editable"),
+ pip_args=fmt.as_opt_val('--pip-args'),
+ ),
+ environ_update={'USE_EMOJI': '0'},
+ check_rc=True,
+ **kwargs
+ )
+ return runner
diff --git a/plugins/module_utils/proxmox.py b/plugins/module_utils/proxmox.py
index 56f0b35e7f..65e8eb4723 100644
--- a/plugins/module_utils/proxmox.py
+++ b/plugins/module_utils/proxmox.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
#
-# Copyright: (c) 2020, Tristan Le Guern
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2020, Tristan Le Guern
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
__metaclass__ = type
diff --git a/plugins/module_utils/pure.py b/plugins/module_utils/pure.py
index ebd41b1ce5..c9914c38b5 100644
--- a/plugins/module_utils/pure.py
+++ b/plugins/module_utils/pure.py
@@ -7,7 +7,8 @@
# to the complete work.
#
# Copyright (c), Simon Dodsley ,2017
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/module_utils/rax.py b/plugins/module_utils/rax.py
index 84effee97c..2372088033 100644
--- a/plugins/module_utils/rax.py
+++ b/plugins/module_utils/rax.py
@@ -7,7 +7,8 @@
#
# Copyright (c), Michael DeHaan , 2012-2013
#
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
@@ -122,8 +123,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,
diff --git a/plugins/module_utils/redfish_utils.py b/plugins/module_utils/redfish_utils.py
index 31750861f7..9068f9b92a 100644
--- a/plugins/module_utils/redfish_utils.py
+++ b/plugins/module_utils/redfish_utils.py
@@ -1,6 +1,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 LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
__metaclass__ = type
@@ -1888,14 +1889,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 = {}
@@ -2061,7 +2061,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 = {}
@@ -2187,9 +2187,8 @@ class RedfishUtils(object):
else:
if media_match_strict:
continue
- # if ejected, 'Inserted' should be False and 'ImageName' cleared
- if (not data.get('Inserted', False) and
- not data.get('ImageName')):
+ # if ejected, 'Inserted' should be False
+ if (not data.get('Inserted', False)):
return uri, data
return None, None
@@ -2225,7 +2224,7 @@ class RedfishUtils(object):
return resources, headers
@staticmethod
- def _insert_virt_media_payload(options, param_map, data, ai):
+ def _insert_virt_media_payload(options, param_map, data, ai, image_only=False):
payload = {
'Image': options.get('image_url')
}
@@ -2239,6 +2238,12 @@ class RedfishUtils(object):
options.get(option), option,
allowable)}
payload[param] = options.get(option)
+
+ # Some hardware (such as iLO 4 or Supermicro) only supports the Image property
+ # Inserted and WriteProtected are not writable
+ if image_only:
+ del payload['Inserted']
+ del payload['WriteProtected']
return payload
def virtual_media_insert_via_patch(self, options, param_map, uri, data, image_only=False):
@@ -2247,16 +2252,10 @@ class RedfishUtils(object):
{'AllowableValues': v}) for k, v in data.items()
if k.endswith('@Redfish.AllowableValues'))
# construct payload
- payload = self._insert_virt_media_payload(options, param_map, data, ai)
- if 'Inserted' not in payload:
+ payload = self._insert_virt_media_payload(options, param_map, data, ai, image_only)
+ if 'Inserted' not in payload and not image_only:
payload['Inserted'] = True
- # Some hardware (such as iLO 4) only supports the Image property on the PATCH operation
- # Inserted and WriteProtected are not writable
- if image_only:
- del payload['Inserted']
- del payload['WriteProtected']
-
# PATCH the resource
response = self.patch_request(self.root_uri + uri, payload)
if response['ret'] is False:
@@ -2292,6 +2291,13 @@ class RedfishUtils(object):
if data["FirmwareVersion"].startswith("iLO 4"):
image_only = True
+ # Supermicro does also not support Inserted and WriteProtected
+ # Supermicro uses as firmware version only a number so we can't check for it because we
+ # can't be sure that this firmware version is nut used by another vendor
+ # Tested with Supermicro Firmware 01.74.02
+ if 'Supermicro' in data['Oem']:
+ image_only = True
+
virt_media_uri = data["VirtualMedia"]["@odata.id"]
response = self.get_request(self.root_uri + virt_media_uri)
if response['ret'] is False:
@@ -2346,7 +2352,7 @@ class RedfishUtils(object):
# get ActionInfo or AllowableValues
ai = self._get_all_action_info_values(action)
# construct payload
- payload = self._insert_virt_media_payload(options, param_map, data, ai)
+ payload = self._insert_virt_media_payload(options, param_map, data, ai, image_only)
# POST to action
response = self.post_request(self.root_uri + action_uri, payload)
if response['ret'] is False:
@@ -2392,6 +2398,9 @@ class RedfishUtils(object):
if data["FirmwareVersion"].startswith("iLO 4"):
image_only = True
+ if 'Supermicro' in data['Oem']:
+ image_only = True
+
virt_media_uri = data["VirtualMedia"]["@odata.id"]
response = self.get_request(self.root_uri + virt_media_uri)
if response['ret'] is False:
@@ -3020,3 +3029,26 @@ class RedfishUtils(object):
if not result["entries"]:
return {'ret': False, 'msg': "No HostInterface objects found"}
return result
+
+ def get_manager_inventory(self, manager_uri):
+ result = {}
+ inventory = {}
+ # Get these entries, but does not fail if not found
+ properties = ['FirmwareVersion', 'ManagerType', 'Manufacturer', 'Model',
+ 'PartNumber', 'PowerState', 'SerialNumber', 'Status', 'UUID']
+
+ response = self.get_request(self.root_uri + manager_uri)
+ if response['ret'] is False:
+ return response
+ result['ret'] = True
+ data = response['data']
+
+ for property in properties:
+ if property in data:
+ inventory[property] = data[property]
+
+ result["entries"] = inventory
+ return result
+
+ def get_multi_manager_inventory(self):
+ return self.aggregate_managers(self.get_manager_inventory)
diff --git a/plugins/module_utils/redhat.py b/plugins/module_utils/redhat.py
index 85f4a6aab2..f82cffaa0d 100644
--- a/plugins/module_utils/redhat.py
+++ b/plugins/module_utils/redhat.py
@@ -7,7 +7,8 @@
#
# Copyright (c), James Laska
#
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/module_utils/redis.py b/plugins/module_utils/redis.py
index de5c8c7fc3..c4d87aca51 100644
--- a/plugins/module_utils/redis.py
+++ b/plugins/module_utils/redis.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
#
-# Copyright: (c) 2021, Andreas Botzner
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2021, Andreas Botzner
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
@@ -15,6 +16,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 +24,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
@@ -37,7 +40,7 @@ def fail_imports(module, needs_certifi=True):
errors.append(missing_required_lib('certifi'))
traceback.append(CERTIFI_IMPORT_ERROR)
if errors:
- module.fail_json(errors=errors, traceback='\n'.join(traceback))
+ module.fail_json(msg='\n'.join(errors), traceback='\n'.join(traceback))
def redis_auth_argument_spec(tls_default=True):
diff --git a/plugins/module_utils/remote_management/lxca/common.py b/plugins/module_utils/remote_management/lxca/common.py
index 07092b9642..0fe8c32077 100644
--- a/plugins/module_utils/remote_management/lxca/common.py
+++ b/plugins/module_utils/remote_management/lxca/common.py
@@ -6,7 +6,8 @@
# own license to the complete work.
#
# Copyright (C) 2017 Lenovo, Inc.
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
#
# Contains LXCA common class
# Lenovo xClarity Administrator (LXCA)
diff --git a/plugins/module_utils/rundeck.py b/plugins/module_utils/rundeck.py
index afbbb48108..dd83eeccaf 100644
--- a/plugins/module_utils/rundeck.py
+++ b/plugins/module_utils/rundeck.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2021, Phillipe Smith
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2021, Phillipe Smith
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
__metaclass__ = type
diff --git a/plugins/module_utils/saslprep.py b/plugins/module_utils/saslprep.py
index 3e16c7169e..29bb49b702 100644
--- a/plugins/module_utils/saslprep.py
+++ b/plugins/module_utils/saslprep.py
@@ -6,9 +6,10 @@
# still belong to the author of the module, and may assign their own license
# to the complete work.
-# Copyright: (c) 2020, Andrew Klychkov (@Andersson007)
+# Copyright (c) 2020, Andrew Klychkov (@Andersson007)
#
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/module_utils/scaleway.py b/plugins/module_utils/scaleway.py
index e6fb8109cc..4c1a475689 100644
--- a/plugins/module_utils/scaleway.py
+++ b/plugins/module_utils/scaleway.py
@@ -1,4 +1,8 @@
# -*- coding: utf-8 -*-
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/module_utils/source_control/bitbucket.py b/plugins/module_utils/source_control/bitbucket.py
index 1d584391d9..592905a65f 100644
--- a/plugins/module_utils/source_control/bitbucket.py
+++ b/plugins/module_utils/source_control/bitbucket.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Copyright (c) Ansible project
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/module_utils/storage/emc/emc_vnx.py b/plugins/module_utils/storage/emc/emc_vnx.py
index 5922512676..2e391b8fbe 100644
--- a/plugins/module_utils/storage/emc/emc_vnx.py
+++ b/plugins/module_utils/storage/emc/emc_vnx.py
@@ -1,13 +1,7 @@
# -*- coding: utf-8 -*-
-# This code is part of Ansible, but is an independent component.
-# This particular file snippet, and this file snippet only, is BSD licensed.
-# Modules you write using this snippet, which is embedded dynamically by Ansible
-# still belong to the author of the module, and may assign their own license
-# to the complete work.
-#
-# (c) 2018 Luca 'remix_tj' Lorenzetto
-#
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Copyright (c) 2018 Luca 'remix_tj' Lorenzetto
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/module_utils/storage/hpe3par/hpe3par.py b/plugins/module_utils/storage/hpe3par/hpe3par.py
index b7734444dd..3d164ce746 100644
--- a/plugins/module_utils/storage/hpe3par/hpe3par.py
+++ b/plugins/module_utils/storage/hpe3par/hpe3par.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2018, Hewlett Packard Enterprise Development LP
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Copyright (c) 2018, Hewlett Packard Enterprise Development LP
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/module_utils/univention_umc.py b/plugins/module_utils/univention_umc.py
index a44a0052a9..b08f39e306 100644
--- a/plugins/module_utils/univention_umc.py
+++ b/plugins/module_utils/univention_umc.py
@@ -9,7 +9,8 @@
# Copyright (c) 2016, Adfinis SyGroup AG
# Tobias Rueetschi
#
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/module_utils/utm_utils.py b/plugins/module_utils/utm_utils.py
index 7e6ff3093e..712450cd2a 100644
--- a/plugins/module_utils/utm_utils.py
+++ b/plugins/module_utils/utm_utils.py
@@ -5,9 +5,10 @@
# still belong to the author of the module, and may assign their own license
# to the complete work.
#
-# Copyright: (c) 2018, Johannes Brunswicker
+# Copyright (c) 2018, Johannes Brunswicker
#
-# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
+# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
+# SPDX-License-Identifier: BSD-2-Clause
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/plugins/module_utils/version.py b/plugins/module_utils/version.py
index dc59c43712..b671e59628 100644
--- a/plugins/module_utils/version.py
+++ b/plugins/module_utils/version.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
-# Copyright: (c) 2021, Felix Fontein
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+# Copyright (c) 2021, Felix Fontein
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
"""Provide version object to compare version numbers."""
diff --git a/plugins/module_utils/vexata.py b/plugins/module_utils/vexata.py
index 3d6fb7aaca..2ea56a3b05 100644
--- a/plugins/module_utils/vexata.py
+++ b/plugins/module_utils/vexata.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
#
-# Copyright: (c) 2019, Sandeep Kasargod