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..a75397852f 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,8 @@ files: $lookups/dnstxt.py: maintainers: jpmens $lookups/dsv.py: - maintainers: amigus endlesstrax + maintainers: delineaKrehl tylerezimmerman + ignore: amigus $lookups/etcd3.py: maintainers: eric-belhomme $lookups/etcd.py: @@ -251,9 +261,13 @@ files: maintainers: RevBits $lookups/shelvefile.py: {} $lookups/tss.py: - maintainers: amigus endlesstrax + maintainers: delineaKrehl tylerezimmerman + ignore: amigus $module_utils/: labels: module_utils + $module_utils/gconftool2.py: + maintainers: russoz + labels: gconftool2 $module_utils/gitlab.py: notify: jlozadad maintainers: $team_gitlab @@ -285,6 +299,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 +318,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 +457,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 +640,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 +732,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: @@ -785,6 +810,8 @@ files: maintainers: bcoca matburt maxamillion $modules/packaging/language/pipx.py: maintainers: russoz + $modules/packaging/language/pipx_info.py: + maintainers: russoz $modules/packaging/language/yarn.py: maintainers: chrishoffman verkaufer $modules/packaging/os/apk.py: @@ -915,7 +942,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 +987,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 +1055,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 +1083,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 +1093,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 +1319,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..36c3198381 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,13 +6,327 @@ Community General Release Notes This changelog describes changes after version 4.0.0. -v5.0.0-a1 -========= +v5.6.0 +====== Release Summary --------------- -Alpha release for community.general 5.0.0. +Regular bugfix and feature release. + +Minor Changes +------------- + +- ali_instance - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5240). +- ali_instance_info - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5240). +- consul_session - adds ``token`` parameter for session (https://github.com/ansible-collections/community.general/pull/5193). +- gitlab module util - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259). +- gitlab_branch - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259). +- gitlab_deploy_key - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259). +- gitlab_group - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259). +- gitlab_group_members - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259). +- gitlab_group_variable - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259). +- gitlab_hook - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259). +- gitlab_hook - minor refactoring (https://github.com/ansible-collections/community.general/pull/5271). +- gitlab_project - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259). +- gitlab_project_members - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259). +- gitlab_project_variable - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259). +- gitlab_protected_branch - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259). +- gitlab_runner - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259). +- gitlab_user - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259). +- homebrew, homebrew_tap - added Homebrew on Linux path to defaults (https://github.com/ansible-collections/community.general/pull/5241). +- nagios - minor refactoring on parameter validation for different actions (https://github.com/ansible-collections/community.general/pull/5239). +- nmcli - add bond option ``xmit_hash_policy`` to bond options (https://github.com/ansible-collections/community.general/issues/5148). +- nmcli - honor IP options for VPNs (https://github.com/ansible-collections/community.general/pull/5228). +- redfish - added new command GetVirtualMedia, VirtualMediaInsert and VirtualMediaEject to Systems category due to Redfish spec changes the virtualMedia resource location from Manager to System (https://github.com/ansible-collections/community.general/pull/5124). +- seport - added new argument ``local`` (https://github.com/ansible-collections/community.general/pull/5203) +- wdc_redfish_command - add ``PowerModeLow`` and ``PowerModeNormal`` commands for ``Chassis`` category (https://github.com/ansible-collections/community.general/pull/5145). + +Deprecated Features +------------------- + +- proxmox - deprecated the current ``unprivileged`` default value, will be changed to ``true`` in community.general 7.0.0 (https://github.com/pull/5224). + +Bugfixes +-------- + +- listen_ports_facts - removed leftover ``EnvironmentError`` . The ``else`` clause had a wrong indentation. The check is now handled in the ``split_pid_name`` function (https://github.com/ansible-collections/community.general/pull/5202). +- nmcli - avoid changed status for most cases with VPN connections (https://github.com/ansible-collections/community.general/pull/5126). +- osx_defaults - no longer expand ``~`` in ``value`` to the user's home directory, or expand environment variables (https://github.com/ansible-collections/community.general/issues/5234, https://github.com/ansible-collections/community.general/pull/5243). +- proxmox_kvm - fix exception when no ``agent`` argument is specified (https://github.com/ansible-collections/community.general/pull/5194). +- proxmox_kvm - replace new condition with proper condition to allow for using ``vmid`` on update (https://github.com/ansible-collections/community.general/pull/5206). +- slack - fix message update for channels which start with ``CP``. When ``message-id`` was passed it failed for channels which started with ``CP`` because the ``#`` symbol was added before the ``channel_id`` (https://github.com/ansible-collections/community.general/pull/5249). +- tss lookup plugin - adding support for updated Delinea library (https://github.com/DelineaXPM/python-tss-sdk/issues/9, https://github.com/ansible-collections/community.general/pull/5151). + +New Modules +----------- + +Packaging +~~~~~~~~~ + +language +^^^^^^^^ + +- pipx_info - Rretrieves information about applications installed with pipx + +v5.5.0 +====== + +Release Summary +--------------- + +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 +337,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 +364,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 +423,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 +439,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 +455,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 +478,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 +528,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 +542,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 +579,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 +606,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 +620,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 -[![Build Status](https://dev.azure.com/ansible/community.general/_apis/build/status/CI?branchName=main)](https://dev.azure.com/ansible/community.general/_build?definitionId=31) +[![Build Status](https://dev.azure.com/ansible/community.general/_apis/build/status/CI?branchName=stable-5)](https://dev.azure.com/ansible/community.general/_build?definitionId=31) [![Codecov](https://img.shields.io/codecov/c/github/ansible-collections/community.general)](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..5897ead01e 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,408 @@ 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' + 5.6.0: + changes: + bugfixes: + - listen_ports_facts - removed leftover ``EnvironmentError`` . The ``else`` + clause had a wrong indentation. The check is now handled in the ``split_pid_name`` + function (https://github.com/ansible-collections/community.general/pull/5202). + - nmcli - avoid changed status for most cases with VPN connections (https://github.com/ansible-collections/community.general/pull/5126). + - osx_defaults - no longer expand ``~`` in ``value`` to the user's home directory, + or expand environment variables (https://github.com/ansible-collections/community.general/issues/5234, + https://github.com/ansible-collections/community.general/pull/5243). + - proxmox_kvm - fix exception when no ``agent`` argument is specified (https://github.com/ansible-collections/community.general/pull/5194). + - proxmox_kvm - replace new condition with proper condition to allow for using + ``vmid`` on update (https://github.com/ansible-collections/community.general/pull/5206). + - slack - fix message update for channels which start with ``CP``. When ``message-id`` + was passed it failed for channels which started with ``CP`` because the ``#`` + symbol was added before the ``channel_id`` (https://github.com/ansible-collections/community.general/pull/5249). + - tss lookup plugin - adding support for updated Delinea library (https://github.com/DelineaXPM/python-tss-sdk/issues/9, + https://github.com/ansible-collections/community.general/pull/5151). + deprecated_features: + - proxmox - deprecated the current ``unprivileged`` default value, will be changed + to ``true`` in community.general 7.0.0 (https://github.com/pull/5224). + minor_changes: + - ali_instance - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5240). + - ali_instance_info - minor refactor when checking for installed dependency + (https://github.com/ansible-collections/community.general/pull/5240). + - consul_session - adds ``token`` parameter for session (https://github.com/ansible-collections/community.general/pull/5193). + - gitlab module util - minor refactor when checking for installed dependency + (https://github.com/ansible-collections/community.general/pull/5259). + - gitlab_branch - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259). + - gitlab_deploy_key - minor refactor when checking for installed dependency + (https://github.com/ansible-collections/community.general/pull/5259). + - gitlab_group - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259). + - gitlab_group_members - minor refactor when checking for installed dependency + (https://github.com/ansible-collections/community.general/pull/5259). + - gitlab_group_variable - minor refactor when checking for installed dependency + (https://github.com/ansible-collections/community.general/pull/5259). + - gitlab_hook - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259). + - gitlab_hook - minor refactoring (https://github.com/ansible-collections/community.general/pull/5271). + - gitlab_project - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259). + - gitlab_project_members - minor refactor when checking for installed dependency + (https://github.com/ansible-collections/community.general/pull/5259). + - gitlab_project_variable - minor refactor when checking for installed dependency + (https://github.com/ansible-collections/community.general/pull/5259). + - gitlab_protected_branch - minor refactor when checking for installed dependency + (https://github.com/ansible-collections/community.general/pull/5259). + - gitlab_runner - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259). + - gitlab_user - minor refactor when checking for installed dependency (https://github.com/ansible-collections/community.general/pull/5259). + - homebrew, homebrew_tap - added Homebrew on Linux path to defaults (https://github.com/ansible-collections/community.general/pull/5241). + - nagios - minor refactoring on parameter validation for different actions (https://github.com/ansible-collections/community.general/pull/5239). + - nmcli - add bond option ``xmit_hash_policy`` to bond options (https://github.com/ansible-collections/community.general/issues/5148). + - nmcli - honor IP options for VPNs (https://github.com/ansible-collections/community.general/pull/5228). + - redfish - added new command GetVirtualMedia, VirtualMediaInsert and VirtualMediaEject + to Systems category due to Redfish spec changes the virtualMedia resource + location from Manager to System (https://github.com/ansible-collections/community.general/pull/5124). + - seport - added new argument ``local`` (https://github.com/ansible-collections/community.general/pull/5203) + - wdc_redfish_command - add ``PowerModeLow`` and ``PowerModeNormal`` commands + for ``Chassis`` category (https://github.com/ansible-collections/community.general/pull/5145). + release_summary: Regular bugfix and feature release. + fragments: + - 5.6.0.yml + - 5124-compatibility-virtualmedia-resource-location.yaml + - 5126-nmcli-remove-diffs.yml + - 5145-wdc-redfish-enclosure-power-state.yml + - 5149-nmcli-bond-option.yml + - 5151-add-delinea-support-tss-lookup.yml + - 5193-consul-session-token.yaml + - 5194-fix-proxmox-agent-exception.yaml + - 5202-bugfix-environmentError-wrong-indentation.yaml + - 5203-seport-add-local-argument.yaml + - 5206-proxmox-conditional-vmid.yml + - 5224-proxmox-unprivileged-default.yaml + - 5228-nmcli-ip-options.yaml + - 5239-nagios-refactor.yaml + - 5240-unused-imports.yaml + - 5241-homebrew-add-linux-path.yaml + - 5243-osx-defaults-expand-user-flags.yml + - 5249-add-new-channel-prefix.yml + - 5259-gitlab-imports.yaml + - 5271-gitlab_hook-refactor.yaml + modules: + - description: Rretrieves information about applications installed with pipx + name: pipx_info + namespace: packaging.language + release_date: '2022-09-13' 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..410e4b40c1 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.6.0 readme: README.md authors: - Ansible (https://github.com/ansible) diff --git a/meta/runtime.yml b/meta/runtime.yml index c3a439b6f3..a7578eea22 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: @@ -1121,6 +1131,8 @@ plugin_routing: redirect: community.general.packaging.language.pip_package_info pipx: redirect: community.general.packaging.language.pipx + pipx_info: + redirect: community.general.packaging.language.pipx_info pkg5: redirect: community.general.packaging.os.pkg5 pkg5_publisher: @@ -1355,6 +1367,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 +1611,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..69e730aad4 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 @@ -54,7 +55,7 @@ DOCUMENTATION = ''' - name: ANSIBLE_DOAS_FLAGS become_pass: description: password for doas prompt - required: False + required: false vars: - name: ansible_become_password - name: ansible_become_pass diff --git a/plugins/become/dzdo.py b/plugins/become/dzdo.py index 1aef8edb69..a358e84e39 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 @@ -53,7 +55,7 @@ DOCUMENTATION = ''' - name: ANSIBLE_DZDO_FLAGS become_pass: description: Options to pass to dzdo - required: False + required: false vars: - name: ansible_become_password - name: ansible_become_pass diff --git a/plugins/become/ksu.py b/plugins/become/ksu.py index 1ee47b0fa3..fa2f66864a 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 @@ -24,7 +25,7 @@ DOCUMENTATION = ''' env: - name: ANSIBLE_BECOME_USER - name: ANSIBLE_KSU_USER - required: True + required: true become_exe: description: Su executable default: ksu @@ -55,7 +56,7 @@ DOCUMENTATION = ''' - name: ANSIBLE_KSU_FLAGS become_pass: description: ksu password - required: False + required: false vars: - name: ansible_ksu_pass - name: ansible_become_pass diff --git a/plugins/become/machinectl.py b/plugins/become/machinectl.py index aebb0891b0..3e13dfc2a5 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 @@ -55,7 +56,7 @@ DOCUMENTATION = ''' - name: ANSIBLE_MACHINECTL_FLAGS become_pass: description: Password for machinectl - required: False + required: false vars: - name: ansible_become_password - name: ansible_become_pass @@ -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..7d1437191e 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 @@ -55,7 +56,7 @@ DOCUMENTATION = ''' - name: ANSIBLE_PBRUN_FLAGS become_pass: description: Password for pbrun - required: False + required: false vars: - name: ansible_become_password - name: ansible_become_pass @@ -68,7 +69,7 @@ DOCUMENTATION = ''' key: password wrap_exe: description: Toggle to wrap the command pbrun calls in 'shell -c' or not - default: False + default: false type: bool ini: - section: pbrun_become_plugin diff --git a/plugins/become/pfexec.py b/plugins/become/pfexec.py index 2b37044c93..43237342d4 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 @@ -58,7 +59,7 @@ DOCUMENTATION = ''' - name: ANSIBLE_PFEXEC_FLAGS become_pass: description: pfexec password - required: False + required: false vars: - name: ansible_become_password - name: ansible_become_pass @@ -71,7 +72,7 @@ DOCUMENTATION = ''' key: password wrap_exe: description: Toggle to wrap the command pfexec calls in 'shell -c' or not - default: False + default: false type: bool ini: - section: pfexec_become_plugin diff --git a/plugins/become/pmrun.py b/plugins/become/pmrun.py index 8cb24fa937..74b633f09a 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 @@ -41,7 +42,7 @@ DOCUMENTATION = ''' - name: ANSIBLE_PMRUN_FLAGS become_pass: description: pmrun password - required: False + required: false vars: - name: ansible_become_password - name: ansible_become_pass diff --git a/plugins/become/sesu.py b/plugins/become/sesu.py index 7113b19442..5958c1bfca 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 @@ -55,7 +56,7 @@ DOCUMENTATION = ''' - name: ANSIBLE_SESU_FLAGS become_pass: description: Password to pass to sesu - required: False + required: false vars: - name: ansible_become_password - name: ansible_become_pass 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..06b673921e 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) @@ -15,7 +16,7 @@ DOCUMENTATION = ''' author: Brian Coca (@bcoca) options: _uri: - required: True + required: true description: - Path in which the cache plugin will save the files env: diff --git a/plugins/cache/redis.py b/plugins/cache/redis.py index 6c2edb5f61..81e960cf18 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 @@ -20,7 +21,7 @@ DOCUMENTATION = ''' - The format is C(host:port:db:password), for example C(localhost:6379:0:changeme). - To use encryption in transit, prefix the connection with C(tls://), as in C(tls://localhost:6379:0:changeme). - To use redis sentinel, use separator C(;), for example C(localhost:26379;localhost:26379;0:changeme). Requires redis>=2.9.0. - required: True + required: true env: - name: ANSIBLE_CACHE_PLUGIN_CONNECTION ini: diff --git a/plugins/cache/yaml.py b/plugins/cache/yaml.py index e5062b16d1..3a5ddf3e6f 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) @@ -15,7 +16,7 @@ DOCUMENTATION = ''' author: Brian Coca (@bcoca) options: _uri: - required: True + required: true description: - Path in which the cache plugin will save the files env: diff --git a/plugins/callback/cgroup_memory_recap.py b/plugins/callback/cgroup_memory_recap.py index 0334bee664..eedacfeecb 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) @@ -22,7 +23,7 @@ DOCUMENTATION = ''' - To create the cgroup, first use a command such as C(sudo cgcreate -a ec2-user:ec2-user -t ec2-user:ec2-user -g memory:ansible_profile) options: max_mem_file: - required: True + required: true description: Path to cgroups C(memory.max_usage_in_bytes) file. Example C(/sys/fs/cgroup/memory/ansible_profile/memory.max_usage_in_bytes) env: - name: CGROUP_MAX_MEM_FILE @@ -30,7 +31,7 @@ DOCUMENTATION = ''' - section: callback_cgroupmemrecap key: max_mem_file cur_mem_file: - required: True + required: true description: Path to C(memory.usage_in_bytes) file. Example C(/sys/fs/cgroup/memory/ansible_profile/memory.usage_in_bytes) env: - name: CGROUP_CUR_MEM_FILE 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..55a07725f2 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 @@ -626,7 +627,7 @@ playbook.yml: > --- - name: "Default plugin output: play example" hosts: localhost - gather_facts: no + gather_facts: false tasks: - name: Default plugin output ansible.builtin.debug: @@ -634,7 +635,7 @@ playbook.yml: > - name: Override from play vars hosts: localhost - gather_facts: no + gather_facts: false vars: ansible_connection: local green: "\e[0m\e[38;5;82m" @@ -712,7 +713,7 @@ playbook.yml: > - name: Using alias vars (see ansible.cfg) ansible.builtin.debug: msg: - when: False + when: false vars: ansible_callback_diy_playbook_on_task_start_msg: "" on_skipped_msg: "DIY output(via task vars): skipped example:\n\e[0m\e[38;5;4m\u25b6\u25b6 {{ ansible_callback_diy.result.task.name }}\n" 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..3e10b69e7f 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 @@ -20,7 +21,7 @@ DOCUMENTATION = ''' options: token: description: HipChat API token for v1 or v2 API. - required: True + required: true env: - name: HIPCHAT_TOKEN ini: @@ -28,7 +29,7 @@ DOCUMENTATION = ''' key: token api_version: description: HipChat API version, v1 or v2. - required: False + required: false default: v1 env: - name: HIPCHAT_API_VERSION @@ -54,7 +55,7 @@ DOCUMENTATION = ''' notify: description: Add notify flag to important messages type: bool - default: True + default: true env: - name: HIPCHAT_NOTIFY ini: diff --git a/plugins/callback/jabber.py b/plugins/callback/jabber.py index b535fa9540..823ae20144 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 @@ -19,22 +20,22 @@ DOCUMENTATION = ''' options: server: description: connection info to jabber server - required: True + required: true env: - name: JABBER_SERV user: description: Jabber user to authenticate as - required: True + required: true env: - name: JABBER_USER password: description: Password for the user to the jabber server - required: True + required: true env: - name: JABBER_PASS to: description: chat identifier that will receive the message - required: True + required: true env: - name: JABBER_TO ''' 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..ee0a1eb022 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 @@ -17,7 +18,7 @@ DOCUMENTATION = ''' - whitelisting in configuration options: conf_key: - required: True + required: true description: LogDNA Ingestion Key type: string env: @@ -26,7 +27,7 @@ DOCUMENTATION = ''' - section: callback_logdna key: conf_key plugin_ignore_errors: - required: False + required: false description: Whether to ignore errors on failing or not type: boolean env: @@ -34,9 +35,9 @@ DOCUMENTATION = ''' ini: - section: callback_logdna key: plugin_ignore_errors - default: False + default: false conf_hostname: - required: False + required: false description: Alternative Host Name; the current host name by default type: string env: @@ -45,7 +46,7 @@ DOCUMENTATION = ''' - section: callback_logdna key: conf_hostname conf_tags: - required: False + required: false description: Tags type: string env: diff --git a/plugins/callback/logentries.py b/plugins/callback/logentries.py index ad71a6d448..d40939b0ab 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 @@ -47,7 +48,7 @@ DOCUMENTATION = ''' description: The logentries "TCP token" env: - name: LOGENTRIES_ANSIBLE_TOKEN - required: True + required: true ini: - section: callback_logentries key: token @@ -56,7 +57,7 @@ DOCUMENTATION = ''' - Toggle to decide whether to use TLS to encrypt the communications with the API server env: - name: LOGENTRIES_USE_TLS - default: False + default: false type: boolean ini: - section: callback_logentries @@ -64,7 +65,7 @@ DOCUMENTATION = ''' flatten: description: flatten complex data structures into a single dictionary with complex keys type: boolean - default: False + default: false env: - name: LOGENTRIES_FLATTEN ini: 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..6476f5ba53 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,13 +15,13 @@ 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: - default: False + default: false description: This setting allows suppressing colorizing output env: - name: ANSIBLE_NOCOLOR diff --git a/plugins/callback/slack.py b/plugins/callback/slack.py index 5cb402b109..6ca15b43f5 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) @@ -20,7 +21,7 @@ DOCUMENTATION = ''' - Before 2.4 only environment variables were available for configuring this plugin options: webhook_url: - required: True + required: true description: Slack Webhook URL env: - name: SLACK_WEBHOOK_URL @@ -50,7 +51,7 @@ DOCUMENTATION = ''' ini: - section: callback_slack key: validate_certs - default: True + default: true type: bool ''' 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..674fb1e9ab 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 @@ -27,5 +28,5 @@ options: description: - Whether or not to validate SSL certs when supplying a https endpoint. type: bool - default: yes + default: true ''' 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..f8372431e0 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 @@ -46,5 +47,5 @@ options: - If C(false), SSL certificates will not be validated. - This should only be used on private instances of the CloudControl API that use self-signed certificates. type: bool - default: yes + default: true ''' diff --git a/plugins/doc_fragments/dimensiondata_wait.py b/plugins/doc_fragments/dimensiondata_wait.py index ac3deab154..d371528396 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 @@ -20,7 +21,7 @@ options: description: - Should we wait for the task to complete before moving onto the next. type: bool - default: no + default: false wait_time: description: - The maximum amount of time (in seconds) to wait for the task to complete. 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..ff38c3fc7c 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 @@ -17,17 +18,17 @@ options: description: - Management user on the spectrum accelerate storage system. type: str - required: True + required: true password: description: - Password for username on the spectrum accelerate storage system. type: str - required: True + required: true endpoints: description: - The hostname or management IP of Spectrum Accelerate storage system. type: str - required: True + required: true notes: - This module requires pyxcli python library. Use 'pip install pyxcli' in order to get pyxcli. diff --git a/plugins/doc_fragments/influxdb.py b/plugins/doc_fragments/influxdb.py index a31c84cbb1..f9e08550bd 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 @@ -45,10 +46,10 @@ options: version_added: '0.2.0' validate_certs: description: - - If set to C(no), the SSL certificates will not be validated. - - This should only set to C(no) used on personally controlled sites using self-signed certificates. + - If set to C(false), the SSL certificates will not be validated. + - This should only set to C(false) used on personally controlled sites using self-signed certificates. type: bool - default: yes + default: true ssl: description: - Use https instead of http to connect to InfluxDB server. diff --git a/plugins/doc_fragments/ipa.py b/plugins/doc_fragments/ipa.py index 47bcee60ba..5051c55390 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 @@ -60,10 +61,10 @@ options: validate_certs: description: - This only applies if C(ipa_prot) is I(https). - - If set to C(no), the SSL certificates will not be validated. - - This should only set to C(no) used on personally controlled sites using self-signed certificates. + - If set to C(false), the SSL certificates will not be validated. + - This should only set to C(false) used on personally controlled sites using self-signed certificates. type: bool - default: yes + default: true ipa_timeout: description: - Specifies idle timeout (in seconds) for the connection. diff --git a/plugins/doc_fragments/keycloak.py b/plugins/doc_fragments/keycloak.py index fab9a6e894..5d79fad7c0 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 @@ -60,7 +61,7 @@ options: description: - Verify TLS certificates (do not disable this in production). type: bool - default: yes + default: true connection_timeout: description: @@ -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..28e9d2fdae 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 @@ -48,13 +49,13 @@ options: description: - If true, we'll use the START_TLS LDAP extension. type: bool - default: no + default: false validate_certs: description: - - If set to C(no), SSL certificates will not be validated. + - If set to C(false), SSL certificates will not be validated. - This should only be used on sites using self-signed certificates. type: bool - default: yes + default: true sasl_class: description: - The class to use for SASL authentication. 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..030d682385 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 @@ -39,7 +40,7 @@ options: description: - Whether SSL certificates should be verified for HTTPS requests. defaults to True. type: bool - default: yes + default: true aliases: [ verify_ssl ] ca_cert: description: 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..54288e51f6 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 @@ -62,7 +63,7 @@ options: - When the ETag Validation is enabled, the request will be conditionally processed only if the current ETag for the resource matches the ETag provided in the data. type: bool - default: yes + default: true ''' FACTSPARAMS = r''' diff --git a/plugins/doc_fragments/online.py b/plugins/doc_fragments/online.py index 4ad35bab20..d7e13765b0 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 @@ -33,7 +34,7 @@ options: description: - Validate SSL certs of the Online API. type: bool - default: yes + default: true notes: - Also see the API documentation on U(https://console.online.net/en/api/) - If C(api_token) is not set within the module, the following diff --git a/plugins/doc_fragments/opennebula.py b/plugins/doc_fragments/opennebula.py index 08b614a6fc..0fc323271a 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 @@ -35,7 +36,7 @@ options: - Whether to validate the SSL certificates or not. - This parameter is ignored if PYTHONHTTPSVERIFY environment variable is used. type: bool - default: yes + default: true wait_timeout: description: - Time to wait for the desired state to be reached before timeout, in seconds. diff --git a/plugins/doc_fragments/openswitch.py b/plugins/doc_fragments/openswitch.py index 7ab7c15540..9d5f0be742 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 @@ -70,11 +71,11 @@ options: default: ssh use_ssl: description: - - Configures the I(transport) to use SSL if set to C(yes) only when the + - Configures the I(transport) to use SSL if set to C(true) only when the I(transport) argument is configured as rest. If the transport argument is not I(rest), this value is ignored. type: bool - default: yes + default: true provider: description: - Convenience method that allows all I(openswitch) arguments to be passed as 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..5293819199 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 @@ -14,7 +15,7 @@ class ModuleDocFragment(object): idempotent operation, and doesn't create the resource if it already exists. Setting this option to true, forcefully creates a copy of the resource, even if it already exists.This option is mutually exclusive with I(key_by). - default: False + default: false type: bool key_by: description: The list of comma-separated attributes of this resource which should be used to uniquely 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..ce7ea776e2 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 @@ -11,15 +12,15 @@ class ModuleDocFragment(object): options: wait: description: Whether to wait for create or delete operation to complete. - default: yes + default: true type: bool wait_timeout: - description: Time, in seconds, to wait when I(wait=yes). + description: Time, in seconds, to wait when I(wait=true). default: 1200 type: int wait_until: - description: The lifecycle state to wait for the resource to transition into when I(wait=yes). By default, - when I(wait=yes), we wait for the resource to get into ACTIVE/ATTACHED/AVAILABLE/PROVISIONED/ + description: The lifecycle state to wait for the resource to transition into when I(wait=true). By default, + when I(wait=true), we wait for the resource to get into ACTIVE/ATTACHED/AVAILABLE/PROVISIONED/ RUNNING applicable lifecycle state during create operation & to get into DELETED/DETACHED/ TERMINATED lifecycle state during delete operation. type: str 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..e39af4f3a6 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 @@ -37,10 +38,10 @@ options: version_added: 1.3.0 validate_certs: description: - - If C(no), SSL certificates will not be validated. + - If C(false), SSL certificates will not be validated. - This should only be used on personally controlled sites using self-signed certificates. type: bool - default: no + default: false requirements: [ "proxmoxer", "requests" ] ''' 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..b08d11dbb0 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 @@ -39,7 +40,7 @@ options: description: - Validate SSL certs of the Scaleway API. type: bool - default: yes + default: true notes: - Also see the API documentation on U(https://developer.scaleway.com/) - If C(api_token) is not set within the module, the following diff --git a/plugins/doc_fragments/utm.py b/plugins/doc_fragments/utm.py index 413fb49675..d8b2305d23 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 @@ -42,7 +43,7 @@ options: description: - Whether the REST interface's ssl certificate should be verified or not. type: bool - default: yes + default: true state: description: - The desired state of the object. diff --git a/plugins/doc_fragments/vexata.py b/plugins/doc_fragments/vexata.py index d541d5ad85..ff79613eec 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 @@ -39,10 +40,10 @@ options: validate_certs: description: - Allows connection when SSL certificates are not valid. Set to C(false) when certificates are not trusted. - - If set to C(yes), please make sure Python >= 2.7.9 is installed on the given machine. + - If set to C(true), please make sure Python >= 2.7.9 is installed on the given machine. required: false type: bool - default: 'no' + default: false requirements: - Vexata VX100 storage array with VXOS >= v3.5.0 on storage array diff --git a/plugins/doc_fragments/xenserver.py b/plugins/doc_fragments/xenserver.py index 747bf02f1b..eaee173849 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 @@ -36,5 +37,5 @@ options: - Allows connection when SSL certificates are not valid. Set to C(false) when certificates are not trusted. - If the value is not specified in the task, the value of environment variable C(XENSERVER_VALIDATE_CERTS) will be used instead. type: bool - default: yes + default: true ''' 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..936a409aeb 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 @@ -18,7 +19,7 @@ DOCUMENTATION = ''' options: plugin: description: The name of this plugin, it should always be set to C(community.general.cobbler) for this plugin to recognize it as it's own. - required: yes + required: true choices: [ 'cobbler', 'community.general.cobbler' ] url: description: URL to cobbler. @@ -27,18 +28,18 @@ DOCUMENTATION = ''' - name: COBBLER_SERVER user: description: Cobbler authentication user. - required: no + required: false env: - name: COBBLER_USER password: description: Cobbler authentication password - required: no + required: false env: - name: COBBLER_PASSWORD cache_fallback: description: Fallback to cached results if connection to cobbler fails type: boolean - default: no + default: false exclude_profiles: description: - Profiles to exclude from inventory. @@ -69,7 +70,7 @@ DOCUMENTATION = ''' want_facts: description: Toggle, if C(true) the plugin will retrieve host facts from the server type: boolean - default: yes + default: true ''' EXAMPLES = ''' @@ -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..d68b8d4e28 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) @@ -54,7 +55,7 @@ DOCUMENTATION = ''' verbose_output: description: Toggle to (not) include all available nodes metadata type: bool - default: yes + default: true ''' EXAMPLES = ''' @@ -65,7 +66,7 @@ host: https://gitlab.com # Example using constructed features to create groups and set ansible_host plugin: community.general.gitlab_runners host: https://gitlab.com -strict: False +strict: false keyed_groups: # add e.g. amd64 hosts to an arch_amd64 group - prefix: arch 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..01a5fa04ba 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 @@ -19,7 +20,7 @@ DOCUMENTATION = ''' options: plugin: description: token that ensures this is a source file for the 'nmap' plugin. - required: True + required: true choices: ['nmap', 'community.general.nmap'] sudo: description: Set to C(true) to execute a C(sudo nmap) plugin scan. @@ -28,7 +29,7 @@ DOCUMENTATION = ''' type: boolean address: description: Network IP or range of IPs to scan, you can use a simple range (10.2.2.15-25) or CIDR notation. - required: True + required: true exclude: description: list of addresses to exclude type: list @@ -36,15 +37,15 @@ DOCUMENTATION = ''' ports: description: Enable/disable scanning for open ports type: boolean - default: True + default: true ipv4: description: use IPv4 type addresses type: boolean - default: True + default: true ipv6: description: use IPv6 type addresses type: boolean - default: True + default: true notes: - At least one of ipv4 or ipv6 is required to be True, both can be True, but they cannot both be False. - 'TODO: add OS fingerprinting' @@ -52,14 +53,14 @@ DOCUMENTATION = ''' EXAMPLES = ''' # inventory.config file in YAML format plugin: community.general.nmap -strict: False +strict: false address: 192.168.0.0/24 # a sudo nmap scan to fully use nmap scan power. plugin: community.general.nmap sudo: true -strict: False +strict: false address: 192.168.0.0/24 ''' diff --git a/plugins/inventory/online.py b/plugins/inventory/online.py index 00454f558c..261548d8a2 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 @@ -15,10 +16,10 @@ DOCUMENTATION = r''' options: plugin: description: token that ensures this is a source file for the 'online' plugin. - required: True + required: true choices: ['online', 'community.general.online'] oauth_token: - required: True + required: true description: Online OAuth token. env: # in order of precedence diff --git a/plugins/inventory/opennebula.py b/plugins/inventory/opennebula.py index 7822240627..603920edc2 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) @@ -33,7 +34,7 @@ DOCUMENTATION = r''' - If not set then the value of the C(ONE_URL) environment variable is used. env: - name: ONE_URL - required: True + required: true type: string api_username: description: @@ -48,7 +49,7 @@ DOCUMENTATION = r''' - If not set, the value of the C(ONE_PASSWORD) environment variable is used. env: - name: ONE_PASSWORD - required: False + required: false type: string api_authfile: description: @@ -57,7 +58,7 @@ DOCUMENTATION = r''' - Set environment variable C(ONE_AUTH) to override this path. env: - name: ONE_AUTH - required: False + required: false type: string hostname: description: Field to match the hostname. Note C(v4_first_ip) corresponds to the first IPv4 found on VM. @@ -73,7 +74,7 @@ DOCUMENTATION = r''' group_by_labels: description: Create host groups by vm labels type: bool - default: True + default: true ''' EXAMPLES = r''' diff --git a/plugins/inventory/proxmox.py b/plugins/inventory/proxmox.py index e0734b33e3..e4474e6e6e 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 @@ -25,7 +26,7 @@ DOCUMENTATION = ''' options: plugin: description: The name of this plugin, it should always be set to C(community.general.proxmox) for this plugin to recognize it as it's own. - required: yes + required: true choices: ['community.general.proxmox'] type: str url: @@ -43,7 +44,7 @@ DOCUMENTATION = ''' - Proxmox authentication user. - If the value is not specified in the inventory configuration, the value of environment variable C(PROXMOX_USER) will be used instead. - Since community.general 4.7.0 you can also use templating to specify the value of the I(user). - required: yes + required: true type: str env: - name: PROXMOX_USER @@ -82,7 +83,7 @@ DOCUMENTATION = ''' validate_certs: description: Verify SSL certificate if using HTTPS. type: boolean - default: yes + default: true group_prefix: description: Prefix to apply to Proxmox groups. default: proxmox_ @@ -92,9 +93,21 @@ DOCUMENTATION = ''' default: proxmox_ type: str want_facts: - description: Gather LXC/QEMU configuration facts. - default: no + 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: false 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: false + 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..6aacc9f665 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) @@ -18,7 +19,7 @@ DOCUMENTATION = r''' options: plugin: description: Token that ensures this is a source file for the 'scaleway' plugin. - required: True + required: true choices: ['scaleway', 'community.general.scaleway'] regions: description: Filter results on a specific Scaleway region. 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..829fc7b971 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 @@ -19,12 +20,12 @@ DOCUMENTATION = ''' options: plugin: description: token that ensures this is a source file for the 'virtualbox' plugin - required: True + required: true choices: ['virtualbox', 'community.general.virtualbox'] running_only: description: toggles showing all vms vs only those currently running type: boolean - default: False + default: false settings_password_file: description: provide a file containing the settings password (equivalent to --settingspwfile) network_info_path: diff --git a/plugins/inventory/xen_orchestra.py b/plugins/inventory/xen_orchestra.py index cc2346a1aa..5a466a6ab0 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 @@ -23,7 +24,7 @@ DOCUMENTATION = ''' options: plugin: description: The name of this plugin, it should always be set to C(community.general.xen_orchestra) for this plugin to recognize it as its own. - required: yes + required: true choices: ['community.general.xen_orchestra'] type: str api_host: @@ -37,7 +38,7 @@ DOCUMENTATION = ''' description: - Xen Orchestra user. - If the value is not specified in the inventory configuration, the value of environment variable C(ANSIBLE_XO_USER) will be used instead. - required: yes + required: true type: str env: - name: ANSIBLE_XO_USER @@ -45,7 +46,7 @@ DOCUMENTATION = ''' description: - Xen Orchestra password. - If the value is not specified in the inventory configuration, the value of environment variable C(ANSIBLE_XO_PASSWORD) will be used instead. - required: yes + required: true type: str env: - name: ANSIBLE_XO_PASSWORD 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..516d153389 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 @@ -17,7 +18,7 @@ DOCUMENTATION = ''' _raw: description: - a set of lists - required: True + required: true ''' EXAMPLES = """ diff --git a/plugins/lookup/chef_databag.py b/plugins/lookup/chef_databag.py index f5ccc766c2..b14d924ae8 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,16 +17,16 @@ 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: - Name of the databag - required: True + required: true item: description: - Item to fetch - required: True + required: true ''' EXAMPLES = """ 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..2d4a202d94 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 @@ -24,7 +25,7 @@ DOCUMENTATION = ''' recurse: type: boolean description: If true, will retrieve all the values that have the given key as prefix. - default: False + default: false index: description: - If the key has a value with the specified index then this is returned allowing access to historical values. @@ -55,7 +56,7 @@ DOCUMENTATION = ''' - Whether to use http or https. - If you use C(ANSIBLE_CONSUL_URL) this value will be used from there. validate_certs: - default: True + default: true description: Whether to verify the ssl connection or not. env: - name: ANSIBLE_CONSUL_VALIDATE_CERTS 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..00dd81d7f7 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 @@ -21,10 +22,10 @@ DOCUMENTATION = ''' default: '/opt/CARKaim/sdk/clipasswordsdk' appid: description: Defines the unique ID of the application that is issuing the password request. - required: True + required: true query: description: Describes the filter criteria for the password retrieval. - required: True + required: true output: description: - Specifies the desired output fields separated by commas. 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..abf3e64b60 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 @@ -16,7 +17,7 @@ DOCUMENTATION = ''' options: _terms: description: domain or list of domains to query TXT records from - required: True + required: true type: list elements: string ''' 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..d6a12293e3 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 @@ -33,7 +21,7 @@ DOCUMENTATION = ''' - the list of keys to lookup on the etcd server type: list elements: string - required: True + required: true url: description: - Environment variable with the url for the etcd server @@ -49,7 +37,7 @@ DOCUMENTATION = ''' validate_certs: description: - toggle checking that the ssl certificates are valid, you normally only want to turn this off with self-signed certs. - default: True + default: true type: boolean ''' diff --git a/plugins/lookup/etcd3.py b/plugins/lookup/etcd3.py index a34fae7bf3..df41d791e8 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 @@ -23,12 +24,12 @@ DOCUMENTATION = ''' - The list of keys (or key prefixes) to look up on the etcd3 server. type: list elements: str - required: True + required: true prefix: description: - Look for key or prefix key. type: bool - default: False + default: false endpoints: description: - Counterpart of C(ETCDCTL_ENDPOINTS) environment variable. diff --git a/plugins/lookup/filetree.py b/plugins/lookup/filetree.py index 1c83486b05..13b3d71e43 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 @@ -17,7 +18,7 @@ description: options: _terms: description: path(s) of files to read - required: True + required: true ''' EXAMPLES = r""" @@ -45,7 +46,7 @@ EXAMPLES = r""" dest: /web/{{ item.path }} state: link follow: false # avoid corrupting target files if the link already exists - force: yes + force: true mode: '{{ item.mode }}' with_community.general.filetree: web/ when: item.state == 'link' diff --git a/plugins/lookup/flattened.py b/plugins/lookup/flattened.py index edc546ff83..25098fa23a 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 @@ -14,7 +15,7 @@ DOCUMENTATION = ''' options: _terms: description: lists to flatten - required: True + required: true notes: - unlike 'items' which only flattens 1 level, this plugin will continue to flatten until it cannot find lists anymore. - aka highlander plugin, there can only be one (list). diff --git a/plugins/lookup/hiera.py b/plugins/lookup/hiera.py index 5b440469eb..055d16133b 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 @@ -20,7 +21,7 @@ DOCUMENTATION = ''' - The list of keys to lookup on the Puppetmaster type: list elements: string - required: True + required: true _bin_file: description: - Binary file to execute Hiera 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..9d2913063a 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 @@ -19,24 +20,24 @@ DOCUMENTATION = ''' matched resources will be returned. type: list elements: string - required: False + required: false api_token: description: - manifold API token type: string - required: True + required: true env: - name: MANIFOLD_API_TOKEN project: description: - The project label you want to get the resource for. type: string - required: False + required: false team: description: - The team label you want to get the resource for. type: string - required: False + required: false ''' EXAMPLES = ''' diff --git a/plugins/lookup/onepassword.py b/plugins/lookup/onepassword.py index e0be0cd27e..42e07e9cbf 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 @@ -21,7 +22,7 @@ DOCUMENTATION = ''' options: _terms: description: identifier(s) (UUID, name, or subdomain; case-insensitive) of item(s) to retrieve. - required: True + required: true field: description: field to return from each matching item (case-insensitive). default: 'password' diff --git a/plugins/lookup/onepassword_raw.py b/plugins/lookup/onepassword_raw.py index d1958f78cd..9a1e0741a0 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 @@ -21,7 +22,7 @@ DOCUMENTATION = ''' options: _terms: description: identifier(s) (UUID, name, or domain; case-insensitive) of item(s) to retrieve. - required: True + required: true master_password: description: The password used to unlock the specified vault. aliases: ['vault_password'] diff --git a/plugins/lookup/passwordstore.py b/plugins/lookup/passwordstore.py index a221e49625..ce1f4ee852 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 @@ -19,10 +20,16 @@ DOCUMENTATION = ''' options: _terms: description: query key. - required: True + 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: @@ -34,7 +41,7 @@ DOCUMENTATION = ''' overwrite: description: Overwrite the password if it does already exist. type: bool - default: 'no' + default: false umask: description: - Sets the umask for the created .gpg files. The first octed must be greater than 3 (user readable). @@ -45,7 +52,7 @@ DOCUMENTATION = ''' returnall: description: Return all the content of the password, not only the first line. type: bool - default: 'no' + default: false subkey: description: Return a specific subkey of the password. When set to C(password), always returns the first line. default: password @@ -56,13 +63,13 @@ DOCUMENTATION = ''' type: integer default: 16 backup: - description: Used with C(overwrite=yes). Backup the previous password in a subkey. + description: Used with C(overwrite=true). Backup the previous password in a subkey. type: bool - default: 'no' + default: false nosymbols: description: use alphanumeric characters. type: bool - default: 'no' + default: false missing: description: - List of preference about what to do if the password file is missing. @@ -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..c1aaef83ce 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 @@ -16,10 +17,10 @@ DOCUMENTATION = ''' description: sets of key value pairs of parameters key: description: key to query - required: True + required: true file: description: path to shelve file - required: True + required: true ''' EXAMPLES = """ diff --git a/plugins/lookup/tss.py b/plugins/lookup/tss.py index 880e6e3833..935b5f4b46 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 @@ -170,19 +171,29 @@ try: HAS_TSS_SDK = True except ImportError: - SecretServer = None - SecretServerError = None - HAS_TSS_SDK = False + try: + from delinea.secrets.server import SecretServer, SecretServerError + + HAS_TSS_SDK = True + except ImportError: + SecretServer = None + SecretServerError = None + HAS_TSS_SDK = False try: from thycotic.secrets.server import PasswordGrantAuthorizer, DomainPasswordGrantAuthorizer, AccessTokenAuthorizer HAS_TSS_AUTHORIZER = True except ImportError: - PasswordGrantAuthorizer = None - DomainPasswordGrantAuthorizer = None - AccessTokenAuthorizer = None - HAS_TSS_AUTHORIZER = False + try: + from delinea.secrets.server import PasswordGrantAuthorizer, DomainPasswordGrantAuthorizer, AccessTokenAuthorizer + + HAS_TSS_AUTHORIZER = True + except ImportError: + PasswordGrantAuthorizer = None + DomainPasswordGrantAuthorizer = None + AccessTokenAuthorizer = None + HAS_TSS_AUTHORIZER = False display = Display() 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..8210793c76 100644 --- a/plugins/module_utils/alicloud_ecs.py +++ b/plugins/module_utils/alicloud_ecs.py @@ -7,13 +7,15 @@ # # 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 import os import json +import traceback from ansible.module_utils.basic import env_fallback try: @@ -27,8 +29,11 @@ try: import footmark.dns import footmark.ram import footmark.market + + FOOTMARK_IMP_ERR = None HAS_FOOTMARK = True except ImportError: + FOOTMARK_IMP_ERR = traceback.format_exc() HAS_FOOTMARK = False 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..3ed338b401 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 @@ -13,10 +14,9 @@ from ansible.module_utils.common.text.converters import to_native from ansible_collections.community.general.plugins.module_utils.version import LooseVersion try: - from urllib import quote_plus # Python 2.X from urlparse import urljoin except ImportError: - from urllib.parse import quote_plus, urljoin # Python 3+ + from urllib.parse import urljoin # Python 3+ import traceback @@ -26,6 +26,7 @@ try: import requests HAS_GITLAB_PACKAGE = True except Exception: + gitlab = None GITLAB_IMP_ERR = traceback.format_exc() HAS_GITLAB_PACKAGE = False @@ -63,6 +64,14 @@ def find_group(gitlab_instance, identifier): return project +def ensure_gitlab_package(module): + if not HAS_GITLAB_PACKAGE: + module.fail_json( + msg=missing_required_lib("python-gitlab", url='https://python-gitlab.readthedocs.io/en/stable/'), + exception=GITLAB_IMP_ERR + ) + + def gitlab_authentication(module): gitlab_url = module.params['api_url'] validate_certs = module.params['validate_certs'] @@ -72,8 +81,7 @@ def gitlab_authentication(module): gitlab_oauth_token = module.params['api_oauth_token'] gitlab_job_token = module.params['api_job_token'] - if not HAS_GITLAB_PACKAGE: - module.fail_json(msg=missing_required_lib("python-gitlab"), exception=GITLAB_IMP_ERR) + ensure_gitlab_package(module) try: # python-gitlab library remove support for username/password authentication since 1.13.0 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..464d1110d7 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 @@ -201,6 +202,16 @@ class RedfishUtils(object): def _init_session(self): pass + def _get_vendor(self): + response = self.get_request(self.root_uri + self.service_root) + if response['ret'] is False: + return {'ret': False, 'Vendor': ''} + data = response['data'] + if 'Vendor' in data: + return {'ret': True, 'Vendor': data["Vendor"]} + else: + return {'ret': True, 'Vendor': ''} + def _find_accountservice_resource(self): response = self.get_request(self.root_uri + self.service_root) if response['ret'] is False: @@ -1888,14 +1899,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 +2071,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 = {} @@ -2162,11 +2172,15 @@ class RedfishUtils(object): result["entries"] = virtualmedia_results return result - def get_multi_virtualmedia(self): + def get_multi_virtualmedia(self, resource_type='Manager'): ret = True entries = [] - resource_uris = self.manager_uris + # Given resource_type, use the proper URI + if resource_type == 'Systems': + resource_uris = self.systems_uris + elif resource_type == 'Manager': + resource_uris = self.manager_uris for resource_uri in resource_uris: virtualmedia = self.get_virtualmedia(resource_uri) @@ -2178,7 +2192,7 @@ class RedfishUtils(object): @staticmethod def _find_empty_virt_media_slot(resources, media_types, - media_match_strict=True): + media_match_strict=True, vendor=''): for uri, data in resources.items(): # check MediaTypes if 'MediaTypes' in data and media_types: @@ -2187,6 +2201,9 @@ class RedfishUtils(object): else: if media_match_strict: continue + # Base on current Lenovo server capability, filter out slot RDOC1/2 and Remote1/2/3/4 which are not supported to Insert/Eject. + if vendor == 'Lenovo' and ('RDOC' in uri or 'Remote' in uri): + continue # if ejected, 'Inserted' should be False and 'ImageName' cleared if (not data.get('Inserted', False) and not data.get('ImageName')): @@ -2225,7 +2242,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 +2256,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,23 +2270,17 @@ 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: return response return {'ret': True, 'changed': True, 'msg': "VirtualMedia inserted"} - def virtual_media_insert(self, options): + def virtual_media_insert(self, options, resource_type='Manager'): param_map = { 'Inserted': 'inserted', 'WriteProtected': 'write_protected', @@ -2280,7 +2297,12 @@ class RedfishUtils(object): media_types = options.get('media_types') # locate and read the VirtualMedia resources - response = self.get_request(self.root_uri + self.manager_uri) + # Given resource_type, use the proper URI + if resource_type == 'Systems': + resource_uri = self.systems_uri + elif resource_type == 'Manager': + resource_uri = self.manager_uri + response = self.get_request(self.root_uri + resource_uri) if response['ret'] is False: return response data = response['data'] @@ -2289,7 +2311,14 @@ class RedfishUtils(object): # Some hardware (such as iLO 4) only supports the Image property on the PATCH operation # Inserted and WriteProtected are not writable - if data["FirmwareVersion"].startswith("iLO 4"): + if "FirmwareVersion" in data and 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"] @@ -2309,12 +2338,13 @@ class RedfishUtils(object): # find an empty slot to insert the media # try first with strict media_type matching + vendor = self._get_vendor()['Vendor'] uri, data = self._find_empty_virt_media_slot( - resources, media_types, media_match_strict=True) + resources, media_types, media_match_strict=True, vendor=vendor) if not uri: # if not found, try without strict media_type matching uri, data = self._find_empty_virt_media_slot( - resources, media_types, media_match_strict=False) + resources, media_types, media_match_strict=False, vendor=vendor) if not uri: return {'ret': False, 'msg': "Unable to find an available VirtualMedia resource " @@ -2346,7 +2376,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: @@ -2372,14 +2402,19 @@ class RedfishUtils(object): return {'ret': True, 'changed': True, 'msg': "VirtualMedia ejected"} - def virtual_media_eject(self, options): + def virtual_media_eject(self, options, resource_type='Manager'): image_url = options.get('image_url') if not image_url: return {'ret': False, 'msg': "image_url option required for VirtualMediaEject"} # locate and read the VirtualMedia resources - response = self.get_request(self.root_uri + self.manager_uri) + # Given resource_type, use the proper URI + if resource_type == 'Systems': + resource_uri = self.systems_uri + elif resource_type == 'Manager': + resource_uri = self.manager_uri + response = self.get_request(self.root_uri + resource_uri) if response['ret'] is False: return response data = response['data'] @@ -2389,7 +2424,10 @@ class RedfishUtils(object): # Some hardware (such as iLO 4) only supports the Image property on the PATCH operation # Inserted is not writable image_only = False - if data["FirmwareVersion"].startswith("iLO 4"): + if "FirmwareVersion" in data and data["FirmwareVersion"].startswith("iLO 4"): + image_only = True + + if 'Supermicro' in data['Oem']: image_only = True virt_media_uri = data["VirtualMedia"]["@odata.id"] @@ -3020,3 +3058,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 -# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) +# Copyright (c) 2019, Sandeep Kasargod +# 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/wdc_redfish_utils.py b/plugins/module_utils/wdc_redfish_utils.py new file mode 100644 index 0000000000..d27e02d7b7 --- /dev/null +++ b/plugins/module_utils/wdc_redfish_utils.py @@ -0,0 +1,520 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2022 Western Digital Corporation +# 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 + +import datetime +import re +import time +import tarfile + +from ansible.module_utils.urls import fetch_file +from ansible_collections.community.general.plugins.module_utils.redfish_utils import RedfishUtils + +from ansible.module_utils.six.moves.urllib.parse import urlparse, urlunparse + + +class WdcRedfishUtils(RedfishUtils): + """Extension to RedfishUtils to support WDC enclosures.""" + # Status codes returned by WDC FW Update Status + UPDATE_STATUS_CODE_READY_FOR_FW_UPDATE = 0 + UPDATE_STATUS_CODE_FW_UPDATE_IN_PROGRESS = 1 + UPDATE_STATUS_CODE_FW_UPDATE_COMPLETED_WAITING_FOR_ACTIVATION = 2 + UPDATE_STATUS_CODE_FW_UPDATE_FAILED = 3 + + # Status messages returned by WDC FW Update Status + UPDATE_STATUS_MESSAGE_READY_FOR_FW_UDPATE = "Ready for FW update" + UDPATE_STATUS_MESSAGE_FW_UPDATE_IN_PROGRESS = "FW update in progress" + UPDATE_STATUS_MESSAGE_FW_UPDATE_COMPLETED_WAITING_FOR_ACTIVATION = "FW update completed. Waiting for activation." + UPDATE_STATUS_MESSAGE_FW_UPDATE_FAILED = "FW update failed." + + # Dict keys for resource bodies + # Standard keys + ACTIONS = "Actions" + OEM = "Oem" + WDC = "WDC" + TARGET = "target" + + # Keys for specific operations + CHASSIS_LOCATE = "#Chassis.Locate" + CHASSIS_POWER_MODE = "#Chassis.PowerMode" + + def __init__(self, + creds, + root_uris, + timeout, + module, + resource_id, + data_modification): + super(WdcRedfishUtils, self).__init__(creds=creds, + root_uri=root_uris[0], + timeout=timeout, + module=module, + resource_id=resource_id, + data_modification=data_modification) + # Update the root URI if we cannot perform a Redfish GET to the first one + self._set_root_uri(root_uris) + + def _set_root_uri(self, root_uris): + """Set the root URI from a list of options. + + If the current root URI is good, just keep it. Else cycle through our options until we find a good one. + A URI is considered good if we can GET uri/redfish/v1. + """ + for root_uri in root_uris: + uri = root_uri + "/redfish/v1" + response = self.get_request(uri) + if response['ret']: + self.root_uri = root_uri + break + + def _find_updateservice_resource(self): + """Find the update service resource as well as additional WDC-specific resources.""" + response = super(WdcRedfishUtils, self)._find_updateservice_resource() + if not response['ret']: + return response + return self._find_updateservice_additional_uris() + + def _is_enclosure_multi_tenant(self): + """Determine if the enclosure is multi-tenant. + + The serial number of a multi-tenant enclosure will end in "-A" or "-B". + + :return: True/False if the enclosure is multi-tenant or not; None if unable to determine. + """ + response = self.get_request(self.root_uri + self.service_root + "Chassis/Enclosure") + if response['ret'] is False: + return None + pattern = r".*-[A,B]" + data = response['data'] + return re.match(pattern, data['SerialNumber']) is not None + + def _find_updateservice_additional_uris(self): + """Find & set WDC-specific update service URIs""" + response = self.get_request(self.root_uri + self._update_uri()) + if response['ret'] is False: + return response + data = response['data'] + if 'Actions' not in data: + return {'ret': False, 'msg': 'Service does not support SimpleUpdate'} + if '#UpdateService.SimpleUpdate' not in data['Actions']: + return {'ret': False, 'msg': 'Service does not support SimpleUpdate'} + action = data['Actions']['#UpdateService.SimpleUpdate'] + if 'target' not in action: + return {'ret': False, 'msg': 'Service does not support SimpleUpdate'} + self.simple_update_uri = action['target'] + + # Simple update status URI is not provided via GET /redfish/v1/UpdateService + # So we have to hard code it. + self.simple_update_status_uri = "{0}/Status".format(self.simple_update_uri) + + # FWActivate URI + if 'Oem' not in data['Actions']: + return {'ret': False, 'msg': 'Service does not support OEM operations'} + if 'WDC' not in data['Actions']['Oem']: + return {'ret': False, 'msg': 'Service does not support WDC operations'} + if '#UpdateService.FWActivate' not in data['Actions']['Oem']['WDC']: + return {'ret': False, 'msg': 'Service does not support FWActivate'} + action = data['Actions']['Oem']['WDC']['#UpdateService.FWActivate'] + if 'target' not in action: + return {'ret': False, 'msg': 'Service does not support FWActivate'} + self.firmware_activate_uri = action['target'] + return {'ret': True} + + def _simple_update_status_uri(self): + return self.simple_update_status_uri + + def _firmware_activate_uri(self): + return self.firmware_activate_uri + + def _update_uri(self): + return self.update_uri + + def get_simple_update_status(self): + """Issue Redfish HTTP GET to return the simple update status""" + result = {} + response = self.get_request(self.root_uri + self._simple_update_status_uri()) + if response['ret'] is False: + return response + result['ret'] = True + data = response['data'] + result['entries'] = data + return result + + def firmware_activate(self, update_opts): + """Perform FWActivate using Redfish HTTP API.""" + creds = update_opts.get('update_creds') + payload = {} + if creds: + if creds.get('username'): + payload["Username"] = creds.get('username') + if creds.get('password'): + payload["Password"] = creds.get('password') + + # Make sure the service supports FWActivate + response = self.get_request(self.root_uri + self._update_uri()) + if response['ret'] is False: + return response + data = response['data'] + if 'Actions' not in data: + return {'ret': False, 'msg': 'Service does not support FWActivate'} + + response = self.post_request(self.root_uri + self._firmware_activate_uri(), payload) + if response['ret'] is False: + return response + return {'ret': True, 'changed': True, + 'msg': "FWActivate requested"} + + def _get_bundle_version(self, + bundle_uri): + """Get the firmware version from a bundle file, and whether or not it is multi-tenant. + + Only supports HTTP at this time. Assumes URI exists and is a tarfile. + Looks for a file oobm-[version].pkg, such as 'oobm-4.0.13.pkg`. Extracts the version number + from that filename (in the above example, the version number is "4.0.13". + + To determine if the bundle is multi-tenant or not, it looks inside the .bin file within the tarfile, + and checks the appropriate byte in the file. + + :param str bundle_uri: HTTP URI of the firmware bundle. + :return: Firmware version number contained in the bundle, and whether or not the bundle is multi-tenant. + Either value will be None if unable to deterine. + :rtype: str or None, bool or None + """ + bundle_temp_filename = fetch_file(module=self.module, + url=bundle_uri) + if not tarfile.is_tarfile(bundle_temp_filename): + return None, None + tf = tarfile.open(bundle_temp_filename) + pattern_pkg = r"oobm-(.+)\.pkg" + pattern_bin = r"(.*\.bin)" + bundle_version = None + is_multi_tenant = None + for filename in tf.getnames(): + match_pkg = re.match(pattern_pkg, filename) + if match_pkg is not None: + bundle_version = match_pkg.group(1) + match_bin = re.match(pattern_bin, filename) + if match_bin is not None: + bin_filename = match_bin.group(1) + bin_file = tf.extractfile(bin_filename) + bin_file.seek(11) + byte_11 = bin_file.read(1) + is_multi_tenant = byte_11 == b'\x80' + + return bundle_version, is_multi_tenant + + @staticmethod + def uri_is_http(uri): + """Return True if the specified URI is http or https. + + :param str uri: A URI. + :return: True if the URI is http or https, else False + :rtype: bool + """ + parsed_bundle_uri = urlparse(uri) + return parsed_bundle_uri.scheme.lower() in ['http', 'https'] + + def update_and_activate(self, update_opts): + """Update and activate the firmware in a single action. + + Orchestrates the firmware update so that everything can be done in a single command. + Compares the update version with the already-installed version -- skips update if they are the same. + Performs retries, handles timeouts as needed. + + """ + # Convert credentials to standard HTTP format + if update_opts.get("update_creds") is not None and "username" in update_opts["update_creds"] and "password" in update_opts["update_creds"]: + update_creds = update_opts["update_creds"] + parsed_url = urlparse(update_opts["update_image_uri"]) + if update_creds: + original_netloc = parsed_url.netloc + parsed_url = parsed_url._replace(netloc="{0}:{1}@{2}".format(update_creds.get("username"), + update_creds.get("password"), + original_netloc)) + update_opts["update_image_uri"] = urlunparse(parsed_url) + del update_opts["update_creds"] + + # Make sure bundle URI is HTTP(s) + bundle_uri = update_opts["update_image_uri"] + + if not self.uri_is_http(bundle_uri): + return { + 'ret': False, + 'msg': 'Bundle URI must be HTTP or HTTPS' + } + # Make sure IOM is ready for update + result = self.get_simple_update_status() + if result['ret'] is False: + return result + update_status = result['entries'] + status_code = update_status['StatusCode'] + status_description = update_status['Description'] + if status_code not in [ + self.UPDATE_STATUS_CODE_READY_FOR_FW_UPDATE, + self.UPDATE_STATUS_CODE_FW_UPDATE_FAILED + ]: + return { + 'ret': False, + 'msg': 'Target is not ready for FW update. Current status: {0} ({1})'.format( + status_code, status_description + )} + + # Check the FW version in the bundle file, and compare it to what is already on the IOMs + + # Bundle version number + bundle_firmware_version, is_bundle_multi_tenant = self._get_bundle_version(bundle_uri) + if bundle_firmware_version is None or is_bundle_multi_tenant is None: + return { + 'ret': False, + 'msg': 'Unable to extract bundle version or multi-tenant status from update image tarfile' + } + + # Verify that the bundle is correctly multi-tenant or not + is_enclosure_multi_tenant = self._is_enclosure_multi_tenant() + if is_enclosure_multi_tenant != is_bundle_multi_tenant: + return { + 'ret': False, + 'msg': 'Enclosure multi-tenant is {0} but bundle multi-tenant is {1}'.format( + is_enclosure_multi_tenant, + is_bundle_multi_tenant, + ) + } + + # Version number installed on IOMs + firmware_inventory = self.get_firmware_inventory() + if not firmware_inventory["ret"]: + return firmware_inventory + firmware_inventory_dict = {} + for entry in firmware_inventory["entries"]: + firmware_inventory_dict[entry["Id"]] = entry + iom_a_firmware_version = firmware_inventory_dict.get("IOModuleA_OOBM", {}).get("Version") + iom_b_firmware_version = firmware_inventory_dict.get("IOModuleB_OOBM", {}).get("Version") + # If version is None, we will proceed with the update, because we cannot tell + # for sure that we have a full version match. + if is_enclosure_multi_tenant: + # For multi-tenant, only one of the IOMs will be affected by the firmware update, + # so see if that IOM already has the same firmware version as the bundle. + firmware_already_installed = bundle_firmware_version == self._get_installed_firmware_version_of_multi_tenant_system( + iom_a_firmware_version, + iom_b_firmware_version) + else: + # For single-tenant, see if both IOMs already have the same firmware version as the bundle. + firmware_already_installed = bundle_firmware_version == iom_a_firmware_version == iom_b_firmware_version + # If this FW already installed, return changed: False, and do not update the firmware. + if firmware_already_installed: + return { + 'ret': True, + 'changed': False, + 'msg': 'Version {0} already installed'.format(bundle_firmware_version) + } + + # Version numbers don't match the bundle -- proceed with update (unless we are in check mode) + if self.module.check_mode: + return { + 'ret': True, + 'changed': True, + 'msg': 'Update not performed in check mode.' + } + update_successful = False + retry_interval_seconds = 5 + max_number_of_retries = 5 + retry_number = 0 + while retry_number < max_number_of_retries and not update_successful: + if retry_number != 0: + time.sleep(retry_interval_seconds) + retry_number += 1 + + result = self.simple_update(update_opts) + if result['ret'] is not True: + # Sometimes a timeout error is returned even though the update actually was requested. + # Check the update status to see if the update is in progress. + status_result = self.get_simple_update_status() + if status_result['ret'] is False: + continue + update_status = status_result['entries'] + status_code = update_status['StatusCode'] + if status_code != self.UPDATE_STATUS_CODE_FW_UPDATE_IN_PROGRESS: + # Update is not in progress -- retry until max number of retries + continue + else: + update_successful = True + else: + update_successful = True + if not update_successful: + # Unable to get SimpleUpdate to work. Return the failure from the SimpleUpdate + return result + + # Wait for "ready to activate" + max_wait_minutes = 30 + polling_interval_seconds = 30 + status_code = self.UPDATE_STATUS_CODE_READY_FOR_FW_UPDATE + start_time = datetime.datetime.now() + # For a short time, target will still say "ready for firmware update" before it transitions + # to "update in progress" + status_codes_for_update_incomplete = [ + self.UPDATE_STATUS_CODE_FW_UPDATE_IN_PROGRESS, + self.UPDATE_STATUS_CODE_READY_FOR_FW_UPDATE + ] + iteration = 0 + while status_code in status_codes_for_update_incomplete \ + and datetime.datetime.now() - start_time < datetime.timedelta(minutes=max_wait_minutes): + if iteration != 0: + time.sleep(polling_interval_seconds) + iteration += 1 + result = self.get_simple_update_status() + if result['ret'] is False: + continue # We may get timeouts, just keep trying until we give up + update_status = result['entries'] + status_code = update_status['StatusCode'] + status_description = update_status['Description'] + if status_code == self.UPDATE_STATUS_CODE_FW_UPDATE_IN_PROGRESS: + # Once it says update in progress, "ready for update" is no longer a valid status code + status_codes_for_update_incomplete = [self.UPDATE_STATUS_CODE_FW_UPDATE_IN_PROGRESS] + + # Update no longer in progress -- verify that it finished + if status_code != self.UPDATE_STATUS_CODE_FW_UPDATE_COMPLETED_WAITING_FOR_ACTIVATION: + return { + 'ret': False, + 'msg': 'Target is not ready for FW activation after update. Current status: {0} ({1})'.format( + status_code, status_description + )} + + self.firmware_activate(update_opts) + return {'ret': True, 'changed': True, + 'msg': "Firmware updated and activation initiated."} + + def _get_installed_firmware_version_of_multi_tenant_system(self, + iom_a_firmware_version, + iom_b_firmware_version): + """Return the version for the active IOM on a multi-tenant system. + + Only call this on a multi-tenant system. + Given the installed firmware versions for IOM A, B, this method will determine which IOM is active + for this tenanat, and return that IOM's firmware version. + """ + # To determine which IOM we are on, try to GET each IOM resource + # The one we are on will return valid data. + # The other will return an error with message "IOM Module A/B cannot be read" + which_iom_is_this = None + for iom_letter in ['A', 'B']: + iom_uri = "Chassis/IOModule{0}FRU".format(iom_letter) + response = self.get_request(self.root_uri + self.service_root + iom_uri) + if response['ret'] is False: + continue + data = response['data'] + if "Id" in data: # Assume if there is an "Id", it is valid + which_iom_is_this = iom_letter + break + if which_iom_is_this == 'A': + return iom_a_firmware_version + elif which_iom_is_this == 'B': + return iom_b_firmware_version + else: + return None + + @staticmethod + def _get_led_locate_uri(data): + """Get the LED locate URI given a resource body.""" + if WdcRedfishUtils.ACTIONS not in data: + return None + if WdcRedfishUtils.OEM not in data[WdcRedfishUtils.ACTIONS]: + return None + if WdcRedfishUtils.WDC not in data[WdcRedfishUtils.ACTIONS][WdcRedfishUtils.OEM]: + return None + if WdcRedfishUtils.CHASSIS_LOCATE not in data[WdcRedfishUtils.ACTIONS][WdcRedfishUtils.OEM][WdcRedfishUtils.WDC]: + return None + if WdcRedfishUtils.TARGET not in data[WdcRedfishUtils.ACTIONS][WdcRedfishUtils.OEM][WdcRedfishUtils.WDC][WdcRedfishUtils.CHASSIS_LOCATE]: + return None + return data[WdcRedfishUtils.ACTIONS][WdcRedfishUtils.OEM][WdcRedfishUtils.WDC][WdcRedfishUtils.CHASSIS_LOCATE][WdcRedfishUtils.TARGET] + + @staticmethod + def _get_power_mode_uri(data): + """Get the Power Mode URI given a resource body.""" + if WdcRedfishUtils.ACTIONS not in data: + return None + if WdcRedfishUtils.OEM not in data[WdcRedfishUtils.ACTIONS]: + return None + if WdcRedfishUtils.WDC not in data[WdcRedfishUtils.ACTIONS][WdcRedfishUtils.OEM]: + return None + if WdcRedfishUtils.CHASSIS_POWER_MODE not in data[WdcRedfishUtils.ACTIONS][WdcRedfishUtils.OEM][WdcRedfishUtils.WDC]: + return None + if WdcRedfishUtils.TARGET not in data[WdcRedfishUtils.ACTIONS][WdcRedfishUtils.OEM][WdcRedfishUtils.WDC][WdcRedfishUtils.CHASSIS_POWER_MODE]: + return None + return data[WdcRedfishUtils.ACTIONS][WdcRedfishUtils.OEM][WdcRedfishUtils.WDC][WdcRedfishUtils.CHASSIS_POWER_MODE][WdcRedfishUtils.TARGET] + + def manage_indicator_led(self, command, resource_uri): + key = 'IndicatorLED' + + payloads = {'IndicatorLedOn': 'On', 'IndicatorLedOff': 'Off'} + current_led_status_map = {'IndicatorLedOn': 'Blinking', 'IndicatorLedOff': 'Off'} + + result = {} + response = self.get_request(self.root_uri + resource_uri) + if response['ret'] is False: + return response + result['ret'] = True + data = response['data'] + if key not in data: + return {'ret': False, 'msg': "Key %s not found" % key} + current_led_status = data[key] + if current_led_status == current_led_status_map[command]: + return {'ret': True, 'changed': False} + + led_locate_uri = self._get_led_locate_uri(data) + if led_locate_uri is None: + return {'ret': False, 'msg': 'LED locate URI not found.'} + + if command in payloads.keys(): + payload = {'LocateState': payloads[command]} + response = self.post_request(self.root_uri + led_locate_uri, payload) + if response['ret'] is False: + return response + else: + return {'ret': False, 'msg': 'Invalid command'} + + return result + + def manage_chassis_power_mode(self, command): + return self.manage_power_mode(command, self.chassis_uri) + + def manage_power_mode(self, command, resource_uri=None): + if resource_uri is None: + resource_uri = self.chassis_uri + + payloads = {'PowerModeNormal': 'Normal', 'PowerModeLow': 'Low'} + requested_power_mode = payloads[command] + + result = {} + response = self.get_request(self.root_uri + resource_uri) + if response['ret'] is False: + return response + result['ret'] = True + data = response['data'] + + # Make sure the response includes Oem.WDC.PowerMode, and get current power mode + power_mode = 'PowerMode' + if WdcRedfishUtils.OEM not in data or WdcRedfishUtils.WDC not in data[WdcRedfishUtils.OEM] or\ + power_mode not in data[WdcRedfishUtils.OEM][WdcRedfishUtils.WDC]: + return {'ret': False, 'msg': 'Resource does not support Oem.WDC.PowerMode'} + current_power_mode = data[WdcRedfishUtils.OEM][WdcRedfishUtils.WDC][power_mode] + if current_power_mode == requested_power_mode: + return {'ret': True, 'changed': False} + + power_mode_uri = self._get_power_mode_uri(data) + if power_mode_uri is None: + return {'ret': False, 'msg': 'Power Mode URI not found.'} + + if command in payloads.keys(): + payload = {'PowerMode': payloads[command]} + response = self.post_request(self.root_uri + power_mode_uri, payload) + if response['ret'] is False: + return response + else: + return {'ret': False, 'msg': 'Invalid command'} + + return result diff --git a/plugins/module_utils/xenserver.py b/plugins/module_utils/xenserver.py index 015b10215e..3176b56289 100644 --- a/plugins/module_utils/xenserver.py +++ b/plugins/module_utils/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/module_utils/xfconf.py b/plugins/module_utils/xfconf.py new file mode 100644 index 0000000000..b63518d0c4 --- /dev/null +++ b/plugins/module_utils/xfconf.py @@ -0,0 +1,38 @@ +# -*- 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 + + +@fmt.unpack_args +def _values_fmt(values, value_types): + result = [] + for value, value_type in zip(values, value_types): + if value_type == 'bool': + value = 'true' if boolean(value) else 'false' + result.extend(['--type', '{0}'.format(value_type), '--set', '{0}'.format(value)]) + return result + + +def xfconf_runner(module, **kwargs): + runner = CmdRunner( + module, + command='xfconf-query', + arg_formats=dict( + channel=fmt.as_opt_val("--channel"), + property=fmt.as_opt_val("--property"), + force_array=fmt.as_bool("--force-array"), + reset=fmt.as_bool("--reset"), + create=fmt.as_bool("--create"), + list_arg=fmt.as_bool("--list"), + values_and_types=fmt.as_func(_values_fmt), + ), + **kwargs + ) + return runner diff --git a/plugins/modules/cloud/alicloud/ali_instance.py b/plugins/modules/cloud/alicloud/ali_instance.py index 09754ccdba..4acec0a109 100644 --- a/plugins/modules/cloud/alicloud/ali_instance.py +++ b/plugins/modules/cloud/alicloud/ali_instance.py @@ -2,7 +2,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 # # This file is part of Ansible # @@ -45,12 +46,12 @@ options: type: str image_id: description: - - Image ID used to launch instances. Required when C(state=present) and creating new ECS instances. + - Image ID used to launch instances. Required when I(state=present) and creating new ECS instances. aliases: ['image'] type: str instance_type: description: - - Instance type used to launch instances. Required when C(state=present) and creating new ECS instances. + - Instance type used to launch instances. Required when I(state=present) and creating new ECS instances. aliases: ['type'] type: str security_groups: @@ -89,7 +90,7 @@ options: max_bandwidth_out: description: - Maximum outgoing bandwidth to the public network, measured in Mbps (Megabits per second). - Required when C(allocate_public_ip=True). Ignored when C(allocate_public_ip=False). + Required when I(allocate_public_ip=true). Ignored when I(allocate_public_ip=false). default: 0 type: int host_name: @@ -100,7 +101,7 @@ options: description: - Specifies whether to add sequential suffixes to the host_name. The sequential suffix ranges from 001 to 999. - default: False + default: false type: bool version_added: '0.2.0' password: @@ -142,7 +143,7 @@ options: allocate_public_ip: description: - Whether allocate a public ip for the new instance. - default: False + default: false aliases: [ 'assign_public_ip' ] type: bool instance_charge_type: @@ -153,7 +154,7 @@ options: type: str period: description: - - The charge duration of the instance, in month. Required when C(instance_charge_type=PrePaid). + - The charge duration of the instance, in months. Required when I(instance_charge_type=PrePaid). - The valid value are [1-9, 12, 24, 36]. default: 1 type: int @@ -161,10 +162,10 @@ options: description: - Whether automate renew the charge of the instance. type: bool - default: False + default: false auto_renew_period: description: - - The duration of the automatic renew the charge of the instance. Required when C(auto_renew=True). + - The duration of the automatic renew the charge of the instance. Required when I(auto_renew=true). choices: [1, 2, 3, 6, 12] type: int instance_ids: @@ -176,7 +177,7 @@ options: force: description: - Whether the current operation needs to be execute forcibly. - default: False + default: false type: bool tags: description: @@ -188,7 +189,7 @@ options: description: - Delete any tags not specified in the task that are on the instance. If True, it means you have to specify all the desired tags on each task affecting an instance. - default: False + default: false type: bool version_added: '0.2.0' key_name: @@ -216,32 +217,32 @@ options: version_added: '0.2.0' spot_strategy: description: - - The bidding mode of the pay-as-you-go instance. This parameter is valid when InstanceChargeType is set to PostPaid. + - The bidding mode of the pay-as-you-go instance. This parameter is valid when InstanceChargeType is set to PostPaid. choices: ['NoSpot', 'SpotWithPriceLimit', 'SpotAsPriceGo'] default: 'NoSpot' type: str version_added: '0.2.0' period_unit: description: - - The duration unit that you will buy the resource. It is valid when C(instance_charge_type=PrePaid) + - The duration unit that you will buy the resource. It is valid when I(instance_charge_type=PrePaid). choices: ['Month', 'Week'] default: 'Month' type: str version_added: '0.2.0' dry_run: description: - - Specifies whether to send a dry-run request. - - If I(dry_run=True), Only a dry-run request is sent and no instance is created. The system checks whether the - required parameters are set, and validates the request format, service permissions, and available ECS instances. - If the validation fails, the corresponding error code is returned. If the validation succeeds, the DryRunOperation error code is returned. - - If I(dry_run=False), A request is sent. If the validation succeeds, the instance is created. - default: False + - Specifies whether to send a dry-run request. + - If I(dry_run=true), Only a dry-run request is sent and no instance is created. The system checks whether the + required parameters are set, and validates the request format, service permissions, and available ECS instances. + If the validation fails, the corresponding error code is returned. If the validation succeeds, the DryRunOperation error code is returned. + - If I(dry_run=false), A request is sent. If the validation succeeds, the instance is created. + default: false type: bool version_added: '0.2.0' include_data_disks: description: - - Whether to change instance disks charge type when changing instance charge type. - default: True + - Whether to change instance disks charge type when changing instance charge type. + default: true type: bool version_added: '0.2.0' author: @@ -264,7 +265,7 @@ EXAMPLES = ''' image: ubuntu1404_64_40G_cloudinit_20160727.raw instance_type: ecs.n4.small vswitch_id: vsw-abcd1234 - assign_public_ip: True + assign_public_ip: true max_bandwidth_out: 10 host_name: myhost password: mypassword @@ -274,7 +275,7 @@ EXAMPLES = ''' security_groups: ["sg-f2rwnfh23r"] instance_ids: ["i-abcd12346", "i-abcd12345"] - force: True + force: true tasks: - name: Launch ECS instance in VPC network @@ -616,18 +617,10 @@ ids: import re import time -import traceback from ansible.module_utils.basic import AnsibleModule, missing_required_lib -from ansible_collections.community.general.plugins.module_utils.alicloud_ecs import ecs_argument_spec, ecs_connect - -HAS_FOOTMARK = False -FOOTMARK_IMP_ERR = None -try: - from footmark.exception import ECSResponseError - HAS_FOOTMARK = True -except ImportError: - FOOTMARK_IMP_ERR = traceback.format_exc() - HAS_FOOTMARK = False +from ansible_collections.community.general.plugins.module_utils.alicloud_ecs import ( + ecs_argument_spec, ecs_connect, FOOTMARK_IMP_ERR, HAS_FOOTMARK +) def get_instances_info(connection, ids): diff --git a/plugins/modules/cloud/alicloud/ali_instance_info.py b/plugins/modules/cloud/alicloud/ali_instance_info.py index 2331db69a6..4b758477a3 100644 --- a/plugins/modules/cloud/alicloud/ali_instance_info.py +++ b/plugins/modules/cloud/alicloud/ali_instance_info.py @@ -2,7 +2,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 # # This file is part of Ansible # @@ -340,18 +341,10 @@ ids: sample: [i-12345er, i-3245fs] ''' -import traceback from ansible.module_utils.basic import AnsibleModule, missing_required_lib -from ansible_collections.community.general.plugins.module_utils.alicloud_ecs import ecs_argument_spec, ecs_connect - -HAS_FOOTMARK = False -FOOTMARK_IMP_ERR = None -try: - from footmark.exception import ECSResponseError - HAS_FOOTMARK = True -except ImportError: - FOOTMARK_IMP_ERR = traceback.format_exc() - HAS_FOOTMARK = False +from ansible_collections.community.general.plugins.module_utils.alicloud_ecs import ( + ecs_argument_spec, ecs_connect, FOOTMARK_IMP_ERR, HAS_FOOTMARK +) def main(): diff --git a/plugins/modules/cloud/atomic/atomic_container.py b/plugins/modules/cloud/atomic/atomic_container.py index a6be44317b..586b1254c2 100644 --- a/plugins/modules/cloud/atomic/atomic_container.py +++ b/plugins/modules/cloud/atomic/atomic_container.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -25,18 +26,18 @@ options: backend: description: - Define the backend to use for the container. - required: True + required: true choices: ["docker", "ostree"] type: str name: description: - Name of the container. - required: True + required: true type: str image: description: - The image to use to install the container. - required: True + required: true type: str rootfs: description: @@ -88,7 +89,7 @@ msg: description: The command standard output returned: always type: str - sample: [u'Using default tag: latest ...'] + sample: 'Using default tag: latest ...' ''' # import module snippets diff --git a/plugins/modules/cloud/atomic/atomic_host.py b/plugins/modules/cloud/atomic/atomic_host.py index 85b00f917a..5aa389e174 100644 --- a/plugins/modules/cloud/atomic/atomic_host.py +++ b/plugins/modules/cloud/atomic/atomic_host.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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/modules/cloud/atomic/atomic_image.py b/plugins/modules/cloud/atomic/atomic_image.py index 350ad4c2ae..2705304f01 100644 --- a/plugins/modules/cloud/atomic/atomic_image.py +++ b/plugins/modules/cloud/atomic/atomic_image.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -30,7 +31,7 @@ options: name: description: - Name of the container image. - required: True + required: true type: str state: description: @@ -43,7 +44,7 @@ options: description: - Start or Stop the container. type: bool - default: 'yes' + default: true ''' EXAMPLES = r''' @@ -64,7 +65,7 @@ msg: description: The command standard output returned: always type: str - sample: [u'Using default tag: latest ...'] + sample: 'Using default tag: latest ...' ''' import traceback diff --git a/plugins/modules/cloud/centurylink/clc_aa_policy.py b/plugins/modules/cloud/centurylink/clc_aa_policy.py index 416a4a6c1f..d5d56b2a65 100644 --- a/plugins/modules/cloud/centurylink/clc_aa_policy.py +++ b/plugins/modules/cloud/centurylink/clc_aa_policy.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright (c) 2015 CenturyLink -# 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 @@ -18,17 +19,17 @@ options: description: - The name of the Anti Affinity Policy. type: str - required: True + required: true location: description: - Datacenter in which the policy lives/should live. type: str - required: True + required: true state: description: - Whether to create or delete the policy. type: str - required: False + required: false default: present choices: ['present','absent'] requirements: @@ -54,7 +55,7 @@ EXAMPLES = ''' --- - name: Create AA Policy hosts: localhost - gather_facts: False + gather_facts: false connection: local tasks: - name: Create an Anti Affinity Policy @@ -70,7 +71,7 @@ EXAMPLES = ''' - name: Delete AA Policy hosts: localhost - gather_facts: False + gather_facts: false connection: local tasks: - name: Delete an Anti Affinity Policy diff --git a/plugins/modules/cloud/centurylink/clc_alert_policy.py b/plugins/modules/cloud/centurylink/clc_alert_policy.py index 424e73cce2..c7f02c2ffa 100644 --- a/plugins/modules/cloud/centurylink/clc_alert_policy.py +++ b/plugins/modules/cloud/centurylink/clc_alert_policy.py @@ -3,7 +3,8 @@ # # Copyright (c) 2015 CenturyLink -# 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 @@ -19,7 +20,7 @@ options: description: - The alias of your CLC Account type: str - required: True + required: true name: description: - The name of the alert policy. This is mutually exclusive with id @@ -80,7 +81,7 @@ EXAMPLES = ''' --- - name: Create Alert Policy Example hosts: localhost - gather_facts: False + gather_facts: false connection: local tasks: - name: Create an Alert Policy for disk above 80% for 5 minutes @@ -101,7 +102,7 @@ EXAMPLES = ''' - name: Delete Alert Policy Example hosts: localhost - gather_facts: False + gather_facts: false connection: local tasks: - name: Delete an Alert Policy diff --git a/plugins/modules/cloud/centurylink/clc_blueprint_package.py b/plugins/modules/cloud/centurylink/clc_blueprint_package.py index 9e0bfa809c..0dc29b0ce0 100644 --- a/plugins/modules/cloud/centurylink/clc_blueprint_package.py +++ b/plugins/modules/cloud/centurylink/clc_blueprint_package.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright (c) 2015 CenturyLink -# 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 @@ -18,24 +19,24 @@ options: description: - A list of server Ids to deploy the blue print package. type: list - required: True + required: true elements: str package_id: description: - The package id of the blue print. type: str - required: True + required: true package_params: description: - The dictionary of arguments required to deploy the blue print. type: dict default: {} - required: False + required: false state: description: - Whether to install or uninstall the package. Currently it supports only "present" for install action. type: str - required: False + required: false default: present choices: ['present'] wait: @@ -43,7 +44,7 @@ options: - Whether to wait for the tasks to finish before returning. type: str default: 'True' - required: False + required: false requirements: - python = 2.7 - requests >= 2.5.0 diff --git a/plugins/modules/cloud/centurylink/clc_firewall_policy.py b/plugins/modules/cloud/centurylink/clc_firewall_policy.py index f1f4a2f22a..cc77238db9 100644 --- a/plugins/modules/cloud/centurylink/clc_firewall_policy.py +++ b/plugins/modules/cloud/centurylink/clc_firewall_policy.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright (c) 2015 CenturyLink -# 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 @@ -18,7 +19,7 @@ options: description: - Target datacenter for the firewall policy type: str - required: True + required: true state: description: - Whether to create or delete the firewall policy @@ -52,7 +53,7 @@ options: description: - CLC alias for the source account type: str - required: True + required: true destination_account_alias: description: - CLC alias for the destination account @@ -89,7 +90,7 @@ EXAMPLES = ''' --- - name: Create Firewall Policy hosts: localhost - gather_facts: False + gather_facts: false connection: local tasks: - name: Create / Verify an Firewall Policy at CenturyLink Cloud @@ -104,7 +105,7 @@ EXAMPLES = ''' - name: Delete Firewall Policy hosts: localhost - gather_facts: False + gather_facts: false connection: local tasks: - name: Delete an Firewall Policy at CenturyLink Cloud diff --git a/plugins/modules/cloud/centurylink/clc_group.py b/plugins/modules/cloud/centurylink/clc_group.py index 5e131719f5..21e6d93d28 100644 --- a/plugins/modules/cloud/centurylink/clc_group.py +++ b/plugins/modules/cloud/centurylink/clc_group.py @@ -3,7 +3,8 @@ # # Copyright (c) 2015 CenturyLink -# 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 @@ -19,23 +20,23 @@ options: description: - The name of the Server Group type: str - required: True + required: true description: description: - A description of the Server Group type: str - required: False + required: false parent: description: - The parent group of the server group. If parent is not provided, it creates the group at top level. type: str - required: False + required: false location: description: - Datacenter to create the group in. If location is not provided, the group gets created in the default datacenter associated with the account type: str - required: False + required: false state: description: - Whether to create or delete the group @@ -46,8 +47,8 @@ options: description: - Whether to wait for the tasks to finish before returning. type: bool - default: True - required: False + default: true + required: false requirements: - python = 2.7 - requests >= 2.5.0 @@ -72,7 +73,7 @@ EXAMPLES = ''' --- - name: Create Server Group hosts: localhost - gather_facts: False + gather_facts: false connection: local tasks: - name: Create / Verify a Server Group at CenturyLink Cloud @@ -89,7 +90,7 @@ EXAMPLES = ''' # Delete a Server Group - name: Delete Server Group hosts: localhost - gather_facts: False + gather_facts: false connection: local tasks: - name: Delete / Verify Absent a Server Group at CenturyLink Cloud diff --git a/plugins/modules/cloud/centurylink/clc_loadbalancer.py b/plugins/modules/cloud/centurylink/clc_loadbalancer.py index 94a815e6ef..d13c2d76ce 100644 --- a/plugins/modules/cloud/centurylink/clc_loadbalancer.py +++ b/plugins/modules/cloud/centurylink/clc_loadbalancer.py @@ -3,7 +3,8 @@ # # Copyright (c) 2015 CenturyLink # -# 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 @@ -19,7 +20,7 @@ options: description: - The name of the loadbalancer type: str - required: True + required: true description: description: - A description for the loadbalancer @@ -28,12 +29,12 @@ options: description: - The alias of your CLC Account type: str - required: True + required: true location: description: - The location of the datacenter where the load balancer resides in type: str - required: True + required: true method: description: -The balancing method for the load balancer pool diff --git a/plugins/modules/cloud/centurylink/clc_modify_server.py b/plugins/modules/cloud/centurylink/clc_modify_server.py index 27cdf614ec..ff0611e3f8 100644 --- a/plugins/modules/cloud/centurylink/clc_modify_server.py +++ b/plugins/modules/cloud/centurylink/clc_modify_server.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright (c) 2015 CenturyLink -# 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 @@ -18,7 +19,7 @@ options: description: - A list of server Ids to modify. type: list - required: True + required: true elements: str cpu: description: @@ -58,7 +59,7 @@ options: description: - Whether to wait for the provisioning tasks to finish before returning. type: bool - default: 'yes' + default: true requirements: - python = 2.7 - requests >= 2.5.0 diff --git a/plugins/modules/cloud/centurylink/clc_publicip.py b/plugins/modules/cloud/centurylink/clc_publicip.py index 3b4fcc4eed..98d392adf9 100644 --- a/plugins/modules/cloud/centurylink/clc_publicip.py +++ b/plugins/modules/cloud/centurylink/clc_publicip.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright (c) 2015 CenturyLink -# 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 @@ -29,7 +30,7 @@ options: description: - A list of servers to create public ips on. type: list - required: True + required: true elements: str state: description: @@ -42,7 +43,7 @@ options: description: - Whether to wait for the tasks to finish before returning. type: bool - default: 'yes' + default: true requirements: - python = 2.7 - requests >= 2.5.0 @@ -65,7 +66,7 @@ EXAMPLES = ''' - name: Add Public IP to Server hosts: localhost - gather_facts: False + gather_facts: false connection: local tasks: - name: Create Public IP For Servers @@ -85,7 +86,7 @@ EXAMPLES = ''' - name: Delete Public IP from Server hosts: localhost - gather_facts: False + gather_facts: false connection: local tasks: - name: Create Public IP For Servers diff --git a/plugins/modules/cloud/centurylink/clc_server.py b/plugins/modules/cloud/centurylink/clc_server.py index b58e39edd7..062c5ea411 100644 --- a/plugins/modules/cloud/centurylink/clc_server.py +++ b/plugins/modules/cloud/centurylink/clc_server.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright (c) 2015 CenturyLink -# 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 @@ -24,7 +25,7 @@ options: description: - Whether to add a public ip to the server type: bool - default: 'no' + default: false alias: description: - The account alias to provision the servers under. @@ -95,8 +96,8 @@ options: description: - Whether to create the server as 'Managed' or not. type: bool - default: 'no' - required: False + default: false + required: false memory: description: - Memory in GB. @@ -193,7 +194,7 @@ options: description: - Whether to wait for the provisioning tasks to finish before returning. type: bool - default: 'yes' + default: true requirements: - python = 2.7 - requests >= 2.5.0 diff --git a/plugins/modules/cloud/centurylink/clc_server_snapshot.py b/plugins/modules/cloud/centurylink/clc_server_snapshot.py index 4de4c9936e..44f52ece64 100644 --- a/plugins/modules/cloud/centurylink/clc_server_snapshot.py +++ b/plugins/modules/cloud/centurylink/clc_server_snapshot.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright (c) 2015 CenturyLink -# 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 @@ -18,26 +19,26 @@ options: description: - The list of CLC server Ids. type: list - required: True + required: true elements: str expiration_days: description: - The number of days to keep the server snapshot before it expires. type: int default: 7 - required: False + required: false state: description: - The state to insure that the provided resources are in. type: str default: 'present' - required: False + required: false choices: ['present', 'absent', 'restore'] wait: description: - Whether to wait for the provisioning tasks to finish before returning. default: 'True' - required: False + required: false type: str requirements: - python = 2.7 @@ -65,7 +66,7 @@ EXAMPLES = ''' - UC1TEST-SVR01 - UC1TEST-SVR02 expiration_days: 10 - wait: True + wait: true state: present - name: Restore server snapshot @@ -73,7 +74,7 @@ EXAMPLES = ''' server_ids: - UC1TEST-SVR01 - UC1TEST-SVR02 - wait: True + wait: true state: restore - name: Delete server snapshot @@ -81,7 +82,7 @@ EXAMPLES = ''' server_ids: - UC1TEST-SVR01 - UC1TEST-SVR02 - wait: True + wait: true state: absent ''' diff --git a/plugins/modules/cloud/dimensiondata/dimensiondata_network.py b/plugins/modules/cloud/dimensiondata/dimensiondata_network.py index 64cc8b118a..d88b4a9339 100644 --- a/plugins/modules/cloud/dimensiondata/dimensiondata_network.py +++ b/plugins/modules/cloud/dimensiondata/dimensiondata_network.py @@ -7,7 +7,8 @@ # - Bert Diwa # - Adam Friedman # -# 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/modules/cloud/dimensiondata/dimensiondata_vlan.py b/plugins/modules/cloud/dimensiondata/dimensiondata_vlan.py index 26c621f44b..b06566b8e6 100644 --- a/plugins/modules/cloud/dimensiondata/dimensiondata_vlan.py +++ b/plugins/modules/cloud/dimensiondata/dimensiondata_vlan.py @@ -1,24 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# # Copyright (c) 2016 Dimension Data -# -# This module 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. -# -# This software 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 this software. 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 # # Authors: # - Adam Friedman -# from __future__ import (absolute_import, division, print_function) __metaclass__ = type @@ -71,7 +58,7 @@ options: - If C(False), the module will fail under these conditions. - This is intended to prevent accidental expansion of a VLAN's network (since this operation is not reversible). type: bool - default: 'no' + default: false ''' EXAMPLES = ''' @@ -85,7 +72,7 @@ EXAMPLES = ''' private_ipv4_base_address: 192.168.23.0 private_ipv4_prefix_size: 24 state: present - wait: yes + wait: true - name: Read / get VLAN details community.general.dimensiondata_vlan: @@ -94,7 +81,7 @@ EXAMPLES = ''' network_domain: test_network name: my_vlan1 state: readonly - wait: yes + wait: true - name: Delete a VLAN community.general.dimensiondata_vlan: @@ -103,7 +90,7 @@ EXAMPLES = ''' network_domain: test_network name: my_vlan_1 state: absent - wait: yes + wait: true ''' RETURN = ''' diff --git a/plugins/modules/cloud/heroku/heroku_collaborator.py b/plugins/modules/cloud/heroku/heroku_collaborator.py index bbc34fdb30..e29439ca2f 100644 --- a/plugins/modules/cloud/heroku/heroku_collaborator.py +++ b/plugins/modules/cloud/heroku/heroku_collaborator.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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 @@ -35,7 +36,7 @@ options: description: - Suppress email invitation when creating collaborator type: bool - default: "no" + default: false user: type: str description: diff --git a/plugins/modules/cloud/huawei/hwc_ecs_instance.py b/plugins/modules/cloud/huawei/hwc_ecs_instance.py index 3d4ba84b64..8026c0f2f6 100644 --- a/plugins/modules/cloud/huawei/hwc_ecs_instance.py +++ b/plugins/modules/cloud/huawei/hwc_ecs_instance.py @@ -2,8 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright (C) 2019 Huawei -# 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/modules/cloud/huawei/hwc_evs_disk.py b/plugins/modules/cloud/huawei/hwc_evs_disk.py index 4aec1b94db..e319821c9f 100644 --- a/plugins/modules/cloud/huawei/hwc_evs_disk.py +++ b/plugins/modules/cloud/huawei/hwc_evs_disk.py @@ -2,8 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright (C) 2019 Huawei -# 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/modules/cloud/huawei/hwc_network_vpc.py b/plugins/modules/cloud/huawei/hwc_network_vpc.py index f53369adcd..2f08f20313 100644 --- a/plugins/modules/cloud/huawei/hwc_network_vpc.py +++ b/plugins/modules/cloud/huawei/hwc_network_vpc.py @@ -2,8 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright (C) 2018 Huawei -# 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/modules/cloud/huawei/hwc_smn_topic.py b/plugins/modules/cloud/huawei/hwc_smn_topic.py index f7fb4faea4..3752e1f18f 100644 --- a/plugins/modules/cloud/huawei/hwc_smn_topic.py +++ b/plugins/modules/cloud/huawei/hwc_smn_topic.py @@ -2,8 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright (C) 2019 Huawei -# 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/modules/cloud/huawei/hwc_vpc_eip.py b/plugins/modules/cloud/huawei/hwc_vpc_eip.py index b53395f87a..a86338052e 100644 --- a/plugins/modules/cloud/huawei/hwc_vpc_eip.py +++ b/plugins/modules/cloud/huawei/hwc_vpc_eip.py @@ -2,8 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright (C) 2019 Huawei -# 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 @@ -135,7 +135,7 @@ EXAMPLES = ''' hwc_vpc_subnet: gateway_ip: "192.168.100.32" name: "ansible_network_subnet_test" - dhcp_enable: True + dhcp_enable: true vpc_id: "{{ vpc.id }}" cidr: "192.168.100.0/26" register: subnet diff --git a/plugins/modules/cloud/huawei/hwc_vpc_peering_connect.py b/plugins/modules/cloud/huawei/hwc_vpc_peering_connect.py index a4d5921b77..89955d2091 100644 --- a/plugins/modules/cloud/huawei/hwc_vpc_peering_connect.py +++ b/plugins/modules/cloud/huawei/hwc_vpc_peering_connect.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # # Copyright (C) 2019 Huawei -# GNU General Public License v3.0+ (see COPYING or +# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or SPDX-License-Identifier: GPL-3.0-or-later # https://www.gnu.org/licenses/gpl-3.0.txt) diff --git a/plugins/modules/cloud/huawei/hwc_vpc_port.py b/plugins/modules/cloud/huawei/hwc_vpc_port.py index cf0718f59b..dadc76c064 100644 --- a/plugins/modules/cloud/huawei/hwc_vpc_port.py +++ b/plugins/modules/cloud/huawei/hwc_vpc_port.py @@ -2,8 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright (C) 2019 Huawei -# 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 @@ -119,7 +119,7 @@ EXAMPLES = ''' hwc_vpc_subnet: gateway_ip: "192.168.100.32" name: "ansible_network_subnet_test" - dhcp_enable: True + dhcp_enable: true vpc_id: "{{ vpc.id }}" cidr: "192.168.100.0/26" register: subnet diff --git a/plugins/modules/cloud/huawei/hwc_vpc_private_ip.py b/plugins/modules/cloud/huawei/hwc_vpc_private_ip.py index 901755f362..e05c14f74d 100644 --- a/plugins/modules/cloud/huawei/hwc_vpc_private_ip.py +++ b/plugins/modules/cloud/huawei/hwc_vpc_private_ip.py @@ -2,8 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright (C) 2019 Huawei -# 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 +63,7 @@ EXAMPLES = ''' hwc_vpc_subnet: gateway_ip: "192.168.100.32" name: "ansible_network_subnet_test" - dhcp_enable: True + dhcp_enable: true vpc_id: "{{ vpc.id }}" cidr: "192.168.100.0/26" register: subnet diff --git a/plugins/modules/cloud/huawei/hwc_vpc_route.py b/plugins/modules/cloud/huawei/hwc_vpc_route.py index 31829dc601..e08a9ebf38 100644 --- a/plugins/modules/cloud/huawei/hwc_vpc_route.py +++ b/plugins/modules/cloud/huawei/hwc_vpc_route.py @@ -2,8 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright (C) 2019 Huawei -# 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/modules/cloud/huawei/hwc_vpc_security_group.py b/plugins/modules/cloud/huawei/hwc_vpc_security_group.py index 5a1dfe706b..2338623890 100644 --- a/plugins/modules/cloud/huawei/hwc_vpc_security_group.py +++ b/plugins/modules/cloud/huawei/hwc_vpc_security_group.py @@ -2,8 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright (C) 2019 Huawei -# 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/modules/cloud/huawei/hwc_vpc_security_group_rule.py b/plugins/modules/cloud/huawei/hwc_vpc_security_group_rule.py index f92c82764e..ca6e2e9de8 100644 --- a/plugins/modules/cloud/huawei/hwc_vpc_security_group_rule.py +++ b/plugins/modules/cloud/huawei/hwc_vpc_security_group_rule.py @@ -2,8 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright (C) 2019 Huawei -# 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/modules/cloud/huawei/hwc_vpc_subnet.py b/plugins/modules/cloud/huawei/hwc_vpc_subnet.py index ccf180502c..d38150dfc3 100644 --- a/plugins/modules/cloud/huawei/hwc_vpc_subnet.py +++ b/plugins/modules/cloud/huawei/hwc_vpc_subnet.py @@ -2,8 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright (C) 2019 Huawei -# 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 @@ -110,7 +110,7 @@ EXAMPLES = ''' cidr: "192.168.100.0/26" gateway_ip: "192.168.100.32" name: "ansible_network_subnet_test" - dhcp_enable: True + dhcp_enable: true ''' RETURN = ''' diff --git a/plugins/modules/cloud/linode/linode.py b/plugins/modules/cloud/linode/linode.py index 8c29e52a21..c19770dc41 100644 --- a/plugins/modules/cloud/linode/linode.py +++ b/plugins/modules/cloud/linode/linode.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -25,7 +26,7 @@ options: - Linode API key. - C(LINODE_API_KEY) env variable can be used instead. type: str - required: yes + required: true name: description: - Name to give the instance (alphanumeric, dashes, underscore). @@ -152,7 +153,7 @@ options: description: - Set status of Lassie watchdog. type: bool - default: "True" + default: true requirements: - python >= 2.6 - linode-python @@ -184,10 +185,10 @@ EXAMPLES = ''' datacenter: 2 distribution: 99 password: 'superSecureRootPassword' - private_ip: yes + private_ip: true ssh_pub_key: 'ssh-rsa qwerty' swap: 768 - wait: yes + wait: true wait_timeout: 600 state: present delegate_to: localhost @@ -202,21 +203,21 @@ EXAMPLES = ''' distribution: 99 kernel_id: 138 password: 'superSecureRootPassword' - private_ip: yes + private_ip: true ssh_pub_key: 'ssh-rsa qwerty' swap: 768 - wait: yes + wait: true wait_timeout: 600 state: present - alert_bwquota_enabled: True + alert_bwquota_enabled: true alert_bwquota_threshold: 80 - alert_bwin_enabled: True + alert_bwin_enabled: true alert_bwin_threshold: 10 - alert_cpu_enabled: True + alert_cpu_enabled: true alert_cpu_threshold: 210 - alert_bwout_enabled: True + alert_bwout_enabled: true alert_bwout_threshold: 10 - alert_diskio_enabled: True + alert_diskio_enabled: true alert_diskio_threshold: 10000 backupweeklyday: 1 backupwindow: 2 @@ -224,7 +225,7 @@ EXAMPLES = ''' additional_disks: - {Label: 'disk1', Size: 2500, Type: 'raw'} - {Label: 'newdisk', Size: 2000} - watchdog: True + watchdog: true delegate_to: localhost register: linode_creation @@ -238,7 +239,7 @@ EXAMPLES = ''' password: 'superSecureRootPassword' ssh_pub_key: 'ssh-rsa qwerty' swap: 768 - wait: yes + wait: true wait_timeout: 600 state: present delegate_to: localhost diff --git a/plugins/modules/cloud/linode/linode_v4.py b/plugins/modules/cloud/linode/linode_v4.py index fcf3725bfc..6ef8786af8 100644 --- a/plugins/modules/cloud/linode/linode_v4.py +++ b/plugins/modules/cloud/linode/linode_v4.py @@ -2,8 +2,8 @@ # -*- 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/modules/cloud/lxc/lxc_container.py b/plugins/modules/cloud/lxc/lxc_container.py index c8c577aba6..ddcee0c8ea 100644 --- a/plugins/modules/cloud/lxc/lxc_container.py +++ b/plugins/modules/cloud/lxc/lxc_container.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2014, Kevin Carter -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2014, Kevin Carter +# 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 @@ -90,7 +91,7 @@ options: description: - Enable a container log for host actions to the container. type: bool - default: 'no' + default: false container_log_level: choices: - Info @@ -118,13 +119,13 @@ options: - This is not supported by all container storage backends. - Enabling this may fail if the backing store does not support snapshots. type: bool - default: 'no' + default: false archive: description: - Create an archive of a container. - This will create a tarball of the running container. type: bool - default: 'no' + default: false archive_path: description: - Path the save the archived container. @@ -412,7 +413,7 @@ lxc_container: description: if the container was cloned returned: success, when clone_name is specified type: bool - sample: True + sample: true """ import os diff --git a/plugins/modules/cloud/lxd/lxd_container.py b/plugins/modules/cloud/lxd/lxd_container.py index 27f8409bc8..c96271bda4 100644 --- a/plugins/modules/cloud/lxd/lxd_container.py +++ b/plugins/modules/cloud/lxd/lxd_container.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2016, Hiroaki Nakamura -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, Hiroaki Nakamura +# 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,10 +192,10 @@ notes: 2.1, the later requires python to be installed in the instance which can be done with the command module. - You can copy a file from the host to the instance - with the Ansible M(ansible.builtin.copy) and M(ansible.builtin.template) module and the `lxd` connection plugin. + with the Ansible M(ansible.builtin.copy) and M(ansible.builtin.template) module and the C(community.general.lxd) connection plugin. See the example below. - You can copy a file in the created instance to the localhost - with `command=lxc file pull instance_name/dir/filename filename`. + with C(command=lxc file pull instance_name/dir/filename filename). See the first example below. ''' @@ -393,7 +394,7 @@ actions: description: List of actions performed for the instance. returned: success type: list - sample: '["create", "start"]' + sample: ["create", "start"] ''' import datetime import os diff --git a/plugins/modules/cloud/lxd/lxd_profile.py b/plugins/modules/cloud/lxd/lxd_profile.py index 82244f0bac..3d1b28b8fc 100644 --- a/plugins/modules/cloud/lxd/lxd_profile.py +++ b/plugins/modules/cloud/lxd/lxd_profile.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2016, Hiroaki Nakamura -# Copyright: (c) 2020, Frank Dornheim -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, Hiroaki Nakamura +# Copyright (c) 2020, 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 @@ -222,7 +223,7 @@ actions: description: List of actions performed for the profile. returned: success type: list - sample: '["create"]' + sample: ["create"] ''' import os @@ -360,7 +361,7 @@ class LXDProfileManagement(object): ) def _merge_dicts(self, source, destination): - """Merge Dictionarys + """Merge Dictionaries Get a list of filehandle numbers from logger to be handed to DaemonContext.files_preserve diff --git a/plugins/modules/cloud/lxd/lxd_project.py b/plugins/modules/cloud/lxd/lxd_project.py index d1488272c8..f0aa4058e7 100644 --- a/plugins/modules/cloud/lxd/lxd_project.py +++ b/plugins/modules/cloud/lxd/lxd_project.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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 @@ -303,7 +304,7 @@ class LXDProjectManagement(object): ) def _merge_dicts(self, source, destination): - """ Return a new dict taht merge two dict, + """ Return a new dict that merge two dict, with values in source dict overwrite destination dict Args: diff --git a/plugins/modules/cloud/memset/memset_dns_reload.py b/plugins/modules/cloud/memset/memset_dns_reload.py index 6eefe133fd..580740d1a3 100644 --- a/plugins/modules/cloud/memset/memset_dns_reload.py +++ b/plugins/modules/cloud/memset/memset_dns_reload.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright (c) 2018, Simon Weald -# 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 @@ -41,7 +42,7 @@ EXAMPLES = ''' - name: Submit DNS reload and poll community.general.memset_dns_reload: api_key: 5eb86c9196ab03919abcf03857163741 - poll: True + poll: true delegate_to: localhost ''' @@ -111,7 +112,7 @@ def poll_reload_status(api_key=None, job_id=None, payload=None): memset_api = response.json() msg = None - return(memset_api, msg, stderr) + return memset_api, msg, stderr def reload_dns(args=None): @@ -133,7 +134,7 @@ def reload_dns(args=None): retvals['failed'] = has_failed retvals['memset_api'] = response.json() retvals['msg'] = msg - return(retvals) + return retvals # set changed to true if the reload request was accepted. has_changed = True @@ -153,7 +154,7 @@ def reload_dns(args=None): if val is not None: retvals[val] = eval(val) - return(retvals) + return retvals def main(): diff --git a/plugins/modules/cloud/memset/memset_memstore_info.py b/plugins/modules/cloud/memset/memset_memstore_info.py index e880b46009..1247085ab9 100644 --- a/plugins/modules/cloud/memset/memset_memstore_info.py +++ b/plugins/modules/cloud/memset/memset_memstore_info.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright (c) 2018, Simon Weald -# 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 @@ -127,7 +128,7 @@ def get_facts(args=None): retvals['failed'] = has_failed retvals['msg'] = msg retvals['stderr'] = "API returned an error: {0}" . format(response.status_code) - return(retvals) + return retvals # we don't want to return the same thing twice msg = None @@ -139,7 +140,7 @@ def get_facts(args=None): if val is not None: retvals[val] = eval(val) - return(retvals) + return retvals def main(): diff --git a/plugins/modules/cloud/memset/memset_server_info.py b/plugins/modules/cloud/memset/memset_server_info.py index 853e2c884d..b756a8338e 100644 --- a/plugins/modules/cloud/memset/memset_server_info.py +++ b/plugins/modules/cloud/memset/memset_server_info.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright (c) 2018, Simon Weald -# 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 @@ -252,7 +253,7 @@ def get_facts(args=None): retvals['failed'] = has_failed retvals['msg'] = msg retvals['stderr'] = "API returned an error: {0}" . format(response.status_code) - return(retvals) + return retvals # we don't want to return the same thing twice msg = None @@ -264,7 +265,7 @@ def get_facts(args=None): if val is not None: retvals[val] = eval(val) - return(retvals) + return retvals def main(): diff --git a/plugins/modules/cloud/memset/memset_zone.py b/plugins/modules/cloud/memset/memset_zone.py index 9ef798bd74..f402e0e0f4 100644 --- a/plugins/modules/cloud/memset/memset_zone.py +++ b/plugins/modules/cloud/memset/memset_zone.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright (c) 2018, Simon Weald -# 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 @@ -139,7 +140,7 @@ def check(args=None): retvals['changed'] = has_changed retvals['failed'] = has_failed - return(retvals) + return retvals def create_zone(args=None, zone_exists=None, payload=None): @@ -185,7 +186,7 @@ def create_zone(args=None, zone_exists=None, payload=None): _has_failed, _msg, response = memset_api_call(api_key=args['api_key'], api_method=api_method, payload=payload) memset_api = response.json() - return(has_failed, has_changed, memset_api, msg) + return has_failed, has_changed, memset_api, msg def delete_zone(args=None, zone_exists=None, payload=None): @@ -233,7 +234,7 @@ def delete_zone(args=None, zone_exists=None, payload=None): else: has_failed, has_changed = False, False - return(has_failed, has_changed, memset_api, msg) + return has_failed, has_changed, memset_api, msg def create_or_delete(args=None): @@ -255,7 +256,7 @@ def create_or_delete(args=None): retvals['failed'] = _has_failed retvals['msg'] = _msg - return(retvals) + return retvals zone_exists, _msg, counter, _zone_id = get_zone_id(zone_name=args['name'], current_zones=response.json()) @@ -271,7 +272,7 @@ def create_or_delete(args=None): if val is not None: retvals[val] = eval(val) - return(retvals) + return retvals def main(): diff --git a/plugins/modules/cloud/memset/memset_zone_domain.py b/plugins/modules/cloud/memset/memset_zone_domain.py index 4aa0eada92..995c7bc8d3 100644 --- a/plugins/modules/cloud/memset/memset_zone_domain.py +++ b/plugins/modules/cloud/memset/memset_zone_domain.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright (c) 2018, Simon Weald -# 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 @@ -110,7 +111,7 @@ def check(args=None): retvals['changed'] = has_changed retvals['failed'] = has_failed - return(retvals) + return retvals def create_zone_domain(args=None, zone_exists=None, zone_id=None, payload=None): @@ -138,7 +139,7 @@ def create_zone_domain(args=None, zone_exists=None, zone_id=None, payload=None): if not has_failed: has_changed = True - return(has_failed, has_changed, msg) + return has_failed, has_changed, msg def delete_zone_domain(args=None, payload=None): @@ -165,7 +166,7 @@ def delete_zone_domain(args=None, payload=None): # unset msg as we don't want to return unnecessary info to the user. msg = None - return(has_failed, has_changed, memset_api, msg) + return has_failed, has_changed, memset_api, msg def create_or_delete_domain(args=None): @@ -188,7 +189,7 @@ def create_or_delete_domain(args=None): retvals['failed'] = has_failed retvals['msg'] = msg retvals['stderr'] = "API returned an error: {0}" . format(response.status_code) - return(retvals) + return retvals zone_exists, msg, counter, zone_id = get_zone_id(zone_name=args['zone'], current_zones=response.json()) @@ -203,7 +204,7 @@ def create_or_delete_domain(args=None): retvals['failed'] = has_failed retvals['msg'] = stderr - return(retvals) + return retvals if args['state'] == 'present': has_failed, has_changed, msg = create_zone_domain(args=args, zone_exists=zone_exists, zone_id=zone_id, payload=payload) @@ -217,7 +218,7 @@ def create_or_delete_domain(args=None): if val is not None: retvals[val] = eval(val) - return(retvals) + return retvals def main(): diff --git a/plugins/modules/cloud/memset/memset_zone_record.py b/plugins/modules/cloud/memset/memset_zone_record.py index 981d2ac47c..5082475176 100644 --- a/plugins/modules/cloud/memset/memset_zone_record.py +++ b/plugins/modules/cloud/memset/memset_zone_record.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright (c) 2018, Simon Weald -# 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 @@ -141,7 +142,7 @@ memset_api: description: Adds the current domain onto the address field for C(CNAME), C(MX), C(NS) and C(SRV) types. returned: always type: bool - sample: False + sample: false ttl: description: Record TTL. returned: always @@ -221,7 +222,7 @@ def create_zone_record(args=None, zone_id=None, records=None, payload=None): # nothing to do; record is already correct so we populate # the return var with the existing record's details. memset_api = zone_record - return(has_changed, has_failed, memset_api, msg) + return has_changed, has_failed, memset_api, msg else: # merge dicts ensuring we change any updated values payload = zone_record.copy() @@ -231,7 +232,7 @@ def create_zone_record(args=None, zone_id=None, records=None, payload=None): has_changed = True # return the new record to the user in the returned var. memset_api = new_record - return(has_changed, has_failed, memset_api, msg) + return has_changed, has_failed, memset_api, msg has_failed, msg, response = memset_api_call(api_key=args['api_key'], api_method=api_method, payload=payload) if not has_failed: has_changed = True @@ -246,7 +247,7 @@ def create_zone_record(args=None, zone_id=None, records=None, payload=None): has_changed = True # populate the return var with the new record's details. memset_api = new_record - return(has_changed, has_failed, memset_api, msg) + return has_changed, has_failed, memset_api, msg has_failed, msg, response = memset_api_call(api_key=args['api_key'], api_method=api_method, payload=payload) if not has_failed: has_changed = True @@ -254,7 +255,7 @@ def create_zone_record(args=None, zone_id=None, records=None, payload=None): # empty msg as we don't want to return a boatload of json to the user. msg = None - return(has_changed, has_failed, memset_api, msg) + return has_changed, has_failed, memset_api, msg def delete_zone_record(args=None, records=None, payload=None): @@ -270,7 +271,7 @@ def delete_zone_record(args=None, records=None, payload=None): for zone_record in records: if args['check_mode']: has_changed = True - return(has_changed, has_failed, memset_api, msg) + return has_changed, has_failed, memset_api, msg payload['id'] = zone_record['id'] api_method = 'dns.zone_record_delete' has_failed, msg, response = memset_api_call(api_key=args['api_key'], api_method=api_method, payload=payload) @@ -280,7 +281,7 @@ def delete_zone_record(args=None, records=None, payload=None): # empty msg as we don't want to return a boatload of json to the user. msg = None - return(has_changed, has_failed, memset_api, msg) + return has_changed, has_failed, memset_api, msg def create_or_delete(args=None): @@ -304,7 +305,7 @@ def create_or_delete(args=None): retvals['failed'] = _has_failed retvals['msg'] = msg retvals['stderr'] = "API returned an error: {0}" . format(response.status_code) - return(retvals) + return retvals zone_exists, _msg, counter, zone_id = get_zone_id(zone_name=args['zone'], current_zones=response.json()) @@ -317,7 +318,7 @@ def create_or_delete(args=None): retvals['failed'] = has_failed retvals['msg'] = stderr retvals['stderr'] = stderr - return(retvals) + return retvals # get a list of all records ( as we can't limit records by zone) api_method = 'dns.zone_record_list' @@ -339,7 +340,7 @@ def create_or_delete(args=None): if val is not None: retvals[val] = eval(val) - return(retvals) + return retvals def main(): diff --git a/plugins/modules/cloud/misc/cloud_init_data_facts.py b/plugins/modules/cloud/misc/cloud_init_data_facts.py index 1b44c50cbe..d02fd2301d 100644 --- a/plugins/modules/cloud/misc/cloud_init_data_facts.py +++ b/plugins/modules/cloud/misc/cloud_init_data_facts.py @@ -1,8 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# -# (c) 2018, René Moser -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2018, René Moser +# 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/modules/cloud/misc/proxmox.py b/plugins/modules/cloud/misc/proxmox.py index da8783e16d..406666f57b 100644 --- a/plugins/modules/cloud/misc/proxmox.py +++ b/plugins/modules/cloud/misc/proxmox.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -85,7 +86,7 @@ options: onboot: description: - specifies whether a VM will be started during system bootup - - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(no). + - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(false). type: bool storage: description: @@ -117,7 +118,7 @@ options: - with C(state=present) force option allow to overwrite existing container - with states C(stopped) , C(restarted) allow to force stop instance type: bool - default: 'no' + default: false purge: description: - Remove container from all related configurations. @@ -139,9 +140,11 @@ options: type: str unprivileged: description: - - Indicate if the container should be unprivileged + - Indicate if the container should be unprivileged. + - > + The default value for this parameter is C(false) but that is deprecated + and it will be replaced with C(true) in community.general 7.0.0. type: bool - default: 'no' description: description: - Specify the description for the container. Only used on the configuration web interface. @@ -238,7 +241,7 @@ EXAMPLES = r''' password: 123456 hostname: example.org ostemplate: 'local:vztmpl/ubuntu-14.04-x86_64.tar.gz' - force: yes + force: true - name: Create new container with minimal options use environment PROXMOX_PASSWORD variable(you should export it before) community.general.proxmox: @@ -368,7 +371,7 @@ EXAMPLES = r''' api_user: root@pam api_password: 1q2w3e api_host: node1 - force: yes + force: true state: stopped - name: Restart container(stopped or mounted container you can't restart) @@ -389,11 +392,10 @@ EXAMPLES = r''' ''' import time -import traceback from ansible_collections.community.general.plugins.module_utils.version import LooseVersion -from ansible.module_utils.basic import AnsibleModule, env_fallback +from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.common.text.converters import to_native from ansible_collections.community.general.plugins.module_utils.proxmox import ( @@ -565,7 +567,7 @@ def main(): purge=dict(type='bool', default=False), state=dict(default='present', choices=['present', 'absent', 'stopped', 'started', 'restarted']), pubkey=dict(type='str'), - unprivileged=dict(type='bool', default=False), + unprivileged=dict(type='bool'), description=dict(type='str'), hookscript=dict(type='str'), proxmox_default_behavior=dict(type='str', default='no_defaults', choices=['compatibility', 'no_defaults']), @@ -607,6 +609,14 @@ def main(): timeout = module.params['timeout'] clone = module.params['clone'] + if module.params['unprivileged'] is None: + module.params['unprivileged'] = False + module.deprecate( + 'The default value `false` for the parameter "unprivileged" is deprecated and it will be replaced with `true`', + version='7.0.0', + collection_name='community.general' + ) + if module.params['proxmox_default_behavior'] == 'compatibility': old_default_values = dict( disk="3", @@ -743,6 +753,8 @@ def main(): module.fail_json(msg="restarting of VM %s failed with exception: %s" % (vmid, e)) elif state == 'absent': + if not vmid: + module.exit_json(changed=False, msg='VM with hostname = %s is already absent' % hostname) try: vm = proxmox.get_vm(vmid, ignore_missing=True) if not vm: diff --git a/plugins/modules/cloud/misc/proxmox_domain_info.py b/plugins/modules/cloud/misc/proxmox_domain_info.py index 675b04a41e..2cabf5b3c7 100644 --- a/plugins/modules/cloud/misc/proxmox_domain_info.py +++ b/plugins/modules/cloud/misc/proxmox_domain_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: Tristan Le Guern (@tleguern) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright Tristan Le Guern (@tleguern) +# 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 @@ -74,7 +75,7 @@ proxmox_domains: ''' -from ansible.module_utils.basic import AnsibleModule, missing_required_lib +from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.proxmox import ( proxmox_auth_argument_spec, ProxmoxAnsible) diff --git a/plugins/modules/cloud/misc/proxmox_group_info.py b/plugins/modules/cloud/misc/proxmox_group_info.py index 58b56e856c..d2d4491ce2 100644 --- a/plugins/modules/cloud/misc/proxmox_group_info.py +++ b/plugins/modules/cloud/misc/proxmox_group_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: Tristan Le Guern -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -71,7 +72,7 @@ proxmox_groups: ''' -from ansible.module_utils.basic import AnsibleModule, missing_required_lib +from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.proxmox import ( proxmox_auth_argument_spec, ProxmoxAnsible) diff --git a/plugins/modules/cloud/misc/proxmox_kvm.py b/plugins/modules/cloud/misc/proxmox_kvm.py index 2354cb916f..dc2d6e5aae 100644 --- a/plugins/modules/cloud/misc/proxmox_kvm.py +++ b/plugins/modules/cloud/misc/proxmox_kvm.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: (c) 2016, Abdoul Bah (@helldorado) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, Abdoul Bah (@helldorado) +# 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 @@ -19,12 +20,14 @@ options: acpi: description: - Specify if ACPI should be enabled/disabled. - - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(yes). + - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(true). type: bool agent: description: - Specify if the QEMU Guest Agent should be enabled/disabled. - type: bool + - Since community.general 5.5.0, this can also be a string instead of a boolean. + This allows to specify values such as C(enabled=1,fstrim_cloned_disks=1). + type: str args: description: - Pass arbitrary arguments to kvm. @@ -35,7 +38,7 @@ options: autostart: description: - Specify if the VM should be automatically restarted after crash (currently ignored in PVE API). - - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(no). + - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(false). type: bool balloon: description: @@ -83,7 +86,7 @@ options: version_added: 1.3.0 clone: description: - - Name of VM to be cloned. If C(vmid) is setted, C(clone) can take arbitrary value but required for initiating the clone. + - Name of VM to be cloned. If I(vmid) is set, I(clone) can take an arbitrary value but is required for initiating the clone. type: str cores: description: @@ -157,7 +160,7 @@ options: description: - Allow to force stop VM. - Can be used with states C(stopped), C(restarted) and C(absent). - - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(no). + - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(false). type: bool format: description: @@ -181,7 +184,7 @@ options: - For VM templates, we try to create a linked clone by default. - Used only with clone type: bool - default: 'yes' + default: true hostpci: description: - Specify a hash/dictionary of map host pci devices into guest. C(hostpci='{"key":"value", "key":"value"}'). @@ -235,7 +238,7 @@ options: kvm: description: - Enable/disable KVM hardware virtualization. - - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(yes). + - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(true). type: bool localtime: description: @@ -311,7 +314,7 @@ options: onboot: description: - Specifies whether a VM will be started during system bootup. - - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(yes). + - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(true). type: bool ostype: description: @@ -332,7 +335,7 @@ options: type: bool reboot: description: - - Allow reboot. If set to C(yes), the VM exit on reboot. + - Allow reboot. If set to C(true), the VM exit on reboot. type: bool revert: description: @@ -434,7 +437,7 @@ options: tablet: description: - Enables/disables the USB tablet device. - - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(no). + - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(false). type: bool tags: description: @@ -456,7 +459,7 @@ options: template: description: - Enables/disables the template. - - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(no). + - This option has no default unless I(proxmox_default_behavior) is set to C(compatiblity); then the default is C(false). type: bool timeout: description: @@ -465,12 +468,12 @@ options: default: 30 update: description: - - If C(yes), the VM will be updated with new value. + - If C(true), the VM will be updated with new value. - Cause of the operations of the API and security reasons, I have disabled the update of the following parameters - C(net, virtio, ide, sata, scsi). Per example updating C(net) update the MAC address and C(virtio) create always new disk... - Update of C(pool) is disabled. It needs an additional API endpoint not covered by this module. type: bool - default: 'no' + default: false vcpus: description: - Sets number of hotplugged vcpus. @@ -577,7 +580,7 @@ EXAMPLES = ''' storage: VMs_LVM_thin format: raw efitype: 4m - pre_enrolled_keys: False + pre_enrolled_keys: false - name: Create VM with 1 10GB SATA disk and an EFI disk, with Secure Boot enabled by default community.general.proxmox_kvm: @@ -622,7 +625,7 @@ EXAMPLES = ''' name: zavala node: sabrewulf storage: VMs - full: no + full: false format: unspecified timeout: 500 @@ -656,7 +659,7 @@ EXAMPLES = ''' api_host: helldorado name: spynal node: sabrewulf - protection: yes + protection: true - name: Create new VM using cloud-init with a username and password community.general.proxmox_kvm: @@ -721,7 +724,7 @@ EXAMPLES = ''' name: spynal node: sabrewulf state: stopped - force: yes + force: true - name: Restart VM community.general.proxmox_kvm: @@ -759,7 +762,7 @@ EXAMPLES = ''' node: sabrewulf cores: 8 memory: 16384 - update: yes + update: true - name: Delete QEMU parameters community.general.proxmox_kvm: @@ -800,14 +803,13 @@ msg: import re import time -import traceback from ansible.module_utils.six.moves.urllib.parse import quote from ansible_collections.community.general.plugins.module_utils.version import LooseVersion from ansible_collections.community.general.plugins.module_utils.proxmox import (proxmox_auth_argument_spec, ProxmoxAnsible) -from ansible.module_utils.basic import AnsibleModule, missing_required_lib -from ansible.module_utils.common.text.converters import to_native +from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.parsing.convert_bool import boolean def parse_mac(netstr): @@ -959,7 +961,15 @@ class ProxmoxKvmAnsible(ProxmoxAnsible): kwargs.update(kwargs[k]) del kwargs[k] - # Rename numa_enabled to numa. According the API documentation + if 'agent' in kwargs: + try: + # The API also allows booleans instead of e.g. `enabled=1` for backward-compatibility. + kwargs['agent'] = boolean(kwargs['agent'], strict=True) + except TypeError: + # Not something that Ansible would parse as a boolean. + pass + + # Rename numa_enabled to numa, according the API documentation if 'numa_enabled' in kwargs: kwargs['numa'] = kwargs['numa_enabled'] del kwargs['numa_enabled'] @@ -1039,7 +1049,7 @@ def main(): module_args = proxmox_auth_argument_spec() kvm_args = dict( acpi=dict(type='bool'), - agent=dict(type='bool'), + agent=dict(type='str'), args=dict(type='str'), autostart=dict(type='bool'), balloon=dict(type='int'), @@ -1204,12 +1214,12 @@ def main(): # Ensure source VM id exists when cloning proxmox.get_vm(vmid) - # Ensure the choosen VM name doesn't already exist when cloning + # Ensure the chosen VM name doesn't already exist when cloning existing_vmid = proxmox.get_vmid(name, ignore_missing=True) if existing_vmid: module.exit_json(changed=False, vmid=existing_vmid, msg="VM with name <%s> already exists" % name) - # Ensure the choosen VM id doesn't already exist when cloning + # Ensure the chosen VM id doesn't already exist when cloning if proxmox.get_vm(newid, ignore_missing=True): module.exit_json(changed=False, vmid=vmid, msg="vmid %s with VM name %s already exists" % (newid, name)) @@ -1233,8 +1243,10 @@ def main(): module.exit_json(changed=False, vmid=vmid, msg="VM with vmid <%s> already exists" % vmid) elif proxmox.get_vmid(name, ignore_missing=True) and not (update or clone): module.exit_json(changed=False, vmid=proxmox.get_vmid(name), msg="VM with name <%s> already exists" % name) - elif not (node, name): - module.fail_json(msg='node, name is mandatory for creating/updating vm') + elif not node: + module.fail.json(msg='node is mandatory for creating/updating VM') + elif update and not any([vmid, name]): + module.fail_json(msg='vmid or name is mandatory for updating VM') elif not proxmox.get_node(node): module.fail_json(msg="node '%s' does not exist in cluster" % node) @@ -1370,6 +1382,8 @@ def main(): elif state == 'absent': status = {} + if not vmid: + module.exit_json(changed=False, msg='VM with name = %s is already absent' % name) try: vm = proxmox.get_vm(vmid, ignore_missing=True) if not vm: @@ -1381,7 +1395,7 @@ def main(): if module.params['force']: proxmox.stop_vm(vm, True) else: - module.exit_json(changed=False, vmid=vmid, msg="VM %s is running. Stop it before deletion or use force=yes." % vmid) + module.exit_json(changed=False, vmid=vmid, msg="VM %s is running. Stop it before deletion or use force=true." % vmid) taskid = proxmox_node.qemu.delete(vmid) if not proxmox.wait_for_task(vm['node'], taskid): module.fail_json(msg='Reached timeout while waiting for removing VM. Last line in task before timeout: %s' % diff --git a/plugins/modules/cloud/misc/proxmox_nic.py b/plugins/modules/cloud/misc/proxmox_nic.py index e83d0dfef1..49f7f91bcd 100644 --- a/plugins/modules/cloud/misc/proxmox_nic.py +++ b/plugins/modules/cloud/misc/proxmox_nic.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: (c) 2021, Lammert Hellinga (@Kogelvis) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, Lammert Hellinga (@Kogelvis) +# 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 @@ -136,7 +137,7 @@ msg: sample: "Nic net0 unchanged on VM with vmid 103" ''' -from ansible.module_utils.basic import AnsibleModule, env_fallback +from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.proxmox import (proxmox_auth_argument_spec, ProxmoxAnsible) diff --git a/plugins/modules/cloud/misc/proxmox_snap.py b/plugins/modules/cloud/misc/proxmox_snap.py index bf845e5103..9a9be8dc4d 100644 --- a/plugins/modules/cloud/misc/proxmox_snap.py +++ b/plugins/modules/cloud/misc/proxmox_snap.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: (c) 2020, Jeffrey van Pelt (@Thulium-Drake) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2020, Jeffrey van Pelt (@Thulium-Drake) +# 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 @@ -35,12 +36,12 @@ options: force: description: - For removal from config file, even if removing disk snapshot fails. - default: no + default: false type: bool vmstate: description: - Snapshot includes RAM. - default: no + default: false type: bool description: description: @@ -99,11 +100,10 @@ EXAMPLES = r''' RETURN = r'''#''' import time -import traceback -from ansible.module_utils.basic import AnsibleModule, missing_required_lib, env_fallback +from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.common.text.converters import to_native -from ansible_collections.community.general.plugins.module_utils.proxmox import (proxmox_auth_argument_spec, ProxmoxAnsible, HAS_PROXMOXER, PROXMOXER_IMP_ERR) +from ansible_collections.community.general.plugins.module_utils.proxmox import (proxmox_auth_argument_spec, ProxmoxAnsible) class ProxmoxSnapAnsible(ProxmoxAnsible): @@ -174,8 +174,8 @@ def main(): state=dict(default='present', choices=['present', 'absent', 'rollback']), description=dict(type='str'), snapname=dict(type='str', default='ansible_snap'), - force=dict(type='bool', default='no'), - vmstate=dict(type='bool', default='no'), + force=dict(type='bool', default=False), + vmstate=dict(type='bool', default=False), ) module_args.update(snap_args) diff --git a/plugins/modules/cloud/misc/proxmox_storage_info.py b/plugins/modules/cloud/misc/proxmox_storage_info.py index 265b6fbaf1..a98d3794a9 100644 --- a/plugins/modules/cloud/misc/proxmox_storage_info.py +++ b/plugins/modules/cloud/misc/proxmox_storage_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: Tristan Le Guern (@tleguern) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright Tristan Le Guern (@tleguern) +# 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 @@ -109,7 +110,7 @@ proxmox_storages: ''' -from ansible.module_utils.basic import AnsibleModule, missing_required_lib +from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.proxmox import ( proxmox_auth_argument_spec, ProxmoxAnsible, proxmox_to_ansible_bool) diff --git a/plugins/modules/cloud/misc/proxmox_tasks_info.py b/plugins/modules/cloud/misc/proxmox_tasks_info.py index ff3bf6869a..c0a3dc6886 100644 --- a/plugins/modules/cloud/misc/proxmox_tasks_info.py +++ b/plugins/modules/cloud/misc/proxmox_tasks_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2021, Andreas Botzner (@paginabianca) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, Andreas Botzner (@paginabianca) +# 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 @@ -114,7 +115,7 @@ msg: sample: 'Task: UPID:xyz:xyz does not exist on node: proxmoxnode' ''' -from ansible.module_utils.basic import AnsibleModule, missing_required_lib +from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.proxmox import ( proxmox_auth_argument_spec, ProxmoxAnsible) diff --git a/plugins/modules/cloud/misc/proxmox_template.py b/plugins/modules/cloud/misc/proxmox_template.py index 32ff8e7edb..ab6e2d88e8 100644 --- a/plugins/modules/cloud/misc/proxmox_template.py +++ b/plugins/modules/cloud/misc/proxmox_template.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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,45 +22,45 @@ options: type: str src: description: - - path to uploaded file - - required only for C(state=present) + - Path to uploaded file. + - Required only for I(state=present). type: path template: description: - - the template name - - Required for state C(absent) to delete a template. - - Required for state C(present) to download an appliance container template (pveam). + - The template name. + - Required for I(state=absent) to delete a template. + - Required for I(state=present) to download an appliance container template (pveam). type: str content_type: description: - - content type - - required only for C(state=present) + - Content type. + - Required only for I(state=present). type: str default: 'vztmpl' choices: ['vztmpl', 'iso'] storage: description: - - target storage + - Target storage. type: str default: 'local' timeout: description: - - timeout for operations + - Timeout for operations. type: int default: 30 force: description: - - can be used only with C(state=present), exists template will be overwritten + - It can only be used with I(state=present), existing template will be overwritten. type: bool - default: 'no' + default: false state: description: - - Indicate desired state of the template + - Indicate desired state of the template. type: str choices: ['present', 'absent'] default: present notes: - - Requires proxmoxer and requests modules on host. This modules can be installed with pip. + - Requires C(proxmoxer) and C(requests) modules on host. This modules can be installed with M(ansible.builtin.pip). author: Sergei Antipov (@UnderGreen) extends_documentation_fragment: community.general.proxmox.documentation ''' @@ -91,7 +92,7 @@ EXAMPLES = ''' storage: local content_type: vztmpl src: ~/ubuntu-14.04-x86_64.tar.gz - force: yes + force: true - name: Delete template with minimal options community.general.proxmox_template: @@ -116,7 +117,7 @@ EXAMPLES = ''' import os import time -from ansible.module_utils.basic import AnsibleModule, env_fallback +from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.proxmox import (proxmox_auth_argument_spec, ProxmoxAnsible) diff --git a/plugins/modules/cloud/misc/proxmox_user_info.py b/plugins/modules/cloud/misc/proxmox_user_info.py index d0ee365b7f..f1b3b881c9 100644 --- a/plugins/modules/cloud/misc/proxmox_user_info.py +++ b/plugins/modules/cloud/misc/proxmox_user_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: Tristan Le Guern -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -154,7 +155,7 @@ proxmox_users: ''' -from ansible.module_utils.basic import AnsibleModule, missing_required_lib +from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.proxmox import ( proxmox_auth_argument_spec, ProxmoxAnsible, proxmox_to_ansible_bool) diff --git a/plugins/modules/cloud/misc/rhevm.py b/plugins/modules/cloud/misc/rhevm.py index 77b40248b3..2542511bea 100644 --- a/plugins/modules/cloud/misc/rhevm.py +++ b/plugins/modules/cloud/misc/rhevm.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2016, Timothy Vandenbrande -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, Timothy Vandenbrande +# 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 @@ -44,7 +45,7 @@ options: description: - A boolean switch to make a secure or insecure connection to the server. type: bool - default: no + default: false name: description: - The name of the VM. @@ -107,7 +108,7 @@ options: description: - To make your VM High Available. type: bool - default: yes + default: true disks: description: - This option uses complex arguments and is a list of disks with the options name, size and domain. @@ -129,7 +130,7 @@ options: description: - This option sets the delete protection checkbox. type: bool - default: yes + default: true cd_drive: description: - The CD you wish to have mounted on the VM when I(state = 'CD'). @@ -148,7 +149,7 @@ vm: description: Returns all of the VMs variables and execution. returned: always type: dict - sample: '{ + sample: { "boot_order": [ "hd", "network" @@ -206,7 +207,7 @@ vm: "vmcpu": "4", "vmhost": "host416", "vmmem": "16" - }' + } ''' EXAMPLES = r''' @@ -308,7 +309,7 @@ EXAMPLES = r''' network: rhevm ip: 172.31.222.200 netmask: 255.255.255.0 - management: yes + management: true - name: bond0.36 network: vlan36 ip: 10.2.36.200 @@ -1252,7 +1253,6 @@ def setChanged(): def setMsg(message): - global failed msg.append(message) diff --git a/plugins/modules/cloud/misc/serverless.py b/plugins/modules/cloud/misc/serverless.py index fce6b77e16..2819adae59 100644 --- a/plugins/modules/cloud/misc/serverless.py +++ b/plugins/modules/cloud/misc/serverless.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2016, Ryan Scott Brown -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, Ryan Scott Brown +# 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 @@ -45,17 +46,17 @@ options: - When this option is C(false) all the functions will be built, but no stack update will be run to send them out. - This is mostly useful for generating artifacts to be stored/deployed elsewhere. type: bool - default: yes + default: true force: description: - Whether or not to force full deployment, equivalent to serverless C(--force) option. type: bool - default: no + default: false verbose: description: - Shows all stack events during deployment, and display any Stack Output. type: bool - default: no + default: false notes: - Currently, the C(serverless) command must be in the path of the node executing the task. In the future this may be a flag. @@ -107,7 +108,7 @@ state: returned: always command: type: str - description: Full `serverless` command run by this module, in case you want to re-run the command outside the module. + description: Full C(serverless) command run by this module, in case you want to re-run the command outside the module. returned: always sample: serverless deploy --stage production ''' diff --git a/plugins/modules/cloud/misc/terraform.py b/plugins/modules/cloud/misc/terraform.py index 4bdf559511..c8b654eb12 100644 --- a/plugins/modules/cloud/misc/terraform.py +++ b/plugins/modules/cloud/misc/terraform.py @@ -1,8 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- - -# (c) 2017, Ryan Scott Brown -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017, Ryan Scott Brown +# 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 @@ -67,7 +67,7 @@ options: state_file: description: - The path to an existing Terraform state file to use when building plan. - If this is not specified, the default `terraform.tfstate` will be used. + If this is not specified, the default C(terraform.tfstate) will be used. - This option is ignored when plan is specified. type: path variables_files: @@ -103,7 +103,7 @@ options: force_init: description: - To avoid duplicating infra, if a state file can't be found this will - force a `terraform init`. Generally, this should be turned off unless + force a C(terraform init). Generally, this should be turned off unless you intend to provision an entirely new Terraform deployment. default: false type: bool @@ -149,7 +149,7 @@ options: type: int version_added: '3.8.0' notes: - - To just run a `terraform plan`, use check mode. + - To just run a C(terraform plan), use check mode. requirements: [ "terraform" ] author: "Ryan Scott Brown (@ryansb)" ''' @@ -205,7 +205,7 @@ EXAMPLES = """ RETURN = """ outputs: type: complex - description: A dictionary of all the TF outputs by their assigned name. Use `.outputs.MyOutputName.value` to access the value. + description: A dictionary of all the TF outputs by their assigned name. Use C(.outputs.MyOutputName.value) to access the value. returned: on success sample: '{"bukkit_arn": {"sensitive": false, "type": "string", "value": "arn:aws:s3:::tf-test-bukkit"}' contains: @@ -223,12 +223,12 @@ outputs: description: The value of the output as interpolated by Terraform stdout: type: str - description: Full `terraform` command stdout, in case you want to display it or examine the event log + description: Full C(terraform) command stdout, in case you want to display it or examine the event log returned: always sample: '' command: type: str - description: Full `terraform` command built by this module, in case you want to re-run the command outside the module or debug a problem. + description: Full C(terraform) command built by this module, in case you want to re-run the command outside the module or debug a problem. returned: always sample: terraform apply ... """ diff --git a/plugins/modules/cloud/misc/xenserver_facts.py b/plugins/modules/cloud/misc/xenserver_facts.py index f65e3c9a86..201b59ec4f 100644 --- a/plugins/modules/cloud/misc/xenserver_facts.py +++ b/plugins/modules/cloud/misc/xenserver_facts.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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/modules/cloud/oneandone/oneandone_firewall_policy.py b/plugins/modules/cloud/oneandone/oneandone_firewall_policy.py index d46ce38897..9d9f042f2b 100644 --- a/plugins/modules/cloud/oneandone/oneandone_firewall_policy.py +++ b/plugins/modules/cloud/oneandone/oneandone_firewall_policy.py @@ -1,19 +1,8 @@ #!/usr/bin/python # -*- 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 @@ -94,7 +83,7 @@ options: description: - wait for the instance to be in state 'running' before returning required: false - default: "yes" + default: true type: bool wait_timeout: description: diff --git a/plugins/modules/cloud/oneandone/oneandone_load_balancer.py b/plugins/modules/cloud/oneandone/oneandone_load_balancer.py index 5f541a878c..3407e264ad 100644 --- a/plugins/modules/cloud/oneandone/oneandone_load_balancer.py +++ b/plugins/modules/cloud/oneandone/oneandone_load_balancer.py @@ -1,19 +1,8 @@ #!/usr/bin/python # -*- 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 @@ -132,7 +121,7 @@ options: description: - wait for the instance to be in state 'running' before returning required: false - default: "yes" + default: true type: bool wait_timeout: description: diff --git a/plugins/modules/cloud/oneandone/oneandone_monitoring_policy.py b/plugins/modules/cloud/oneandone/oneandone_monitoring_policy.py index 28dd0d41c5..cd9ee40ca2 100644 --- a/plugins/modules/cloud/oneandone/oneandone_monitoring_policy.py +++ b/plugins/modules/cloud/oneandone/oneandone_monitoring_policy.py @@ -1,19 +1,8 @@ #!/usr/bin/python # -*- 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 @@ -185,7 +174,7 @@ options: description: - wait for the instance to be in state 'running' before returning required: false - default: "yes" + default: true type: bool wait_timeout: description: diff --git a/plugins/modules/cloud/oneandone/oneandone_private_network.py b/plugins/modules/cloud/oneandone/oneandone_private_network.py index 6a16cf683e..36633716f7 100644 --- a/plugins/modules/cloud/oneandone/oneandone_private_network.py +++ b/plugins/modules/cloud/oneandone/oneandone_private_network.py @@ -1,19 +1,8 @@ #!/usr/bin/python # -*- 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 @@ -82,7 +71,7 @@ options: description: - wait for the instance to be in state 'running' before returning required: false - default: "yes" + default: true type: bool wait_timeout: description: diff --git a/plugins/modules/cloud/oneandone/oneandone_public_ip.py b/plugins/modules/cloud/oneandone/oneandone_public_ip.py index 96b1c9f3a5..a5970735ce 100644 --- a/plugins/modules/cloud/oneandone/oneandone_public_ip.py +++ b/plugins/modules/cloud/oneandone/oneandone_public_ip.py @@ -1,19 +1,8 @@ #!/usr/bin/python # -*- 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 @@ -70,7 +59,7 @@ options: description: - wait for the instance to be in state 'running' before returning required: false - default: "yes" + default: true type: bool wait_timeout: description: diff --git a/plugins/modules/cloud/oneandone/oneandone_server.py b/plugins/modules/cloud/oneandone/oneandone_server.py index aa651bd75f..22b4b9dd69 100644 --- a/plugins/modules/cloud/oneandone/oneandone_server.py +++ b/plugins/modules/cloud/oneandone/oneandone_server.py @@ -1,19 +1,8 @@ #!/usr/bin/python # -*- 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 @@ -131,7 +120,7 @@ options: for each individual server to be deleted before moving on with other tasks.) type: bool - default: 'yes' + default: true wait_timeout: description: - how long before wait gives up, in seconds @@ -148,7 +137,7 @@ options: hostnames by appending a count after them or substituting the count where there is a %02d or %03d in the hostname string. type: bool - default: 'yes' + default: true requirements: - "1and1" @@ -184,7 +173,7 @@ EXAMPLES = ''' datacenter: ES appliance: C5A349786169F140BCBC335675014C08 count: 3 - wait: yes + wait: true wait_timeout: 600 wait_interval: 10 ssh_key: SSH_PUBLIC_KEY @@ -212,7 +201,8 @@ RETURN = ''' servers: description: Information about each server that was processed type: list - sample: '[{"hostname": "my-server", "id": "server-id"}]' + sample: + - {"hostname": "my-server", "id": "server-id"} returned: always ''' diff --git a/plugins/modules/cloud/online/online_server_info.py b/plugins/modules/cloud/online/online_server_info.py index cf218efd29..6ba3e4aa4f 100644 --- a/plugins/modules/cloud/online/online_server_info.py +++ b/plugins/modules/cloud/online/online_server_info.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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) diff --git a/plugins/modules/cloud/online/online_user_info.py b/plugins/modules/cloud/online/online_user_info.py index cd1b6dfa45..1086502040 100644 --- a/plugins/modules/cloud/online/online_user_info.py +++ b/plugins/modules/cloud/online/online_user_info.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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/modules/cloud/opennebula/one_host.py b/plugins/modules/cloud/opennebula/one_host.py index f205a40a2c..20bdaa4088 100644 --- a/plugins/modules/cloud/opennebula/one_host.py +++ b/plugins/modules/cloud/opennebula/one_host.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright 2018 www.privaz.io Valletech AB -# 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 # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) diff --git a/plugins/modules/cloud/opennebula/one_image.py b/plugins/modules/cloud/opennebula/one_image.py index 5a80306fd1..04a6b57083 100644 --- a/plugins/modules/cloud/opennebula/one_image.py +++ b/plugins/modules/cloud/opennebula/one_image.py @@ -1,5 +1,8 @@ #!/usr/bin/python # -*- 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 # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) @@ -99,12 +102,12 @@ EXAMPLES = ''' - name: Disable the IMAGE by id community.general.one_image: id: 37 - enabled: no + enabled: false - name: Enable the IMAGE by name community.general.one_image: name: bar-image - enabled: yes + enabled: true - name: Clone the IMAGE by name community.general.one_image: @@ -346,7 +349,7 @@ def get_connection_info(module): if not password: password = os.environ.get('ONE_PASSWORD') - if not(url and username and password): + if not (url and username and password): module.fail_json(msg="One or more connection parameters (api_url, api_username, api_password) were not specified") from collections import namedtuple diff --git a/plugins/modules/cloud/opennebula/one_image_info.py b/plugins/modules/cloud/opennebula/one_image_info.py index e03b8ad724..08521a7acd 100644 --- a/plugins/modules/cloud/opennebula/one_image_info.py +++ b/plugins/modules/cloud/opennebula/one_image_info.py @@ -1,5 +1,8 @@ #!/usr/bin/python # -*- 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 # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) @@ -240,7 +243,7 @@ def get_connection_info(module): if not password: password = os.environ.get('ONE_PASSWORD') - if not(url and username and password): + if not (url and username and password): module.fail_json(msg="One or more connection parameters (api_url, api_username, api_password) were not specified") from collections import namedtuple diff --git a/plugins/modules/cloud/opennebula/one_service.py b/plugins/modules/cloud/opennebula/one_service.py index 68f8398f36..96f200a39e 100644 --- a/plugins/modules/cloud/opennebula/one_service.py +++ b/plugins/modules/cloud/opennebula/one_service.py @@ -1,5 +1,8 @@ #!/usr/bin/python # -*- 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 # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) @@ -47,30 +50,30 @@ options: type: str template_name: description: - - Name of service template to use to create a new instance of a service + - Name of service template to use to create a new instance of a service. type: str template_id: description: - - ID of a service template to use to create a new instance of a service + - ID of a service template to use to create a new instance of a service. type: int service_id: description: - - ID of a service instance that you would like to manage + - ID of a service instance that you would like to manage. type: int service_name: description: - - Name of a service instance that you would like to manage + - Name of a service instance that you would like to manage. type: str unique: description: - - Setting C(unique=yes) will make sure that there is only one service instance running with a name set with C(service_name) when - - instantiating a service from a template specified with C(template_id)/C(template_name). Check examples below. + - Setting I(unique=true) will make sure that there is only one service instance running with a name set with C(service_name) when + instantiating a service from a template specified with I(template_id) or I(template_name). Check examples below. type: bool - default: no + default: false state: description: - - C(present) - instantiate a service from a template specified with C(template_id)/C(template_name). - - C(absent) - terminate an instance of a service specified with C(service_id)/C(service_name). + - C(present) - instantiate a service from a template specified with I(template_id) or I(template_name). + - C(absent) - terminate an instance of a service specified with I(template_id) or I(template_name). choices: ["present", "absent"] default: present type: str @@ -80,20 +83,20 @@ options: type: str owner_id: description: - - ID of the user which will be set as the owner of the service + - ID of the user which will be set as the owner of the service. type: int group_id: description: - - ID of the group which will be set as the group of the service + - ID of the group which will be set as the group of the service. type: int wait: description: - - Wait for the instance to reach RUNNING state after DEPLOYING or COOLDOWN state after SCALING + - Wait for the instance to reach RUNNING state after DEPLOYING or COOLDOWN state after SCALING. type: bool - default: no + default: false wait_timeout: description: - - How long before wait gives up, in seconds + - How long before wait gives up, in seconds. default: 300 type: int custom_attrs: @@ -103,17 +106,17 @@ options: type: dict role: description: - - Name of the role whose cardinality should be changed + - Name of the role whose cardinality should be changed. type: str cardinality: description: - - Number of VMs for the specified role + - Number of VMs for the specified role. type: int force: description: - - Force the new cardinality even if it is outside the limits + - Force the new cardinality even if it is outside the limits. type: bool - default: no + default: false author: - "Milan Ilic (@ilicmilan)" ''' @@ -146,7 +149,7 @@ EXAMPLES = ''' community.general.one_service: template_id: 53 service_name: 'foo' - unique: yes + unique: true - name: Delete a service by ID community.general.one_service: @@ -173,7 +176,7 @@ EXAMPLES = ''' - name: Wait service to become RUNNING community.general.one_service: service_id: 112 - wait: yes + wait: true - name: Change role cardinality community.general.one_service: @@ -186,7 +189,7 @@ EXAMPLES = ''' service_id: 112 role: foo cardinality: 7 - wait: yes + wait: true ''' RETURN = ''' @@ -234,12 +237,12 @@ roles: description: list of dictionaries of roles, each role is described by name, cardinality, state and nodes ids type: list returned: success - sample: '[{"cardinality": 1,"name": "foo","state": "RUNNING","ids": [ 123, 456 ]}, - {"cardinality": 2,"name": "bar","state": "RUNNING", "ids": [ 452, 567, 746 ]}]' + sample: + - {"cardinality": 1,"name": "foo","state": "RUNNING", "ids": [ 123, 456 ]} + - {"cardinality": 2,"name": "bar","state": "RUNNING", "ids": [ 452, 567, 746 ]} ''' import os -import sys from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.urls import open_url @@ -660,7 +663,7 @@ def get_connection_info(module): if not password: password = os.environ.get('ONEFLOW_PASSWORD') - if not(url and username and password): + if not (url and username and password): module.fail_json(msg="One or more connection parameters (api_url, api_username, api_password) were not specified") from collections import namedtuple diff --git a/plugins/modules/cloud/opennebula/one_template.py b/plugins/modules/cloud/opennebula/one_template.py index b1d2c69ccf..8cfac6baf0 100644 --- a/plugins/modules/cloud/opennebula/one_template.py +++ b/plugins/modules/cloud/opennebula/one_template.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: (c) 2021, Georg Gadinger -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, Georg Gadinger +# 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/modules/cloud/opennebula/one_vm.py b/plugins/modules/cloud/opennebula/one_vm.py index 86061f73cb..dca65d6db3 100644 --- a/plugins/modules/cloud/opennebula/one_vm.py +++ b/plugins/modules/cloud/opennebula/one_vm.py @@ -1,5 +1,8 @@ #!/usr/bin/python # -*- 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 # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) @@ -65,7 +68,7 @@ options: vm_start_on_hold: description: - Set to true to put vm on hold while creating - default: False + default: false type: bool instance_ids: description: @@ -86,7 +89,7 @@ options: hard: description: - Reboot, power-off or terminate instances C(hard) - default: no + default: false type: bool wait: description: @@ -95,7 +98,7 @@ options: - doesn't mean that you will be able to SSH on that machine only that - boot process have started on that instance, see 'wait_for' example for - details. - default: yes + default: true type: bool wait_timeout: description: @@ -199,7 +202,7 @@ options: persistent: description: - Create a private persistent copy of the template plus any image defined in DISK, and instantiate that copy. - default: NO + default: false type: bool version_added: '0.2.0' datastore_id: @@ -248,7 +251,7 @@ EXAMPLES = ''' - name: Deploy a new VM as persistent community.general.one_vm: template_id: 90 - persistent: yes + persistent: true - name: Change VM's permissions to 640 community.general.one_vm: diff --git a/plugins/modules/cloud/oracle/oci_vcn.py b/plugins/modules/cloud/oracle/oci_vcn.py index a82914bdea..87568e1893 100644 --- a/plugins/modules/cloud/oracle/oci_vcn.py +++ b/plugins/modules/cloud/oracle/oci_vcn.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017, 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 diff --git a/plugins/modules/cloud/ovh/ovh_ip_failover.py b/plugins/modules/cloud/ovh/ovh_ip_failover.py index 26179eb8f7..4a5c8e5346 100644 --- a/plugins/modules/cloud/ovh/ovh_ip_failover.py +++ b/plugins/modules/cloud/ovh/ovh_ip_failover.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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/modules/cloud/ovh/ovh_ip_loadbalancing_backend.py b/plugins/modules/cloud/ovh/ovh_ip_loadbalancing_backend.py index 28d6f3a129..fe1e722507 100644 --- a/plugins/modules/cloud/ovh/ovh_ip_loadbalancing_backend.py +++ b/plugins/modules/cloud/ovh/ovh_ip_loadbalancing_backend.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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/modules/cloud/ovh/ovh_monthly_billing.py b/plugins/modules/cloud/ovh/ovh_monthly_billing.py index 75c70a79ec..445041a23b 100644 --- a/plugins/modules/cloud/ovh/ovh_monthly_billing.py +++ b/plugins/modules/cloud/ovh/ovh_monthly_billing.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2019, Francois Lallart (@fraff) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, Francois Lallart (@fraff) +# 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 @@ -72,8 +73,6 @@ EXAMPLES = ''' RETURN = ''' ''' -import os -import sys import traceback try: diff --git a/plugins/modules/cloud/packet/packet_device.py b/plugins/modules/cloud/packet/packet_device.py index abafa51870..e8452f99eb 100644 --- a/plugins/modules/cloud/packet/packet_device.py +++ b/plugins/modules/cloud/packet/packet_device.py @@ -1,10 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2016, Tomas Karasek -# (c) 2016, Matt Baldwin -# (c) 2016, Thibaud Morel l'Horset -# -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, Tomas Karasek +# Copyright (c) 2016, Matt Baldwin +# Copyright (c) 2016, Thibaud Morel l'Horset +# 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 @@ -255,16 +255,23 @@ RETURN = ''' changed: description: True if a device was altered in any way (created, modified or removed) type: bool - sample: True + sample: true returned: success devices: description: Information about each device that was processed type: list - sample: '[{"hostname": "my-server.com", "id": "2a5122b9-c323-4d5c-b53c-9ad3f54273e7", - "public_ipv4": "147.229.15.12", "private-ipv4": "10.0.15.12", - "tags": [], "locked": false, "state": "provisioning", - "public_ipv6": ""2604:1380:2:5200::3"}]' + sample: + - { + "hostname": "my-server.com", + "id": "2a5122b9-c323-4d5c-b53c-9ad3f54273e7", + "public_ipv4": "147.229.15.12", + "private-ipv4": "10.0.15.12", + "tags": [], + "locked": false, + "state": "provisioning", + "public_ipv6": "2604:1380:2:5200::3" + } returned: success ''' # NOQA diff --git a/plugins/modules/cloud/packet/packet_ip_subnet.py b/plugins/modules/cloud/packet/packet_ip_subnet.py index 718de36f22..79f93a6413 100644 --- a/plugins/modules/cloud/packet/packet_ip_subnet.py +++ b/plugins/modules/cloud/packet/packet_ip_subnet.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2019, Nurfet Becirevic -# Copyright: (c) 2017, Tomas Karasek -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, Nurfet Becirevic +# Copyright (c) 2017, Tomas Karasek +# 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 @@ -36,13 +37,13 @@ options: hostname: description: - A hostname of a device to/from which to assign/remove a subnet. - required: False + required: false type: str device_id: description: - UUID of a device to/from which to assign/remove a subnet. - required: False + required: false type: str project_id: @@ -117,7 +118,7 @@ RETURN = ''' changed: description: True if an IP address assignments were altered in any way (created or removed). type: bool - sample: True + sample: true returned: success device_id: @@ -134,15 +135,15 @@ subnet: assigned_to: { href : /devices/61f9aa5e-0530-47f5-97c2-113828e61ed0 } cidr: 31 created_at: '2017-08-07T15:15:30Z' - enabled: True + enabled: true gateway: 147.75.90.240 href: /ips/31eda960-0a16-4c0f-b196-f3dc4928529f id: 1eda960-0a16-4c0f-b196-f3dc4928529f - manageable: True - management: True + manageable: true + management: true netmask: 255.255.255.254 network: 147.75.90.240 - public: True + public: true returned: success ''' @@ -216,7 +217,7 @@ def parse_subnet_cidr(cidr): try: prefixlen = int(prefixlen) except ValueError: - raise("Wrong prefix length in CIDR expression {0}".format(cidr)) + raise Exception("Wrong prefix length in CIDR expression {0}".format(cidr)) return addr, prefixlen diff --git a/plugins/modules/cloud/packet/packet_project.py b/plugins/modules/cloud/packet/packet_project.py index c6502c6ea6..18b6f73f99 100644 --- a/plugins/modules/cloud/packet/packet_project.py +++ b/plugins/modules/cloud/packet/packet_project.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2019, Nurfet Becirevic -# Copyright: (c) 2019, Tomas Karasek -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, Nurfet Becirevic +# Copyright (c) 2019, Tomas Karasek +# 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 @@ -107,7 +108,7 @@ RETURN = ''' changed: description: True if a project was created or removed. type: bool - sample: True + sample: true returned: success name: diff --git a/plugins/modules/cloud/packet/packet_sshkey.py b/plugins/modules/cloud/packet/packet_sshkey.py index 77f3a70201..d39e419747 100644 --- a/plugins/modules/cloud/packet/packet_sshkey.py +++ b/plugins/modules/cloud/packet/packet_sshkey.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2016 Tomas Karasek -# 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 @@ -83,7 +84,7 @@ RETURN = ''' changed: description: True if a sshkey was created or removed. type: bool - sample: True + sample: true returned: always sshkeys: description: Information about sshkeys that were created/removed. diff --git a/plugins/modules/cloud/packet/packet_volume.py b/plugins/modules/cloud/packet/packet_volume.py index 4f10bdf45b..f0508c5891 100644 --- a/plugins/modules/cloud/packet/packet_volume.py +++ b/plugins/modules/cloud/packet/packet_volume.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2019, Nurfet Becirevic -# Copyright: (c) 2017, Tomas Karasek -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, Nurfet Becirevic +# Copyright (c) 2017, Tomas Karasek +# 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 @@ -83,7 +84,7 @@ options: description: - Create new volume locked. type: bool - default: False + default: false billing_cycle: description: @@ -101,13 +102,13 @@ options: snapshot_count: description: - How many snapshots to keep, a positive integer. - required: True + required: true type: int snapshot_frequency: description: - Frequency of snapshots. - required: True + required: true choices: ["15min", "1hour", "1day", "1week", "1month", "1year"] type: str diff --git a/plugins/modules/cloud/packet/packet_volume_attachment.py b/plugins/modules/cloud/packet/packet_volume_attachment.py index 9044fbcffa..4f55d60cfa 100644 --- a/plugins/modules/cloud/packet/packet_volume_attachment.py +++ b/plugins/modules/cloud/packet/packet_volume_attachment.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2019, Nurfet Becirevic -# Copyright: (c) 2017, Tomas Karasek -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, Nurfet Becirevic +# Copyright (c) 2017, Tomas Karasek +# 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/modules/cloud/profitbricks/profitbricks.py b/plugins/modules/cloud/profitbricks/profitbricks.py index eccedb71f4..42e6a1314b 100644 --- a/plugins/modules/cloud/profitbricks/profitbricks.py +++ b/plugins/modules/cloud/profitbricks/profitbricks.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -19,7 +20,7 @@ options: description: - Whether or not to increment a single number in the name for created virtual machines. type: bool - default: 'yes' + default: true name: description: - The name of the virtual machine. @@ -88,7 +89,7 @@ options: description: - This will assign the machine to the public LAN. If no LAN exists with public Internet access it is created. type: bool - default: 'no' + default: false lan: description: - The ID of the LAN you wish to add the servers to. @@ -106,7 +107,7 @@ options: description: - wait for the instance to be in state 'running' before returning type: bool - default: 'yes' + default: true wait_timeout: description: - how long before wait gives up, in seconds @@ -116,7 +117,7 @@ options: description: - remove the bootVolume of the virtual machine you're destroying. type: bool - default: 'yes' + default: true state: description: - create or terminate instances diff --git a/plugins/modules/cloud/profitbricks/profitbricks_datacenter.py b/plugins/modules/cloud/profitbricks/profitbricks_datacenter.py index 7897ffdeb9..cc3184320d 100644 --- a/plugins/modules/cloud/profitbricks/profitbricks_datacenter.py +++ b/plugins/modules/cloud/profitbricks/profitbricks_datacenter.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -45,7 +46,7 @@ options: description: - wait for the datacenter to be created before returning required: false - default: "yes" + default: true type: bool wait_timeout: description: @@ -183,7 +184,7 @@ def remove_datacenter(module, profitbricks): name = module.params.get('name') changed = False - if(uuid_match.match(name)): + if uuid_match.match(name): _remove_datacenter(module, profitbricks, name) changed = True else: diff --git a/plugins/modules/cloud/profitbricks/profitbricks_nic.py b/plugins/modules/cloud/profitbricks/profitbricks_nic.py index 5d98e05e4b..facb146b60 100644 --- a/plugins/modules/cloud/profitbricks/profitbricks_nic.py +++ b/plugins/modules/cloud/profitbricks/profitbricks_nic.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -47,7 +48,7 @@ options: description: - wait for the operation to complete before returning required: false - default: "yes" + default: true type: bool wait_timeout: description: diff --git a/plugins/modules/cloud/profitbricks/profitbricks_volume.py b/plugins/modules/cloud/profitbricks/profitbricks_volume.py index be1c18b55a..a49948b4bf 100644 --- a/plugins/modules/cloud/profitbricks/profitbricks_volume.py +++ b/plugins/modules/cloud/profitbricks/profitbricks_volume.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -73,7 +74,7 @@ options: auto_increment: description: - Whether or not to increment a single number in the name for created virtual machines. - default: yes + default: true type: bool instance_ids: description: @@ -95,7 +96,7 @@ options: description: - wait for the datacenter to be created before returning required: false - default: "yes" + default: true type: bool wait_timeout: description: @@ -124,7 +125,7 @@ EXAMPLES = ''' datacenter: Tardis One name: vol%02d count: 5 - auto_increment: yes + auto_increment: true wait_timeout: 500 state: present @@ -324,7 +325,7 @@ def delete_volume(module, profitbricks): break for n in instance_ids: - if(uuid_match.match(n)): + if uuid_match.match(n): _delete_volume(module, profitbricks, datacenter, n) changed = True else: diff --git a/plugins/modules/cloud/profitbricks/profitbricks_volume_attachments.py b/plugins/modules/cloud/profitbricks/profitbricks_volume_attachments.py index 1fb3f3c0e2..5637aca67f 100644 --- a/plugins/modules/cloud/profitbricks/profitbricks_volume_attachments.py +++ b/plugins/modules/cloud/profitbricks/profitbricks_volume_attachments.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -40,7 +41,7 @@ options: description: - wait for the operation to complete before returning required: false - default: "yes" + default: true type: bool wait_timeout: description: diff --git a/plugins/modules/cloud/pubnub/pubnub_blocks.py b/plugins/modules/cloud/pubnub/pubnub_blocks.py index d3b76337a3..8e9a56bdf5 100644 --- a/plugins/modules/cloud/pubnub/pubnub_blocks.py +++ b/plugins/modules/cloud/pubnub/pubnub_blocks.py @@ -7,7 +7,8 @@ # http://www.pubnub.com/ # http://www.pubnub.com/terms # -# 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/modules/cloud/rackspace/rax.py b/plugins/modules/cloud/rackspace/rax.py index 8c452d9d72..35f88dde81 100644 --- a/plugins/modules/cloud/rackspace/rax.py +++ b/plugins/modules/cloud/rackspace/rax.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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,15 +22,15 @@ options: created servers. Only applicable when used with the I(group) attribute or meta key. type: bool - default: 'yes' + default: true boot_from_volume: description: - Whether or not to boot the instance from a Cloud Block Storage volume. - If C(yes) and I(image) is specified a new volume will be created at + If C(true) and I(image) is specified a new volume will be created at boot time. I(boot_volume_size) is required with I(image) to create a new volume at boot time. type: bool - default: 'no' + default: false boot_volume: type: str description: @@ -46,12 +47,12 @@ options: - Whether the I(boot_volume) or newly created volume from I(image) will be terminated when the server is terminated type: bool - default: 'no' + default: false config_drive: description: - Attach read-only configuration drive to server as label config-2 type: bool - default: 'no' + default: false count: type: int description: @@ -73,12 +74,12 @@ options: exact_count: description: - Explicitly ensure an exact count of instances, used with - state=active/present. If specified as C(yes) and I(count) is less than + state=active/present. If specified as C(true) and I(count) is less than the servers matched, servers will be deleted to match the count. If the number of matched servers is fewer than specified in I(count) additional servers will be added. type: bool - default: 'no' + default: false extra_client_args: type: dict description: @@ -156,7 +157,7 @@ options: description: - wait for the instance to be in state 'running' before returning type: bool - default: 'no' + default: false wait_timeout: type: int description: @@ -178,7 +179,7 @@ extends_documentation_fragment: EXAMPLES = ''' - name: Build a Cloud Server - gather_facts: False + gather_facts: false tasks: - name: Server build request local_action: @@ -190,7 +191,7 @@ EXAMPLES = ''' key_name: my_rackspace_key files: /root/test.txt: /home/localuser/test.txt - wait: yes + wait: true state: present networks: - private @@ -199,7 +200,7 @@ EXAMPLES = ''' - name: Build an exact count of cloud servers with incremented names hosts: local - gather_facts: False + gather_facts: false tasks: - name: Server build requests local_action: @@ -211,9 +212,9 @@ EXAMPLES = ''' state: present count: 10 count_offset: 10 - exact_count: yes + exact_count: true group: test - wait: yes + wait: true register: rax ''' diff --git a/plugins/modules/cloud/rackspace/rax_cbs.py b/plugins/modules/cloud/rackspace/rax_cbs.py index abfda419ed..cde1d98755 100644 --- a/plugins/modules/cloud/rackspace/rax_cbs.py +++ b/plugins/modules/cloud/rackspace/rax_cbs.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -17,34 +18,34 @@ options: description: type: str description: - - Description to give the volume being created + - Description to give the volume being created. image: type: str description: - - image to use for bootable volumes. Can be an C(id), C(human_id) or - C(name). This option requires C(pyrax>=1.9.3) + - Image to use for bootable volumes. Can be an C(id), C(human_id) or + C(name). This option requires C(pyrax>=1.9.3). meta: type: dict description: - - A hash of metadata to associate with the volume + - A hash of metadata to associate with the volume. name: type: str description: - - Name to give the volume being created + - Name to give the volume being created. required: true size: type: int description: - - Size of the volume to create in Gigabytes + - Size of the volume to create in Gigabytes. default: 100 snapshot_id: type: str description: - - The id of the snapshot to create the volume from + - The id of the snapshot to create the volume from. state: type: str description: - - Indicate desired state of the resource + - Indicate desired state of the resource. choices: - present - absent @@ -52,20 +53,20 @@ options: volume_type: type: str description: - - Type of the volume being created + - Type of the volume being created. choices: - SATA - SSD default: SATA wait: description: - - wait for the volume to be in state 'available' before returning + - Wait for the volume to be in state C(available) before returning. type: bool - default: 'no' + default: false wait_timeout: type: int description: - - how long before wait gives up, in seconds + - how long before wait gives up, in seconds. default: 300 author: - "Christopher H. Laco (@claco)" @@ -77,7 +78,7 @@ extends_documentation_fragment: EXAMPLES = ''' - name: Build a Block Storage Volume - gather_facts: False + gather_facts: false hosts: local connection: local tasks: @@ -90,7 +91,7 @@ EXAMPLES = ''' volume_type: SSD size: 150 region: DFW - wait: yes + wait: true state: present meta: app: my-cool-app diff --git a/plugins/modules/cloud/rackspace/rax_cbs_attachments.py b/plugins/modules/cloud/rackspace/rax_cbs_attachments.py index fd21081475..82a1f30cfb 100644 --- a/plugins/modules/cloud/rackspace/rax_cbs_attachments.py +++ b/plugins/modules/cloud/rackspace/rax_cbs_attachments.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -41,7 +42,7 @@ options: description: - wait for the volume to be in 'in-use'/'available' state before returning type: bool - default: 'no' + default: false wait_timeout: type: int description: @@ -57,7 +58,7 @@ extends_documentation_fragment: EXAMPLES = ''' - name: Attach a Block Storage Volume - gather_facts: False + gather_facts: false hosts: local connection: local tasks: @@ -69,7 +70,7 @@ EXAMPLES = ''' server: my-server device: /dev/xvdd region: DFW - wait: yes + wait: true state: present register: my_volume ''' diff --git a/plugins/modules/cloud/rackspace/rax_cdb.py b/plugins/modules/cloud/rackspace/rax_cdb.py index a9c3243281..6703a8dd4b 100644 --- a/plugins/modules/cloud/rackspace/rax_cdb.py +++ b/plugins/modules/cloud/rackspace/rax_cdb.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -20,7 +21,7 @@ options: type: str description: - Name of the databases server instance - required: yes + required: true flavor: type: int description: @@ -54,7 +55,7 @@ options: description: - wait for the instance to be in state 'running' before returning type: bool - default: 'no' + default: false wait_timeout: type: int description: @@ -69,7 +70,7 @@ extends_documentation_fragment: EXAMPLES = ''' - name: Build a Cloud Databases - gather_facts: False + gather_facts: false tasks: - name: Server build request local_action: @@ -81,7 +82,7 @@ EXAMPLES = ''' volume: 2 cdb_type: MySQL cdb_version: 5.6 - wait: yes + wait: true state: present register: rax_db_server ''' diff --git a/plugins/modules/cloud/rackspace/rax_cdb_database.py b/plugins/modules/cloud/rackspace/rax_cdb_database.py index 86cd1aac40..5b5ebc6e29 100644 --- a/plugins/modules/cloud/rackspace/rax_cdb_database.py +++ b/plugins/modules/cloud/rackspace/rax_cdb_database.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -17,12 +18,12 @@ options: type: str description: - The databases server UUID - required: yes + required: true name: type: str description: - Name to give to the database - required: yes + required: true character_set: type: str description: diff --git a/plugins/modules/cloud/rackspace/rax_cdb_user.py b/plugins/modules/cloud/rackspace/rax_cdb_user.py index 674f17c070..ccc3e677a5 100644 --- a/plugins/modules/cloud/rackspace/rax_cdb_user.py +++ b/plugins/modules/cloud/rackspace/rax_cdb_user.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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,17 +19,17 @@ options: type: str description: - The databases server UUID - required: yes + required: true db_username: type: str description: - Name of the database user - required: yes + required: true db_password: type: str description: - Database user password - required: yes + required: true databases: type: list elements: str diff --git a/plugins/modules/cloud/rackspace/rax_clb.py b/plugins/modules/cloud/rackspace/rax_clb.py index 9160133e21..8e5db34e50 100644 --- a/plugins/modules/cloud/rackspace/rax_clb.py +++ b/plugins/modules/cloud/rackspace/rax_clb.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -33,7 +34,7 @@ options: type: str description: - Name to give the load balancer - required: yes + required: true port: type: int description: @@ -93,7 +94,7 @@ options: description: - wait for the balancer to be in state 'running' before returning type: bool - default: 'no' + default: false wait_timeout: type: int description: @@ -110,7 +111,7 @@ extends_documentation_fragment: EXAMPLES = ''' - name: Build a Load Balancer - gather_facts: False + gather_facts: false hosts: local connection: local tasks: @@ -124,7 +125,7 @@ EXAMPLES = ''' type: SERVICENET timeout: 30 region: DFW - wait: yes + wait: true state: present meta: app: my-cool-app diff --git a/plugins/modules/cloud/rackspace/rax_clb_nodes.py b/plugins/modules/cloud/rackspace/rax_clb_nodes.py index 4adcc66fb7..04341f7ceb 100644 --- a/plugins/modules/cloud/rackspace/rax_clb_nodes.py +++ b/plugins/modules/cloud/rackspace/rax_clb_nodes.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -63,7 +64,7 @@ options: - Type of node wait: required: false - default: "no" + default: false type: bool description: - Wait for the load balancer to become active before returning @@ -98,7 +99,7 @@ EXAMPLES = ''' port: 80 condition: enabled type: primary - wait: yes + wait: true credentials: /path/to/credentials - name: Drain connections from a node @@ -107,7 +108,7 @@ EXAMPLES = ''' load_balancer_id: 71 node_id: 410 condition: draining - wait: yes + wait: true credentials: /path/to/credentials - name: Remove a node from the load balancer @@ -116,7 +117,7 @@ EXAMPLES = ''' load_balancer_id: 71 node_id: 410 state: absent - wait: yes + wait: true credentials: /path/to/credentials ''' @@ -252,7 +253,8 @@ def main(): 'weight': weight, } - for name, value in mutable.items(): + for name in list(mutable): + value = mutable[name] if value is None or value == getattr(node, name): mutable.pop(name) diff --git a/plugins/modules/cloud/rackspace/rax_clb_ssl.py b/plugins/modules/cloud/rackspace/rax_clb_ssl.py index adf375124d..db192368b4 100644 --- a/plugins/modules/cloud/rackspace/rax_clb_ssl.py +++ b/plugins/modules/cloud/rackspace/rax_clb_ssl.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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/modules/cloud/rackspace/rax_dns.py b/plugins/modules/cloud/rackspace/rax_dns.py index 915e13a9a6..a97a4bb175 100644 --- a/plugins/modules/cloud/rackspace/rax_dns.py +++ b/plugins/modules/cloud/rackspace/rax_dns.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -53,7 +54,7 @@ extends_documentation_fragment: EXAMPLES = ''' - name: Create domain hosts: all - gather_facts: False + gather_facts: false tasks: - name: Domain create request local_action: diff --git a/plugins/modules/cloud/rackspace/rax_dns_record.py b/plugins/modules/cloud/rackspace/rax_dns_record.py index 1a6986dea7..e51424dc04 100644 --- a/plugins/modules/cloud/rackspace/rax_dns_record.py +++ b/plugins/modules/cloud/rackspace/rax_dns_record.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -23,7 +24,7 @@ options: description: - IP address for A/AAAA record, FQDN for CNAME/MX/NS, or text data for SRV/TXT - required: True + required: true domain: type: str description: @@ -37,7 +38,7 @@ options: type: str description: - FQDN record name to create - required: True + required: true overwrite: description: - Add new records if data doesn't match, instead of updating existing @@ -99,7 +100,7 @@ extends_documentation_fragment: EXAMPLES = ''' - name: Create DNS Records hosts: all - gather_facts: False + gather_facts: false tasks: - name: Create A record local_action: diff --git a/plugins/modules/cloud/rackspace/rax_facts.py b/plugins/modules/cloud/rackspace/rax_facts.py index 0288a5e35b..560f05e56a 100644 --- a/plugins/modules/cloud/rackspace/rax_facts.py +++ b/plugins/modules/cloud/rackspace/rax_facts.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -36,7 +37,7 @@ extends_documentation_fragment: EXAMPLES = ''' - name: Gather info about servers hosts: all - gather_facts: False + gather_facts: false tasks: - name: Get facts about servers local_action: diff --git a/plugins/modules/cloud/rackspace/rax_files.py b/plugins/modules/cloud/rackspace/rax_files.py index 1e1f82c85d..6599c88d16 100644 --- a/plugins/modules/cloud/rackspace/rax_files.py +++ b/plugins/modules/cloud/rackspace/rax_files.py @@ -1,8 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- - -# (c) 2013, Paul Durivage -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2013, Paul Durivage +# 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 @@ -20,7 +20,7 @@ options: - Optionally clear existing metadata when applying metadata to existing containers. Selecting this option is only appropriate when setting type=meta type: bool - default: "no" + default: false container: type: str description: @@ -82,7 +82,7 @@ extends_documentation_fragment: EXAMPLES = ''' - name: "Test Cloud Files Containers" hosts: local - gather_facts: no + gather_facts: false tasks: - name: "List all containers" community.general.rax_files: @@ -112,22 +112,22 @@ EXAMPLES = ''' - name: "Make container public" community.general.rax_files: container: mycontainer - public: yes + public: true - name: "Make container public with a 24 hour TTL" community.general.rax_files: container: mycontainer - public: yes + public: true ttl: 86400 - name: "Make container private" community.general.rax_files: container: mycontainer - private: yes + private: true - name: "Test Cloud Files Containers Metadata Storage" hosts: local - gather_facts: no + gather_facts: false tasks: - name: "Get mycontainer2 metadata" community.general.rax_files: diff --git a/plugins/modules/cloud/rackspace/rax_files_objects.py b/plugins/modules/cloud/rackspace/rax_files_objects.py index 8f8793e375..a7c36e6920 100644 --- a/plugins/modules/cloud/rackspace/rax_files_objects.py +++ b/plugins/modules/cloud/rackspace/rax_files_objects.py @@ -1,8 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- - -# (c) 2013, Paul Durivage -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2013, Paul Durivage +# 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 +63,7 @@ options: from Cloud Files. Setting to false downloads the contents of a container to a single, flat directory type: bool - default: 'yes' + default: true type: type: str description: @@ -83,7 +83,7 @@ extends_documentation_fragment: EXAMPLES = ''' - name: "Test Cloud Files Objects" hosts: local - gather_facts: False + gather_facts: false tasks: - name: "Get objects from test container" community.general.rax_files_objects: @@ -153,14 +153,14 @@ EXAMPLES = ''' method: get src: FileThatDoesNotExist.jpg dest: ~/Downloads/testcont - ignore_errors: yes + ignore_errors: true - name: "Attempt to delete remote object that does not exist" community.general.rax_files_objects: container: testcont method: delete dest: FileThatDoesNotExist.jpg - ignore_errors: yes + ignore_errors: true - name: "Test Cloud Files Objects Metadata" hosts: local diff --git a/plugins/modules/cloud/rackspace/rax_identity.py b/plugins/modules/cloud/rackspace/rax_identity.py index 2021052faa..6f7472bcf4 100644 --- a/plugins/modules/cloud/rackspace/rax_identity.py +++ b/plugins/modules/cloud/rackspace/rax_identity.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -31,7 +32,7 @@ extends_documentation_fragment: EXAMPLES = ''' - name: Load Rackspace Cloud Identity - gather_facts: False + gather_facts: false hosts: local connection: local tasks: diff --git a/plugins/modules/cloud/rackspace/rax_keypair.py b/plugins/modules/cloud/rackspace/rax_keypair.py index 90b0183e50..6664ac8bd0 100644 --- a/plugins/modules/cloud/rackspace/rax_keypair.py +++ b/plugins/modules/cloud/rackspace/rax_keypair.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -44,7 +45,7 @@ extends_documentation_fragment: EXAMPLES = ''' - name: Create a keypair hosts: localhost - gather_facts: False + gather_facts: false tasks: - name: Keypair request local_action: @@ -66,7 +67,7 @@ EXAMPLES = ''' - name: Create a keypair hosts: localhost - gather_facts: False + gather_facts: false tasks: - name: Keypair request local_action: diff --git a/plugins/modules/cloud/rackspace/rax_meta.py b/plugins/modules/cloud/rackspace/rax_meta.py index 3504181f19..7937696f88 100644 --- a/plugins/modules/cloud/rackspace/rax_meta.py +++ b/plugins/modules/cloud/rackspace/rax_meta.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -40,7 +41,7 @@ extends_documentation_fragment: EXAMPLES = ''' - name: Set metadata for a server hosts: all - gather_facts: False + gather_facts: false tasks: - name: Set metadata local_action: diff --git a/plugins/modules/cloud/rackspace/rax_mon_alarm.py b/plugins/modules/cloud/rackspace/rax_mon_alarm.py index 7e99db3fa8..dd971f7243 100644 --- a/plugins/modules/cloud/rackspace/rax_mon_alarm.py +++ b/plugins/modules/cloud/rackspace/rax_mon_alarm.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -76,7 +77,7 @@ extends_documentation_fragment: EXAMPLES = ''' - name: Alarm example - gather_facts: False + gather_facts: false hosts: local connection: local tasks: diff --git a/plugins/modules/cloud/rackspace/rax_mon_check.py b/plugins/modules/cloud/rackspace/rax_mon_check.py index 17a3932f6e..adbd7e7600 100644 --- a/plugins/modules/cloud/rackspace/rax_mon_check.py +++ b/plugins/modules/cloud/rackspace/rax_mon_check.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -75,15 +76,15 @@ options: target_hostname: type: str description: - - One of `target_hostname` and `target_alias` is required for remote.* checks, + - One of I(target_hostname) and I(target_alias) is required for remote.* checks, but prohibited for agent.* checks. The hostname this check should target. Must be a valid IPv4, IPv6, or FQDN. target_alias: type: str description: - - One of `target_alias` and `target_hostname` is required for remote.* checks, + - One of I(target_alias) and I(target_hostname) is required for remote.* checks, but prohibited for agent.* checks. Use the corresponding key in the entity's - `ip_addresses` hash to resolve an IP address to target. + I(ip_addresses) hash to resolve an IP address to target. details: type: dict description: @@ -92,7 +93,7 @@ options: 256 items. disabled: description: - - If "yes", ensure the check is created, but don't actually use it yet. + - If C(true), ensure the check is created, but don't actually use it yet. type: bool default: false metadata: @@ -118,7 +119,7 @@ extends_documentation_fragment: EXAMPLES = ''' - name: Create a monitoring check - gather_facts: False + gather_facts: false hosts: local connection: local tasks: diff --git a/plugins/modules/cloud/rackspace/rax_mon_entity.py b/plugins/modules/cloud/rackspace/rax_mon_entity.py index 2f8cdeefd8..e8dabef69e 100644 --- a/plugins/modules/cloud/rackspace/rax_mon_entity.py +++ b/plugins/modules/cloud/rackspace/rax_mon_entity.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -56,7 +57,7 @@ extends_documentation_fragment: EXAMPLES = ''' - name: Entity example - gather_facts: False + gather_facts: false hosts: local connection: local tasks: diff --git a/plugins/modules/cloud/rackspace/rax_mon_notification.py b/plugins/modules/cloud/rackspace/rax_mon_notification.py index fb645c3036..c26b0315db 100644 --- a/plugins/modules/cloud/rackspace/rax_mon_notification.py +++ b/plugins/modules/cloud/rackspace/rax_mon_notification.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -51,7 +52,7 @@ extends_documentation_fragment: EXAMPLES = ''' - name: Monitoring notification example - gather_facts: False + gather_facts: false hosts: local connection: local tasks: diff --git a/plugins/modules/cloud/rackspace/rax_mon_notification_plan.py b/plugins/modules/cloud/rackspace/rax_mon_notification_plan.py index 25e506829f..7800ea0fe9 100644 --- a/plugins/modules/cloud/rackspace/rax_mon_notification_plan.py +++ b/plugins/modules/cloud/rackspace/rax_mon_notification_plan.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -57,7 +58,7 @@ extends_documentation_fragment: EXAMPLES = ''' - name: Example notification plan - gather_facts: False + gather_facts: false hosts: local connection: local tasks: diff --git a/plugins/modules/cloud/rackspace/rax_network.py b/plugins/modules/cloud/rackspace/rax_network.py index 146c08c8e1..02de3ce011 100644 --- a/plugins/modules/cloud/rackspace/rax_network.py +++ b/plugins/modules/cloud/rackspace/rax_network.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -26,7 +27,7 @@ options: type: str description: - Label (name) to give the network - required: yes + required: true cidr: type: str description: @@ -41,7 +42,7 @@ extends_documentation_fragment: EXAMPLES = ''' - name: Build an Isolated Network - gather_facts: False + gather_facts: false tasks: - name: Network create request diff --git a/plugins/modules/cloud/rackspace/rax_queue.py b/plugins/modules/cloud/rackspace/rax_queue.py index 46c942c70d..366c1c77e3 100644 --- a/plugins/modules/cloud/rackspace/rax_queue.py +++ b/plugins/modules/cloud/rackspace/rax_queue.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -37,7 +38,7 @@ extends_documentation_fragment: EXAMPLES = ''' - name: Build a Queue - gather_facts: False + gather_facts: false hosts: local connection: local tasks: diff --git a/plugins/modules/cloud/rackspace/rax_scaling_group.py b/plugins/modules/cloud/rackspace/rax_scaling_group.py index 4080e4c6a4..6389f91a26 100644 --- a/plugins/modules/cloud/rackspace/rax_scaling_group.py +++ b/plugins/modules/cloud/rackspace/rax_scaling_group.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ options: description: - Attach read-only configuration drive to server as label config-2 type: bool - default: 'no' + default: false cooldown: type: int description: @@ -111,7 +112,7 @@ options: - wait for the scaling group to finish provisioning the minimum amount of servers type: bool - default: 'no' + default: false wait_timeout: type: int description: diff --git a/plugins/modules/cloud/rackspace/rax_scaling_policy.py b/plugins/modules/cloud/rackspace/rax_scaling_policy.py index be46bd62a6..3596575187 100644 --- a/plugins/modules/cloud/rackspace/rax_scaling_policy.py +++ b/plugins/modules/cloud/rackspace/rax_scaling_policy.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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/modules/cloud/scaleway/scaleway_compute.py b/plugins/modules/cloud/scaleway/scaleway_compute.py index a195d7fb93..3acdc8bd77 100644 --- a/plugins/modules/cloud/scaleway/scaleway_compute.py +++ b/plugins/modules/cloud/scaleway/scaleway_compute.py @@ -6,7 +6,8 @@ # Copyright (C) 2018 Online SAS. # https://www.scaleway.com # -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# GNU General Public License v3.0+ (see 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 @@ -109,7 +110,7 @@ options: description: - Wait for the instance to reach its desired state before returning. type: bool - default: 'no' + default: false wait_timeout: type: int diff --git a/plugins/modules/cloud/scaleway/scaleway_compute_private_network.py b/plugins/modules/cloud/scaleway/scaleway_compute_private_network.py new file mode 100644 index 0000000000..f85b2f2444 --- /dev/null +++ b/plugins/modules/cloud/scaleway/scaleway_compute_private_network.py @@ -0,0 +1,211 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# +# Scaleway VPC management module +# +# 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 + +DOCUMENTATION = ''' +--- +module: scaleway_compute_private_network +short_description: Scaleway compute - private network management +version_added: 5.2.0 +author: Pascal MANGIN (@pastral) +description: + - This module add or remove a private network to a compute instance + (U(https://developer.scaleway.com)). +extends_documentation_fragment: +- community.general.scaleway + + +options: + state: + type: str + description: + - Indicate desired state of the VPC. + default: present + choices: + - present + - absent + + project: + type: str + description: + - Project identifier. + required: true + + region: + type: str + description: + - Scaleway region to use (for example C(par1)). + required: true + choices: + - ams1 + - EMEA-NL-EVS + - par1 + - EMEA-FR-PAR1 + - par2 + - EMEA-FR-PAR2 + - waw1 + - EMEA-PL-WAW1 + + compute_id: + type: str + description: + - ID of the compute instance (see M(community.general.scaleway_compute)). + required: true + + private_network_id: + type: str + description: + - ID of the private network (see M(community.general.scaleway_private_network)). + required: true + +''' + +EXAMPLES = ''' +- name: Plug a VM to a private network + community.general.scaleway_compute_private_network: + project: '{{ scw_project }}' + state: present + region: par1 + compute_id: "12345678-f1e6-40ec-83e5-12345d67ed89" + private_network_id: "22345678-f1e6-40ec-83e5-12345d67ed89" + register: nicsvpc_creation_task + +- name: Unplug a VM from a private network + community.general.scaleway_compute_private_network: + project: '{{ scw_project }}' + state: absent + region: par1 + compute_id: "12345678-f1e6-40ec-83e5-12345d67ed89" + private_network_id: "22345678-f1e6-40ec-83e5-12345d67ed89" + +''' + +RETURN = ''' +scaleway_compute_private_network: + description: Information on the VPC. + returned: success when C(state=present) + type: dict + sample: + { + "created_at": "2022-01-15T11:11:12.676445Z", + "id": "12345678-f1e6-40ec-83e5-12345d67ed89", + "name": "network", + "organization_id": "a123b4cd-ef5g-678h-90i1-jk2345678l90", + "project_id": "a123b4cd-ef5g-678h-90i1-jk2345678l90", + "tags": [ + "tag1", + "tag2", + "tag3", + "tag4", + "tag5" + ], + "updated_at": "2022-01-15T11:12:04.624837Z", + "zone": "fr-par-2" + } +''' +from ansible_collections.community.general.plugins.module_utils.scaleway import SCALEWAY_LOCATION, scaleway_argument_spec, Scaleway +from ansible.module_utils.basic import AnsibleModule + + +def get_nics_info(api, compute_id, private_network_id): + + response = api.get('servers/' + compute_id + '/private_nics') + if not response.ok: + msg = "Error during get servers information: %s: '%s' (%s)" % (response.info['msg'], response.json['message'], response.json) + api.module.fail_json(msg=msg) + + i = 0 + list_nics = response.json['private_nics'] + + while i < len(list_nics): + if list_nics[i]['private_network_id'] == private_network_id: + return list_nics[i] + i += 1 + + return None + + +def present_strategy(api, compute_id, private_network_id): + + changed = False + nic = get_nics_info(api, compute_id, private_network_id) + if nic is not None: + return changed, nic + + data = {"private_network_id": private_network_id} + changed = True + if api.module.check_mode: + return changed, {"status": "a private network would be add to a server"} + + response = api.post(path='servers/' + compute_id + '/private_nics', data=data) + + if not response.ok: + api.module.fail_json(msg='Error when adding a private network to a server [{0}: {1}]'.format(response.status_code, response.json)) + + return changed, response.json + + +def absent_strategy(api, compute_id, private_network_id): + + changed = False + nic = get_nics_info(api, compute_id, private_network_id) + if nic is None: + return changed, {} + + changed = True + if api.module.check_mode: + return changed, {"status": "private network would be destroyed"} + + response = api.delete('servers/' + compute_id + '/private_nics/' + nic['id']) + + if not response.ok: + api.module.fail_json(msg='Error deleting private network from server [{0}: {1}]'.format( + response.status_code, response.json)) + + return changed, response.json + + +def core(module): + + compute_id = module.params['compute_id'] + pn_id = module.params['private_network_id'] + + region = module.params["region"] + module.params['api_url'] = SCALEWAY_LOCATION[region]["api_endpoint"] + + api = Scaleway(module=module) + if module.params["state"] == "absent": + changed, summary = absent_strategy(api=api, compute_id=compute_id, private_network_id=pn_id) + else: + changed, summary = present_strategy(api=api, compute_id=compute_id, private_network_id=pn_id) + module.exit_json(changed=changed, scaleway_compute_private_network=summary) + + +def main(): + argument_spec = scaleway_argument_spec() + argument_spec.update(dict( + state=dict(default='present', choices=['absent', 'present']), + project=dict(required=True), + region=dict(required=True, choices=list(SCALEWAY_LOCATION.keys())), + compute_id=dict(required=True), + private_network_id=dict(required=True) + )) + module = AnsibleModule( + argument_spec=argument_spec, + supports_check_mode=True, + ) + + core(module) + + +if __name__ == '__main__': + main() diff --git a/plugins/modules/cloud/scaleway/scaleway_database_backup.py b/plugins/modules/cloud/scaleway/scaleway_database_backup.py index 35f35f820a..f91ce143a0 100644 --- a/plugins/modules/cloud/scaleway/scaleway_database_backup.py +++ b/plugins/modules/cloud/scaleway/scaleway_database_backup.py @@ -5,7 +5,8 @@ # # Copyright (C) 2020 Guillaume Rodriguez (g.rodriguez@opendecide.com). # -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# GNU General Public License v3.0+ (see 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/modules/cloud/scaleway/scaleway_image_info.py b/plugins/modules/cloud/scaleway/scaleway_image_info.py index 98aa453f3c..c68cc99684 100644 --- a/plugins/modules/cloud/scaleway/scaleway_image_info.py +++ b/plugins/modules/cloud/scaleway/scaleway_image_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# (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/modules/cloud/scaleway/scaleway_ip.py b/plugins/modules/cloud/scaleway/scaleway_ip.py index 7901aaade4..eccd64e47b 100644 --- a/plugins/modules/cloud/scaleway/scaleway_ip.py +++ b/plugins/modules/cloud/scaleway/scaleway_ip.py @@ -3,7 +3,9 @@ # # Scaleway IP management module # -# 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 diff --git a/plugins/modules/cloud/scaleway/scaleway_ip_info.py b/plugins/modules/cloud/scaleway/scaleway_ip_info.py index 189ee1cf05..c65c7e6ab9 100644 --- a/plugins/modules/cloud/scaleway/scaleway_ip_info.py +++ b/plugins/modules/cloud/scaleway/scaleway_ip_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# (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/modules/cloud/scaleway/scaleway_lb.py b/plugins/modules/cloud/scaleway/scaleway_lb.py index 2112ae4411..b323064012 100644 --- a/plugins/modules/cloud/scaleway/scaleway_lb.py +++ b/plugins/modules/cloud/scaleway/scaleway_lb.py @@ -6,7 +6,8 @@ # Copyright (C) 2018 Online SAS. # https://www.scaleway.com # -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# GNU General Public License v3.0+ (see 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 @@ -72,7 +73,7 @@ options: description: - Wait for the load-balancer to reach its desired state before returning. type: bool - default: 'no' + default: false wait_timeout: type: int diff --git a/plugins/modules/cloud/scaleway/scaleway_organization_info.py b/plugins/modules/cloud/scaleway/scaleway_organization_info.py index a09d1bb5d8..542b8d4603 100644 --- a/plugins/modules/cloud/scaleway/scaleway_organization_info.py +++ b/plugins/modules/cloud/scaleway/scaleway_organization_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# (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/modules/cloud/scaleway/scaleway_private_network.py b/plugins/modules/cloud/scaleway/scaleway_private_network.py index 996a3cce27..6a611fa32b 100644 --- a/plugins/modules/cloud/scaleway/scaleway_private_network.py +++ b/plugins/modules/cloud/scaleway/scaleway_private_network.py @@ -3,7 +3,9 @@ # # Scaleway VPC management module # -# 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 diff --git a/plugins/modules/cloud/scaleway/scaleway_security_group.py b/plugins/modules/cloud/scaleway/scaleway_security_group.py index f9faee6104..635309947a 100644 --- a/plugins/modules/cloud/scaleway/scaleway_security_group.py +++ b/plugins/modules/cloud/scaleway/scaleway_security_group.py @@ -5,7 +5,8 @@ # # Copyright (C) 2018 Antoine Barbare (antoinebarbare@gmail.com). # -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# GNU General Public License v3.0+ (see 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/modules/cloud/scaleway/scaleway_security_group_info.py b/plugins/modules/cloud/scaleway/scaleway_security_group_info.py index a15044e6a4..5e2cc95a1c 100644 --- a/plugins/modules/cloud/scaleway/scaleway_security_group_info.py +++ b/plugins/modules/cloud/scaleway/scaleway_security_group_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# (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/modules/cloud/scaleway/scaleway_security_group_rule.py b/plugins/modules/cloud/scaleway/scaleway_security_group_rule.py index 9f95921202..d0b16aeb50 100644 --- a/plugins/modules/cloud/scaleway/scaleway_security_group_rule.py +++ b/plugins/modules/cloud/scaleway/scaleway_security_group_rule.py @@ -5,8 +5,8 @@ # # Copyright (C) 2018 Antoine Barbare (antoinebarbare@gmail.com). # -# GNU General Public License v3.0+ (see COPYING or -# https://www.gnu.org/licenses/gpl-3.0.txt) +# GNU General Public License v3.0+ (see 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 @@ -143,6 +143,7 @@ except ImportError: IPADDRESS_IMP_ERR = traceback.format_exc() HAS_IPADDRESS = False else: + IPADDRESS_IMP_ERR = None HAS_IPADDRESS = True diff --git a/plugins/modules/cloud/scaleway/scaleway_server_info.py b/plugins/modules/cloud/scaleway/scaleway_server_info.py index 2b9d91b47c..087be54d24 100644 --- a/plugins/modules/cloud/scaleway/scaleway_server_info.py +++ b/plugins/modules/cloud/scaleway/scaleway_server_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# (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/modules/cloud/scaleway/scaleway_snapshot_info.py b/plugins/modules/cloud/scaleway/scaleway_snapshot_info.py index 8e1d2a615d..bebf27395c 100644 --- a/plugins/modules/cloud/scaleway/scaleway_snapshot_info.py +++ b/plugins/modules/cloud/scaleway/scaleway_snapshot_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# (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/modules/cloud/scaleway/scaleway_sshkey.py b/plugins/modules/cloud/scaleway/scaleway_sshkey.py index 4c55909245..13dc211d36 100644 --- a/plugins/modules/cloud/scaleway/scaleway_sshkey.py +++ b/plugins/modules/cloud/scaleway/scaleway_sshkey.py @@ -6,7 +6,8 @@ # Copyright (C) 2018 Online SAS. # https://www.scaleway.com # -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# GNU General Public License v3.0+ (see 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/modules/cloud/scaleway/scaleway_user_data.py b/plugins/modules/cloud/scaleway/scaleway_user_data.py index 2848ec2c4a..37d9e94142 100644 --- a/plugins/modules/cloud/scaleway/scaleway_user_data.py +++ b/plugins/modules/cloud/scaleway/scaleway_user_data.py @@ -6,7 +6,8 @@ # Copyright (C) 2018 Online SAS. # https://www.scaleway.com # -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# GNU General Public License v3.0+ (see 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 @@ -35,7 +36,7 @@ options: user_data: type: dict description: - - User defined data. Typically used with `cloud-init`. + - User defined data. Typically used with C(cloud-init). - Pass your cloud-init script here as a string required: false diff --git a/plugins/modules/cloud/scaleway/scaleway_volume.py b/plugins/modules/cloud/scaleway/scaleway_volume.py index e68309fc31..315b5e7334 100644 --- a/plugins/modules/cloud/scaleway/scaleway_volume.py +++ b/plugins/modules/cloud/scaleway/scaleway_volume.py @@ -5,7 +5,8 @@ # # Copyright (C) 2018 Henryk Konsek Consulting (hekonsek@gmail.com). # -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# GNU General Public License v3.0+ (see 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/modules/cloud/scaleway/scaleway_volume_info.py b/plugins/modules/cloud/scaleway/scaleway_volume_info.py index e8dfa41419..14a8c96884 100644 --- a/plugins/modules/cloud/scaleway/scaleway_volume_info.py +++ b/plugins/modules/cloud/scaleway/scaleway_volume_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# (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/modules/cloud/smartos/imgadm.py b/plugins/modules/cloud/smartos/imgadm.py index 18a67d014a..2357fffa30 100644 --- a/plugins/modules/cloud/smartos/imgadm.py +++ b/plugins/modules/cloud/smartos/imgadm.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2016, 2017 Jasper Lievisse Adriaanse -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, 2017 Jasper Lievisse Adriaanse +# 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/modules/cloud/smartos/nictagadm.py b/plugins/modules/cloud/smartos/nictagadm.py index 05aba6f188..e70d93c8a1 100644 --- a/plugins/modules/cloud/smartos/nictagadm.py +++ b/plugins/modules/cloud/smartos/nictagadm.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2018, Bruce Smith -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2018, Bruce 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 @@ -31,7 +32,7 @@ options: - Specifies that the nic tag will be attached to a created I(etherstub). - Parameter I(etherstub) is mutually exclusive with both I(mtu), and I(mac). type: bool - default: no + default: false mtu: description: - Specifies the size of the I(mtu) of the desired nic tag. @@ -41,7 +42,7 @@ options: description: - When I(state) is absent set this switch will use the C(-f) parameter and delete the nic tag regardless of existing VMs. type: bool - default: no + default: false state: description: - Create or delete a SmartOS nic tag. @@ -79,7 +80,7 @@ etherstub: description: specifies if the nic tag will create and attach to an etherstub. returned: always type: bool - sample: False + sample: false mtu: description: specifies which MTU size was passed during the nictagadm add command. mtu and etherstub are mutually exclusive. returned: always @@ -89,7 +90,7 @@ force: description: Shows if -f was used during the deletion of a nic tag returned: always type: bool - sample: False + sample: false state: description: state of the target returned: always diff --git a/plugins/modules/cloud/smartos/smartos_image_info.py b/plugins/modules/cloud/smartos/smartos_image_info.py index 0aa9c3ac1c..fb8c782317 100644 --- a/plugins/modules/cloud/smartos/smartos_image_info.py +++ b/plugins/modules/cloud/smartos/smartos_image_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2015, Adam Števko -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2015, Adam Števko +# 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/modules/cloud/smartos/vmadm.py b/plugins/modules/cloud/smartos/vmadm.py index c6b75e6b18..c352de90f7 100644 --- a/plugins/modules/cloud/smartos/vmadm.py +++ b/plugins/modules/cloud/smartos/vmadm.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2017, Jasper Lievisse Adriaanse -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017, Jasper Lievisse Adriaanse +# 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 @@ -357,8 +358,8 @@ EXAMPLES = ''' state: present alias: fw_zone image_uuid: 95f265b8-96b2-11e6-9597-972f3af4b6d5 - firewall_enabled: yes - indestructible_zoneroot: yes + firewall_enabled: true + indestructible_zoneroot: true nics: - nic_tag: admin ip: dhcp diff --git a/plugins/modules/cloud/softlayer/sl_vm.py b/plugins/modules/cloud/softlayer/sl_vm.py index 825d82e173..851f7a7f53 100644 --- a/plugins/modules/cloud/softlayer/sl_vm.py +++ b/plugins/modules/cloud/softlayer/sl_vm.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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 __metaclass__ = type @@ -79,22 +80,22 @@ options: description: - Flag to determine if the instance should be hourly billed. type: bool - default: 'yes' + default: true private: description: - Flag to determine if the instance should be private only. type: bool - default: 'no' + default: false dedicated: description: - Flag to determine if the instance should be deployed in dedicated space. type: bool - default: 'no' + default: false local_disk: description: - Flag to determine if local disk should be used for the new instance. type: bool - default: 'yes' + default: true cpus: description: - Count of cpus to be assigned to new virtual instance. @@ -157,7 +158,7 @@ options: description: - Flag used to wait for active status before returning. type: bool - default: 'yes' + default: true wait_time: description: - Time in seconds before wait returns. @@ -173,7 +174,7 @@ author: EXAMPLES = ''' - name: Build instance hosts: localhost - gather_facts: no + gather_facts: false tasks: - name: Build instance request community.general.sl_vm: @@ -181,19 +182,19 @@ EXAMPLES = ''' domain: anydomain.com datacenter: dal09 tags: ansible-module-test - hourly: yes - private: no - dedicated: no - local_disk: yes + hourly: true + private: false + dedicated: false + local_disk: true cpus: 1 memory: 1024 disks: [25] os_code: UBUNTU_LATEST - wait: no + wait: false - name: Build additional instances hosts: localhost - gather_facts: no + gather_facts: false tasks: - name: Build instances request community.general.sl_vm: @@ -218,10 +219,10 @@ EXAMPLES = ''' tags: - ansible-module-test - ansible-module-test-replicas - hourly: yes - private: no - dedicated: no - local_disk: yes + hourly: true + private: false + dedicated: false + local_disk: true cpus: 1 memory: 1024 disks: @@ -229,17 +230,17 @@ EXAMPLES = ''' - 100 os_code: UBUNTU_LATEST ssh_keys: [] - wait: True + wait: true - hostname: instance-3 domain: anydomain.com datacenter: dal09 tags: - ansible-module-test - ansible-module-test-replicas - hourly: yes - private: no - dedicated: no - local_disk: yes + hourly: true + private: false + dedicated: false + local_disk: true cpus: 1 memory: 1024 disks: @@ -247,11 +248,11 @@ EXAMPLES = ''' - 100 os_code: UBUNTU_LATEST ssh_keys: [] - wait: yes + wait: true - name: Cancel instances hosts: localhost - gather_facts: no + gather_facts: false tasks: - name: Cancel by tag community.general.sl_vm: diff --git a/plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py b/plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py index da8f010229..40d0270800 100644 --- a/plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py +++ b/plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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) DOCUMENTATION = ''' @@ -522,7 +523,7 @@ EXAMPLES = ''' min_size: 0 target: 0 unit: instance - monitoring: True + monitoring: true name: ansible-group on_demand_instance_type: c3.large product: Linux/UNIX @@ -560,7 +561,7 @@ EXAMPLES = ''' min_size: 0 target: 0 unit: instance - monitoring: True + monitoring: true name: ansible-group-tal on_demand_instance_type: c3.large product: Linux/UNIX @@ -575,7 +576,7 @@ EXAMPLES = ''' - c3.large do_not_update: - image_id - wait_for_instances: True + wait_for_instances: true wait_timeout: 600 register: result @@ -607,7 +608,7 @@ EXAMPLES = ''' min_size: 0 target: 0 unit: instance - monitoring: True + monitoring: true name: ansible-group-tal on_demand_instance_type: c3.large product: Linux/UNIX @@ -626,7 +627,7 @@ EXAMPLES = ''' - c3.large do_not_update: - image_id - wait_for_instances: True + wait_for_instances: true wait_timeout: 600 register: result @@ -658,7 +659,7 @@ EXAMPLES = ''' virtual_name: ephemeral0 - device_name: '/dev/xvdb/' virtual_name: ephemeral1 - monitoring: True + monitoring: true name: ansible-group on_demand_instance_type: c3.large product: Linux/UNIX @@ -696,7 +697,7 @@ EXAMPLES = ''' min_size: 0 target: 0 unit: instance - monitoring: True + monitoring: true name: ansible-group on_demand_instance_type: c3.large product: Linux/UNIX @@ -736,7 +737,7 @@ EXAMPLES = ''' min_size: 0 target: 2 unit: instance - monitoring: True + monitoring: true name: ansible-group-1 on_demand_instance_type: c3.large product: Linux/UNIX diff --git a/plugins/modules/cloud/univention/udm_dns_record.py b/plugins/modules/cloud/univention/udm_dns_record.py index 4e7aa70b32..13eb4feed4 100644 --- a/plugins/modules/cloud/univention/udm_dns_record.py +++ b/plugins/modules/cloud/univention/udm_dns_record.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2016, Adfinis SyGroup AG +# Copyright (c) 2016, Adfinis SyGroup AG # Tobias Rueetschi -# 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 @@ -55,7 +56,7 @@ options: default: {} description: - "Additional data for this record, e.g. ['a': '192.0.2.1']. - Required if C(state=present)." + Required if I(state=present)." ''' diff --git a/plugins/modules/cloud/univention/udm_dns_zone.py b/plugins/modules/cloud/univention/udm_dns_zone.py index f1cea87e4f..9b80368536 100644 --- a/plugins/modules/cloud/univention/udm_dns_zone.py +++ b/plugins/modules/cloud/univention/udm_dns_zone.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2016, Adfinis SyGroup AG +# Copyright (c) 2016, Adfinis SyGroup AG # Tobias Rueetschi -# 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 @@ -43,13 +44,13 @@ options: type: list elements: str description: - - List of appropriate name servers. Required if C(state=present). + - List of appropriate name servers. Required if I(state=present). interfaces: type: list elements: str description: - List of interface IP addresses, on which the server should - response this zone. Required if C(state=present). + response this zone. Required if I(state=present). refresh: type: int diff --git a/plugins/modules/cloud/univention/udm_group.py b/plugins/modules/cloud/univention/udm_group.py index aab6e2b7bc..034cdca1c3 100644 --- a/plugins/modules/cloud/univention/udm_group.py +++ b/plugins/modules/cloud/univention/udm_group.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2016, Adfinis SyGroup AG +# Copyright (c) 2016, Adfinis SyGroup AG # Tobias Rueetschi -# 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/modules/cloud/univention/udm_share.py b/plugins/modules/cloud/univention/udm_share.py index 5818467d1a..b1d7e13287 100644 --- a/plugins/modules/cloud/univention/udm_share.py +++ b/plugins/modules/cloud/univention/udm_share.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2016, Adfinis SyGroup AG +# Copyright (c) 2016, Adfinis SyGroup AG # Tobias Rueetschi -# 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 @@ -37,17 +38,17 @@ options: required: false description: - Host FQDN (server which provides the share), e.g. C({{ - ansible_fqdn }}). Required if C(state=present). + ansible_fqdn }}). Required if I(state=present). type: str path: required: false description: - - Directory on the providing server, e.g. C(/home). Required if C(state=present). + - Directory on the providing server, e.g. C(/home). Required if I(state=present). type: path sambaName: required: false description: - - Windows name. Required if C(state=present). + - Windows name. Required if I(state=present). type: str aliases: [ samba_name ] ou: @@ -105,7 +106,7 @@ options: description: - Show in Windows network environment. type: bool - default: True + default: true aliases: [ samba_browsable ] sambaCreateMode: default: '0744' diff --git a/plugins/modules/cloud/univention/udm_user.py b/plugins/modules/cloud/univention/udm_user.py index b0d6138fda..5fef1a337a 100644 --- a/plugins/modules/cloud/univention/udm_user.py +++ b/plugins/modules/cloud/univention/udm_user.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2016, Adfinis SyGroup AG +# Copyright (c) 2016, Adfinis SyGroup AG # Tobias Rueetschi -# 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 @@ -36,15 +37,15 @@ options: type: str firstname: description: - - First name. Required if C(state=present). + - First name. Required if I(state=present). type: str lastname: description: - - Last name. Required if C(state=present). + - Last name. Required if I(state=present). type: str password: description: - - Password. Required if C(state=present). + - Password. Required if I(state=present). type: str birthday: description: @@ -148,13 +149,13 @@ options: type: str overridePWHistory: type: bool - default: 'no' + default: false description: - Override password history aliases: [ override_pw_history ] overridePWLength: type: bool - default: 'no' + default: false description: - Override password check aliases: [ override_pw_length ] diff --git a/plugins/modules/cloud/webfaction/webfaction_app.py b/plugins/modules/cloud/webfaction/webfaction_app.py index cd779b035a..b2fe7f892d 100644 --- a/plugins/modules/cloud/webfaction/webfaction_app.py +++ b/plugins/modules/cloud/webfaction/webfaction_app.py @@ -1,11 +1,12 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2015, Quentin Stafford-Fraser, with contributions gratefully acknowledged from: +# Copyright (c) 2015, Quentin Stafford-Fraser, with contributions gratefully acknowledged from: # * Andy Baker # * Federico Tarantini # -# 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 # Create a Webfaction application using Ansible and the Webfaction API # @@ -54,7 +55,7 @@ options: description: - Whether the app should restart with an C(autostart.cgi) script type: bool - default: 'no' + default: false extra_info: description: @@ -66,7 +67,7 @@ options: description: - IF the port should be opened type: bool - default: 'no' + default: false login_name: description: diff --git a/plugins/modules/cloud/webfaction/webfaction_db.py b/plugins/modules/cloud/webfaction/webfaction_db.py index 8708c7743b..868f1f66a2 100644 --- a/plugins/modules/cloud/webfaction/webfaction_db.py +++ b/plugins/modules/cloud/webfaction/webfaction_db.py @@ -1,11 +1,12 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2015, Quentin Stafford-Fraser, with contributions gratefully acknowledged from: +# Copyright (c) 2015, Quentin Stafford-Fraser, with contributions gratefully acknowledged from: # * Andy Baker # * Federico Tarantini # -# 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 # Create a webfaction database using Ansible and the Webfaction API diff --git a/plugins/modules/cloud/webfaction/webfaction_domain.py b/plugins/modules/cloud/webfaction/webfaction_domain.py index f9c3b7db7a..79485d629c 100644 --- a/plugins/modules/cloud/webfaction/webfaction_domain.py +++ b/plugins/modules/cloud/webfaction/webfaction_domain.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2015, Quentin Stafford-Fraser -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2015, Quentin Stafford-Fraser +# 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 # Create Webfaction domains and subdomains using Ansible and the Webfaction API @@ -18,7 +19,7 @@ description: - Add or remove domains or subdomains on a Webfaction host. Further documentation at https://github.com/quentinsf/ansible-webfaction. author: Quentin Stafford-Fraser (@quentinsf) notes: - - If you are I(deleting) domains by using C(state=absent), then note that if you specify subdomains, just those particular subdomains will be deleted. + - If you are I(deleting) domains by using I(state=absent), then note that if you specify subdomains, just those particular subdomains will be deleted. If you don't specify subdomains, the domain will be deleted. - > You can run playbooks that use this on a local machine, or on a Webfaction host, or elsewhere, since the scripts use the remote webfaction API. diff --git a/plugins/modules/cloud/webfaction/webfaction_mailbox.py b/plugins/modules/cloud/webfaction/webfaction_mailbox.py index 37755763a2..0df4e8ced0 100644 --- a/plugins/modules/cloud/webfaction/webfaction_mailbox.py +++ b/plugins/modules/cloud/webfaction/webfaction_mailbox.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2015, Quentin Stafford-Fraser and Andy Baker -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2015, Quentin Stafford-Fraser and Andy Baker +# 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 # Create webfaction mailbox using Ansible and the Webfaction API diff --git a/plugins/modules/cloud/webfaction/webfaction_site.py b/plugins/modules/cloud/webfaction/webfaction_site.py index 87faade3e2..4e6f317e87 100644 --- a/plugins/modules/cloud/webfaction/webfaction_site.py +++ b/plugins/modules/cloud/webfaction/webfaction_site.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2015, Quentin Stafford-Fraser -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2015, Quentin Stafford-Fraser +# 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 # Create Webfaction website using Ansible and the Webfaction API @@ -52,7 +53,7 @@ options: description: - Whether or not to use HTTPS type: bool - default: 'no' + default: false site_apps: description: @@ -91,7 +92,7 @@ EXAMPLES = ''' - 'testsite1.my_domain.org' site_apps: - ['testapp1', '/'] - https: no + https: false login_name: "{{webfaction_user}}" login_password: "{{webfaction_passwd}}" ''' diff --git a/plugins/modules/cloud/xenserver/xenserver_guest.py b/plugins/modules/cloud/xenserver/xenserver_guest.py index b90b380c3f..95b25174cf 100644 --- a/plugins/modules/cloud/xenserver/xenserver_guest.py +++ b/plugins/modules/cloud/xenserver/xenserver_guest.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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 @@ -26,7 +27,7 @@ notes: U(https://raw.githubusercontent.com/xapi-project/xen-api/master/scripts/examples/python/XenAPI/XenAPI.py)' - 'If no scheme is specified in I(hostname), module defaults to C(http://) because C(https://) is problematic in most setups. Make sure you are accessing XenServer host in trusted environment or use C(https://) scheme explicitly.' -- 'To use C(https://) scheme for I(hostname) you have to either import host certificate to your OS certificate store or use I(validate_certs): C(no) +- 'To use C(https://) scheme for I(hostname) you have to either import host certificate to your OS certificate store or use I(validate_certs): C(false) which requires XenAPI library from XenServer 7.2 SDK or newer and Python 2.7.9 or newer.' - 'Network configuration inside a guest OS, by using I(networks.type), I(networks.ip), I(networks.gateway) etc. parameters, is supported on XenServer 7.0 or newer for Windows guests by using official XenServer Guest agent support for network configuration. The module will try to @@ -92,7 +93,7 @@ options: description: - Convert VM to template. type: bool - default: no + default: false folder: description: - Destination folder for VM. @@ -252,21 +253,21 @@ options: description: - VM param name. type: str - required: yes + required: true value: description: - VM param value. type: raw - required: yes + required: true wait_for_ip_address: description: - Wait until XenServer detects an IP address for the VM. If I(state) is set to C(absent), this parameter is ignored. - This requires XenServer Tools to be preinstalled on the VM to work properly. type: bool - default: no + default: false state_change_timeout: description: - - 'By default, module will wait indefinitely for VM to accquire an IP address if I(wait_for_ip_address): C(yes).' + - 'By default, module will wait indefinitely for VM to accquire an IP address if I(wait_for_ip_address): C(true).' - If this parameter is set to positive value, the module will instead wait specified number of seconds for the state change. - In case of timeout, module will generate an error message. type: int @@ -276,13 +277,13 @@ options: - Whether to create a Linked Clone from the template, existing VM or snapshot. If no, will create a full copy. - This is equivalent to C(Use storage-level fast disk clone) option in XenCenter. type: bool - default: no + default: false force: description: - Ignore warnings and complete the actions. - This parameter is useful for removing VM in running state or reconfiguring VM params that require VM to be shut down. type: bool - default: no + default: false extends_documentation_fragment: - community.general.xenserver.documentation @@ -294,7 +295,7 @@ EXAMPLES = r''' hostname: "{{ xenserver_hostname }}" username: "{{ xenserver_username }}" password: "{{ xenserver_password }}" - validate_certs: no + validate_certs: false folder: /testvms name: testvm_2 state: poweredon @@ -312,7 +313,7 @@ EXAMPLES = r''' networks: - name: VM Network mac: aa:bb:dd:aa:00:14 - wait_for_ip_address: yes + wait_for_ip_address: true delegate_to: localhost register: deploy @@ -321,10 +322,10 @@ EXAMPLES = r''' hostname: "{{ xenserver_hostname }}" username: "{{ xenserver_username }}" password: "{{ xenserver_password }}" - validate_certs: no + validate_certs: false folder: /testvms name: testvm_6 - is_template: yes + is_template: true disk: - size_gb: 10 sr: my_sr @@ -1207,7 +1208,7 @@ class XenServerVM(XenServerObject): if (self.module.params['home_server'] and (not self.vm_params['affinity'] or self.module.params['home_server'] != self.vm_params['affinity']['name_label'])): - # Check existance only. Ignore return value. + # Check existence only. Ignore return value. get_object_ref(self.module, self.module.params['home_server'], uuid=None, obj_type="home server", fail=True, msg_prefix="VM check home_server: ") @@ -1371,7 +1372,7 @@ class XenServerVM(XenServerObject): disk_sr = disk_params.get('sr') if disk_sr_uuid is not None or disk_sr is not None: - # Check existance only. Ignore return value. + # Check existence only. Ignore return value. get_object_ref(self.module, disk_sr, disk_sr_uuid, obj_type="SR", fail=True, msg_prefix="VM check disks[%s]: " % position) elif self.default_sr_ref == 'OpaqueRef:NULL': @@ -1448,7 +1449,7 @@ class XenServerVM(XenServerObject): if cdrom_type == "iso": # Check if ISO exists. - # Check existance only. Ignore return value. + # Check existence only. Ignore return value. get_object_ref(self.module, cdrom_iso_name, uuid=None, obj_type="ISO image", fail=True, msg_prefix="VM check cdrom.iso_name: ") @@ -1496,7 +1497,7 @@ class XenServerVM(XenServerObject): self.module.fail_json(msg="VM check networks[%s]: network name cannot be an empty string!" % position) if network_name: - # Check existance only. Ignore return value. + # Check existence only. Ignore return value. get_object_ref(self.module, network_name, uuid=None, obj_type="network", fail=True, msg_prefix="VM check networks[%s]: " % position) diff --git a/plugins/modules/cloud/xenserver/xenserver_guest_info.py b/plugins/modules/cloud/xenserver/xenserver_guest_info.py index a2e777253e..750cc3a84f 100644 --- a/plugins/modules/cloud/xenserver/xenserver_guest_info.py +++ b/plugins/modules/cloud/xenserver/xenserver_guest_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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/modules/cloud/xenserver/xenserver_guest_powerstate.py b/plugins/modules/cloud/xenserver/xenserver_guest_powerstate.py index 4a195ff50a..7903ad8b9f 100644 --- a/plugins/modules/cloud/xenserver/xenserver_guest_powerstate.py +++ b/plugins/modules/cloud/xenserver/xenserver_guest_powerstate.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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 @@ -56,10 +57,10 @@ options: - Wait until XenServer detects an IP address for the VM. - This requires XenServer Tools to be preinstalled on the VM to work properly. type: bool - default: no + default: false state_change_timeout: description: - - 'By default, module will wait indefinitely for VM to change state or acquire an IP address if C(wait_for_ip_address: yes).' + - 'By default, module will wait indefinitely for VM to change state or acquire an IP address if C(wait_for_ip_address: true).' - If this parameter is set to positive value, the module will instead wait specified number of seconds for the state change. - In case of timeout, module will generate an error message. type: int @@ -170,8 +171,6 @@ instance: } ''' -import re - HAS_XENAPI = False try: import XenAPI diff --git a/plugins/modules/clustering/consul/consul.py b/plugins/modules/clustering/consul/consul.py index e06432b684..152d4577a1 100644 --- a/plugins/modules/clustering/consul/consul.py +++ b/plugins/modules/clustering/consul/consul.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# (c) 2015, Steve Gargan -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2015, Steve Gargan +# 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 @@ -69,7 +70,7 @@ options: description: - whether to verify the TLS certificate of the consul agent type: bool - default: 'yes' + default: true notes: type: str description: @@ -333,7 +334,7 @@ def add_service(module, service): service_id=result.id, service_name=result.name, service_port=result.port, - checks=[check.to_dict() for check in service.checks], + checks=[check.to_dict() for check in service.checks()], tags=result.tags) diff --git a/plugins/modules/clustering/consul/consul_acl.py b/plugins/modules/clustering/consul/consul_acl.py index 1e01e58af5..b9f14db164 100644 --- a/plugins/modules/clustering/consul/consul_acl.py +++ b/plugins/modules/clustering/consul/consul_acl.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# (c) 2015, Steve Gargan -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2015, Steve Gargan +# 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 @@ -78,7 +79,7 @@ options: description: - whether to verify the tls certificate of the consul agent required: false - default: True + default: true requirements: - python-consul - pyhcl @@ -149,7 +150,7 @@ rules: description: the HCL JSON representation of the rules associated to the ACL, in the format described in the Consul documentation (https://www.consul.io/docs/guides/acl.html#rule-specification). returned: I(status) == "present" - type: str + type: dict sample: { "key": { "foo": { diff --git a/plugins/modules/clustering/consul/consul_kv.py b/plugins/modules/clustering/consul/consul_kv.py index f7b33b856e..3419e3322b 100644 --- a/plugins/modules/clustering/consul/consul_kv.py +++ b/plugins/modules/clustering/consul/consul_kv.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# (c) 2015, Steve Gargan -# (c) 2018 Genome Research Ltd. -# 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) 2018 Genome Research Ltd. +# 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 @@ -28,14 +29,14 @@ author: options: state: description: - - The action to take with the supplied key and value. If the state is 'present' and `value` is set, the key - contents will be set to the value supplied and `changed` will be set to `true` only if the value was - different to the current contents. If the state is 'present' and `value` is not set, the existing value - associated to the key will be returned. The state 'absent' will remove the key/value pair, - again 'changed' will be set to true only if the key actually existed + - The action to take with the supplied key and value. If the state is C(present) and I(value) is set, the key + contents will be set to the value supplied and C(changed) will be set to C(true) only if the value was + different to the current contents. If the state is C(present) and I(value) is not set, the existing value + associated to the key will be returned. The state C(absent) will remove the key/value pair, + again C(changed) will be set to true only if the key actually existed prior to the removal. An attempt can be made to obtain or free the - lock associated with a key/value pair with the states 'acquire' or - 'release' respectively. a valid session must be supplied to make the + lock associated with a key/value pair with the states C(acquire) or + C(release) respectively. a valid session must be supplied to make the attempt changed will be true if the attempt is successful, false otherwise. type: str @@ -45,7 +46,7 @@ options: description: - The key at which the value should be stored. type: str - required: yes + required: true value: description: - The value should be associated with the given key, required if C(state) @@ -54,13 +55,13 @@ options: recurse: description: - If the key represents a prefix, each entry with the prefix can be - retrieved by setting this to C(yes). + retrieved by setting this to C(true). type: bool retrieve: description: - If the I(state) is C(present) and I(value) is set, perform a read after setting the value and return this value. - default: True + default: true type: bool session: description: @@ -102,7 +103,7 @@ options: description: - Whether to verify the tls certificate of the consul agent. type: bool - default: 'yes' + default: true ''' @@ -278,7 +279,7 @@ def remove_value(module): data=existing) -def get_consul_api(module, token=None): +def get_consul_api(module): return consul.Consul(host=module.params.get('host'), port=module.params.get('port'), scheme=module.params.get('scheme'), diff --git a/plugins/modules/clustering/consul/consul_session.py b/plugins/modules/clustering/consul/consul_session.py index 7ace1f89a8..062eb3befe 100644 --- a/plugins/modules/clustering/consul/consul_session.py +++ b/plugins/modules/clustering/consul/consul_session.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2015, Steve Gargan -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2015, Steve Gargan +# 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 @@ -87,7 +88,7 @@ options: description: - Whether to verify the TLS certificate of the consul agent. type: bool - default: True + default: true behavior: description: - The optional behavior that can be attached to the session when it @@ -95,6 +96,17 @@ options: choices: [ delete, release ] type: str default: release + ttl: + description: + - Specifies the duration of a session in seconds (between 10 and 86400). + type: int + version_added: 5.4.0 + token: + description: + - The token key identifying an ACL rule set that controls access to + the key value pair. + type: str + version_added: 5.6.0 ''' EXAMPLES = ''' @@ -121,6 +133,11 @@ EXAMPLES = ''' - name: Retrieve active sessions community.general.consul_session: state: list + +- name: Register session with a ttl + community.general.consul_session: + name: session-with-ttl + ttl: 600 # sec ''' try: @@ -185,6 +202,7 @@ def update_session(module): datacenter = module.params.get('datacenter') node = module.params.get('node') behavior = module.params.get('behavior') + ttl = module.params.get('ttl') consul_client = get_consul_api(module) @@ -192,6 +210,7 @@ def update_session(module): session = consul_client.session.create( name=name, behavior=behavior, + ttl=ttl, node=node, lock_delay=delay, dc=datacenter, @@ -201,6 +220,7 @@ def update_session(module): session_id=session, name=name, behavior=behavior, + ttl=ttl, delay=delay, checks=checks, node=node) @@ -227,7 +247,8 @@ def get_consul_api(module): return consul.Consul(host=module.params.get('host'), port=module.params.get('port'), scheme=module.params.get('scheme'), - verify=module.params.get('validate_certs')) + verify=module.params.get('validate_certs'), + token=module.params.get('token')) def test_dependencies(module): @@ -241,6 +262,7 @@ def main(): checks=dict(type='list', elements='str'), delay=dict(type='int', default='15'), behavior=dict(type='str', default='release', choices=['release', 'delete']), + ttl=dict(type='int'), host=dict(type='str', default='localhost'), port=dict(type='int', default=8500), scheme=dict(type='str', default='http'), @@ -250,6 +272,7 @@ def main(): node=dict(type='str'), state=dict(type='str', default='present', choices=['absent', 'info', 'list', 'node', 'present']), datacenter=dict(type='str'), + token=dict(type='str', no_log=True), ) module = AnsibleModule( diff --git a/plugins/modules/clustering/etcd3.py b/plugins/modules/clustering/etcd3.py index 6a09513364..e67227cc19 100644 --- a/plugins/modules/clustering/etcd3.py +++ b/plugins/modules/clustering/etcd3.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# (c) 2018, Jean-Philippe Evrard -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2018, Jean-Philippe Evrard +# 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 @@ -126,6 +127,7 @@ from ansible.module_utils.common.text.converters import to_native try: import etcd3 HAS_ETCD = True + ETCD_IMP_ERR = None except ImportError: ETCD_IMP_ERR = traceback.format_exc() HAS_ETCD = False diff --git a/plugins/modules/clustering/nomad/nomad_job.py b/plugins/modules/clustering/nomad/nomad_job.py index 92081dfabd..05e2556c1b 100644 --- a/plugins/modules/clustering/nomad/nomad_job.py +++ b/plugins/modules/clustering/nomad/nomad_job.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (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/modules/clustering/nomad/nomad_job_info.py b/plugins/modules/clustering/nomad/nomad_job_info.py index 3d15712fda..5130fd1b60 100644 --- a/plugins/modules/clustering/nomad/nomad_job_info.py +++ b/plugins/modules/clustering/nomad/nomad_job_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (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 @@ -265,10 +266,6 @@ result: ''' - -import os -import json - from ansible.module_utils.basic import AnsibleModule, missing_required_lib from ansible.module_utils.common.text.converters import to_native diff --git a/plugins/modules/clustering/pacemaker_cluster.py b/plugins/modules/clustering/pacemaker_cluster.py index 4ec6010f53..a71c1b0044 100644 --- a/plugins/modules/clustering/pacemaker_cluster.py +++ b/plugins/modules/clustering/pacemaker_cluster.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2016, Mathieu Bultel -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, Mathieu Bultel +# 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 @@ -36,13 +37,13 @@ options: description: - Force the change of the cluster state type: bool - default: 'yes' + default: true ''' EXAMPLES = ''' --- - name: Set cluster Online hosts: localhost - gather_facts: no + gather_facts: false tasks: - name: Get cluster state community.general.pacemaker_cluster: @@ -51,7 +52,7 @@ EXAMPLES = ''' RETURN = ''' changed: - description: True if the cluster state has changed + description: true if the cluster state has changed type: bool returned: always out: diff --git a/plugins/modules/clustering/znode.py b/plugins/modules/clustering/znode.py index d55a502b15..07be85c145 100644 --- a/plugins/modules/clustering/znode.py +++ b/plugins/modules/clustering/znode.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2015 WP Engine, Inc. All rights reserved. -# 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 @@ -47,7 +48,7 @@ options: description: - Recursively delete node and all its children. type: bool - default: 'no' + default: false requirements: - kazoo >= 2.1 - python >= 2.6 diff --git a/plugins/modules/database/aerospike/aerospike_migrations.py b/plugins/modules/database/aerospike/aerospike_migrations.py index 27b979ad1f..32ab06a853 100644 --- a/plugins/modules/database/aerospike/aerospike_migrations.py +++ b/plugins/modules/database/aerospike/aerospike_migrations.py @@ -2,8 +2,9 @@ # -*- coding: utf-8 -*- """short_description: Check or wait for migrations between nodes""" -# Copyright: (c) 2018, Albert Autin -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2018, Albert Autin +# 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 @@ -22,73 +23,73 @@ options: host: description: - Which host do we use as seed for info connection - required: False + required: false type: str default: localhost port: description: - Which port to connect to Aerospike on (service port) - required: False + required: false type: int default: 3000 connect_timeout: description: - How long to try to connect before giving up (milliseconds) - required: False + required: false type: int default: 1000 consecutive_good_checks: description: - How many times should the cluster report "no migrations" consecutively before returning OK back to ansible? - required: False + required: false type: int default: 3 sleep_between_checks: description: - How long to sleep between each check (seconds). - required: False + required: false type: int default: 60 tries_limit: description: - How many times do we poll before giving up and failing? default: 300 - required: False + required: false type: int local_only: description: - Do you wish to only check for migrations on the local node before returning, or do you want all nodes in the cluster to finish before returning? - required: True + required: true type: bool min_cluster_size: description: - Check will return bad until cluster size is met or until tries is exhausted - required: False + required: false type: int default: 1 fail_on_cluster_change: description: - Fail if the cluster key changes if something else is changing the cluster, we may want to fail - required: False + required: false type: bool - default: True + default: true migrate_tx_key: description: - The metric key used to determine if we have tx migrations remaining. Changeable due to backwards compatibility. - required: False + required: false type: str default: migrate_tx_partitions_remaining migrate_rx_key: description: - The metric key used to determine if we have rx migrations remaining. Changeable due to backwards compatibility. - required: False + required: false type: str default: migrate_rx_partitions_remaining target_cluster_size: @@ -101,7 +102,7 @@ options: - If this option is specified on a cluster that has at least 1 host <4.3 then it will be ignored until the min version reaches 4.3. - required: False + required: false type: int ''' EXAMPLES = ''' @@ -113,7 +114,7 @@ EXAMPLES = ''' consecutive_good_checks: 5 sleep_between_checks: 15 tries_limit: 600 - local_only: False + local_only: false # example playbook: - name: Upgrade aerospike @@ -139,7 +140,7 @@ EXAMPLES = ''' # Tries Limit * Sleep Between Checks * delay * retries - name: Wait for aerospike migrations community.general.aerospike_migrations: - local_only: True + local_only: true sleep_between_checks: 1 tries_limit: 5 consecutive_good_checks: 3 diff --git a/plugins/modules/database/influxdb/influxdb_database.py b/plugins/modules/database/influxdb/influxdb_database.py index 6601b30124..8ffbece606 100644 --- a/plugins/modules/database/influxdb/influxdb_database.py +++ b/plugins/modules/database/influxdb/influxdb_database.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2016, Kamil Szczygiel -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, Kamil Szczygiel +# 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 @@ -55,8 +56,8 @@ EXAMPLES = r''' username: "{{influxdb_username}}" password: "{{influxdb_password}}" database_name: "{{influxdb_database_name}}" - ssl: yes - validate_certs: yes + ssl: true + validate_certs: true ''' RETURN = r''' diff --git a/plugins/modules/database/influxdb/influxdb_query.py b/plugins/modules/database/influxdb/influxdb_query.py index bff6fa989b..14a65a60dc 100644 --- a/plugins/modules/database/influxdb/influxdb_query.py +++ b/plugins/modules/database/influxdb/influxdb_query.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017, 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/modules/database/influxdb/influxdb_retention_policy.py b/plugins/modules/database/influxdb/influxdb_retention_policy.py index 6cb45229cd..1b7d7eec9a 100644 --- a/plugins/modules/database/influxdb/influxdb_retention_policy.py +++ b/plugins/modules/database/influxdb/influxdb_retention_policy.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2016, Kamil Szczygiel -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, Kamil Szczygiel +# 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 @@ -76,8 +77,8 @@ EXAMPLES = r''' policy_name: test duration: 1h replication: 1 - ssl: yes - validate_certs: yes + ssl: true + validate_certs: true state: present - name: Create 1 day retention policy with 1 hour shard group duration @@ -107,8 +108,8 @@ EXAMPLES = r''' policy_name: test duration: INF replication: 1 - ssl: no - validate_certs: no + ssl: false + validate_certs: false shard_group_duration: 1w state: present @@ -119,8 +120,8 @@ EXAMPLES = r''' policy_name: test duration: 5d1h30m replication: 1 - ssl: no - validate_certs: no + ssl: false + validate_certs: false shard_group_duration: 1d10h30m state: present diff --git a/plugins/modules/database/influxdb/influxdb_user.py b/plugins/modules/database/influxdb/influxdb_user.py index 76524d8613..25bc2a95ce 100644 --- a/plugins/modules/database/influxdb/influxdb_user.py +++ b/plugins/modules/database/influxdb/influxdb_user.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2017, Vitaliy Zhhuta +# Copyright (c) 2017, Vitaliy Zhhuta # insipred by Kamil Szczygiel influxdb_database module -# 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 @@ -23,7 +24,7 @@ options: user_name: description: - Name of the user. - required: True + required: true type: str user_password: description: @@ -34,7 +35,7 @@ options: description: - Whether the user should be in the admin role or not. - Since version 2.8, the role will also be updated. - default: no + default: false type: bool state: description: @@ -72,7 +73,7 @@ EXAMPLES = r''' community.general.influxdb_user: user_name: john user_password: s3cr3t - admin: yes + admin: true hostname: "{{ influxdb_hostname }}" login_username: "{{ influxdb_username }}" login_password: "{{ influxdb_password }}" diff --git a/plugins/modules/database/influxdb/influxdb_write.py b/plugins/modules/database/influxdb/influxdb_write.py index e34fe9c2cf..68e722ae1c 100644 --- a/plugins/modules/database/influxdb/influxdb_write.py +++ b/plugins/modules/database/influxdb/influxdb_write.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017, 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/modules/database/misc/elasticsearch_plugin.py b/plugins/modules/database/misc/elasticsearch_plugin.py index bc7df931b6..a68ff086c3 100644 --- a/plugins/modules/database/misc/elasticsearch_plugin.py +++ b/plugins/modules/database/misc/elasticsearch_plugin.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2015, Mathew Davies -# (c) 2017, Sam Doran -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2015, Mathew Davies +# Copyright (c) 2017, 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 @@ -21,7 +22,7 @@ options: name: description: - Name of the plugin to install. - required: True + required: true type: str state: description: @@ -39,13 +40,13 @@ options: parameter. If, for example, the plugin is already installed, changing this has no effect. - For ES 1.x use url. - required: False + required: false type: str url: description: - Set exact URL to download the plugin from (Only works for ES 1.x). - For ES 2.x and higher, use src. - required: False + required: false type: str timeout: description: @@ -56,7 +57,7 @@ options: force: description: - "Force batch mode when installing plugins. This is only necessary if a plugin requires additional permissions and console detection fails." - default: False + default: false type: bool plugin_bin: description: @@ -108,7 +109,7 @@ EXAMPLES = ''' community.general.elasticsearch_plugin: name: ingest-geoip state: present - force: yes + force: true ''' import os diff --git a/plugins/modules/database/misc/kibana_plugin.py b/plugins/modules/database/misc/kibana_plugin.py index db5091e400..94838e22b6 100644 --- a/plugins/modules/database/misc/kibana_plugin.py +++ b/plugins/modules/database/misc/kibana_plugin.py @@ -4,7 +4,8 @@ # Copyright (c) 2016, Thierno IB. BARRY @barryib # Sponsored by Polyconseil http://polyconseil.fr. # -# 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 @@ options: name: description: - Name of the plugin to install. - required: True + required: true type: str state: description: diff --git a/plugins/modules/database/misc/odbc.py b/plugins/modules/database/misc/odbc.py index 5d1cdf884b..3b6e8ad226 100644 --- a/plugins/modules/database/misc/odbc.py +++ b/plugins/modules/database/misc/odbc.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2019, John Westcott -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, John Westcott +# 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 @@ -19,12 +20,12 @@ options: dsn: description: - The connection string passed into ODBC. - required: yes + required: true type: str query: description: - The SQL query to perform. - required: yes + required: true type: str params: description: @@ -37,7 +38,7 @@ options: - Some databases allow a commit after a select whereas others raise an exception. - Default is C(true) to support legacy module behavior. type: bool - default: yes + default: true version_added: 1.3.0 requirements: - "python >= 2.6" @@ -57,7 +58,7 @@ EXAMPLES = ''' params: - "value1" commit: false - changed_when: no + changed_when: false ''' RETURN = ''' diff --git a/plugins/modules/database/misc/redis.py b/plugins/modules/database/misc/redis.py index 13a1f5060b..298b3aaf8c 100644 --- a/plugins/modules/database/misc/redis.py +++ b/plugins/modules/database/misc/redis.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -138,7 +139,7 @@ except ImportError: else: redis_found = True -from ansible.module_utils.basic import AnsibleModule, missing_required_lib +from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.common.text.formatters import human_to_bytes from ansible.module_utils.common.text.converters import to_native from ansible_collections.community.general.plugins.module_utils.redis import ( diff --git a/plugins/modules/database/misc/redis_data.py b/plugins/modules/database/misc/redis_data.py index 587b37d04f..633afbff54 100644 --- a/plugins/modules/database/misc/redis_data.py +++ b/plugins/modules/database/misc/redis_data.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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/modules/database/misc/redis_data_incr.py b/plugins/modules/database/misc/redis_data_incr.py index e9e03941e4..4d1c119349 100644 --- a/plugins/modules/database/misc/redis_data_incr.py +++ b/plugins/modules/database/misc/redis_data_incr.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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/modules/database/misc/redis_data_info.py b/plugins/modules/database/misc/redis_data_info.py index 7ecfd4a234..c4186ff358 100644 --- a/plugins/modules/database/misc/redis_data_info.py +++ b/plugins/modules/database/misc/redis_data_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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/modules/database/misc/redis_info.py b/plugins/modules/database/misc/redis_info.py index 9762b03c98..25b1d80035 100644 --- a/plugins/modules/database/misc/redis_info.py +++ b/plugins/modules/database/misc/redis_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2020, Pavlo Bashynskyi (@levonet) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2020, Pavlo Bashynskyi (@levonet) +# 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/modules/database/misc/riak.py b/plugins/modules/database/misc/riak.py index 4ee7b5b674..38f1c33c78 100644 --- a/plugins/modules/database/misc/riak.py +++ b/plugins/modules/database/misc/riak.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2013, James Martin , Drew Kerrigan -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2013, James Martin , Drew Kerrigan +# 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 @@ -56,10 +57,10 @@ options: type: str validate_certs: description: - - If C(no), SSL certificates will not be validated. This should only be used + - If C(false), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. type: bool - default: 'yes' + default: true ''' EXAMPLES = ''' @@ -70,7 +71,7 @@ EXAMPLES = ''' - name: Wait for handoffs to finish. Use with async and poll. community.general.riak: - wait_for_handoffs: yes + wait_for_handoffs: true - name: Wait for riak_kv service to startup community.general.riak: diff --git a/plugins/modules/database/mssql/mssql_db.py b/plugins/modules/database/mssql/mssql_db.py index e6c5f183fa..7e64dcc2cc 100644 --- a/plugins/modules/database/mssql/mssql_db.py +++ b/plugins/modules/database/mssql/mssql_db.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2014, Vedit Firat Arig +# Copyright (c) 2014, Vedit Firat Arig # Outline and parts are reused from Mark Theunissen's mysql_db module -# 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 @@ -56,7 +57,7 @@ options: - Automatically commit the change only if the import succeed. Sometimes it is necessary to use autocommit=true, since some content can't be changed within a transaction. type: bool - default: 'no' + default: false notes: - Requires the pymssql Python package on the remote host. For Ubuntu, this is as easy as pip install pymssql (See M(ansible.builtin.pip).) diff --git a/plugins/modules/database/mssql/mssql_script.py b/plugins/modules/database/mssql/mssql_script.py index bb80607ccf..1a5f45736f 100644 --- a/plugins/modules/database/mssql/mssql_script.py +++ b/plugins/modules/database/mssql/mssql_script.py @@ -1,7 +1,8 @@ #!/usr/bin/python -# Copyright: (c) 2021, Kris Budde -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, Rainer Leber +# 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 @@ -87,7 +88,7 @@ EXAMPLES = r''' - "select user_name from users;" - select * from SYSTEM; host: "localhost" - autocommit: False + autocommit: false - name: Run several queries from file community.general.hana_query: @@ -108,7 +109,7 @@ EXAMPLES = r''' query: - "select user_name from users;" - select * from users; - autocommit: False + autocommit: false ''' RETURN = r''' diff --git a/plugins/modules/database/vertica/vertica_configuration.py b/plugins/modules/database/vertica/vertica_configuration.py index b210e3f6f0..f3ac067d0f 100644 --- a/plugins/modules/database/vertica/vertica_configuration.py +++ b/plugins/modules/database/vertica/vertica_configuration.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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/modules/database/vertica/vertica_info.py b/plugins/modules/database/vertica/vertica_info.py index 3822a0717d..825006ad71 100644 --- a/plugins/modules/database/vertica/vertica_info.py +++ b/plugins/modules/database/vertica/vertica_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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/modules/database/vertica/vertica_role.py b/plugins/modules/database/vertica/vertica_role.py index 4ec75d7dc6..e9f2ef34df 100644 --- a/plugins/modules/database/vertica/vertica_role.py +++ b/plugins/modules/database/vertica/vertica_role.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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/modules/database/vertica/vertica_schema.py b/plugins/modules/database/vertica/vertica_schema.py index 12af3e64f7..b1bdf944b9 100644 --- a/plugins/modules/database/vertica/vertica_schema.py +++ b/plugins/modules/database/vertica/vertica_schema.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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/modules/database/vertica/vertica_user.py b/plugins/modules/database/vertica/vertica_user.py index 0616c302bd..ff2f02d0cc 100644 --- a/plugins/modules/database/vertica/vertica_user.py +++ b/plugins/modules/database/vertica/vertica_user.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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/modules/files/archive.py b/plugins/modules/files/archive.py index 7b13eb6c4d..9d82017b3c 100644 --- a/plugins/modules/files/archive.py +++ b/plugins/modules/files/archive.py @@ -1,10 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2016, Ben Doherty +# Copyright (c) 2016, Ben Doherty # Sponsored by Oomph, Inc. http://www.oomphinc.com -# 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 __metaclass__ = type @@ -63,7 +64,7 @@ options: description: - Remove any added source files and trees after adding to archive. type: bool - default: no + default: false notes: - Requires tarfile, zipfile, gzip and bzip2 packages on target host. - Requires lzma or backports.lzma if using xz format. @@ -83,7 +84,7 @@ EXAMPLES = r''' - name: Compress regular file /path/to/foo into /path/to/foo.gz and remove it community.general.archive: path: /path/to/foo - remove: yes + remove: true - name: Create a zip archive of /path/to/foo community.general.archive: diff --git a/plugins/modules/files/filesize.py b/plugins/modules/files/filesize.py index 83edbe58ae..a8c47d70fd 100644 --- a/plugins/modules/files/filesize.py +++ b/plugins/modules/files/filesize.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2021, quidame -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, 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/modules/files/ini_file.py b/plugins/modules/files/ini_file.py index 79d373f3a7..aaef3bb3db 100644 --- a/plugins/modules/files/ini_file.py +++ b/plugins/modules/files/ini_file.py @@ -1,10 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2012, Jan-Piet Mens -# Copyright: (c) 2015, Ales Nosek -# 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) 2012, Jan-Piet Mens +# Copyright (c) 2015, Ales Nosek +# 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 @@ -32,7 +33,7 @@ options: aliases: [ dest ] section: description: - - Section name in INI file. This is added if C(state=present) automatically when + - Section name in INI file. This is added if I(state=present) automatically when a single value is being set. - If left empty or set to C(null), the I(option) will be placed before the first I(section). - Using C(null) is also required if the config format does not support sections. @@ -64,44 +65,44 @@ options: - Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly. type: bool - default: no + default: false state: description: - - If set to C(absent) and I(exclusive) set to C(yes) all matching I(option) lines are removed. - - If set to C(absent) and I(exclusive) set to C(no) the specified C(option=value) lines are removed, + - If set to C(absent) and I(exclusive) set to C(true) all matching I(option) lines are removed. + - If set to C(absent) and I(exclusive) set to C(false) the specified I(option=value) lines are removed, but the other I(option)s with the same name are not touched. - - If set to C(present) and I(exclusive) set to C(no) the specified C(option=values) lines are added, + - If set to C(present) and I(exclusive) set to C(false) the specified I(option=values) lines are added, but the other I(option)s with the same name are not touched. - - If set to C(present) and I(exclusive) set to C(yes) all given C(option=values) lines will be + - If set to C(present) and I(exclusive) set to C(true) all given I(option=values) lines will be added and the other I(option)s with the same name are removed. type: str choices: [ absent, present ] default: present exclusive: description: - - If set to C(yes) (default), all matching I(option) lines are removed when I(state=absent), + - If set to C(true) (default), all matching I(option) lines are removed when I(state=absent), or replaced when I(state=present). - - If set to C(no), only the specified I(value(s)) are added when I(state=present), + - If set to C(false), only the specified I(value(s)) are added when I(state=present), or removed when I(state=absent), and existing ones are not modified. type: bool - default: yes + default: true version_added: 3.6.0 no_extra_spaces: description: - Do not insert spaces before and after '=' symbol. type: bool - default: no + default: false create: description: - - If set to C(no), the module will fail if the file does not already exist. + - If set to C(false), the module will fail if the file does not already exist. - By default it will create the file if it is missing. type: bool - default: yes + default: true allow_no_value: description: - Allow option without value and without '=' symbol. type: bool - default: no + default: false notes: - While it is possible to add an I(option) without specifying a I(value), this makes no sense. - As of Ansible 2.3, the I(dest) option has been changed to I(path) as default, but I(dest) still works as well. @@ -120,7 +121,7 @@ EXAMPLES = r''' option: fav value: lemonade mode: '0600' - backup: yes + backup: true - name: Ensure "temperature=cold is in section "[drinks]" in specified file community.general.ini_file: @@ -128,7 +129,7 @@ EXAMPLES = r''' section: drinks option: temperature value: cold - backup: yes + backup: true - name: Add "beverage=lemon juice" is in section "[drinks]" in specified file community.general.ini_file: @@ -138,7 +139,7 @@ EXAMPLES = r''' value: lemon juice mode: '0600' state: present - exclusive: no + exclusive: false - name: Ensure multiple values "beverage=coke" and "beverage=pepsi" are in section "[drinks]" in specified file community.general.ini_file: @@ -279,7 +280,7 @@ def do_ini(module, filename, section=None, option=None, values=None, # handling multiple instances of option=value when state is 'present' with/without exclusive is a bit complex # # 1. edit all lines where we have a option=value pair with a matching value in values[] - # 2. edit all the remaing lines where we have a matching option + # 2. edit all the remaining lines where we have a matching option # 3. delete remaining lines where we have a matching option # 4. insert missing option line(s) at the end of the section @@ -309,7 +310,7 @@ def do_ini(module, filename, section=None, option=None, values=None, # override option with no value to option with value if not allow_no_value if len(values) > 0: for index, line in enumerate(section_lines): - if not changed_lines[index] and match_active_opt(option, section_lines[index]): + if not changed_lines[index] and match_active_opt(option, section_lines[index]): # pylint: disable=unnecessary-list-index-lookup newline = assignment_format % (option, values.pop(0)) (changed, msg) = update_section_line(changed, section_lines, index, changed_lines, newline, msg) if len(values) == 0: diff --git a/plugins/modules/files/iso_create.py b/plugins/modules/files/iso_create.py index 3fa456339e..d729f222a2 100644 --- a/plugins/modules/files/iso_create.py +++ b/plugins/modules/files/iso_create.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2020, Ansible Project -# Copyright: (c) 2020, VMware, Inc. All Rights Reserved. -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2020, Ansible Project +# Copyright (c) 2020, VMware, Inc. All Rights Reserved. +# 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 @@ -30,14 +31,14 @@ options: underscores (_). File names are limited to 31 characters, directory nesting is limited to 8 levels, and path names are limited to 255 characters.' type: list - required: yes + required: true elements: path dest_iso: description: - The absolute path with file name of the new generated ISO file on local machine. - Will create intermediate folders when they does not exist. type: path - required: yes + required: true interchange_level: description: - The ISO9660 interchange level to use, it dictates the rules on the names of files. @@ -72,7 +73,7 @@ options: - If set to C(True), then version 2.60 of the UDF spec is used. - If not specified or set to C(False), then no UDF support is added. type: bool - default: False + default: false ''' EXAMPLES = r''' @@ -138,7 +139,7 @@ udf: description: Configured UDF support. returned: on success type: bool - sample: False + sample: false ''' import os diff --git a/plugins/modules/files/iso_extract.py b/plugins/modules/files/iso_extract.py index 81fe6b662f..6693fc3884 100644 --- a/plugins/modules/files/iso_extract.py +++ b/plugins/modules/files/iso_extract.py @@ -1,11 +1,12 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2013, Jeroen Hoekx -# Copyright: (c) 2016, Matt Robinson -# Copyright: (c) 2017, Dag Wieers -# 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) 2013, Jeroen Hoekx +# Copyright (c) 2016, Matt Robinson +# Copyright (c) 2017, 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 @@ -27,33 +28,33 @@ description: mounts the ISO image to a temporary location, and copies files to a given destination, if needed. requirements: -- Either 7z (from I(7zip) or I(p7zip) package) +- Either 7z (from C(7zip) or C(p7zip) package) - Or mount capabilities (root-access, or CAP_SYS_ADMIN capability on Linux) options: image: description: - The ISO image to extract files from. type: path - required: yes + required: true aliases: [ path, src ] dest: description: - The destination directory to extract files to. type: path - required: yes + required: true files: description: - A list of files to extract from the image. - Extracting directories does not work. type: list elements: str - required: yes + required: true force: description: - - If C(yes), which will replace the remote file when contents are different than the source. - - If C(no), the file will only be extracted and copied if the destination does not already exist. + - If C(true), which will replace the remote file when contents are different than the source. + - If C(false), the file will only be extracted and copied if the destination does not already exist. type: bool - default: yes + default: true executable: description: - The path to the C(7z) executable to use for extracting files from the ISO. @@ -61,7 +62,7 @@ options: type: path notes: - Only the file checksum (content) is taken into account when extracting files - from the ISO image. If C(force=no), only checks the presence of the file. + from the ISO image. If I(force=false), only checks the presence of the file. - In Ansible 2.3 this module was using C(mount) and C(umount) commands only, requiring root access. This is no longer needed with the introduction of 7zip for extraction. diff --git a/plugins/modules/files/read_csv.py b/plugins/modules/files/read_csv.py index 484a365e4c..38c91ded07 100644 --- a/plugins/modules/files/read_csv.py +++ b/plugins/modules/files/read_csv.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# 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) 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 @@ -20,7 +21,7 @@ options: description: - The CSV filename to read data from. type: path - required: yes + required: true aliases: [ filename ] key: description: @@ -44,7 +45,7 @@ options: description: - Whether the C(key) used is expected to be unique. type: bool - default: yes + default: true delimiter: description: - A one-character string used to separate fields. diff --git a/plugins/modules/files/sapcar_extract.py b/plugins/modules/files/sapcar_extract.py index 8463703c1e..57ede47616 100644 --- a/plugins/modules/files/sapcar_extract.py +++ b/plugins/modules/files/sapcar_extract.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2021, Rainer Leber -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, Rainer Leber +# 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 @@ -207,7 +208,7 @@ def main(): changed = True else: changed = False - out = "allready unpacked" + out = "already unpacked" if remove: os.remove(path) diff --git a/plugins/modules/files/xattr.py b/plugins/modules/files/xattr.py index c0867892d3..9cc74a1382 100644 --- a/plugins/modules/files/xattr.py +++ b/plugins/modules/files/xattr.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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 __metaclass__ = type diff --git a/plugins/modules/files/xml.py b/plugins/modules/files/xml.py index ae95e9c646..05bbdf00c8 100644 --- a/plugins/modules/files/xml.py +++ b/plugins/modules/files/xml.py @@ -1,11 +1,12 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2014, Red Hat, Inc. -# Copyright: (c) 2014, Tim Bielawa -# Copyright: (c) 2014, Magnus Hedemark -# Copyright: (c) 2017, Dag Wieers -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2014, Red Hat, Inc. +# Copyright (c) 2014, Tim Bielawa +# Copyright (c) 2014, Magnus Hedemark +# Copyright (c) 2017, 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 @@ -21,13 +22,13 @@ options: description: - Path to the file to operate on. - This file must exist ahead of time. - - This parameter is required, unless C(xmlstring) is given. + - This parameter is required, unless I(xmlstring) is given. type: path aliases: [ dest, file ] xmlstring: description: - A string containing XML on which to operate. - - This parameter is required, unless C(path) is given. + - This parameter is required, unless I(path) is given. type: str xpath: description: @@ -48,7 +49,7 @@ options: aliases: [ ensure ] attribute: description: - - The attribute to select when using parameter C(value). + - The attribute to select when using parameter I(value). - This is a string, not prepended with C(@). type: raw value: @@ -60,47 +61,47 @@ options: type: raw add_children: description: - - Add additional child-element(s) to a selected element for a given C(xpath). + - Add additional child-element(s) to a selected element for a given I(xpath). - Child elements must be given in a list and each item may be either a string (eg. C(children=ansible) to add an empty C() child element), or a hash where the key is an element name and the value is the element value. - - This parameter requires C(xpath) to be set. + - This parameter requires I(xpath) to be set. type: list elements: raw set_children: description: - - Set the child-element(s) of a selected element for a given C(xpath). + - Set the child-element(s) of a selected element for a given I(xpath). - Removes any existing children. - - Child elements must be specified as in C(add_children). - - This parameter requires C(xpath) to be set. + - Child elements must be specified as in I(add_children). + - This parameter requires I(xpath) to be set. type: list elements: raw count: description: - - Search for a given C(xpath) and provide the count of any matches. - - This parameter requires C(xpath) to be set. + - Search for a given I(xpath) and provide the count of any matches. + - This parameter requires I(xpath) to be set. type: bool - default: no + default: false print_match: description: - - Search for a given C(xpath) and print out any matches. - - This parameter requires C(xpath) to be set. + - Search for a given I(xpath) and print out any matches. + - This parameter requires I(xpath) to be set. type: bool - default: no + default: false pretty_print: description: - Pretty print XML output. type: bool - default: no + default: false content: description: - - Search for a given C(xpath) and get content. - - This parameter requires C(xpath) to be set. + - Search for a given I(xpath) and get content. + - This parameter requires I(xpath) to be set. type: str choices: [ attribute, text ] input_type: description: - - Type of input for C(add_children) and C(set_children). + - Type of input for I(add_children) and I(set_children). type: str choices: [ xml, yaml ] default: yaml @@ -109,38 +110,38 @@ options: - Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly. type: bool - default: no + default: false strip_cdata_tags: description: - Remove CDATA tags surrounding text values. - Note that this might break your XML file if text values contain characters that could be interpreted as XML. type: bool - default: no + default: false insertbefore: description: - - Add additional child-element(s) before the first selected element for a given C(xpath). + - Add additional child-element(s) before the first selected element for a given I(xpath). - Child elements must be given in a list and each item may be either a string (eg. C(children=ansible) to add an empty C() child element), or a hash where the key is an element name and the value is the element value. - - This parameter requires C(xpath) to be set. + - This parameter requires I(xpath) to be set. type: bool - default: no + default: false insertafter: description: - - Add additional child-element(s) after the last selected element for a given C(xpath). + - Add additional child-element(s) after the last selected element for a given I(xpath). - Child elements must be given in a list and each item may be either a string (eg. C(children=ansible) to add an empty C() child element), or a hash where the key is an element name and the value is the element value. - - This parameter requires C(xpath) to be set. + - This parameter requires I(xpath) to be set. type: bool - default: no + default: false requirements: - lxml >= 2.3.0 notes: - Use the C(--check) and C(--diff) options when testing your expressions. - The diff output is automatically pretty-printed, so may not reflect the actual file content, only the file structure. - This module does not handle complicated xpath expressions, so limit xpath selectors to simple expressions. -- Beware that in case your XML elements are namespaced, you need to use the C(namespaces) parameter, see the examples. +- Beware that in case your XML elements are namespaced, you need to use the I(namespaces) parameter, see the examples. - Namespaces prefix should be used for all children of an element where namespace is defined, unless another namespace is defined for them. seealso: - name: Xml module development community wiki @@ -192,7 +193,7 @@ EXAMPLES = r''' community.general.xml: path: /foo/bar.xml xpath: /business/beers/beer - count: yes + count: true register: hits - ansible.builtin.debug: @@ -218,7 +219,7 @@ EXAMPLES = r''' community.general.xml: path: /foo/bar.xml xpath: '/business/beers/beer[text()="Rochefort 10"]' - insertbefore: yes + insertbefore: true add_children: - beer: Old Rasputin - beer: Old Motor Oil @@ -329,7 +330,7 @@ actions: backup_file: description: The name of the backup file that was created type: str - returned: when backup=yes + returned: when I(backup=true) sample: /path/to/file.xml.1942.2017-08-24@14:16:01~ count: description: The count of xpath matches. diff --git a/plugins/modules/identity/ipa/ipa_config.py b/plugins/modules/identity/ipa/ipa_config.py index 2b41dfb098..5847db077a 100644 --- a/plugins/modules/identity/ipa/ipa_config.py +++ b/plugins/modules/identity/ipa/ipa_config.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2018, Fran Fitzpatrick -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2018, Fran Fitzpatrick +# 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/modules/identity/ipa/ipa_dnsrecord.py b/plugins/modules/identity/ipa/ipa_dnsrecord.py index 36f4cfdded..d070e1c69f 100644 --- a/plugins/modules/identity/ipa/ipa_dnsrecord.py +++ b/plugins/modules/identity/ipa/ipa_dnsrecord.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2017, Abhijeet Kasurde (akasurde@redhat.com) +# 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) +# 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/modules/identity/ipa/ipa_dnszone.py b/plugins/modules/identity/ipa/ipa_dnszone.py index 33ae59e9d0..167c49dc80 100644 --- a/plugins/modules/identity/ipa/ipa_dnszone.py +++ b/plugins/modules/identity/ipa/ipa_dnszone.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2017, Fran Fitzpatrick (francis.x.fitzpatrick@gmail.com) +# Copyright (c) 2017, Fran Fitzpatrick (francis.x.fitzpatrick@gmail.com) # Borrowed heavily from other work by Abhijeet Kasurde (akasurde@redhat.com) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# GNU General Public License v3.0+ (see 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/modules/identity/ipa/ipa_group.py b/plugins/modules/identity/ipa/ipa_group.py index d6af57ba1f..fa3c610d90 100644 --- a/plugins/modules/identity/ipa/ipa_group.py +++ b/plugins/modules/identity/ipa/ipa_group.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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 __metaclass__ = type @@ -16,9 +17,9 @@ description: options: append: description: - - If C(yes), add the listed I(user) and I(group) to the group members. - - If C(no), only the listed I(user) and I(group) will be group members, removing any other members. - default: no + - If C(true), add the listed I(user) and I(group) to the group members. + - If C(false), only the listed I(user) and I(group) will be group members, removing any other members. + default: false type: bool version_added: 4.0.0 cn: @@ -44,9 +45,9 @@ options: group: description: - List of group names assigned to this group. - - If I(append=no) and an empty list is passed all groups will be removed from this group. + - If I(append=false) and an empty list is passed all groups will be removed from this group. - Groups that are already assigned but not passed will be removed. - - If I(append=yes) the listed groups will be assigned without removing other groups. + - If I(append=true) the listed groups will be assigned without removing other groups. - If option is omitted assigned groups will not be checked or changed. type: list elements: str @@ -57,9 +58,9 @@ options: user: description: - List of user names assigned to this group. - - If I(append=no) and an empty list is passed all users will be removed from this group. + - If I(append=false) and an empty list is passed all users will be removed from this group. - Users that are already assigned but not passed will be removed. - - If I(append=yes) the listed users will be assigned without removing other users. + - If I(append=true) the listed users will be assigned without removing other users. - If option is omitted assigned users will not be checked or changed. type: list elements: str @@ -109,7 +110,7 @@ EXAMPLES = r''' name: developers user: - john - append: yes + append: true state: present ipa_host: ipa.example.com ipa_user: admin diff --git a/plugins/modules/identity/ipa/ipa_hbacrule.py b/plugins/modules/identity/ipa/ipa_hbacrule.py index 5f0704d58b..37f0de8bc1 100644 --- a/plugins/modules/identity/ipa/ipa_hbacrule.py +++ b/plugins/modules/identity/ipa/ipa_hbacrule.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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 __metaclass__ = type diff --git a/plugins/modules/identity/ipa/ipa_host.py b/plugins/modules/identity/ipa/ipa_host.py index 25c65f0b34..ad3c37877c 100644 --- a/plugins/modules/identity/ipa/ipa_host.py +++ b/plugins/modules/identity/ipa/ipa_host.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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 __metaclass__ = type @@ -111,8 +112,8 @@ EXAMPLES = r''' ipa_host: ipa.example.com ipa_user: admin ipa_pass: topsecret - validate_certs: False - random_password: True + validate_certs: false + random_password: true - name: Ensure host is disabled community.general.ipa_host: @@ -145,7 +146,7 @@ EXAMPLES = r''' ipa_host: ipa.example.com ipa_user: admin ipa_pass: topsecret - update_dns: True + update_dns: true ''' RETURN = r''' diff --git a/plugins/modules/identity/ipa/ipa_hostgroup.py b/plugins/modules/identity/ipa/ipa_hostgroup.py index 9d5c6f99c7..37a09f7fa2 100644 --- a/plugins/modules/identity/ipa/ipa_hostgroup.py +++ b/plugins/modules/identity/ipa/ipa_hostgroup.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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 __metaclass__ = type diff --git a/plugins/modules/identity/ipa/ipa_otpconfig.py b/plugins/modules/identity/ipa/ipa_otpconfig.py index 9a10baec0b..e9bef94a85 100644 --- a/plugins/modules/identity/ipa/ipa_otpconfig.py +++ b/plugins/modules/identity/ipa/ipa_otpconfig.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2021, Ansible Project +# Copyright (c) 2021, Ansible Project # Heavily influenced from Fran Fitzpatrick ipa_config module -# 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 @@ -45,7 +46,7 @@ EXAMPLES = r''' ipa_user: admin ipa_pass: supersecret -- name: Ensure the TOTP syncronization window is set to 86400 seconds +- name: Ensure the TOTP synchronization window is set to 86400 seconds community.general.ipa_otpconfig: ipatokentotpsyncwindow: '86400' ipa_host: localhost @@ -59,7 +60,7 @@ EXAMPLES = r''' ipa_user: admin ipa_pass: supersecret -- name: Ensure the HOTP syncronization window is set to 100 hops +- name: Ensure the HOTP synchronization window is set to 100 hops community.general.ipa_otpconfig: ipatokenhotpsyncwindow: '100' ipa_host: localhost diff --git a/plugins/modules/identity/ipa/ipa_otptoken.py b/plugins/modules/identity/ipa/ipa_otptoken.py index 4027a1c459..0cc06d7163 100644 --- a/plugins/modules/identity/ipa/ipa_otptoken.py +++ b/plugins/modules/identity/ipa/ipa_otptoken.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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 __metaclass__ = type @@ -445,8 +446,8 @@ def ensure(module, client): module_otptoken['all'] = True ipa_otptoken = client.otptoken_add(name=uniqueid, item=module_otptoken) else: - if not(validate_modifications(ansible_to_ipa, module, ipa_otptoken, - module_otptoken, unmodifiable_after_creation)): + if not validate_modifications(ansible_to_ipa, module, ipa_otptoken, + module_otptoken, unmodifiable_after_creation): module.fail_json(msg="Modifications requested in module are not valid") # IPA will reject 'modifications' that do not actually modify anything diff --git a/plugins/modules/identity/ipa/ipa_pwpolicy.py b/plugins/modules/identity/ipa/ipa_pwpolicy.py index 0f9b141b4c..db75b121c7 100644 --- a/plugins/modules/identity/ipa/ipa_pwpolicy.py +++ b/plugins/modules/identity/ipa/ipa_pwpolicy.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2020, Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# 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 from __future__ import absolute_import, division, print_function __metaclass__ = type diff --git a/plugins/modules/identity/ipa/ipa_role.py b/plugins/modules/identity/ipa/ipa_role.py index c602614ef9..0168343839 100644 --- a/plugins/modules/identity/ipa/ipa_role.py +++ b/plugins/modules/identity/ipa/ipa_role.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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 __metaclass__ = type diff --git a/plugins/modules/identity/ipa/ipa_service.py b/plugins/modules/identity/ipa/ipa_service.py index 63c6d8216d..f0a7daf151 100644 --- a/plugins/modules/identity/ipa/ipa_service.py +++ b/plugins/modules/identity/ipa/ipa_service.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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/modules/identity/ipa/ipa_subca.py b/plugins/modules/identity/ipa/ipa_subca.py index 387d63c513..ef9f74ed87 100644 --- a/plugins/modules/identity/ipa/ipa_subca.py +++ b/plugins/modules/identity/ipa/ipa_subca.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # 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) +# 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/modules/identity/ipa/ipa_sudocmd.py b/plugins/modules/identity/ipa/ipa_sudocmd.py index d75aff44ce..18991ccfd4 100644 --- a/plugins/modules/identity/ipa/ipa_sudocmd.py +++ b/plugins/modules/identity/ipa/ipa_sudocmd.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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 __metaclass__ = type diff --git a/plugins/modules/identity/ipa/ipa_sudocmdgroup.py b/plugins/modules/identity/ipa/ipa_sudocmdgroup.py index 65fdd4f75f..d9c39a4a3c 100644 --- a/plugins/modules/identity/ipa/ipa_sudocmdgroup.py +++ b/plugins/modules/identity/ipa/ipa_sudocmdgroup.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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 __metaclass__ = type diff --git a/plugins/modules/identity/ipa/ipa_sudorule.py b/plugins/modules/identity/ipa/ipa_sudorule.py index 2054599f9d..bc5419adba 100644 --- a/plugins/modules/identity/ipa/ipa_sudorule.py +++ b/plugins/modules/identity/ipa/ipa_sudorule.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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 __metaclass__ = type diff --git a/plugins/modules/identity/ipa/ipa_user.py b/plugins/modules/identity/ipa/ipa_user.py index 8a7b3abea2..4fd96425cf 100644 --- a/plugins/modules/identity/ipa/ipa_user.py +++ b/plugins/modules/identity/ipa/ipa_user.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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 __metaclass__ = type diff --git a/plugins/modules/identity/ipa/ipa_vault.py b/plugins/modules/identity/ipa/ipa_vault.py index 7a6a601fa9..40f5844cd9 100644 --- a/plugins/modules/identity/ipa/ipa_vault.py +++ b/plugins/modules/identity/ipa/ipa_vault.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2018, Juan Manuel Parrilla -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2018, Juan Manuel Parrilla +# 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,9 +64,9 @@ options: type: str replace: description: - - Force replace the existant vault on IPA server. + - Force replace the existent vault on IPA server. type: bool - default: False + default: false choices: ["True", "False"] validate_certs: description: @@ -114,7 +115,7 @@ EXAMPLES = r''' ipa_host: ipa.example.com ipa_user: admin ipa_pass: topsecret - replace: True + replace: true - name: Get vault info if already exists community.general.ipa_vault: diff --git a/plugins/modules/identity/keycloak/keycloak_authentication.py b/plugins/modules/identity/keycloak/keycloak_authentication.py index c7bf5bc01f..e2e680814f 100644 --- a/plugins/modules/identity/keycloak/keycloak_authentication.py +++ b/plugins/modules/identity/keycloak/keycloak_authentication.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2019, INSPQ -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, INSPQ +# 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/modules/identity/keycloak/keycloak_client.py b/plugins/modules/identity/keycloak/keycloak_client.py index 88268b3068..22ba6a810a 100644 --- a/plugins/modules/identity/keycloak/keycloak_client.py +++ b/plugins/modules/identity/keycloak/keycloak_client.py @@ -2,7 +2,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) +# 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 @@ -595,7 +596,7 @@ EXAMPLES = ''' root_url: https://www.example.com/ admin_url: https://www.example.com/admin_url base_url: basepath - enabled: True + enabled: true client_authenticator_type: client-secret secret: REALLYWELLKEPTSECRET redirect_uris: @@ -604,22 +605,22 @@ EXAMPLES = ''' web_origins: - https://www.example.com/* not_before: 1507825725 - bearer_only: False - consent_required: False - standard_flow_enabled: True - implicit_flow_enabled: False - direct_access_grants_enabled: False - service_accounts_enabled: False - authorization_services_enabled: False - public_client: False - frontchannel_logout: False + bearer_only: false + consent_required: false + standard_flow_enabled: true + implicit_flow_enabled: false + direct_access_grants_enabled: false + service_accounts_enabled: false + authorization_services_enabled: false + public_client: false + frontchannel_logout: false protocol: openid-connect full_scope_allowed: false node_re_registration_timeout: -1 client_template: test - use_template_config: False + use_template_config: false use_template_scope: false - use_template_mappers: no + use_template_mappers: false always_display_in_console: true registered_nodes: node01.example.com: 1507828202 @@ -632,13 +633,13 @@ EXAMPLES = ''' browser: 4c90336b-bf1d-4b87-916d-3677ba4e5fbb protocol_mappers: - config: - access.token.claim: True + access.token.claim: true claim.name: "family_name" - id.token.claim: True + id.token.claim: true jsonType.label: String user.attribute: lastName - userinfo.token.claim: True - consentRequired: True + userinfo.token.claim: true + consentRequired: true consentText: "${familyName}" name: family name protocol: openid-connect @@ -652,14 +653,14 @@ EXAMPLES = ''' protocol: saml protocolMapper: saml-role-list-mapper attributes: - saml.authnstatement: True - saml.client.signature: True - saml.force.post.binding: True - saml.server.signature: True + saml.authnstatement: true + saml.client.signature: true + saml.force.post.binding: true + saml.server.signature: true saml.signature.algorithm: RSA_SHA256 saml.signing.certificate: CERTIFICATEHERE saml.signing.private.key: PRIVATEKEYHERE - saml_force_name_id_format: False + saml_force_name_id_format: false saml_name_id_format: username saml_signature_canonicalization_method: "http://www.w3.org/2001/10/xml-exc-c14n#" user.info.response.signature.alg: RS256 diff --git a/plugins/modules/identity/keycloak/keycloak_client_rolemapping.py b/plugins/modules/identity/keycloak/keycloak_client_rolemapping.py index 2d89753143..c4dde9bee1 100644 --- a/plugins/modules/identity/keycloak/keycloak_client_rolemapping.py +++ b/plugins/modules/identity/keycloak/keycloak_client_rolemapping.py @@ -1,7 +1,9 @@ #!/usr/bin/python # -*- 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/modules/identity/keycloak/keycloak_clientscope.py b/plugins/modules/identity/keycloak/keycloak_clientscope.py index 2deab5547d..0ac6836f7b 100644 --- a/plugins/modules/identity/keycloak/keycloak_clientscope.py +++ b/plugins/modules/identity/keycloak/keycloak_clientscope.py @@ -1,7 +1,9 @@ #!/usr/bin/python # -*- 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 @@ -226,12 +228,12 @@ EXAMPLES = ''' protocol: openid-connect protocol_mappers: - config: - access.token.claim: True + access.token.claim: true claim.name: "family_name" - id.token.claim: True + id.token.claim: true jsonType.label: String user.attribute: lastName - userinfo.token.claim: True + userinfo.token.claim: true name: family name protocol: openid-connect protocolMapper: oidc-usermodel-property-mapper diff --git a/plugins/modules/identity/keycloak/keycloak_clienttemplate.py b/plugins/modules/identity/keycloak/keycloak_clienttemplate.py index cec7c93d8d..4b75bad919 100644 --- a/plugins/modules/identity/keycloak/keycloak_clienttemplate.py +++ b/plugins/modules/identity/keycloak/keycloak_clienttemplate.py @@ -2,7 +2,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) +# 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 @@ -212,13 +213,13 @@ EXAMPLES = ''' name: this_is_a_test protocol_mappers: - config: - access.token.claim: True + access.token.claim: true claim.name: "family_name" - id.token.claim: True + id.token.claim: true jsonType.label: String user.attribute: lastName - userinfo.token.claim: True - consentRequired: True + userinfo.token.claim: true + consentRequired: true consentText: "${familyName}" name: family name protocol: openid-connect diff --git a/plugins/modules/identity/keycloak/keycloak_group.py b/plugins/modules/identity/keycloak/keycloak_group.py index 3455f57818..1ae3859ef2 100644 --- a/plugins/modules/identity/keycloak/keycloak_group.py +++ b/plugins/modules/identity/keycloak/keycloak_group.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # Copyright (c) 2019, Adam Goossens -# 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/modules/identity/keycloak/keycloak_identity_provider.py b/plugins/modules/identity/keycloak/keycloak_identity_provider.py index a4adddd951..5915006d6b 100644 --- a/plugins/modules/identity/keycloak/keycloak_identity_provider.py +++ b/plugins/modules/identity/keycloak/keycloak_identity_provider.py @@ -1,7 +1,9 @@ #!/usr/bin/python # -*- 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/modules/identity/keycloak/keycloak_realm.py b/plugins/modules/identity/keycloak/keycloak_realm.py index 90b8d62a56..f457d20cd3 100644 --- a/plugins/modules/identity/keycloak/keycloak_realm.py +++ b/plugins/modules/identity/keycloak/keycloak_realm.py @@ -3,7 +3,8 @@ # Copyright (c) 2017, Eike Frost # Copyright (c) 2021, Christophe Gilles -# 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 @@ -163,7 +164,7 @@ options: aliases: - defaultGroups type: list - elements: dict + elements: str default_locale: description: - The realm default locale. @@ -183,7 +184,7 @@ options: aliases: - defaultRoles type: list - elements: dict + elements: str default_signature_algorithm: description: - The realm default signature algorithm. @@ -622,10 +623,10 @@ def main(): client_authentication_flow=dict(type='str', aliases=['clientAuthenticationFlow']), client_scope_mappings=dict(type='dict', aliases=['clientScopeMappings']), default_default_client_scopes=dict(type='list', elements='str', aliases=['defaultDefaultClientScopes']), - default_groups=dict(type='list', elements='dict', aliases=['defaultGroups']), + default_groups=dict(type='list', elements='str', aliases=['defaultGroups']), default_locale=dict(type='str', aliases=['defaultLocale']), default_optional_client_scopes=dict(type='list', elements='str', aliases=['defaultOptionalClientScopes']), - default_roles=dict(type='list', elements='dict', aliases=['defaultRoles']), + default_roles=dict(type='list', elements='str', aliases=['defaultRoles']), default_signature_algorithm=dict(type='str', aliases=['defaultSignatureAlgorithm']), direct_grant_flow=dict(type='str', aliases=['directGrantFlow']), display_name=dict(type='str', aliases=['displayName']), diff --git a/plugins/modules/identity/keycloak/keycloak_realm_info.py b/plugins/modules/identity/keycloak/keycloak_realm_info.py index a84c9dc767..0956f1b525 100644 --- a/plugins/modules/identity/keycloak/keycloak_realm_info.py +++ b/plugins/modules/identity/keycloak/keycloak_realm_info.py @@ -1,7 +1,9 @@ #!/usr/bin/python # -*- 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 @@ -36,7 +38,7 @@ options: description: - Verify TLS certificates (do not disable this in production). type: bool - default: yes + default: true realm: type: str @@ -64,7 +66,7 @@ msg: realm_info: description: - - Representation of the realm public infomation. + - Representation of the realm public information. returned: always type: dict contains: diff --git a/plugins/modules/identity/keycloak/keycloak_role.py b/plugins/modules/identity/keycloak/keycloak_role.py index 2dd2438e42..ea6828b38e 100644 --- a/plugins/modules/identity/keycloak/keycloak_role.py +++ b/plugins/modules/identity/keycloak/keycloak_role.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # Copyright (c) 2019, Adam Goossens -# 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/modules/identity/keycloak/keycloak_user_federation.py b/plugins/modules/identity/keycloak/keycloak_user_federation.py index 4d623a4874..55915d08c4 100644 --- a/plugins/modules/identity/keycloak/keycloak_user_federation.py +++ b/plugins/modules/identity/keycloak/keycloak_user_federation.py @@ -1,7 +1,9 @@ #!/usr/bin/python # -*- 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/modules/identity/onepassword_info.py b/plugins/modules/identity/onepassword_info.py index 6621092303..8118709b17 100644 --- a/plugins/modules/identity/onepassword_info.py +++ b/plugins/modules/identity/onepassword_info.py @@ -1,10 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# (c) 2018, Ryan Conway (@rylon) -# (c) 2018, Scott Buchanan (onepassword.py used as starting point) -# (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, Ryan Conway (@rylon) +# Copyright (c) 2018, Scott Buchanan (onepassword.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) @@ -54,7 +55,7 @@ options: type: str description: - The name of the particular 1Password vault to search, useful if your 1Password user has access to multiple vaults (optional). - required: True + required: true auto_login: type: dict description: @@ -79,18 +80,18 @@ options: description: - The master password for your subdomain. - This is always required when specifying C(auto_login). - required: True + required: true secret_key: type: str description: - The secret key for your subdomain. - Only required for initial sign in. default: {} - required: False + required: false cli_path: type: path description: Used to specify the exact path to the C(op) command line interface - required: False + required: false default: 'op' ''' @@ -113,7 +114,7 @@ EXAMPLES = ''' vault: Name of the vault # optional, only necessary if there is more than 1 Vault available delegate_to: localhost register: my_1password_item - no_log: True # Don't want to log the secrets to the console! + no_log: true # Don't want to log the secrets to the console! # Gather secrets combining simple and advanced search terms to retrieve two items, one of which we fetch two # fields. In the first 'password' is fetched, as a field name is not specified (default behaviour) and in the diff --git a/plugins/modules/identity/opendj/opendj_backendprop.py b/plugins/modules/identity/opendj/opendj_backendprop.py index be118a505d..dfdf6a903a 100644 --- a/plugins/modules/identity/opendj/opendj_backendprop.py +++ b/plugins/modules/identity/opendj/opendj_backendprop.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2016, Werner Dijkerman (ikben@werner-dijkerman.nl) -# 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) 2016, Werner Dijkerman (ikben@werner-dijkerman.nl) +# 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/modules/monitoring/airbrake_deployment.py b/plugins/modules/monitoring/airbrake_deployment.py index a7d7710a0a..2fb5b58737 100644 --- a/plugins/modules/monitoring/airbrake_deployment.py +++ b/plugins/modules/monitoring/airbrake_deployment.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # Copyright 2013 Bruce Pennypacker -# 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 @@ -64,10 +65,10 @@ options: type: str validate_certs: description: - - If C(no), SSL certificates for the target url will not be validated. This should only be used + - If C(false), SSL certificates for the target url will not be validated. This should only be used on personally controlled sites using self-signed certificates. required: false - default: 'yes' + default: true type: bool requirements: [] @@ -94,7 +95,6 @@ EXAMPLES = ''' from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.urls import fetch_url -from ansible.module_utils.six.moves.urllib.parse import urlencode # =========================================== diff --git a/plugins/modules/monitoring/alerta_customer.py b/plugins/modules/monitoring/alerta_customer.py index 27b0abe1a9..b9bfd4b265 100644 --- a/plugins/modules/monitoring/alerta_customer.py +++ b/plugins/modules/monitoring/alerta_customer.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2022, Christian Wollinger <@cwollinger> -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2022, Christian Wollinger <@cwollinger> +# 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/modules/monitoring/bigpanda.py b/plugins/modules/monitoring/bigpanda.py index c5fe61cbf6..4e653aadb7 100644 --- a/plugins/modules/monitoring/bigpanda.py +++ b/plugins/modules/monitoring/bigpanda.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -63,14 +64,14 @@ options: type: str description: - Base URL of the API server. - required: False + required: false default: https://api.bigpanda.io validate_certs: description: - - If C(no), SSL certificates for the target url will not be validated. This should only be used + - If C(false), SSL certificates for the target url will not be validated. This should only be used on personally controlled sites using self-signed certificates. required: false - default: 'yes' + default: true type: bool deployment_message: type: str diff --git a/plugins/modules/monitoring/circonus_annotation.py b/plugins/modules/monitoring/circonus_annotation.py index 40c7297dd7..6248fd2f55 100644 --- a/plugins/modules/monitoring/circonus_annotation.py +++ b/plugins/modules/monitoring/circonus_annotation.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# (c) 2014-2015, Epic Games, Inc. -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2014-2015, Epic Games, 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/modules/monitoring/datadog/datadog_downtime.py b/plugins/modules/monitoring/datadog/datadog_downtime.py index ef308bdabe..8a1acf7e83 100644 --- a/plugins/modules/monitoring/datadog/datadog_downtime.py +++ b/plugins/modules/monitoring/datadog/datadog_downtime.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2020, Datadog, Inc -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2020, Datadog, 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 @@ -150,7 +151,6 @@ import traceback from ansible.module_utils.basic import AnsibleModule, missing_required_lib # Import Datadog -from ansible.module_utils.common.text.converters import to_native DATADOG_IMP_ERR = None HAS_DATADOG = True diff --git a/plugins/modules/monitoring/datadog/datadog_event.py b/plugins/modules/monitoring/datadog/datadog_event.py index 6284b5bf23..0a669c4a81 100644 --- a/plugins/modules/monitoring/datadog/datadog_event.py +++ b/plugins/modules/monitoring/datadog/datadog_event.py @@ -6,7 +6,9 @@ # # This module is proudly sponsored by iGeolise (www.igeolise.com) and # Tiny Lab Productions (www.tinylabproductions.com). -# 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 @@ -20,7 +22,7 @@ description: - "Allows to post events to Datadog (www.datadoghq.com) service." - "Uses http://docs.datadoghq.com/api/#events API." author: -- "Artūras `arturaz` Šlajus (@arturaz)" +- "Artūras 'arturaz' Šlajus (@arturaz)" - "Naoya Nakazawa (@n0ts)" options: api_key: @@ -73,10 +75,10 @@ options: description: ["An arbitrary string to use for aggregation."] validate_certs: description: - - If C(no), SSL certificates will not be validated. This should only be used + - If C(false), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. type: bool - default: 'yes' + default: true ''' EXAMPLES = ''' diff --git a/plugins/modules/monitoring/datadog/datadog_monitor.py b/plugins/modules/monitoring/datadog/datadog_monitor.py index ffc2bcd657..ef6aa84255 100644 --- a/plugins/modules/monitoring/datadog/datadog_monitor.py +++ b/plugins/modules/monitoring/datadog/datadog_monitor.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2015, Sebastian Kornehl -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2015, Sebastian Kornehl +# 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 @@ -90,7 +91,7 @@ options: description: - Whether this monitor will notify when data stops reporting. type: bool - default: 'no' + default: false no_data_timeframe: description: - The number of minutes before a monitor will notify when data stops reporting. @@ -115,7 +116,7 @@ options: description: - Whether tagged users will be notified on changes to this monitor. type: bool - default: 'no' + default: false thresholds: type: dict description: @@ -127,7 +128,7 @@ options: description: - Whether changes to this monitor should be restricted to the creator or admins. type: bool - default: 'no' + default: false require_full_window: description: - Whether this monitor needs a full window of data before it gets evaluated. @@ -152,7 +153,7 @@ options: description: - Whether notifications from this monitor automatically inserts its triggering tags into the title. type: bool - default: yes + default: true version_added: 1.3.0 priority: description: diff --git a/plugins/modules/monitoring/honeybadger_deployment.py b/plugins/modules/monitoring/honeybadger_deployment.py index 2e2198e1a3..be8412f9af 100644 --- a/plugins/modules/monitoring/honeybadger_deployment.py +++ b/plugins/modules/monitoring/honeybadger_deployment.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # Copyright 2014 Benjamin Curtis -# 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 @@ -44,10 +45,10 @@ options: default: "https://api.honeybadger.io/v1/deploys" validate_certs: description: - - If C(no), SSL certificates for the target url will not be validated. This should only be used + - If C(false), SSL certificates for the target url will not be validated. This should only be used on personally controlled sites using self-signed certificates. type: bool - default: 'yes' + default: true ''' diff --git a/plugins/modules/monitoring/icinga2_feature.py b/plugins/modules/monitoring/icinga2_feature.py index b59c0e11e4..2f1d5629d5 100644 --- a/plugins/modules/monitoring/icinga2_feature.py +++ b/plugins/modules/monitoring/icinga2_feature.py @@ -6,7 +6,8 @@ # Sponsored by Infopro Digital. http://www.infopro-digital.com/ # Sponsored by E.T.A.I. http://www.etai.fr/ # -# 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 @@ -25,7 +26,7 @@ options: type: str description: - This is the feature name to enable or disable. - required: True + required: true state: type: str description: diff --git a/plugins/modules/monitoring/icinga2_host.py b/plugins/modules/monitoring/icinga2_host.py index b4c4cdbcfb..0f4e2b26a0 100644 --- a/plugins/modules/monitoring/icinga2_host.py +++ b/plugins/modules/monitoring/icinga2_host.py @@ -3,7 +3,9 @@ # This module is proudly sponsored by CGI (www.cgi.com) and # KPN (www.kpn.com). -# 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 @@ -24,16 +26,16 @@ options: - HTTP, HTTPS, or FTP URL in the form (http|https|ftp)://[user[:pass]]@host.domain[:port]/path use_proxy: description: - - If C(no), it will not use a proxy, even if one is defined in + - If C(false), it will not use a proxy, even if one is defined in an environment variable on the target hosts. type: bool - default: 'yes' + default: true validate_certs: description: - - If C(no), SSL certificates will not be validated. This should only be used + - If C(false), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. type: bool - default: 'yes' + default: true url_username: type: str description: @@ -51,7 +53,7 @@ options: send a 401, logins will fail. This option forces the sending of the Basic authentication header upon initial request. type: bool - default: 'no' + default: false client_cert: type: path description: @@ -134,7 +136,6 @@ data: ''' import json -import os from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.urls import fetch_url, url_argument_spec diff --git a/plugins/modules/monitoring/librato_annotation.py b/plugins/modules/monitoring/librato_annotation.py index 6fcabcf34e..4ca2e7204a 100644 --- a/plugins/modules/monitoring/librato_annotation.py +++ b/plugins/modules/monitoring/librato_annotation.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# (C) Seth Edwards, 2014 -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) Seth Edwards, 2014 +# 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/modules/monitoring/logentries.py b/plugins/modules/monitoring/logentries.py index 075752862d..a605c41316 100644 --- a/plugins/modules/monitoring/logentries.py +++ b/plugins/modules/monitoring/logentries.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2013, Ivan Vanderbyl -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2013, Ivan Vanderbyl +# 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/modules/monitoring/logstash_plugin.py b/plugins/modules/monitoring/logstash_plugin.py index 13b1233c1f..a4979646dd 100644 --- a/plugins/modules/monitoring/logstash_plugin.py +++ b/plugins/modules/monitoring/logstash_plugin.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2017, Loic Blot -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017, Loic Blot +# 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 @@ -19,7 +20,7 @@ options: type: str description: - Install plugin with that name. - required: True + required: true state: type: str description: diff --git a/plugins/modules/monitoring/monit.py b/plugins/modules/monitoring/monit.py index dfbe9cee35..729b05b5d1 100644 --- a/plugins/modules/monitoring/monit.py +++ b/plugins/modules/monitoring/monit.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2013, Darryl Stoflet -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2013, Darryl Stoflet +# 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/modules/monitoring/nagios.py b/plugins/modules/monitoring/nagios.py index 248fd1051d..4fb2a9ff45 100644 --- a/plugins/modules/monitoring/nagios.py +++ b/plugins/modules/monitoring/nagios.py @@ -7,7 +7,8 @@ # func-nagios - Schedule downtime and enables/disable notifications # Copyright 2011, Red Hat, Inc. # Tim Bielawa -# 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 @@ -22,11 +23,11 @@ description: - The C(nagios) module is not idempotent. - All actions require the I(host) parameter to be given explicitly. In playbooks you can use the C({{inventory_hostname}}) variable to refer to the host the playbook is currently running on. - - You can specify multiple services at once by separating them with commas, .e.g., C(services=httpd,nfs,puppet). + - You can specify multiple services at once by separating them with commas, .e.g. I(services=httpd,nfs,puppet). - When specifying what service to handle there is a special service value, I(host), which will handle alerts/downtime/acknowledge for the I(host itself), - e.g., C(service=host). This keyword may not be given with other services at the same time. + e.g., I(service=host). This keyword may not be given with other services at the same time. I(Setting alerts/downtime/acknowledge for a host does not affect alerts/downtime/acknowledge for any of the services running on it.) - To schedule downtime for all services on particular host use keyword "all", e.g., C(service=all). + To schedule downtime for all services on particular host use keyword "all", e.g., I(service=all). options: action: description: @@ -51,17 +52,17 @@ options: author: description: - Author to leave downtime comments as. - Only usable with the C(downtime) and C(acknowledge) action. + Only used when I(action) is C(downtime) or C(acknowledge). type: str default: Ansible comment: description: - - Comment for C(downtime) and C(acknowledge)action. + - Comment when I(action) is C(downtime) or C(acknowledge). type: str default: Scheduling downtime start: description: - - When downtime should start, in time_t format (epoch seconds). + - When downtime should start, in C(time_t) format (epoch seconds). version_added: '0.2.0' type: str minutes: @@ -72,9 +73,10 @@ options: default: 30 services: description: - - What to manage downtime/alerts for. Separate multiple services with commas. - C(service) is an alias for C(services). - B(Required) option when using the C(downtime), C(acknowledge), C(forced_check), C(enable_alerts), and C(disable_alerts) actions. + - > + What to manage downtime/alerts for. Separate multiple services with commas. + I(service) is an alias for I(services). + B(Required) option when I(action) is one of: C(downtime), C(acknowledge), C(forced_check), C(enable_alerts), C(disable_alerts). aliases: [ "service" ] type: str servicegroup: @@ -250,8 +252,6 @@ import stat from ansible.module_utils.basic import AnsibleModule -###################################################################### - def which_cmdfile(): locations = [ # rhel @@ -285,8 +285,6 @@ def which_cmdfile(): return None -###################################################################### - def main(): ACTION_CHOICES = [ @@ -307,95 +305,42 @@ def main(): module = AnsibleModule( argument_spec=dict( - action=dict(required=True, choices=ACTION_CHOICES), - author=dict(default='Ansible'), - comment=dict(default='Scheduling downtime'), - host=dict(required=False, default=None), - servicegroup=dict(required=False, default=None), - start=dict(required=False, default=None), - minutes=dict(default=30, type='int'), - cmdfile=dict(default=which_cmdfile()), - services=dict(default=None, aliases=['service']), - command=dict(required=False, default=None), - ) + action=dict(type='str', required=True, choices=ACTION_CHOICES), + author=dict(type='str', default='Ansible'), + comment=dict(type='str', default='Scheduling downtime'), + host=dict(type='str'), + servicegroup=dict(type='str'), + start=dict(type='str'), + minutes=dict(type='int', default=30), + cmdfile=dict(type='str', default=which_cmdfile()), + services=dict(type='str', aliases=['service']), + command=dict(type='str'), + ), + required_if=[ + ('action', 'downtime', ['host', 'services']), + ('action', 'delete_downtime', ['host', 'services']), + ('action', 'silence', ['host']), + ('action', 'unsilence', ['host']), + ('action', 'enable_alerts', ['host', 'services']), + ('action', 'disable_alerts', ['host', 'services']), + ('action', 'command', ['command']), + ('action', 'servicegroup_host_downtime', ['host', 'servicegroup']), + ('action', 'servicegroup_service_downtime', ['host', 'servicegroup']), + ('action', 'acknowledge', ['host', 'services']), + ('action', 'forced_check', ['host', 'services']), + ], ) - action = module.params['action'] - host = module.params['host'] - servicegroup = module.params['servicegroup'] - start = module.params['start'] - services = module.params['services'] - cmdfile = module.params['cmdfile'] - command = module.params['command'] - - ################################################################## - # Required args per action: - # downtime = (minutes, service, host) - # acknowledge = (service, host) - # (un)silence = (host) - # (enable/disable)_alerts = (service, host) - # command = command - # - # AnsibleModule will verify most stuff, we need to verify - # 'service' manually. - - ################################################################## - if action not in ['command', 'silence_nagios', 'unsilence_nagios']: - if not host: - module.fail_json(msg='no host specified for action requiring one') - ###################################################################### - if action == 'downtime': - # Make sure there's an actual service selected - if not services: - module.fail_json(msg='no service selected to set downtime for') - - ###################################################################### - if action == 'delete_downtime': - # Make sure there's an actual service selected - if not services: - module.fail_json(msg='no service selected to set downtime for') - - ###################################################################### - - if action in ['servicegroup_service_downtime', 'servicegroup_host_downtime']: - # Make sure there's an actual servicegroup selected - if not servicegroup: - module.fail_json(msg='no servicegroup selected to set downtime for') - - ################################################################## - if action in ['enable_alerts', 'disable_alerts']: - if not services: - module.fail_json(msg='a service is required when setting alerts') - - if action in ['command']: - if not command: - module.fail_json(msg='no command passed for command action') - ###################################################################### - if action == 'acknowledge': - # Make sure there's an actual service selected - if not services: - module.fail_json(msg='no service selected to acknowledge') - - ################################################################## - if action == 'forced_check': - # Make sure there's an actual service selected - if not services: - module.fail_json(msg='no service selected to check') - - ################################################################## - if not cmdfile: + if not module.params['cmdfile']: module.fail_json(msg='unable to locate nagios.cfg') - ################################################################## ansible_nagios = Nagios(module, **module.params) if module.check_mode: module.exit_json(changed=True) else: ansible_nagios.act() - ################################################################## -###################################################################### class Nagios(object): """ Perform common tasks in Nagios related to downtime and @@ -452,10 +397,9 @@ class Nagios(object): self.module.fail_json(msg='nagios command file is not a fifo file', cmdfile=self.cmdfile) try: - fp = open(self.cmdfile, 'w') - fp.write(cmd) - fp.flush() - fp.close() + with open(self.cmdfile, 'w') as fp: + fp.write(cmd) + fp.flush() self.command_results.append(cmd.strip()) except IOError: self.module.fail_json(msg='unable to write to nagios command file', diff --git a/plugins/modules/monitoring/newrelic_deployment.py b/plugins/modules/monitoring/newrelic_deployment.py index af953e0a75..2fd4faf8e3 100644 --- a/plugins/modules/monitoring/newrelic_deployment.py +++ b/plugins/modules/monitoring/newrelic_deployment.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # Copyright 2013 Matt Coddington -# 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,10 +64,10 @@ options: required: false validate_certs: description: - - If C(no), SSL certificates will not be validated. This should only be used + - If C(false), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. required: false - default: 'yes' + default: true type: bool requirements: [] diff --git a/plugins/modules/monitoring/pagerduty.py b/plugins/modules/monitoring/pagerduty.py index dba931ab96..7df9cc1d16 100644 --- a/plugins/modules/monitoring/pagerduty.py +++ b/plugins/modules/monitoring/pagerduty.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -72,10 +73,10 @@ options: default: Created by Ansible validate_certs: description: - - If C(no), SSL certificates will not be validated. This should only be used + - If C(false), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. type: bool - default: 'yes' + default: true ''' EXAMPLES = ''' diff --git a/plugins/modules/monitoring/pagerduty_alert.py b/plugins/modules/monitoring/pagerduty_alert.py index 58a1f260fb..e6bd7a3c0c 100644 --- a/plugins/modules/monitoring/pagerduty_alert.py +++ b/plugins/modules/monitoring/pagerduty_alert.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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/modules/monitoring/pagerduty_change.py b/plugins/modules/monitoring/pagerduty_change.py index 358a69612e..104e76e66a 100644 --- a/plugins/modules/monitoring/pagerduty_change.py +++ b/plugins/modules/monitoring/pagerduty_change.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2020, Adam Vaughan (@adamvaughan) avaughan@pagerduty.com -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2020, Adam Vaughan (@adamvaughan) avaughan@pagerduty.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 @@ -72,10 +73,10 @@ options: type: str validate_certs: description: - - If C(no), SSL certificates for the target URL will not be validated. + - If C(false), SSL certificates for the target URL will not be validated. This should only be used on personally controlled sites using self-signed certificates. required: false - default: yes + default: true type: bool notes: - Supports C(check_mode). Note that check mode simply does nothing except returning C(changed=true) in case the I(url) seems to be correct. diff --git a/plugins/modules/monitoring/pagerduty_user.py b/plugins/modules/monitoring/pagerduty_user.py index 4b20a32108..4d8e32248f 100644 --- a/plugins/modules/monitoring/pagerduty_user.py +++ b/plugins/modules/monitoring/pagerduty_user.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2020, Zainab Alsaffar -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2020, Zainab Alsaffar +# 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 @@ -86,6 +87,7 @@ from os import path try: from pdpyras import APISession HAS_PD_PY = True + PD_IMPORT_ERR = None except ImportError: HAS_PD_PY = False PD_IMPORT_ERR = traceback.format_exc() @@ -93,6 +95,7 @@ except ImportError: try: from pdpyras import PDClientError HAS_PD_CLIENT_ERR = True + PD_CLIENT_ERR_IMPORT_ERR = None except ImportError: HAS_PD_CLIENT_ERR = False PD_CLIENT_ERR_IMPORT_ERR = traceback.format_exc() diff --git a/plugins/modules/monitoring/pingdom.py b/plugins/modules/monitoring/pingdom.py index 23ed254543..e9ee40eb96 100644 --- a/plugins/modules/monitoring/pingdom.py +++ b/plugins/modules/monitoring/pingdom.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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/modules/monitoring/rollbar_deployment.py b/plugins/modules/monitoring/rollbar_deployment.py index cea3bfdf51..c899d60163 100644 --- a/plugins/modules/monitoring/rollbar_deployment.py +++ b/plugins/modules/monitoring/rollbar_deployment.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # Copyright 2014, Max Riveiro, -# 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 @@ -55,11 +56,11 @@ options: default: 'https://api.rollbar.com/api/1/deploy/' validate_certs: description: - - If C(no), SSL certificates for the target url will not be validated. + - If C(false), SSL certificates for the target url will not be validated. This should only be used on personally controlled sites using self-signed certificates. required: false - default: 'yes' + default: true type: bool ''' diff --git a/plugins/modules/monitoring/sensu/sensu_check.py b/plugins/modules/monitoring/sensu/sensu_check.py index ec43b60abe..943a653249 100644 --- a/plugins/modules/monitoring/sensu/sensu_check.py +++ b/plugins/modules/monitoring/sensu/sensu_check.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2014, Anders Ingemann -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2014, Anders Ingemann +# 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,7 +43,7 @@ options: - Create a backup file (if yes), including the timestamp information so - you can get the original file back if you somehow clobbered it incorrectly. type: bool - default: 'no' + default: false command: type: str description: @@ -96,7 +97,7 @@ options: description: - Whether the check is a metric type: bool - default: 'no' + default: false standalone: description: - Whether the check should be scheduled by the sensu client or server @@ -152,7 +153,7 @@ EXAMPLES = ''' community.general.sensu_check: name: cpu_load command: /etc/sensu/plugins/system/cpu-mpstat-metrics.rb - metric: yes + metric: true handlers: relay subscribers: common interval: 60 @@ -327,7 +328,7 @@ def main(): arg_spec = {'name': {'type': 'str', 'required': True}, 'path': {'type': 'str', 'default': '/etc/sensu/conf.d/checks.json'}, 'state': {'type': 'str', 'default': 'present', 'choices': ['present', 'absent']}, - 'backup': {'type': 'bool', 'default': 'no'}, + 'backup': {'type': 'bool', 'default': False}, 'command': {'type': 'str'}, 'handlers': {'type': 'list', 'elements': 'str'}, 'subscribers': {'type': 'list', 'elements': 'str'}, @@ -338,7 +339,7 @@ def main(): 'subdue_begin': {'type': 'str'}, 'subdue_end': {'type': 'str'}, 'dependencies': {'type': 'list', 'elements': 'str'}, - 'metric': {'type': 'bool', 'default': 'no'}, + 'metric': {'type': 'bool', 'default': False}, 'standalone': {'type': 'bool'}, 'publish': {'type': 'bool'}, 'occurrences': {'type': 'int'}, diff --git a/plugins/modules/monitoring/sensu/sensu_client.py b/plugins/modules/monitoring/sensu/sensu_client.py index 886c398e09..ffd1fe9fbd 100644 --- a/plugins/modules/monitoring/sensu/sensu_client.py +++ b/plugins/modules/monitoring/sensu/sensu_client.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2017, Red Hat Inc. -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017, Red Hat 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 @@ -43,7 +44,7 @@ options: description: - If safe mode is enabled for the client. Safe mode requires local check definitions in order to accept a check request and execute the check. type: bool - default: 'no' + default: false redact: type: list elements: str @@ -57,7 +58,7 @@ options: description: - If Sensu should monitor keepalives for this client. type: bool - default: 'yes' + default: true keepalive: type: dict description: diff --git a/plugins/modules/monitoring/sensu/sensu_handler.py b/plugins/modules/monitoring/sensu/sensu_handler.py index 6511479899..15e63e57d3 100644 --- a/plugins/modules/monitoring/sensu/sensu_handler.py +++ b/plugins/modules/monitoring/sensu/sensu_handler.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2017, Red Hat Inc. -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017, Red Hat 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 @@ -26,7 +27,7 @@ options: type: str description: - A unique name for the handler. The name cannot contain special characters or spaces. - required: True + required: true type: type: str description: @@ -63,12 +64,12 @@ options: description: - If events matching one or more silence entries should be handled. type: bool - default: 'no' + default: false handle_flapping: description: - If events in the flapping state should be handled. type: bool - default: 'no' + default: false command: type: str description: diff --git a/plugins/modules/monitoring/sensu/sensu_silence.py b/plugins/modules/monitoring/sensu/sensu_silence.py index 80a5216711..c5ed10e36d 100644 --- a/plugins/modules/monitoring/sensu/sensu_silence.py +++ b/plugins/modules/monitoring/sensu/sensu_silence.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2017, Steven Bambling -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017, Steven Bambling +# 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/modules/monitoring/sensu/sensu_subscription.py b/plugins/modules/monitoring/sensu/sensu_subscription.py index 947c6e0de5..a84d805221 100644 --- a/plugins/modules/monitoring/sensu/sensu_subscription.py +++ b/plugins/modules/monitoring/sensu/sensu_subscription.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2014, Anders Ingemann -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2014, Anders Ingemann +# 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 @@ -39,7 +40,7 @@ options: - can get the original file back if you somehow clobbered it incorrectly. type: bool required: false - default: no + default: false requirements: [ ] author: Anders Ingemann (@andsens) ''' @@ -132,7 +133,7 @@ def main(): arg_spec = {'name': {'type': 'str', 'required': True}, 'path': {'type': 'str', 'default': '/etc/sensu/conf.d/subscriptions.json'}, 'state': {'type': 'str', 'default': 'present', 'choices': ['present', 'absent']}, - 'backup': {'type': 'bool', 'default': 'no'}, + 'backup': {'type': 'bool', 'default': False}, } module = AnsibleModule(argument_spec=arg_spec, diff --git a/plugins/modules/monitoring/spectrum_device.py b/plugins/modules/monitoring/spectrum_device.py index 77e3b15390..c2bab55016 100644 --- a/plugins/modules/monitoring/spectrum_device.py +++ b/plugins/modules/monitoring/spectrum_device.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2016, Renato Orgito -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, Renato Orgito +# 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 @@ -28,7 +29,7 @@ options: type: str description: - SNMP community used for device discovery. - - Required when C(state=present). + - Required when I(state=present). required: true landscape: type: str @@ -37,7 +38,6 @@ options: - Landscape handle of the SpectroServer to which add or remove the device. state: type: str - required: false description: - On C(present) creates the device when it does not exist. - On C(absent) removes the device when it exists. @@ -48,7 +48,7 @@ options: aliases: [ oneclick_url ] required: true description: - - HTTP, HTTPS URL of the Oneclick server in the form (http|https)://host.domain[:port] + - HTTP, HTTPS URL of the Oneclick server in the form C((http|https)://host.domain[:port]). url_username: type: str aliases: [ oneclick_user ] @@ -62,18 +62,15 @@ options: description: - Oneclick user password. use_proxy: - required: false description: - - if C(no), it will not use a proxy, even if one is defined in an environment - variable on the target hosts. - default: 'yes' + - if C(false), it will not use a proxy, even if one is defined in an environment variable on the target hosts. + default: true type: bool validate_certs: - required: false description: - - If C(no), SSL certificates will not be validated. This should only be used - on personally controlled sites using self-signed certificates. - default: 'yes' + - If C(false), SSL certificates will not be validated. This should only be used + on personally controlled sites using self-signed certificates. + default: true type: bool agentport: type: int @@ -107,7 +104,7 @@ EXAMPLES = ''' oneclick_url: http://oneclick.example.com:8080 oneclick_user: username oneclick_password: password - use_proxy: no + use_proxy: false state: absent ''' diff --git a/plugins/modules/monitoring/spectrum_model_attrs.py b/plugins/modules/monitoring/spectrum_model_attrs.py index 231352acd6..5a92802f5f 100644 --- a/plugins/modules/monitoring/spectrum_model_attrs.py +++ b/plugins/modules/monitoring/spectrum_model_attrs.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# (c) 2021, Tyler Gates +# Copyright (c) 2021, Tyler Gates # -# 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 @@ -42,9 +43,9 @@ options: aliases: [password] use_proxy: description: - - if C(no), it will not use a proxy, even if one is defined in + - if C(false), it will not use a proxy, even if one is defined in an environment variable on the target hosts. - default: yes + default: true required: false type: bool name: @@ -62,7 +63,7 @@ options: - Validate SSL certificates. Only change this to C(false) if you can guarantee that you are talking to the correct endpoint and there is no man-in-the-middle attack happening. type: bool - default: yes + default: true required: false attributes: description: diff --git a/plugins/modules/monitoring/stackdriver.py b/plugins/modules/monitoring/stackdriver.py index fa6bacb951..6fe2a7caa9 100644 --- a/plugins/modules/monitoring/stackdriver.py +++ b/plugins/modules/monitoring/stackdriver.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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/modules/monitoring/statsd.py b/plugins/modules/monitoring/statsd.py index b07851641b..26c8e7c283 100644 --- a/plugins/modules/monitoring/statsd.py +++ b/plugins/modules/monitoring/statsd.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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/modules/monitoring/statusio_maintenance.py b/plugins/modules/monitoring/statusio_maintenance.py index 10f733d4a8..b884a943aa 100644 --- a/plugins/modules/monitoring/statusio_maintenance.py +++ b/plugins/modules/monitoring/statusio_maintenance.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2015, Benjamin Copeland (@bhcopeland) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2015, Benjamin Copeland (@bhcopeland) +# 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 @@ -73,32 +74,32 @@ options: description: - If it affects all components and containers type: bool - default: 'no' + default: false automation: description: - Automatically start and end the maintenance window type: bool - default: 'no' + default: false maintenance_notify_now: description: - Notify subscribers now type: bool - default: 'no' + default: false maintenance_notify_72_hr: description: - Notify subscribers 72 hours before maintenance start time type: bool - default: 'no' + default: false maintenance_notify_24_hr: description: - Notify subscribers 24 hours before maintenance start time type: bool - default: 'no' + default: false maintenance_notify_1_hr: description: - Notify subscribers 1 hour before maintenance start time type: bool - default: 'no' + default: false maintenance_id: type: str description: @@ -130,8 +131,8 @@ EXAMPLES = ''' api_id: api_id api_key: api_key statuspage: statuspage_id - maintenance_notify_1_hr: True - automation: True + maintenance_notify_1_hr: true + automation: true - name: Create a maintenance window for 60 minutes on server1 and server2 community.general.statusio_maintenance: @@ -144,8 +145,8 @@ EXAMPLES = ''' api_id: api_id api_key: api_key statuspage: statuspage_id - maintenance_notify_1_hr: True - automation: True + maintenance_notify_1_hr: true + automation: true delegate_to: localhost - name: Create a future maintenance window for 24 hours to all hosts inside the Primary Data Center diff --git a/plugins/modules/monitoring/uptimerobot.py b/plugins/modules/monitoring/uptimerobot.py index 833a7f191e..527e59ac1f 100644 --- a/plugins/modules/monitoring/uptimerobot.py +++ b/plugins/modules/monitoring/uptimerobot.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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/modules/net_tools/cloudflare_dns.py b/plugins/modules/net_tools/cloudflare_dns.py index 4e82e0af36..92132c0f6f 100644 --- a/plugins/modules/net_tools/cloudflare_dns.py +++ b/plugins/modules/net_tools/cloudflare_dns.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2016 Michael Gruener -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016 Michael Gruener +# 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 @@ -43,39 +44,39 @@ options: algorithm: description: - Algorithm number. - - Required for C(type=DS) and C(type=SSHFP) when C(state=present). + - Required for I(type=DS) and I(type=SSHFP) when I(state=present). type: int cert_usage: description: - Certificate usage number. - - Required for C(type=TLSA) when C(state=present). + - Required for I(type=TLSA) when I(state=present). type: int choices: [ 0, 1, 2, 3 ] hash_type: description: - Hash type number. - - Required for C(type=DS), C(type=SSHFP) and C(type=TLSA) when C(state=present). + - Required for I(type=DS), I(type=SSHFP) and I(type=TLSA) when I(state=present). type: int choices: [ 1, 2 ] key_tag: description: - DNSSEC key tag. - - Needed for C(type=DS) when C(state=present). + - Needed for I(type=DS) when I(state=present). type: int port: description: - Service port. - - Required for C(type=SRV) and C(type=TLSA). + - Required for I(type=SRV) and I(type=TLSA). type: int priority: description: - Record priority. - - Required for C(type=MX) and C(type=SRV) + - Required for I(type=MX) and I(type=SRV) default: 1 type: int proto: description: - - Service protocol. Required for C(type=SRV) and C(type=TLSA). + - Service protocol. Required for I(type=SRV) and I(type=TLSA). - Common values are TCP and UDP. - Before Ansible 2.6 only TCP and UDP were available. type: str @@ -83,11 +84,11 @@ options: description: - Proxy through Cloudflare network or just use DNS. type: bool - default: no + default: false record: description: - Record to add. - - Required if C(state=present). + - Required if I(state=present). - Default is C(@) (e.g. the zone name). type: str default: '@' @@ -95,7 +96,7 @@ options: selector: description: - Selector number. - - Required for C(type=TLSA) when C(state=present). + - Required for I(type=TLSA) when I(state=present). choices: [ 0, 1 ] type: int service: @@ -106,7 +107,7 @@ options: solo: description: - Whether the record should be the only one for that record type and record name. - - Only use with C(state=present). + - Only use with I(state=present). - This will delete all other records with the same record name and type. type: bool state: @@ -128,20 +129,20 @@ options: default: 1 type: description: - - The type of DNS record to create. Required if C(state=present). - - C(type=DS), C(type=SSHFP) and C(type=TLSA) added in Ansible 2.7. + - The type of DNS record to create. Required if I(state=present). + - I(type=DS), I(type=SSHFP) and I(type=TLSA) added in Ansible 2.7. type: str choices: [ A, AAAA, CNAME, DS, MX, NS, SPF, SRV, SSHFP, TLSA, TXT ] value: description: - The record value. - - Required for C(state=present). + - Required for I(state=present). type: str aliases: [ content ] weight: description: - Service weight. - - Required for C(type=SRV). + - Required for I(type=SRV). type: int default: 1 zone: @@ -205,7 +206,7 @@ EXAMPLES = r''' zone: example.net type: CNAME value: example.com - proxied: yes + proxied: true account_email: test@example.com account_api_key: dummyapitoken state: present @@ -303,7 +304,7 @@ record: description: No documentation available. returned: success type: bool - sample: False + sample: false meta: description: No documentation available. returned: success @@ -328,12 +329,12 @@ record: description: Whether this record can be proxied through Cloudflare. returned: success type: bool - sample: False + sample: false proxied: description: Whether the record is proxied through Cloudflare. returned: success type: bool - sample: False + sample: false ttl: description: The time-to-live for the record. returned: success diff --git a/plugins/modules/net_tools/dnsimple.py b/plugins/modules/net_tools/dnsimple.py index a4d531c76d..e96c22613f 100644 --- a/plugins/modules/net_tools/dnsimple.py +++ b/plugins/modules/net_tools/dnsimple.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: Ansible Project +# Copyright 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 @@ -71,14 +72,14 @@ options: - Whether the record should be the only one for that record type and record name. - Only use with C(state) is set to C(present) on a record. type: 'bool' - default: no + default: false sandbox: description: - Use the DNSimple sandbox environment. - Requires a dedicated account in the dnsimple sandbox environment. - Check U(https://developer.dnsimple.com/sandbox/) for more information. type: 'bool' - default: no + default: false version_added: 3.5.0 requirements: - "dnsimple >= 2.0.0" diff --git a/plugins/modules/net_tools/dnsimple_info.py b/plugins/modules/net_tools/dnsimple_info.py index 4ac22be0cb..f4a68f509d 100644 --- a/plugins/modules/net_tools/dnsimple_info.py +++ b/plugins/modules/net_tools/dnsimple_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Edward Hilgendorf, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright Edward Hilgendorf, +# 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 @@ -228,15 +229,15 @@ dnsimple_record_info: import traceback from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import missing_required_lib -import json try: from requests import Request, Session except ImportError: - HAS_ANOTHER_LIBRARY = False - ANOTHER_LIBRARY_IMPORT_ERROR = traceback.format_exc() + HAS_REQUESTS = False + REQUESTS_IMPORT_ERROR = traceback.format_exc() else: - HAS_ANOTHER_LIBRARY = True + HAS_REQUESTS = True + REQUESTS_IMPORT_ERROR = None def build_url(account, key, is_sandbox): @@ -261,7 +262,7 @@ def iterate_data(module, request_object): request_object.url = base_url + '&page=' + str(page) new_results = Session().send(request_object) data = data + new_results.json()["data"] - return(data) + return data else: module.fail_json('API Call failed, check ID, key and sandbox values') @@ -305,11 +306,10 @@ def main(): params['api_key'], params['sandbox']) - if not HAS_ANOTHER_LIBRARY: - # Needs: from ansible.module_utils.basic import missing_required_lib + if not HAS_REQUESTS: module.exit_json( - msg=missing_required_lib('another_library'), - exception=ANOTHER_LIBRARY_IMPORT_ERROR) + msg=missing_required_lib('requests'), + exception=REQUESTS_IMPORT_ERROR) # At minimum we need account and key if params['account_id'] and params['api_key']: diff --git a/plugins/modules/net_tools/dnsmadeeasy.py b/plugins/modules/net_tools/dnsmadeeasy.py index 1d708cdce0..ec9e9951cd 100644 --- a/plugins/modules/net_tools/dnsmadeeasy.py +++ b/plugins/modules/net_tools/dnsmadeeasy.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -40,7 +41,7 @@ options: description: - Decides if the sandbox API should be used. Otherwise (default) the production API of DNS Made Easy is used. type: bool - default: 'no' + default: false record_name: description: @@ -79,16 +80,16 @@ options: validate_certs: description: - - If C(no), SSL certificates will not be validated. This should only be used + - If C(false), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. type: bool - default: 'yes' + default: true monitor: description: - - If C(yes), add or change the monitor. This is applicable only for A records. + - If C(true), add or change the monitor. This is applicable only for A records. type: bool - default: 'no' + default: false systemDescription: description: @@ -146,16 +147,16 @@ options: failover: description: - - If C(yes), add or change the failover. This is applicable only for A records. + - If C(true), add or change the failover. This is applicable only for A records. type: bool - default: 'no' + default: false autoFailover: description: - If true, fallback to the primary IP address is manual after a failover. - If false, fallback to the primary IP address is automatic after a failover. type: bool - default: 'no' + default: false ip1: description: @@ -253,7 +254,7 @@ EXAMPLES = ''' record_name: test record_type: A record_value: 127.0.0.1 - failover: True + failover: true ip1: 127.0.0.2 ip2: 127.0.0.3 @@ -266,7 +267,7 @@ EXAMPLES = ''' record_name: test record_type: A record_value: 127.0.0.1 - failover: True + failover: true ip1: 127.0.0.2 ip2: 127.0.0.3 ip3: 127.0.0.4 @@ -282,7 +283,7 @@ EXAMPLES = ''' record_name: test record_type: A record_value: 127.0.0.1 - monitor: yes + monitor: true ip1: 127.0.0.2 protocol: HTTP # default port: 80 # default @@ -299,7 +300,7 @@ EXAMPLES = ''' record_name: test record_type: A record_value: 127.0.0.1 - monitor: yes + monitor: true ip1: 127.0.0.2 protocol: HTTP # default port: 80 # default @@ -319,10 +320,10 @@ EXAMPLES = ''' record_name: test record_type: A record_value: 127.0.0.1 - failover: True + failover: true ip1: 127.0.0.2 ip2: 127.0.0.3 - monitor: yes + monitor: true protocol: HTTPS port: 443 maxEmails: 1 @@ -338,7 +339,7 @@ EXAMPLES = ''' record_name: test record_type: A record_value: 127.0.0.1 - failover: no + failover: false - name: Remove a monitor community.general.dnsmadeeasy: @@ -349,7 +350,7 @@ EXAMPLES = ''' record_name: test record_type: A record_value: 127.0.0.1 - monitor: no + monitor: false ''' # ============================================ diff --git a/plugins/modules/net_tools/gandi_livedns.py b/plugins/modules/net_tools/gandi_livedns.py index 6124288511..9566661f41 100644 --- a/plugins/modules/net_tools/gandi_livedns.py +++ b/plugins/modules/net_tools/gandi_livedns.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2019 Gregory Thiemonge -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019 Gregory Thiemonge +# 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/modules/net_tools/haproxy.py b/plugins/modules/net_tools/haproxy.py index f736036671..38033bc81a 100644 --- a/plugins/modules/net_tools/haproxy.py +++ b/plugins/modules/net_tools/haproxy.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2014, Ravi Bhure -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2014, Ravi Bhure +# 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 @@ -20,7 +21,7 @@ notes: sockets configured for level 'admin'. For example, you can add the line 'stats socket /var/run/haproxy.sock level admin' to the general section of haproxy.cfg. See U(http://haproxy.1wt.eu/download/1.5/doc/configuration.txt). - - Depends on netcat (nc) being available; you need to install the appropriate + - Depends on netcat (C(nc)) being available; you need to install the appropriate package for your operating system before this module can be used. options: backend: @@ -32,7 +33,7 @@ options: description: - Wait until the server has no active connections or until the timeout determined by wait_interval and wait_retries is reached. - - Continue only after the status changes to 'MAINT'. + - Continue only after the status changes to C(MAINT). - This overrides the shutdown_sessions option. type: bool default: false @@ -48,7 +49,7 @@ options: - This can be used to terminate long-running sessions after a server is put into maintenance mode. Overridden by the drain option. type: bool - default: no + default: false socket: description: - Path to the HAProxy socket file. @@ -67,25 +68,25 @@ options: description: - Disable/enable agent checks (depending on I(state) value). type: bool - default: no + default: false version_added: 1.0.0 health: description: - Disable/enable health checks (depending on I(state) value). type: bool - default: no + default: false version_added: "1.0.0" fail_on_not_found: description: - - Fail whenever trying to enable/disable a backend host that does not exist + - Fail whenever trying to enable/disable a backend host that does not exist. type: bool - default: no + default: false wait: description: - - Wait until the server reports a status of 'UP' when C(state=enabled), - status of 'MAINT' when C(state=disabled) or status of 'DRAIN' when C(state=drain) + - Wait until the server reports a status of C(UP) when I(state=enabled), + status of C(MAINT) when I(state=disabled) or status of C(DRAIN) when I(state=drain). type: bool - default: no + default: false wait_interval: description: - Number of seconds to wait between retries. @@ -99,7 +100,7 @@ options: weight: description: - The value passed in argument. - - If the value ends with the `%` sign, then the new weight will be + - If the value ends with the C(%) sign, then the new weight will be relative to the initially configured weight. - Relative weights are only permitted between 0 and 100% and absolute weights are permitted between 0 and 256. @@ -117,8 +118,8 @@ EXAMPLES = r''' community.general.haproxy: state: disabled host: '{{ inventory_hostname }}' - health: yes - agent: yes + health: true + agent: true - name: Disable server without backend pool name (apply to all available backend pool) community.general.haproxy: @@ -138,7 +139,7 @@ EXAMPLES = r''' host: '{{ inventory_hostname }}' socket: /var/run/haproxy.sock backend: www - wait: yes + wait: true # Place server in drain mode, providing a socket file. Then check the server's # status every minute to see if it changes to maintenance mode, continuing if it @@ -148,8 +149,8 @@ EXAMPLES = r''' host: '{{ inventory_hostname }}' socket: /var/run/haproxy.sock backend: www - wait: yes - drain: yes + wait: true + drain: true wait_interval: 60 wait_retries: 60 @@ -159,13 +160,13 @@ EXAMPLES = r''' host: '{{ inventory_hostname }}' backend: www socket: /var/run/haproxy.sock - shutdown_sessions: yes + shutdown_sessions: true - name: Disable server without backend pool name (apply to all available backend pool) but fail when the backend host is not found community.general.haproxy: state: disabled host: '{{ inventory_hostname }}' - fail_on_not_found: yes + fail_on_not_found: true - name: Enable server in 'www' backend pool community.general.haproxy: @@ -178,14 +179,14 @@ EXAMPLES = r''' state: enabled host: '{{ inventory_hostname }}' backend: www - wait: yes + wait: true - name: Enable server in 'www' backend pool wait until healthy. Retry 10 times with intervals of 5 seconds to retrieve the health community.general.haproxy: state: enabled host: '{{ inventory_hostname }}' backend: www - wait: yes + wait: true wait_retries: 10 wait_interval: 5 diff --git a/plugins/modules/net_tools/infinity/infinity.py b/plugins/modules/net_tools/infinity/infinity.py index bd12f85af2..53fa7efd48 100644 --- a/plugins/modules/net_tools/infinity/infinity.py +++ b/plugins/modules/net_tools/infinity/infinity.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2017, -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017, +# 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 @@ -116,10 +117,17 @@ network_info: description: when reserving a LAN network from a Infinity supernet by providing network_size, the information about the reserved network is returned. returned: success type: str - sample: {"network_address": "192.168.10.32/28","network_family": "4", "network_id": 3102, - "network_size": null,"description": null,"network_location": "3085", - "ranges": { "id": 0, "name": null,"first_ip": null,"type": null,"last_ip": null}, - "network_type": "lan","network_name": "'reserve_new_ansible_network'"} + sample: { + "network_address": "192.168.10.32/28", + "network_family": "4", + "network_id": 3102, + "network_size": null, + "description": null, + "network_location": "3085", + "ranges": { "id": 0, "name": null,"first_ip": null,"type": null,"last_ip": null}, + "network_type": "lan", + "network_name": "'reserve_new_ansible_network'" + } ''' diff --git a/plugins/modules/net_tools/ip_netns.py b/plugins/modules/net_tools/ip_netns.py index 00f1112bc0..e719874f7d 100644 --- a/plugins/modules/net_tools/ip_netns.py +++ b/plugins/modules/net_tools/ip_netns.py @@ -1,21 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2017, Arie Bregman -# -# This file is a module for Ansible that interacts with Network Manager -# -# 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) 2017, Arie Bregman +# 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/modules/net_tools/ipify_facts.py b/plugins/modules/net_tools/ipify_facts.py index 2ae0348cb1..8953c02940 100644 --- a/plugins/modules/net_tools/ipify_facts.py +++ b/plugins/modules/net_tools/ipify_facts.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: (c) 2015, René Moser -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2015, René Moser +# 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 @@ -32,7 +33,7 @@ options: description: - When set to C(NO), SSL certificates will not be validated. type: bool - default: yes + default: true notes: - Visit https://www.ipify.org to get more information. ''' diff --git a/plugins/modules/net_tools/ipinfoio_facts.py b/plugins/modules/net_tools/ipinfoio_facts.py index ee1d49f3ac..a10b54ecce 100644 --- a/plugins/modules/net_tools/ipinfoio_facts.py +++ b/plugins/modules/net_tools/ipinfoio_facts.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2016, Aleksei Kostiuk -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, Aleksei Kostiuk +# 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/modules/net_tools/ipwcli_dns.py b/plugins/modules/net_tools/ipwcli_dns.py index 8a6122edff..9436decc8c 100644 --- a/plugins/modules/net_tools/ipwcli_dns.py +++ b/plugins/modules/net_tools/ipwcli_dns.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2020, Christian Wollinger -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2020, Christian Wollinger +# 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 @@ -44,7 +45,7 @@ options: address: description: - The IP address for the A or AAAA record. - - Required for C(type=A) or C(type=AAAA) + - Required for I(type=A) or I(type=AAAA). type: str ttl: description: @@ -70,38 +71,38 @@ options: port: description: - Sets the port of the SRV record. - - Required for C(type=SRV) + - Required for I(type=SRV). type: int target: description: - Sets the target of the SRV record. - - Required for C(type=SRV) + - Required for I(type=SRV). type: str order: description: - Sets the order of the NAPTR record. - - Required for C(type=NAPTR) + - Required for I(type=NAPTR). type: int preference: description: - Sets the preference of the NAPTR record. - - Required for C(type=NAPTR) + - Required for I(type=NAPTR). type: int flags: description: - Sets one of the possible flags of NAPTR record. - - Required for C(type=NAPTR) + - Required for I(type=NAPTR). type: str choices: ['S', 'A', 'U', 'P'] service: description: - Sets the service of the NAPTR record. - - Required for C(type=NAPTR) + - Required for I(type=NAPTR). type: str replacement: description: - Sets the replacement of the NAPTR record. - - Required for C(type=NAPTR) + - Required for I(type=NAPTR). type: str username: description: @@ -157,7 +158,6 @@ record: ''' from ansible.module_utils.basic import AnsibleModule -import os class ResourceRecord(object): diff --git a/plugins/modules/net_tools/ldap/ldap_attrs.py b/plugins/modules/net_tools/ldap/ldap_attrs.py index c357a83087..df61233ab1 100644 --- a/plugins/modules/net_tools/ldap/ldap_attrs.py +++ b/plugins/modules/net_tools/ldap/ldap_attrs.py @@ -1,11 +1,12 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2019, Maciej Delmanowski -# Copyright: (c) 2017, Alexander Korinek -# Copyright: (c) 2016, Peter Sagerson -# Copyright: (c) 2016, Jiri Tyr -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, Maciej Delmanowski +# Copyright (c) 2017, Alexander Korinek +# Copyright (c) 2016, Peter Sagerson +# Copyright (c) 2016, Jiri Tyr +# 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 @@ -61,9 +62,9 @@ options: ordered: required: false type: bool - default: 'no' + default: false description: - - If C(yes), prepend list values with X-ORDERED index numbers in all + - If C(true), prepend list values with X-ORDERED index numbers in all attributes specified in the current task. This is useful mostly with I(olcAccess) attribute to easily manage LDAP Access Control Lists. extends_documentation_fragment: @@ -114,7 +115,7 @@ EXAMPLES = r''' to dn.base="dc=example,dc=com" by dn="cn=admin,dc=example,dc=com" write by * read - ordered: yes + ordered: true state: exact - name: Declare some indexes @@ -160,7 +161,8 @@ modlist: description: list of modified parameters returned: success type: list - sample: '[[2, "olcRootDN", ["cn=root,dc=example,dc=com"]]]' + sample: + - [2, "olcRootDN", ["cn=root,dc=example,dc=com"]] ''' import traceback diff --git a/plugins/modules/net_tools/ldap/ldap_entry.py b/plugins/modules/net_tools/ldap/ldap_entry.py index 24e121e521..affdafeb6c 100644 --- a/plugins/modules/net_tools/ldap/ldap_entry.py +++ b/plugins/modules/net_tools/ldap/ldap_entry.py @@ -1,10 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2016, Peter Sagerson -# Copyright: (c) 2016, Jiri Tyr +# Copyright (c) 2016, Peter Sagerson +# Copyright (c) 2016, Jiri Tyr # -# 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/modules/net_tools/ldap/ldap_passwd.py b/plugins/modules/net_tools/ldap/ldap_passwd.py index 8d86ee93fc..5ffd5e12ca 100644 --- a/plugins/modules/net_tools/ldap/ldap_passwd.py +++ b/plugins/modules/net_tools/ldap/ldap_passwd.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2017-2018, Keller Fuchs -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017-2018, Keller Fuchs +# 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 @@ -58,7 +59,8 @@ modlist: description: list of modified parameters returned: success type: list - sample: '[[2, "olcRootDN", ["cn=root,dc=example,dc=com"]]]' + sample: + - [2, "olcRootDN", ["cn=root,dc=example,dc=com"]] """ import traceback diff --git a/plugins/modules/net_tools/ldap/ldap_search.py b/plugins/modules/net_tools/ldap/ldap_search.py index d3378646ac..02ba4d3529 100644 --- a/plugins/modules/net_tools/ldap/ldap_search.py +++ b/plugins/modules/net_tools/ldap/ldap_search.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2016, Peter Sagerson -# Copyright: (c) 2020, Sebastian Pfahl -# 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) 2020, Sebastian Pfahl +# 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/modules/net_tools/lldp.py b/plugins/modules/net_tools/lldp.py index 1b8fa9eb06..9a74f37f37 100644 --- a/plugins/modules/net_tools/lldp.py +++ b/plugins/modules/net_tools/lldp.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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/modules/net_tools/netcup_dns.py b/plugins/modules/net_tools/netcup_dns.py index 5ec5cbb246..e6bf3de0c3 100644 --- a/plugins/modules/net_tools/netcup_dns.py +++ b/plugins/modules/net_tools/netcup_dns.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2018 Nicolai Buchwitz -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2018 Nicolai Buchwitz +# 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 @@ -14,60 +15,60 @@ module: netcup_dns notes: [] short_description: manage Netcup DNS records description: - - "Manages DNS records via the Netcup API, see the docs U(https://ccp.netcup.net/run/webservice/servers/endpoint.php)" + - "Manages DNS records via the Netcup API, see the docs U(https://ccp.netcup.net/run/webservice/servers/endpoint.php)." options: api_key: description: - - API key for authentication, must be obtained via the netcup CCP (U(https://ccp.netcup.net)) - required: True + - "API key for authentication, must be obtained via the netcup CCP (U(https://ccp.netcup.net))." + required: true type: str api_password: description: - - API password for authentication, must be obtained via the netcup CCP (https://ccp.netcup.net) - required: True + - "API password for authentication, must be obtained via the netcup CCP (U(https://ccp.netcup.net))." + required: true type: str customer_id: description: - - Netcup customer id - required: True + - Netcup customer id. + required: true type: int domain: description: - - Domainname the records should be added / removed - required: True + - Domainname the records should be added / removed. + required: true type: str record: description: - - Record to add or delete, supports wildcard (*). Default is C(@) (e.g. the zone name) + - Record to add or delete, supports wildcard (*). Default is C(@) (e.g. the zone name). default: "@" aliases: [ name ] type: str type: description: - - Record type + - Record type. choices: ['A', 'AAAA', 'MX', 'CNAME', 'CAA', 'SRV', 'TXT', 'TLSA', 'NS', 'DS'] - required: True + required: true type: str value: description: - - Record value + - Record value. required: true type: str solo: type: bool - default: False + default: false description: - - Whether the record should be the only one for that record type and record name. Only use with C(state=present) + - Whether the record should be the only one for that record type and record name. Only use with I(state=present). - This will delete all other records with the same record name and type. priority: description: - - Record priority. Required for C(type=MX) - required: False + - Record priority. Required for I(type=MX). + required: false type: int state: description: - - Whether the record should exist or not - required: False + - Whether the record should exist or not. + required: false default: present choices: [ 'present', 'absent' ] type: str diff --git a/plugins/modules/net_tools/nmcli.py b/plugins/modules/net_tools/nmcli.py index 3c59b7efea..f5a45b2f5b 100644 --- a/plugins/modules/net_tools/nmcli.py +++ b/plugins/modules/net_tools/nmcli.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2015, Chris Long -# 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) 2015, Chris Long +# 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 @@ -34,7 +35,7 @@ options: - Whether the connection should start on boot. - Whether the connection profile can be automatically activated type: bool - default: yes + default: true conn_name: description: - The name used to call the connection. Pattern is [-][-]. @@ -45,8 +46,8 @@ options: - The interface to bind the connection to. - The connection will only be applicable to this interface name. - A special value of C('*') can be used for interface-independent connections. - - The ifname argument is mandatory for all connection types except bond, team, bridge and vlan. - - This parameter defaults to C(conn_name) when left unset. + - The ifname argument is mandatory for all connection types except bond, team, bridge, vlan and vpn. + - This parameter defaults to C(conn_name) when left unset for all connection types except vpn that removes it. type: str type: description: @@ -55,10 +56,11 @@ options: - Type C(generic) is added in Ansible 2.5. - Type C(infiniband) is added in community.general 2.0.0. - Type C(gsm) is added in community.general 3.7.0. - - Type C(wireguard) is added in community.general 4.3.0 + - Type C(wireguard) is added in community.general 4.3.0. + - Type C(vpn) is added in community.general 5.1.0. type: str choices: [ bond, bond-slave, bridge, bridge-slave, dummy, ethernet, generic, gre, infiniband, ipip, sit, team, team-slave, vlan, vxlan, wifi, gsm, - wireguard ] + wireguard, vpn ] mode: description: - This is the type of device or network connection that you wish to create for a bond or bridge. @@ -153,12 +155,12 @@ options: - Set as default route. - This parameter is mutually_exclusive with gw4 parameter. type: bool - default: no + default: false version_added: 2.0.0 dns4: description: - - A list of up to 3 dns servers. - - IPv4 format e.g. to add two IPv4 DNS server addresses, use C(192.0.2.53 198.51.100.53). + - A list of up to 3 DNS servers. + - The entries must be IPv4 addresses, for example C(192.0.2.53). elements: str type: list dns4_search: @@ -255,8 +257,8 @@ options: version_added: 4.4.0 dns6: description: - - A list of up to 3 dns servers. - - IPv6 format e.g. to add two IPv6 DNS server addresses, use C(2001:4860:4860::8888 2001:4860:4860::8844). + - A list of up to 3 DNS servers. + - The entries must be IPv6 addresses, for example C(2001:4860:4860::8888). elements: str type: list dns6_search: @@ -317,6 +319,11 @@ options: description: - This is only used with bond - updelay. type: int + xmit_hash_policy: + description: + - This is only used with bond - xmit_hash_policy type. + type: str + version_added: 5.6.0 arp_interval: description: - This is only used with bond - ARP interval. @@ -329,7 +336,7 @@ options: description: - This is only used with bridge and controls whether Spanning Tree Protocol (STP) is enabled for this bridge. type: bool - default: yes + default: true priority: description: - This is only used with 'bridge' - sets STP priority. @@ -905,6 +912,57 @@ options: description: C(NMSettingSecretFlags) indicating how to handle the I(wireguard.private-key) property. type: int choices: [ 0, 1, 2 ] + vpn: + description: + - Configuration of a VPN connection (PPTP and L2TP). + - In order to use L2TP you need to be sure that C(network-manager-l2tp) - and C(network-manager-l2tp-gnome) + if host has UI - are installed on the host. + type: dict + version_added: 5.1.0 + suboptions: + permissions: + description: User that will have permission to use the connection. + type: str + required: true + service-type: + description: This defines the service type of connection. + type: str + required: true + gateway: + description: The gateway to connection. It can be an IP address (for example C(192.0.2.1)) + or a FQDN address (for example C(vpn.example.com)). + type: str + required: true + password-flags: + description: + - NMSettingSecretFlags indicating how to handle the I(password) property. + - 'Following choices are allowed: + C(0) B(NONE): The system is responsible for providing and storing this secret (default); + C(1) B(AGENT_OWNED): A user secret agent is responsible for providing and storing this secret; when it is required agents will be + asked to retrieve it; + C(2) B(NOT_SAVED): This secret should not be saved, but should be requested from the user each time it is needed; + C(4) B(NOT_REQUIRED): In situations where it cannot be automatically determined that the secret is required + (some VPNs and PPP providers do not require all secrets) this flag indicates that the specific secret is not required.' + type: int + choices: [ 0, 1, 2 , 4 ] + default: 0 + user: + description: Username provided by VPN administrator. + type: str + required: true + ipsec-enabled: + description: + - Enable or disable IPSec tunnel to L2TP host. + - This option is need when C(service-type) is C(org.freedesktop.NetworkManager.l2tp). + type: bool + choices: [ yes, no ] + ipsec-psk: + description: + - The pre-shared key in base64 encoding. + - > + You can encode using this Ansible jinja2 expression: C("0s{{ '[YOUR PRE-SHARED KEY]' | ansible.builtin.b64encode }}"). + - This is only used when I(ipsec-enabled=true). + type: str ''' EXAMPLES = r''' @@ -1129,7 +1187,7 @@ EXAMPLES = r''' ip4: 192.0.2.100/24 gw4: 192.0.2.1 state: present - autoconnect: yes + autoconnect: true - name: Optionally, at the same time specify IPv6 addresses for the device community.general.nmcli: @@ -1288,6 +1346,23 @@ EXAMPLES = r''' autoconnect: true state: present +- name: >- + Create a VPN L2TP connection for ansible_user to connect on vpn.example.com + authenticating with user 'brittany' and pre-shared key as 'Brittany123' + community.general.nmcli: + type: vpn + conn_name: my-vpn-connection + vpn: + permissions: "{{ ansible_user }}" + service-type: org.freedesktop.NetworkManager.l2tp + gateway: vpn.example.com + password-flags: 2 + user: brittany + ipsec-enabled: true + ipsec-psk: "0s{{ 'Brittany123' | ansible.builtin.b64encode }}" + autoconnect: false + state: present + ''' RETURN = r"""# @@ -1370,6 +1445,7 @@ class Nmcli(object): self.primary = module.params['primary'] self.downdelay = module.params['downdelay'] self.updelay = module.params['updelay'] + self.xmit_hash_policy = module.params['xmit_hash_policy'] self.arp_interval = module.params['arp_interval'] self.arp_ip_target = module.params['arp_ip_target'] self.slavepriority = module.params['slavepriority'] @@ -1404,6 +1480,7 @@ class Nmcli(object): self.wifi_sec = module.params['wifi_sec'] self.gsm = module.params['gsm'] self.wireguard = module.params['wireguard'] + self.vpn = module.params['vpn'] if self.method4: self.ipv4_method = self.method4 @@ -1430,7 +1507,7 @@ class Nmcli(object): if self._hairpin is None: self.module.deprecate( "Parameter 'hairpin' default value will change from true to false in community.general 7.0.0. " - "Set the value explicitly to supress this warning.", + "Set the value explicitly to suppress this warning.", version='7.0.0', collection_name='community.general', ) # Should be False in 7.0.0 but then that should be in argument_specs @@ -1509,6 +1586,7 @@ class Nmcli(object): 'mode': self.mode, 'primary': self.primary, 'updelay': self.updelay, + 'xmit_hash_policy': self.xmit_hash_policy, }) elif self.type == 'bond-slave': options.update({ @@ -1592,6 +1670,29 @@ class Nmcli(object): options.update({ 'wireguard.%s' % name: value, }) + elif self.type == 'vpn': + if self.vpn: + vpn_data_values = '' + for name, value in self.vpn.items(): + if name == 'service-type': + options.update({ + 'vpn.service-type': value, + }) + elif name == 'permissions': + options.update({ + 'connection.permissions': value, + }) + else: + if vpn_data_values != '': + vpn_data_values += ', ' + + if isinstance(value, bool): + value = self.bool_to_string(value) + + vpn_data_values += '%s=%s' % (name, value) + options.update({ + 'vpn.data': vpn_data_values, + }) # Convert settings values based on the situation. for setting, value in options.items(): setting_type = self.settings_type(setting) @@ -1636,6 +1737,7 @@ class Nmcli(object): '802-11-wireless', 'gsm', 'wireguard', + 'vpn', ) @property @@ -1742,7 +1844,10 @@ class Nmcli(object): @staticmethod def list_to_string(lst): - return ",".join(lst or [""]) + if lst is None: + return None + else: + return ",".join(lst) @staticmethod def settings_type(setting): @@ -1832,6 +1937,10 @@ class Nmcli(object): 'connection.interface-name': ifname, } + # VPN doesn't need an interface but if sended it must be a valid interface. + if self.type == 'vpn' and self.ifname is None: + del options['connection.interface-name'] + options.update(self.connection_options()) # Constructing the command. @@ -1997,6 +2106,9 @@ class Nmcli(object): current_value = current_value.strip('"') if key == self.mtu_setting and self.mtu is None: self.mtu = 0 + if key == 'vpn.data': + current_value = sorted(re.sub(r'\s*=\s*', '=', part.strip(), count=1) for part in current_value.split(',')) + value = sorted(part.strip() for part in value.split(',')) else: # parameter does not exist current_value = None @@ -2025,6 +2137,10 @@ class Nmcli(object): 'connection.interface-name': self.ifname, } + # VPN doesn't need an interface but if sended it must be a valid interface. + if self.type == 'vpn' and self.ifname is None: + del options['connection.interface-name'] + if not self.type: current_con_type = self.show_connection().get('connection.type') if current_con_type: @@ -2064,6 +2180,7 @@ def main(): 'wifi', 'gsm', 'wireguard', + 'vpn', ]), ip4=dict(type='list', elements='str'), gw4=dict(type='str'), @@ -2118,6 +2235,7 @@ def main(): miimon=dict(type='int'), downdelay=dict(type='int'), updelay=dict(type='int'), + xmit_hash_policy=dict(type='str'), arp_interval=dict(type='int'), arp_ip_target=dict(type='str'), primary=dict(type='str'), @@ -2163,6 +2281,7 @@ def main(): wifi_sec=dict(type='dict', no_log=True), gsm=dict(type='dict'), wireguard=dict(type='dict'), + vpn=dict(type='dict'), ), mutually_exclusive=[['never_default4', 'gw4'], ['routes4_extended', 'routes4'], diff --git a/plugins/modules/net_tools/nsupdate.py b/plugins/modules/net_tools/nsupdate.py index fc0d5e1c46..512e44da2f 100644 --- a/plugins/modules/net_tools/nsupdate.py +++ b/plugins/modules/net_tools/nsupdate.py @@ -1,13 +1,14 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2016, Marcin Skarbek -# (c) 2016, Andreas Olsson -# (c) 2017, Loic Blot +# Copyright (c) 2016, Marcin Skarbek +# Copyright (c) 2016, Andreas Olsson +# Copyright (c) 2017, Loic Blot # # This module was ported from https://github.com/mskarbek/ansible-nsupdate # -# 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 @@ -426,7 +427,10 @@ class RecordManager(object): if lookup.rcode() != dns.rcode.NOERROR: self.module.fail_json(msg='Failed to lookup TTL of existing matching record.') - current_ttl = lookup.answer[0].ttl + if self.module.params['type'] == 'NS': + current_ttl = lookup.answer[0].ttl if lookup.answer else lookup.authority[0].ttl + else: + current_ttl = lookup.answer[0].ttl return current_ttl != self.module.params['ttl'] diff --git a/plugins/modules/net_tools/omapi_host.py b/plugins/modules/net_tools/omapi_host.py index 4d65fcb95d..7d1897ca55 100644 --- a/plugins/modules/net_tools/omapi_host.py +++ b/plugins/modules/net_tools/omapi_host.py @@ -1,10 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# copyright: (c) 2016, Loic Blot +# Copyright (c) 2016, Loic Blot # Sponsored by Infopro Digital. http://www.infopro-digital.com/ # Sponsored by E.T.A.I. http://www.etai.fr/ -# 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 @@ -69,7 +70,7 @@ options: description: - Enable dynamic DNS updates for this host. type: bool - default: no + default: false ''' EXAMPLES = r''' @@ -81,7 +82,7 @@ EXAMPLES = r''' macaddr: 44:dd:ab:dd:11:44 name: server01 ip: 192.168.88.99 - ddns: yes + ddns: true statements: - filename "pxelinux.0" - next-server 1.1.1.1 diff --git a/plugins/modules/net_tools/pritunl/pritunl_org.py b/plugins/modules/net_tools/pritunl/pritunl_org.py index 35796ae361..75c3564f24 100644 --- a/plugins/modules/net_tools/pritunl/pritunl_org.py +++ b/plugins/modules/net_tools/pritunl/pritunl_org.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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 @@ -67,11 +68,11 @@ response: type: dict sample: { - "auth_api": False, + "auth_api": false, "name": "Foo", - "auth_token": None, + "auth_token": null, "user_count": 0, - "auth_secret": None, + "auth_secret": null, "id": "csftwlu6uhralzi2dpmhekz3", } """ diff --git a/plugins/modules/net_tools/pritunl/pritunl_org_info.py b/plugins/modules/net_tools/pritunl/pritunl_org_info.py index a7e65c80d1..1529239ad9 100644 --- a/plugins/modules/net_tools/pritunl/pritunl_org_info.py +++ b/plugins/modules/net_tools/pritunl/pritunl_org_info.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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 @@ -48,27 +49,27 @@ organizations: sample: [ { - "auth_api": False, + "auth_api": false, "name": "FooOrg", - "auth_token": None, + "auth_token": null, "user_count": 0, - "auth_secret": None, + "auth_secret": null, "id": "csftwlu6uhralzi2dpmhekz3", }, { - "auth_api": False, + "auth_api": false, "name": "MyOrg", - "auth_token": None, + "auth_token": null, "user_count": 3, - "auth_secret": None, + "auth_secret": null, "id": "58070daee63f3b2e6e472c36", }, { - "auth_api": False, + "auth_api": false, "name": "BarOrg", - "auth_token": None, + "auth_token": null, "user_count": 0, - "auth_secret": None, + "auth_secret": null, "id": "v1sncsxxybnsylc8gpqg85pg", } ] diff --git a/plugins/modules/net_tools/pritunl/pritunl_user.py b/plugins/modules/net_tools/pritunl/pritunl_user.py index 0beb9720b6..817d6fb3f6 100644 --- a/plugins/modules/net_tools/pritunl/pritunl_user.py +++ b/plugins/modules/net_tools/pritunl/pritunl_user.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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 @@ -107,7 +108,7 @@ EXAMPLES = """ organization: MyOrg user_name: Foo user_email: foo@bar.com - user_disabled: yes + user_disabled: true - name: Make sure the user Foo is not part of MyOrg anymore community.general.pritunl_user: diff --git a/plugins/modules/net_tools/pritunl/pritunl_user_info.py b/plugins/modules/net_tools/pritunl/pritunl_user_info.py index e8cf5e2955..3a5343f6b6 100644 --- a/plugins/modules/net_tools/pritunl/pritunl_user_info.py +++ b/plugins/modules/net_tools/pritunl/pritunl_user_info.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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/modules/net_tools/snmp_facts.py b/plugins/modules/net_tools/snmp_facts.py index 37183b95f4..7683d7308b 100644 --- a/plugins/modules/net_tools/snmp_facts.py +++ b/plugins/modules/net_tools/snmp_facts.py @@ -2,7 +2,9 @@ # -*- coding: utf-8 -*- # This file is part of Networklore's snmp library for Ansible -# 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/modules/notification/bearychat.py b/plugins/modules/notification/bearychat.py index 4c907ea6b7..48d5c994fc 100644 --- a/plugins/modules/notification/bearychat.py +++ b/plugins/modules/notification/bearychat.py @@ -1,22 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- - -# (c) 2016, Jiangge Zhang -# -# 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) 2016, Jiangge Zhang +# 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,8 +28,8 @@ options: - Message to send. markdown: description: - - If C(yes), text will be parsed as markdown. - default: 'yes' + - If C(true), text will be parsed as markdown. + default: true type: bool channel: type: str @@ -72,7 +58,7 @@ EXAMPLES = """ url: | https://hook.bearychat.com/=ae2CF/incoming/e61bd5c57b164e04b11ac02e66f47f60 text: "{{ inventory_hostname }} completed" - markdown: no + markdown: false channel: "#ansible" attachments: - title: "Ansible on {{ inventory_hostname }}" diff --git a/plugins/modules/notification/campfire.py b/plugins/modules/notification/campfire.py index c684823889..dfc9af1ce1 100644 --- a/plugins/modules/notification/campfire.py +++ b/plugins/modules/notification/campfire.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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/modules/notification/catapult.py b/plugins/modules/notification/catapult.py index 1383362068..8b8c72974d 100644 --- a/plugins/modules/notification/catapult.py +++ b/plugins/modules/notification/catapult.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2016, Jonathan Mainguy -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, Jonathan Mainguy +# 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 # # basis of code taken from the ansible twillio and nexmo modules @@ -89,7 +90,7 @@ changed: description: Whether the api accepted the message. returned: always type: bool - sample: True + sample: true ''' diff --git a/plugins/modules/notification/cisco_webex.py b/plugins/modules/notification/cisco_webex.py index 8c1361fb14..95fcccb7d6 100644 --- a/plugins/modules/notification/cisco_webex.py +++ b/plugins/modules/notification/cisco_webex.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -25,14 +26,14 @@ options: description: - The request parameter you would like to send the message to. - Messages can be sent to either a room or individual (by ID or E-Mail). - required: yes + required: true choices: ['roomId', 'toPersonEmail', 'toPersonId'] type: str recipient_id: description: - The unique identifier associated with the supplied C(recipient_type). - required: yes + required: true type: str msg_type: @@ -46,14 +47,14 @@ options: personal_token: description: - Your personal access token required to validate the Webex Teams API. - required: yes + required: true aliases: ['token'] type: str msg: description: - The message you would like to send. - required: yes + required: true type: str ''' diff --git a/plugins/modules/notification/discord.py b/plugins/modules/notification/discord.py index 27dc6fc85c..9df00ad7dd 100644 --- a/plugins/modules/notification/discord.py +++ b/plugins/modules/notification/discord.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2021, Christian Wollinger -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, Christian Wollinger +# 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,13 +25,13 @@ options: description: - The webhook ID. - "Format from Discord webhook URL: C(/webhooks/{webhook.id}/{webhook.token})." - required: yes + required: true type: str webhook_token: description: - The webhook token. - "Format from Discord webhook URL: C(/webhooks/{webhook.id}/{webhook.token})." - required: yes + required: true type: str content: description: diff --git a/plugins/modules/notification/flowdock.py b/plugins/modules/notification/flowdock.py index a1842c5d16..965ae62d7a 100644 --- a/plugins/modules/notification/flowdock.py +++ b/plugins/modules/notification/flowdock.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # Copyright 2013 Matt Coddington -# 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 @@ -79,10 +80,10 @@ options: required: false validate_certs: description: - - If C(no), SSL certificates will not be validated. This should only be used + - If C(false), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. required: false - default: 'yes' + default: true type: bool requirements: [ ] diff --git a/plugins/modules/notification/grove.py b/plugins/modules/notification/grove.py index 12c910902e..d3ad6bb019 100644 --- a/plugins/modules/notification/grove.py +++ b/plugins/modules/notification/grove.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -45,9 +46,9 @@ options: required: false validate_certs: description: - - If C(no), SSL certificates will not be validated. This should only be used + - If C(false), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. - default: 'yes' + default: true type: bool author: "Jonas Pfenniger (@zimbatm)" ''' diff --git a/plugins/modules/notification/hipchat.py b/plugins/modules/notification/hipchat.py index 76c1227af4..1871bd23ae 100644 --- a/plugins/modules/notification/hipchat.py +++ b/plugins/modules/notification/hipchat.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -53,13 +54,13 @@ options: description: - If true, a notification will be triggered for users in the room. type: bool - default: 'yes' + default: true validate_certs: description: - - If C(no), SSL certificates will not be validated. This should only be used + - If C(false), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. type: bool - default: 'yes' + default: true api: type: str description: diff --git a/plugins/modules/notification/irc.py b/plugins/modules/notification/irc.py index 9b1b91f586..f45d610da7 100644 --- a/plugins/modules/notification/irc.py +++ b/plugins/modules/notification/irc.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2013, Jan-Piet Mens -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2013, Jan-Piet Mens +# 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 @@ -75,13 +76,13 @@ options: description: - Designates whether TLS/SSL should be used when connecting to the IRC server type: bool - default: 'no' + default: false part: description: - Designates whether user should part from channel after sending message or not. Useful for when using a faux bot and not wanting join/parts between messages. type: bool - default: 'yes' + default: true style: type: str description: diff --git a/plugins/modules/notification/jabber.py b/plugins/modules/notification/jabber.py index 9b6811b3fa..110b618d77 100644 --- a/plugins/modules/notification/jabber.py +++ b/plugins/modules/notification/jabber.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# (c) 2015, Brian Coca -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2015, Brian Coca +# 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/modules/notification/logentries_msg.py b/plugins/modules/notification/logentries_msg.py index 59e0f32565..b1b77e1d62 100644 --- a/plugins/modules/notification/logentries_msg.py +++ b/plugins/modules/notification/logentries_msg.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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 __metaclass__ = type diff --git a/plugins/modules/notification/mail.py b/plugins/modules/notification/mail.py index 82ca6d52b2..697ed49ee7 100644 --- a/plugins/modules/notification/mail.py +++ b/plugins/modules/notification/mail.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2012, Dag Wieers (@dagwieers) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2012, 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 @@ -57,7 +58,7 @@ options: subject: description: - The subject of the email being sent. - required: yes + required: true type: str aliases: [ msg ] body: diff --git a/plugins/modules/notification/matrix.py b/plugins/modules/notification/matrix.py index d94ed2b8de..f339e76593 100644 --- a/plugins/modules/notification/matrix.py +++ b/plugins/modules/notification/matrix.py @@ -1,8 +1,9 @@ #!/usr/bin/python # coding: utf-8 -# (c) 2018, Jan Christian Grünhage -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2018, Jan Christian Grünhage +# 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/modules/notification/mattermost.py b/plugins/modules/notification/mattermost.py index efee4c33eb..af6666b3cd 100644 --- a/plugins/modules/notification/mattermost.py +++ b/plugins/modules/notification/mattermost.py @@ -1,14 +1,15 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Benjamin Jolivot +# Copyright (c) Benjamin Jolivot # Inspired by slack module : -# # (c) 2017, Steve Pletcher -# # (c) 2016, René Moser -# # (c) 2015, Stefan Berggren -# # (c) 2014, Ramon de la Fuente ) +# # Copyright (c) 2017, Steve Pletcher +# # Copyright (c) 2016, René Moser +# # Copyright (c) 2015, Stefan Berggren +# # Copyright (c) 2014, Ramon de la Fuente ) # -# 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,9 +64,9 @@ options: default: https://www.ansible.com/favicon.ico validate_certs: description: - - If C(no), SSL certificates will not be validated. This should only be used + - If C(false), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. - default: yes + default: true type: bool ''' @@ -96,10 +97,10 @@ EXAMPLES = """ fields: - title: System A value: "load average: 0,74, 0,66, 0,63" - short: True + short: true - title: System B value: 'load average: 5,16, 4,64, 2,43' - short: True + short: true """ RETURN = ''' diff --git a/plugins/modules/notification/mqtt.py b/plugins/modules/notification/mqtt.py index 6099196102..fe6e7347fc 100644 --- a/plugins/modules/notification/mqtt.py +++ b/plugins/modules/notification/mqtt.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2013, 2014, Jan-Piet Mens -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2013, 2014, Jan-Piet Mens +# 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 @@ -62,7 +63,7 @@ options: applications that subsequently subscribe to the topic can received the last retained message immediately. type: bool - default: 'no' + default: false ca_cert: type: path description: @@ -111,7 +112,7 @@ EXAMPLES = ''' topic: 'service/ansible/{{ ansible_hostname }}' payload: 'Hello at {{ ansible_date_time.iso8601 }}' qos: 0 - retain: False + retain: false client_id: ans001 delegate_to: localhost ''' diff --git a/plugins/modules/notification/nexmo.py b/plugins/modules/notification/nexmo.py index d239bb4456..d1e6b8d35c 100644 --- a/plugins/modules/notification/nexmo.py +++ b/plugins/modules/notification/nexmo.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (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 @@ -44,10 +45,10 @@ options: required: true validate_certs: description: - - If C(no), SSL certificates will not be validated. This should only be used + - If C(false), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. type: bool - default: 'yes' + default: true extends_documentation_fragment: - url ''' diff --git a/plugins/modules/notification/office_365_connector_card.py b/plugins/modules/notification/office_365_connector_card.py index 04d5e385d4..fc9a24aa57 100644 --- a/plugins/modules/notification/office_365_connector_card.py +++ b/plugins/modules/notification/office_365_connector_card.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # Copyright (c) 2017 Marc Sensenich # 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/modules/notification/pushbullet.py b/plugins/modules/notification/pushbullet.py index 435fcf2fcb..a3e4104554 100644 --- a/plugins/modules/notification/pushbullet.py +++ b/plugins/modules/notification/pushbullet.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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/modules/notification/pushover.py b/plugins/modules/notification/pushover.py index 7f73592a36..c4c12a4670 100644 --- a/plugins/modules/notification/pushover.py +++ b/plugins/modules/notification/pushover.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # Copyright (c) 2012, Jim Richardson # Copyright (c) 2019, Bernd Arnold -# 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/modules/notification/rocketchat.py b/plugins/modules/notification/rocketchat.py index 500560e417..153567e22a 100644 --- a/plugins/modules/notification/rocketchat.py +++ b/plugins/modules/notification/rocketchat.py @@ -1,11 +1,12 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2016, Deepak Kothandan -# (c) 2015, Stefan Berggren -# (c) 2014, Ramon de la Fuente +# Copyright (c) 2016, Deepak Kothandan +# Copyright (c) 2015, Stefan Berggren +# Copyright (c) 2014, Ramon de la Fuente # -# 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 @@ -73,10 +74,10 @@ options: - 0 validate_certs: description: - - If C(no), SSL certificates will not be validated. This should only be used + - If C(false), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. type: bool - default: 'yes' + default: true color: type: str description: @@ -134,10 +135,10 @@ EXAMPLES = """ fields: - title: System A value: 'load average: 0,74, 0,66, 0,63' - short: True + short: true - title: System B value: 'load average: 5,16, 4,64, 2,43' - short: True + short: true delegate_to: localhost """ diff --git a/plugins/modules/notification/say.py b/plugins/modules/notification/say.py index 1c66adf66e..fe36b02d15 100644 --- a/plugins/modules/notification/say.py +++ b/plugins/modules/notification/say.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2013, Michael DeHaan -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2013, 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 from __future__ import absolute_import, division, print_function __metaclass__ = type diff --git a/plugins/modules/notification/sendgrid.py b/plugins/modules/notification/sendgrid.py index 2c349064b8..d2a52e5f0e 100644 --- a/plugins/modules/notification/sendgrid.py +++ b/plugins/modules/notification/sendgrid.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2015, Matt Makai -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2015, Matt Makai +# 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 @@ -80,7 +81,7 @@ options: description: - Whether the body is html content that should be rendered. type: bool - default: 'no' + default: false headers: type: dict description: @@ -89,7 +90,7 @@ options: type: str description: - The e-mail body content. - required: yes + required: true author: "Matt Makai (@makaimc)" ''' diff --git a/plugins/modules/notification/slack.py b/plugins/modules/notification/slack.py index bdc839f9a8..46602a5d16 100644 --- a/plugins/modules/notification/slack.py +++ b/plugins/modules/notification/slack.py @@ -1,14 +1,15 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2020, Lee Goolsbee -# (c) 2020, Michal Middleton -# (c) 2017, Steve Pletcher -# (c) 2016, René Moser -# (c) 2015, Stefan Berggren -# (c) 2014, Ramon de la Fuente +# Copyright (c) 2020, Lee Goolsbee +# Copyright (c) 2020, Michal Middleton +# Copyright (c) 2017, Steve Pletcher +# Copyright (c) 2016, René Moser +# Copyright (c) 2015, Stefan Berggren +# Copyright (c) 2014, Ramon de la Fuente # -# 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 @@ -68,7 +69,8 @@ options: message_id: description: - Optional. Message ID to edit, instead of posting a new message. - Corresponds to C(ts) in the Slack API (U(https://api.slack.com/messaging/modifying)). + - If supplied I(channel_id) must be in form of C(C0xxxxxxx). use C({{ slack_response.channel_id }}) to get I(channel_id) from previous task run. + - Corresponds to C(ts) in the Slack API (U(https://api.slack.com/messaging/modifying)). type: str version_added: 1.2.0 username: @@ -103,10 +105,10 @@ options: - 'none' validate_certs: description: - - If C(no), SSL certificates will not be validated. This should only be used + - If C(false), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. type: bool - default: 'yes' + default: true color: type: str description: @@ -174,10 +176,10 @@ EXAMPLES = """ fields: - title: System A value: "load average: 0,74, 0,66, 0,63" - short: True + short: true - title: System B value: 'load average: 5,16, 4,64, 2,43' - short: True + short: true - name: Use the blocks API community.general.slack: @@ -233,6 +235,8 @@ EXAMPLES = """ - name: Edit message community.general.slack: token: thetoken/generatedby/slack + # The 'channel' option does not accept the channel name. It must use the 'channel_id', + # which can be retrieved for example from 'slack_response' from the previous task. channel: "{{ slack_response.channel }}" msg: Deployment complete! message_id: "{{ slack_response.ts }}" @@ -293,7 +297,7 @@ def build_payload_for_slack(text, channel, thread_id, username, icon_url, icon_e # With a custom color we have to set the message as attachment, and explicitly turn markdown parsing on for it. payload = dict(attachments=[dict(text=escape_quotes(text), color=color, mrkdwn_in=["text"])]) if channel is not None: - if channel.startswith(('#', '@', 'C0')): + if channel.startswith(('#', '@', 'C0', 'GF', 'G0', 'CP')): payload['channel'] = channel else: payload['channel'] = '#' + channel diff --git a/plugins/modules/notification/syslogger.py b/plugins/modules/notification/syslogger.py index 7627f35985..5fc21a9dc1 100644 --- a/plugins/modules/notification/syslogger.py +++ b/plugins/modules/notification/syslogger.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2017, Tim Rightnour -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017, Tim Rightnour +# 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 @@ -17,7 +18,7 @@ options: type: str description: - This is the message to place in syslog. - required: True + required: true priority: type: str description: @@ -36,7 +37,7 @@ options: description: - Log the PID in brackets. type: bool - default: False + default: false ident: description: - Specify the name of application name which is sending the log to syslog. @@ -87,7 +88,7 @@ log_pid: description: Log PID status returned: always type: bool - sample: True + sample: true msg: description: Message sent to syslog returned: always diff --git a/plugins/modules/notification/telegram.py b/plugins/modules/notification/telegram.py index 4960874ddb..499af4ef1a 100644 --- a/plugins/modules/notification/telegram.py +++ b/plugins/modules/notification/telegram.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2016, Artem Feofanov -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, Artem Feofanov +# 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 @@ -53,8 +54,8 @@ EXAMPLES = """ chat_id: 000000 parse_mode: "markdown" text: "Your precious application has been deployed: https://example.com" - disable_web_page_preview: True - disable_notification: True + disable_web_page_preview: true + disable_notification: true - name: Forward message to someone community.general.telegram: @@ -63,7 +64,7 @@ EXAMPLES = """ api_args: chat_id: 000000 from_chat_id: 111111 - disable_notification: True + disable_notification: true message_id: '{{ saved_msg_id }}' """ diff --git a/plugins/modules/notification/twilio.py b/plugins/modules/notification/twilio.py index 88851a6ad3..1934820fe3 100644 --- a/plugins/modules/notification/twilio.py +++ b/plugins/modules/notification/twilio.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2015, Matt Makai -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2015, Matt Makai +# 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/modules/notification/typetalk.py b/plugins/modules/notification/typetalk.py index 6f8e4e8b9a..5fe2baa916 100644 --- a/plugins/modules/notification/typetalk.py +++ b/plugins/modules/notification/typetalk.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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/modules/packaging/language/ansible_galaxy_install.py b/plugins/modules/packaging/language/ansible_galaxy_install.py index 968a8d093d..3964cdab9f 100644 --- a/plugins/modules/packaging/language/ansible_galaxy_install.py +++ b/plugins/modules/packaging/language/ansible_galaxy_install.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2021, Alexei Znamensky +# Copyright (c) 2021, Alexei Znamensky # -# 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 @@ -226,7 +227,7 @@ class AnsibleGalaxyInstall(CmdModuleHelper): check_rc = True def _get_ansible_galaxy_version(self): - ansible_galaxy = self.module.get_bin_path("ansible-galaxy", required=True) + ansible_galaxy = self.get_bin_path("ansible-galaxy", required=True) dummy, out, dummy = self.module.run_command([ansible_galaxy, "--version"], check_rc=True) line = out.splitlines()[0] match = self._RE_GALAXY_VERSION.match(line) @@ -242,7 +243,7 @@ class AnsibleGalaxyInstall(CmdModuleHelper): self.module.deprecate( "Support for Ansible 2.9 and ansible-base 2.10 is being deprecated. " "At the same time support for them is ended, also the ack_ansible29 option will be removed. " - "Upgrading is strongly recommended, or set 'ack_min_ansiblecore211' to supress this message.", + "Upgrading is strongly recommended, or set 'ack_min_ansiblecore211' to suppress this message.", version="8.0.0", collection_name="community.general", ) @@ -302,9 +303,9 @@ class AnsibleGalaxyInstall(CmdModuleHelper): self.vars.set("new_roles", {}) self.vars.set("ansible29_change", False, change=True, output=False) if not (self.vars.ack_ansible29 or self.vars.ack_min_ansiblecore211): - self.module.warn("Ansible 2.9 or older: unable to retrieve lists of roles and collections already installed") + self.warn("Ansible 2.9 or older: unable to retrieve lists of roles and collections already installed") if self.vars.requirements_file is not None and self.vars.type == 'both': - self.module.warn("Ansible 2.9 or older: will install only roles from requirement files") + self.warn("Ansible 2.9 or older: will install only roles from requirement files") def _setup210plus(self): self.vars.set("new_collections", {}, change=True) diff --git a/plugins/modules/packaging/language/bower.py b/plugins/modules/packaging/language/bower.py index 911d99b7d9..8964bd0434 100644 --- a/plugins/modules/packaging/language/bower.py +++ b/plugins/modules/packaging/language/bower.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2014, Michael Warkentin -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2014, Michael Warkentin +# 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,12 +25,12 @@ options: description: - Install packages from local cache, if the packages were installed before type: bool - default: 'no' + default: false production: description: - Install with --production flag type: bool - default: 'no' + default: false path: type: path description: @@ -79,7 +80,7 @@ EXAMPLES = ''' - npm: path: /app/location name: bower - global: no + global: false - community.general.bower: path: /app/location relative_execpath: node_modules/.bin diff --git a/plugins/modules/packaging/language/bundler.py b/plugins/modules/packaging/language/bundler.py index 43f8cfa2ee..5811fa720c 100644 --- a/plugins/modules/packaging/language/bundler.py +++ b/plugins/modules/packaging/language/bundler.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2015, Tim Hoiberg -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2015, Tim Hoiberg +# 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 @@ -44,7 +45,7 @@ options: - Only applies if state is C(present). If set removes any gems on the target host that are not in the gemfile type: bool - default: 'no' + default: false gemfile: type: path description: @@ -54,19 +55,19 @@ options: description: - If set only installs gems from the cache on the target host type: bool - default: 'no' + default: false deployment_mode: description: - Only applies if state is C(present). If set it will install gems in ./vendor/bundle instead of the default location. Requires a Gemfile.lock file to have been created prior type: bool - default: 'no' + default: false user_install: description: - Only applies if state is C(present). Installs gems in the local user's cache or for all users type: bool - default: 'yes' + default: true gem_path: type: path description: @@ -105,7 +106,7 @@ EXAMPLES = ''' - name: Install gems into ./vendor/bundle community.general.bundler: state: present - deployment_mode: yes + deployment_mode: true - name: Install gems using a Gemfile in another directory community.general.bundler: diff --git a/plugins/modules/packaging/language/cargo.py b/plugins/modules/packaging/language/cargo.py index d449f1020e..787edbd256 100644 --- a/plugins/modules/packaging/language/cargo.py +++ b/plugins/modules/packaging/language/cargo.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2021 Radek Sprta -# 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/modules/packaging/language/composer.py b/plugins/modules/packaging/language/composer.py index 351a104658..64310c760e 100644 --- a/plugins/modules/packaging/language/composer.py +++ b/plugins/modules/packaging/language/composer.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2014, Dimitrios Tydeas Mengidis -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2014, Dimitrios Tydeas Mengidis +# 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 @@ -40,7 +41,7 @@ options: description: - Directory of your project (see --working-dir). This is required when the command is not run globally. - - Will be ignored if C(global_command=true). + - Will be ignored if I(global_command=true). global_command: description: - Runs the specified command globally. @@ -81,7 +82,7 @@ options: classmap_authoritative: description: - Autoload classes from classmap only. - - Implicitely enable optimize_autoloader. + - Implicitly enable optimize_autoloader. - Recommended especially for production, but can take a bit of time to run. default: false type: bool @@ -125,12 +126,12 @@ EXAMPLES = ''' command: create-project arguments: package/package /path/to/project ~1.0 working_dir: /path/to/project - prefer_dist: yes + prefer_dist: true - name: Install a package globally community.general.composer: command: require - global_command: yes + global_command: true arguments: my/package ''' diff --git a/plugins/modules/packaging/language/cpanm.py b/plugins/modules/packaging/language/cpanm.py index 7b209d1fae..aba4e9d56e 100644 --- a/plugins/modules/packaging/language/cpanm.py +++ b/plugins/modules/packaging/language/cpanm.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2012, Franck Cuny -# (c) 2021, Alexei Znamensky -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2012, Franck Cuny +# Copyright (c) 2021, 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 @@ -30,7 +31,7 @@ options: description: - Do not run unit tests. type: bool - default: no + default: false locallib: description: - Specify the install base to install modules. @@ -43,12 +44,12 @@ options: description: - Use the mirror's index file instead of the CPAN Meta DB. type: bool - default: no + default: false installdeps: description: - Only install dependencies. type: bool - default: no + default: false version: description: - Version specification for the perl module. When I(mode) is C(new), C(cpanm) version operators are accepted. @@ -112,7 +113,7 @@ EXAMPLES = ''' - name: Install Dancer perl package without running the unit tests in indicated locallib community.general.cpanm: name: Dancer - notest: True + notest: true locallib: /srv/webapps/my_app/extlib - name: Install Dancer perl package from a specific mirror @@ -121,7 +122,7 @@ EXAMPLES = ''' mirror: 'http://cpan.cpantesters.org/' - name: Install Dancer perl package into the system root path - become: yes + become: true community.general.cpanm: name: Dancer @@ -134,7 +135,7 @@ EXAMPLES = ''' import os from ansible_collections.community.general.plugins.module_utils.module_helper import ( - ModuleHelper, CmdMixin, ArgFormat, ModuleHelperException + ModuleHelper, CmdMixin, ArgFormat ) @@ -171,10 +172,10 @@ class CPANMinus(CmdMixin, ModuleHelper): v = self.vars if v.mode == "compatibility": if v.name_check: - raise ModuleHelperException("Parameter name_check can only be used with mode=new") + self.do_raise("Parameter name_check can only be used with mode=new") else: if v.name and v.from_path: - raise ModuleHelperException("Parameters 'name' and 'from_path' are mutually exclusive when 'mode=new'") + self.do_raise("Parameters 'name' and 'from_path' are mutually exclusive when 'mode=new'") self.command = self.module.get_bin_path(v.executable if v.executable else self.command) self.vars.set("binary", self.command) @@ -190,17 +191,16 @@ class CPANMinus(CmdMixin, ModuleHelper): return rc == 0 - @staticmethod - def sanitize_pkg_spec_version(pkg_spec, version): + def sanitize_pkg_spec_version(self, pkg_spec, version): if version is None: return pkg_spec if pkg_spec.endswith('.tar.gz'): - raise ModuleHelperException(msg="parameter 'version' must not be used when installing from a file") + self.do_raise(msg="parameter 'version' must not be used when installing from a file") if os.path.isdir(pkg_spec): - raise ModuleHelperException(msg="parameter 'version' must not be used when installing from a directory") + self.do_raise(msg="parameter 'version' must not be used when installing from a directory") if pkg_spec.endswith('.git'): if version.startswith('~'): - raise ModuleHelperException(msg="operator '~' not allowed in version parameter when installing from git repository") + self.do_raise(msg="operator '~' not allowed in version parameter when installing from git repository") version = version if version.startswith('@') else '@' + version elif version[0] not in ('@', '~'): version = '~' + version @@ -228,7 +228,7 @@ class CPANMinus(CmdMixin, ModuleHelper): def process_command_output(self, rc, out, err): if self.vars.mode == "compatibility" and rc != 0: - raise ModuleHelperException(msg=err, cmd=self.vars.cmd_args) + self.do_raise(msg=err, cmd=self.vars.cmd_args) return 'is up to date' not in err and 'is up to date' not in out diff --git a/plugins/modules/packaging/language/easy_install.py b/plugins/modules/packaging/language/easy_install.py index 5e1d7930b5..0a3158c926 100644 --- a/plugins/modules/packaging/language/easy_install.py +++ b/plugins/modules/packaging/language/easy_install.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2012, Matt Wright -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2012, Matt Wright +# 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 @@ -33,7 +34,7 @@ options: have any effect, the environment must be deleted and newly created. type: bool - default: 'no' + default: false virtualenv_command: type: str description: diff --git a/plugins/modules/packaging/language/gem.py b/plugins/modules/packaging/language/gem.py index ad48e0c7da..e30bf458d4 100644 --- a/plugins/modules/packaging/language/gem.py +++ b/plugins/modules/packaging/language/gem.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2013, Johan Wiren -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2013, Johan Wiren +# 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 @@ -37,7 +38,7 @@ options: - Whether to include dependencies or not. required: false type: bool - default: "yes" + default: true repository: type: str description: @@ -49,7 +50,7 @@ options: - Install gem in user's local gems cache or for all users required: false type: bool - default: "yes" + default: true executable: type: path description: @@ -79,7 +80,7 @@ options: description: - Rewrite the shebang line on installed scripts to use /usr/bin/env. required: false - default: "no" + default: false type: bool version: type: str @@ -90,13 +91,13 @@ options: description: - Allow installation of pre-release versions of the gem. required: false - default: "no" + default: false type: bool include_doc: description: - Install with or without docs. required: false - default: "no" + default: false type: bool build_flags: type: str @@ -107,7 +108,7 @@ options: description: - Force gem to install, bypassing dependency checks. required: false - default: "no" + default: false type: bool author: - "Ansible Core Team" diff --git a/plugins/modules/packaging/language/maven_artifact.py b/plugins/modules/packaging/language/maven_artifact.py index eee3e2f67d..b909f509a4 100644 --- a/plugins/modules/packaging/language/maven_artifact.py +++ b/plugins/modules/packaging/language/maven_artifact.py @@ -6,7 +6,8 @@ # Built using https://github.com/hamnis/useful-scripts/blob/master/python/download-maven-artifact # as a reference and starting point. # -# 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 @@ -82,7 +83,7 @@ options: responds to an initial request with a 401 status. Since some basic auth services do not properly send a 401, logins will fail. This option forces the sending of the Basic authentication header upon initial request. - default: 'no' + default: false type: bool version_added: '0.2.0' dest: @@ -104,9 +105,9 @@ options: default: 10 validate_certs: description: - - If C(no), SSL certificates will not be validated. This should only be set to C(no) when no other option exists. + - If C(false), SSL certificates will not be validated. This should only be set to C(false) when no other option exists. type: bool - default: 'yes' + default: true client_cert: description: - PEM formatted certificate chain file to be used for SSL client authentication. @@ -121,11 +122,11 @@ options: version_added: '1.3.0' keep_name: description: - - If C(yes), the downloaded artifact's name is preserved, i.e the version number remains part of it. + - If C(true), the downloaded artifact's name is preserved, i.e the version number remains part of it. - This option only has effect when C(dest) is a directory and C(version) is set to C(latest) or C(version_by_spec) is defined. type: bool - default: 'no' + default: false verify_checksum: type: str description: @@ -150,6 +151,15 @@ options: default: 'md5' choices: ['md5', 'sha1'] version_added: 3.2.0 + unredirected_headers: + type: list + elements: str + version_added: 5.2.0 + description: + - A list of headers that should not be included in the redirection. This headers are sent to the fetch_url C(fetch_url) function. + - On ansible-core version 2.12 or later, the default of this option is C([Authorization, Cookie]). + - Useful if the redirection URL does not need to have sensitive headers in the request. + - Requires ansible-core version 2.12 or later. directory_mode: type: str description: @@ -204,7 +214,7 @@ EXAMPLES = ''' artifact_id: spring-core group_id: org.springframework dest: /tmp/ - keep_name: yes + keep_name: true - name: Download the latest version of the JUnit framework artifact from Maven local community.general.maven_artifact: @@ -230,6 +240,7 @@ import tempfile import traceback import re +from ansible_collections.community.general.plugins.module_utils.version import LooseVersion from ansible.module_utils.ansible_release import __version__ as ansible_version from re import match @@ -509,7 +520,18 @@ class MavenDownloader: self.module.params['url_password'] = self.module.params.get('password', '') self.module.params['http_agent'] = self.user_agent - response, info = fetch_url(self.module, url_to_use, timeout=req_timeout, headers=self.headers) + kwargs = {} + if self.module.params['unredirected_headers']: + kwargs['unredirected_headers'] = self.module.params['unredirected_headers'] + + response, info = fetch_url( + self.module, + url_to_use, + timeout=req_timeout, + headers=self.headers, + **kwargs + ) + if info['status'] == 200: return response if force: @@ -614,12 +636,20 @@ def main(): keep_name=dict(required=False, default=False, type='bool'), verify_checksum=dict(required=False, default='download', choices=['never', 'download', 'change', 'always']), checksum_alg=dict(required=False, default='md5', choices=['md5', 'sha1']), + unredirected_headers=dict(type='list', elements='str', required=False), directory_mode=dict(type='str'), ), add_file_common_args=True, mutually_exclusive=([('version', 'version_by_spec')]) ) + if LooseVersion(ansible_version) < LooseVersion("2.12") and module.params['unredirected_headers']: + module.fail_json(msg="Unredirected Headers parameter provided, but your ansible-core version does not support it. Minimum version is 2.12") + + if LooseVersion(ansible_version) >= LooseVersion("2.12") and module.params['unredirected_headers'] is None: + # if the user did not supply unredirected params, we use the default, ONLY on ansible core 2.12 and above + module.params['unredirected_headers'] = ['Authorization', 'Cookie'] + if not HAS_LXML_ETREE: module.fail_json(msg=missing_required_lib('lxml'), exception=LXML_ETREE_IMP_ERR) diff --git a/plugins/modules/packaging/language/npm.py b/plugins/modules/packaging/language/npm.py index 1c97035e67..02d97de766 100644 --- a/plugins/modules/packaging/language/npm.py +++ b/plugins/modules/packaging/language/npm.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017 Chris Hoffman -# 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 @@ -34,7 +35,7 @@ options: description: - Install the node.js library globally. required: false - default: no + default: false type: bool executable: description: @@ -47,23 +48,23 @@ options: - Use the C(--ignore-scripts) flag when installing. required: false type: bool - default: no + default: false unsafe_perm: description: - Use the C(--unsafe-perm) flag when installing. type: bool - default: no + default: false ci: description: - Install packages based on package-lock file, same as running C(npm ci). type: bool - default: no + default: false production: description: - Install dependencies in production mode, excluding devDependencies. required: false type: bool - default: no + default: false registry: description: - The registry to install modules from. @@ -80,13 +81,13 @@ options: description: - Use the C(--no-optional) flag when installing. type: bool - default: no + default: false version_added: 2.0.0 no_bin_links: description: - Use the C(--no-bin-links) flag when installing. type: bool - default: no + default: false version_added: 2.5.0 requirements: - npm installed in bin path (recommended /usr/local/bin) @@ -107,12 +108,12 @@ EXAMPLES = r''' - name: Install "coffee-script" node.js package globally. community.general.npm: name: coffee-script - global: yes + global: true - name: Remove the globally package "coffee-script". community.general.npm: name: coffee-script - global: yes + global: true state: absent - name: Install "coffee-script" node.js package from custom registry. diff --git a/plugins/modules/packaging/language/pear.py b/plugins/modules/packaging/language/pear.py index e8e36b3c56..4e10ca0414 100644 --- a/plugins/modules/packaging/language/pear.py +++ b/plugins/modules/packaging/language/pear.py @@ -1,11 +1,12 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2012, Afterburn -# (c) 2013, Aaron Bull Schaefer -# (c) 2015, Jonathan Lestrelin +# Copyright (c) 2012, Afterburn +# Copyright (c) 2013, Aaron Bull Schaefer +# Copyright (c) 2015, Jonathan Lestrelin # -# 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/modules/packaging/language/pip_package_info.py b/plugins/modules/packaging/language/pip_package_info.py index 25825cefb1..6931366c87 100644 --- a/plugins/modules/packaging/language/pip_package_info.py +++ b/plugins/modules/packaging/language/pip_package_info.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (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 # started out with AWX's scan_packages module @@ -17,9 +18,9 @@ options: clients: description: - A list of the pip executables that will be used to get the packages. - They can be supplied with the full path or just the executable name, i.e `pip3.7`. + They can be supplied with the full path or just the executable name, for example C(pip3.7). default: ['pip'] - required: False + required: false type: list elements: path requirements: @@ -97,13 +98,13 @@ from ansible.module_utils.facts.packages import CLIMgr class PIP(CLIMgr): - def __init__(self, pip): + def __init__(self, pip, module): self.CLI = pip + self.module = module def list_installed(self): - global module - rc, out, err = module.run_command([self._cli, 'list', '-l', '--format=json']) + rc, out, err = self.module.run_command([self._cli, 'list', '-l', '--format=json']) if rc != 0: raise Exception("Unable to list packages rc=%s : %s" % (rc, err)) return json.loads(out) @@ -116,7 +117,6 @@ class PIP(CLIMgr): def main(): # start work - global module module = AnsibleModule( argument_spec=dict( clients=dict(type='list', elements='path', default=['pip']), @@ -133,7 +133,7 @@ def main(): module.warn('Skipping invalid pip client: %s' % (pip)) continue try: - pip_mgr = PIP(pip) + pip_mgr = PIP(pip, module) if pip_mgr.is_available(): found += 1 packages[pip] = pip_mgr.get_packages() diff --git a/plugins/modules/packaging/language/pipx.py b/plugins/modules/packaging/language/pipx.py index 0b2276c6f8..a94b7d8d03 100644 --- a/plugins/modules/packaging/language/pipx.py +++ b/plugins/modules/packaging/language/pipx.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2021, Alexei Znamensky -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, 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 @@ -18,11 +19,13 @@ description: options: state: type: str - choices: [present, absent, install, uninstall, uninstall_all, inject, upgrade, upgrade_all, reinstall, reinstall_all] + choices: [present, absent, install, uninstall, uninstall_all, inject, upgrade, upgrade_all, reinstall, reinstall_all, latest] default: install description: - Desired state for the application. - The states C(present) and C(absent) are aliases to C(install) and C(uninstall), respectively. + - The state C(latest) is equivalent to executing the task twice, with state C(install) and then C(upgrade). + It was added in community.general 5.5.0. name: type: str description: @@ -133,29 +136,19 @@ EXAMPLES = ''' import json -from ansible_collections.community.general.plugins.module_utils.module_helper import ( - CmdStateModuleHelper, ArgFormat, ModuleHelperException -) +from ansible_collections.community.general.plugins.module_utils.module_helper import StateModuleHelper +from ansible_collections.community.general.plugins.module_utils.pipx import pipx_runner + from ansible.module_utils.facts.compat import ansible_facts -_state_map = dict( - present='install', - absent='uninstall', - uninstall_all='uninstall-all', - upgrade_all='upgrade-all', - reinstall_all='reinstall-all', -) - - -class PipX(CmdStateModuleHelper): +class PipX(StateModuleHelper): output_params = ['name', 'source', 'index_url', 'force', 'installdeps'] module = dict( argument_spec=dict( state=dict(type='str', default='install', - choices=[ - 'present', 'absent', 'install', 'uninstall', 'uninstall_all', - 'inject', 'upgrade', 'upgrade_all', 'reinstall', 'reinstall_all']), + choices=['present', 'absent', 'install', 'uninstall', 'uninstall_all', + 'inject', 'upgrade', 'upgrade_all', 'reinstall', 'reinstall_all', 'latest']), name=dict(type='str'), source=dict(type='str'), install_deps=dict(type='bool', default=False), @@ -173,27 +166,13 @@ class PipX(CmdStateModuleHelper): ('state', 'install', ['name']), ('state', 'absent', ['name']), ('state', 'uninstall', ['name']), + ('state', 'upgrade', ['name']), + ('state', 'reinstall', ['name']), + ('state', 'latest', ['name']), ('state', 'inject', ['name', 'inject_packages']), ], supports_check_mode=True, ) - command_args_formats = dict( - state=dict(fmt=lambda v: [_state_map.get(v, v)]), - name_source=dict(fmt=lambda n, s: [s] if s else [n], stars=1), - install_deps=dict(fmt="--include-deps", style=ArgFormat.BOOLEAN), - inject_packages=dict(fmt=lambda v: v), - force=dict(fmt="--force", style=ArgFormat.BOOLEAN), - include_injected=dict(fmt="--include-injected", style=ArgFormat.BOOLEAN), - index_url=dict(fmt=('--index-url', '{0}'),), - python=dict(fmt=('--python', '{0}'),), - _list=dict(fmt=('list', '--include-injected', '--json'), style=ArgFormat.BOOLEAN), - editable=dict(fmt="--editable", style=ArgFormat.BOOLEAN), - pip_args=dict(fmt=('--pip-args', '{0}'),), - ) - check_rc = True - run_command_fixed_options = dict( - environ_update={'USE_EMOJI': '0'} - ) def _retrieve_installed(self): def process_list(rc, out, err): @@ -211,8 +190,7 @@ class PipX(CmdStateModuleHelper): } return results - installed = self.run_command(params=[{'_list': True}], process_output=process_list, - publish_rc=False, publish_out=False, publish_err=False, publish_cmd=False) + installed = self.runner('_list', output_process=process_list).run(_list=1) if self.vars.name is not None: app_list = installed.get(self.vars.name) @@ -229,67 +207,91 @@ class PipX(CmdStateModuleHelper): else: facts = ansible_facts(self.module, gather_subset=['python']) self.command = [facts['python']['executable'], '-m', 'pipx'] + self.runner = pipx_runner(self.module, self.command) self.vars.set('application', self._retrieve_installed(), change=True, diff=True) def __quit_module__(self): self.vars.application = self._retrieve_installed() + def _capture_results(self, ctx): + self.vars.stdout = ctx.results_out + self.vars.stderr = ctx.results_err + self.vars.cmd = ctx.cmd + if self.verbosity >= 4: + self.vars.run_info = ctx.run_info + def state_install(self): if not self.vars.application or self.vars.force: self.changed = True - if not self.module.check_mode: - self.run_command(params=[ - 'state', 'index_url', 'install_deps', 'force', 'python', 'editable', 'pip_args', - {'name_source': [self.vars.name, self.vars.source]}]) + with self.runner('state index_url install_deps force python editable pip_args name_source', check_mode_skip=True) as ctx: + ctx.run(name_source=[self.vars.name, self.vars.source]) + self._capture_results(ctx) state_present = state_install def state_upgrade(self): if not self.vars.application: - raise ModuleHelperException( - "Trying to upgrade a non-existent application: {0}".format(self.vars.name)) + self.do_raise("Trying to upgrade a non-existent application: {0}".format(self.vars.name)) if self.vars.force: self.changed = True - if not self.module.check_mode: - self.run_command(params=['state', 'index_url', 'install_deps', 'force', 'editable', 'pip_args', 'name']) + + with self.runner('state index_url install_deps force editable pip_args name', check_mode_skip=True) as ctx: + ctx.run() + self._capture_results(ctx) def state_uninstall(self): - if self.vars.application and not self.module.check_mode: - self.run_command(params=['state', 'name']) + if self.vars.application: + with self.runner('state name', check_mode_skip=True) as ctx: + ctx.run() + self._capture_results(ctx) state_absent = state_uninstall def state_reinstall(self): if not self.vars.application: - raise ModuleHelperException( - "Trying to reinstall a non-existent application: {0}".format(self.vars.name)) + self.do_raise("Trying to reinstall a non-existent application: {0}".format(self.vars.name)) self.changed = True - if not self.module.check_mode: - self.run_command(params=['state', 'name', 'python']) + with self.runner('state name python', check_mode_skip=True) as ctx: + ctx.run() + self._capture_results(ctx) def state_inject(self): if not self.vars.application: - raise ModuleHelperException( - "Trying to inject packages into a non-existent application: {0}".format(self.vars.name)) + self.do_raise("Trying to inject packages into a non-existent application: {0}".format(self.vars.name)) if self.vars.force: self.changed = True - if not self.module.check_mode: - self.run_command(params=['state', 'index_url', 'force', 'editable', 'pip_args', 'name', 'inject_packages']) + with self.runner('state index_url force editable pip_args name inject_packages', check_mode_skip=True) as ctx: + ctx.run() + self._capture_results(ctx) def state_uninstall_all(self): - if not self.module.check_mode: - self.run_command(params=['state']) + with self.runner('state', check_mode_skip=True) as ctx: + ctx.run() + self._capture_results(ctx) def state_reinstall_all(self): - if not self.module.check_mode: - self.run_command(params=['state', 'python']) + with self.runner('state python', check_mode_skip=True) as ctx: + ctx.run() + self._capture_results(ctx) def state_upgrade_all(self): if self.vars.force: self.changed = True - if not self.module.check_mode: - self.run_command(params=['state', 'include_injected', 'force']) + with self.runner('state include_injected force', check_mode_skip=True) as ctx: + ctx.run() + self._capture_results(ctx) + + def state_latest(self): + if not self.vars.application or self.vars.force: + self.changed = True + with self.runner('state index_url install_deps force python editable pip_args name_source', check_mode_skip=True) as ctx: + ctx.run(state='install', name_source=[self.vars.name, self.vars.source]) + self._capture_results(ctx) + + with self.runner('state index_url install_deps force editable pip_args name', check_mode_skip=True) as ctx: + ctx.run(state='upgrade') + self._capture_results(ctx) def main(): diff --git a/plugins/modules/packaging/language/pipx_info.py b/plugins/modules/packaging/language/pipx_info.py new file mode 100644 index 0000000000..05b9db1b2d --- /dev/null +++ b/plugins/modules/packaging/language/pipx_info.py @@ -0,0 +1,205 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, 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 + + +DOCUMENTATION = ''' +--- +module: pipx_info +short_description: Rretrieves information about applications installed with pipx +version_added: 5.6.0 +description: + - Retrieve details about Python applications installed in isolated virtualenvs using pipx. +options: + name: + description: + - Name of an application installed with C(pipx). + type: str + include_deps: + description: + - Include dependent packages in the output. + type: bool + default: false + include_injected: + description: + - Include injected packages in the output. + type: bool + default: false + include_raw: + description: + - Returns the raw output of C(pipx list --json). + - The raw output is not affected by I(include_deps) or I(include_injected). + type: bool + default: false + executable: + description: + - Path to the C(pipx) installed in the system. + - > + If not specified, the module will use C(python -m pipx) to run the tool, + using the same Python interpreter as ansible itself. + type: path +notes: + - This module does not install the C(pipx) python package, however that can be easily done with the module M(ansible.builtin.pip). + - This module does not require C(pipx) to be in the shell C(PATH), but it must be loadable by Python as a module. + - Please note that C(pipx) requires Python 3.6 or above. + - See also the C(pipx) documentation at U(https://pypa.github.io/pipx/). +author: + - "Alexei Znamensky (@russoz)" +''' + +EXAMPLES = ''' +- name: retrieve all installed applications + community.general.pipx_info: {} + +- name: retrieve all installed applications, include dependencies and injected packages + community.general.pipx_info: + include_deps: true + include_injected: true + +- name: retrieve application tox + community.general.pipx_info: + name: tox + include_deps: true + +- name: retrieve application ansible-lint, include dependencies + community.general.pipx_info: + name: ansible-lint + include_deps: true +''' + +RETURN = ''' +application: + description: The list of installed applications + returned: success + type: list + elements: dict + contains: + name: + description: The name of the installed application. + returned: success + type: str + sample: "tox" + version: + description: The version of the installed application. + returned: success + type: str + sample: "3.24.0" + dependencies: + description: The dependencies of the installed application, when I(include_deps=true). + returned: success + type: list + elements: str + sample: ["virtualenv"] + injected: + description: The injected packages for the installed application, when I(include_injected=true). + returned: success + type: dict + sample: + licenses: "0.6.1" + +raw_output: + description: The raw output of the C(pipx list) command, when I(include_raw=true). Used for debugging. + returned: success + type: dict + +cmd: + description: Command executed to obtain the list of installed applications. + returned: success + type: list + elements: str + sample: [ + "/usr/bin/python3.10", + "-m", + "pipx", + "list", + "--include-injected", + "--json" + ] +''' + +import json + +from ansible_collections.community.general.plugins.module_utils.module_helper import ModuleHelper +from ansible_collections.community.general.plugins.module_utils.pipx import pipx_runner + +from ansible.module_utils.facts.compat import ansible_facts + + +class PipXInfo(ModuleHelper): + output_params = ['name'] + module = dict( + argument_spec=dict( + name=dict(type='str'), + include_deps=dict(type='bool', default=False), + include_injected=dict(type='bool', default=False), + include_raw=dict(type='bool', default=False), + executable=dict(type='path'), + ), + supports_check_mode=True, + ) + + def __init_module__(self): + if self.vars.executable: + self.command = [self.vars.executable] + else: + facts = ansible_facts(self.module, gather_subset=['python']) + self.command = [facts['python']['executable'], '-m', 'pipx'] + self.runner = pipx_runner(self.module, self.command) + + # self.vars.set('application', self._retrieve_installed(), change=True, diff=True) + + def __run__(self): + def process_list(rc, out, err): + if not out: + return [] + + results = [] + raw_data = json.loads(out) + if self.vars.include_raw: + self.vars.raw_output = raw_data + + if self.vars.name: + if self.vars.name in raw_data['venvs']: + data = {self.vars.name: raw_data['venvs'][self.vars.name]} + else: + data = {} + else: + data = raw_data['venvs'] + + for venv_name, venv in data.items(): + entry = { + 'name': venv_name, + 'version': venv['metadata']['main_package']['package_version'] + } + if self.vars.include_injected: + entry['injected'] = dict( + (k, v['package_version']) for k, v in venv['metadata']['injected_packages'].items() + ) + if self.vars.include_deps: + entry['dependencies'] = list(venv['metadata']['main_package']['app_paths_of_dependencies']) + results.append(entry) + + return results + + with self.runner('_list', output_process=process_list) as ctx: + self.vars.application = ctx.run(_list=1) + self._capture_results(ctx) + + def _capture_results(self, ctx): + self.vars.cmd = ctx.cmd + if self.verbosity >= 4: + self.vars.run_info = ctx.run_info + + +def main(): + PipXInfo.execute() + + +if __name__ == '__main__': + main() diff --git a/plugins/modules/packaging/language/yarn.py b/plugins/modules/packaging/language/yarn.py index 6ea9db5d26..2e96cb799d 100644 --- a/plugins/modules/packaging/language/yarn.py +++ b/plugins/modules/packaging/language/yarn.py @@ -3,7 +3,8 @@ # (c) 2017 David Gunter # Copyright (c) 2017 Chris Hoffman -# 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 @@ -43,7 +44,7 @@ options: description: - Install the node.js library globally required: false - default: no + default: false type: bool executable: type: path @@ -55,14 +56,14 @@ options: - Use the --ignore-scripts flag when installing. required: false type: bool - default: no + default: false production: description: - Install dependencies in production mode. - Yarn will ignore any dependencies under devDependencies in package.json required: false type: bool - default: no + default: false registry: type: str description: @@ -95,12 +96,12 @@ EXAMPLES = ''' - name: Install "imagemin" node.js package globally. community.general.yarn: name: imagemin - global: yes + global: true - name: Remove the globally-installed package "imagemin". community.general.yarn: name: imagemin - global: yes + global: true state: absent - name: Install "imagemin" node.js package from custom registry. @@ -155,7 +156,6 @@ out: ''' import os -import re import json from ansible.module_utils.basic import AnsibleModule @@ -221,7 +221,7 @@ class Yarn(object): rc, out, err = self.module.run_command(cmd, check_rc=check_rc, cwd=cwd) return out, err - return(None, None) + return None, None def list(self): cmd = ['list', '--depth=0', '--json'] diff --git a/plugins/modules/packaging/os/apk.py b/plugins/modules/packaging/os/apk.py index 74b738de27..831ab60749 100644 --- a/plugins/modules/packaging/os/apk.py +++ b/plugins/modules/packaging/os/apk.py @@ -1,11 +1,12 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2015, Kevin Brebanov +# Copyright (c) 2015, Kevin Brebanov # Based on pacman (Afterburn , Aaron Bull Schaefer ) # and apt (Matthew Williams ) modules. # -# 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 @@ -24,7 +25,7 @@ options: - During upgrade, reset versioned world dependencies and change logic to prefer replacing or downgrading packages (instead of holding them) if the currently installed package is no longer available from any repository. type: bool - default: no + default: false name: description: - A package name, like C(foo), or multiple packages, like C(foo, bar). @@ -34,7 +35,7 @@ options: description: - Do not use any local cache path. type: bool - default: no + default: false version_added: 1.0.0 repository: description: @@ -55,27 +56,33 @@ options: description: - Update repository indexes. Can be run with other steps or on it's own. type: bool - default: no + default: false upgrade: description: - Upgrade all installed packages to their latest version. type: bool - default: no + default: false + world: + description: + - Use a custom world file when checking for explicitly installed packages. + type: str + default: /etc/apk/world + version_added: 5.4.0 notes: - - '"name" and "upgrade" are mutually exclusive.' - - When used with a `loop:` each package will be processed individually, it is much more efficient to pass the list directly to the `name` option. + - 'I(name) and I(upgrade) are mutually exclusive.' + - When used with a C(loop:) each package will be processed individually, it is much more efficient to pass the list directly to the I(name) option. ''' EXAMPLES = ''' - name: Update repositories and install foo package community.general.apk: name: foo - update_cache: yes + update_cache: true - name: Update repositories and install foo and bar packages community.general.apk: name: foo,bar - update_cache: yes + update_cache: true - name: Remove foo package community.general.apk: @@ -101,39 +108,45 @@ EXAMPLES = ''' community.general.apk: name: foo state: latest - update_cache: yes + update_cache: true - name: Update repositories and update packages foo and bar to latest versions community.general.apk: name: foo,bar state: latest - update_cache: yes + update_cache: true - name: Update all installed packages to the latest versions community.general.apk: - upgrade: yes + upgrade: true - name: Upgrade / replace / downgrade / uninstall all installed packages to the latest versions available community.general.apk: - available: yes - upgrade: yes + available: true + upgrade: true - name: Update repositories as a separate step community.general.apk: - update_cache: yes + update_cache: true - name: Install package from a specific repository community.general.apk: name: foo state: latest - update_cache: yes + update_cache: true repository: http://dl-3.alpinelinux.org/alpine/edge/main - name: Install package without using cache community.general.apk: name: foo state: latest - no_cache: yes + no_cache: true + +- name: Install package checking a custom world + community.general.apk: + name: foo + state: latest + world: /etc/apk/world.custom ''' RETURN = ''' @@ -171,11 +184,11 @@ def update_package_db(module, exit): return True -def query_toplevel(module, name): - # /etc/apk/world contains a list of top-level packages separated by ' ' or \n +def query_toplevel(module, name, world): + # world contains a list of top-level packages separated by ' ' or \n # packages may contain repository (@) or version (=<>~) separator characters or start with negation ! regex = re.compile(r'^' + re.escape(name) + r'([@=<>~].+)?$') - with open('/etc/apk/world') as f: + with open(world) as f: content = f.read().split() for p in content: if regex.search(p): @@ -237,7 +250,7 @@ def upgrade_packages(module, available): module.exit_json(changed=True, msg="upgraded packages", stdout=stdout, stderr=stderr, packages=packagelist) -def install_packages(module, names, state): +def install_packages(module, names, state, world): upgrade = False to_install = [] to_upgrade = [] @@ -250,7 +263,7 @@ def install_packages(module, names, state): if state == 'latest' and not query_latest(module, dependency): to_upgrade.append(dependency) else: - if not query_toplevel(module, name): + if not query_toplevel(module, name, world): to_install.append(name) elif state == 'latest' and not query_latest(module, name): to_upgrade.append(name) @@ -313,6 +326,7 @@ def main(): update_cache=dict(default=False, type='bool'), upgrade=dict(default=False, type='bool'), available=dict(default=False, type='bool'), + world=dict(default='/etc/apk/world', type='str'), ), required_one_of=[['name', 'update_cache', 'upgrade']], mutually_exclusive=[['name', 'upgrade']], @@ -348,7 +362,7 @@ def main(): upgrade_packages(module, p['available']) if p['state'] in ['present', 'latest']: - install_packages(module, p['name'], p['state']) + install_packages(module, p['name'], p['state'], p['world']) elif p['state'] == 'absent': remove_packages(module, p['name']) diff --git a/plugins/modules/packaging/os/apt_repo.py b/plugins/modules/packaging/os/apt_repo.py index d196e03be1..2e9c9b109c 100644 --- a/plugins/modules/packaging/os/apt_repo.py +++ b/plugins/modules/packaging/os/apt_repo.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2018, Mikhail Gordeev +# Copyright (c) 2018, Mikhail Gordeev -# 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 @@ -35,12 +36,12 @@ options: - Remove other then added repositories - Used if I(state=present) type: bool - default: no + default: false update: description: - Update the package database after changing repositories. type: bool - default: no + default: false author: - Mikhail Gordeev (@obirvalger) ''' @@ -55,13 +56,13 @@ EXAMPLES = ''' community.general.apt_repo: repo: Sisysphus state: present - remove_others: yes + remove_others: true - name: Add local repository `/space/ALT/Sisyphus` and update package cache community.general.apt_repo: repo: copy:///space/ALT/Sisyphus state: present - update: yes + update: true ''' RETURN = ''' # ''' diff --git a/plugins/modules/packaging/os/apt_rpm.py b/plugins/modules/packaging/os/apt_rpm.py index 95d0f64109..2b6bf3e8a2 100644 --- a/plugins/modules/packaging/os/apt_rpm.py +++ b/plugins/modules/packaging/os/apt_rpm.py @@ -1,11 +1,12 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2013, Evgenii Terechkov +# Copyright (c) 2013, Evgenii Terechkov # Written by Evgenii Terechkov # Based on urpmi module written by Philippe Makowski -# 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 @@ -34,7 +35,7 @@ options: description: - update the package database first C(apt-get update). type: bool - default: no + default: false author: - Evgenii Terechkov (@evgkrsk) ''' @@ -67,13 +68,10 @@ EXAMPLES = ''' community.general.apt_rpm: name: bar state: present - update_cache: yes + update_cache: true ''' -import json import os -import shlex -import sys from ansible.module_utils.basic import AnsibleModule diff --git a/plugins/modules/packaging/os/copr.py b/plugins/modules/packaging/os/copr.py index cb31e8c9fb..68738a6c98 100644 --- a/plugins/modules/packaging/os/copr.py +++ b/plugins/modules/packaging/os/copr.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2020, Silvie Chlupova -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2020, Silvie Chlupova +# 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 @@ -84,6 +85,7 @@ try: import dnf.repodict from dnf.conf import Conf HAS_DNF_PACKAGES = True + DNF_IMP_ERR = None except ImportError: DNF_IMP_ERR = traceback.format_exc() HAS_DNF_PACKAGES = False diff --git a/plugins/modules/packaging/os/dnf_versionlock.py b/plugins/modules/packaging/os/dnf_versionlock.py index fca33fd83c..a0a440b620 100644 --- a/plugins/modules/packaging/os/dnf_versionlock.py +++ b/plugins/modules/packaging/os/dnf_versionlock.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2021, Roberto Moreda -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, Roberto Moreda +# 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/modules/packaging/os/flatpak.py b/plugins/modules/packaging/os/flatpak.py index da913b5ac0..d6264a50d3 100644 --- a/plugins/modules/packaging/os/flatpak.py +++ b/plugins/modules/packaging/os/flatpak.py @@ -1,10 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2017 John Kwiatkoski (@JayKayy) -# Copyright: (c) 2018 Alexander Bethke (@oolongbrothers) -# 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 John Kwiatkoski (@JayKayy) +# Copyright (c) 2018 Alexander Bethke (@oolongbrothers) +# 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 @@ -162,7 +163,7 @@ OUTDATED_FLATPAK_VERSION_ERROR_MESSAGE = "Unknown option --columns=application" def install_flat(module, binary, remote, names, method, no_dependencies): """Add new flatpaks.""" - global result + global result # pylint: disable=global-variable-not-assigned uri_names = [] id_names = [] for name in names: @@ -189,7 +190,7 @@ def install_flat(module, binary, remote, names, method, no_dependencies): def uninstall_flat(module, binary, names, method): """Remove existing flatpaks.""" - global result + global result # pylint: disable=global-variable-not-assigned installed_flat_names = [ _match_installed_flat_name(module, binary, name, method) for name in names @@ -224,7 +225,7 @@ def _match_installed_flat_name(module, binary, name, method): # This is a difficult function, since if the user supplies a flatpakref url, # we have to rely on a naming convention: # The flatpakref file name needs to match the flatpak name - global result + global result # pylint: disable=global-variable-not-assigned parsed_name = _parse_flatpak_name(name) # Try running flatpak list with columns feature command = [binary, "list", "--{0}".format(method), "--app", "--columns=application"] @@ -248,7 +249,7 @@ def _match_installed_flat_name(module, binary, name, method): def _match_flat_using_outdated_flatpak_format(module, binary, parsed_name, method): - global result + global result # pylint: disable=global-variable-not-assigned command = [binary, "list", "--{0}".format(method), "--app", "--columns=application"] output = _flatpak_command(module, False, command) for row in output.split('\n'): @@ -257,7 +258,7 @@ def _match_flat_using_outdated_flatpak_format(module, binary, parsed_name, metho def _match_flat_using_flatpak_column_feature(module, binary, parsed_name, method): - global result + global result # pylint: disable=global-variable-not-assigned command = [binary, "list", "--{0}".format(method), "--app"] output = _flatpak_command(module, False, command) for row in output.split('\n'): @@ -276,7 +277,7 @@ def _parse_flatpak_name(name): def _flatpak_version(module, binary): - global result + global result # pylint: disable=global-variable-not-assigned command = [binary, "--version"] output = _flatpak_command(module, False, command) version_number = output.split()[1] @@ -284,7 +285,7 @@ def _flatpak_version(module, binary): def _flatpak_command(module, noop, command, ignore_failure=False): - global result + global result # pylint: disable=global-variable-not-assigned result['command'] = ' '.join(command) if noop: result['rc'] = 0 diff --git a/plugins/modules/packaging/os/flatpak_remote.py b/plugins/modules/packaging/os/flatpak_remote.py index e0e4170f47..bc52d5461a 100644 --- a/plugins/modules/packaging/os/flatpak_remote.py +++ b/plugins/modules/packaging/os/flatpak_remote.py @@ -1,10 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2017 John Kwiatkoski (@JayKayy) -# Copyright: (c) 2018 Alexander Bethke (@oolongbrothers) -# 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 John Kwiatkoski (@JayKayy) +# Copyright (c) 2018 Alexander Bethke (@oolongbrothers) +# 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 @@ -124,7 +125,7 @@ from ansible.module_utils.common.text.converters import to_bytes, to_native def add_remote(module, binary, name, flatpakrepo_url, method): """Add a new remote.""" - global result + global result # pylint: disable=global-variable-not-assigned command = [binary, "remote-add", "--{0}".format(method), name, flatpakrepo_url] _flatpak_command(module, module.check_mode, command) result['changed'] = True @@ -132,7 +133,7 @@ def add_remote(module, binary, name, flatpakrepo_url, method): def remove_remote(module, binary, name, method): """Remove an existing remote.""" - global result + global result # pylint: disable=global-variable-not-assigned command = [binary, "remote-delete", "--{0}".format(method), "--force", name] _flatpak_command(module, module.check_mode, command) result['changed'] = True @@ -153,7 +154,7 @@ def remote_exists(module, binary, name, method): def _flatpak_command(module, noop, command): - global result + global result # pylint: disable=global-variable-not-assigned result['command'] = ' '.join(command) if noop: result['rc'] = 0 diff --git a/plugins/modules/packaging/os/homebrew.py b/plugins/modules/packaging/os/homebrew.py index db1feda78e..a72d929a81 100644 --- a/plugins/modules/packaging/os/homebrew.py +++ b/plugins/modules/packaging/os/homebrew.py @@ -1,13 +1,14 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2013, Andrew Dunham -# (c) 2013, Daniel Jaouen -# (c) 2015, Indrajit Raychaudhuri +# Copyright (c) 2013, Andrew Dunham +# Copyright (c) 2013, Daniel Jaouen +# Copyright (c) 2015, Indrajit Raychaudhuri # # Based on macports (Jimmy Tang ) # -# 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 @@ -35,10 +36,10 @@ options: elements: str path: description: - - "A ':' separated list of paths to search for 'brew' executable. + - "A C(:) separated list of paths to search for C(brew) executable. Since a package (I(formula) in homebrew parlance) location is prefixed relative to the actual path of I(brew) command, providing an alternative I(brew) path enables managing different set of packages in an alternative location in the system." - default: '/usr/local/bin:/opt/homebrew/bin' + default: '/usr/local/bin:/opt/homebrew/bin:/home/linuxbrew/.linuxbrew/bin' type: path state: description: @@ -50,12 +51,12 @@ options: description: - update homebrew itself first. type: bool - default: no + default: false upgrade_all: description: - upgrade all homebrew packages. type: bool - default: no + default: false aliases: ['upgrade'] install_options: description: @@ -70,8 +71,8 @@ options: elements: str version_added: '0.2.0' notes: - - When used with a `loop:` each package will be processed individually, - it is much more efficient to pass the list directly to the `name` option. + - When used with a C(loop:) each package will be processed individually, + it is much more efficient to pass the list directly to the I(name) option. ''' EXAMPLES = ''' @@ -90,18 +91,18 @@ EXAMPLES = ''' - community.general.homebrew: name: foo state: present - update_homebrew: yes + update_homebrew: true # Update homebrew first and upgrade formula foo to latest available with 'brew' in default path - community.general.homebrew: name: foo state: latest - update_homebrew: yes + update_homebrew: true # Update homebrew and upgrade all packages - community.general.homebrew: - update_homebrew: yes - upgrade_all: yes + update_homebrew: true + upgrade_all: true # Miscellaneous other examples - community.general.homebrew: @@ -132,7 +133,7 @@ EXAMPLES = ''' - name: Use ignore-pinned option while upgrading all community.general.homebrew: - upgrade_all: yes + upgrade_all: true upgrade_options: ignore-pinned ''' @@ -875,7 +876,7 @@ def main(): elements='str', ), path=dict( - default="/usr/local/bin:/opt/homebrew/bin", + default="/usr/local/bin:/opt/homebrew/bin:/home/linuxbrew/.linuxbrew/bin", required=False, type='path', ), diff --git a/plugins/modules/packaging/os/homebrew_cask.py b/plugins/modules/packaging/os/homebrew_cask.py index a43eabb7cb..5937831962 100644 --- a/plugins/modules/packaging/os/homebrew_cask.py +++ b/plugins/modules/packaging/os/homebrew_cask.py @@ -1,10 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2013, Daniel Jaouen -# Copyright: (c) 2016, Indrajit Raychaudhuri +# Copyright (c) 2013, Daniel Jaouen +# Copyright (c) 2016, Indrajit Raychaudhuri # -# 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 @@ -50,7 +51,7 @@ options: - Update homebrew itself first. - Note that C(brew cask update) is a synonym for C(brew update). type: bool - default: no + default: false install_options: description: - Options flags to install a package. @@ -61,13 +62,13 @@ options: description: - Allow external apps. type: bool - default: no + default: false upgrade_all: description: - Upgrade all casks. - Mutually exclusive with C(upgraded) state. type: bool - default: no + default: false aliases: [ 'upgrade' ] greedy: description: @@ -75,7 +76,7 @@ options: - Passes --greedy to brew cask outdated when checking if an installed cask has a newer version available. type: bool - default: no + default: false ''' EXAMPLES = ''' - name: Install cask @@ -110,7 +111,7 @@ EXAMPLES = ''' community.general.homebrew_cask: name: alfred state: present - accept_external_apps: True + accept_external_apps: true - name: Remove cask with force option community.general.homebrew_cask: @@ -132,7 +133,7 @@ EXAMPLES = ''' community.general.homebrew_cask: name: 1password state: upgraded - greedy: True + greedy: true - name: Using sudo password for installing cask community.general.homebrew_cask: diff --git a/plugins/modules/packaging/os/homebrew_tap.py b/plugins/modules/packaging/os/homebrew_tap.py index 6b30fdb68f..0cc5b23ce8 100644 --- a/plugins/modules/packaging/os/homebrew_tap.py +++ b/plugins/modules/packaging/os/homebrew_tap.py @@ -1,12 +1,13 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2013, Daniel Jaouen -# Copyright: (c) 2016, Indrajit Raychaudhuri +# Copyright (c) 2013, Daniel Jaouen +# Copyright (c) 2016, Indrajit Raychaudhuri # # Based on homebrew (Andrew Dunham ) # -# 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 @@ -47,8 +48,8 @@ options: type: str path: description: - - "A ':' separated list of paths to search for C(brew) executable." - default: '/usr/local/bin:/opt/homebrew/bin' + - "A C(:) separated list of paths to search for C(brew) executable." + default: '/usr/local/bin:/opt/homebrew/bin:/home/linuxbrew/.linuxbrew/bin' type: path version_added: '2.1.0' requirements: [ homebrew ] @@ -218,7 +219,7 @@ def main(): url=dict(default=None, required=False), state=dict(default='present', choices=['present', 'absent']), path=dict( - default="/usr/local/bin:/opt/homebrew/bin", + default="/usr/local/bin:/opt/homebrew/bin:/home/linuxbrew/.linuxbrew/bin", required=False, type='path', ), diff --git a/plugins/modules/packaging/os/installp.py b/plugins/modules/packaging/os/installp.py index af7a950afa..f1421bc390 100644 --- a/plugins/modules/packaging/os/installp.py +++ b/plugins/modules/packaging/os/installp.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2017, Kairo Araujo -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017, Kairo Araujo +# 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 @@ -20,7 +21,7 @@ options: description: - Whether to accept the license for the package(s). type: bool - default: no + default: false name: description: - One or more packages to install or remove. @@ -48,28 +49,28 @@ EXAMPLES = r''' community.general.installp: name: foo repository_path: /repository/AIX71/installp/base - accept_license: yes + accept_license: true state: present - name: Install bos.sysmgt that includes bos.sysmgt.nim.master, bos.sysmgt.nim.spot community.general.installp: name: bos.sysmgt repository_path: /repository/AIX71/installp/base - accept_license: yes + accept_license: true state: present - name: Install bos.sysmgt.nim.master only community.general.installp: name: bos.sysmgt.nim.master repository_path: /repository/AIX71/installp/base - accept_license: yes + accept_license: true state: present - name: Install bos.sysmgt.nim.master and bos.sysmgt.nim.spot community.general.installp: name: bos.sysmgt.nim.master, bos.sysmgt.nim.spot repository_path: /repository/AIX71/installp/base - accept_license: yes + accept_license: true state: present - name: Remove packages bos.sysmgt.nim.master diff --git a/plugins/modules/packaging/os/layman.py b/plugins/modules/packaging/os/layman.py index 3c990205d9..b860385969 100644 --- a/plugins/modules/packaging/os/layman.py +++ b/plugins/modules/packaging/os/layman.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2014, Jakub Jirutka +# Copyright (c) 2014, Jakub Jirutka # -# 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 @@ -24,7 +25,7 @@ options: name: description: - The overlay id to install, synchronize, or uninstall. - Use 'ALL' to sync all of the installed overlays (can be used only when C(state=updated)). + Use 'ALL' to sync all of the installed overlays (can be used only when I(state=updated)). required: true type: str list_url: @@ -42,11 +43,11 @@ options: type: str validate_certs: description: - - If C(no), SSL certificates will not be validated. This should only be - set to C(no) when no other option exists. Prior to 1.9.3 the code - defaulted to C(no). + - If C(false), SSL certificates will not be validated. This should only be + set to C(false) when no other option exists. Prior to 1.9.3 the code + defaulted to C(false). type: bool - default: yes + default: true ''' EXAMPLES = ''' diff --git a/plugins/modules/packaging/os/macports.py b/plugins/modules/packaging/os/macports.py index 1d3f47a240..398a5552e0 100644 --- a/plugins/modules/packaging/os/macports.py +++ b/plugins/modules/packaging/os/macports.py @@ -1,11 +1,12 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2013, Jimmy Tang +# Copyright (c) 2013, Jimmy Tang # Based on okpg (Patrick Pelletier ), pacman # (Afterburn) and pkgin (Shaun Zinck) modules # -# 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 @@ -30,7 +31,7 @@ options: - Update Macports and the ports tree, either prior to installing ports or as a separate step. - Equivalent to running C(port selfupdate). aliases: ['update_cache', 'update_ports'] - default: "no" + default: false type: bool state: description: @@ -42,7 +43,7 @@ options: description: - Upgrade all outdated ports, either prior to installing ports or as a separate step. - Equivalent to running C(port upgrade outdated). - default: "no" + default: false type: bool variant: description: @@ -71,13 +72,13 @@ EXAMPLES = ''' - name: Update Macports and the ports tree, then upgrade all outdated ports community.general.macports: - selfupdate: yes - upgrade: yes + selfupdate: true + upgrade: true - name: Update Macports and the ports tree, then install the foo port community.general.macports: name: foo - selfupdate: yes + selfupdate: true - name: Remove the foo port community.general.macports: diff --git a/plugins/modules/packaging/os/mas.py b/plugins/modules/packaging/os/mas.py index 0afd858add..49faa53d9d 100644 --- a/plugins/modules/packaging/os/mas.py +++ b/plugins/modules/packaging/os/mas.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2020, Lukas Bestle -# Copyright: (c) 2017, Michael Heap -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2020, Lukas Bestle +# Copyright (c) 2017, Michael Heap +# 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 @@ -39,7 +40,7 @@ options: description: - Upgrade all installed Mac App Store apps. type: bool - default: "no" + default: false aliases: ["upgrade"] requirements: - macOS 10.11+ @@ -76,7 +77,7 @@ EXAMPLES = ''' - name: Upgrade all installed Mac App Store apps community.general.mas: - upgrade_all: yes + upgrade_all: true - name: Install specific apps and also upgrade all others community.general.mas: @@ -84,13 +85,13 @@ EXAMPLES = ''' - 409183694 # Keynote - 413857545 # Divvy state: present - upgrade_all: yes + upgrade_all: true - name: Uninstall Divvy community.general.mas: id: 413857545 state: absent - become: yes # Uninstallation requires root permissions + become: true # Uninstallation requires root permissions ''' RETURN = r''' # ''' @@ -273,7 +274,7 @@ def main(): if mas.is_installed(app): # Ensure we are root if os.getuid() != 0: - module.fail_json(msg="Uninstalling apps requires root permissions ('become: yes')") + module.fail_json(msg="Uninstalling apps requires root permissions ('become: true')") mas.app_command('uninstall', app) diff --git a/plugins/modules/packaging/os/openbsd_pkg.py b/plugins/modules/packaging/os/openbsd_pkg.py index 6943569f8d..f99c5a24d0 100644 --- a/plugins/modules/packaging/os/openbsd_pkg.py +++ b/plugins/modules/packaging/os/openbsd_pkg.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2013, Patrik Lundin +# Copyright (c) 2013, Patrik Lundin # -# 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 @@ -23,7 +24,7 @@ options: name: description: - A name or a list of names of the packages. - required: yes + required: true type: list elements: str state: @@ -42,13 +43,13 @@ options: not already installed. - Mutually exclusive with I(snapshot). type: bool - default: no + default: false snapshot: description: - Force C(%c) and C(%m) to expand to C(snapshots), even on a release kernel. - Mutually exclusive with I(build). type: bool - default: no + default: false version_added: 1.3.0 ports_dir: description: @@ -62,16 +63,16 @@ options: file(s) in the old packages which are annotated with @extra in the packaging-list. type: bool - default: no + default: false quick: description: - Replace or delete packages quickly; do not bother with checksums before removing normal files. type: bool - default: no + default: false notes: - - When used with a `loop:` each package will be processed individually, - it is much more efficient to pass the list directly to the `name` option. + - When used with a C(loop:) each package will be processed individually, + it is much more efficient to pass the list directly to the I(name) option. ''' EXAMPLES = ''' @@ -94,7 +95,7 @@ EXAMPLES = ''' community.general.openbsd_pkg: name: nmap state: present - build: yes + build: true - name: Specify a pkg flavour with '--' community.general.openbsd_pkg: @@ -119,13 +120,13 @@ EXAMPLES = ''' - name: Purge a package and it's configuration files community.general.openbsd_pkg: name: mpd - clean: yes + clean: true state: absent - name: Quickly remove a package without checking checksums community.general.openbsd_pkg: name: qt5 - quick: yes + quick: true state: absent ''' diff --git a/plugins/modules/packaging/os/opkg.py b/plugins/modules/packaging/os/opkg.py index f7bc9ae842..f7f3e6ab27 100644 --- a/plugins/modules/packaging/os/opkg.py +++ b/plugins/modules/packaging/os/opkg.py @@ -1,10 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2013, Patrick Pelletier +# Copyright (c) 2013, Patrick Pelletier # Based on pacman (Afterburn) and pkgin (Shaun Zinck) modules # -# 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 @@ -66,7 +67,7 @@ EXAMPLES = ''' community.general.opkg: name: foo state: present - update_cache: yes + update_cache: true - name: Remove foo community.general.opkg: diff --git a/plugins/modules/packaging/os/pacman.py b/plugins/modules/packaging/os/pacman.py index a3e0b2f589..c8d6caebe5 100644 --- a/plugins/modules/packaging/os/pacman.py +++ b/plugins/modules/packaging/os/pacman.py @@ -1,11 +1,12 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2012, Afterburn -# Copyright: (c) 2013, Aaron Bull Schaefer -# Copyright: (c) 2015, Indrajit Raychaudhuri -# Copyright: (c) 2022, Jean Raby -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2012, Afterburn +# Copyright (c) 2013, Aaron Bull Schaefer +# Copyright (c) 2015, Indrajit Raychaudhuri +# Copyright (c) 2022, Jean Raby +# 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 @@ -44,10 +45,10 @@ options: force: description: - When removing packages, forcefully remove them, without any checks. - Same as C(extra_args="--nodeps --nodeps"). + Same as I(extra_args="--nodeps --nodeps"). When combined with I(update_cache), force a refresh of all package databases. - Same as C(update_cache_extra_args="--refresh --refresh"). - default: no + Same as I(update_cache_extra_args="--refresh --refresh"). + default: false type: bool remove_nosave: @@ -55,7 +56,7 @@ options: - When removing packages, do not save modified configuration files as C(.pacsave) files. (passes C(--nosave) to pacman) version_added: 4.6.0 - default: no + default: false type: bool executable: @@ -104,6 +105,22 @@ options: default: type: str + reason: + description: + - The install reason to set for the packages. + choices: [ dependency, explicit ] + type: str + version_added: 5.4.0 + + reason_for: + description: + - Set the install reason for C(all) packages or only for C(new) packages. + - In case of I(state=latest) already installed packages which will be updated to a newer version are not counted as C(new). + default: new + choices: [ all, new ] + type: str + version_added: 5.4.0 + notes: - When used with a C(loop:) each package will be processed individually, it is much more efficient to pass the list directly to the I(name) option. @@ -181,7 +198,7 @@ EXAMPLES = """ community.general.pacman: name: foo state: latest - update_cache: yes + update_cache: true - name: Remove packages foo and bar community.general.pacman: @@ -198,11 +215,11 @@ EXAMPLES = """ - name: Run the equivalent of "pacman -Sy" as a separate step community.general.pacman: - update_cache: yes + update_cache: true - name: Run the equivalent of "pacman -Su" as a separate step community.general.pacman: - upgrade: yes + upgrade: true - name: Run the equivalent of "pacman -Syu" as a separate step # Since community.general 5.0.0 the 'changed' state of this call @@ -215,14 +232,28 @@ EXAMPLES = """ # register: result # changed_when: result.packages | length > 0 community.general.pacman: - update_cache: yes - upgrade: yes + update_cache: true + upgrade: true - name: Run the equivalent of "pacman -Rdd", force remove package baz community.general.pacman: name: baz state: absent - force: yes + force: true + +- name: Install foo as dependency and leave reason untouched if already installed + community.general.pacman: + name: foo + state: present + reason: dependency + reason_for: new + +- name: Run the equivalent of "pacman -S --asexplicit", mark foo as explicit and install it if not present + community.general.pacman: + name: foo + state: present + reason: explicit + reason_for: all """ import shlex @@ -331,7 +362,14 @@ class Pacman(object): def install_packages(self, pkgs): pkgs_to_install = [] pkgs_to_install_from_url = [] + pkgs_to_set_reason = [] for p in pkgs: + if self.m.params["reason"] and ( + p.name not in self.inventory["pkg_reasons"] + or self.m.params["reason_for"] == "all" + and self.inventory["pkg_reasons"][p.name] != self.m.params["reason"] + ): + pkgs_to_set_reason.append(p.name) if p.source_is_URL: # URL packages bypass the latest / upgradable_pkgs test # They go through the dry-run to let pacman decide if they will be installed @@ -344,7 +382,7 @@ class Pacman(object): ): pkgs_to_install.append(p) - if len(pkgs_to_install) == 0 and len(pkgs_to_install_from_url) == 0: + if len(pkgs_to_install) == 0 and len(pkgs_to_install_from_url) == 0 and len(pkgs_to_set_reason) == 0: self.exit_params["packages"] = [] self.add_exit_infos("package(s) already installed") return @@ -377,8 +415,13 @@ class Pacman(object): continue name, version = p.split() if name in self.inventory["installed_pkgs"]: - before.append("%s-%s" % (name, self.inventory["installed_pkgs"][name])) - after.append("%s-%s" % (name, version)) + before.append("%s-%s-%s" % (name, self.inventory["installed_pkgs"][name], self.inventory["pkg_reasons"][name])) + if name in pkgs_to_set_reason: + after.append("%s-%s-%s" % (name, version, self.m.params["reason"])) + elif name in self.inventory["pkg_reasons"]: + after.append("%s-%s-%s" % (name, version, self.inventory["pkg_reasons"][name])) + else: + after.append("%s-%s" % (name, version)) to_be_installed.append(name) return (to_be_installed, before, after) @@ -398,7 +441,7 @@ class Pacman(object): before.extend(b) after.extend(a) - if len(installed_pkgs) == 0: + if len(installed_pkgs) == 0 and len(pkgs_to_set_reason) == 0: # This can happen with URL packages if pacman decides there's nothing to do self.exit_params["packages"] = [] self.add_exit_infos("package(s) already installed") @@ -411,9 +454,11 @@ class Pacman(object): "after": "\n".join(sorted(after)) + "\n" if after else "", } + changed_reason_pkgs = [p for p in pkgs_to_set_reason if p not in installed_pkgs] + if self.m.check_mode: - self.add_exit_infos("Would have installed %d packages" % len(installed_pkgs)) - self.exit_params["packages"] = sorted(installed_pkgs) + self.add_exit_infos("Would have installed %d packages" % (len(installed_pkgs) + len(changed_reason_pkgs))) + self.exit_params["packages"] = sorted(installed_pkgs + changed_reason_pkgs) return # actually do it @@ -430,8 +475,22 @@ class Pacman(object): if pkgs_to_install_from_url: _install_packages_for_real("--upgrade", pkgs_to_install_from_url) - self.exit_params["packages"] = installed_pkgs - self.add_exit_infos("Installed %d package(s)" % len(installed_pkgs)) + # set reason + if pkgs_to_set_reason: + cmd = [self.pacman_path, "--noconfirm", "--database"] + if self.m.params["reason"] == "dependency": + cmd.append("--asdeps") + else: + cmd.append("--asexplicit") + cmd.extend(pkgs_to_set_reason) + + rc, stdout, stderr = self.m.run_command(cmd, check_rc=False) + if rc != 0: + self.fail("Failed to install package(s)", cmd=cmd, stdout=stdout, stderr=stderr) + self.add_exit_infos(stdout=stdout, stderr=stderr) + + self.exit_params["packages"] = sorted(installed_pkgs + changed_reason_pkgs) + self.add_exit_infos("Installed %d package(s)" % (len(installed_pkgs) + len(changed_reason_pkgs))) def remove_packages(self, pkgs): # filter out pkgs that are already absent @@ -613,8 +672,9 @@ class Pacman(object): stderr=stderr, rc=rc, ) - # With Pacman v6.0.1 - libalpm v13.0.1, --upgrade outputs "loading packages..." on stdout. strip that - stdout = stdout.replace("loading packages...\n", "") + # With Pacman v6.0.1 - libalpm v13.0.1, --upgrade outputs " filename_without_extension downloading..." if the URL is unseen. + # In all cases, pacman outputs "loading packages..." on stdout. strip both + stdout = stdout.splitlines()[-1] is_URL = True pkg_name = stdout.strip() pkg_list.append(Package(name=pkg_name, source=pkg, source_is_URL=is_URL)) @@ -630,6 +690,7 @@ class Pacman(object): "available_pkgs": {pkgname: version}, "available_groups": {groupname: set(pkgnames)}, "upgradable_pkgs": {pkgname: (current_version,latest_version)}, + "pkg_reasons": {pkgname: reason}, } Fails the module if a package requested for install cannot be found @@ -722,12 +783,31 @@ class Pacman(object): rc=rc, ) + pkg_reasons = {} + dummy, stdout, dummy = self.m.run_command([self.pacman_path, "--query", "--explicit"], check_rc=True) + # Format of a line: "pacman 6.0.1-2" + for l in stdout.splitlines(): + l = l.strip() + if not l: + continue + pkg = l.split()[0] + pkg_reasons[pkg] = "explicit" + dummy, stdout, dummy = self.m.run_command([self.pacman_path, "--query", "--deps"], check_rc=True) + # Format of a line: "pacman 6.0.1-2" + for l in stdout.splitlines(): + l = l.strip() + if not l: + continue + pkg = l.split()[0] + pkg_reasons[pkg] = "dependency" + return dict( installed_pkgs=installed_pkgs, installed_groups=installed_groups, available_pkgs=available_pkgs, available_groups=available_groups, upgradable_pkgs=upgradable_pkgs, + pkg_reasons=pkg_reasons, ) @@ -748,6 +828,8 @@ def setup_module(): upgrade_extra_args=dict(type="str", default=""), update_cache=dict(type="bool"), update_cache_extra_args=dict(type="str", default=""), + reason=dict(type="str", choices=["explicit", "dependency"]), + reason_for=dict(type="str", default="new", choices=["new", "all"]), ), required_one_of=[["name", "update_cache", "upgrade"]], mutually_exclusive=[["name", "upgrade"]], diff --git a/plugins/modules/packaging/os/pacman_key.py b/plugins/modules/packaging/os/pacman_key.py index a40575b697..7fa173ac3b 100644 --- a/plugins/modules/packaging/os/pacman_key.py +++ b/plugins/modules/packaging/os/pacman_key.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2019, George Rawlinson -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, George Rawlinson +# 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/modules/packaging/os/pkg5.py b/plugins/modules/packaging/os/pkg5.py index 266c073f37..f8f6be24b9 100644 --- a/plugins/modules/packaging/os/pkg5.py +++ b/plugins/modules/packaging/os/pkg5.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2014, Peter Oliver -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2014, Peter Oliver +# 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 @@ -35,7 +36,7 @@ options: description: - Accept any licences. type: bool - default: no + default: false aliases: [ accept, accept_licences ] be_name: description: @@ -45,7 +46,7 @@ options: description: - Refresh publishers before execution. type: bool - default: yes + default: true ''' EXAMPLES = ''' - name: Install Vim @@ -55,7 +56,7 @@ EXAMPLES = ''' - name: Install Vim without refreshing publishers community.general.pkg5: name: editor/vim - refresh: no + refresh: false - name: Remove finger daemon community.general.pkg5: diff --git a/plugins/modules/packaging/os/pkg5_publisher.py b/plugins/modules/packaging/os/pkg5_publisher.py index 95d577655f..3ccf3d8ca1 100644 --- a/plugins/modules/packaging/os/pkg5_publisher.py +++ b/plugins/modules/packaging/os/pkg5_publisher.py @@ -3,7 +3,8 @@ # Copyright 2014 Peter Oliver # -# 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/modules/packaging/os/pkgin.py b/plugins/modules/packaging/os/pkgin.py index dc7204e60d..477460e0e3 100644 --- a/plugins/modules/packaging/os/pkgin.py +++ b/plugins/modules/packaging/os/pkgin.py @@ -9,7 +9,8 @@ # Based on pacman module written by Afterburn # that was based on apt module written by Matthew Williams # -# 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 @@ -48,27 +49,27 @@ options: description: - Update repository database. Can be run with other steps or on it's own. type: bool - default: no + default: false upgrade: description: - Upgrade main packages to their newer versions type: bool - default: no + default: false full_upgrade: description: - Upgrade all packages to their newer versions type: bool - default: no + default: false clean: description: - Clean packages cache type: bool - default: no + default: false force: description: - Force package reinstall type: bool - default: no + default: false ''' EXAMPLES = ''' @@ -85,7 +86,7 @@ EXAMPLES = ''' - name: Update cache and install foo package community.general.pkgin: name: foo - update_cache: yes + update_cache: true - name: Remove package foo community.general.pkgin: @@ -99,24 +100,24 @@ EXAMPLES = ''' - name: Update repositories as a separate step community.general.pkgin: - update_cache: yes + update_cache: true - name: Upgrade main packages (equivalent to pkgin upgrade) community.general.pkgin: - upgrade: yes + upgrade: true - name: Upgrade all packages (equivalent to pkgin full-upgrade) community.general.pkgin: - full_upgrade: yes + full_upgrade: true - name: Force-upgrade all packages (equivalent to pkgin -F full-upgrade) community.general.pkgin: - full_upgrade: yes - force: yes + full_upgrade: true + force: true - name: Clean packages cache (equivalent to pkgin clean) community.general.pkgin: - clean: yes + clean: true ''' diff --git a/plugins/modules/packaging/os/pkgng.py b/plugins/modules/packaging/os/pkgng.py index ff7e45fa96..5f4a2a5f27 100644 --- a/plugins/modules/packaging/os/pkgng.py +++ b/plugins/modules/packaging/os/pkgng.py @@ -1,13 +1,14 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2013, bleader +# Copyright (c) 2013, bleader # Written by bleader # Based on pkgin module written by Shaun Zinck # that was based on pacman module written by Afterburn # that was based on apt module written by Matthew Williams # -# 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 @@ -23,10 +24,10 @@ options: name: description: - Name or list of names of packages to install/remove. - - "With I(name=*), I(state: latest) will operate, but I(state: present) and I(state: absent) will be noops." + - "With I(name=*), I(state=latest) will operate, but I(state=present) and I(state=absent) will be noops." - > Warning: In Ansible 2.9 and earlier this module had a misfeature - where I(name=*) with I(state: latest) or I(state: present) would + where I(name=*) with I(state=latest) or I(state=present) would install every package from every package repository, filling up the machines disk. Avoid using them unless you are certain that your role will only be used with newer versions. @@ -47,7 +48,7 @@ options: - Use local package base instead of fetching an updated one. type: bool required: false - default: no + default: false annotation: description: - A list of keyvalue-pairs of the form @@ -90,20 +91,20 @@ options: - Remove automatically installed packages which are no longer needed. required: false type: bool - default: no + default: false ignore_osver: description: - Ignore FreeBSD OS version check, useful on -STABLE and -CURRENT branches. - Defines the C(IGNORE_OSVERSION) environment variable. required: false type: bool - default: no + default: false version_added: 1.3.0 author: "bleader (@bleader)" notes: - When using pkgsite, be careful that already in cache packages won't be downloaded again. - - When used with a `loop:` each package will be processed individually, - it is much more efficient to pass the list directly to the `name` option. + - When used with a C(loop:) each package will be processed individually, + it is much more efficient to pass the list directly to the I(name) option. ''' EXAMPLES = ''' diff --git a/plugins/modules/packaging/os/pkgutil.py b/plugins/modules/packaging/os/pkgutil.py index 0f1daca4ef..d15c9d2726 100644 --- a/plugins/modules/packaging/os/pkgutil.py +++ b/plugins/modules/packaging/os/pkgutil.py @@ -1,11 +1,12 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2013, Alexander Winkler +# Copyright (c) 2013, Alexander Winkler # based on svr4pkg by # Boyd Adamson (2012) # -# 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 @@ -26,7 +27,7 @@ options: name: description: - The name of the package. - - When using C(state=latest), this can be C('*'), which updates all installed packages managed by pkgutil. + - When using I(state=latest), this can be C('*'), which updates all installed packages managed by pkgutil. type: list required: true elements: str @@ -46,12 +47,12 @@ options: choices: [ absent, installed, latest, present, removed ] update_catalog: description: - - If you always want to refresh your catalog from the mirror, even when it's not stale, set this to C(yes). + - If you always want to refresh your catalog from the mirror, even when it's not stale, set this to C(true). type: bool - default: no + default: false force: description: - - To allow the update process to downgrade packages to match what is present in the repository, set this to C(yes). + - To allow the update process to downgrade packages to match what is present in the repository, set this to C(true). - This is useful for rolling back to stable from testing, or similar operations. type: bool default: false @@ -93,7 +94,7 @@ EXAMPLES = r''' community.general.pkgutil: name: '*' state: latest - force: yes + force: true ''' RETURN = r''' # ''' diff --git a/plugins/modules/packaging/os/portage.py b/plugins/modules/packaging/os/portage.py index 2a8679dbbd..22f258cf1a 100644 --- a/plugins/modules/packaging/os/portage.py +++ b/plugins/modules/packaging/os/portage.py @@ -1,13 +1,14 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2016, William L Thomson Jr -# (c) 2013, Yap Sok Ann +# Copyright (c) 2016, William L Thomson Jr +# Copyright (c) 2013, Yap Sok Ann # Written by Yap Sok Ann # Modified by William L. Thomson Jr. # Based on apt module written by Matthew Williams # -# 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 @@ -39,19 +40,19 @@ options: description: - Update packages to the best version available (--update) type: bool - default: no + default: false deep: description: - Consider the entire dependency tree of packages (--deep) type: bool - default: no + default: false newuse: description: - Include installed packages where USE flags have changed (--newuse) type: bool - default: no + default: false changed_use: description: @@ -59,31 +60,31 @@ options: - flags that the user has not enabled are added or removed - (--changed-use) type: bool - default: no + default: false oneshot: description: - Do not add the packages to the world file (--oneshot) type: bool - default: no + default: false noreplace: description: - Do not re-emerge installed packages (--noreplace) type: bool - default: yes + default: true nodeps: description: - Only merge packages but not their dependencies (--nodeps) type: bool - default: no + default: false onlydeps: description: - Only merge packages' dependencies but not the packages (--onlydeps) type: bool - default: no + default: false depclean: description: @@ -91,25 +92,25 @@ options: - If no package is specified, clean up the world's dependencies - Otherwise, --depclean serves as a dependency aware version of --unmerge type: bool - default: no + default: false quiet: description: - Run emerge in quiet mode (--quiet) type: bool - default: no + default: false verbose: description: - Run emerge in verbose mode (--verbose) type: bool - default: no + default: false sync: description: - Sync package repositories first - - If yes, perform "emerge --sync" - - If web, perform "emerge-webrsync" + - If C(yes), perform "emerge --sync" + - If C(web), perform "emerge-webrsync" choices: [ "web", "yes", "no" ] type: str @@ -117,32 +118,32 @@ options: description: - Merge only packages specified at C(PORTAGE_BINHOST) in C(make.conf). type: bool - default: no + default: false version_added: 1.3.0 getbinpkg: description: - Prefer packages specified at C(PORTAGE_BINHOST) in C(make.conf). type: bool - default: no + default: false usepkgonly: description: - Merge only binaries (no compiling). type: bool - default: no + default: false usepkg: description: - Tries to use the binary package(s) in the locally available packages directory. type: bool - default: no + default: false keepgoing: description: - Continue as much as possible after an error. type: bool - default: no + default: false jobs: description: @@ -164,7 +165,7 @@ options: - Redirect all build output to logs alone, and do not display it - on stdout (--quiet-build) type: bool - default: no + default: false quietfail: description: @@ -172,7 +173,7 @@ options: - Only the die message and the path of the build log will be - displayed on stdout. type: bool - default: no + default: false requirements: [ gentoolkit ] author: @@ -195,34 +196,34 @@ EXAMPLES = ''' - name: Update package foo to the latest version (os specific alternative to latest) community.general.portage: package: foo - update: yes + update: true - name: Install package foo using PORTAGE_BINHOST setup community.general.portage: package: foo - getbinpkg: yes + getbinpkg: true - name: Re-install world from binary packages only and do not allow any compiling community.general.portage: package: '@world' - usepkgonly: yes + usepkgonly: true - name: Sync repositories and update world community.general.portage: package: '@world' - update: yes - deep: yes - sync: yes + update: true + deep: true + sync: true - name: Remove unneeded packages community.general.portage: - depclean: yes + depclean: true - name: Remove package foo if it is not explicitly needed community.general.portage: package: foo state: absent - depclean: yes + depclean: true ''' import os diff --git a/plugins/modules/packaging/os/portinstall.py b/plugins/modules/packaging/os/portinstall.py index d1c33cc5c8..d044756d9e 100644 --- a/plugins/modules/packaging/os/portinstall.py +++ b/plugins/modules/packaging/os/portinstall.py @@ -1,11 +1,12 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2013, berenddeboer +# Copyright (c) 2013, berenddeboer # Written by berenddeboer # Based on pkgng module written by bleader # -# 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 @@ -36,7 +37,7 @@ options: - use packages instead of ports whenever available type: bool required: false - default: yes + default: true author: "berenddeboer (@berenddeboer)" ''' @@ -57,9 +58,7 @@ EXAMPLES = ''' state: absent ''' -import os import re -import sys from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.six.moves import shlex_quote diff --git a/plugins/modules/packaging/os/pulp_repo.py b/plugins/modules/packaging/os/pulp_repo.py index d14d84451b..030d2fd9af 100644 --- a/plugins/modules/packaging/os/pulp_repo.py +++ b/plugins/modules/packaging/os/pulp_repo.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2016, Joe Adams <@sysadmind> +# Copyright (c) 2016, Joe Adams <@sysadmind> # -# 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 @@ -22,7 +23,7 @@ options: description: - Whether or not to add the export distributor to new C(rpm) repositories. type: bool - default: no + default: false feed: description: - Upstream feed URL to receive updates from. @@ -35,14 +36,14 @@ options: properly send a 401, logins will fail. This option forces the sending of the Basic authentication header upon initial request. type: bool - default: no + default: false generate_sqlite: description: - Boolean flag to indicate whether sqlite files should be generated during a repository publish. required: false type: bool - default: no + default: false feed_ca_cert: description: - CA certificate string used to validate the feed source SSL certificate. @@ -119,20 +120,20 @@ options: repoview: description: - Whether to generate repoview files for a published repository. Setting - this to "yes" automatically activates `generate_sqlite`. + this to C(true) automatically activates C(generate_sqlite). required: false type: bool - default: no + default: false serve_http: description: - Make the repo available over HTTP. type: bool - default: no + default: false serve_https: description: - Make the repo available over HTTPS. type: bool - default: yes + default: true state: description: - The repo state. A state of C(sync) will queue a sync of the repo. @@ -151,15 +152,15 @@ options: - The username for use in HTTP basic authentication to the pulp API. validate_certs: description: - - If C(no), SSL certificates will not be validated. This should only be + - If C(false), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. type: bool - default: yes + default: true wait_for_completion: description: - Wait for asynchronous tasks to complete before returning. type: bool - default: no + default: false notes: - This module can currently only create distributors and importers on rpm repositories. Contributions to support other repo types are welcome. @@ -182,7 +183,7 @@ EXAMPLES = ''' relative_url: centos/6/updates url_username: admin url_password: admin - force_basic_auth: yes + force_basic_auth: true state: present - name: Remove a repo from the pulp server diff --git a/plugins/modules/packaging/os/redhat_subscription.py b/plugins/modules/packaging/os/redhat_subscription.py index 7bb540b3f1..da156c22ba 100644 --- a/plugins/modules/packaging/os/redhat_subscription.py +++ b/plugins/modules/packaging/os/redhat_subscription.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# James Laska (jlaska@redhat.com) +# Copyright (c) James Laska (jlaska@redhat.com) # -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# GNU General Public License v3.0+ (see 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 @@ -137,7 +138,7 @@ options: description: - Register the system even if it is already registered type: bool - default: no + default: false release: description: - Set a release version @@ -172,7 +173,7 @@ options: RHSM server immediately. When this option is false, then syspurpose attributes will be synchronized with RHSM server by rhsmcertd daemon. type: bool - default: no + default: false ''' EXAMPLES = ''' @@ -468,7 +469,7 @@ class Rhsm(RegistrationBase): items = ["--all"] if items: - args = [SUBMAN_CMD, 'unsubscribe'] + items + args = [SUBMAN_CMD, 'remove'] + items rc, stderr, stdout = self.module.run_command(args, check_rc=True) return serials diff --git a/plugins/modules/packaging/os/rhn_channel.py b/plugins/modules/packaging/os/rhn_channel.py index e3a1ae3098..02fc30dad0 100644 --- a/plugins/modules/packaging/os/rhn_channel.py +++ b/plugins/modules/packaging/os/rhn_channel.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) Vincent Van de Kussen -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) Vincent Van de Kussen +# 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/modules/packaging/os/rhn_register.py b/plugins/modules/packaging/os/rhn_register.py index 08e9a99e9a..ba58c3345f 100644 --- a/plugins/modules/packaging/os/rhn_register.py +++ b/plugins/modules/packaging/os/rhn_register.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) James Laska -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) James Laska +# 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 @@ -53,7 +54,7 @@ options: description: - Force registration, even if system is already registered. type: bool - default: no + default: false version_added: 2.0.0 ca_cert: description: @@ -72,14 +73,14 @@ options: default: [] enable_eus: description: - - If C(no), extended update support will be requested. + - If C(false), extended update support will be requested. type: bool - default: no + default: false nopackages: description: - - If C(yes), the registered node will not upload its installed packages information to Satellite server. + - If C(true), the registered node will not upload its installed packages information to Satellite server. type: bool - default: no + default: false ''' EXAMPLES = r''' @@ -99,7 +100,7 @@ EXAMPLES = r''' community.general.rhn_register: state: present activationkey: 1-222333444 - enable_eus: yes + enable_eus: true - name: Register with activationkey and set a profilename which may differ from the hostname community.general.rhn_register: @@ -127,7 +128,7 @@ EXAMPLES = r''' username: joe_user password: somepass server_url: https://xmlrpc.my.satellite/XMLRPC - force: yes + force: true ''' RETURN = r''' diff --git a/plugins/modules/packaging/os/rhsm_release.py b/plugins/modules/packaging/os/rhsm_release.py index 4b76cee274..698e64f995 100644 --- a/plugins/modules/packaging/os/rhsm_release.py +++ b/plugins/modules/packaging/os/rhsm_release.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2018, Sean Myers -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2018, Sean Myers +# 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/modules/packaging/os/rhsm_repository.py b/plugins/modules/packaging/os/rhsm_repository.py index b103ea621a..2ff0cd4c96 100644 --- a/plugins/modules/packaging/os/rhsm_repository.py +++ b/plugins/modules/packaging/os/rhsm_repository.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2017, Giovanni Sciortino (@giovannisciortino) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017, Giovanni Sciortino (@giovannisciortino) +# 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 @@ -34,7 +35,7 @@ options: - The ID of repositories to enable. - To operate on several repositories this can accept a comma separated list or a YAML list. - required: True + required: true type: list elements: str purge: @@ -43,7 +44,7 @@ options: Only set this to C(True) if passing in a list of repositories to the C(name) field. Using this with C(loop) will most likely not have the desired result. type: bool - default: no + default: false ''' EXAMPLES = ''' @@ -64,7 +65,7 @@ EXAMPLES = ''' - name: Disable all repositories except rhel-7-server-rpms community.general.rhsm_repository: name: rhel-7-server-rpms - purge: True + purge: true ''' RETURN = ''' diff --git a/plugins/modules/packaging/os/rpm_ostree_pkg.py b/plugins/modules/packaging/os/rpm_ostree_pkg.py index 38e2486ddc..5f7632b1e1 100644 --- a/plugins/modules/packaging/os/rpm_ostree_pkg.py +++ b/plugins/modules/packaging/os/rpm_ostree_pkg.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2018, Dusty Mabe -# Copyright: (c) 2018, Ansible Project -# Copyright: (c) 2021, Abhijeet Kasurde -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2018, Dusty Mabe +# Copyright (c) 2018, Ansible Project +# Copyright (c) 2021, Abhijeet Kasurde +# 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 @@ -61,7 +62,7 @@ changed: description: State changes. returned: always type: bool - sample: True + sample: true action: description: Action performed. returned: always diff --git a/plugins/modules/packaging/os/slackpkg.py b/plugins/modules/packaging/os/slackpkg.py index e98f9a338d..1a6cdf7705 100644 --- a/plugins/modules/packaging/os/slackpkg.py +++ b/plugins/modules/packaging/os/slackpkg.py @@ -1,14 +1,15 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2014, Kim Nørgaard +# Copyright (c) 2014, Kim Nørgaard # Written by Kim Nørgaard # Based on pkgng module written by bleader # that was based on pkgin module written by Shaun Zinck # that was based on pacman module written by Afterburn # that was based on apt module written by Matthew Williams # -# 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/modules/packaging/os/snap.py b/plugins/modules/packaging/os/snap.py index f5df9d1a52..c50e789c85 100644 --- a/plugins/modules/packaging/os/snap.py +++ b/plugins/modules/packaging/os/snap.py @@ -1,12 +1,13 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2021, Alexei Znamensky (russoz) -# Copyright: (c) 2021, Marcus Rickert -# Copyright: (c) 2018, Stanislas Lange (angristan) -# Copyright: (c) 2018, Victor Carceler +# Copyright (c) 2021, Alexei Znamensky (russoz) +# Copyright (c) 2021, Marcus Rickert +# Copyright (c) 2018, Stanislas Lange (angristan) +# Copyright (c) 2018, Victor Carceler -# 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 @@ -39,7 +40,7 @@ options: This option can only be specified if there is a single snap in the task. type: bool required: false - default: no + default: false channel: description: - Define which release of a snap is installed and tracked for updates. @@ -103,7 +104,7 @@ EXAMPLES = ''' - name: Install "foo" with option --classic community.general.snap: name: foo - classic: yes + classic: true # Install a snap with from a specific channel - name: Install "foo" with option --channel=latest/edge @@ -147,7 +148,7 @@ import numbers from ansible.module_utils.common.text.converters import to_native from ansible_collections.community.general.plugins.module_utils.module_helper import ( - CmdStateModuleHelper, ArgFormat, ModuleHelperException + CmdStateModuleHelper, ArgFormat ) @@ -218,8 +219,8 @@ class Snap(CmdStateModuleHelper): option_map = {} if not isinstance(json_subtree, dict): - raise ModuleHelperException("Non-dict non-leaf element encountered while parsing option map. " - "The output format of 'snap set' may have changed. Aborting!") + self.do_raise("Non-dict non-leaf element encountered while parsing option map. " + "The output format of 'snap set' may have changed. Aborting!") for key, value in json_subtree.items(): full_key = key if prefix is None else prefix + "." + key @@ -252,7 +253,7 @@ class Snap(CmdStateModuleHelper): option_map = self.convert_json_to_map(out) except Exception as e: - raise ModuleHelperException( + self.do_raise( msg="Parsing option map returned by 'snap get {0}' triggers exception '{1}', output:\n'{2}'".format(snap_name, str(e), out)) return option_map @@ -267,7 +268,7 @@ class Snap(CmdStateModuleHelper): result = out.splitlines()[1] match = self.__disable_re.match(result) if not match: - raise ModuleHelperException(msg="Unable to parse 'snap list {0}' output:\n{1}".format(snap_name, out)) + self.do_raise(msg="Unable to parse 'snap list {0}' output:\n{1}".format(snap_name, out)) notes = match.group('notes') return "disabled" not in notes.split(',') @@ -300,7 +301,7 @@ class Snap(CmdStateModuleHelper): else: msg = "Ooops! Snap installation failed while executing '{cmd}', please examine logs and " \ "error output for more details.".format(cmd=self.vars.cmd) - raise ModuleHelperException(msg=msg) + self.do_raise(msg=msg) def state_present(self): @@ -330,14 +331,14 @@ class Snap(CmdStateModuleHelper): if not match: msg = "Cannot parse set option '{option_string}'".format(option_string=option_string) - raise ModuleHelperException(msg) + self.do_raise(msg) snap_prefix = match.group("snap_prefix") selected_snap_name = snap_prefix[:-1] if snap_prefix else None if selected_snap_name is not None and selected_snap_name not in self.vars.name: msg = "Snap option '{option_string}' refers to snap which is not in the list of snap names".format(option_string=option_string) - raise ModuleHelperException(msg) + self.do_raise(msg) if selected_snap_name is None or (snap_name is not None and snap_name == selected_snap_name): key = match.group("key") @@ -360,11 +361,11 @@ class Snap(CmdStateModuleHelper): if rc != 0: if 'has no "configure" hook' in err: msg = "Snap '{snap}' does not have any configurable options".format(snap=snap_name) - raise ModuleHelperException(msg) + self.do_raise(msg) msg = "Cannot set options '{options}' for snap '{snap}': error={error}".format( options=" ".join(options_changed), snap=snap_name, error=err) - raise ModuleHelperException(msg) + self.do_raise(msg) if overall_options_changed: self.vars.options_changed = overall_options_changed @@ -385,7 +386,7 @@ class Snap(CmdStateModuleHelper): return msg = "Ooops! Snap operation failed while executing '{cmd}', please examine logs and " \ "error output for more details.".format(cmd=self.vars.cmd) - raise ModuleHelperException(msg=msg) + self.do_raise(msg=msg) def state_absent(self): self._generic_state_action(self.is_snap_installed, "snaps_removed", ['classic', 'channel', 'state']) diff --git a/plugins/modules/packaging/os/snap_alias.py b/plugins/modules/packaging/os/snap_alias.py index 036be12004..818dbbce31 100644 --- a/plugins/modules/packaging/os/snap_alias.py +++ b/plugins/modules/packaging/os/snap_alias.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: (c) 2021, Alexei Znamensky (russoz) +# Copyright (c) 2021, Alexei Znamensky (russoz) # -# 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/modules/packaging/os/sorcery.py b/plugins/modules/packaging/os/sorcery.py index 347413fc9d..23070ad3b3 100644 --- a/plugins/modules/packaging/os/sorcery.py +++ b/plugins/modules/packaging/os/sorcery.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2015-2016, Vlad Glagolev +# Copyright (c) 2015-2016, Vlad Glagolev # -# 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 @@ -38,7 +39,7 @@ options: description: - Whether to cast, dispel or rebuild a package - state C(cast) is an equivalent of C(present), not C(latest) - - state C(latest) always triggers C(update_cache=yes) + - state C(latest) always triggers I(update_cache=true) - state C(rebuild) implies cast of all specified spells, not only those existed before choices: ["present", "latest", "absent", "cast", "dispelled", "rebuild"] @@ -60,13 +61,13 @@ options: description: - Whether or not to update sorcery scripts at the very first stage type: bool - default: no + default: false update_cache: description: - Whether or not to update grimoire collection before casting spells type: bool - default: no + default: false aliases: ["update_codex"] cache_valid_time: @@ -131,17 +132,17 @@ EXAMPLES = ''' community.general.sorcery: spell: '*' state: rebuild - update: yes - update_cache: yes + update: true + update_cache: true - name: Refresh the grimoire collection if it is 1 day old using native sorcerous alias community.general.sorcery: - update_codex: yes + update_codex: true cache_valid_time: 86400 - name: Update only Sorcery itself community.general.sorcery: - update: yes + update: true ''' diff --git a/plugins/modules/packaging/os/svr4pkg.py b/plugins/modules/packaging/os/svr4pkg.py index aa7a5c2e52..51e43b079f 100644 --- a/plugins/modules/packaging/os/svr4pkg.py +++ b/plugins/modules/packaging/os/svr4pkg.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2012, Boyd Adamson +# Copyright (c) 2012, Boyd Adamson # -# 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 @@ -38,13 +39,13 @@ options: src: description: - - Specifies the location to install the package from. Required when C(state=present). + - Specifies the location to install the package from. Required when I(state=present). - "Can be any path acceptable to the C(pkgadd) command's C(-d) option. e.g.: C(somefile.pkg), C(/dir/with/pkgs), C(http:/server/mypkgs.pkg)." - If using a file or directory, they must already be accessible by the host. See the M(ansible.builtin.copy) module for a way to get them there. type: str proxy: description: - - HTTP[s] proxy to be used if C(src) is a URL. + - HTTP[s] proxy to be used if I(src) is a URL. type: str response_file: description: diff --git a/plugins/modules/packaging/os/swdepot.py b/plugins/modules/packaging/os/swdepot.py index 7e9db8353b..17d0157bb5 100644 --- a/plugins/modules/packaging/os/swdepot.py +++ b/plugins/modules/packaging/os/swdepot.py @@ -1,11 +1,12 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2013, Raul Melo +# Copyright (c) 2013, Raul Melo # Written by Raul Melo # Based on yum module written by Seth Vidal # -# 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/modules/packaging/os/swupd.py b/plugins/modules/packaging/os/swupd.py index 6ededcad02..4567709f48 100644 --- a/plugins/modules/packaging/os/swupd.py +++ b/plugins/modules/packaging/os/swupd.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2017, Alberto Murillo +# Copyright (c) 2017, Alberto Murillo # -# 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 @@ -70,7 +71,7 @@ options: EXAMPLES = ''' - name: Update the OS to the latest version community.general.swupd: - update: yes + update: true - name: Installs the "foo" bundle community.general.swupd: @@ -84,11 +85,11 @@ EXAMPLES = ''' - name: Check integrity of filesystem community.general.swupd: - verify: yes + verify: true - name: Downgrade OS to release 12920 community.general.swupd: - verify: yes + verify: true manifest: 12920 ''' diff --git a/plugins/modules/packaging/os/urpmi.py b/plugins/modules/packaging/os/urpmi.py index 572a6146b0..7b1db9c415 100644 --- a/plugins/modules/packaging/os/urpmi.py +++ b/plugins/modules/packaging/os/urpmi.py @@ -1,11 +1,12 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2013, Philippe Makowski +# Copyright (c) 2013, Philippe Makowski # Written by Philippe Makowski # Based on apt module written by Matthew Williams -# 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 @@ -20,7 +21,7 @@ options: name: description: - A list of package names to install, upgrade or remove. - required: yes + required: true aliases: [ package, pkg ] type: list elements: str @@ -34,18 +35,18 @@ options: description: - Update the package database first C(urpmi.update -a). type: bool - default: no + default: false no_recommends: description: - Corresponds to the C(--no-recommends) option for I(urpmi). type: bool - default: yes + default: true force: description: - Assume "yes" is the answer to any question urpmi has to ask. Corresponds to the C(--force) option for I(urpmi). type: bool - default: yes + default: true root: description: - Specifies an alternative install root, relative to which all packages will be installed. @@ -76,14 +77,10 @@ EXAMPLES = ''' - community.general.urpmi: name: bar state: present - update_cache: yes + update_cache: true ''' -import os -import shlex -import sys - from ansible.module_utils.basic import AnsibleModule diff --git a/plugins/modules/packaging/os/xbps.py b/plugins/modules/packaging/os/xbps.py index 212ec79cbf..aad496238b 100644 --- a/plugins/modules/packaging/os/xbps.py +++ b/plugins/modules/packaging/os/xbps.py @@ -3,7 +3,8 @@ # Copyright 2016 Dino Occhialini # -# 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 @@ -37,54 +38,68 @@ options: that they are not required by other packages and were not explicitly installed by a user. type: bool - default: no + default: false update_cache: description: - Whether or not to refresh the master package lists. This can be run as part of a package installation or as a separate step. type: bool - default: yes + default: true upgrade: description: - Whether or not to upgrade whole system type: bool - default: no + default: false upgrade_xbps: description: - Whether or not to upgrade the xbps package when necessary. Before installing new packages, xbps requires the user to update the xbps package itself. - Thus when this option is set to C(no), + Thus when this option is set to C(false), upgrades and installations will fail when xbps is not up to date. type: bool - default: yes + default: true version_added: '0.2.0' ''' EXAMPLES = ''' - name: Install package foo (automatically updating the xbps package if needed) - community.general.xbps: name=foo state=present + community.general.xbps: + name: foo + state: present - name: Upgrade package foo - community.general.xbps: name=foo state=latest update_cache=yes + community.general.xbps: + name: foo + state: latest + update_cache: true - name: Remove packages foo and bar - community.general.xbps: name=foo,bar state=absent + community.general.xbps: + name: + - foo + - bar + state: absent - name: Recursively remove package foo - community.general.xbps: name=foo state=absent recurse=yes + community.general.xbps: + name: foo + state: absent + recurse: true - name: Update package cache - community.general.xbps: update_cache=yes + community.general.xbps: + update_cache: true - name: Upgrade packages - community.general.xbps: upgrade=yes + community.general.xbps: + upgrade: true - name: Install a package, failing if the xbps package is out of date community.general.xbps: name: foo state: present - upgrade_xbps: no + upgrade_xbps: false ''' RETURN = ''' @@ -158,7 +173,7 @@ def upgrade(module, xbps_path): rc, stdout, stderr = module.run_command(cmdneedupgrade, check_rc=False) if rc == 0: - if(len(stdout.splitlines()) == 0): + if len(stdout.splitlines()) == 0: module.exit_json(changed=False, msg='Nothing to upgrade') elif module.check_mode: module.exit_json(changed=True, msg='Would have performed upgrade') diff --git a/plugins/modules/packaging/os/yum_versionlock.py b/plugins/modules/packaging/os/yum_versionlock.py index a0d9ed2e76..4835f6116c 100644 --- a/plugins/modules/packaging/os/yum_versionlock.py +++ b/plugins/modules/packaging/os/yum_versionlock.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2018, Florian Paul Hoberg +# Copyright (c) 2018, Florian Paul Azim Hoberg # -# 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 @@ -35,7 +36,7 @@ requirements: - yum - yum-versionlock author: - - Florian Paul Hoberg (@florianpaulhoberg) + - Florian Paul Azim Hoberg (@gyptazy) - Amin Vakil (@aminvakil) ''' diff --git a/plugins/modules/packaging/os/zypper.py b/plugins/modules/packaging/os/zypper.py index 07d71169ec..c5404975e8 100644 --- a/plugins/modules/packaging/os/zypper.py +++ b/plugins/modules/packaging/os/zypper.py @@ -1,17 +1,18 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2013, Patrick Callahan +# Copyright (c) 2013, Patrick Callahan # based on # openbsd_pkg -# (c) 2013 +# Copyright (c) 2013 # Patrik Lundin # # yum -# (c) 2012, Red Hat, Inc +# Copyright (c) 2012, Red Hat, Inc # Written by Seth Vidal # -# 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 @@ -37,7 +38,7 @@ options: - Can include a version like C(name=1.0), C(name>3.4) or C(name<=2.7). If a version is given, C(oldpackage) is implied and zypper is allowed to update the package within the version range given. - You can also pass a url or a local path to a rpm file. - - When using state=latest, this can be '*', which updates all installed packages. + - When using I(state=latest), this can be '*', which updates all installed packages. required: true aliases: [ 'pkg' ] type: list @@ -72,33 +73,33 @@ options: signature being installed. Has an effect only if state is I(present) or I(latest). required: false - default: "no" + default: false type: bool disable_recommends: description: - - Corresponds to the C(--no-recommends) option for I(zypper). Default behavior (C(yes)) modifies zypper's default behavior; C(no) does + - Corresponds to the C(--no-recommends) option for I(zypper). Default behavior (C(true)) modifies zypper's default behavior; C(false) does install recommended packages. required: false - default: "yes" + default: true type: bool force: description: - Adds C(--force) option to I(zypper). Allows to downgrade packages and change vendor or architecture. required: false - default: "no" + default: false type: bool force_resolution: description: - Adds C(--force-resolution) option to I(zypper). Allows to (un)install packages with conflicting requirements (resolver will choose a solution). required: false - default: "no" + default: false type: bool version_added: '0.2.0' update_cache: description: - Run the equivalent of C(zypper refresh) before the operation. Disabled in check mode. required: false - default: "no" + default: false type: bool aliases: [ "refresh" ] oldpackage: @@ -106,7 +107,7 @@ options: - Adds C(--oldpackage) option to I(zypper). Allows to downgrade packages with less side-effects than force. This is implied as soon as a version is specified as part of the package name. required: false - default: "no" + default: false type: bool extra_args: required: false @@ -136,8 +137,8 @@ options: - Adds C(--clean-deps) option to I(zypper) remove command. version_added: '4.6.0' notes: - - When used with a `loop:` each package will be processed individually, - it is much more efficient to pass the list directly to the `name` option. + - When used with a C(loop:) each package will be processed individually, + it is much more efficient to pass the list directly to the I(name) option. # informational: requirements for nodes requirements: - "zypper >= 1.0 # included in openSUSE >= 11.1 or SUSE Linux Enterprise Server/Desktop >= 11.0" @@ -155,7 +156,7 @@ EXAMPLES = ''' community.general.zypper: name: apache2 state: present - disable_recommends: no + disable_recommends: false - name: Apply a given patch community.general.zypper: @@ -206,7 +207,7 @@ EXAMPLES = ''' community.general.zypper: name: openssl state: present - update_cache: yes + update_cache: true - name: "Install specific version (possible comparisons: <, >, <=, >=, =)" community.general.zypper: diff --git a/plugins/modules/packaging/os/zypper_repository.py b/plugins/modules/packaging/os/zypper_repository.py index 8483df4c61..9a947254c5 100644 --- a/plugins/modules/packaging/os/zypper_repository.py +++ b/plugins/modules/packaging/os/zypper_repository.py @@ -1,10 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2013, Matthias Vogelgesang -# (c) 2014, Justin Lecher +# Copyright (c) 2013, Matthias Vogelgesang +# Copyright (c) 2014, Justin Lecher # -# 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 @@ -43,12 +44,12 @@ options: I(present). - Needs zypper version >= 1.6.2. type: bool - default: no + default: false autorefresh: description: - Enable autorefresh of the repository. type: bool - default: yes + default: true aliases: [ "refresh" ] priority: description: @@ -61,7 +62,7 @@ options: - Overwrite multiple repository entries, if repositories with both name and URL already exist. type: bool - default: no + default: false auto_import_keys: description: - Automatically import the gpg signing key of the new or changed repository. @@ -69,18 +70,18 @@ options: - Implies runrefresh. - Only works with C(.repo) files if `name` is given explicitly. type: bool - default: no + default: false runrefresh: description: - Refresh the package list of the given repository. - Can be used with repo=* to refresh all repositories. type: bool - default: no + default: false enabled: description: - Set repository to enabled (or disabled). type: bool - default: yes + default: true requirements: @@ -108,19 +109,19 @@ EXAMPLES = ''' - name: Refresh all repos community.general.zypper_repository: repo: '*' - runrefresh: yes + runrefresh: true - name: Add a repo and add its gpg key community.general.zypper_repository: repo: 'http://download.opensuse.org/repositories/systemsmanagement/openSUSE_Leap_42.1/' - auto_import_keys: yes + auto_import_keys: true - name: Force refresh of a repository community.general.zypper_repository: repo: 'http://my_internal_ci_repo/repo' name: my_ci_repo state: present - runrefresh: yes + runrefresh: true ''' import traceback diff --git a/plugins/modules/remote_management/cobbler/cobbler_sync.py b/plugins/modules/remote_management/cobbler/cobbler_sync.py index 157208216b..5e7082ddf5 100644 --- a/plugins/modules/remote_management/cobbler/cobbler_sync.py +++ b/plugins/modules/remote_management/cobbler/cobbler_sync.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# 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) 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 @@ -35,15 +36,15 @@ options: type: str use_ssl: description: - - If C(no), an HTTP connection will be used instead of the default HTTPS connection. + - If C(false), an HTTP connection will be used instead of the default HTTPS connection. type: bool - default: 'yes' + default: true validate_certs: description: - - If C(no), SSL certificates will not be validated. - - This should only set to C(no) when used on personally controlled sites using self-signed certificates. + - If C(false), SSL certificates will not be validated. + - This should only set to C(false) when used on personally controlled sites using self-signed certificates. type: bool - default: 'yes' + default: true author: - Dag Wieers (@dagwieers) todo: @@ -59,7 +60,7 @@ EXAMPLES = r''' host: cobbler01 username: cobbler password: MySuperSecureP4sswOrd - run_once: yes + run_once: true delegate_to: localhost ''' diff --git a/plugins/modules/remote_management/cobbler/cobbler_system.py b/plugins/modules/remote_management/cobbler/cobbler_system.py index e97be01239..973478b627 100644 --- a/plugins/modules/remote_management/cobbler/cobbler_system.py +++ b/plugins/modules/remote_management/cobbler/cobbler_system.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# 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) 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 @@ -35,15 +36,15 @@ options: type: str use_ssl: description: - - If C(no), an HTTP connection will be used instead of the default HTTPS connection. + - If C(false), an HTTP connection will be used instead of the default HTTPS connection. type: bool - default: 'yes' + default: true validate_certs: description: - - If C(no), SSL certificates will not be validated. - - This should only set to C(no) when used on personally controlled sites using self-signed certificates. + - If C(false), SSL certificates will not be validated. + - This should only set to C(false) when used on personally controlled sites using self-signed certificates. type: bool - default: 'yes' + default: true name: description: - The system name to manage. @@ -61,7 +62,7 @@ options: - Sync on changes. - Concurrently syncing Cobbler is bound to fail. type: bool - default: no + default: false state: description: - Whether the system should be present, absent or a query is made. @@ -100,7 +101,7 @@ EXAMPLES = r''' password: ins3965! name: bdsol-aci51-apic1.cisco.com properties: - netboot_enabled: yes + netboot_enabled: true state: present delegate_to: localhost @@ -136,15 +137,14 @@ EXAMPLES = r''' RETURN = r''' systems: description: List of systems - returned: C(state=query) and C(name) is not provided + returned: I(state=query) and I(name) is not provided type: list system: description: (Resulting) information about the system we are working with - returned: when C(name) is provided + returned: when I(name) is provided type: dict ''' -import copy import datetime import ssl diff --git a/plugins/modules/remote_management/hpilo/hpilo_boot.py b/plugins/modules/remote_management/hpilo/hpilo_boot.py index 728f8ffbb1..f663a7b5f5 100644 --- a/plugins/modules/remote_management/hpilo/hpilo_boot.py +++ b/plugins/modules/remote_management/hpilo/hpilo_boot.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # Copyright 2012 Dag Wieers -# 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 @@ -62,7 +63,7 @@ options: description: - Whether to force a reboot (even when the system is already booted). - As a safeguard, without force, hpilo_boot will refuse to reboot a server that is already running. - default: no + default: false type: bool ssl_version: description: diff --git a/plugins/modules/remote_management/hpilo/hpilo_info.py b/plugins/modules/remote_management/hpilo/hpilo_info.py index b0cc0be940..219885cf41 100644 --- a/plugins/modules/remote_management/hpilo/hpilo_info.py +++ b/plugins/modules/remote_management/hpilo/hpilo_info.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # Copyright 2012 Dag Wieers -# 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 @@ -124,7 +125,7 @@ host_power_status: - Will be one of C(ON), C(OFF) and C(UNKNOWN). returned: always type: str - sample: ON + sample: "ON" version_added: 3.5.0 ''' diff --git a/plugins/modules/remote_management/hpilo/hponcfg.py b/plugins/modules/remote_management/hpilo/hponcfg.py index 98d11dd8b9..9d2afc0ab1 100644 --- a/plugins/modules/remote_management/hpilo/hponcfg.py +++ b/plugins/modules/remote_management/hpilo/hponcfg.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (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 @@ -29,13 +30,13 @@ options: type: str executable: description: - - Path to the hponcfg executable (`hponcfg` which uses $PATH). + - Path to the hponcfg executable (C(hponcfg) which uses $PATH). default: hponcfg type: str verbose: description: - Run hponcfg in verbose mode (-v). - default: no + default: false type: bool requirements: - hponcfg tool diff --git a/plugins/modules/remote_management/imc/imc_rest.py b/plugins/modules/remote_management/imc/imc_rest.py index b685e96b82..4d90bcc54d 100644 --- a/plugins/modules/remote_management/imc/imc_rest.py +++ b/plugins/modules/remote_management/imc/imc_rest.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2017, Dag Wieers -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017, 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 @@ -70,10 +71,10 @@ options: type: int validate_certs: description: - - If C(no), SSL certificates will not be validated. - - This should only set to C(no) used on personally controlled sites using self-signed certificates. + - If C(false), SSL certificates will not be validated. + - This should only set to C(false) used on personally controlled sites using self-signed certificates. type: bool - default: 'yes' + default: true notes: - The XML fragments don't need an authentication cookie, this is injected by the module automatically. - The Cisco IMC XML output is being translated to JSON using the Cobra convention. @@ -92,7 +93,7 @@ EXAMPLES = r''' hostname: '{{ imc_hostname }}' username: '{{ imc_username }}' password: '{{ imc_password }}' - validate_certs: no + validate_certs: false content: | @@ -104,7 +105,7 @@ EXAMPLES = r''' hostname: '{{ imc_hostname }}' username: '{{ imc_username }}' password: '{{ imc_password }}' - validate_certs: no + validate_certs: false timeout: 120 content: | @@ -129,7 +130,7 @@ EXAMPLES = r''' hostname: '{{ imc_hostname }}' username: '{{ imc_username }}' password: '{{ imc_password }}' - validate_certs: no + validate_certs: false content: | @@ -147,7 +148,7 @@ EXAMPLES = r''' hostname: '{{ imc_host }}' username: '{{ imc_username }}' password: '{{ imc_password }}' - validate_certs: no + validate_certs: false content: | @@ -159,7 +160,7 @@ EXAMPLES = r''' hostname: '{{ imc_host }}' username: '{{ imc_username }}' password: '{{ imc_password }}' - validate_certs: no + validate_certs: false content: | @@ -171,7 +172,7 @@ EXAMPLES = r''' hostname: '{{ imc_host }}' username: '{{ imc_username }}' password: '{{ imc_password }}' - validate_certs: no + validate_certs: false timeout: 120 content: | @@ -263,7 +264,6 @@ output: import datetime import os import traceback -from functools import partial LXML_ETREE_IMP_ERR = None try: diff --git a/plugins/modules/remote_management/ipmi/ipmi_boot.py b/plugins/modules/remote_management/ipmi/ipmi_boot.py index f8cff0e7e0..3cfa60d18e 100644 --- a/plugins/modules/remote_management/ipmi/ipmi_boot.py +++ b/plugins/modules/remote_management/ipmi/ipmi_boot.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -76,14 +77,14 @@ options: - If set, ask that system firmware uses this device beyond next boot. Be aware many systems do not honor this. type: bool - default: 'no' + default: false uefiboot: description: - If set, request UEFI boot explicitly. Strictly speaking, the spec suggests that if not set, the system should BIOS boot and offers no "don't care" option. In practice, this flag not being set does not preclude UEFI boot on any system I've encountered. type: bool - default: 'no' + default: false requirements: - "python >= 2.6" - pyghmi diff --git a/plugins/modules/remote_management/ipmi/ipmi_power.py b/plugins/modules/remote_management/ipmi/ipmi_power.py index 9abf167f60..fa23b289b5 100644 --- a/plugins/modules/remote_management/ipmi/ipmi_power.py +++ b/plugins/modules/remote_management/ipmi/ipmi_power.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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/modules/remote_management/lenovoxcc/xcc_redfish_command.py b/plugins/modules/remote_management/lenovoxcc/xcc_redfish_command.py index f082f6cd5c..8a213d85ff 100644 --- a/plugins/modules/remote_management/lenovoxcc/xcc_redfish_command.py +++ b/plugins/modules/remote_management/lenovoxcc/xcc_redfish_command.py @@ -1,7 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# GNU General Public License v3.0+ (see LICENSE 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 @@ -305,6 +307,8 @@ class XCCRedfishUtils(RedfishUtils): continue if 'RDOC' in uri: continue + if 'Remote' in uri: + continue # if ejected, 'Inserted' should be False and 'ImageName' cleared if (not data.get('Inserted', False) and not data.get('ImageName')): @@ -312,13 +316,19 @@ class XCCRedfishUtils(RedfishUtils): return None, None def virtual_media_eject_one(self, image_url): - # locate and read the VirtualMedia resources - response = self.get_request(self.root_uri + self.manager_uri) + # read the VirtualMedia resources from systems + response = self.get_request(self.root_uri + self.systems_uri) if response['ret'] is False: return response data = response['data'] if 'VirtualMedia' not in data: - return {'ret': False, 'msg': "VirtualMedia resource not found"} + # read the VirtualMedia resources from manager + response = self.get_request(self.root_uri + self.manager_uri) + if response['ret'] is False: + return response + data = response['data'] + if 'VirtualMedia' not in data: + return {'ret': False, 'msg': "VirtualMedia resource not found"} virt_media_uri = data["VirtualMedia"]["@odata.id"] response = self.get_request(self.root_uri + virt_media_uri) if response['ret'] is False: @@ -379,13 +389,20 @@ class XCCRedfishUtils(RedfishUtils): return self.virtual_media_eject_one(image_url) # eject all inserted media when no image_url specified - # read all the VirtualMedia resources - response = self.get_request(self.root_uri + self.manager_uri) + # read the VirtualMedia resources from systems + response = self.get_request(self.root_uri + self.systems_uri) if response['ret'] is False: return response data = response['data'] if 'VirtualMedia' not in data: - return {'ret': False, 'msg': "VirtualMedia resource not found"} + # read the VirtualMedia resources from manager + response = self.get_request(self.root_uri + self.manager_uri) + if response['ret'] is False: + return response + data = response['data'] + if 'VirtualMedia' not in data: + return {'ret': False, 'msg': "VirtualMedia resource not found"} + # read all the VirtualMedia resources virt_media_uri = data["VirtualMedia"]["@odata.id"] response = self.get_request(self.root_uri + virt_media_uri) if response['ret'] is False: @@ -413,6 +430,95 @@ class XCCRedfishUtils(RedfishUtils): return {'ret': True, 'changed': True, 'msg': "VirtualMedia %s ejected" % str(ejected_media_list)} + def virtual_media_insert(self, options): + param_map = { + 'Inserted': 'inserted', + 'WriteProtected': 'write_protected', + 'UserName': 'username', + 'Password': 'password', + 'TransferProtocolType': 'transfer_protocol_type', + 'TransferMethod': 'transfer_method' + } + image_url = options.get('image_url') + if not image_url: + return {'ret': False, + 'msg': "image_url option required for VirtualMediaInsert"} + media_types = options.get('media_types') + + # read the VirtualMedia resources from systems + response = self.get_request(self.root_uri + self.systems_uri) + if response['ret'] is False: + return response + data = response['data'] + if 'VirtualMedia' not in data: + # read the VirtualMedia resources from manager + response = self.get_request(self.root_uri + self.manager_uri) + if response['ret'] is False: + return response + data = response['data'] + if 'VirtualMedia' not in data: + return {'ret': False, 'msg': "VirtualMedia resource not found"} + virt_media_uri = data["VirtualMedia"]["@odata.id"] + response = self.get_request(self.root_uri + virt_media_uri) + if response['ret'] is False: + return response + data = response['data'] + virt_media_list = [] + for member in data[u'Members']: + virt_media_list.append(member[u'@odata.id']) + resources, headers = self._read_virt_media_resources(virt_media_list) + + # see if image already inserted; if so, nothing to do + if self._virt_media_image_inserted(resources, image_url): + return {'ret': True, 'changed': False, + 'msg': "VirtualMedia '%s' already inserted" % image_url} + + # find an empty slot to insert the media + # try first with strict media_type matching + uri, data = self._find_empty_virt_media_slot( + resources, media_types, media_match_strict=True) + if not uri: + # if not found, try without strict media_type matching + uri, data = self._find_empty_virt_media_slot( + resources, media_types, media_match_strict=False) + if not uri: + return {'ret': False, + 'msg': "Unable to find an available VirtualMedia resource " + "%s" % ('supporting ' + str(media_types) + if media_types else '')} + + # confirm InsertMedia action found + if ('Actions' not in data or + '#VirtualMedia.InsertMedia' not in data['Actions']): + # try to insert via PATCH if no InsertMedia action found + h = headers[uri] + if 'allow' in h: + methods = [m.strip() for m in h.get('allow').split(',')] + if 'PATCH' not in methods: + # if Allow header present and PATCH missing, return error + return {'ret': False, + 'msg': "%s action not found and PATCH not allowed" + % '#VirtualMedia.InsertMedia'} + return self.virtual_media_insert_via_patch(options, param_map, + uri, data) + + # get the action property + action = data['Actions']['#VirtualMedia.InsertMedia'] + if 'target' not in action: + return {'ret': False, + 'msg': "target URI missing from Action " + "#VirtualMedia.InsertMedia"} + action_uri = action['target'] + # 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) + # POST to action + response = self.post_request(self.root_uri + action_uri, payload) + if response['ret'] is False: + return response + return {'ret': True, 'changed': True, 'msg': "VirtualMedia inserted"} + def raw_get_resource(self, resource_uri): if resource_uri is None: return {'ret': False, 'msg': "resource_uri is missing"} @@ -640,7 +746,11 @@ def main(): # Organize by Categories / Commands if category == "Manager": - # execute only if we find a Manager service resource + # For virtual media resource locates on Systems service + result = rf_utils._find_systems_resource() + if result['ret'] is False: + module.fail_json(msg=to_native(result['msg'])) + # For virtual media resource locates on Managers service result = rf_utils._find_managers_resource() if result['ret'] is False: module.fail_json(msg=to_native(result['msg'])) diff --git a/plugins/modules/remote_management/lxca/lxca_cmms.py b/plugins/modules/remote_management/lxca/lxca_cmms.py index b3bb6c2a8c..0941b4521e 100644 --- a/plugins/modules/remote_management/lxca/lxca_cmms.py +++ b/plugins/modules/remote_management/lxca/lxca_cmms.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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/modules/remote_management/lxca/lxca_nodes.py b/plugins/modules/remote_management/lxca/lxca_nodes.py index 62b8e334d8..b3445b1c0b 100644 --- a/plugins/modules/remote_management/lxca/lxca_nodes.py +++ b/plugins/modules/remote_management/lxca/lxca_nodes.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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/modules/remote_management/manageiq/manageiq_alert_profiles.py b/plugins/modules/remote_management/manageiq/manageiq_alert_profiles.py index d76c334259..1ea5c57b09 100644 --- a/plugins/modules/remote_management/manageiq/manageiq_alert_profiles.py +++ b/plugins/modules/remote_management/manageiq/manageiq_alert_profiles.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017 Red Hat Inc. -# 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 @@ -64,7 +65,7 @@ EXAMPLES = ''' url: 'http://127.0.0.1:3000' username: 'admin' password: 'smartvm' - validate_certs: False + validate_certs: false - name: Delete an alert profile from ManageIQ community.general.manageiq_alert_profiles: @@ -74,7 +75,7 @@ EXAMPLES = ''' url: 'http://127.0.0.1:3000' username: 'admin' password: 'smartvm' - validate_certs: False + validate_certs: false ''' RETURN = ''' @@ -238,7 +239,7 @@ class ManageIQAlertProfiles(object): except Exception as e: msg = "Updating profile '{name}' failed: {error}" msg = msg.format(name=old_profile['name'], error=e) - self.module.fail_json(msg=msg, result=result) + self.module.fail_json(msg=msg) if changed: msg = "Profile {name} updated successfully".format(name=desired_profile['name']) diff --git a/plugins/modules/remote_management/manageiq/manageiq_alerts.py b/plugins/modules/remote_management/manageiq/manageiq_alerts.py index de85e96fcb..d12ebd6ea6 100644 --- a/plugins/modules/remote_management/manageiq/manageiq_alerts.py +++ b/plugins/modules/remote_management/manageiq/manageiq_alerts.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017 Red Hat Inc. -# 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 @@ -25,7 +26,7 @@ options: description: - absent - alert should not exist, - present - alert should exist, - required: False + required: false choices: ['absent', 'present'] default: 'present' description: @@ -83,7 +84,7 @@ EXAMPLES = ''' url: 'http://127.0.0.1:3000' username: 'admin' password: 'smartvm' - validate_certs: False + validate_certs: false - name: Add an alert with a "miq expression" to ManageIQ community.general.manageiq_alerts: @@ -110,7 +111,7 @@ EXAMPLES = ''' url: 'http://127.0.0.1:3000' username: 'admin' password: 'smartvm' - validate_certs: False + validate_certs: false - name: Delete an alert from ManageIQ community.general.manageiq_alerts: @@ -120,7 +121,7 @@ EXAMPLES = ''' url: 'http://127.0.0.1:3000' username: 'admin' password: 'smartvm' - validate_certs: False + validate_certs: false ''' RETURN = ''' diff --git a/plugins/modules/remote_management/manageiq/manageiq_group.py b/plugins/modules/remote_management/manageiq/manageiq_group.py index 2452e101d1..509de77e21 100644 --- a/plugins/modules/remote_management/manageiq/manageiq_group.py +++ b/plugins/modules/remote_management/manageiq/manageiq_group.py @@ -1,22 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# -# (c) 2018, Evert Mulder (base on manageiq_user.py by Daniel Korn ) -# -# 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) 2018, Evert Mulder (base on manageiq_user.py by 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) @@ -113,7 +99,7 @@ EXAMPLES = ''' url: 'https://manageiq_server' username: 'admin' password: 'smartvm' - validate_certs: False + validate_certs: false - name: Create a group in ManageIQ with the role EvmRole-user and tenant with tenant_id 4 community.general.manageiq_group: @@ -124,7 +110,7 @@ EXAMPLES = ''' url: 'https://manageiq_server' username: 'admin' password: 'smartvm' - validate_certs: False + validate_certs: false - name: - Create or update a group in ManageIQ with the role EvmRole-user and tenant my_tenant. @@ -150,7 +136,7 @@ EXAMPLES = ''' url: 'https://manageiq_server' username: 'admin' password: 'smartvm' - validate_certs: False + validate_certs: false - name: Delete a group in ManageIQ community.general.manageiq_group: diff --git a/plugins/modules/remote_management/manageiq/manageiq_policies.py b/plugins/modules/remote_management/manageiq/manageiq_policies.py index 567833d7cc..3d54a7b5aa 100644 --- a/plugins/modules/remote_management/manageiq/manageiq_policies.py +++ b/plugins/modules/remote_management/manageiq/manageiq_policies.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2017, Daniel Korn -# (c) 2017, Yaacov Zamir -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017, Daniel Korn +# Copyright (c) 2017, Yaacov Zamir +# 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 @@ -67,7 +68,7 @@ EXAMPLES = ''' url: 'http://127.0.0.1:3000' username: 'admin' password: 'smartvm' - validate_certs: False + validate_certs: false - name: Unassign a policy_profile for a provider in ManageIQ community.general.manageiq_policies: @@ -80,7 +81,7 @@ EXAMPLES = ''' url: 'http://127.0.0.1:3000' username: 'admin' password: 'smartvm' - validate_certs: False + validate_certs: false - name: List current policy_profile and policies for a provider in ManageIQ community.general.manageiq_policies: @@ -91,7 +92,7 @@ EXAMPLES = ''' url: 'http://127.0.0.1:3000' username: 'admin' password: 'smartvm' - validate_certs: False + validate_certs: false ''' RETURN = ''' diff --git a/plugins/modules/remote_management/manageiq/manageiq_provider.py b/plugins/modules/remote_management/manageiq/manageiq_provider.py index f17cbec910..50565936f4 100644 --- a/plugins/modules/remote_management/manageiq/manageiq_provider.py +++ b/plugins/modules/remote_management/manageiq/manageiq_provider.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2017, Daniel Korn -# (c) 2017, Yaacov Zamir -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017, Daniel Korn +# Copyright (c) 2017, Yaacov Zamir +# 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 @@ -58,7 +59,7 @@ options: aliases: [ keystone_v3_domain_id ] tenant_mapping_enabled: type: bool - default: 'no' + default: false description: Whether to enable mapping of existing tenants. defaults to False. api_version: type: str @@ -87,7 +88,7 @@ options: validate_certs: description: Whether SSL certificates should be verified for HTTPS requests (deprecated). defaults to True. type: bool - default: 'yes' + default: true security_protocol: type: str description: How SSL certificates should be used for HTTPS requests. defaults to None. @@ -118,7 +119,7 @@ options: validate_certs: description: Whether SSL certificates should be verified for HTTPS requests (deprecated). defaults to True. type: bool - default: 'yes' + default: true security_protocol: type: str choices: ['ssl-with-validation','ssl-with-validation-custom-ca','ssl-without-validation','non-ssl'] @@ -178,7 +179,7 @@ options: description: - Whether certificates should be verified for connections. type: bool - default: yes + default: true aliases: [ verify_ssl ] ''' diff --git a/plugins/modules/remote_management/manageiq/manageiq_tags.py b/plugins/modules/remote_management/manageiq/manageiq_tags.py index 83ab60ac93..d8db5960ff 100644 --- a/plugins/modules/remote_management/manageiq/manageiq_tags.py +++ b/plugins/modules/remote_management/manageiq/manageiq_tags.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2017, Daniel Korn -# (c) 2017, Yaacov Zamir -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017, Daniel Korn +# Copyright (c) 2017, Yaacov Zamir +# 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 @@ -70,7 +71,7 @@ EXAMPLES = ''' url: 'http://127.0.0.1:3000' username: 'admin' password: 'smartvm' - validate_certs: False + validate_certs: false - name: Create new tags for a provider in ManageIQ community.general.manageiq_tags: @@ -85,7 +86,7 @@ EXAMPLES = ''' url: 'http://127.0.0.1:3000' username: 'admin' password: 'smartvm' - validate_certs: False + validate_certs: false - name: Remove tags for a provider in ManageIQ community.general.manageiq_tags: @@ -101,7 +102,7 @@ EXAMPLES = ''' url: 'http://127.0.0.1:3000' username: 'admin' password: 'smartvm' - validate_certs: False + validate_certs: false - name: List current tags for a provider in ManageIQ community.general.manageiq_tags: @@ -112,7 +113,7 @@ EXAMPLES = ''' url: 'http://127.0.0.1:3000' username: 'admin' password: 'smartvm' - validate_certs: False + validate_certs: false ''' RETURN = ''' diff --git a/plugins/modules/remote_management/manageiq/manageiq_tenant.py b/plugins/modules/remote_management/manageiq/manageiq_tenant.py index 58c2e1ed71..f696934b2f 100644 --- a/plugins/modules/remote_management/manageiq/manageiq_tenant.py +++ b/plugins/modules/remote_management/manageiq/manageiq_tenant.py @@ -1,22 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# -# (c) 2018, Evert Mulder (base on manageiq_user.py by Daniel Korn ) -# -# 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) 2018, Evert Mulder (base on manageiq_user.py by 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) @@ -91,7 +77,7 @@ EXAMPLES = ''' url: 'http://127.0.0.1:3000' username: 'admin' password: 'smartvm' - validate_certs: False + validate_certs: false - name: Create a tenant in ManageIQ community.general.manageiq_tenant: @@ -102,7 +88,7 @@ EXAMPLES = ''' url: 'http://127.0.0.1:3000' username: 'admin' password: 'smartvm' - validate_certs: False + validate_certs: false - name: Delete a tenant in ManageIQ community.general.manageiq_tenant: @@ -113,7 +99,7 @@ EXAMPLES = ''' url: 'http://127.0.0.1:3000' username: 'admin' password: 'smartvm' - validate_certs: False + validate_certs: false - name: Set tenant quota for cpu_allocated, mem_allocated, remove quota for vms_allocated community.general.manageiq_tenant: @@ -127,7 +113,7 @@ EXAMPLES = ''' url: 'http://127.0.0.1:3000' username: 'admin' password: 'smartvm' - validate_certs: False + validate_certs: false - name: Delete a tenant in ManageIQ using a token @@ -138,7 +124,7 @@ EXAMPLES = ''' manageiq_connection: url: 'http://127.0.0.1:3000' token: 'sometoken' - validate_certs: False + validate_certs: false ''' RETURN = ''' diff --git a/plugins/modules/remote_management/manageiq/manageiq_user.py b/plugins/modules/remote_management/manageiq/manageiq_user.py index f3dc8103f7..b9b69182cb 100644 --- a/plugins/modules/remote_management/manageiq/manageiq_user.py +++ b/plugins/modules/remote_management/manageiq/manageiq_user.py @@ -1,22 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# -# (c) 2017, Daniel Korn -# -# 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) 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 @@ -82,7 +68,7 @@ EXAMPLES = ''' url: 'http://127.0.0.1:3000' username: 'admin' password: 'smartvm' - validate_certs: False + validate_certs: false - name: Create a new user in ManageIQ using a token community.general.manageiq_user: @@ -94,7 +80,7 @@ EXAMPLES = ''' manageiq_connection: url: 'http://127.0.0.1:3000' token: 'sometoken' - validate_certs: False + validate_certs: false - name: Delete a user in ManageIQ community.general.manageiq_user: @@ -104,7 +90,7 @@ EXAMPLES = ''' url: 'http://127.0.0.1:3000' username: 'admin' password: 'smartvm' - validate_certs: False + validate_certs: false - name: Delete a user in ManageIQ using a token community.general.manageiq_user: @@ -113,7 +99,7 @@ EXAMPLES = ''' manageiq_connection: url: 'http://127.0.0.1:3000' token: 'sometoken' - validate_certs: False + validate_certs: false - name: Update email of user in ManageIQ community.general.manageiq_user: @@ -123,7 +109,7 @@ EXAMPLES = ''' url: 'http://127.0.0.1:3000' username: 'admin' password: 'smartvm' - validate_certs: False + validate_certs: false - name: Update email of user in ManageIQ using a token community.general.manageiq_user: @@ -132,7 +118,7 @@ EXAMPLES = ''' manageiq_connection: url: 'http://127.0.0.1:3000' token: 'sometoken' - validate_certs: False + validate_certs: false ''' RETURN = ''' diff --git a/plugins/modules/remote_management/oneview/oneview_datacenter_info.py b/plugins/modules/remote_management/oneview/oneview_datacenter_info.py index bf3e9a8772..0d78c2483a 100644 --- a/plugins/modules/remote_management/oneview/oneview_datacenter_info.py +++ b/plugins/modules/remote_management/oneview/oneview_datacenter_info.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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) +# 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/modules/remote_management/oneview/oneview_enclosure_info.py b/plugins/modules/remote_management/oneview/oneview_enclosure_info.py index 18e245d617..1c19d36860 100644 --- a/plugins/modules/remote_management/oneview/oneview_enclosure_info.py +++ b/plugins/modules/remote_management/oneview/oneview_enclosure_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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/modules/remote_management/oneview/oneview_ethernet_network.py b/plugins/modules/remote_management/oneview/oneview_ethernet_network.py index 99b5d0fed9..3c8711fe05 100644 --- a/plugins/modules/remote_management/oneview/oneview_ethernet_network.py +++ b/plugins/modules/remote_management/oneview/oneview_ethernet_network.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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) +# 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/modules/remote_management/oneview/oneview_ethernet_network_info.py b/plugins/modules/remote_management/oneview/oneview_ethernet_network_info.py index f1b55165b1..94b87ff24b 100644 --- a/plugins/modules/remote_management/oneview/oneview_ethernet_network_info.py +++ b/plugins/modules/remote_management/oneview/oneview_ethernet_network_info.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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) +# 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/modules/remote_management/oneview/oneview_fc_network.py b/plugins/modules/remote_management/oneview/oneview_fc_network.py index 59984ee8b6..e4b1a17339 100644 --- a/plugins/modules/remote_management/oneview/oneview_fc_network.py +++ b/plugins/modules/remote_management/oneview/oneview_fc_network.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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) +# 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/modules/remote_management/oneview/oneview_fc_network_info.py b/plugins/modules/remote_management/oneview/oneview_fc_network_info.py index 40fed8d017..2b6377fb35 100644 --- a/plugins/modules/remote_management/oneview/oneview_fc_network_info.py +++ b/plugins/modules/remote_management/oneview/oneview_fc_network_info.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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) +# 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/modules/remote_management/oneview/oneview_fcoe_network.py b/plugins/modules/remote_management/oneview/oneview_fcoe_network.py index ef24f8fc8e..61102dff15 100644 --- a/plugins/modules/remote_management/oneview/oneview_fcoe_network.py +++ b/plugins/modules/remote_management/oneview/oneview_fcoe_network.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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) +# 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/modules/remote_management/oneview/oneview_fcoe_network_info.py b/plugins/modules/remote_management/oneview/oneview_fcoe_network_info.py index e581bff862..db5c5a59b0 100644 --- a/plugins/modules/remote_management/oneview/oneview_fcoe_network_info.py +++ b/plugins/modules/remote_management/oneview/oneview_fcoe_network_info.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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) +# 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/modules/remote_management/oneview/oneview_logical_interconnect_group.py b/plugins/modules/remote_management/oneview/oneview_logical_interconnect_group.py index e833f9e092..ed51722672 100644 --- a/plugins/modules/remote_management/oneview/oneview_logical_interconnect_group.py +++ b/plugins/modules/remote_management/oneview/oneview_logical_interconnect_group.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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/modules/remote_management/oneview/oneview_logical_interconnect_group_info.py b/plugins/modules/remote_management/oneview/oneview_logical_interconnect_group_info.py index 436dd5d62b..f0962a996a 100644 --- a/plugins/modules/remote_management/oneview/oneview_logical_interconnect_group_info.py +++ b/plugins/modules/remote_management/oneview/oneview_logical_interconnect_group_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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/modules/remote_management/oneview/oneview_network_set.py b/plugins/modules/remote_management/oneview/oneview_network_set.py index 3a2632b765..6dac04c5ca 100644 --- a/plugins/modules/remote_management/oneview/oneview_network_set.py +++ b/plugins/modules/remote_management/oneview/oneview_network_set.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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) +# 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/modules/remote_management/oneview/oneview_network_set_info.py b/plugins/modules/remote_management/oneview/oneview_network_set_info.py index 2d610f2b57..caff260220 100644 --- a/plugins/modules/remote_management/oneview/oneview_network_set_info.py +++ b/plugins/modules/remote_management/oneview/oneview_network_set_info.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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) +# 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/modules/remote_management/oneview/oneview_san_manager.py b/plugins/modules/remote_management/oneview/oneview_san_manager.py index 20870a31d5..a22398074a 100644 --- a/plugins/modules/remote_management/oneview/oneview_san_manager.py +++ b/plugins/modules/remote_management/oneview/oneview_san_manager.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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) +# 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/modules/remote_management/oneview/oneview_san_manager_info.py b/plugins/modules/remote_management/oneview/oneview_san_manager_info.py index 284371cafc..95497ed8aa 100644 --- a/plugins/modules/remote_management/oneview/oneview_san_manager_info.py +++ b/plugins/modules/remote_management/oneview/oneview_san_manager_info.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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) +# 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/modules/remote_management/redfish/idrac_redfish_command.py b/plugins/modules/remote_management/redfish/idrac_redfish_command.py index 5e02154ed8..9e523b6d11 100644 --- a/plugins/modules/remote_management/redfish/idrac_redfish_command.py +++ b/plugins/modules/remote_management/redfish/idrac_redfish_command.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # Copyright (c) 2018 Dell EMC Inc. -# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) +# GNU General Public License v3.0+ (see 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,46 +15,46 @@ short_description: Manages Out-Of-Band controllers using iDRAC OEM Redfish APIs description: - Builds Redfish URIs locally and sends them to remote OOB controllers to perform an action. - - For use with Dell iDRAC operations that require Redfish OEM extensions + - For use with Dell iDRAC operations that require Redfish OEM extensions. options: category: required: true description: - - Category to execute on OOB controller + - Category to execute on iDRAC. type: str command: required: true description: - - List of commands to execute on OOB controller + - List of commands to execute on iDRAC. type: list elements: str baseuri: required: true description: - - Base URI of OOB controller + - Base URI of iDRAC. type: str username: description: - - User for authentication with OOB controller + - Username for authenticating to iDRAC. type: str password: description: - - Password for authentication with OOB controller + - Password for authenticating to iDRAC. type: str auth_token: description: - - Security token for authentication with OOB controller + - Security token for authenticating to iDRAC. type: str version_added: 2.3.0 timeout: description: - - Timeout in seconds for URL requests to OOB controller + - Timeout in seconds for HTTP requests to iDRAC. default: 10 type: int resource_id: required: false description: - - The ID of the System, Manager or Chassis to modify + - ID of the System, Manager or Chassis to modify. type: str version_added: '0.2.0' diff --git a/plugins/modules/remote_management/redfish/idrac_redfish_config.py b/plugins/modules/remote_management/redfish/idrac_redfish_config.py index adea4b11a9..f995258c7d 100644 --- a/plugins/modules/remote_management/redfish/idrac_redfish_config.py +++ b/plugins/modules/remote_management/redfish/idrac_redfish_config.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # Copyright (c) 2019 Dell EMC Inc. -# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) +# GNU General Public License v3.0+ (see 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 @@ -20,50 +21,50 @@ options: required: true type: str description: - - Category to execute on iDRAC + - Category to execute on iDRAC. command: required: true description: - - List of commands to execute on iDRAC + - List of commands to execute on iDRAC. - I(SetManagerAttributes), I(SetLifecycleControllerAttributes) and I(SetSystemAttributes) are mutually exclusive commands when C(category) - is I(Manager) + is I(Manager). type: list elements: str baseuri: required: true description: - - Base URI of iDRAC + - Base URI of iDRAC. type: str username: description: - - User for authentication with iDRAC + - Username for authenticating to iDRAC. type: str password: description: - - Password for authentication with iDRAC + - Password for authenticating to iDRAC. type: str auth_token: description: - - Security token for authentication with OOB controller + - Security token for authenticating to iDRAC. type: str version_added: 2.3.0 manager_attributes: required: false description: - - dictionary of iDRAC attribute name and value pairs to update + - Dictionary of iDRAC attribute name and value pairs to update. default: {} type: 'dict' version_added: '0.2.0' timeout: description: - - Timeout in seconds for URL requests to iDRAC controller + - Timeout in seconds for HTTP requests to iDRAC. default: 10 type: int resource_id: required: false description: - - The ID of the System, Manager or Chassis to modify + - ID of the System, Manager or Chassis to modify. type: str version_added: '0.2.0' diff --git a/plugins/modules/remote_management/redfish/idrac_redfish_info.py b/plugins/modules/remote_management/redfish/idrac_redfish_info.py index fb137acca3..91e57de14d 100644 --- a/plugins/modules/remote_management/redfish/idrac_redfish_info.py +++ b/plugins/modules/remote_management/redfish/idrac_redfish_info.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # Copyright (c) 2019 Dell EMC Inc. -# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) +# GNU General Public License v3.0+ (see 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,44 +15,44 @@ short_description: Gather PowerEdge server information through iDRAC using Redfi description: - Builds Redfish URIs locally and sends them to remote iDRAC controllers to get information back. - - For use with Dell EMC iDRAC operations that require Redfish OEM extensions + - For use with Dell EMC iDRAC operations that require Redfish OEM extensions. - This module was called C(idrac_redfish_facts) before Ansible 2.9, returning C(ansible_facts). Note that the M(community.general.idrac_redfish_info) module no longer returns C(ansible_facts)! options: category: required: true description: - - Category to execute on iDRAC controller + - Category to execute on iDRAC. type: str command: required: true description: - - List of commands to execute on iDRAC controller + - List of commands to execute on iDRAC. - C(GetManagerAttributes) returns the list of dicts containing iDRAC, - LifecycleController and System attributes + LifecycleController and System attributes. type: list elements: str baseuri: required: true description: - - Base URI of iDRAC controller + - Base URI of iDRAC. type: str username: description: - - User for authentication with iDRAC controller + - Username for authenticating to iDRAC. type: str password: description: - - Password for authentication with iDRAC controller + - Password for authenticating to iDRAC. type: str auth_token: description: - - Security token for authentication with OOB controller + - Security token for authenticating to iDRAC. type: str version_added: 2.3.0 timeout: description: - - Timeout in seconds for URL requests to OOB controller + - Timeout in seconds for HTTP requests to iDRAC. default: 10 type: int diff --git a/plugins/modules/remote_management/redfish/ilo_redfish_config.py b/plugins/modules/remote_management/redfish/ilo_redfish_config.py index 4640688407..d13d10dfdc 100644 --- a/plugins/modules/remote_management/redfish/ilo_redfish_config.py +++ b/plugins/modules/remote_management/redfish/ilo_redfish_config.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2021-2022 Hewlett Packard Enterprise, Inc. All rights reserved. -# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) +# GNU General Public License v3.0+ (see 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 @@ -34,19 +35,19 @@ options: type: str username: description: - - User for authentication with iLO. + - Username for authenticating to iLO. type: str password: description: - - Password for authentication with iLO. + - Password for authenticating to iLO. type: str auth_token: description: - - Security token for authentication with OOB controller. + - Security token for authenticating to iLO. type: str timeout: description: - - Timeout in seconds for URL requests to iLO controller. + - Timeout in seconds for HTTP requests to iLO. default: 10 type: int attribute_name: @@ -82,6 +83,17 @@ EXAMPLES = ''' password: Testpass123 attribute_name: TimeZone attribute_value: Chennai + + - name: Set NTP Servers + community.general.ilo_redfish_config: + category: Manager + command: SetNTPServers + baseuri: 15.X.X.X + username: Admin + password: Testpass123 + attribute_name: StaticNTPServers + attribute_value: X.X.X.X + ''' RETURN = ''' diff --git a/plugins/modules/remote_management/redfish/ilo_redfish_info.py b/plugins/modules/remote_management/redfish/ilo_redfish_info.py index 6773c4ae95..4611e620d5 100644 --- a/plugins/modules/remote_management/redfish/ilo_redfish_info.py +++ b/plugins/modules/remote_management/redfish/ilo_redfish_info.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2021-2022 Hewlett Packard Enterprise, Inc. All rights reserved. -# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) +# GNU General Public License v3.0+ (see 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 @@ -34,19 +35,19 @@ options: type: str username: description: - - User for authentication with iLO. + - Username for authenticating to iLO. type: str password: description: - - Password for authentication with iLO. + - Password for authenticating to iLO. type: str auth_token: description: - - Security token for authentication with iLO. + - Security token for authenticating to iLO. type: str timeout: description: - - Timeout in seconds for URL requests to iLO. + - Timeout in seconds for HTTP requests to iLO. default: 10 type: int author: @@ -74,7 +75,7 @@ ilo_redfish_info: type: dict contains: ret: - description: Check variable to see if the information was succesfully retrived. + description: Check variable to see if the information was successfully retrieved. type: bool msg: description: Information of all active iLO sessions. @@ -105,7 +106,6 @@ CATEGORY_COMMANDS_DEFAULT = { } from ansible.module_utils.basic import AnsibleModule -from ansible.module_utils.common.text.converters import to_native from ansible_collections.community.general.plugins.module_utils.ilo_redfish_utils import iLORedfishUtils diff --git a/plugins/modules/remote_management/redfish/redfish_command.py b/plugins/modules/remote_management/redfish/redfish_command.py index a38e18945e..4ab519f5a4 100644 --- a/plugins/modules/remote_management/redfish/redfish_command.py +++ b/plugins/modules/remote_management/redfish/redfish_command.py @@ -2,7 +2,8 @@ # -*- 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 @@ -21,35 +22,35 @@ options: category: required: true description: - - Category to execute on OOB controller + - Category to execute on OOB controller. type: str command: required: true description: - - List of commands to execute on OOB controller + - List of commands to execute on OOB controller. type: list elements: str baseuri: required: true description: - - Base URI of OOB controller + - Base URI of OOB controller. type: str username: description: - - Username for authentication with OOB controller + - Username for authenticating to OOB controller. type: str password: description: - - Password for authentication with OOB controller + - Password for authenticating to OOB controller. type: str auth_token: description: - - Security token for authentication with OOB controller + - Security token for authenticating to OOB controller. type: str version_added: 2.3.0 session_uri: description: - - URI of the session resource + - URI of the session resource. type: str version_added: 2.3.0 id: @@ -63,28 +64,28 @@ options: required: false aliases: [ account_username ] description: - - Username of account to add/delete/modify + - Username of account to add/delete/modify. type: str new_password: required: false aliases: [ account_password ] description: - - New password of account to add/modify + - New password of account to add/modify. type: str roleid: required: false aliases: [ account_roleid ] description: - - Role of account to add/modify + - Role of account to add/modify. type: str bootdevice: required: false description: - - bootdevice when setting boot configuration + - Boot device when setting boot configuration. type: str timeout: description: - - Timeout in seconds for URL requests to OOB controller + - Timeout in seconds for HTTP requests to OOB controller. default: 10 type: int boot_override_mode: @@ -96,117 +97,117 @@ options: uefi_target: required: false description: - - UEFI target when bootdevice is "UefiTarget" + - UEFI boot target when bootdevice is "UefiTarget". type: str boot_next: required: false description: - - BootNext target when bootdevice is "UefiBootNext" + - BootNext target when bootdevice is "UefiBootNext". type: str update_username: required: false aliases: [ account_updatename ] description: - - new update user name for account_username + - New user name for updating account_username. type: str version_added: '0.2.0' account_properties: required: false description: - - properties of account service to update + - Properties of account service to update. type: dict version_added: '0.2.0' resource_id: required: false description: - - The ID of the System, Manager or Chassis to modify + - ID of the System, Manager or Chassis to modify. type: str version_added: '0.2.0' update_image_uri: required: false description: - - The URI of the image for the update + - URI of the image for the update. type: str version_added: '0.2.0' update_protocol: required: false description: - - The protocol for the update + - Protocol for the update. type: str version_added: '0.2.0' update_targets: required: false description: - - The list of target resource URIs to apply the update to + - List of target resource URIs to apply the update to. type: list elements: str version_added: '0.2.0' update_creds: required: false description: - - The credentials for retrieving the update image + - Credentials for retrieving the update image. type: dict version_added: '0.2.0' suboptions: username: required: false description: - - The username for retrieving the update image + - Username for retrieving the update image. type: str password: required: false description: - - The password for retrieving the update image + - Password for retrieving the update image. type: str virtual_media: required: false description: - - The options for VirtualMedia commands + - Options for VirtualMedia commands. type: dict version_added: '0.2.0' suboptions: media_types: required: false description: - - The list of media types appropriate for the image + - List of media types appropriate for the image. type: list elements: str image_url: required: false description: - - The URL od the image the insert or eject + - URL of the image to insert or eject. type: str inserted: required: false description: - - Indicates if the image is treated as inserted on command completion + - Indicates that the image is treated as inserted on command completion. type: bool - default: True + default: true write_protected: required: false description: - - Indicates if the media is treated as write-protected + - Indicates that the media is treated as write-protected. type: bool - default: True + default: true username: required: false description: - - The username for accessing the image URL + - Username for accessing the image URL. type: str password: required: false description: - - The password for accessing the image URL + - Password for accessing the image URL. type: str transfer_protocol_type: required: false description: - - The network protocol to use with the image + - Network protocol to use with the image. type: str transfer_method: required: false description: - - The transfer method to use with the image + - Transfer method to use with the image. type: str strip_etag_quotes: description: @@ -504,6 +505,20 @@ EXAMPLES = ''' username: operator password: supersecretpwd + - name: Insert Virtual Media + community.general.redfish_command: + category: Systems + command: VirtualMediaInsert + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + virtual_media: + image_url: 'http://example.com/images/SomeLinux-current.iso' + media_types: + - CD + - DVD + resource_id: 1 + - name: Insert Virtual Media community.general.redfish_command: category: Manager @@ -518,6 +533,17 @@ EXAMPLES = ''' - DVD resource_id: BMC + - name: Eject Virtual Media + community.general.redfish_command: + category: Systems + command: VirtualMediaEject + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + virtual_media: + image_url: 'http://example.com/images/SomeLinux-current.iso' + resource_id: 1 + - name: Eject Virtual Media community.general.redfish_command: category: Manager @@ -592,7 +618,7 @@ from ansible.module_utils.common.text.converters import to_native CATEGORY_COMMANDS_ALL = { "Systems": ["PowerOn", "PowerForceOff", "PowerForceRestart", "PowerGracefulRestart", "PowerGracefulShutdown", "PowerReboot", "SetOneTimeBoot", "EnableContinuousBootOverride", "DisableBootOverride", - "IndicatorLedOn", "IndicatorLedOff", "IndicatorLedBlink"], + "IndicatorLedOn", "IndicatorLedOff", "IndicatorLedBlink", "VirtualMediaInsert", "VirtualMediaEject"], "Chassis": ["IndicatorLedOn", "IndicatorLedOff", "IndicatorLedBlink"], "Accounts": ["AddUser", "EnableUser", "DeleteUser", "DisableUser", "UpdateUserRole", "UpdateUserPassword", "UpdateUserName", @@ -765,6 +791,10 @@ def main(): result = rf_utils.set_boot_override(boot_opts) elif command.startswith('IndicatorLed'): result = rf_utils.manage_system_indicator_led(command) + elif command == 'VirtualMediaInsert': + result = rf_utils.virtual_media_insert(virtual_media, category) + elif command == 'VirtualMediaEject': + result = rf_utils.virtual_media_eject(virtual_media, category) elif category == "Chassis": result = rf_utils._find_chassis_resource() @@ -813,9 +843,9 @@ def main(): elif command == 'ClearLogs': result = rf_utils.clear_logs() elif command == 'VirtualMediaInsert': - result = rf_utils.virtual_media_insert(virtual_media) + result = rf_utils.virtual_media_insert(virtual_media, category) elif command == 'VirtualMediaEject': - result = rf_utils.virtual_media_eject(virtual_media) + result = rf_utils.virtual_media_eject(virtual_media, category) elif category == "Update": # execute only if we find UpdateService resources diff --git a/plugins/modules/remote_management/redfish/redfish_config.py b/plugins/modules/remote_management/redfish/redfish_config.py index b903ceed77..c583fb6cb2 100644 --- a/plugins/modules/remote_management/redfish/redfish_config.py +++ b/plugins/modules/remote_management/redfish/redfish_config.py @@ -2,7 +2,8 @@ # -*- 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 @@ -20,48 +21,48 @@ options: category: required: true description: - - Category to execute on OOB controller + - Category to execute on OOB controller. type: str command: required: true description: - - List of commands to execute on OOB controller + - List of commands to execute on OOB controller. type: list elements: str baseuri: required: true description: - - Base URI of OOB controller + - Base URI of OOB controller. type: str username: description: - - User for authentication with OOB controller + - Username for authenticating to OOB controller. type: str password: description: - - Password for authentication with OOB controller + - Password for authenticating to OOB controller. type: str auth_token: description: - - Security token for authentication with OOB controller + - Security token for authenticating to OOB controller. type: str version_added: 2.3.0 bios_attributes: required: false description: - - dictionary of BIOS attributes to update + - Dictionary of BIOS attributes to update. default: {} type: dict version_added: '0.2.0' timeout: description: - - Timeout in seconds for URL requests to OOB controller + - Timeout in seconds for HTTP requests to OOB controller. default: 10 type: int boot_order: required: false description: - - list of BootOptionReference strings specifying the BootOrder + - List of BootOptionReference strings specifying the BootOrder. default: [] type: list elements: str @@ -69,26 +70,26 @@ options: network_protocols: required: false description: - - setting dict of manager services to update + - Setting dict of manager services to update. type: dict version_added: '0.2.0' resource_id: required: false description: - - The ID of the System, Manager or Chassis to modify + - ID of the System, Manager or Chassis to modify. type: str version_added: '0.2.0' nic_addr: required: false description: - - EthernetInterface Address string on OOB controller + - EthernetInterface Address string on OOB controller. default: 'null' type: str version_added: '0.2.0' nic_config: required: false description: - - setting dict of EthernetInterface on OOB controller + - Setting dict of EthernetInterface on OOB controller. type: dict version_added: '0.2.0' strip_etag_quotes: @@ -190,10 +191,10 @@ EXAMPLES = ''' command: SetNetworkProtocols network_protocols: SNMP: - ProtocolEnabled: True + ProtocolEnabled: true Port: 161 HTTP: - ProtocolEnabled: False + ProtocolEnabled: false Port: 8080 baseuri: "{{ baseuri }}" username: "{{ username }}" @@ -205,7 +206,7 @@ EXAMPLES = ''' command: SetManagerNic nic_config: DHCPv4: - DHCPEnabled: False + DHCPEnabled: false IPv4StaticAddresses: Address: 192.168.1.3 Gateway: 192.168.1.1 diff --git a/plugins/modules/remote_management/redfish/redfish_info.py b/plugins/modules/remote_management/redfish/redfish_info.py index c0576ff4c8..4cb42711ad 100644 --- a/plugins/modules/remote_management/redfish/redfish_info.py +++ b/plugins/modules/remote_management/redfish/redfish_info.py @@ -2,7 +2,8 @@ # -*- 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 @@ -21,37 +22,37 @@ options: category: required: false description: - - List of categories to execute on OOB controller + - List of categories to execute on OOB controller. default: ['Systems'] type: list elements: str command: required: false description: - - List of commands to execute on OOB controller + - List of commands to execute on OOB controller. type: list elements: str baseuri: required: true description: - - Base URI of OOB controller + - Base URI of OOB controller. type: str username: description: - - User for authentication with OOB controller + - Username for authenticating to OOB controller. type: str password: description: - - Password for authentication with OOB controller + - Password for authenticating to OOB controller. type: str auth_token: description: - - Security token for authentication with OOB controller + - Security token for authenticating to OOB controller. type: str version_added: 2.3.0 timeout: description: - - Timeout in seconds for URL requests to OOB controller + - Timeout in seconds for HTTP requests to OOB controller. default: 10 type: int @@ -117,6 +118,19 @@ EXAMPLES = ''' ansible.builtin.debug: msg: "{{ result.redfish_facts.virtual_media.entries | to_nice_json }}" + - name: Get Virtual Media information from Systems + community.general.redfish_info: + category: Systems + command: GetVirtualMedia + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + register: result + + - name: Print fetched information + ansible.builtin.debug: + msg: "{{ result.redfish_facts.virtual_media.entries | to_nice_json }}" + - name: Get Volume Inventory community.general.redfish_info: category: Systems @@ -277,6 +291,14 @@ EXAMPLES = ''' baseuri: "{{ baseuri }}" username: "{{ username }}" password: "{{ password }}" + + - name: Get Manager Inventory + community.general.redfish_info: + category: Manager + command: GetManagerInventory + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" ''' RETURN = ''' @@ -294,14 +316,14 @@ CATEGORY_COMMANDS_ALL = { "Systems": ["GetSystemInventory", "GetPsuInventory", "GetCpuInventory", "GetMemoryInventory", "GetNicInventory", "GetHealthReport", "GetStorageControllerInventory", "GetDiskInventory", "GetVolumeInventory", - "GetBiosAttributes", "GetBootOrder", "GetBootOverride"], + "GetBiosAttributes", "GetBootOrder", "GetBootOverride", "GetVirtualMedia"], "Chassis": ["GetFanInventory", "GetPsuInventory", "GetChassisPower", "GetChassisThermals", "GetChassisInventory", "GetHealthReport"], "Accounts": ["ListUsers"], "Sessions": ["GetSessions"], "Update": ["GetFirmwareInventory", "GetFirmwareUpdateCapabilities", "GetSoftwareInventory"], "Manager": ["GetManagerNicInventory", "GetVirtualMedia", "GetLogs", "GetNetworkProtocols", - "GetHealthReport", "GetHostInterfaces"], + "GetHealthReport", "GetHostInterfaces", "GetManagerInventory"], } CATEGORY_COMMANDS_DEFAULT = { @@ -411,6 +433,8 @@ def main(): result["boot_override"] = rf_utils.get_multi_boot_override() elif command == "GetHealthReport": result["health_report"] = rf_utils.get_multi_system_health_report() + elif command == "GetVirtualMedia": + result["virtual_media"] = rf_utils.get_multi_virtualmedia(category) elif category == "Chassis": # execute only if we find Chassis resource @@ -476,7 +500,7 @@ def main(): if command == "GetManagerNicInventory": result["manager_nics"] = rf_utils.get_multi_nic_inventory(category) elif command == "GetVirtualMedia": - result["virtual_media"] = rf_utils.get_multi_virtualmedia() + result["virtual_media"] = rf_utils.get_multi_virtualmedia(category) elif command == "GetLogs": result["log"] = rf_utils.get_logs() elif command == "GetNetworkProtocols": @@ -485,6 +509,8 @@ def main(): result["health_report"] = rf_utils.get_multi_manager_health_report() elif command == "GetHostInterfaces": result["host_interfaces"] = rf_utils.get_hostinterfaces() + elif command == "GetManagerInventory": + result["manager"] = rf_utils.get_multi_manager_inventory() # Return data back module.exit_json(redfish_facts=result) diff --git a/plugins/modules/remote_management/redfish/wdc_redfish_command.py b/plugins/modules/remote_management/redfish/wdc_redfish_command.py new file mode 100644 index 0000000000..0b89a1ff15 --- /dev/null +++ b/plugins/modules/remote_management/redfish/wdc_redfish_command.py @@ -0,0 +1,338 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2022 Western Digital Corporation +# 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 = ''' +--- +module: wdc_redfish_command +short_description: Manages WDC UltraStar Data102 Out-Of-Band controllers using Redfish APIs +version_added: 5.4.0 +description: + - Builds Redfish URIs locally and sends them to remote OOB controllers to + perform an action. + - Manages OOB controller firmware. For example, Firmware Activate, Update and Activate. +options: + category: + required: true + description: + - Category to execute on OOB controller. + type: str + command: + required: true + description: + - List of commands to execute on OOB controller. + type: list + elements: str + baseuri: + description: + - Base URI of OOB controller. Must include this or I(ioms). + type: str + ioms: + description: + - List of IOM FQDNs for the enclosure. Must include this or I(baseuri). + type: list + elements: str + username: + description: + - User for authentication with OOB controller. + type: str + password: + description: + - Password for authentication with OOB controller. + type: str + auth_token: + description: + - Security token for authentication with OOB controller. + type: str + timeout: + description: + - Timeout in seconds for URL requests to OOB controller. + default: 10 + type: int + resource_id: + required: false + description: + - ID of the component to modify, such as C(Enclosure), C(IOModuleAFRU), C(PowerSupplyBFRU), C(FanExternalFRU3), or C(FanInternalFRU). + type: str + version_added: 5.4.0 + update_image_uri: + required: false + description: + - The URI of the image for the update. + type: str + update_creds: + required: false + description: + - The credentials for retrieving the update image. + type: dict + suboptions: + username: + required: false + description: + - The username for retrieving the update image. + type: str + password: + required: false + description: + - The password for retrieving the update image. + type: str +notes: + - In the inventory, you can specify baseuri or ioms. See the EXAMPLES section. + - ioms is a list of FQDNs for the enclosure's IOMs. + + +author: Mike Moerk (@mikemoerk) +''' + +EXAMPLES = ''' +- name: Firmware Activate (required after SimpleUpdate to apply the new firmware) + community.general.wdc_redfish_command: + category: Update + command: FWActivate + ioms: "{{ ioms }}" + username: "{{ username }}" + password: "{{ password }}" + +- name: Firmware Activate with individual IOMs specified + community.general.wdc_redfish_command: + category: Update + command: FWActivate + ioms: + - iom1.wdc.com + - iom2.wdc.com + username: "{{ username }}" + password: "{{ password }}" + +- name: Firmware Activate with baseuri specified + community.general.wdc_redfish_command: + category: Update + command: FWActivate + baseuri: "iom1.wdc.com" + username: "{{ username }}" + password: "{{ password }}" + + +- name: Update and Activate (orchestrates firmware update and activation with a single command) + community.general.wdc_redfish_command: + category: Update + command: UpdateAndActivate + ioms: "{{ ioms }}" + username: "{{ username }}" + password: "{{ password }}" + update_image_uri: "{{ update_image_uri }}" + update_creds: + username: operator + password: supersecretpwd + +- name: Turn on enclosure indicator LED + community.general.wdc_redfish_command: + category: Chassis + resource_id: Enclosure + command: IndicatorLedOn + username: "{{ username }}" + password: "{{ password }}" + +- name: Turn off IOM A indicator LED + community.general.wdc_redfish_command: + category: Chassis + resource_id: IOModuleAFRU + command: IndicatorLedOff + username: "{{ username }}" + password: "{{ password }}" + +- name: Turn on Power Supply B indicator LED + community.general.wdc_redfish_command: + category: Chassis + resource_id: PowerSupplyBFRU + command: IndicatorLedOn + username: "{{ username }}" + password: "{{ password }}" + +- name: Turn on External Fan 3 indicator LED + community.general.wdc_redfish_command: + category: Chassis + resource_id: FanExternalFRU3 + command: IndicatorLedOn + username: "{{ username }}" + password: "{{ password }}" + +- name: Turn on Internal Fan indicator LED + community.general.wdc_redfish_command: + category: Chassis + resource_id: FanInternalFRU + command: IndicatorLedOn + username: "{{ username }}" + password: "{{ password }}" + +- name: Set chassis to Low Power Mode + community.general.wdc_redfish_command: + category: Chassis + resource_id: Enclosure + command: PowerModeLow + +- name: Set chassis to Normal Power Mode + community.general.wdc_redfish_command: + category: Chassis + resource_id: Enclosure + command: PowerModeNormal + +''' + +RETURN = ''' +msg: + description: Message with action result or error description + returned: always + type: str + sample: "Action was successful" +''' + +from ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils import WdcRedfishUtils +from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native + +CATEGORY_COMMANDS_ALL = { + "Update": [ + "FWActivate", + "UpdateAndActivate" + ], + "Chassis": [ + "IndicatorLedOn", + "IndicatorLedOff", + "PowerModeLow", + "PowerModeNormal", + ] +} + + +def main(): + module = AnsibleModule( + argument_spec=dict( + category=dict(required=True), + command=dict(required=True, type='list', elements='str'), + ioms=dict(type='list', elements='str'), + baseuri=dict(), + username=dict(), + password=dict(no_log=True), + auth_token=dict(no_log=True), + update_creds=dict( + type='dict', + options=dict( + username=dict(), + password=dict(no_log=True) + ) + ), + resource_id=dict(), + update_image_uri=dict(), + timeout=dict(type='int', default=10) + ), + required_together=[ + ('username', 'password'), + ], + required_one_of=[ + ('username', 'auth_token'), + ('baseuri', 'ioms') + ], + mutually_exclusive=[ + ('username', 'auth_token'), + ], + supports_check_mode=True + ) + + category = module.params['category'] + command_list = module.params['command'] + + # admin credentials used for authentication + creds = {'user': module.params['username'], + 'pswd': module.params['password'], + 'token': module.params['auth_token']} + + # timeout + timeout = module.params['timeout'] + + # Resource to modify + resource_id = module.params['resource_id'] + + # Check that Category is valid + if category not in CATEGORY_COMMANDS_ALL: + module.fail_json(msg=to_native("Invalid Category '%s'. Valid Categories = %s" % (category, sorted(CATEGORY_COMMANDS_ALL.keys())))) + + # Check that all commands are valid + for cmd in command_list: + # Fail if even one command given is invalid + if cmd not in CATEGORY_COMMANDS_ALL[category]: + module.fail_json(msg=to_native("Invalid Command '%s'. Valid Commands = %s" % (cmd, CATEGORY_COMMANDS_ALL[category]))) + + # Build root URI(s) + if module.params.get("baseuri") is not None: + root_uris = ["https://" + module.params['baseuri']] + else: + root_uris = [ + "https://" + iom for iom in module.params['ioms'] + ] + rf_utils = WdcRedfishUtils(creds, root_uris, timeout, module, + resource_id=resource_id, data_modification=True) + + # Organize by Categories / Commands + + if category == "Update": + # execute only if we find UpdateService resources + resource = rf_utils._find_updateservice_resource() + if resource['ret'] is False: + module.fail_json(msg=resource['msg']) + # update options + update_opts = { + 'update_creds': module.params['update_creds'] + } + for command in command_list: + if command == "FWActivate": + if module.check_mode: + result = { + 'ret': True, + 'changed': True, + 'msg': 'FWActivate not performed in check mode.' + } + else: + result = rf_utils.firmware_activate(update_opts) + elif command == "UpdateAndActivate": + update_opts["update_image_uri"] = module.params['update_image_uri'] + result = rf_utils.update_and_activate(update_opts) + + elif category == "Chassis": + result = rf_utils._find_chassis_resource() + if result['ret'] is False: + module.fail_json(msg=to_native(result['msg'])) + + led_commands = ["IndicatorLedOn", "IndicatorLedOff"] + + # Check if more than one led_command is present + num_led_commands = sum([command in led_commands for command in command_list]) + if num_led_commands > 1: + result = {'ret': False, 'msg': "Only one IndicatorLed command should be sent at a time."} + else: + for command in command_list: + if command.startswith("IndicatorLed"): + result = rf_utils.manage_chassis_indicator_led(command) + elif command.startswith("PowerMode"): + result = rf_utils.manage_chassis_power_mode(command) + + if result['ret'] is False: + module.fail_json(msg=to_native(result['msg'])) + else: + del result['ret'] + changed = result.get('changed', True) + session = result.get('session', dict()) + module.exit_json(changed=changed, + session=session, + msg='Action was successful' if not module.check_mode else result.get( + 'msg', "No action performed in check mode." + )) + + +if __name__ == '__main__': + main() diff --git a/plugins/modules/remote_management/redfish/wdc_redfish_info.py b/plugins/modules/remote_management/redfish/wdc_redfish_info.py new file mode 100644 index 0000000000..7ba9263b55 --- /dev/null +++ b/plugins/modules/remote_management/redfish/wdc_redfish_info.py @@ -0,0 +1,205 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2022 Western Digital Corporation +# 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 = ''' +--- +module: wdc_redfish_info +short_description: Manages WDC UltraStar Data102 Out-Of-Band controllers using Redfish APIs +version_added: 5.4.0 +description: + - Builds Redfish URIs locally and sends them to remote OOB controllers to + get information back. +options: + category: + required: true + description: + - Category to execute on OOB controller. + type: str + command: + required: true + description: + - List of commands to execute on OOB controller. + type: list + elements: str + baseuri: + description: + - Base URI of OOB controller. Must include this or I(ioms). + type: str + ioms: + description: + - List of IOM FQDNs for the enclosure. Must include this or I(baseuri). + type: list + elements: str + username: + description: + - User for authentication with OOB controller. + type: str + password: + description: + - Password for authentication with OOB controller. + type: str + auth_token: + description: + - Security token for authentication with OOB controller. + type: str + timeout: + description: + - Timeout in seconds for URL requests to OOB controller. + default: 10 + type: int + +notes: + - In the inventory, you can specify baseuri or ioms. See the EXAMPLES section. + - ioms is a list of FQDNs for the enclosure's IOMs. + +author: Mike Moerk (@mikemoerk) +''' + +EXAMPLES = ''' +- name: Get Simple Update Status with individual IOMs specified + community.general.wdc_redfish_info: + category: Update + command: SimpleUpdateStatus + ioms: + - iom1.wdc.com + - iom2.wdc.com + username: "{{ username }}" + password: "{{ password }}" + register: result + +- name: Print fetched information + ansible.builtin.debug: + msg: "{{ result.redfish_facts.simple_update_status.entries | to_nice_json }}" + +- name: Get Simple Update Status with baseuri specified + community.general.wdc_redfish_info: + category: Update + command: SimpleUpdateStatus + baseuri: "iom1.wdc.com" + username: "{{ username }}" + password: "{{ password }}" + register: result + +- name: Print fetched information + ansible.builtin.debug: + msg: "{{ result.redfish_facts.simple_update_status.entries | to_nice_json }}" +''' + +RETURN = ''' +Description: + description: Firmware update status description. + returned: always + type: str + sample: Ready for FW update +ErrorCode: + description: Numeric error code for firmware update status. Non-zero indicates an error condition. + returned: always + type: int + sample: 0 +EstimatedRemainingMinutes: + description: Estimated number of minutes remaining in firmware update operation. + returned: always + type: int + sample: 20 +StatusCode: + description: Firmware update status code. + returned: always + type: int + sample: 2 +''' + +from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native +from ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils import WdcRedfishUtils + +CATEGORY_COMMANDS_ALL = { + "Update": ["SimpleUpdateStatus"] +} + + +def main(): + result = {} + module = AnsibleModule( + argument_spec=dict( + category=dict(required=True), + command=dict(required=True, type='list', elements='str'), + ioms=dict(type='list', elements='str'), + baseuri=dict(), + username=dict(), + password=dict(no_log=True), + auth_token=dict(no_log=True), + timeout=dict(type='int', default=10) + ), + required_together=[ + ('username', 'password'), + ], + required_one_of=[ + ('username', 'auth_token'), + ('baseuri', 'ioms') + ], + mutually_exclusive=[ + ('username', 'auth_token'), + ], + supports_check_mode=True + ) + + category = module.params['category'] + command_list = module.params['command'] + + # admin credentials used for authentication + creds = {'user': module.params['username'], + 'pswd': module.params['password'], + 'token': module.params['auth_token']} + + # timeout + timeout = module.params['timeout'] + + # Check that Category is valid + if category not in CATEGORY_COMMANDS_ALL: + module.fail_json(msg=to_native("Invalid Category '%s'. Valid Categories = %s" % (category, sorted(CATEGORY_COMMANDS_ALL.keys())))) + + # Check that all commands are valid + for cmd in command_list: + # Fail if even one command given is invalid + if cmd not in CATEGORY_COMMANDS_ALL[category]: + module.fail_json(msg=to_native("Invalid Command '%s'. Valid Commands = %s" % (cmd, CATEGORY_COMMANDS_ALL[category]))) + + # Build root URI(s) + if module.params.get("baseuri") is not None: + root_uris = ["https://" + module.params['baseuri']] + else: + root_uris = [ + "https://" + iom for iom in module.params['ioms'] + ] + rf_utils = WdcRedfishUtils(creds, root_uris, timeout, module, + resource_id=None, + data_modification=False + ) + + # Organize by Categories / Commands + + if category == "Update": + # execute only if we find UpdateService resources + resource = rf_utils._find_updateservice_resource() + if resource['ret'] is False: + module.fail_json(msg=resource['msg']) + for command in command_list: + if command == "SimpleUpdateStatus": + simple_update_status_result = rf_utils.get_simple_update_status() + if simple_update_status_result['ret'] is False: + module.fail_json(msg=to_native(result['msg'])) + else: + del simple_update_status_result['ret'] + result["simple_update_status"] = simple_update_status_result + module.exit_json(changed=False, redfish_facts=result) + + +if __name__ == '__main__': + main() diff --git a/plugins/modules/remote_management/stacki/stacki_host.py b/plugins/modules/remote_management/stacki/stacki_host.py index fda0c5d318..2e339bf280 100644 --- a/plugins/modules/remote_management/stacki/stacki_host.py +++ b/plugins/modules/remote_management/stacki/stacki_host.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2016, Hugh Ma -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, Hugh Ma +# 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,23 +19,23 @@ options: name: description: - Name of the host to be added to Stacki. - required: True + required: true type: str stacki_user: description: - Username for authenticating with Stacki API, but if not specified, the environment variable C(stacki_user) is used instead. - required: True + required: true type: str stacki_password: description: - Password for authenticating with Stacki API, but if not specified, the environment variable C(stacki_password) is used instead. - required: True + required: true type: str stacki_endpoint: description: - URL for the Stacki API Endpoint. - required: True + required: true type: str prim_intf_mac: description: @@ -55,7 +56,7 @@ options: description: - Set value to C(true) to force node into install state if it already exists in stacki. type: bool - default: no + default: false state: description: - Set value to the desired state for the specified host. diff --git a/plugins/modules/remote_management/wakeonlan.py b/plugins/modules/remote_management/wakeonlan.py index 725e070cd8..bbdbcfdeff 100644 --- a/plugins/modules/remote_management/wakeonlan.py +++ b/plugins/modules/remote_management/wakeonlan.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2016, Dag Wieers -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, 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/modules/source_control/bitbucket/bitbucket_access_key.py b/plugins/modules/source_control/bitbucket/bitbucket_access_key.py index 6451d72909..f084b98027 100644 --- a/plugins/modules/source_control/bitbucket/bitbucket_access_key.py +++ b/plugins/modules/source_control/bitbucket/bitbucket_access_key.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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/modules/source_control/bitbucket/bitbucket_pipeline_key_pair.py b/plugins/modules/source_control/bitbucket/bitbucket_pipeline_key_pair.py index 5d42419dfa..97e1ee3bbb 100644 --- a/plugins/modules/source_control/bitbucket/bitbucket_pipeline_key_pair.py +++ b/plugins/modules/source_control/bitbucket/bitbucket_pipeline_key_pair.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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/modules/source_control/bitbucket/bitbucket_pipeline_known_host.py b/plugins/modules/source_control/bitbucket/bitbucket_pipeline_known_host.py index 9f4f2b9498..b8ceb8f90f 100644 --- a/plugins/modules/source_control/bitbucket/bitbucket_pipeline_known_host.py +++ b/plugins/modules/source_control/bitbucket/bitbucket_pipeline_known_host.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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/modules/source_control/bitbucket/bitbucket_pipeline_variable.py b/plugins/modules/source_control/bitbucket/bitbucket_pipeline_variable.py index e5701184c3..daf65d0b4d 100644 --- a/plugins/modules/source_control/bitbucket/bitbucket_pipeline_variable.py +++ b/plugins/modules/source_control/bitbucket/bitbucket_pipeline_variable.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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 @@ -43,7 +44,7 @@ options: description: - Whether to encrypt the variable value. type: bool - default: no + default: false state: description: - Indicates desired state of the variable. @@ -65,8 +66,8 @@ EXAMPLES = r''' secured: '{{ item.secured }}' state: present with_items: - - { name: AWS_ACCESS_KEY, value: ABCD1234, secured: False } - - { name: AWS_SECRET, value: qwe789poi123vbn0, secured: True } + - { name: AWS_ACCESS_KEY, value: ABCD1234, secured: false } + - { name: AWS_SECRET, value: qwe789poi123vbn0, secured: true } - name: Remove pipeline variable community.general.bitbucket_pipeline_variable: diff --git a/plugins/modules/source_control/bzr.py b/plugins/modules/source_control/bzr.py index a4ce4bc075..7832183806 100644 --- a/plugins/modules/source_control/bzr.py +++ b/plugins/modules/source_control/bzr.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2013, André Paramés +# Copyright (c) 2013, André Paramés # Based on the Git module by Michael DeHaan -# 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,12 +22,12 @@ options: description: - SSH or HTTP protocol address of the parent branch. aliases: [ parent ] - required: yes + required: true type: str dest: description: - Absolute path of where the branch should be cloned to. - required: yes + required: true type: path version: description: @@ -36,11 +37,11 @@ options: type: str force: description: - - If C(yes), any modified files in the working + - If C(true), any modified files in the working tree will be discarded. Before 1.9 the default - value was C(yes). + value was C(true). type: bool - default: 'no' + default: false executable: description: - Path to bzr executable to use. If not supplied, @@ -111,7 +112,7 @@ class Bzr(object): tree since that commit. ''' if not force and self.has_local_mods(): - self.module.fail_json(msg="Local modifications exist in branch (force=no).") + self.module.fail_json(msg="Local modifications exist in branch (force=false).") return self._command(["revert"], check_rc=True, cwd=self.dest) def fetch(self): diff --git a/plugins/modules/source_control/git_config.py b/plugins/modules/source_control/git_config.py index 8651458610..9191de0e87 100644 --- a/plugins/modules/source_control/git_config.py +++ b/plugins/modules/source_control/git_config.py @@ -1,10 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2015, Marius Gedminas -# (c) 2016, Matthew Gamble +# Copyright (c) 2015, Marius Gedminas +# Copyright (c) 2016, Matthew Gamble # -# 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 @@ -29,7 +30,7 @@ options: description: - List all settings (optionally limited to a given I(scope)). type: bool - default: 'no' + default: false name: description: - The name of the setting. If no value is supplied, the value will @@ -51,7 +52,7 @@ options: - This is required when setting config values. - If this is set to C(local), you must also specify the C(repo) parameter. - If this is set to C(file), you must also specify the C(file) parameter. - - It defaults to system only when not using I(list_all)=C(yes). + - It defaults to system only when not using I(list_all)=C(true). choices: [ "file", "local", "global", "system" ] type: str state: @@ -122,35 +123,35 @@ EXAMPLES = ''' name: alias.ci scope: global -- name: Scope system is also assumed when reading values, unless list_all=yes +- name: Scope system is also assumed when reading values, unless list_all=true community.general.git_config: name: alias.diffc - name: Read all values from git config community.general.git_config: - list_all: yes + list_all: true scope: global - name: When list_all is yes and no scope is specified, you get configuration from all scopes community.general.git_config: - list_all: yes + list_all: true - name: Specify a repository to include local settings community.general.git_config: - list_all: yes + list_all: true repo: /path/to/repo.git ''' RETURN = ''' --- config_value: - description: When list_all=no and value is not set, a string containing the value of the setting in name + description: When I(list_all=false) and value is not set, a string containing the value of the setting in name returned: success type: str sample: "vim" config_values: - description: When list_all=yes, a dict containing key/value pairs of multiple configuration settings + description: When I(list_all=true), a dict containing key/value pairs of multiple configuration settings returned: success type: dict sample: @@ -159,7 +160,6 @@ config_values: alias.diffc: "diff --cached" alias.remotev: "remote -v" ''' -import os from ansible.module_utils.basic import AnsibleModule diff --git a/plugins/modules/source_control/github/github_deploy_key.py b/plugins/modules/source_control/github/github_deploy_key.py index a90de48d42..97e7a1ac7f 100644 --- a/plugins/modules/source_control/github/github_deploy_key.py +++ b/plugins/modules/source_control/github/github_deploy_key.py @@ -1,7 +1,9 @@ #!/usr/bin/python # -*- 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 @@ -51,7 +53,7 @@ options: description: - If C(true), the deploy key will only be able to read repository contents. Otherwise, the deploy key will be able to read and write. type: bool - default: 'yes' + default: true state: description: - The state of the deploy key. @@ -62,7 +64,7 @@ options: description: - If C(true), forcefully adds the deploy key by deleting any existing deploy key with the same public key or title. type: bool - default: 'no' + default: false username: description: - The username to authenticate with. Should not be set when using personal access token @@ -90,7 +92,7 @@ EXAMPLES = ''' repo: "example" name: "new-deploy-key" key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAwXxn7kIMNWzcDfou..." - read_only: yes + read_only: true username: "johndoe" password: "supersecretpassword" @@ -100,7 +102,7 @@ EXAMPLES = ''' repository: "example" name: "new-deploy-key" key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAwXxn7kIMNWzcDfou..." - force: yes + force: true username: "johndoe" password: "supersecretpassword" state: absent @@ -111,7 +113,7 @@ EXAMPLES = ''' repository: "example" name: "new-deploy-key" key: "{{ lookup('file', '~/.ssh/github.pub') }}" - force: yes + force: true token: "ABAQDAwXxn7kIMNWzcDfo..." - name: Re-add a deploy key to a GitHub repository but with a different name @@ -140,7 +142,7 @@ EXAMPLES = ''' repo: "example" name: "new-deploy-key" key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAwXxn7kIMNWzcDfou..." - read_only: yes + read_only: true username: "janedoe" password: "supersecretpassword" ''' diff --git a/plugins/modules/source_control/github/github_issue.py b/plugins/modules/source_control/github/github_issue.py index 4add29f341..4f8f2363cc 100644 --- a/plugins/modules/source_control/github/github_issue.py +++ b/plugins/modules/source_control/github/github_issue.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2017-18, Abhijeet Kasurde +# Copyright (c) 2017-18, Abhijeet Kasurde # -# 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/modules/source_control/github/github_key.py b/plugins/modules/source_control/github/github_key.py index 2afbe29aa1..5dfd694275 100644 --- a/plugins/modules/source_control/github/github_key.py +++ b/plugins/modules/source_control/github/github_key.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 @@ -26,7 +27,7 @@ options: type: str pubkey: description: - - SSH public key value. Required when C(state=present). + - SSH public key value. Required when I(state=present). type: str state: description: @@ -36,11 +37,11 @@ options: type: str force: description: - - The default is C(yes), which will replace the existing remote key - if it's different than C(pubkey). If C(no), the key will only be - set if no key with the given C(name) exists. + - The default is C(true), which will replace the existing remote key + if it's different than C(pubkey). If C(false), the key will only be + set if no key with the given I(name) exists. type: bool - default: 'yes' + default: true author: Robert Estelle (@erydo) ''' @@ -50,17 +51,17 @@ deleted_keys: description: An array of key objects that were deleted. Only present on state=absent type: list returned: When state=absent - sample: [{'id': 0, 'key': 'BASE64 encoded key', 'url': 'http://example.com/github key', 'created_at': 'YYYY-MM-DDTHH:MM:SZ', 'read_only': False}] + sample: [{'id': 0, 'key': 'BASE64 encoded key', 'url': 'http://example.com/github key', 'created_at': 'YYYY-MM-DDTHH:MM:SZ', 'read_only': false}] matching_keys: description: An array of keys matching the specified name. Only present on state=present type: list returned: When state=present - sample: [{'id': 0, 'key': 'BASE64 encoded key', 'url': 'http://example.com/github key', 'created_at': 'YYYY-MM-DDTHH:MM:SZ', 'read_only': False}] + sample: [{'id': 0, 'key': 'BASE64 encoded key', 'url': 'http://example.com/github key', 'created_at': 'YYYY-MM-DDTHH:MM:SZ', 'read_only': false}] key: description: Metadata about the key just created. Only present on state=present type: dict returned: success - sample: {'id': 0, 'key': 'BASE64 encoded key', 'url': 'http://example.com/github key', 'created_at': 'YYYY-MM-DDTHH:MM:SZ', 'read_only': False} + sample: {'id': 0, 'key': 'BASE64 encoded key', 'url': 'http://example.com/github key', 'created_at': 'YYYY-MM-DDTHH:MM:SZ', 'read_only': false} ''' EXAMPLES = ''' diff --git a/plugins/modules/source_control/github/github_release.py b/plugins/modules/source_control/github/github_release.py index 654dce5f98..84ce4ce4ec 100644 --- a/plugins/modules/source_control/github/github_release.py +++ b/plugins/modules/source_control/github/github_release.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: Ansible Team -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright Ansible Team +# 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 @@ -58,13 +59,13 @@ options: draft: description: - Sets if the release is a draft or not. (boolean) - type: 'bool' - default: 'no' + type: bool + default: false prerelease: description: - Sets if the release is a prerelease or not. (boolean) type: bool - default: 'no' + default: false author: - "Adrian Moisey (@adrianmoisey)" diff --git a/plugins/modules/source_control/github/github_repo.py b/plugins/modules/source_control/github/github_repo.py index 1446e4abe9..d01312fcfa 100644 --- a/plugins/modules/source_control/github/github_repo.py +++ b/plugins/modules/source_control/github/github_repo.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2021, Álvaro Torres Cogollo -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, Álvaro Torres Cogollo +# 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 @@ -100,9 +101,9 @@ EXAMPLES = ''' organization: MyOrganization name: myrepo description: "Just for fun" - private: yes + private: true state: present - force_defaults: no + force_defaults: false register: result - name: Delete the repository @@ -124,7 +125,6 @@ repo: import traceback from ansible.module_utils.basic import AnsibleModule, missing_required_lib -import sys GITHUB_IMP_ERR = None try: diff --git a/plugins/modules/source_control/github/github_webhook.py b/plugins/modules/source_control/github/github_webhook.py index fcb6f8d06f..b97087d221 100644 --- a/plugins/modules/source_control/github/github_webhook.py +++ b/plugins/modules/source_control/github/github_webhook.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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 @@ -112,7 +113,7 @@ EXAMPLES = ''' url: https://jenkins.example.com/ghprbhook/ content_type: json secret: "{{ github_shared_secret }}" - insecure_ssl: True + insecure_ssl: true events: - issue_comment - pull_request diff --git a/plugins/modules/source_control/github/github_webhook_info.py b/plugins/modules/source_control/github/github_webhook_info.py index 98a7516e75..bc3d3c90fa 100644 --- a/plugins/modules/source_control/github/github_webhook_info.py +++ b/plugins/modules/source_control/github/github_webhook_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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 @@ -73,15 +74,18 @@ hooks: description: A list of hooks that exist for the repo returned: always type: list - sample: > - [{"has_shared_secret": true, - "url": "https://jenkins.example.com/ghprbhook/", - "events": ["issue_comment", "pull_request"], - "insecure_ssl": "1", - "content_type": "json", - "active": true, - "id": 6206, - "last_response": {"status": "active", "message": "OK", "code": 200}}] + elements: dict + sample: + - { + "has_shared_secret": true, + "url": "https://jenkins.example.com/ghprbhook/", + "events": ["issue_comment", "pull_request"], + "insecure_ssl": "1", + "content_type": "json", + "active": true, + "id": 6206, + "last_response": {"status": "active", "message": "OK", "code": 200} + } ''' import traceback diff --git a/plugins/modules/source_control/gitlab/gitlab_branch.py b/plugins/modules/source_control/gitlab/gitlab_branch.py index 8707e6453a..e57ca4922f 100644 --- a/plugins/modules/source_control/gitlab/gitlab_branch.py +++ b/plugins/modules/source_control/gitlab/gitlab_branch.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2021, Werner Dijkerman (ikben@werner-dijkerman.nl) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, Werner Dijkerman (ikben@werner-dijkerman.nl) +# 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 @@ -71,20 +72,13 @@ RETURN = ''' import traceback -from ansible.module_utils.basic import AnsibleModule, missing_required_lib +from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.api import basic_auth_argument_spec from ansible_collections.community.general.plugins.module_utils.version import LooseVersion - -GITLAB_IMP_ERR = None -try: - import gitlab - HAS_GITLAB_PACKAGE = True -except Exception: - GITLAB_IMP_ERR = traceback.format_exc() - HAS_GITLAB_PACKAGE = False - -from ansible_collections.community.general.plugins.module_utils.gitlab import auth_argument_spec, gitlab_authentication +from ansible_collections.community.general.plugins.module_utils.gitlab import ( + auth_argument_spec, gitlab_authentication, gitlab, ensure_gitlab_package +) class GitlabBranch(object): @@ -143,15 +137,13 @@ def main(): ], supports_check_mode=False ) + ensure_gitlab_package(module) project = module.params['project'] branch = module.params['branch'] ref_branch = module.params['ref_branch'] state = module.params['state'] - if not HAS_GITLAB_PACKAGE: - module.fail_json(msg=missing_required_lib("python-gitlab"), exception=GITLAB_IMP_ERR) - gitlab_version = gitlab.__version__ if LooseVersion(gitlab_version) < LooseVersion('2.3.0'): module.fail_json(msg="community.general.gitlab_proteched_branch requires python-gitlab Python module >= 2.3.0 (installed version: [%s])." diff --git a/plugins/modules/source_control/gitlab/gitlab_deploy_key.py b/plugins/modules/source_control/gitlab/gitlab_deploy_key.py index 5746186ca5..1b77801ec4 100644 --- a/plugins/modules/source_control/gitlab/gitlab_deploy_key.py +++ b/plugins/modules/source_control/gitlab/gitlab_deploy_key.py @@ -1,11 +1,12 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr) -# Copyright: (c) 2018, Marcus Watkins +# Copyright (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr) +# Copyright (c) 2018, Marcus Watkins # Based on code: -# Copyright: (c) 2013, Phillip Gentry -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2013, Phillip Gentry +# 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 @@ -45,7 +46,7 @@ options: description: - Whether this key can push to the project. type: bool - default: no + default: false state: description: - When C(present) the deploy key added to the project if it doesn't exist. @@ -72,7 +73,7 @@ EXAMPLES = ''' project: "my_group/my_project" title: "Jenkins CI" state: present - can_push: yes + can_push: true - name: "Remove the previous deploy key from the project" community.general.gitlab_deploy_key: @@ -108,22 +109,13 @@ deploy_key: type: dict ''' -import re -import traceback - -GITLAB_IMP_ERR = None -try: - import gitlab - HAS_GITLAB_PACKAGE = True -except Exception: - GITLAB_IMP_ERR = traceback.format_exc() - HAS_GITLAB_PACKAGE = False - from ansible.module_utils.api import basic_auth_argument_spec -from ansible.module_utils.basic import AnsibleModule, missing_required_lib +from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.common.text.converters import to_native -from ansible_collections.community.general.plugins.module_utils.gitlab import auth_argument_spec, find_project, gitlab_authentication +from ansible_collections.community.general.plugins.module_utils.gitlab import ( + auth_argument_spec, find_project, gitlab_authentication, gitlab, ensure_gitlab_package +) class GitLabDeployKey(object): @@ -261,6 +253,7 @@ def main(): ], supports_check_mode=True, ) + ensure_gitlab_package(module) state = module.params['state'] project_identifier = module.params['project'] @@ -268,9 +261,6 @@ def main(): key_keyfile = module.params['key'] key_can_push = module.params['can_push'] - if not HAS_GITLAB_PACKAGE: - module.fail_json(msg=missing_required_lib("python-gitlab"), exception=GITLAB_IMP_ERR) - gitlab_instance = gitlab_authentication(module) gitlab_deploy_key = GitLabDeployKey(module, gitlab_instance) diff --git a/plugins/modules/source_control/gitlab/gitlab_group.py b/plugins/modules/source_control/gitlab/gitlab_group.py index 1c4a0c9b27..d099a0c274 100644 --- a/plugins/modules/source_control/gitlab/gitlab_group.py +++ b/plugins/modules/source_control/gitlab/gitlab_group.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr) -# Copyright: (c) 2015, Werner Dijkerman (ikben@werner-dijkerman.nl) -# 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) 2015, Werner Dijkerman (ikben@werner-dijkerman.nl) +# 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 @@ -93,14 +94,14 @@ EXAMPLES = ''' community.general.gitlab_group: api_url: https://gitlab.example.com/ api_token: "{{ access_token }}" - validate_certs: False + validate_certs: false name: my_first_group state: absent - name: "Create GitLab Group" community.general.gitlab_group: api_url: https://gitlab.example.com/ - validate_certs: True + validate_certs: true api_username: dj-wasabi api_password: "MySecretPassword" name: my_first_group @@ -111,7 +112,7 @@ EXAMPLES = ''' - name: "Create GitLab SubGroup" community.general.gitlab_group: api_url: https://gitlab.example.com/ - validate_certs: True + validate_certs: true api_username: dj-wasabi api_password: "MySecretPassword" name: my_first_group @@ -123,7 +124,7 @@ EXAMPLES = ''' - name: "Create GitLab Group for SubGroups only" community.general.gitlab_group: api_url: https://gitlab.example.com/ - validate_certs: True + validate_certs: true api_username: dj-wasabi api_password: "MySecretPassword" name: my_main_group @@ -158,21 +159,13 @@ group: type: dict ''' -import traceback - -GITLAB_IMP_ERR = None -try: - import gitlab - HAS_GITLAB_PACKAGE = True -except Exception: - GITLAB_IMP_ERR = traceback.format_exc() - HAS_GITLAB_PACKAGE = False - from ansible.module_utils.api import basic_auth_argument_spec -from ansible.module_utils.basic import AnsibleModule, missing_required_lib +from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.common.text.converters import to_native -from ansible_collections.community.general.plugins.module_utils.gitlab import auth_argument_spec, find_group, gitlab_authentication +from ansible_collections.community.general.plugins.module_utils.gitlab import ( + auth_argument_spec, find_group, gitlab_authentication, gitlab, ensure_gitlab_package +) class GitLabGroup(object): @@ -338,6 +331,7 @@ def main(): ], supports_check_mode=True, ) + ensure_gitlab_package(module) group_name = module.params['name'] group_path = module.params['path'] @@ -351,9 +345,6 @@ def main(): require_two_factor_authentication = module.params['require_two_factor_authentication'] avatar_path = module.params['avatar_path'] - if not HAS_GITLAB_PACKAGE: - module.fail_json(msg=missing_required_lib("python-gitlab"), exception=GITLAB_IMP_ERR) - gitlab_instance = gitlab_authentication(module) # Define default group_path based on group_name diff --git a/plugins/modules/source_control/gitlab/gitlab_group_members.py b/plugins/modules/source_control/gitlab/gitlab_group_members.py index 31f835dd08..50cb35367f 100644 --- a/plugins/modules/source_control/gitlab/gitlab_group_members.py +++ b/plugins/modules/source_control/gitlab/gitlab_group_members.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2020, Zainab Alsaffar -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2020, Zainab Alsaffar +# 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 @@ -151,18 +152,11 @@ EXAMPLES = r''' RETURN = r''' # ''' from ansible.module_utils.api import basic_auth_argument_spec -from ansible.module_utils.basic import AnsibleModule, missing_required_lib +from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.general.plugins.module_utils.gitlab import auth_argument_spec, gitlab_authentication - -import traceback - -try: - import gitlab - HAS_PY_GITLAB = True -except ImportError: - GITLAB_IMP_ERR = traceback.format_exc() - HAS_PY_GITLAB = False +from ansible_collections.community.general.plugins.module_utils.gitlab import ( + auth_argument_spec, gitlab_authentication, gitlab, ensure_gitlab_package +) class GitLabGroup(object): @@ -280,9 +274,7 @@ def main(): ], supports_check_mode=True, ) - - if not HAS_PY_GITLAB: - module.fail_json(msg=missing_required_lib('python-gitlab', url='https://python-gitlab.readthedocs.io/en/stable/'), exception=GITLAB_IMP_ERR) + ensure_gitlab_package(module) access_level_int = { 'guest': gitlab.GUEST_ACCESS, diff --git a/plugins/modules/source_control/gitlab/gitlab_group_variable.py b/plugins/modules/source_control/gitlab/gitlab_group_variable.py index 9be3a3ab39..c273777ca3 100644 --- a/plugins/modules/source_control/gitlab/gitlab_group_variable.py +++ b/plugins/modules/source_control/gitlab/gitlab_group_variable.py @@ -1,10 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2020, Florent Madiot (scodeman@scode.io) +# Copyright (c) 2020, Florent Madiot (scodeman@scode.io) # Based on code: -# Copyright: (c) 2019, Markus Bergholz (markuman@gmail.com) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, Markus Bergholz (markuman@gmail.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 @@ -140,39 +141,32 @@ group_variable: description: A list of variables which were created. returned: always type: list - sample: "['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY']" + sample: ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY'] untouched: description: A list of variables which exist. returned: always type: list - sample: "['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY']" + sample: ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY'] removed: description: A list of variables which were deleted. returned: always type: list - sample: "['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY']" + sample: ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY'] updated: description: A list of variables whose values were changed. returned: always type: list - sample: "['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY']" + sample: ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY'] ''' -import traceback -from ansible.module_utils.basic import AnsibleModule, missing_required_lib +from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.api import basic_auth_argument_spec from ansible.module_utils.six import string_types from ansible.module_utils.six import integer_types -GITLAB_IMP_ERR = None -try: - import gitlab - HAS_GITLAB_PACKAGE = True -except Exception: - GITLAB_IMP_ERR = traceback.format_exc() - HAS_GITLAB_PACKAGE = False - -from ansible_collections.community.general.plugins.module_utils.gitlab import auth_argument_spec, gitlab_authentication +from ansible_collections.community.general.plugins.module_utils.gitlab import ( + auth_argument_spec, gitlab_authentication, ensure_gitlab_package +) def vars_to_variables(vars, module): @@ -415,9 +409,7 @@ def main(): ], supports_check_mode=True ) - - if not HAS_GITLAB_PACKAGE: - module.fail_json(msg=missing_required_lib("python-gitlab"), exception=GITLAB_IMP_ERR) + ensure_gitlab_package(module) purge = module.params['purge'] var_list = module.params['vars'] diff --git a/plugins/modules/source_control/gitlab/gitlab_hook.py b/plugins/modules/source_control/gitlab/gitlab_hook.py index 8a850b1c9e..f69ed8f4e1 100644 --- a/plugins/modules/source_control/gitlab/gitlab_hook.py +++ b/plugins/modules/source_control/gitlab/gitlab_hook.py @@ -1,11 +1,12 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr) -# Copyright: (c) 2018, Marcus Watkins +# Copyright (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr) +# Copyright (c) 2018, Marcus Watkins # Based on code: -# Copyright: (c) 2013, Phillip Gentry -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2013, Phillip Gentry +# 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 @@ -48,7 +49,7 @@ options: description: - Trigger hook on push events. type: bool - default: yes + default: true push_events_branch_filter: description: - Branch name of wildcard to trigger hook on push events @@ -58,42 +59,42 @@ options: description: - Trigger hook on issues events. type: bool - default: no + default: false merge_requests_events: description: - Trigger hook on merge requests events. type: bool - default: no + default: false tag_push_events: description: - Trigger hook on tag push events. type: bool - default: no + default: false note_events: description: - Trigger hook on note events or when someone adds a comment. type: bool - default: no + default: false job_events: description: - Trigger hook on job events. type: bool - default: no + default: false pipeline_events: description: - Trigger hook on pipeline events. type: bool - default: no + default: false wiki_page_events: description: - Trigger hook on wiki events. type: bool - default: no + default: false hook_validate_certs: description: - Whether GitLab will do SSL verification when triggering the hook. type: bool - default: no + default: false aliases: [ enable_ssl_verification ] token: description: @@ -112,9 +113,9 @@ EXAMPLES = ''' project: "my_group/my_project" hook_url: "https://my-ci-server.example.com/gitlab-hook" state: present - push_events: yes - tag_push_events: yes - hook_validate_certs: no + push_events: true + tag_push_events: true + hook_validate_certs: false token: "my-super-secret-token-that-my-ci-server-will-check" - name: "Delete the previous hook" @@ -158,22 +159,12 @@ hook: type: dict ''' -import re -import traceback - -GITLAB_IMP_ERR = None -try: - import gitlab - HAS_GITLAB_PACKAGE = True -except Exception: - GITLAB_IMP_ERR = traceback.format_exc() - HAS_GITLAB_PACKAGE = False - from ansible.module_utils.api import basic_auth_argument_spec -from ansible.module_utils.basic import AnsibleModule, missing_required_lib -from ansible.module_utils.common.text.converters import to_native +from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.general.plugins.module_utils.gitlab import auth_argument_spec, find_project, gitlab_authentication +from ansible_collections.community.general.plugins.module_utils.gitlab import ( + auth_argument_spec, find_project, gitlab_authentication, ensure_gitlab_package +) class GitLabHook(object): @@ -232,9 +223,8 @@ class GitLabHook(object): hook.save() except Exception as e: self._module.fail_json(msg="Failed to update hook: %s " % e) - return True - else: - return False + + return changed ''' @param project Project Object @@ -256,9 +246,9 @@ class GitLabHook(object): changed = False for arg_key, arg_value in arguments.items(): - if arguments[arg_key] is not None: - if getattr(hook, arg_key, None) != arguments[arg_key]: - setattr(hook, arg_key, arguments[arg_key]) + if arg_value is not None: + if getattr(hook, arg_key, None) != arg_value: + setattr(hook, arg_key, arg_value) changed = True return (changed, hook) @@ -286,10 +276,8 @@ class GitLabHook(object): return False def delete_hook(self): - if self._module.check_mode: - return True - - return self.hook_object.delete() + if not self._module.check_mode: + self.hook_object.delete() def main(): @@ -329,6 +317,7 @@ def main(): ], supports_check_mode=True, ) + ensure_gitlab_package(module) state = module.params['state'] project_identifier = module.params['project'] @@ -345,9 +334,6 @@ def main(): enable_ssl_verification = module.params['hook_validate_certs'] hook_token = module.params['token'] - if not HAS_GITLAB_PACKAGE: - module.fail_json(msg=missing_required_lib("python-gitlab"), exception=GITLAB_IMP_ERR) - gitlab_instance = gitlab_authentication(module) gitlab_hook = GitLabHook(module, gitlab_instance) diff --git a/plugins/modules/source_control/gitlab/gitlab_project.py b/plugins/modules/source_control/gitlab/gitlab_project.py index c151837e69..ca1f8a6c64 100644 --- a/plugins/modules/source_control/gitlab/gitlab_project.py +++ b/plugins/modules/source_control/gitlab/gitlab_project.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr) -# Copyright: (c) 2015, Werner Dijkerman (ikben@werner-dijkerman.nl) -# 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) 2015, Werner Dijkerman (ikben@werner-dijkerman.nl) +# 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 @@ -57,23 +58,23 @@ options: - Whether you want to create issues or not. - Possible values are true and false. type: bool - default: yes + default: true merge_requests_enabled: description: - If merge requests can be made or not. - Possible values are true and false. type: bool - default: yes + default: true wiki_enabled: description: - If an wiki for this project should be available or not. type: bool - default: yes + default: true snippets_enabled: description: - If creating snippets should be available or not. type: bool - default: yes + default: true visibility: description: - C(private) Project access must be granted explicitly for each user. @@ -185,7 +186,7 @@ EXAMPLES = r''' community.general.gitlab_project: api_url: https://gitlab.example.com/ api_token: "{{ access_token }}" - validate_certs: False + validate_certs: false name: my_first_project state: absent delegate_to: localhost @@ -193,15 +194,15 @@ EXAMPLES = r''' - name: Create GitLab Project in group Ansible community.general.gitlab_project: api_url: https://gitlab.example.com/ - validate_certs: True + validate_certs: true api_username: dj-wasabi api_password: "MySecretPassword" name: my_first_project group: ansible - issues_enabled: False + issues_enabled: false merge_method: rebase_merge - wiki_enabled: True - snippets_enabled: True + wiki_enabled: true + snippets_enabled: true import_url: http://git.example.com/example/lab.git initialize_with_readme: true state: present @@ -245,21 +246,14 @@ project: type: dict ''' -import traceback - -GITLAB_IMP_ERR = None -try: - import gitlab - HAS_GITLAB_PACKAGE = True -except Exception: - GITLAB_IMP_ERR = traceback.format_exc() - HAS_GITLAB_PACKAGE = False from ansible.module_utils.api import basic_auth_argument_spec -from ansible.module_utils.basic import AnsibleModule, missing_required_lib +from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.common.text.converters import to_native -from ansible_collections.community.general.plugins.module_utils.gitlab import auth_argument_spec, find_group, find_project, gitlab_authentication +from ansible_collections.community.general.plugins.module_utils.gitlab import ( + auth_argument_spec, find_group, find_project, gitlab_authentication, gitlab, ensure_gitlab_package +) class GitLabProject(object): @@ -443,6 +437,7 @@ def main(): ], supports_check_mode=True, ) + ensure_gitlab_package(module) group_identifier = module.params['group'] project_name = module.params['name'] @@ -473,9 +468,6 @@ def main(): if default_branch and not initialize_with_readme: module.fail_json(msg="Param default_branch need param initialize_with_readme set to true") - if not HAS_GITLAB_PACKAGE: - module.fail_json(msg=missing_required_lib("python-gitlab"), exception=GITLAB_IMP_ERR) - gitlab_instance = gitlab_authentication(module) # Set project_path to project_name if it is empty. diff --git a/plugins/modules/source_control/gitlab/gitlab_project_members.py b/plugins/modules/source_control/gitlab/gitlab_project_members.py index 699c6a5867..811033f312 100644 --- a/plugins/modules/source_control/gitlab/gitlab_project_members.py +++ b/plugins/modules/source_control/gitlab/gitlab_project_members.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2021, Sergey Mikhaltsov -# Copyright: (c) 2020, Zainab Alsaffar -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, Sergey Mikhaltsov +# Copyright (c) 2020, Zainab Alsaffar +# 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 @@ -90,7 +91,7 @@ EXAMPLES = r''' community.general.gitlab_project_members: api_url: 'https://gitlab.example.com' api_token: 'Your-Private-Token' - validate_certs: True + validate_certs: true project: projectname gitlab_user: username access_level: developer @@ -100,7 +101,7 @@ EXAMPLES = r''' community.general.gitlab_project_members: api_url: 'https://gitlab.example.com' api_token: 'Your-Private-Token' - validate_certs: False + validate_certs: false project: projectname gitlab_user: username state: absent @@ -154,18 +155,11 @@ EXAMPLES = r''' RETURN = r''' # ''' from ansible.module_utils.api import basic_auth_argument_spec -from ansible.module_utils.basic import AnsibleModule, missing_required_lib +from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.general.plugins.module_utils.gitlab import auth_argument_spec, gitlab_authentication - -import traceback - -try: - import gitlab - HAS_PY_GITLAB = True -except ImportError: - GITLAB_IMP_ERR = traceback.format_exc() - HAS_PY_GITLAB = False +from ansible_collections.community.general.plugins.module_utils.gitlab import ( + auth_argument_spec, gitlab_authentication, gitlab, ensure_gitlab_package +) class GitLabProjectMembers(object): @@ -280,9 +274,7 @@ def main(): ], supports_check_mode=True, ) - - if not HAS_PY_GITLAB: - module.fail_json(msg=missing_required_lib('python-gitlab', url='https://python-gitlab.readthedocs.io/en/stable/'), exception=GITLAB_IMP_ERR) + ensure_gitlab_package(module) access_level_int = { 'guest': gitlab.GUEST_ACCESS, diff --git a/plugins/modules/source_control/gitlab/gitlab_project_variable.py b/plugins/modules/source_control/gitlab/gitlab_project_variable.py index f9b8d7b6e1..cdd6402ae8 100644 --- a/plugins/modules/source_control/gitlab/gitlab_project_variable.py +++ b/plugins/modules/source_control/gitlab/gitlab_project_variable.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2019, Markus Bergholz (markuman@gmail.com) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, Markus Bergholz (markuman@gmail.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 @@ -116,8 +117,8 @@ EXAMPLES = ''' value: abc123 - name: SECRET_ACCESS_KEY value: dassgrfaeui8989 - masked: yes - protected: yes + masked: true + protected: true environment_scope: production - name: Set or update some CI/CD variables @@ -155,27 +156,26 @@ project_variable: description: A list of variables which were created. returned: always type: list - sample: "['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY']" + sample: ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY'] untouched: description: A list of variables which exist. returned: always type: list - sample: "['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY']" + sample: ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY'] removed: description: A list of variables which were deleted. returned: always type: list - sample: "['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY']" + sample: ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY'] updated: description: A list of variables whose values were changed. returned: always type: list - sample: "['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY']" + sample: ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY'] ''' import traceback from ansible.module_utils.basic import AnsibleModule, missing_required_lib -from ansible.module_utils.common.text.converters import to_native from ansible.module_utils.api import basic_auth_argument_spec from ansible.module_utils.six import string_types from ansible.module_utils.six import integer_types @@ -188,7 +188,9 @@ except Exception: GITLAB_IMP_ERR = traceback.format_exc() HAS_GITLAB_PACKAGE = False -from ansible_collections.community.general.plugins.module_utils.gitlab import auth_argument_spec, gitlab_authentication +from ansible_collections.community.general.plugins.module_utils.gitlab import ( + auth_argument_spec, gitlab_authentication, ensure_gitlab_package +) def vars_to_variables(vars, module): @@ -430,6 +432,7 @@ def main(): ], supports_check_mode=True ) + ensure_gitlab_package(module) if not HAS_GITLAB_PACKAGE: module.fail_json(msg=missing_required_lib("python-gitlab"), exception=GITLAB_IMP_ERR) diff --git a/plugins/modules/source_control/gitlab/gitlab_protected_branch.py b/plugins/modules/source_control/gitlab/gitlab_protected_branch.py index fe8e98a3f3..bddf175f0f 100644 --- a/plugins/modules/source_control/gitlab/gitlab_protected_branch.py +++ b/plugins/modules/source_control/gitlab/gitlab_protected_branch.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2021, Werner Dijkerman (ikben@werner-dijkerman.nl) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, Werner Dijkerman (ikben@werner-dijkerman.nl) +# 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 @@ -36,7 +37,7 @@ options: name: description: - The name of the branch that needs to be protected. - - Can make use a wildcard charachter for like C(production/*) or just have C(main) or C(develop) as value. + - Can make use a wildcard character for like C(production/*) or just have C(main) or C(develop) as value. required: true type: str merge_access_levels: @@ -69,22 +70,14 @@ EXAMPLES = ''' RETURN = ''' ''' -import traceback - -from ansible.module_utils.basic import AnsibleModule, missing_required_lib +from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.api import basic_auth_argument_spec from ansible_collections.community.general.plugins.module_utils.version import LooseVersion -GITLAB_IMP_ERR = None -try: - import gitlab - HAS_GITLAB_PACKAGE = True -except Exception: - GITLAB_IMP_ERR = traceback.format_exc() - HAS_GITLAB_PACKAGE = False - -from ansible_collections.community.general.plugins.module_utils.gitlab import auth_argument_spec, gitlab_authentication +from ansible_collections.community.general.plugins.module_utils.gitlab import ( + auth_argument_spec, gitlab_authentication, gitlab, ensure_gitlab_package +) class GitlabProtectedBranch(object): @@ -164,6 +157,7 @@ def main(): ], supports_check_mode=True ) + ensure_gitlab_package(module) project = module.params['project'] name = module.params['name'] @@ -171,9 +165,6 @@ def main(): push_access_level = module.params['push_access_level'] state = module.params['state'] - if not HAS_GITLAB_PACKAGE: - module.fail_json(msg=missing_required_lib("python-gitlab"), exception=GITLAB_IMP_ERR) - gitlab_version = gitlab.__version__ if LooseVersion(gitlab_version) < LooseVersion('2.3.0'): module.fail_json(msg="community.general.gitlab_proteched_branch requires python-gitlab Python module >= 2.3.0 (installed version: [%s])." diff --git a/plugins/modules/source_control/gitlab/gitlab_runner.py b/plugins/modules/source_control/gitlab/gitlab_runner.py index c31030ab01..67d998f12f 100644 --- a/plugins/modules/source_control/gitlab/gitlab_runner.py +++ b/plugins/modules/source_control/gitlab/gitlab_runner.py @@ -1,10 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2021, Raphaël Droz (raphael.droz@gmail.com) -# Copyright: (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr) -# Copyright: (c) 2018, Samy Coenen -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, Raphaël Droz (raphael.droz@gmail.com) +# Copyright (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr) +# Copyright (c) 2018, Samy Coenen +# 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 @@ -45,14 +46,14 @@ options: description: description: - The unique name of the runner. - required: True + required: true type: str aliases: - name state: description: - Make sure that the runner with the same name exists with the same configuration or delete the runner with the same name. - required: False + required: false default: present choices: ["present", "absent"] type: str @@ -65,45 +66,45 @@ options: description: - Searches only runners available to the user when searching for existing, when false admin token required. - Mutually exclusive with I(project) since community.general 4.5.0. - default: no + default: false type: bool version_added: 2.0.0 active: description: - Define if the runners is immediately active after creation. - required: False - default: yes + required: false + default: true type: bool locked: description: - Determines if the runner is locked or not. - required: False - default: False + required: false + default: false type: bool access_level: description: - Determines if a runner can pick up jobs only from protected branches. - If set to C(ref_protected), runner can pick up jobs only from protected branches. - If set to C(not_protected), runner can pick up jobs from both protected and unprotected branches. - required: False + required: false default: ref_protected choices: ["ref_protected", "not_protected"] type: str maximum_timeout: description: - The maximum time that a runner has to complete a specific job. - required: False + required: false default: 3600 type: int run_untagged: description: - Run untagged jobs or not. - required: False - default: yes + required: false + default: true type: bool tag_list: description: The tags that apply to the runner. - required: False + required: false default: [] type: list elements: str @@ -117,10 +118,10 @@ EXAMPLES = ''' registration_token: 4gfdsg345 description: Docker Machine t1 state: present - active: True + active: true tag_list: ['docker'] - run_untagged: False - locked: False + run_untagged: false + locked: false - name: "Delete runner" community.general.gitlab_runner: @@ -134,7 +135,7 @@ EXAMPLES = ''' api_url: https://gitlab.example.com/ api_token: "{{ access_token }}" description: Docker Machine t1 - owned: yes + owned: true state: absent - name: Register runner for a specific project @@ -171,24 +172,17 @@ runner: type: dict ''' -import traceback - -GITLAB_IMP_ERR = None -try: - import gitlab - HAS_GITLAB_PACKAGE = True -except Exception: - GITLAB_IMP_ERR = traceback.format_exc() - HAS_GITLAB_PACKAGE = False - from ansible.module_utils.api import basic_auth_argument_spec -from ansible.module_utils.basic import AnsibleModule, missing_required_lib +from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.common.text.converters import to_native -from ansible_collections.community.general.plugins.module_utils.gitlab import auth_argument_spec, gitlab_authentication +from ansible_collections.community.general.plugins.module_utils.gitlab import ( + auth_argument_spec, gitlab_authentication, gitlab, ensure_gitlab_package +) + try: - cmp + cmp # pylint: disable=used-before-assignment except NameError: def cmp(a, b): return (a > b) - (a < b) @@ -361,6 +355,7 @@ def main(): ], supports_check_mode=True, ) + ensure_gitlab_package(module) state = module.params['state'] runner_description = module.params['description'] @@ -373,9 +368,6 @@ def main(): registration_token = module.params['registration_token'] project = module.params['project'] - if not HAS_GITLAB_PACKAGE: - module.fail_json(msg=missing_required_lib("python-gitlab"), exception=GITLAB_IMP_ERR) - gitlab_instance = gitlab_authentication(module) gitlab_project = None if project: diff --git a/plugins/modules/source_control/gitlab/gitlab_user.py b/plugins/modules/source_control/gitlab/gitlab_user.py index 803c54bc83..4824f7301f 100644 --- a/plugins/modules/source_control/gitlab/gitlab_user.py +++ b/plugins/modules/source_control/gitlab/gitlab_user.py @@ -1,10 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2021, Lennert Mertens (lennert@nubera.be) -# Copyright: (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr) -# Copyright: (c) 2015, Werner Dijkerman (ikben@werner-dijkerman.nl) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, Lennert Mertens (lennert@nubera.be) +# Copyright (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr) +# Copyright (c) 2015, Werner Dijkerman (ikben@werner-dijkerman.nl) +# 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 @@ -101,17 +102,17 @@ options: description: - Require confirmation. type: bool - default: yes + default: true isadmin: description: - Grant admin privileges to the user. type: bool - default: no + default: false external: description: - Define external parameter for this user. type: bool - default: no + default: false identities: description: - List of identities to be added/updated for this user. @@ -143,14 +144,14 @@ EXAMPLES = ''' community.general.gitlab_user: api_url: https://gitlab.example.com/ api_token: "{{ access_token }}" - validate_certs: False + validate_certs: false username: myusername state: absent - name: "Create GitLab User" community.general.gitlab_user: api_url: https://gitlab.example.com/ - validate_certs: True + validate_certs: true api_username: dj-wasabi api_password: "MySecretPassword" name: My Name @@ -166,7 +167,7 @@ EXAMPLES = ''' - name: "Create GitLab User using external identity provider" community.general.gitlab_user: api_url: https://gitlab.example.com/ - validate_certs: True + validate_certs: true api_token: "{{ access_token }}" name: My Name username: myusername @@ -183,7 +184,7 @@ EXAMPLES = ''' community.general.gitlab_user: api_url: https://gitlab.example.com/ api_token: "{{ access_token }}" - validate_certs: False + validate_certs: false username: myusername state: blocked @@ -191,7 +192,7 @@ EXAMPLES = ''' community.general.gitlab_user: api_url: https://gitlab.example.com/ api_token: "{{ access_token }}" - validate_certs: False + validate_certs: false username: myusername state: unblocked ''' @@ -220,21 +221,14 @@ user: type: dict ''' -import traceback - -GITLAB_IMP_ERR = None -try: - import gitlab - HAS_GITLAB_PACKAGE = True -except Exception: - GITLAB_IMP_ERR = traceback.format_exc() - HAS_GITLAB_PACKAGE = False from ansible.module_utils.api import basic_auth_argument_spec -from ansible.module_utils.basic import AnsibleModule, missing_required_lib +from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.common.text.converters import to_native -from ansible_collections.community.general.plugins.module_utils.gitlab import auth_argument_spec, find_group, gitlab_authentication +from ansible_collections.community.general.plugins.module_utils.gitlab import ( + auth_argument_spec, find_group, gitlab_authentication, gitlab, ensure_gitlab_package +) class GitLabUser(object): @@ -305,7 +299,7 @@ class GitLabUser(object): # note: as we unfortunately have some uncheckable parameters # where it is not possible to determine if the update # changed something or not, we must assume here that a - # changed happend and that an user object update is needed + # changed happened and that an user object update is needed potentionally_changed = True # Assign ssh keys @@ -615,6 +609,7 @@ def main(): ('state', 'present', ['name', 'email']), ) ) + ensure_gitlab_package(module) user_name = module.params['name'] state = module.params['state'] @@ -633,9 +628,6 @@ def main(): user_identities = module.params['identities'] overwrite_identities = module.params['overwrite_identities'] - if not HAS_GITLAB_PACKAGE: - module.fail_json(msg=missing_required_lib("python-gitlab"), exception=GITLAB_IMP_ERR) - gitlab_instance = gitlab_authentication(module) gitlab_user = GitLabUser(module, gitlab_instance) diff --git a/plugins/modules/source_control/hg.py b/plugins/modules/source_control/hg.py index 572b036e1f..777feaa059 100644 --- a/plugins/modules/source_control/hg.py +++ b/plugins/modules/source_control/hg.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2013, Yeukhon Wong -# Copyright: (c) 2014, Nate Coraor -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2013, Yeukhon Wong +# Copyright (c) 2014, Nate Coraor +# 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 @@ -19,7 +20,7 @@ options: repo: description: - The repository address. - required: yes + required: true aliases: [ name ] type: str dest: @@ -36,24 +37,24 @@ options: force: description: - Discards uncommitted changes. Runs C(hg update -C). Prior to - 1.9, the default was `yes`. + 1.9, the default was C(true). type: bool - default: 'no' + default: false purge: description: - Deletes untracked files. Runs C(hg purge). type: bool - default: 'no' + default: false update: description: - - If C(no), do not retrieve new revisions from the origin repository + - If C(false), do not retrieve new revisions from the origin repository type: bool - default: 'yes' + default: true clone: description: - - If C(no), do not clone the repository if it does not exist locally. + - If C(false), do not clone the repository if it does not exist locally. type: bool - default: 'yes' + default: true executable: description: - Path to hg executable to use. If not supplied, @@ -76,14 +77,14 @@ EXAMPLES = ''' repo: https://bitbucket.org/user/repo1 dest: /home/user/repo1 revision: stable - purge: yes + purge: true - name: Get information about the repository whether or not it has already been cloned locally. community.general.hg: repo: git://bitbucket.org/user/repo dest: /srv/checkout - clone: no - update: no + clone: false + update: false ''' import os @@ -244,7 +245,7 @@ def main(): cleaned = False if not dest and (clone or update): - module.fail_json(msg="the destination directory must be specified unless clone=no and update=no") + module.fail_json(msg="the destination directory must be specified unless clone=false and update=false") hg = Hg(module, dest, repo, revision, hg_path) diff --git a/plugins/modules/storage/emc/emc_vnx_sg_member.py b/plugins/modules/storage/emc/emc_vnx_sg_member.py index 20977687fc..39c0ab3a99 100644 --- a/plugins/modules/storage/emc/emc_vnx_sg_member.py +++ b/plugins/modules/storage/emc/emc_vnx_sg_member.py @@ -3,7 +3,8 @@ # # Copyright (c) 2018, Luca 'remix_tj' Lorenzetto # -# 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/modules/storage/hpe3par/ss_3par_cpg.py b/plugins/modules/storage/hpe3par/ss_3par_cpg.py index be4a6a02a2..f692ff3ecb 100644 --- a/plugins/modules/storage/hpe3par/ss_3par_cpg.py +++ b/plugins/modules/storage/hpe3par/ss_3par_cpg.py @@ -1,8 +1,8 @@ #!/usr/bin/python # -*- 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 @@ -85,7 +85,7 @@ options: description: - Specifies whether the certificate needs to be validated while communicating. type: bool - default: no + default: false extends_documentation_fragment: - community.general.hpe3par @@ -108,7 +108,7 @@ EXAMPLES = r''' set_size: 8 high_availability: MAG disk_type: FC - secure: no + secure: false - name: Delete CPG sample_cpg community.general.ss_3par_cpg: @@ -117,7 +117,7 @@ EXAMPLES = r''' storage_system_password: password state: absent cpg_name: sample_cpg - secure: no + secure: false ''' RETURN = r''' diff --git a/plugins/modules/storage/ibm/ibm_sa_domain.py b/plugins/modules/storage/ibm/ibm_sa_domain.py index 9c5e6c50c8..26e4b7e47c 100644 --- a/plugins/modules/storage/ibm/ibm_sa_domain.py +++ b/plugins/modules/storage/ibm/ibm_sa_domain.py @@ -1,11 +1,11 @@ #!/usr/bin/python # -*- 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/modules/storage/ibm/ibm_sa_host.py b/plugins/modules/storage/ibm/ibm_sa_host.py index 27a7287f8a..2902a02028 100644 --- a/plugins/modules/storage/ibm/ibm_sa_host.py +++ b/plugins/modules/storage/ibm/ibm_sa_host.py @@ -4,7 +4,8 @@ # 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/modules/storage/ibm/ibm_sa_host_ports.py b/plugins/modules/storage/ibm/ibm_sa_host_ports.py index 32daa9f3c7..147c434344 100644 --- a/plugins/modules/storage/ibm/ibm_sa_host_ports.py +++ b/plugins/modules/storage/ibm/ibm_sa_host_ports.py @@ -4,7 +4,8 @@ # 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/modules/storage/ibm/ibm_sa_pool.py b/plugins/modules/storage/ibm/ibm_sa_pool.py index 67c963ace1..6393a70686 100644 --- a/plugins/modules/storage/ibm/ibm_sa_pool.py +++ b/plugins/modules/storage/ibm/ibm_sa_pool.py @@ -4,7 +4,8 @@ # 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/modules/storage/ibm/ibm_sa_vol.py b/plugins/modules/storage/ibm/ibm_sa_vol.py index 7820d26828..6e28fcfd05 100644 --- a/plugins/modules/storage/ibm/ibm_sa_vol.py +++ b/plugins/modules/storage/ibm/ibm_sa_vol.py @@ -4,7 +4,8 @@ # 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/modules/storage/ibm/ibm_sa_vol_map.py b/plugins/modules/storage/ibm/ibm_sa_vol_map.py index b449ba8de4..72de7d8c07 100644 --- a/plugins/modules/storage/ibm/ibm_sa_vol_map.py +++ b/plugins/modules/storage/ibm/ibm_sa_vol_map.py @@ -4,8 +4,8 @@ # 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/modules/storage/pmem/pmem.py b/plugins/modules/storage/pmem/pmem.py index b91bab5fad..8cc14c4693 100644 --- a/plugins/modules/storage/pmem/pmem.py +++ b/plugins/modules/storage/pmem/pmem.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2022, Masayoshi Mizuma -# 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 @@ -99,7 +100,7 @@ options: - The size of namespace. This option supports the suffixes C(k) or C(K) or C(KB) for KiB, C(m) or C(M) or C(MB) for MiB, C(g) or C(G) or C(GB) for GiB and C(t) or C(T) or C(TB) for TiB. - This option is required if multiple namespaces are configured. - - If this option is not set, all of the avaiable space of a region is configured. + - If this option is not set, all of the available space of a region is configured. type: str required: false namespace_append: @@ -116,7 +117,7 @@ reboot_required: description: Indicates that the system reboot is required to complete the PMem configuration. returned: success type: bool - sample: True + sample: true result: description: - Shows the value of AppDirect, Memory Mode and Reserved size in bytes. @@ -172,7 +173,7 @@ EXAMPLES = r''' - name: Configure the Pmem as AppDirect with not interleaved 10, Memory Mode 70, and the Reserved 20 percent. community.general.pmem: appdirect: 10 - appdirect_interleaved: False + appdirect_interleaved: false memorymode: 70 - name: Configure the Pmem each socket. @@ -180,7 +181,7 @@ EXAMPLES = r''' socket: - id: 0 appdirect: 10 - appdirect_interleaved: False + appdirect_interleaved: false memorymode: 70 reserved: 20 - id: 1 @@ -211,6 +212,7 @@ except ImportError: XMLTODICT_LIBRARY_IMPORT_ERROR = traceback.format_exc() else: HAS_XMLTODICT_LIBRARY = True + XMLTODICT_LIBRARY_IMPORT_ERROR = None class PersistentMemory(object): diff --git a/plugins/modules/storage/vexata/vexata_eg.py b/plugins/modules/storage/vexata/vexata_eg.py index 54bb8c29a7..f1d3960406 100644 --- a/plugins/modules/storage/vexata/vexata_eg.py +++ b/plugins/modules/storage/vexata/vexata_eg.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2019, Sandeep Kasargod (sandeep@vexata.com) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, Sandeep Kasargod (sandeep@vexata.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/modules/storage/vexata/vexata_volume.py b/plugins/modules/storage/vexata/vexata_volume.py index 1cf4cd7b5c..e443e5f6c4 100644 --- a/plugins/modules/storage/vexata/vexata_volume.py +++ b/plugins/modules/storage/vexata/vexata_volume.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2019, Sandeep Kasargod (sandeep@vexata.com) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, Sandeep Kasargod (sandeep@vexata.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/modules/storage/zfs/zfs.py b/plugins/modules/storage/zfs/zfs.py index e206a8f7ba..a09a386f41 100644 --- a/plugins/modules/storage/zfs/zfs.py +++ b/plugins/modules/storage/zfs/zfs.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2013, Johan Wiren -# 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) 2013, Johan Wiren +# 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 @@ -160,7 +161,7 @@ class Zfs(object): elif prop == 'volblocksize': cmd += ['-b', value] else: - cmd += ['-o', '%s="%s"' % (prop, value)] + cmd += ['-o', '%s=%s' % (prop, value)] if origin and action == 'clone': cmd.append(origin) cmd.append(self.name) diff --git a/plugins/modules/storage/zfs/zfs_delegate_admin.py b/plugins/modules/storage/zfs/zfs_delegate_admin.py index ead4041150..36a213a0fe 100644 --- a/plugins/modules/storage/zfs/zfs_delegate_admin.py +++ b/plugins/modules/storage/zfs/zfs_delegate_admin.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2015, Nate Coraor -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2015, Nate Coraor +# 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 @@ -17,7 +18,7 @@ description: - See the C(zfs allow) section of C(zfs(1M)) for detailed explanations of options. - This module attempts to adhere to the behavior of the command line tool as much as possible. requirements: - - "A ZFS/OpenZFS implementation that supports delegation with `zfs allow`, including: Solaris >= 10, illumos (all + - "A ZFS/OpenZFS implementation that supports delegation with C(zfs allow), including: Solaris >= 10, illumos (all versions), FreeBSD >= 8.0R, ZFS on Linux >= 0.7.0." options: name: @@ -47,7 +48,7 @@ options: description: - Apply permissions to everyone. type: bool - default: no + default: false permissions: description: - The list of permission(s) to delegate (required if C(state) is C(present)). @@ -67,7 +68,7 @@ options: description: - Unallow permissions recursively (ignored when C(state) is C(present)). type: bool - default: no + default: false author: - Nate Coraor (@natefoo) ''' @@ -83,7 +84,7 @@ EXAMPLES = r''' community.general.zfs_delegate_admin: name: rpool/myvol groups: backup - everyone: yes + everyone: true permissions: send - name: Grant `zfs send,receive` to users `foo` and `bar` with local scope only @@ -91,12 +92,12 @@ EXAMPLES = r''' name: rpool/myfs users: foo,bar permissions: send,receive - local: yes + local: true - name: Revoke all permissions from everyone (permissions specifically assigned to users and groups remain) community.general.zfs_delegate_admin: name: rpool/myfs - everyone: yes + everyone: true state: absent ''' diff --git a/plugins/modules/storage/zfs/zfs_facts.py b/plugins/modules/storage/zfs/zfs_facts.py index cb106de111..ee0884f995 100644 --- a/plugins/modules/storage/zfs/zfs_facts.py +++ b/plugins/modules/storage/zfs/zfs_facts.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2016, Adam Števko -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, Adam Števko +# 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 @@ -19,7 +20,7 @@ options: name: description: - ZFS dataset name. - required: yes + required: true aliases: [ "ds", "dataset" ] type: str recurse: @@ -27,13 +28,13 @@ options: - Specifies if properties for any children should be recursively displayed. type: bool - default: 'no' + default: false parsable: description: - Specifies if property values should be displayed in machine friendly format. type: bool - default: 'no' + default: false properties: description: - Specifies which dataset properties should be queried in comma-separated format. @@ -61,7 +62,7 @@ EXAMPLES = ''' - name: Report space usage on ZFS filesystems under data/home community.general.zfs_facts: name: data/home - recurse: yes + recurse: true type: filesystem - ansible.builtin.debug: @@ -79,12 +80,12 @@ parsable: description: if parsable output should be provided in machine friendly format. returned: if 'parsable' is set to True type: bool - sample: True + sample: true recurse: description: if we should recurse over ZFS dataset returned: if 'recurse' is set to True type: bool - sample: True + sample: true zfs_datasets: description: ZFS dataset facts returned: always diff --git a/plugins/modules/storage/zfs/zpool_facts.py b/plugins/modules/storage/zfs/zpool_facts.py index b7a66255c6..a749438659 100644 --- a/plugins/modules/storage/zfs/zpool_facts.py +++ b/plugins/modules/storage/zfs/zpool_facts.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2016, Adam Števko -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, Adam Števko +# 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 @@ -27,7 +28,7 @@ options: - Specifies if property values should be displayed in machine friendly format. type: bool - default: False + default: false required: false properties: description: @@ -112,7 +113,7 @@ parsable: description: if parsable output should be provided in machine friendly format. returned: if 'parsable' is set to True type: bool - sample: True + sample: true ''' from collections import defaultdict diff --git a/plugins/modules/system/aix_devices.py b/plugins/modules/system/aix_devices.py index 89468059f3..be23937baa 100644 --- a/plugins/modules/system/aix_devices.py +++ b/plugins/modules/system/aix_devices.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2017, 2018 Kairo Araujo -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017, 2018 Kairo Araujo +# 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 @@ -29,12 +30,12 @@ options: description: - Forces action. type: bool - default: no + default: false recursive: description: - Removes or defines a device and children devices. type: bool - default: no + default: false state: description: - Controls the device state. @@ -86,13 +87,13 @@ EXAMPLES = r''' - name: Put vscsi1 and children devices in Defined state. community.general.aix_devices: device: vscsi1 - recursive: yes + recursive: true state: defined - name: Removes vscsi1 and children devices. community.general.aix_devices: device: vscsi1 - recursive: yes + recursive: true state: removed - name: Changes en1 mtu to 9000 and disables arp. diff --git a/plugins/modules/system/aix_filesystem.py b/plugins/modules/system/aix_filesystem.py index a47c29f04b..77d065a59a 100644 --- a/plugins/modules/system/aix_filesystem.py +++ b/plugins/modules/system/aix_filesystem.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2017, Kairo Araujo -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017, Kairo Araujo +# 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 @@ -23,18 +24,20 @@ options: description: - Specifies whether the file system is to be processed by the accounting subsystem. type: bool - default: no + default: false attributes: description: - Specifies attributes for files system separated by comma. type: list elements: str - default: agblksize='4096',isnapshot='no' + default: + - agblksize='4096' + - isnapshot='no' auto_mount: description: - File system is automatically mounted at system restart. type: bool - default: yes + default: true device: description: - Logical volume (LV) device name or remote export device to create a NFS file system. @@ -69,7 +72,7 @@ options: description: - Removes the mount point directory when used with state C(absent). type: bool - default: no + default: false size: description: - Specifies the file system size. @@ -105,56 +108,56 @@ EXAMPLES = r''' - name: Create filesystem in a previously defined logical volume. community.general.aix_filesystem: device: testlv - community.general.filesystem: /testfs + filesystem: /testfs state: present - name: Creating NFS filesystem from nfshost. community.general.aix_filesystem: device: /home/ftp nfs_server: nfshost - community.general.filesystem: /home/ftp + filesystem: /home/ftp state: present - name: Creating a new file system without a previously logical volume. community.general.aix_filesystem: - community.general.filesystem: /newfs + filesystem: /newfs size: 1G state: present vg: datavg - name: Unmounting /testfs. community.general.aix_filesystem: - community.general.filesystem: /testfs + filesystem: /testfs state: unmounted - name: Resizing /mksysb to +512M. community.general.aix_filesystem: - community.general.filesystem: /mksysb + filesystem: /mksysb size: +512M state: present - name: Resizing /mksysb to 11G. community.general.aix_filesystem: - community.general.filesystem: /mksysb + filesystem: /mksysb size: 11G state: present - name: Resizing /mksysb to -2G. community.general.aix_filesystem: - community.general.filesystem: /mksysb + filesystem: /mksysb size: -2G state: present - name: Remove NFS filesystem /home/ftp. community.general.aix_filesystem: - community.general.filesystem: /home/ftp - rm_mount_point: yes + filesystem: /home/ftp + rm_mount_point: true state: absent - name: Remove /newfs. community.general.aix_filesystem: - community.general.filesystem: /newfs - rm_mount_point: yes + filesystem: /newfs + rm_mount_point: true state: absent ''' diff --git a/plugins/modules/system/aix_inittab.py b/plugins/modules/system/aix_inittab.py index c2daface36..57ef4758cb 100644 --- a/plugins/modules/system/aix_inittab.py +++ b/plugins/modules/system/aix_inittab.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2017, Joris Weijters -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017, Joris Weijters +# 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 @@ -20,13 +21,13 @@ options: description: - Name of the inittab entry. type: str - required: yes + required: true aliases: [ service ] runlevel: description: - Runlevel of the entry. type: str - required: yes + required: true action: description: - Action what the init has to do with this entry. @@ -48,7 +49,7 @@ options: description: - What command has to run. type: str - required: yes + required: true insertafter: description: - After which inittabline should the new entry inserted. @@ -77,7 +78,7 @@ EXAMPLES = ''' command: echo hello insertafter: existingservice state: present - become: yes + become: true # Change inittab entry startmyservice to runlevel "2" and processaction "wait". - name: Change startmyservice to inittab @@ -87,7 +88,7 @@ EXAMPLES = ''' action: wait command: echo hello state: present - become: yes + become: true - name: Remove startmyservice from inittab community.general.aix_inittab: @@ -96,7 +97,7 @@ EXAMPLES = ''' action: wait command: echo hello state: absent - become: yes + become: true ''' RETURN = ''' diff --git a/plugins/modules/system/aix_lvg.py b/plugins/modules/system/aix_lvg.py index 37bf71a4bc..44ad631236 100644 --- a/plugins/modules/system/aix_lvg.py +++ b/plugins/modules/system/aix_lvg.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2017, Kairo Araujo -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017, Kairo Araujo +# 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 @@ -20,7 +21,7 @@ options: description: - Force volume group creation. type: bool - default: no + default: false pp_size: description: - The size of the physical partition in megabytes. diff --git a/plugins/modules/system/aix_lvol.py b/plugins/modules/system/aix_lvol.py index 02b4f06c5b..99bd3ead9b 100644 --- a/plugins/modules/system/aix_lvol.py +++ b/plugins/modules/system/aix_lvol.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2016, Alain Dejoux -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, Alain Dejoux +# 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/modules/system/alternatives.py b/plugins/modules/system/alternatives.py index ca075d69b4..4566144493 100644 --- a/plugins/modules/system/alternatives.py +++ b/plugins/modules/system/alternatives.py @@ -1,9 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2014, Gabe Mulley -# Copyright: (c) 2015, David Wittman -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2014, Gabe Mulley +# Copyright (c) 2015, David Wittman +# Copyright (c) 2022, Marius Rieder +# 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 @@ -17,6 +19,7 @@ description: - Manages symbolic links using the 'update-alternatives' tool. - Useful when multiple programs are installed but provide similar functionality (e.g. different editors). author: + - Marius Rieder (@jiuka) - David Wittman (@DavidWittman) - Gabe Mulley (@mulby) options: @@ -38,19 +41,45 @@ options: type: path priority: description: - - The priority of the alternative. + - The priority of the alternative. If no priority is given for creation C(50) is used as a fallback. type: int - default: 50 state: description: - C(present) - install the alternative (if not already installed), but do not set it as the currently selected alternative for the group. - C(selected) - install the alternative (if not already installed), and set it as the currently selected alternative for the group. - choices: [ present, selected ] + - C(auto) - install the alternative (if not already installed), and + set the group to auto mode. Added in community.general 5.1.0. + - C(absent) - removes the alternative. Added in community.general 5.1.0. + choices: [ present, selected, auto, absent ] default: selected type: str version_added: 4.8.0 + subcommands: + description: + - A list of subcommands. + - Each subcommand needs a name, a link and a path parameter. + type: list + elements: dict + aliases: ['slaves'] + suboptions: + name: + description: + - The generic name of the subcommand. + type: str + required: true + path: + description: + - The path to the real executable that the subcommand should point to. + type: path + required: true + link: + description: + - The path to the symbolic link that should point to the real subcommand executable. + type: path + required: true + version_added: 5.1.0 requirements: [ update-alternatives ] ''' @@ -78,11 +107,27 @@ EXAMPLES = r''' path: /usr/bin/python3.5 link: /usr/bin/python state: present + +- name: Install Python 3.5 and reset selection to auto + community.general.alternatives: + name: python + path: /usr/bin/python3.5 + link: /usr/bin/python + state: auto + +- name: keytool is a subcommand of java + community.general.alternatives: + name: java + link: /usr/bin/java + path: /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java + subcommands: + - name: keytool + link: /usr/bin/keytool + path: /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/keytool ''' import os import re -import subprocess from ansible.module_utils.basic import AnsibleModule @@ -90,10 +135,238 @@ from ansible.module_utils.basic import AnsibleModule class AlternativeState: PRESENT = "present" SELECTED = "selected" + ABSENT = "absent" + AUTO = "auto" @classmethod def to_list(cls): - return [cls.PRESENT, cls.SELECTED] + return [cls.PRESENT, cls.SELECTED, cls.ABSENT, cls.AUTO] + + +class AlternativesModule(object): + _UPDATE_ALTERNATIVES = None + + def __init__(self, module): + self.module = module + self.result = dict(changed=False, diff=dict(before=dict(), after=dict())) + self.module.run_command_environ_update = {'LC_ALL': 'C'} + self.messages = [] + self.run() + + @property + def mode_present(self): + return self.module.params.get('state') in [AlternativeState.PRESENT, AlternativeState.SELECTED, AlternativeState.AUTO] + + @property + def mode_selected(self): + return self.module.params.get('state') == AlternativeState.SELECTED + + @property + def mode_auto(self): + return self.module.params.get('state') == AlternativeState.AUTO + + def run(self): + self.parse() + + if self.mode_present: + # Check if we need to (re)install + subcommands_parameter = self.module.params['subcommands'] + priority_parameter = self.module.params['priority'] + if ( + self.path not in self.current_alternatives or + (priority_parameter is not None and self.current_alternatives[self.path].get('priority') != priority_parameter) or + (subcommands_parameter is not None and ( + not all(s in subcommands_parameter for s in self.current_alternatives[self.path].get('subcommands')) or + not all(s in self.current_alternatives[self.path].get('subcommands') for s in subcommands_parameter) + )) + ): + self.install() + + # Check if we need to set the preference + if self.mode_selected and self.current_path != self.path: + self.set() + + # Check if we need to reset to auto + if self.mode_auto and self.current_mode == 'manual': + self.auto() + else: + # Check if we need to uninstall + if self.path in self.current_alternatives: + self.remove() + + self.result['msg'] = ' '.join(self.messages) + self.module.exit_json(**self.result) + + def install(self): + if not os.path.exists(self.path): + self.module.fail_json(msg="Specified path %s does not exist" % self.path) + if not self.link: + self.module.fail_json(msg='Needed to install the alternative, but unable to do so as we are missing the link') + + cmd = [self.UPDATE_ALTERNATIVES, '--install', self.link, self.name, self.path, str(self.priority)] + + if self.module.params['subcommands'] is not None: + subcommands = [['--slave', subcmd['link'], subcmd['name'], subcmd['path']] for subcmd in self.subcommands] + cmd += [item for sublist in subcommands for item in sublist] + + self.result['changed'] = True + self.messages.append("Install alternative '%s' for '%s'." % (self.path, self.name)) + + if not self.module.check_mode: + self.module.run_command(cmd, check_rc=True) + + if self.module._diff: + self.result['diff']['after'] = dict( + state=AlternativeState.PRESENT, + path=self.path, + priority=self.priority, + link=self.link, + ) + if self.subcommands: + self.result['diff']['after'].update(dict( + subcommands=self.subcommands + )) + + def remove(self): + cmd = [self.UPDATE_ALTERNATIVES, '--remove', self.name, self.path] + self.result['changed'] = True + self.messages.append("Remove alternative '%s' from '%s'." % (self.path, self.name)) + + if not self.module.check_mode: + self.module.run_command(cmd, check_rc=True) + + if self.module._diff: + self.result['diff']['after'] = dict(state=AlternativeState.ABSENT) + + def set(self): + cmd = [self.UPDATE_ALTERNATIVES, '--set', self.name, self.path] + self.result['changed'] = True + self.messages.append("Set alternative '%s' for '%s'." % (self.path, self.name)) + + if not self.module.check_mode: + self.module.run_command(cmd, check_rc=True) + + if self.module._diff: + self.result['diff']['after']['state'] = AlternativeState.SELECTED + + def auto(self): + cmd = [self.UPDATE_ALTERNATIVES, '--auto', self.name] + self.messages.append("Set alternative to auto for '%s'." % (self.name)) + self.result['changed'] = True + + if not self.module.check_mode: + self.module.run_command(cmd, check_rc=True) + + if self.module._diff: + self.result['diff']['after']['state'] = AlternativeState.PRESENT + + @property + def name(self): + return self.module.params.get('name') + + @property + def path(self): + return self.module.params.get('path') + + @property + def link(self): + return self.module.params.get('link') or self.current_link + + @property + def priority(self): + if self.module.params.get('priority') is not None: + return self.module.params.get('priority') + return self.current_alternatives.get(self.path, {}).get('priority', 50) + + @property + def subcommands(self): + if self.module.params.get('subcommands') is not None: + return self.module.params.get('subcommands') + elif self.path in self.current_alternatives and self.current_alternatives[self.path].get('subcommands'): + return self.current_alternatives[self.path].get('subcommands') + return None + + @property + def UPDATE_ALTERNATIVES(self): + if self._UPDATE_ALTERNATIVES is None: + self._UPDATE_ALTERNATIVES = self.module.get_bin_path('update-alternatives', True) + return self._UPDATE_ALTERNATIVES + + def parse(self): + self.current_mode = None + self.current_path = None + self.current_link = None + self.current_alternatives = {} + + # Run `update-alternatives --display ` to find existing alternatives + (rc, display_output, dummy) = self.module.run_command( + [self.UPDATE_ALTERNATIVES, '--display', self.name] + ) + + if rc != 0: + self.module.debug("No current alternative found. '%s' exited with %s" % (self.UPDATE_ALTERNATIVES, rc)) + return + + current_mode_regex = re.compile(r'\s-\s(?:status\sis\s)?(\w*)(?:\smode|.)$', re.MULTILINE) + current_path_regex = re.compile(r'^\s*link currently points to (.*)$', re.MULTILINE) + current_link_regex = re.compile(r'^\s*link \w+ is (.*)$', re.MULTILINE) + subcmd_path_link_regex = re.compile(r'^\s*slave (\S+) is (.*)$', re.MULTILINE) + + alternative_regex = re.compile(r'^(\/.*)\s-\s(?:family\s\S+\s)?priority\s(\d+)((?:\s+slave.*)*)', re.MULTILINE) + subcmd_regex = re.compile(r'^\s+slave (.*): (.*)$', re.MULTILINE) + + match = current_mode_regex.search(display_output) + if not match: + self.module.debug("No current mode found in output") + return + self.current_mode = match.group(1) + + match = current_path_regex.search(display_output) + if not match: + self.module.debug("No current path found in output") + else: + self.current_path = match.group(1) + + match = current_link_regex.search(display_output) + if not match: + self.module.debug("No current link found in output") + else: + self.current_link = match.group(1) + + subcmd_path_map = dict(subcmd_path_link_regex.findall(display_output)) + if not subcmd_path_map and self.subcommands: + subcmd_path_map = dict((s['name'], s['link']) for s in self.subcommands) + + for path, prio, subcmd in alternative_regex.findall(display_output): + self.current_alternatives[path] = dict( + priority=int(prio), + subcommands=[dict( + name=name, + path=spath, + link=subcmd_path_map.get(name) + ) for name, spath in subcmd_regex.findall(subcmd) if spath != '(null)'] + ) + + if self.module._diff: + if self.path in self.current_alternatives: + self.result['diff']['before'].update(dict( + state=AlternativeState.PRESENT, + path=self.path, + priority=self.current_alternatives[self.path].get('priority'), + link=self.current_link, + )) + if self.current_alternatives[self.path].get('subcommands'): + self.result['diff']['before'].update(dict( + subcommands=self.current_alternatives[self.path].get('subcommands') + )) + if self.current_mode == 'manual' and self.current_path != self.path: + self.result['diff']['before'].update(dict( + state=AlternativeState.SELECTED + )) + else: + self.result['diff']['before'].update(dict( + state=AlternativeState.ABSENT + )) def main(): @@ -103,115 +376,22 @@ def main(): name=dict(type='str', required=True), path=dict(type='path', required=True), link=dict(type='path'), - priority=dict(type='int', default=50), + priority=dict(type='int'), state=dict( type='str', choices=AlternativeState.to_list(), default=AlternativeState.SELECTED, ), + subcommands=dict(type='list', elements='dict', aliases=['slaves'], options=dict( + name=dict(type='str', required=True), + path=dict(type='path', required=True), + link=dict(type='path', required=True), + )), ), supports_check_mode=True, ) - params = module.params - name = params['name'] - path = params['path'] - link = params['link'] - priority = params['priority'] - state = params['state'] - - UPDATE_ALTERNATIVES = module.get_bin_path('update-alternatives', True) - - current_path = None - all_alternatives = [] - - # Run `update-alternatives --display ` to find existing alternatives - (rc, display_output, dummy) = module.run_command( - ['env', 'LC_ALL=C', UPDATE_ALTERNATIVES, '--display', name] - ) - - if rc == 0: - # Alternatives already exist for this link group - # Parse the output to determine the current path of the symlink and - # available alternatives - current_path_regex = re.compile(r'^\s*link currently points to (.*)$', - re.MULTILINE) - alternative_regex = re.compile(r'^(\/.*)\s-\s(?:family\s\S+\s)?priority', re.MULTILINE) - - match = current_path_regex.search(display_output) - if match: - current_path = match.group(1) - all_alternatives = alternative_regex.findall(display_output) - - if not link: - # Read the current symlink target from `update-alternatives --query` - # in case we need to install the new alternative before setting it. - # - # This is only compatible on Debian-based systems, as the other - # alternatives don't have --query available - rc, query_output, dummy = module.run_command( - ['env', 'LC_ALL=C', UPDATE_ALTERNATIVES, '--query', name] - ) - if rc == 0: - for line in query_output.splitlines(): - if line.startswith('Link:'): - link = line.split()[1] - break - - changed = False - if current_path != path: - - # Check mode: expect a change if this alternative is not already - # installed, or if it is to be set as the current selection. - if module.check_mode: - module.exit_json( - changed=( - path not in all_alternatives or - state == AlternativeState.SELECTED - ), - current_path=current_path, - ) - - try: - # install the requested path if necessary - if path not in all_alternatives: - if not os.path.exists(path): - module.fail_json(msg="Specified path %s does not exist" % path) - if not link: - module.fail_json(msg="Needed to install the alternative, but unable to do so as we are missing the link") - - module.run_command( - [UPDATE_ALTERNATIVES, '--install', link, name, path, str(priority)], - check_rc=True - ) - changed = True - - # set the current selection to this path (if requested) - if state == AlternativeState.SELECTED: - module.run_command( - [UPDATE_ALTERNATIVES, '--set', name, path], - check_rc=True - ) - changed = True - - except subprocess.CalledProcessError as cpe: - module.fail_json(msg=str(dir(cpe))) - elif current_path == path and state == AlternativeState.PRESENT: - # Case where alternative is currently selected, but state is set - # to 'present'. In this case, we set to auto mode. - if module.check_mode: - module.exit_json(changed=True, current_path=current_path) - - changed = True - try: - module.run_command( - [UPDATE_ALTERNATIVES, '--auto', name], - check_rc=True, - ) - except subprocess.CalledProcessError as cpe: - module.fail_json(msg=str(dir(cpe))) - - module.exit_json(changed=changed) + AlternativesModule(module) if __name__ == '__main__': diff --git a/plugins/modules/system/awall.py b/plugins/modules/system/awall.py index 260c7ae4d0..dc13d46789 100644 --- a/plugins/modules/system/awall.py +++ b/plugins/modules/system/awall.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2017, Ted Trask -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017, Ted Trask +# 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 @@ -34,7 +35,7 @@ options: - Activate the new firewall rules. - Can be run with other steps or on its own. type: bool - default: no + default: false ''' EXAMPLES = r''' @@ -49,11 +50,11 @@ EXAMPLES = r''' - foo - bar state: disabled - activate: no + activate: false - name: Activate currently enabled firewall rules community.general.awall: - activate: yes + activate: true ''' RETURN = ''' # ''' diff --git a/plugins/modules/system/beadm.py b/plugins/modules/system/beadm.py index d89ca79af1..8cb43c6cbb 100644 --- a/plugins/modules/system/beadm.py +++ b/plugins/modules/system/beadm.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2016, Adam Števko -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, Adam Števko +# 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 @@ options: description: - ZFS boot environment name. type: str - required: True + required: true aliases: [ "be" ] snapshot: description: @@ -132,11 +133,10 @@ force: description: If forced action is wanted returned: always type: bool - sample: False + sample: false ''' import os -import re from ansible.module_utils.basic import AnsibleModule @@ -164,10 +164,10 @@ class BE(object): for line in out.splitlines(): if self.is_freebsd: check = line.split() - if(check == []): + if check == []: continue full_name = check[0].split('/') - if(full_name == []): + if full_name == []: continue check[0] = full_name[len(full_name) - 1] if check[0] == self.name: diff --git a/plugins/modules/system/capabilities.py b/plugins/modules/system/capabilities.py index ac6dde6761..9309958eca 100644 --- a/plugins/modules/system/capabilities.py +++ b/plugins/modules/system/capabilities.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2014, Nate Coraor -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2014, Nate Coraor +# 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,13 +19,13 @@ options: description: - Specifies the path to the file to be managed. type: str - required: yes + required: true aliases: [ key ] capability: description: - Desired capability to set (with operator and flags, if state is C(present)) or remove (if state is C(absent)) type: str - required: yes + required: true aliases: [ cap ] state: description: diff --git a/plugins/modules/system/cronvar.py b/plugins/modules/system/cronvar.py index 9871668ac0..9299880537 100644 --- a/plugins/modules/system/cronvar.py +++ b/plugins/modules/system/cronvar.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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 # Cronvar Plugin: The goal of this plugin is to provide an idempotent # method for set cron variable values. It should play well with the @@ -28,20 +29,20 @@ options: description: - Name of the crontab variable. type: str - required: yes + required: true value: description: - The value to set this variable to. - - Required if C(state=present). + - Required if I(state=present). type: str insertafter: description: - If specified, the variable will be inserted after the variable specified. - - Used with C(state=present). + - Used with I(state=present). type: str insertbefore: description: - - Used with C(state=present). If specified, the variable will be inserted + - Used with I(state=present). If specified, the variable will be inserted just before the variable specified. type: str state: @@ -66,7 +67,7 @@ options: - If set, create a backup of the crontab before it is modified. The location of the backup is returned in the C(backup) variable by this module. type: bool - default: no + default: false requirements: - cron author: diff --git a/plugins/modules/system/crypttab.py b/plugins/modules/system/crypttab.py index 8eeec56d3d..a334e8ab3f 100644 --- a/plugins/modules/system/crypttab.py +++ b/plugins/modules/system/crypttab.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2014, Steve -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2014, Steve +# 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 @@ -20,7 +21,7 @@ options: optionally prefixed with C(/dev/mapper/), as it appears in the filesystem. I(/dev/mapper/) will be stripped from I(name). type: str - required: yes + required: true state: description: - Use I(present) to add a line to C(/etc/crypttab) or update its definition @@ -30,7 +31,7 @@ options: different values will be updated. - Use I(opts_absent) to remove options from the existing set. type: str - required: yes + required: true choices: [ absent, opts_absent, opts_present, present ] backing_device: description: diff --git a/plugins/modules/system/dconf.py b/plugins/modules/system/dconf.py index 636ca536ee..61bf6f0e3f 100644 --- a/plugins/modules/system/dconf.py +++ b/plugins/modules/system/dconf.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2017, Branko Majic -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017, Branko Majic +# 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 @@ -33,7 +34,7 @@ notes: - Keep in mind that the C(dconf) CLI tool, which this module wraps around, utilises an unusual syntax for the values (GVariant). For example, if you wanted to provide a string value, the correct syntax would be - C(value="'myvalue'") - with single quotes as part of the Ansible parameter + I(value="'myvalue'") - with single quotes as part of the Ansible parameter value. - When using loops in combination with a value like :code:`"[('xkb', 'us'), ('xkb', 'se')]"`, you need to be aware of possible diff --git a/plugins/modules/system/dpkg_divert.py b/plugins/modules/system/dpkg_divert.py index 709d35b865..52e6c33d0d 100644 --- a/plugins/modules/system/dpkg_divert.py +++ b/plugins/modules/system/dpkg_divert.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2017-2020, Yann Amar -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017-2020, Yann Amar +# 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 @@ -69,7 +70,7 @@ options: exists (this lock being a dpkg-divert feature, and bypassing it being a module feature). type: bool - default: no + default: false force: description: - When I(rename=true) and I(force=true), renaming is performed even if @@ -77,7 +78,7 @@ options: file at this location will be lost. - This parameter is ignored when I(rename=false). type: bool - default: no + default: false notes: - This module supports I(check_mode) and I(diff). requirements: @@ -98,14 +99,14 @@ EXAMPLES = r''' community.general.dpkg_divert: path: /usr/bin/busybox divert: /usr/bin/busybox.dpkg-divert - rename: yes + rename: true - name: Remove the busybox diversion and move the diverted file back community.general.dpkg_divert: path: /usr/bin/busybox state: absent - rename: yes - force: yes + rename: true + force: true ''' RETURN = r''' @@ -114,21 +115,13 @@ commands: type: list returned: on_success elements: str - sample: |- - [ - "/usr/bin/dpkg-divert --no-rename --remove /etc/foobarrc", - "/usr/bin/dpkg-divert --package ansible --no-rename --add /etc/foobarrc" - ] + sample: "/usr/bin/dpkg-divert --no-rename --remove /etc/foobarrc" messages: description: The dpkg-divert relevant messages (stdout or stderr). type: list returned: on_success elements: str - sample: |- - [ - "Removing 'local diversion of /etc/foobarrc to /etc/foobarrc.distrib'", - "Adding 'diversion of /etc/foobarrc to /etc/foobarrc.distrib by ansible'" - ] + sample: "Removing 'local diversion of /etc/foobarrc to /etc/foobarrc.distrib'" diversion: description: The status of the diversion after task execution. type: dict @@ -146,11 +139,11 @@ diversion: state: description: The state of the diversion. type: str - sample: |- + sample: { "divert": "/etc/foobarrc.distrib", "holder": "LOCAL", - "path": "/etc/foobarrc" + "path": "/etc/foobarrc", "state": "present" } ''' diff --git a/plugins/modules/system/facter.py b/plugins/modules/system/facter.py index abd2ebc3a7..be45e3ce14 100644 --- a/plugins/modules/system/facter.py +++ b/plugins/modules/system/facter.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2012, Michael DeHaan -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2012, 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 from __future__ import absolute_import, division, print_function __metaclass__ = type diff --git a/plugins/modules/system/filesystem.py b/plugins/modules/system/filesystem.py index 9fb7810249..4dcfddee23 100644 --- a/plugins/modules/system/filesystem.py +++ b/plugins/modules/system/filesystem.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2021, quidame -# Copyright: (c) 2013, Alexander Bulimov -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, quidame +# Copyright (c) 2013, Alexander Bulimov +# 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,11 +22,11 @@ description: options: state: description: - - If C(state=present), the filesystem is created if it doesn't already + - If I(state=present), the filesystem is created if it doesn't already exist, that is the default behaviour if I(state) is omitted. - - If C(state=absent), filesystem signatures on I(dev) are wiped if it + - If I(state=absent), filesystem signatures on I(dev) are wiped if it contains a filesystem (as known by C(blkid)). - - When C(state=absent), all other options but I(dev) are ignored, and the + - When I(state=absent), all other options but I(dev) are ignored, and the module doesn't fail if the device I(dev) doesn't actually exist. type: str choices: [ present, absent ] @@ -35,7 +36,7 @@ options: choices: [ btrfs, ext2, ext3, ext4, ext4dev, f2fs, lvm, ocfs2, reiserfs, xfs, vfat, swap, ufs ] description: - Filesystem type to be created. This option is required with - C(state=present) (or if I(state) is omitted). + I(state=present) (or if I(state) is omitted). - ufs support has been added in community.general 3.4.0. type: str aliases: [type] @@ -49,27 +50,27 @@ options: a regular file as their target I(dev). - Support for character devices on FreeBSD has been added in community.general 3.4.0. type: path - required: yes + required: true aliases: [device] force: description: - - If C(yes), allows to create new filesystem on devices that already has filesystem. + - If C(true), allows to create new filesystem on devices that already has filesystem. type: bool - default: 'no' + default: false resizefs: description: - - If C(yes), if the block device and filesystem size differ, grow the filesystem into the space. + - If C(true), if the block device and filesystem size differ, grow the filesystem into the space. - Supported for C(btrfs), C(ext2), C(ext3), C(ext4), C(ext4dev), C(f2fs), C(lvm), C(xfs), C(ufs) and C(vfat) filesystems. Attempts to resize other filesystem types will fail. - XFS Will only grow if mounted. Currently, the module is based on commands from C(util-linux) package to perform operations, so resizing of XFS is not supported on FreeBSD systems. - - vFAT will likely fail if fatresize < 1.04. + - vFAT will likely fail if C(fatresize < 1.04). type: bool - default: 'no' + default: false opts: description: - - List of options to be passed to mkfs command. + - List of options to be passed to C(mkfs) command. type: str requirements: - Uses specific tools related to the I(fstype) for creating or resizing a @@ -81,7 +82,7 @@ notes: - Potential filesystems on I(dev) are checked using C(blkid). In case C(blkid) is unable to detect a filesystem (and in case C(fstyp) on FreeBSD is also unable to detect a filesystem), this filesystem is overwritten even if - I(force) is C(no). + I(force) is C(false). - On FreeBSD systems, both C(e2fsprogs) and C(util-linux) packages provide a C(blkid) command that is compatible with this module. However, these packages conflict with each other, and only the C(util-linux) package @@ -268,7 +269,7 @@ class Ext(Filesystem): if None not in (block_size, block_count): break else: - raise ValueError(out) + raise ValueError(repr(out)) return block_size * block_count @@ -319,7 +320,7 @@ class XFS(Filesystem): if None not in (block_size, block_count): break else: - raise ValueError(out) + raise ValueError(repr(out)) return block_size * block_count @@ -364,7 +365,7 @@ class Btrfs(Filesystem): for line in stdout.splitlines(): if "Device size" in line: return int(line.split()[-1]) - raise ValueError(stdout) + raise ValueError(repr(stdout)) class Ocfs2(Filesystem): @@ -405,7 +406,7 @@ class F2fs(Filesystem): if None not in (sector_size, sector_count): break else: - raise ValueError(out) + raise ValueError(repr(out)) return sector_size * sector_count @@ -428,12 +429,15 @@ class VFAT(Filesystem): dummy, out, dummy = self.module.run_command([cmd, '--info', str(dev)], check_rc=True, environ_update=self.LANG_ENV) fssize = None for line in out.splitlines()[1:]: - param, value = line.split(':', 1) - if param.strip() == 'Size': + parts = line.split(':', 1) + if len(parts) < 2: + continue + param, value = parts + if param.strip() in ('Size', 'Cur size'): fssize = int(value.strip()) break else: - raise ValueError(out) + raise ValueError(repr(out)) return fssize @@ -477,7 +481,7 @@ class UFS(Filesystem): if None not in (fragmentsize, providersize): break else: - raise ValueError(out) + raise ValueError(repr(out)) return fragmentsize * providersize @@ -577,7 +581,7 @@ def main(): module.exit_json(changed=True, msg=out) elif fs and not force: - module.fail_json(msg="'%s' is already used as %s, use force=yes to overwrite" % (dev, fs), rc=rc, err=err) + module.fail_json(msg="'%s' is already used as %s, use force=true to overwrite" % (dev, fs), rc=rc, err=err) # create fs filesystem.create(mkfs_opts, dev) diff --git a/plugins/modules/system/gconftool2.py b/plugins/modules/system/gconftool2.py index 86bb2f9259..7ade53e3f4 100644 --- a/plugins/modules/system/gconftool2.py +++ b/plugins/modules/system/gconftool2.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2016, Kenneth D. Evensen -# Copyright: (c) 2017, Abhijeet Kasurde -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, Kenneth D. Evensen +# Copyright (c) 2017, Abhijeet Kasurde +# 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 @@ -22,7 +23,7 @@ options: description: - A GConf preference key is an element in the GConf repository that corresponds to an application preference. See man gconftool-2(1) - required: yes + required: true value: type: str description: @@ -38,7 +39,7 @@ options: type: str description: - The action to take upon the key/value. - required: yes + required: true choices: [ absent, get, present ] config_source: type: str @@ -51,7 +52,7 @@ options: specified then the config_source must be specified as well. See man gconftool-2(1) type: bool - default: 'no' + default: false ''' EXAMPLES = """ @@ -186,11 +187,11 @@ def main(): % str(state)) if direct and config_source is None: - module.fail_json(msg='If "direct" is "yes" then the ' + + module.fail_json(msg='If "direct" is "true" then the ' + '"config_source" must be specified') elif not direct and config_source is not None: module.fail_json(msg='If the "config_source" is specified ' + - 'then "direct" must be "yes"') + 'then "direct" must be "true"') # Create a gconf2 preference gconf_pref = GConf2Preference(module, key, value_type, diff --git a/plugins/modules/system/gconftool2_info.py b/plugins/modules/system/gconftool2_info.py new file mode 100644 index 0000000000..acebb44013 --- /dev/null +++ b/plugins/modules/system/gconftool2_info.py @@ -0,0 +1,75 @@ +#!/usr/bin/python +# -*- 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 + +DOCUMENTATION = ''' +module: gconftool2_info +author: + - "Alexei Znamensky (@russoz)" +short_description: Retrieve GConf configurations +version_added: 5.1.0 +description: + - This module allows retrieving application preferences from the GConf database, with the help of C(gconftool-2). +options: + key: + description: + - The key name for an element in the GConf database. + type: str + required: true +notes: + - See man gconftool-2(1) for more details. +seealso: + - name: gconf repository (archived) + description: Git repository for the project. It is an archived project, so the repository is read-only. + link: https://gitlab.gnome.org/Archive/gconf +''' + +EXAMPLES = """ +- name: Get value for a certain key in the database. + community.general.gconftool2_info: + key: /desktop/gnome/background/picture_filename + register: result +""" + +RETURN = ''' + value: + description: + - The value of the property. + returned: success + type: str + sample: Monospace 10 +''' + +from ansible_collections.community.general.plugins.module_utils.module_helper import ModuleHelper +from ansible_collections.community.general.plugins.module_utils.gconftool2 import gconftool2_runner + + +class GConftoolInfo(ModuleHelper): + output_params = ['key'] + module = dict( + argument_spec=dict( + key=dict(type='str', required=True, no_log=False), + ), + supports_check_mode=True, + ) + + def __init_module__(self): + self.runner = gconftool2_runner(self.module, check_rc=True) + + def __run__(self): + with self.runner.context(args_order=["get", "key"]) as ctx: + rc, out, err = ctx.run(get=True) + self.vars.value = None if err and not out else out.rstrip() + + +def main(): + GConftoolInfo.execute() + + +if __name__ == '__main__': + main() diff --git a/plugins/modules/system/homectl.py b/plugins/modules/system/homectl.py index ff7a619509..c14dc4af9a 100644 --- a/plugins/modules/system/homectl.py +++ b/plugins/modules/system/homectl.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2022, James Livulpi -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2022, James Livulpi +# 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 @@ -57,7 +58,7 @@ options: realname: description: - The user's real ('human') name. - - This can also be used to add a comment to maintain compatability with C(useradd). + - This can also be used to add a comment to maintain compatibility with C(useradd). aliases: [ 'comment' ] type: str realm: @@ -195,7 +196,7 @@ EXAMPLES = ''' password: myreallysecurepassword1! state: present disksize: 10G - resize: yes + resize: true - name: Remove an existing user 'janet' community.general.homectl: @@ -328,7 +329,7 @@ class Homectl(object): cmd = [self.module.get_bin_path('homectl', True)] cmd.append('create') cmd.append('--identity=-') # Read the user record from standard input. - return(self.module.run_command(cmd, data=record)) + return self.module.run_command(cmd, data=record) def _hash_password(self, password): method = crypt.METHOD_SHA512 diff --git a/plugins/modules/system/interfaces_file.py b/plugins/modules/system/interfaces_file.py index 91cf74b426..fe4223a12f 100644 --- a/plugins/modules/system/interfaces_file.py +++ b/plugins/modules/system/interfaces_file.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: (c) 2016, Roman Belyakovsky -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, Roman Belyakovsky +# 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 @@ -47,7 +48,7 @@ options: - Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly. type: bool - default: 'no' + default: false state: type: str description: @@ -135,7 +136,7 @@ EXAMPLES = ''' iface: eth1 option: mtu value: 8000 - backup: yes + backup: true state: present register: eth1_cfg ''' diff --git a/plugins/modules/system/iptables_state.py b/plugins/modules/system/iptables_state.py index 1f35edc04b..1e94631c7f 100644 --- a/plugins/modules/system/iptables_state.py +++ b/plugins/modules/system/iptables_state.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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 @@ -70,14 +71,14 @@ options: - The file the iptables state should be saved to. - The file the iptables state should be restored from. type: path - required: yes + required: true state: description: - Whether the firewall state should be saved (into a file) or restored (from a file). type: str choices: [ saved, restored ] - required: yes + required: true table: description: - When I(state=restored), restore only the named table even if the input @@ -132,7 +133,7 @@ EXAMPLES = r''' community.general.iptables_state: state: saved path: /tmp/iptables - check_mode: yes + check_mode: true changed_when: false register: iptables_state diff --git a/plugins/modules/system/java_cert.py b/plugins/modules/system/java_cert.py index afeab9d9e7..a78d71155a 100644 --- a/plugins/modules/system/java_cert.py +++ b/plugins/modules/system/java_cert.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2013, RSD Services S.A -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2013, RSD Services S.A +# 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 @@ -41,7 +42,7 @@ options: description: - Trust imported cert as CAcert. type: bool - default: False + default: false version_added: '0.2.0' pkcs12_path: description: @@ -118,17 +119,17 @@ EXAMPLES = r''' cert_path: /opt/certs/rootca.crt keystore_path: /tmp/cacerts keystore_pass: changeit - keystore_create: yes + keystore_create: true state: present cert_alias: LE_RootCA - trust_cacert: True + trust_cacert: true - name: Import SSL certificate from google.com to a keystore, create it if it doesn't exist community.general.java_cert: cert_url: google.com keystore_path: /tmp/cacerts keystore_pass: changeit - keystore_create: yes + keystore_create: true state: present - name: Import a pkcs12 keystore with a specified alias, create it if it doesn't exist @@ -137,7 +138,7 @@ EXAMPLES = r''' cert_alias: default keystore_path: /opt/wildfly/standalone/configuration/defaultkeystore.jks keystore_pass: changeit - keystore_create: yes + keystore_create: true state: present - name: Import SSL certificate to JCEKS keystore @@ -149,7 +150,7 @@ EXAMPLES = r''' keystore_path: /opt/someapp/security/keystore.jceks keystore_type: "JCEKS" keystore_pass: changeit - keystore_create: yes + keystore_create: true state: present ''' @@ -175,8 +176,6 @@ cmd: import os import tempfile -import random -import string import re diff --git a/plugins/modules/system/java_keystore.py b/plugins/modules/system/java_keystore.py index 772d3a69b1..2383c8cc48 100644 --- a/plugins/modules/system/java_keystore.py +++ b/plugins/modules/system/java_keystore.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2021, quidame -# Copyright: (c) 2016, Guillaume Grossetie -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, quidame +# Copyright (c) 2016, Guillaume Grossetie +# 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 @@ -75,7 +76,7 @@ options: description: - Keystore is created even if it already exists. type: bool - default: 'no' + default: false owner: description: - Name of the user that should own jks file. diff --git a/plugins/modules/system/kernel_blacklist.py b/plugins/modules/system/kernel_blacklist.py index ad0241b31a..c4352ac08a 100644 --- a/plugins/modules/system/kernel_blacklist.py +++ b/plugins/modules/system/kernel_blacklist.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2021, Alexei Znamensky (@russoz) -# Copyright: (c) 2013, Matthias Vogelgesang -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, Alexei Znamensky (@russoz) +# Copyright (c) 2013, Matthias Vogelgesang +# 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/modules/system/keyring.py b/plugins/modules/system/keyring.py new file mode 100644 index 0000000000..43dfb8c5dc --- /dev/null +++ b/plugins/modules/system/keyring.py @@ -0,0 +1,272 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2022, Alexander Hussey +# 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 Module - community.general.keyring +""" + +from __future__ import absolute_import, division, print_function + +__metaclass__ = type + +DOCUMENTATION = r""" +--- +module: keyring +version_added: 5.2.0 +author: + - Alexander Hussey (@ahussey-redhat) +short_description: Set or delete a passphrase using the Operating System's native keyring +description: >- + This module uses the L(keyring Python library, https://pypi.org/project/keyring/) + to set or delete passphrases for a given service and username from the OS' native keyring. +requirements: + - keyring (Python library) + - gnome-keyring (application - required for headless Gnome keyring access) + - dbus-run-session (application - required for headless Gnome keyring access) +options: + service: + description: The name of the service. + required: true + type: str + username: + description: The user belonging to the service. + required: true + type: str + user_password: + description: The password to set. + required: false + type: str + aliases: + - password + keyring_password: + description: Password to unlock keyring. + required: true + type: str + state: + description: Whether the password should exist. + required: false + default: present + type: str + choices: + - present + - absent +""" + +EXAMPLES = r""" +- name: Set a password for test/test1 + community.general.keyring: + service: test + username: test1 + user_password: "{{ user_password }}" + keyring_password: "{{ keyring_password }}" + +- name: Delete the password for test/test1 + community.general.keyring: + service: test + username: test1 + user_password: "{{ user_password }}" + keyring_password: "{{ keyring_password }}" + state: absent +""" + +try: + from shlex import quote +except ImportError: + from pipes import quote +import traceback + +from ansible.module_utils.basic import AnsibleModule, missing_required_lib + +try: + import keyring + + HAS_KEYRING = True + KEYRING_IMP_ERR = None +except ImportError: + HAS_KEYRING = False + KEYRING_IMP_ERR = traceback.format_exc() + + +def del_passphrase(module): + """ + Attempt to delete a passphrase in the keyring using the Python API and fallback to using a shell. + """ + if module.check_mode: + return None + try: + keyring.delete_password(module.params["service"], module.params["username"]) + return None + except keyring.errors.KeyringLocked as keyring_locked_err: # pylint: disable=unused-variable + delete_argument = ( + 'echo "%s" | gnome-keyring-daemon --unlock\nkeyring del %s %s\n' + % ( + quote(module.params["keyring_password"]), + quote(module.params["service"]), + quote(module.params["username"]), + ) + ) + dummy, dummy, stderr = module.run_command( + "dbus-run-session -- /bin/bash", + use_unsafe_shell=True, + data=delete_argument, + encoding=None, + ) + + if not stderr.decode("UTF-8"): + return None + return stderr.decode("UTF-8") + + +def set_passphrase(module): + """ + Attempt to set passphrase in the keyring using the Python API and fallback to using a shell. + """ + if module.check_mode: + return None + try: + keyring.set_password( + module.params["service"], + module.params["username"], + module.params["user_password"], + ) + return None + except keyring.errors.KeyringLocked as keyring_locked_err: # pylint: disable=unused-variable + set_argument = ( + 'echo "%s" | gnome-keyring-daemon --unlock\nkeyring set %s %s\n%s\n' + % ( + quote(module.params["keyring_password"]), + quote(module.params["service"]), + quote(module.params["username"]), + quote(module.params["user_password"]), + ) + ) + dummy, dummy, stderr = module.run_command( + "dbus-run-session -- /bin/bash", + use_unsafe_shell=True, + data=set_argument, + encoding=None, + ) + if not stderr.decode("UTF-8"): + return None + return stderr.decode("UTF-8") + + +def get_passphrase(module): + """ + Attempt to retrieve passphrase from keyring using the Python API and fallback to using a shell. + """ + try: + passphrase = keyring.get_password( + module.params["service"], module.params["username"] + ) + return passphrase + except keyring.errors.KeyringLocked: + pass + except keyring.errors.InitError: + pass + except AttributeError: + pass + get_argument = 'echo "%s" | gnome-keyring-daemon --unlock\nkeyring get %s %s\n' % ( + quote(module.params["keyring_password"]), + quote(module.params["service"]), + quote(module.params["username"]), + ) + dummy, stdout, dummy = module.run_command( + "dbus-run-session -- /bin/bash", + use_unsafe_shell=True, + data=get_argument, + encoding=None, + ) + try: + return stdout.decode("UTF-8").splitlines()[1] # Only return the line containing the password + except IndexError: + return None + + +def run_module(): + """ + Attempts to retrieve a passphrase from a keyring. + """ + result = dict( + changed=False, + msg="", + ) + + module_args = dict( + service=dict(type="str", required=True), + username=dict(type="str", required=True), + keyring_password=dict(type="str", required=True, no_log=True), + user_password=dict( + type="str", required=False, no_log=True, aliases=["password"] + ), + state=dict( + type="str", required=False, default="present", choices=["absent", "present"] + ), + ) + + module = AnsibleModule(argument_spec=module_args, supports_check_mode=True) + + if not HAS_KEYRING: + module.fail_json(msg=missing_required_lib("keyring"), exception=KEYRING_IMP_ERR) + + passphrase = get_passphrase(module) + if module.params["state"] == "present": + if passphrase is not None: + if passphrase == module.params["user_password"]: + result["msg"] = "Passphrase already set for %s@%s" % ( + module.params["service"], + module.params["username"], + ) + if passphrase != module.params["user_password"]: + set_result = set_passphrase(module) + if set_result is None: + result["changed"] = True + result["msg"] = "Passphrase has been updated for %s@%s" % ( + module.params["service"], + module.params["username"], + ) + if set_result is not None: + module.fail_json(msg=set_result) + if passphrase is None: + set_result = set_passphrase(module) + if set_result is None: + result["changed"] = True + result["msg"] = "Passphrase has been updated for %s@%s" % ( + module.params["service"], + module.params["username"], + ) + if set_result is not None: + module.fail_json(msg=set_result) + + if module.params["state"] == "absent": + if not passphrase: + result["result"] = "Passphrase already absent for %s@%s" % ( + module.params["service"], + module.params["username"], + ) + if passphrase: + del_result = del_passphrase(module) + if del_result is None: + result["changed"] = True + result["msg"] = "Passphrase has been removed for %s@%s" % ( + module.params["service"], + module.params["username"], + ) + if del_result is not None: + module.fail_json(msg=del_result) + + module.exit_json(**result) + + +def main(): + """ + main module loop + """ + run_module() + + +if __name__ == "__main__": + main() diff --git a/plugins/modules/system/keyring_info.py b/plugins/modules/system/keyring_info.py new file mode 100644 index 0000000000..e0c33ce724 --- /dev/null +++ b/plugins/modules/system/keyring_info.py @@ -0,0 +1,153 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2022, Alexander Hussey +# 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 Module - community.general.keyring_info +""" + +from __future__ import absolute_import, division, print_function + +__metaclass__ = type + +DOCUMENTATION = r""" +--- +module: keyring_info +version_added: 5.2.0 +author: + - Alexander Hussey (@ahussey-redhat) +short_description: Get a passphrase using the Operating System's native keyring +description: >- + This module uses the L(keyring Python library, https://pypi.org/project/keyring/) + to retrieve passphrases for a given service and username from the OS' native keyring. +requirements: + - keyring (Python library) + - gnome-keyring (application - required for headless Linux keyring access) + - dbus-run-session (application - required for headless Linux keyring access) +options: + service: + description: The name of the service. + required: true + type: str + username: + description: The user belonging to the service. + required: true + type: str + keyring_password: + description: Password to unlock keyring. + required: true + type: str +""" + +EXAMPLES = r""" + - name: Retrieve password for service_name/user_name + community.general.keyring_info: + service: test + username: test1 + keyring_password: "{{ keyring_password }}" + register: test_password + + - name: Display password + ansible.builtin.debug: + msg: "{{ test_password.passphrase }}" +""" + +RETURN = r""" + passphrase: + description: A string containing the password. + returned: success and the password exists + type: str + sample: Password123 +""" + +try: + from shlex import quote +except ImportError: + from pipes import quote +import traceback + +from ansible.module_utils.basic import AnsibleModule, missing_required_lib + +try: + import keyring + + HAS_KEYRING = True + KEYRING_IMP_ERR = None +except ImportError: + HAS_KEYRING = False + KEYRING_IMP_ERR = traceback.format_exc() + + +def _alternate_retrieval_method(module): + get_argument = 'echo "%s" | gnome-keyring-daemon --unlock\nkeyring get %s %s\n' % ( + quote(module.params["keyring_password"]), + quote(module.params["service"]), + quote(module.params["username"]), + ) + dummy, stdout, dummy = module.run_command( + "dbus-run-session -- /bin/bash", + use_unsafe_shell=True, + data=get_argument, + encoding=None, + ) + try: + return stdout.decode("UTF-8").splitlines()[1] + except IndexError: + return None + + +def run_module(): + """ + Attempts to retrieve a passphrase from a keyring. + """ + result = dict(changed=False, msg="") + + module_args = dict( + service=dict(type="str", required=True), + username=dict(type="str", required=True), + keyring_password=dict(type="str", required=True, no_log=True), + ) + + module = AnsibleModule(argument_spec=module_args, supports_check_mode=True) + + if not HAS_KEYRING: + module.fail_json(msg=missing_required_lib("keyring"), exception=KEYRING_IMP_ERR) + try: + passphrase = keyring.get_password( + module.params["service"], module.params["username"] + ) + except keyring.errors.KeyringLocked: + pass + except keyring.errors.InitError: + pass + except AttributeError: + pass + + if passphrase is None: + passphrase = _alternate_retrieval_method(module) + + if passphrase is not None: + result["msg"] = "Successfully retrieved password for %s@%s" % ( + module.params["service"], + module.params["username"], + ) + result["passphrase"] = passphrase + if passphrase is None: + result["msg"] = "Password for %s@%s does not exist." % ( + module.params["service"], + module.params["username"], + ) + module.exit_json(**result) + + +def main(): + """ + main module loop + """ + run_module() + + +if __name__ == "__main__": + main() diff --git a/plugins/modules/system/launchd.py b/plugins/modules/system/launchd.py index 8c09a44f6e..6e14e4c10c 100644 --- a/plugins/modules/system/launchd.py +++ b/plugins/modules/system/launchd.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2018, Martin Migasiewicz -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2018, Martin Migasiewicz +# 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 @@ -46,9 +47,9 @@ options: - Whether the service should not be restarted automatically by launchd. - Services might have the 'KeepAlive' attribute set to true in a launchd configuration. In case this is set to true, stopping a service will cause that launchd starts the service again. - - Set this option to C(yes) to let this module change the 'KeepAlive' attribute to false. + - Set this option to C(true) to let this module change the 'KeepAlive' attribute to false. type: bool - default: no + default: false notes: - A user must privileged to manage services using this module. requirements: @@ -81,7 +82,7 @@ EXAMPLES = r''' community.general.launchd: name: org.memcached state: stopped - force_stop: yes + force_stop: true - name: Restart memcached community.general.launchd: diff --git a/plugins/modules/system/lbu.py b/plugins/modules/system/lbu.py index fcc3a0d940..86f01f62af 100644 --- a/plugins/modules/system/lbu.py +++ b/plugins/modules/system/lbu.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2019, Kaarle Ritvanen -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, Kaarle Ritvanen +# 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/modules/system/listen_ports_facts.py b/plugins/modules/system/listen_ports_facts.py index 40adeb9e16..fc4afa6d7b 100644 --- a/plugins/modules/system/listen_ports_facts.py +++ b/plugins/modules/system/listen_ports_facts.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: (c) 2017, Nathan Davison -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017, Nathan Davison +# 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 @@ -32,6 +33,13 @@ options: - netstat - ss version_added: 4.1.0 + include_non_listening: + description: + - Show both listening and non-listening sockets (for TCP this means established connections). + - Adds the return values C(state) and C(foreign_address) to the returned facts. + type: bool + default: false + version_added: 5.4.0 ''' EXAMPLES = r''' @@ -59,6 +67,11 @@ EXAMPLES = r''' - name: List all ports ansible.builtin.debug: msg: "{{ (ansible_facts.tcp_listen + ansible_facts.udp_listen) | map(attribute='port') | unique | sort | list }}" + +- name: Gather facts on all ports and override which command to use + community.general.listen_ports_facts: + command: 'netstat' + include_non_listening: true ''' RETURN = r''' @@ -77,6 +90,18 @@ ansible_facts: returned: always type: str sample: "0.0.0.0" + foreign_address: + description: The address of the remote end of the socket. + returned: if I(include_non_listening=true) + type: str + sample: "10.80.0.1" + version_added: 5.4.0 + state: + description: The state of the socket. + returned: if I(include_non_listening=true) + type: str + sample: "ESTABLISHED" + version_added: 5.4.0 name: description: The name of the listening process. returned: if user permissions allow @@ -117,6 +142,18 @@ ansible_facts: returned: always type: str sample: "0.0.0.0" + foreign_address: + description: The address of the remote end of the socket. + returned: if I(include_non_listening=true) + type: str + sample: "10.80.0.1" + version_added: 5.4.0 + state: + description: The state of the socket. UDP is a connectionless protocol. Shows UCONN or ESTAB. + returned: if I(include_non_listening=true) + type: str + sample: "UCONN" + version_added: 5.4.0 name: description: The name of the listening process. returned: if user permissions allow @@ -155,47 +192,82 @@ from ansible.module_utils.common.text.converters import to_native from ansible.module_utils.basic import AnsibleModule +def split_pid_name(pid_name): + """ + Split the entry PID/Program name into the PID (int) and the name (str) + :param pid_name: PID/Program String seperated with a dash. E.g 51/sshd: returns pid = 51 and name = sshd + :return: PID (int) and the program name (str) + """ + try: + pid, name = pid_name.split("/", 1) + except ValueError: + # likely unprivileged user, so add empty name & pid + return 0, "" + else: + name = name.rstrip(":") + return int(pid), name + + def netStatParse(raw): + """ + The netstat result can be either split in 6,7 or 8 elements depending on the values of state, process and name. + For UDP the state is always empty. For UDP and TCP the process can be empty. + So these cases have to be checked. + :param raw: Netstat raw output String. First line explains the format, each following line contains a connection. + :return: List of dicts, each dict contains protocol, state, local address, foreign address, port, name, pid for one + connection. + """ results = list() for line in raw.splitlines(): - listening_search = re.search('[^ ]+:[0-9]+', line) - if listening_search: - splitted = line.split() - conns = re.search('([^ ]+):([0-9]+)', splitted[3]) - pidstr = '' - if 'tcp' in splitted[0]: - protocol = 'tcp' - pidstr = splitted[6] - elif 'udp' in splitted[0]: - protocol = 'udp' - pidstr = splitted[5] - pids = re.search(r'(([0-9]+)/(.*)|-)', pidstr) - if conns and pids: - address = conns.group(1) - port = conns.group(2) - if (pids.group(2)): - pid = pids.group(2) - else: - pid = 0 - if (pids.group(3)): - name = pids.group(3) - else: - name = '' - result = { - 'pid': int(pid), - 'address': address, - 'port': int(port), - 'protocol': protocol, - 'name': name, - } - if result not in results: - results.append(result) - else: - raise EnvironmentError('Could not get process information for the listening ports.') + if line.startswith(("tcp", "udp")): + # set variables to default state, in case they are not specified + state = "" + pid_and_name = "" + process = "" + formatted_line = line.split() + protocol, recv_q, send_q, address, foreign_address, rest = \ + formatted_line[0], formatted_line[1], formatted_line[2], formatted_line[3], formatted_line[4], formatted_line[5:] + address, port = address.rsplit(":", 1) + + if protocol.startswith("tcp"): + # nestat distinguishes between tcp6 and tcp + protocol = "tcp" + if len(rest) == 3: + state, pid_and_name, process = rest + if len(rest) == 2: + state, pid_and_name = rest + + if protocol.startswith("udp"): + # safety measure, similar to tcp6 + protocol = "udp" + if len(rest) == 2: + pid_and_name, process = rest + if len(rest) == 1: + pid_and_name = rest[0] + + pid, name = split_pid_name(pid_name=pid_and_name) + result = { + 'protocol': protocol, + 'state': state, + 'address': address, + 'foreign_address': foreign_address, + 'port': int(port), + 'name': name, + 'pid': int(pid), + } + if result not in results: + results.append(result) return results def ss_parse(raw): + """ + The ss_parse result can be either split in 6 or 7 elements depending on the process column, + e.g. due to unprivileged user. + :param raw: ss raw output String. First line explains the format, each following line contains a connection. + :return: List of dicts, each dict contains protocol, state, local address, foreign address, port, name, pid for one + connection. + """ results = list() regex_conns = re.compile(pattern=r'\[?(.+?)\]?:([0-9]+)$') regex_pid = re.compile(pattern=r'"(.*?)",pid=(\d+)') @@ -221,8 +293,8 @@ def ss_parse(raw): except ValueError: # unexpected stdout from ss raise EnvironmentError( - 'Expected `ss` table layout "Netid, State, Recv-Q, Send-Q, Local Address:Port, Peer Address:Port" and optionally "Process", \ - but got something else: {0}'.format(line) + 'Expected `ss` table layout "Netid, State, Recv-Q, Send-Q, Local Address:Port, Peer Address:Port" and \ + optionally "Process", but got something else: {0}'.format(line) ) conns = regex_conns.search(local_addr_port) @@ -239,46 +311,44 @@ def ss_parse(raw): port = conns.group(2) for name, pid in pids: result = { - 'pid': int(pid), - 'address': address, - 'port': int(port), 'protocol': protocol, - 'name': name + 'state': state, + 'address': address, + 'foreign_address': peer_addr_port, + 'port': int(port), + 'name': name, + 'pid': int(pid), } results.append(result) return results def main(): + command_args = ['-p', '-l', '-u', '-n', '-t'] commands_map = { 'netstat': { - 'args': [ - '-p', - '-l', - '-u', - '-n', - '-t', - ], + 'args': [], 'parse_func': netStatParse }, 'ss': { - 'args': [ - '-p', - '-l', - '-u', - '-n', - '-t', - ], + 'args': [], 'parse_func': ss_parse }, } module = AnsibleModule( argument_spec=dict( - command=dict(type='str', choices=list(sorted(commands_map))) + command=dict(type='str', choices=list(sorted(commands_map))), + include_non_listening=dict(default=False, type='bool'), ), supports_check_mode=True, ) + if module.params['include_non_listening']: + command_args = ['-p', '-u', '-n', '-t', '-a'] + + commands_map['netstat']['args'] = command_args + commands_map['ss']['args'] = command_args + if platform.system() != 'Linux': module.fail_json(msg='This module requires Linux.') @@ -333,13 +403,17 @@ def main(): parse_func = commands_map[command]['parse_func'] results = parse_func(stdout) - for p in results: - p['stime'] = getPidSTime(p['pid']) - p['user'] = getPidUser(p['pid']) - if p['protocol'].startswith('tcp'): - result['ansible_facts']['tcp_listen'].append(p) - elif p['protocol'].startswith('udp'): - result['ansible_facts']['udp_listen'].append(p) + for connection in results: + # only display state and foreign_address for include_non_listening. + if not module.params['include_non_listening']: + connection.pop('state', None) + connection.pop('foreign_address', None) + connection['stime'] = getPidSTime(connection['pid']) + connection['user'] = getPidUser(connection['pid']) + if connection['protocol'].startswith('tcp'): + result['ansible_facts']['tcp_listen'].append(connection) + elif connection['protocol'].startswith('udp'): + result['ansible_facts']['udp_listen'].append(connection) except (KeyError, EnvironmentError) as e: module.fail_json(msg=to_native(e)) diff --git a/plugins/modules/system/locale_gen.py b/plugins/modules/system/locale_gen.py index c142da1ceb..814a82c72a 100644 --- a/plugins/modules/system/locale_gen.py +++ b/plugins/modules/system/locale_gen.py @@ -1,7 +1,9 @@ #!/usr/bin/python # -*- 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/modules/system/lvg.py b/plugins/modules/system/lvg.py index 47d3d6c230..0bb91583fa 100644 --- a/plugins/modules/system/lvg.py +++ b/plugins/modules/system/lvg.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2013, Alexander Bulimov +# Copyright (c) 2013, Alexander Bulimov # Based on lvol module by Jeroen Hoekx -# 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 @@ -43,7 +44,7 @@ options: type: str pvresize: description: - - If C(yes), resize the physical volume to the maximum available size. + - If C(true), resize the physical volume to the maximum available size. type: bool default: false version_added: '0.2.0' @@ -59,9 +60,9 @@ options: default: present force: description: - - If C(yes), allows to remove volume group with logical volumes. + - If C(true), allows to remove volume group with logical volumes. type: bool - default: no + default: false seealso: - module: community.general.filesystem - module: community.general.lvol @@ -101,7 +102,7 @@ EXAMPLES = r''' community.general.lvg: vg: resizableVG pvs: /dev/sda3 - pvresize: yes + pvresize: true ''' import itertools @@ -257,7 +258,7 @@ def main(): else: module.fail_json(msg="Failed to remove volume group %s" % (vg), rc=rc, err=err) else: - module.fail_json(msg="Refuse to remove non-empty volume group %s without force=yes" % (vg)) + module.fail_json(msg="Refuse to remove non-empty volume group %s without force=true" % (vg)) # resize VG current_devs = [os.path.realpath(pv['name']) for pv in pvs if pv['vg_name'] == vg] diff --git a/plugins/modules/system/lvol.py b/plugins/modules/system/lvol.py index b1b9dcb739..4489258da5 100644 --- a/plugins/modules/system/lvol.py +++ b/plugins/modules/system/lvol.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2013, Jeroen Hoekx , Alexander Bulimov -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2013, Jeroen Hoekx , Alexander Bulimov +# 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 @@ -51,13 +52,13 @@ options: description: - Whether the volume is active and visible to the host. type: bool - default: 'yes' + default: true force: description: - Shrink or remove operations of volumes requires this switch. Ensures that that filesystems get never corrupted/destroyed by mistake. type: bool - default: 'no' + default: false opts: type: str description: @@ -78,14 +79,14 @@ options: description: - Shrink if current size is higher than size requested. type: bool - default: 'yes' + default: true resizefs: description: - Resize the underlying filesystem together with the logical volume. - Supported for C(ext2), C(ext3), C(ext4), C(reiserfs) and C(XFS) filesystems. Attempts to resize other filesystem types will fail. type: bool - default: 'no' + default: false notes: - You must specify lv (when managing the state of logical volumes) or thinpool (when managing a thin provisioned volume). ''' @@ -160,35 +161,35 @@ EXAMPLES = ''' vg: firefly lv: test size: 80%VG - force: yes + force: true - name: Reduce the logical volume to 512m community.general.lvol: vg: firefly lv: test size: 512 - force: yes + force: true - name: Reduce the logical volume by given space community.general.lvol: vg: firefly lv: test size: -512M - force: yes + force: true - name: Set the logical volume to 512m and do not try to shrink if size is lower than current one community.general.lvol: vg: firefly lv: test size: 512 - shrink: no + shrink: false - name: Remove the logical volume. community.general.lvol: vg: firefly lv: test state: absent - force: yes + force: true - name: Create a snapshot volume of the test logical volume. community.general.lvol: @@ -486,7 +487,7 @@ def main(): if state == 'absent': # remove LV if not force: - module.fail_json(msg="Sorry, no removal of logical volume %s without force=yes." % (this_lv['name'])) + module.fail_json(msg="Sorry, no removal of logical volume %s without force=true." % (this_lv['name'])) lvremove_cmd = module.get_bin_path("lvremove", required=True) rc, dummy, err = module.run_command("%s %s --force %s/%s" % (lvremove_cmd, test_opt, vg, this_lv['name'])) if rc == 0: @@ -526,7 +527,7 @@ def main(): if size_requested < 1: module.fail_json(msg="Sorry, no shrinking of %s to 0 permitted." % (this_lv['name'])) elif not force: - module.fail_json(msg="Sorry, no shrinking of %s without force=yes" % (this_lv['name'])) + module.fail_json(msg="Sorry, no shrinking of %s without force=true" % (this_lv['name'])) else: tool = module.get_bin_path("lvreduce", required=True) tool = '%s %s' % (tool, '--force') @@ -560,7 +561,7 @@ def main(): if float(size) == 0: module.fail_json(msg="Sorry, no shrinking of %s to 0 permitted." % (this_lv['name'])) if not force: - module.fail_json(msg="Sorry, no shrinking of %s without force=yes." % (this_lv['name'])) + module.fail_json(msg="Sorry, no shrinking of %s without force=true." % (this_lv['name'])) else: tool = module.get_bin_path("lvreduce", required=True) tool = '%s %s' % (tool, '--force') diff --git a/plugins/modules/system/make.py b/plugins/modules/system/make.py index 6a66973369..31da07c579 100644 --- a/plugins/modules/system/make.py +++ b/plugins/modules/system/make.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2015, Linus Unnebäck -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2015, Linus Unnebäck +# 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 @@ -58,7 +59,7 @@ EXAMPLES = r''' community.general.make: chdir: /home/ubuntu/cool-project target: install - become: yes + become: true - name: Build 'all' target with extra arguments community.general.make: diff --git a/plugins/modules/system/mksysb.py b/plugins/modules/system/mksysb.py index ddf9c171f3..a2e3f4e6c8 100644 --- a/plugins/modules/system/mksysb.py +++ b/plugins/modules/system/mksysb.py @@ -1,10 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2021, Alexei Znamensky (@russoz) -# (c) 2017, Kairo Araujo -# GNU General Public License v3.0+ (see COPYING or -# https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, Alexei Znamensky (@russoz) +# Copyright (c) 2017, Kairo Araujo +# 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 @@ -22,32 +22,32 @@ options: description: - Backup encrypted files. type: bool - default: "yes" + default: true backup_dmapi_fs: description: - Back up DMAPI filesystem files. type: bool - default: "yes" + default: true create_map_files: description: - Creates a new MAP files. type: bool - default: "no" + default: false exclude_files: description: - Excludes files using C(/etc/rootvg.exclude). type: bool - default: "no" + default: false exclude_wpar_files: description: - Excludes WPAR files. type: bool - default: "no" + default: false extended_attrs: description: - Backup extended attributes. type: bool - default: "yes" + default: true name: type: str description: @@ -57,13 +57,13 @@ options: description: - Creates a new file data. type: bool - default: "yes" + default: true software_packing: description: - Exclude files from packing option listed in C(/etc/exclude_packing.rootvg). type: bool - default: "no" + default: false storage_path: type: str description: @@ -73,7 +73,7 @@ options: description: - Creates backup using snapshots. type: bool - default: "no" + default: false ''' EXAMPLES = ''' @@ -81,8 +81,8 @@ EXAMPLES = ''' community.general.mksysb: name: myserver storage_path: /repository/images - exclude_files: yes - exclude_wpar_files: yes + exclude_files: true + exclude_wpar_files: true ''' RETURN = ''' @@ -99,7 +99,7 @@ msg: import os from ansible_collections.community.general.plugins.module_utils.module_helper import ( - CmdModuleHelper, ArgFormat, ModuleHelperException + CmdModuleHelper, ArgFormat ) @@ -136,7 +136,7 @@ class MkSysB(CmdModuleHelper): def __init_module__(self): if not os.path.isdir(self.vars.storage_path): - raise ModuleHelperException("Storage path %s is not valid." % self.vars.storage_path) + self.do_raise("Storage path %s is not valid." % self.vars.storage_path) def __run__(self): if not self.module.check_mode: @@ -149,7 +149,7 @@ class MkSysB(CmdModuleHelper): def process_command_output(self, rc, out, err): if rc != 0: - raise ModuleHelperException("mksysb failed.") + self.do_raise("mksysb failed.") self.vars.msg = out diff --git a/plugins/modules/system/modprobe.py b/plugins/modules/system/modprobe.py index 07f7cd8cc3..df460e7161 100644 --- a/plugins/modules/system/modprobe.py +++ b/plugins/modules/system/modprobe.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2013, David Stygstra -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2013, David Stygstra +# 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/modules/system/nosh.py b/plugins/modules/system/nosh.py index 1f9f2806c6..756f5fed42 100644 --- a/plugins/modules/system/nosh.py +++ b/plugins/modules/system/nosh.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2017, Thomas Caravia -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017, Thomas Caravia +# 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 @@ -50,7 +51,7 @@ options: effect prior to I(state=reset). user: required: false - default: 'no' + default: false type: bool description: - Run system-control talking to the calling user's service manager, rather than @@ -63,10 +64,14 @@ notes: EXAMPLES = ''' - name: Start dnscache if not running - community.general.nosh: name=dnscache state=started + community.general.nosh: + name: dnscache + state: started - name: Stop mpd, if running - community.general.nosh: name=mpd state=stopped + community.general.nosh: + name: mpd + state: stopped - name: Restart unbound or start it if not already running community.general.nosh: @@ -79,26 +84,36 @@ EXAMPLES = ''' state: reloaded - name: Disable nsd - community.general.nosh: name=nsd enabled=no + community.general.nosh: + name: nsd + enabled: false - name: For package installers, set nginx running state according to local enable settings, preset and reset - community.general.nosh: name=nginx preset=True state=reset + community.general.nosh: + name: nginx + preset: true + state: reset - name: Reboot the host if nosh is the system manager, would need a "wait_for*" task at least, not recommended as-is - community.general.nosh: name=reboot state=started + community.general.nosh: + name: reboot + state: started - name: Using conditionals with the module facts tasks: - name: Obtain information on tinydns service - community.general.nosh: name=tinydns + community.general.nosh: + name: tinydns register: result - name: Fail if service not loaded - ansible.builtin.fail: msg="The {{ result.name }} service is not loaded" + ansible.builtin.fail: + msg: "The {{ result.name }} service is not loaded" when: not result.status - name: Fail if service is running - ansible.builtin.fail: msg="The {{ result.name }} service is running" + ansible.builtin.fail: + msg: "The {{ result.name }} service is running" when: result.status and result.status['DaemontoolsEncoreState'] == "running" ''' @@ -117,7 +132,7 @@ enabled: description: whether the service is enabled at system bootstrap returned: success type: bool - sample: True + sample: true preset: description: whether the enabled status reflects the one set in the relevant C(*.preset) file returned: success @@ -129,7 +144,7 @@ state: type: str sample: "reloaded" status: - description: a dictionary with the key=value pairs returned by `system-control show-json` or C(None) if the service is not loaded + description: A dictionary with the key=value pairs returned by C(system-control show-json) or C(None) if the service is not loaded returned: success type: complex contains: @@ -147,7 +162,7 @@ status: description: [] # FIXME returned: success type: list - sample: '[]' + sample: [] DaemontoolsEncoreState: description: [] # FIXME returned: success @@ -162,7 +177,7 @@ status: description: [] # FIXME returned: success type: bool - sample: True + sample: true LogService: description: [] # FIXME returned: success @@ -192,7 +207,7 @@ status: description: [] # FIXME returned: success type: list - sample: '[]' + sample: [] RestartExitStatusCode: description: [] # FIXME returned: success @@ -307,7 +322,7 @@ user: description: whether the user-level service manager is called returned: success type: bool - sample: False + sample: false ''' diff --git a/plugins/modules/system/ohai.py b/plugins/modules/system/ohai.py index 64092fd15c..c7322c0962 100644 --- a/plugins/modules/system/ohai.py +++ b/plugins/modules/system/ohai.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2012, Michael DeHaan -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2012, 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 from __future__ import absolute_import, division, print_function diff --git a/plugins/modules/system/open_iscsi.py b/plugins/modules/system/open_iscsi.py index 1768a8b6df..7704fd8b7f 100644 --- a/plugins/modules/system/open_iscsi.py +++ b/plugins/modules/system/open_iscsi.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2013, Serge van Ginderachter -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2013, Serge van Ginderachter +# 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 @@ -77,7 +78,7 @@ options: - Whether the list of target nodes on the portal should be (re)discovered and added to the persistent iSCSI database. - Keep in mind that C(iscsiadm) discovery resets configuration, like C(node.startup) - to manual, hence combined with C(auto_node_startup=yes) will always return + to manual, hence combined with I(auto_node_startup=true) will always return a changed state. type: bool default: false @@ -99,31 +100,31 @@ options: EXAMPLES = r''' - name: Perform a discovery on sun.com and show available target nodes community.general.open_iscsi: - show_nodes: yes - discover: yes + show_nodes: true + discover: true portal: sun.com - name: Perform a discovery on 10.1.2.3 and show available target nodes community.general.open_iscsi: - show_nodes: yes - discover: yes + show_nodes: true + discover: true ip: 10.1.2.3 # NOTE: Only works if exactly one target is exported to the initiator - name: Discover targets on portal and login to the one available community.general.open_iscsi: portal: '{{ iscsi_target }}' - login: yes - discover: yes + login: true + discover: true - name: Connect to the named target, after updating the local persistent database (cache) community.general.open_iscsi: - login: yes + login: true target: iqn.1986-03.com.sun:02:f8c1f9e0-c3ec-ec84-c9c9-8bfb0cd5de3d - name: Disconnect from the cached named target community.general.open_iscsi: - login: no + login: false target: iqn.1986-03.com.sun:02:f8c1f9e0-c3ec-ec84-c9c9-8bfb0cd5de3d - name: Override and disable automatic portal login on specific portal diff --git a/plugins/modules/system/openwrt_init.py b/plugins/modules/system/openwrt_init.py index fa9488ecb2..be7031791e 100644 --- a/plugins/modules/system/openwrt_init.py +++ b/plugins/modules/system/openwrt_init.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2016, Andrew Gaffney -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, Andrew Gaffney +# 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 @@ -63,7 +64,7 @@ EXAMPLES = ''' - name: Enable service httpd community.general.openwrt_init: name: httpd - enabled: yes + enabled: true ''' RETURN = ''' diff --git a/plugins/modules/system/osx_defaults.py b/plugins/modules/system/osx_defaults.py index 45179dc7d2..f905493a31 100644 --- a/plugins/modules/system/osx_defaults.py +++ b/plugins/modules/system/osx_defaults.py @@ -1,10 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2014, GeekChimp - Franck Nijhof (DO NOT CONTACT!) -# Copyright: (c) 2019, Ansible project -# Copyright: (c) 2019, Abhijeet Kasurde -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2014, GeekChimp - Franck Nijhof (DO NOT CONTACT!) +# Copyright (c) 2019, Ansible project +# Copyright (c) 2019, Abhijeet Kasurde +# 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 @@ -46,11 +47,11 @@ options: description: - Add new elements to the array for a key which has an array as its value. type: bool - default: no + default: false value: description: - The value to write. - - Only required when C(state=present). + - Only required when I(state=present). type: raw state: description: @@ -91,7 +92,7 @@ EXAMPLES = r''' key: AutomaticCheckEnabled type: int value: 1 - become: yes + become: true - community.general.osx_defaults: domain: com.apple.screensaver @@ -303,7 +304,8 @@ class OSXDefaults(object): if not isinstance(value, list): value = [value] - rc, out, err = self.module.run_command(self._base_command() + ['write', self.domain, self.key, '-' + self.type] + value) + rc, out, err = self.module.run_command(self._base_command() + ['write', self.domain, self.key, '-' + self.type] + value, + expand_user_and_vars=False) if rc != 0: raise OSXDefaultsException('An error occurred while writing value to defaults: %s' % out) diff --git a/plugins/modules/system/pam_limits.py b/plugins/modules/system/pam_limits.py index 17b1ea1304..d80ba5ffbf 100644 --- a/plugins/modules/system/pam_limits.py +++ b/plugins/modules/system/pam_limits.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2014, Sebastien Rohaut -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2014, Sebastien Rohaut +# 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,23 +69,23 @@ options: the original file back if you somehow clobbered it incorrectly. required: false type: bool - default: "no" + default: false use_min: description: - - If set to C(yes), the minimal value will be used or conserved. + - If set to C(true), the minimal value will be used or conserved. - If the specified value is inferior to the value in the file, file content is replaced with the new value, else content is not modified. required: false type: bool - default: "no" + default: false use_max: description: - - If set to C(yes), the maximal value will be used or conserved. + - If set to C(true), the maximal value will be used or conserved. - If the specified value is superior to the value in the file, file content is replaced with the new value, else content is not modified. required: false type: bool - default: "no" + default: false dest: type: str description: @@ -115,7 +116,7 @@ EXAMPLES = r''' limit_type: hard limit_item: fsize value: 1000000 - use_max: yes + use_max: true - name: Add or modify memlock, both soft and hard, limit for the user james with a comment community.general.pam_limits: diff --git a/plugins/modules/system/pamd.py b/plugins/modules/system/pamd.py index dda504974d..9b7ac77857 100644 --- a/plugins/modules/system/pamd.py +++ b/plugins/modules/system/pamd.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2017, Kenneth D. Evensen -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017, Kenneth D. Evensen +# 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 @@ -94,7 +95,7 @@ options: - Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly. type: bool - default: no + default: false ''' EXAMPLES = r''' @@ -226,34 +227,6 @@ change_count: type: int sample: 1 returned: success -new_rule: - description: The changes to the rule. This was available in Ansible 2.4 and Ansible 2.5. It was removed in Ansible 2.6. - type: str - sample: None None None sha512 shadow try_first_pass use_authtok - returned: success -updated_rule_(n): - description: The rule(s) that was/were changed. This is only available in - Ansible 2.4 and was removed in Ansible 2.5. - type: str - sample: - - password sufficient pam_unix.so sha512 shadow try_first_pass - use_authtok - returned: success -action: - description: - - "That action that was taken and is one of: update_rule, - insert_before_rule, insert_after_rule, args_present, args_absent, - absent. This was available in Ansible 2.4 and removed in Ansible 2.8" - returned: always - type: str - sample: "update_rule" -dest: - description: - - "Path to pam.d service that was changed. This is only available in - Ansible 2.3 and was removed in Ansible 2.4." - returned: success - type: str - sample: "/etc/pam.d/system-auth" backupdest: description: - "The file name of the backup file, if created." diff --git a/plugins/modules/system/parted.py b/plugins/modules/system/parted.py index 3796cfc40b..ae5e7584d1 100644 --- a/plugins/modules/system/parted.py +++ b/plugins/modules/system/parted.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2016, Fabrizio Colonna -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, Fabrizio Colonna +# 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 @@ -27,7 +28,7 @@ options: device: description: The block device (disk) where to operate. type: str - required: True + required: true align: description: Set alignment for newly created partitions. Use 'undefined' for parted default aligment. type: str @@ -362,7 +363,7 @@ def format_disk_size(size_bytes, unit): This function has been adapted from https://github.com/Distrotech/parted/blo b/279d9d869ff472c52b9ec2e180d568f0c99e30b0/libparted/unit.c """ - global units_si, units_iec + global units_si, units_iec # pylint: disable=global-variable-not-assigned unit = unit.lower() @@ -458,7 +459,7 @@ def get_device_info(device, unit): Fetches information about a disk and its partitions and it returns a dictionary. """ - global module, parted_exec + global module, parted_exec # pylint: disable=global-variable-not-assigned # If parted complains about missing labels, it means there are no partitions. # In this case only, use a custom function to fetch information and emulate @@ -485,7 +486,7 @@ def check_parted_label(device): to 3.1 don't return data when there is no label. For more information see: http://upstream.rosalinux.ru/changelogs/libparted/3.1/changelog.html """ - global parted_exec + global parted_exec # pylint: disable=global-variable-not-assigned # Check the version parted_major, parted_minor, dummy = parted_version() @@ -531,7 +532,7 @@ def parted_version(): """ Returns the major and minor version of parted installed on the system. """ - global module, parted_exec + global module, parted_exec # pylint: disable=global-variable-not-assigned rc, out, err = module.run_command("%s --version" % parted_exec) if rc != 0: @@ -550,7 +551,7 @@ def parted(script, device, align): """ Runs a parted script. """ - global module, parted_exec + global module, parted_exec # pylint: disable=global-variable-not-assigned align_option = '-a %s' % align if align == 'undefined': @@ -601,7 +602,7 @@ def check_size_format(size_str): def main(): - global module, units_si, units_iec, parted_exec + global module, units_si, units_iec, parted_exec # pylint: disable=global-variable-not-assigned changed = False output_script = "" diff --git a/plugins/modules/system/pids.py b/plugins/modules/system/pids.py index 1fd8014070..072a2bb7a4 100644 --- a/plugins/modules/system/pids.py +++ b/plugins/modules/system/pids.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2019, Saranya Sridharan -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, Saranya Sridharan +# 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/modules/system/puppet.py b/plugins/modules/system/puppet.py index ed7341cb94..c787a7f00c 100644 --- a/plugins/modules/system/puppet.py +++ b/plugins/modules/system/puppet.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2015, Hewlett-Packard Development Company, L.P. -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2015, Hewlett-Packard Development Company, L.P. +# 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 @@ -34,8 +35,8 @@ options: noop: description: - Override puppet.conf noop mode. - - When C(yes), run Puppet agent with C(--noop) switch set. - - When C(no), run Puppet agent with C(--no-noop) switch set. + - When C(true), run Puppet agent with C(--noop) switch set. + - When C(false), run Puppet agent with C(--no-noop) switch set. - When unset (default), use default or puppet.conf value if defined. type: bool facts: @@ -51,6 +52,11 @@ options: description: - Puppet environment to be used. type: str + confdir: + description: + - Path to the directory containing the puppet.conf file. + type: str + version_added: 5.1.0 logdest: description: - Where the puppet logs should go, if puppet apply is being used. @@ -133,7 +139,7 @@ EXAMPLES = r''' - name: Run puppet agent in noop mode community.general.puppet: - noop: yes + noop: true - name: Run a manifest with debug, log to both syslog and console, specify module path community.general.puppet: @@ -179,6 +185,7 @@ def main(): puppetmaster=dict(type='str'), modulepath=dict(type='str'), manifest=dict(type='str'), + confdir=dict(type='str'), noop=dict(type='bool'), logdest=dict(type='str', default='stdout', choices=['all', 'stdout', 'syslog']), # The following is not related to Ansible's diff; see https://github.com/ansible-collections/community.general/pull/3980#issuecomment-1005666154 @@ -255,6 +262,8 @@ def main(): cmd += " --server %s" % shlex_quote(p['puppetmaster']) if p['show_diff']: cmd += " --show_diff" + if p['confdir']: + cmd += " --confdir %s" % shlex_quote(p['confdir']) if p['environment']: cmd += " --environment '%s'" % p['environment'] if p['tags']: diff --git a/plugins/modules/system/python_requirements_info.py b/plugins/modules/system/python_requirements_info.py index dc0e0a44cc..d96787c7d0 100644 --- a/plugins/modules/system/python_requirements_info.py +++ b/plugins/modules/system/python_requirements_info.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- 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/modules/system/runit.py b/plugins/modules/system/runit.py index 811248317c..7b60215300 100644 --- a/plugins/modules/system/runit.py +++ b/plugins/modules/system/runit.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2015, Brian Coca -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2015, Brian Coca +# 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 @@ -20,7 +21,7 @@ options: description: - Name of the service to manage. type: str - required: yes + required: true state: description: - C(started)/C(stopped) are idempotent actions that will not run diff --git a/plugins/modules/system/sap_task_list_execute.py b/plugins/modules/system/sap_task_list_execute.py index 87d6a1060d..29936b8483 100644 --- a/plugins/modules/system/sap_task_list_execute.py +++ b/plugins/modules/system/sap_task_list_execute.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2021, Rainer Leber -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, Rainer Leber +# 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 @@ -178,7 +179,6 @@ out: ''' from ansible.module_utils.basic import AnsibleModule, missing_required_lib -from ansible.module_utils.json_utils import json import traceback try: from pyrfc import Connection @@ -187,6 +187,7 @@ except ImportError: PYRFC_LIBRARY_IMPORT_ERROR = traceback.format_exc() else: HAS_PYRFC_LIBRARY = True + PYRFC_LIBRARY_IMPORT_ERROR = None try: import xmltodict except ImportError: @@ -194,6 +195,7 @@ except ImportError: XMLTODICT_LIBRARY_IMPORT_ERROR = traceback.format_exc() else: HAS_XMLTODICT_LIBRARY = True + XMLTODICT_LIBRARY_IMPORT_ERROR = None def call_rfc_method(connection, method_name, kwargs): diff --git a/plugins/modules/system/sefcontext.py b/plugins/modules/system/sefcontext.py index 73c79662bc..8183ed7d71 100644 --- a/plugins/modules/system/sefcontext.py +++ b/plugins/modules/system/sefcontext.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2016, Dag Wieers (@dagwieers) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, 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 @@ -19,7 +20,7 @@ options: description: - Target path (expression). type: str - required: yes + required: true aliases: [ path ] ftype: description: @@ -40,7 +41,7 @@ options: description: - SELinux type for the specified target. type: str - required: yes + required: true seuser: description: - SELinux user for the specified target. @@ -61,12 +62,12 @@ options: - Reload SELinux policy after commit. - Note that this does not apply SELinux file contexts to existing files. type: bool - default: yes + default: true ignore_selinux_state: description: - Useful for scenarios (chrooted environment) that you can't get the real SELinux state. type: bool - default: no + default: false notes: - The changes are persistent across reboots. - The M(community.general.sefcontext) module does not modify existing files to the new diff --git a/plugins/modules/system/selinux_permissive.py b/plugins/modules/system/selinux_permissive.py index fd90475712..2578519909 100644 --- a/plugins/modules/system/selinux_permissive.py +++ b/plugins/modules/system/selinux_permissive.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2015, Michael Scherer +# Copyright (c) 2015, Michael Scherer # inspired by code of github.com/dandiker/ -# 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 @@ -29,10 +30,10 @@ options: no_reload: description: - Disable reloading of the SELinux policy after making change to a domain's permissive setting. - - The default is C(no), which causes policy to be reloaded when a domain changes state. + - The default is C(false), which causes policy to be reloaded when a domain changes state. - Reloading the policy does not work on older versions of the C(policycoreutils-python) library, for example in EL 6." type: bool - default: no + default: false store: description: - Name of the SELinux policy store to use. diff --git a/plugins/modules/system/selogin.py b/plugins/modules/system/selogin.py index 46daf1a76a..59222e073a 100644 --- a/plugins/modules/system/selogin.py +++ b/plugins/modules/system/selogin.py @@ -1,21 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- - -# (c) 2017, Petr Lautrbach +# Copyright (c) 2017, Petr Lautrbach # Based on seport.py module (c) 2014, Dan Keder - -# This program 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. -# -# This program 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 this program. 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 @@ -52,7 +40,7 @@ options: description: - Reload SELinux policy after commit. type: bool - default: yes + default: true ignore_selinux_state: description: - Run independent of selinux runtime state diff --git a/plugins/modules/system/seport.py b/plugins/modules/system/seport.py index 4a734c2353..b43b501058 100644 --- a/plugins/modules/system/seport.py +++ b/plugins/modules/system/seport.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2014, Dan Keder -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2014, Dan Keder +# 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,12 +43,18 @@ options: description: - Reload SELinux policy after commit. type: bool - default: yes + default: true ignore_selinux_state: description: - Run independent of selinux runtime state type: bool - default: no + default: false + local: + description: + - Work with local modifications only. + type: bool + default: false + version_added: 5.6.0 notes: - The changes are persistent across reboots. - Not tested on any debian based system. @@ -88,6 +95,14 @@ EXAMPLES = r''' proto: tcp setype: memcache_port_t state: present + +- name: Remove tcp port 22 local modification if exists + community.general.seport: + ports: 22 + protocol: tcp + setype: ssh_port_t + state: absent + local: true ''' import traceback @@ -116,7 +131,7 @@ def get_runtime_status(ignore_selinux_state=False): return ignore_selinux_state or selinux.is_selinux_enabled() -def semanage_port_get_ports(seport, setype, proto): +def semanage_port_get_ports(seport, setype, proto, local): """ Get the list of ports that have the specified type definition. :param community.general.seport: Instance of seobject.portRecords @@ -130,7 +145,7 @@ def semanage_port_get_ports(seport, setype, proto): :rtype: list :return: List of ports that have the specified SELinux type. """ - records = seport.get_all_by_type() + records = seport.get_all_by_type(locallist=local) if (setype, proto) in records: return records[(setype, proto)] else: @@ -164,7 +179,7 @@ def semanage_port_get_type(seport, port, proto): return records.get(key) -def semanage_port_add(module, ports, proto, setype, do_reload, serange='s0', sestore=''): +def semanage_port_add(module, ports, proto, setype, do_reload, serange='s0', sestore='', local=False): """ Add SELinux port type definition to the policy. :type module: AnsibleModule @@ -195,7 +210,7 @@ def semanage_port_add(module, ports, proto, setype, do_reload, serange='s0', ses try: seport = seobject.portRecords(sestore) seport.set_reload(do_reload) - ports_by_type = semanage_port_get_ports(seport, setype, proto) + ports_by_type = semanage_port_get_ports(seport, setype, proto, local) for port in ports: if port in ports_by_type: continue @@ -215,7 +230,7 @@ def semanage_port_add(module, ports, proto, setype, do_reload, serange='s0', ses return change -def semanage_port_del(module, ports, proto, setype, do_reload, sestore=''): +def semanage_port_del(module, ports, proto, setype, do_reload, sestore='', local=False): """ Delete SELinux port type definition from the policy. :type module: AnsibleModule @@ -243,7 +258,7 @@ def semanage_port_del(module, ports, proto, setype, do_reload, sestore=''): try: seport = seobject.portRecords(sestore) seport.set_reload(do_reload) - ports_by_type = semanage_port_get_ports(seport, setype, proto) + ports_by_type = semanage_port_get_ports(seport, setype, proto, local) for port in ports: if port in ports_by_type: change = True @@ -265,6 +280,7 @@ def main(): setype=dict(type='str', required=True), state=dict(type='str', default='present', choices=['absent', 'present']), reload=dict(type='bool', default=True), + local=dict(type='bool', default=False) ), supports_check_mode=True, ) @@ -285,6 +301,7 @@ def main(): setype = module.params['setype'] state = module.params['state'] do_reload = module.params['reload'] + local = module.params['local'] result = { 'ports': ports, @@ -294,9 +311,9 @@ def main(): } if state == 'present': - result['changed'] = semanage_port_add(module, ports, proto, setype, do_reload) + result['changed'] = semanage_port_add(module, ports, proto, setype, do_reload, local=local) elif state == 'absent': - result['changed'] = semanage_port_del(module, ports, proto, setype, do_reload) + result['changed'] = semanage_port_del(module, ports, proto, setype, do_reload, local=local) else: module.fail_json(msg='Invalid value of argument "state": {0}'.format(state)) diff --git a/plugins/modules/system/shutdown.py b/plugins/modules/system/shutdown.py index ccb02a2da0..cc4108c8a7 100644 --- a/plugins/modules/system/shutdown.py +++ b/plugins/modules/system/shutdown.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2020, Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# 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 from __future__ import (absolute_import, division, print_function) __metaclass__ = type diff --git a/plugins/modules/system/solaris_zone.py b/plugins/modules/system/solaris_zone.py index 8ecdeb8dcf..5d07dbfc60 100644 --- a/plugins/modules/system/solaris_zone.py +++ b/plugins/modules/system/solaris_zone.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2015, Paul Markham -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2015, Paul Markham +# 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 @@ -52,7 +53,7 @@ options: description: - Whether to create a sparse (C(true)) or whole root (C(false)) zone. type: bool - default: no + default: false root_password: description: - The password hash for the root account. If not specified, the zone's root account @@ -96,7 +97,7 @@ EXAMPLES = ''' name: zone1 state: present path: /zones/zone1 - sparse: True + sparse: true root_password: Be9oX7OSwWoU. config: 'set autoboot=true; add net; set physical=bge0; set address=10.1.1.1; end' diff --git a/plugins/modules/system/ssh_config.py b/plugins/modules/system/ssh_config.py index 18262a2aae..00a0525d6c 100644 --- a/plugins/modules/system/ssh_config.py +++ b/plugins/modules/system/ssh_config.py @@ -1,10 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2015, Björn Andersson -# Copyright: (c) 2021, Ansible Project -# Copyright: (c) 2021, Abhijeet Kasurde -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2015, Björn Andersson +# Copyright (c) 2021, Ansible Project +# Copyright (c) 2021, Abhijeet Kasurde +# 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/modules/system/sudoers.py b/plugins/modules/system/sudoers.py index 86d8306c26..2c0aa879bc 100644 --- a/plugins/modules/system/sudoers.py +++ b/plugins/modules/system/sudoers.py @@ -2,8 +2,9 @@ # -*- coding: utf-8 -*- -# Copyright: (c) 2019, Jon Ellis (@JonEllis) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, Jon Ellis (@JonEllis) +# 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 @@ -65,6 +66,15 @@ options: - The name of the user for the sudoers rule. - This option cannot be used in conjunction with I(group). type: str + validation: + description: + - If C(absent), the sudoers rule will be added without validation. + - If C(detect) and visudo is available, then the sudoers rule will be validated by visudo. + - If C(required), visudo must be available to validate the sudoers rule. + type: str + default: detect + choices: [ absent, detect, required ] + version_added: 5.2.0 ''' EXAMPLES = ''' @@ -115,7 +125,11 @@ from ansible.module_utils.common.text.converters import to_native class Sudoers(object): + FILE_MODE = 0o440 + def __init__(self, module): + self.module = module + self.check_mode = module.check_mode self.name = module.params['name'] self.user = module.params['user'] @@ -126,6 +140,7 @@ class Sudoers(object): self.sudoers_path = module.params['sudoers_path'] self.file = os.path.join(self.sudoers_path, self.name) self.commands = module.params['commands'] + self.validation = module.params['validation'] def write(self): if self.check_mode: @@ -134,6 +149,8 @@ class Sudoers(object): with open(self.file, 'w') as f: f.write(self.content()) + os.chmod(self.file, self.FILE_MODE) + def delete(self): if self.check_mode: return @@ -145,7 +162,12 @@ class Sudoers(object): def matches(self): with open(self.file, 'r') as f: - return f.read() == self.content() + content_matches = f.read() == self.content() + + current_mode = os.stat(self.file).st_mode & 0o777 + mode_matches = current_mode == self.FILE_MODE + + return content_matches and mode_matches def content(self): if self.user: @@ -158,10 +180,29 @@ class Sudoers(object): runas_str = '({runas})'.format(runas=self.runas) if self.runas is not None else '' return "{owner} ALL={runas}{nopasswd} {commands}\n".format(owner=owner, runas=runas_str, nopasswd=nopasswd_str, commands=commands_str) + def validate(self): + if self.validation == 'absent': + return + + visudo_path = self.module.get_bin_path('visudo', required=self.validation == 'required') + if visudo_path is None: + return + + check_command = [visudo_path, '-c', '-f', '-'] + rc, stdout, stderr = self.module.run_command(check_command, data=self.content()) + + if rc != 0: + raise Exception('Failed to validate sudoers rule:\n{stdout}'.format(stdout=stdout)) + def run(self): - if self.state == 'absent' and self.exists(): - self.delete() - return True + if self.state == 'absent': + if self.exists(): + self.delete() + return True + else: + return False + + self.validate() if self.exists() and self.matches(): return False @@ -197,6 +238,10 @@ def main(): 'choices': ['present', 'absent'], }, 'user': {}, + 'validation': { + 'default': 'detect', + 'choices': ['absent', 'detect', 'required'] + }, } module = AnsibleModule( diff --git a/plugins/modules/system/svc.py b/plugins/modules/system/svc.py index 53f46f0440..2800c9d2bf 100644 --- a/plugins/modules/system/svc.py +++ b/plugins/modules/system/svc.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: (c) 2015, Brian Coca -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2015, Brian Coca +# 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/modules/system/syspatch.py b/plugins/modules/system/syspatch.py index 42cb17b8a3..36b934f299 100644 --- a/plugins/modules/system/syspatch.py +++ b/plugins/modules/system/syspatch.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2019-2020, Andrew Klaus -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019-2020, Andrew Klaus +# 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 @@ -69,7 +70,7 @@ reboot_needed: description: Whether or not a reboot is required after an update. returned: always type: bool - sample: True + sample: true ''' from ansible.module_utils.basic import AnsibleModule diff --git a/plugins/modules/system/sysrc.py b/plugins/modules/system/sysrc.py index cee82cf827..ccd5c2c545 100644 --- a/plugins/modules/system/sysrc.py +++ b/plugins/modules/system/sysrc.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2019 David Lundgren +# Copyright (c) 2019 David Lundgren # -# 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/modules/system/sysupgrade.py b/plugins/modules/system/sysupgrade.py index 333d7765d2..e597db975b 100644 --- a/plugins/modules/system/sysupgrade.py +++ b/plugins/modules/system/sysupgrade.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2020, Andrew Klaus -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2020, Andrew Klaus +# 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 @@ -19,24 +20,24 @@ options: description: - Apply the latest snapshot. - Otherwise release will be applied. - default: no + default: false type: bool force: description: - Force upgrade (for snapshots only). - default: no + default: false type: bool keep_files: description: - Keep the files under /home/_sysupgrade. - By default, the files will be deleted after the upgrade. - default: no + default: false type: bool fetch_only: description: - Fetch and verify files and create /bsd.upgrade but do not reboot. - Set to C(false) if you want sysupgrade to reboot. This will cause Ansible to error, as it expects the module to exit gracefully. See the examples. - default: yes + default: true type: bool installurl: description: @@ -54,7 +55,7 @@ EXAMPLES = r''' - name: Upgrade to latest snapshot community.general.sysupgrade: - snapshot: yes + snapshot: true installurl: https://cloudflare.cdn.openbsd.org/pub/OpenBSD register: sysupgrade @@ -67,8 +68,8 @@ EXAMPLES = r''' - name: Have sysupgrade automatically reboot community.general.sysupgrade: - fetch_only: no - ignore_errors: yes + fetch_only: false + ignore_errors: true ''' RETURN = r''' diff --git a/plugins/modules/system/timezone.py b/plugins/modules/system/timezone.py index f632939041..9e89462089 100644 --- a/plugins/modules/system/timezone.py +++ b/plugins/modules/system/timezone.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2016, Shinichi TAMURA (@tmshn) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, Shinichi TAMURA (@tmshn) +# 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 @@ -790,7 +791,7 @@ class AIXTimezone(Timezone): inspects C(/etc/environment) to determine the current timezone. While AIX time zones can be set using two formats (POSIX and - Olson) the prefered method is Olson. + Olson) the preferred method is Olson. See the following article for more information: https://developer.ibm.com/articles/au-aix-posix/ diff --git a/plugins/modules/system/ufw.py b/plugins/modules/system/ufw.py index b6e0b3de78..6d18f3f781 100644 --- a/plugins/modules/system/ufw.py +++ b/plugins/modules/system/ufw.py @@ -1,11 +1,12 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2014, Ahti Kitsik -# Copyright: (c) 2014, Jarno Keskikangas -# Copyright: (c) 2013, Aleksey Ovcharenko -# Copyright: (c) 2013, James Martin -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2014, Ahti Kitsik +# Copyright (c) 2014, Jarno Keskikangas +# Copyright (c) 2013, Aleksey Ovcharenko +# Copyright (c) 2013, James Martin +# 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 @@ -178,7 +179,7 @@ EXAMPLES = r''' - community.general.ufw: rule: reject port: auth - log: yes + log: true # ufw supports connection rate limiting, which is useful for protecting # against brute-force login attacks. ufw will deny connections if an IP @@ -191,7 +192,7 @@ EXAMPLES = r''' proto: tcp # Allow OpenSSH. (Note that as ufw manages its own state, simply removing -# a rule=allow task can leave those ports exposed. Either use delete=yes +# a rule=allow task can leave those ports exposed. Either use delete=true # or a separate state=reset task) - community.general.ufw: rule: allow @@ -201,7 +202,7 @@ EXAMPLES = r''' community.general.ufw: rule: allow name: OpenSSH - delete: yes + delete: true - name: Deny all access to port 53 community.general.ufw: @@ -284,9 +285,9 @@ EXAMPLES = r''' - name: Deny forwarded/routed traffic from subnet 1.2.3.0/24 to subnet 4.5.6.0/24 community.general.ufw: rule: deny - route: yes - src: 1.2.3.0/24 - dest: 4.5.6.0/24 + route: true + src: 192.0.2.0/24 + dest: 198.51.100.0/24 ''' import re diff --git a/plugins/modules/system/vdo.py b/plugins/modules/system/vdo.py index d2888836d1..21e8a96100 100644 --- a/plugins/modules/system/vdo.py +++ b/plugins/modules/system/vdo.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2018, Red Hat, Inc. -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2018, Red Hat, 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 @@ -47,7 +48,7 @@ options: activated: description: - The "activate" status for a VDO volume. If this is set - to "no", the VDO volume cannot be started, and it will + to C(false), the VDO volume cannot be started, and it will not start on system startup. However, on initial creation, a VDO volume with "activated" set to "off" will be running, until stopped. This is the default @@ -269,7 +270,7 @@ options: checks it is important to make sure that all parameters provided are accurate and intentional." type: bool - default: no + default: false version_added: 2.4.0 notes: - In general, the default thread configuration should be used. @@ -724,7 +725,7 @@ def run_module(): # Note that a disabled VDO volume cannot be started by the # 'vdo start' command, by design. To accurately track changed # status, don't try to start a disabled VDO volume. - # If the playbook contains 'activated: yes', assume that + # If the playbook contains 'activated: true', assume that # the activate_vdo() operation succeeded, as 'vdoactivatestatus' # will have the activated status prior to the activate_vdo() # call. diff --git a/plugins/modules/system/xfconf.py b/plugins/modules/system/xfconf.py index 8becd4a683..4e95e212a0 100644 --- a/plugins/modules/system/xfconf.py +++ b/plugins/modules/system/xfconf.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2017, Joseph Benden +# Copyright (c) 2017, Joseph Benden # -# 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 @@ -71,7 +72,7 @@ options: description: - Force array even if only one element type: bool - default: 'no' + default: false aliases: ['array'] version_added: 1.0.0 disable_facts: @@ -143,33 +144,31 @@ RETURN = ''' returned: success type: any sample: '"96" or ["red", "blue", "green"]' + cmd: + description: + - A list with the resulting C(xfconf-query) command executed by the module. + returned: success + type: list + elements: str + version_added: 5.4.0 + sample: + - /usr/bin/xfconf-query + - --channel + - xfce4-panel + - --property + - /plugins/plugin-19/timezone + - --create + - --type + - string + - --set + - Pacific/Auckland ''' -from ansible_collections.community.general.plugins.module_utils.module_helper import ( - CmdStateModuleHelper, ArgFormat, ModuleHelperException -) +from ansible_collections.community.general.plugins.module_utils.module_helper import StateModuleHelper +from ansible_collections.community.general.plugins.module_utils.xfconf import xfconf_runner -def fix_bool(value): - vl = value.lower() - return vl if vl in ("true", "false") else value - - -@ArgFormat.stars_deco(1) -def values_fmt(values, value_types): - result = [] - for value, value_type in zip(values, value_types): - if value_type == 'bool': - value = fix_bool(value) - result.extend(['--type', '{0}'.format(value_type), '--set', '{0}'.format(value)]) - return result - - -class XFConfException(Exception): - pass - - -class XFConfProperty(CmdStateModuleHelper): +class XFConfProperty(StateModuleHelper): change_params = 'value', diff_params = 'value', output_params = ('property', 'channel', 'value') @@ -191,34 +190,26 @@ class XFConfProperty(CmdStateModuleHelper): ) default_state = 'present' - command = 'xfconf-query' - command_args_formats = dict( - channel=dict(fmt=('--channel', '{0}'),), - property=dict(fmt=('--property', '{0}'),), - is_array=dict(fmt="--force-array", style=ArgFormat.BOOLEAN), - reset=dict(fmt="--reset", style=ArgFormat.BOOLEAN), - create=dict(fmt="--create", style=ArgFormat.BOOLEAN), - values_and_types=dict(fmt=values_fmt) - ) def update_xfconf_output(self, **kwargs): self.update_vars(meta={"output": True, "fact": True}, **kwargs) def __init_module__(self): - self.does_not = 'Property "{0}" does not exist on channel "{1}".'.format(self.module.params['property'], - self.module.params['channel']) + self.runner = xfconf_runner(self.module) + self.does_not = 'Property "{0}" does not exist on channel "{1}".'.format(self.vars.property, + self.vars.channel) self.vars.set('previous_value', self._get(), fact=True) self.vars.set('type', self.vars.value_type, fact=True) self.vars.meta('value').set(initial_value=self.vars.previous_value) - if self.module.params['disable_facts'] is False: - raise ModuleHelperException('Returning results as facts has been removed. Stop using disable_facts=false.') + if self.vars.disable_facts is False: + self.do_raise('Returning results as facts has been removed. Stop using disable_facts=false.') def process_command_output(self, rc, out, err): if err.rstrip() == self.does_not: return None if rc or len(err): - raise XFConfException('xfconf-query failed with error (rc={0}): {1}'.format(rc, err)) + self.do_raise('xfconf-query failed with error (rc={0}): {1}'.format(rc, err)) result = out.rstrip() if "Value is an array with" in result: @@ -229,11 +220,17 @@ class XFConfProperty(CmdStateModuleHelper): return result def _get(self): - return self.run_command(params=('channel', 'property')) + with self.runner('channel property', output_process=self.process_command_output) as ctx: + return ctx.run() def state_absent(self): - if not self.module.check_mode: - self.run_command(params=('channel', 'property', {'reset': True})) + with self.runner('channel property reset', check_mode_skip=True) as ctx: + ctx.run(reset=True) + self.vars.stdout = ctx.results_out + self.vars.stderr = ctx.results_err + self.vars.cmd = ctx.cmd + if self.verbosity >= 4: + self.vars.run_info = ctx.run_info self.vars.value = None def state_present(self): @@ -250,10 +247,7 @@ class XFConfProperty(CmdStateModuleHelper): value_type = value_type * values_len elif types_len != values_len: # or complain if lists' lengths are different - raise XFConfException('Number of elements in "value" and "value_type" must be the same') - - # fix boolean values - self.vars.value = [fix_bool(v[0]) if v[1] == 'bool' else v[0] for v in zip(self.vars.value, value_type)] + self.do_raise('Number of elements in "value" and "value_type" must be the same') # calculates if it is an array self.vars.is_array = \ @@ -261,13 +255,13 @@ class XFConfProperty(CmdStateModuleHelper): isinstance(self.vars.previous_value, list) or \ values_len > 1 - params = ['channel', 'property', {'create': True}] - if self.vars.is_array: - params.append('is_array') - params.append({'values_and_types': (self.vars.value, value_type)}) - - if not self.module.check_mode: - self.run_command(params=params) + with self.runner('channel property create force_array values_and_types', check_mode_skip=True) as ctx: + ctx.run(create=True, force_array=self.vars.is_array, values_and_types=(self.vars.value, value_type)) + self.vars.stdout = ctx.results_out + self.vars.stderr = ctx.results_err + self.vars.cmd = ctx.cmd + if self.verbosity >= 4: + self.vars.run_info = ctx.run_info if not self.vars.is_array: self.vars.value = self.vars.value[0] diff --git a/plugins/modules/system/xfconf_info.py b/plugins/modules/system/xfconf_info.py index 766267dd3d..2bdb745393 100644 --- a/plugins/modules/system/xfconf_info.py +++ b/plugins/modules/system/xfconf_info.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2021, Alexei Znamensky -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, 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 @@ -9,7 +10,7 @@ __metaclass__ = type DOCUMENTATION = ''' module: xfconf_info author: - - "Alexei Znamensky (@russoz)" + - "Alexei Znamensky (@russoz)" short_description: Retrieve XFCE4 configurations version_added: 3.5.0 description: @@ -61,8 +62,8 @@ EXAMPLES = """ RETURN = ''' channels: description: - - List of available channels. - - Returned when the module receives no parameter at all. + - List of available channels. + - Returned when the module receives no parameter at all. returned: success type: list elements: str @@ -73,57 +74,54 @@ RETURN = ''' - xfwm4 properties: description: - - List of available properties for a specific channel. - - Returned by passed only the I(channel) parameter to the module. + - List of available properties for a specific channel. + - Returned by passing only the I(channel) parameter to the module. returned: success type: list elements: str sample: - - /Gdk/WindowScalingFactor - - /Gtk/ButtonImages - - /Gtk/CursorThemeSize - - /Gtk/DecorationLayout - - /Gtk/FontName - - /Gtk/MenuImages - - /Gtk/MonospaceFontName - - /Net/DoubleClickTime - - /Net/IconThemeName - - /Net/ThemeName - - /Xft/Antialias - - /Xft/Hinting - - /Xft/HintStyle - - /Xft/RGBA + - /Gdk/WindowScalingFactor + - /Gtk/ButtonImages + - /Gtk/CursorThemeSize + - /Gtk/DecorationLayout + - /Gtk/FontName + - /Gtk/MenuImages + - /Gtk/MonospaceFontName + - /Net/DoubleClickTime + - /Net/IconThemeName + - /Net/ThemeName + - /Xft/Antialias + - /Xft/Hinting + - /Xft/HintStyle + - /Xft/RGBA is_array: description: - - Flag indicating whether the property is an array or not. + - Flag indicating whether the property is an array or not. returned: success type: bool value: description: - - The value of the property. Empty if the property is of array type. + - The value of the property. Empty if the property is of array type. returned: success type: str sample: Monospace 10 value_array: description: - - The array value of the property. Empty if the property is not of array type. + - The array value of the property. Empty if the property is not of array type. returned: success type: list elements: str sample: - - Main - - Work - - Tmp + - Main + - Work + - Tmp ''' -from ansible_collections.community.general.plugins.module_utils.module_helper import CmdModuleHelper, ArgFormat +from ansible_collections.community.general.plugins.module_utils.module_helper import ModuleHelper +from ansible_collections.community.general.plugins.module_utils.xfconf import xfconf_runner -class XFConfException(Exception): - pass - - -class XFConfInfo(CmdModuleHelper): +class XFConfInfo(ModuleHelper): module = dict( argument_spec=dict( channel=dict(type='str'), @@ -135,16 +133,9 @@ class XFConfInfo(CmdModuleHelper): supports_check_mode=True, ) - command = 'xfconf-query' - command_args_formats = dict( - channel=dict(fmt=['--channel', '{0}']), - property=dict(fmt=['--property', '{0}']), - _list_arg=dict(fmt="--list", style=ArgFormat.BOOLEAN), - ) - check_rc = True - def __init_module__(self): - self.vars.set("_list_arg", False, output=False) + self.runner = xfconf_runner(self.module, check_rc=True) + self.vars.set("list_arg", False, output=False) self.vars.set("is_array", False) def process_command_output(self, rc, out, err): @@ -167,7 +158,7 @@ class XFConfInfo(CmdModuleHelper): return lines def __run__(self): - self.vars._list_arg = not (bool(self.vars.channel) and bool(self.vars.property)) + self.vars.list_arg = not (bool(self.vars.channel) and bool(self.vars.property)) output = 'value' proc = self.process_command_output if self.vars.channel is None: @@ -176,15 +167,17 @@ class XFConfInfo(CmdModuleHelper): elif self.vars.property is None: output = 'properties' proc = self._process_list_properties - result = self.run_command(params=('_list_arg', 'channel', 'property'), process_output=proc) - if not self.vars._list_arg and self.vars.is_array: + + with self.runner.context('list_arg channel property', output_process=proc) as ctx: + result = ctx.run(**self.vars) + + if not self.vars.list_arg and self.vars.is_array: output = "value_array" self.vars.set(output, result) def main(): - xfconf = XFConfInfo() - xfconf.run() + XFConfInfo.execute() if __name__ == '__main__': diff --git a/plugins/modules/system/xfs_quota.py b/plugins/modules/system/xfs_quota.py index 7437ddfd70..5f71334c01 100644 --- a/plugins/modules/system/xfs_quota.py +++ b/plugins/modules/system/xfs_quota.py @@ -1,10 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2018, Emmanouil Kampitakis -# Copyright: (c) 2018, William Leemans +# Copyright (c) 2018, Emmanouil Kampitakis +# Copyright (c) 2018, William Leemans -# 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/modules/web_infrastructure/apache2_mod_proxy.py b/plugins/modules/web_infrastructure/apache2_mod_proxy.py index 2ab679aaf6..70ab5a42ed 100644 --- a/plugins/modules/web_infrastructure/apache2_mod_proxy.py +++ b/plugins/modules/web_infrastructure/apache2_mod_proxy.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2016, Olivier Boukili -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, Olivier Boukili +# 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 @@ -49,12 +50,12 @@ options: description: - Use https to access balancer management page. type: bool - default: 'no' + default: false validate_certs: description: - Validate ssl/tls certificates. type: bool - default: 'yes' + default: true ''' EXAMPLES = ''' @@ -261,8 +262,8 @@ class BalancerMember(object): else: try: soup = BeautifulSoup(balancer_member_page[0]) - except TypeError: - self.module.fail_json(msg="Cannot parse balancer_member_page HTML! " + str(soup)) + except TypeError as exc: + self.module.fail_json(msg="Cannot parse balancer_member_page HTML! " + str(exc)) else: subsoup = soup.findAll('table')[1].findAll('tr') keys = subsoup[0].findAll('th') diff --git a/plugins/modules/web_infrastructure/apache2_module.py b/plugins/modules/web_infrastructure/apache2_module.py index 44327fe13c..65d2f689bf 100644 --- a/plugins/modules/web_infrastructure/apache2_module.py +++ b/plugins/modules/web_infrastructure/apache2_module.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2013-2014, Christian Berendt -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2013-2014, Christian Berendt +# 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 @@ -30,13 +31,13 @@ options: - Identifier of the module as listed by C(apache2ctl -M). This is optional and usually determined automatically by the common convention of appending C(_module) to I(name) as well as custom exception for popular modules. - required: False + required: false force: description: - Force disabling of default modules and override Debian warnings. required: false type: bool - default: False + default: false state: type: str description: @@ -47,7 +48,7 @@ options: description: - Ignore configuration checks about inconsistent module configuration. Especially for mpm_* modules. type: bool - default: False + default: false requirements: ["a2enmod","a2dismod"] notes: - This does not work on RedHat-based distributions. It does work on Debian- and SuSE-based distributions. @@ -69,13 +70,13 @@ EXAMPLES = ''' community.general.apache2_module: state: absent name: autoindex - force: True + force: true - name: Disable mpm_worker and ignore warnings about missing mpm module community.general.apache2_module: state: absent name: mpm_worker - ignore_configcheck: True + ignore_configcheck: true - name: Enable dump_io module, which is identified as dumpio_module inside apache2 community.general.apache2_module: diff --git a/plugins/modules/web_infrastructure/deploy_helper.py b/plugins/modules/web_infrastructure/deploy_helper.py index f73c9c1f18..3d3fe08f28 100644 --- a/plugins/modules/web_infrastructure/deploy_helper.py +++ b/plugins/modules/web_infrastructure/deploy_helper.py @@ -1,10 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2014, Jasper N. Brouwer -# (c) 2014, Ramon de la Fuente +# Copyright (c) 2014, Jasper N. Brouwer +# Copyright (c) 2014, Ramon de la Fuente # -# 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 @@ -19,8 +20,8 @@ description: - The Deploy Helper manages some of the steps common in deploying software. It creates a folder structure, manages a symlink for the current release and cleans up old releases. - - "Running it with the C(state=query) or C(state=present) will return the C(deploy_helper) fact. - C(project_path), whatever you set in the path parameter, + - "Running it with the I(state=query) or I(state=present) will return the C(deploy_helper) fact. + C(project_path), whatever you set in the I(path) parameter, C(current_path), the path to the symlink that points to the active release, C(releases_path), the path to the folder to keep releases in, C(shared_path), the path to the folder to keep shared resources in, @@ -33,43 +34,43 @@ description: options: path: type: path - required: True + required: true aliases: ['dest'] description: - - the root path of the project. Alias I(dest). + - The root path of the project. Returned in the C(deploy_helper.project_path) fact. state: type: str description: - - the state of the project. + - The state of the project. C(query) will only gather facts, C(present) will create the project I(root) folder, and in it the I(releases) and I(shared) folders, C(finalize) will remove the unfinished_filename file, create a symlink to the newly deployed release and optionally clean old releases, C(clean) will remove failed & old releases, - C(absent) will remove the project folder (synonymous to the M(ansible.builtin.file) module with C(state=absent)) + C(absent) will remove the project folder (synonymous to the M(ansible.builtin.file) module with I(state=absent)). choices: [ present, finalize, absent, clean, query ] default: present release: type: str description: - - the release version that is being deployed. Defaults to a timestamp format %Y%m%d%H%M%S (i.e. '20141119223359'). - This parameter is optional during C(state=present), but needs to be set explicitly for C(state=finalize). - You can use the generated fact C(release={{ deploy_helper.new_release }}). + - The release version that is being deployed. Defaults to a timestamp format %Y%m%d%H%M%S (i.e. '20141119223359'). + This parameter is optional during I(state=present), but needs to be set explicitly for I(state=finalize). + You can use the generated fact I(release={{ deploy_helper.new_release }}). releases_path: type: str description: - - the name of the folder that will hold the releases. This can be relative to C(path) or absolute. + - The name of the folder that will hold the releases. This can be relative to I(path) or absolute. Returned in the C(deploy_helper.releases_path) fact. default: releases shared_path: type: path description: - - the name of the folder that will hold the shared resources. This can be relative to C(path) or absolute. + - The name of the folder that will hold the shared resources. This can be relative to I(path) or absolute. If this is set to an empty string, no shared folder will be created. Returned in the C(deploy_helper.shared_path) fact. default: shared @@ -77,38 +78,38 @@ options: current_path: type: path description: - - the name of the symlink that is created when the deploy is finalized. Used in C(finalize) and C(clean). + - The name of the symlink that is created when the deploy is finalized. Used in I(finalize) and I(clean). Returned in the C(deploy_helper.current_path) fact. default: current unfinished_filename: type: str description: - - the name of the file that indicates a deploy has not finished. All folders in the releases_path that - contain this file will be deleted on C(state=finalize) with clean=True, or C(state=clean). This file is - automatically deleted from the I(new_release_path) during C(state=finalize). + - The name of the file that indicates a deploy has not finished. All folders in the I(releases_path) that + contain this file will be deleted on I(state=finalize) with I(clean=True), or I(state=clean). This file is + automatically deleted from the I(new_release_path) during I(state=finalize). default: DEPLOY_UNFINISHED clean: description: - - Whether to run the clean procedure in case of C(state=finalize). + - Whether to run the clean procedure in case of I(state=finalize). type: bool - default: 'yes' + default: true keep_releases: type: int description: - - the number of old releases to keep when cleaning. Used in C(finalize) and C(clean). Any unfinished builds + - The number of old releases to keep when cleaning. Used in I(finalize) and I(clean). Any unfinished builds will be deleted first, so only correct releases will count. The current version will not count. default: 5 notes: - - Facts are only returned for C(state=query) and C(state=present). If you use both, you should pass any overridden + - Facts are only returned for I(state=query) and I(state=present). If you use both, you should pass any overridden parameters to both calls, otherwise the second call will overwrite the facts of the first one. - - When using C(state=clean), the releases are ordered by I(creation date). You should be able to switch to a + - When using I(state=clean), the releases are ordered by I(creation date). You should be able to switch to a new naming strategy without problems. - Because of the default behaviour of generating the I(new_release) fact, this module will not be idempotent - unless you pass your own release name with C(release). Due to the nature of deploying software, this should not + unless you pass your own release name with I(release). Due to the nature of deploying software, this should not be much of a problem. extends_documentation_fragment: files ''' @@ -233,7 +234,7 @@ EXAMPLES = ''' path: /path/to/root release: '{{ deploy_helper.new_release }}' state: finalize - clean: False + clean: false - community.general.deploy_helper: path: /path/to/root state: clean diff --git a/plugins/modules/web_infrastructure/django_manage.py b/plugins/modules/web_infrastructure/django_manage.py index 4ced7452bb..0d68e926eb 100644 --- a/plugins/modules/web_infrastructure/django_manage.py +++ b/plugins/modules/web_infrastructure/django_manage.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2013, Scott Anderson -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2013, Scott Anderson +# 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 @@ -64,7 +65,7 @@ options: - Clear the existing files before trying to copy or link the original file. - Used only with the C(collectstatic) command. The C(--noinput) argument will be added automatically. required: false - default: no + default: false type: bool database: description: diff --git a/plugins/modules/web_infrastructure/ejabberd_user.py b/plugins/modules/web_infrastructure/ejabberd_user.py index e6cdd72b5e..f7189fa08e 100644 --- a/plugins/modules/web_infrastructure/ejabberd_user.py +++ b/plugins/modules/web_infrastructure/ejabberd_user.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright (C) 2013, Peter Sprygada -# 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/modules/web_infrastructure/gunicorn.py b/plugins/modules/web_infrastructure/gunicorn.py index 4c9e5da45b..9ed903dfd5 100644 --- a/plugins/modules/web_infrastructure/gunicorn.py +++ b/plugins/modules/web_infrastructure/gunicorn.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2017, Alejandro Gomez -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017, Alejandro Gomez +# 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/modules/web_infrastructure/htpasswd.py b/plugins/modules/web_infrastructure/htpasswd.py index 2eebdfd5b8..4f05d21b0d 100644 --- a/plugins/modules/web_infrastructure/htpasswd.py +++ b/plugins/modules/web_infrastructure/htpasswd.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2013, Nimbis Services, Inc. -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2013, Nimbis Services, 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 @@ -53,10 +54,10 @@ options: create: required: false type: bool - default: "yes" + default: true description: - - Used with C(state=present). If specified, the file will be created - if it does not already exist. If set to "no", will fail if the + - Used with I(state=present). If specified, the file will be created + if it does not already exist. If set to C(false), will fail if the file does not exist notes: - "This module depends on the I(passlib) Python library, which needs to be installed on all target systems." diff --git a/plugins/modules/web_infrastructure/jboss.py b/plugins/modules/web_infrastructure/jboss.py index 5512e10ee4..2dc82f5594 100644 --- a/plugins/modules/web_infrastructure/jboss.py +++ b/plugins/modules/web_infrastructure/jboss.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2013, Jeroen Hoekx -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2013, Jeroen Hoekx +# 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 @@ -72,7 +73,6 @@ EXAMPLES = r""" RETURN = r""" # """ import os -import shutil import time from ansible.module_utils.basic import AnsibleModule diff --git a/plugins/modules/web_infrastructure/jenkins_build.py b/plugins/modules/web_infrastructure/jenkins_build.py index 0141185342..09304ccfbc 100644 --- a/plugins/modules/web_infrastructure/jenkins_build.py +++ b/plugins/modules/web_infrastructure/jenkins_build.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: (c) Ansible Project -# 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/modules/web_infrastructure/jenkins_job.py b/plugins/modules/web_infrastructure/jenkins_job.py index 88a8766133..0ea52ab36b 100644 --- a/plugins/modules/web_infrastructure/jenkins_job.py +++ b/plugins/modules/web_infrastructure/jenkins_job.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: (c) Ansible Project -# 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 @@ -22,14 +23,14 @@ options: description: - config in XML format. - Required if job does not yet exist. - - Mutually exclusive with C(enabled). - - Considered if C(state=present). + - Mutually exclusive with I(enabled). + - Considered if I(state=present). required: false enabled: description: - Whether the job should be enabled or disabled. - - Mutually exclusive with C(config). - - Considered if C(state=present). + - Mutually exclusive with I(config). + - Considered if I(state=present). type: bool required: false name: @@ -67,10 +68,10 @@ options: required: false validate_certs: type: bool - default: yes + default: true description: - - If set to C(no), the SSL certificates will not be validated. - This should only set to C(no) used on personally controlled sites + - If set to C(false), the SSL certificates will not be validated. + This should only set to C(false) used on personally controlled sites using self-signed certificates as it avoids verifying the source site. - The C(python-jenkins) library only handles this by using the environment variable C(PYTHONHTTPSVERIFY). version_added: 2.3.0 @@ -113,7 +114,7 @@ EXAMPLES = ''' community.general.jenkins_job: name: test password: admin - enabled: False + enabled: false url: http://localhost:8080 user: admin @@ -121,7 +122,7 @@ EXAMPLES = ''' community.general.jenkins_job: name: test token: asdfasfasfasdfasdfadfasfasdfasdfc - enabled: False + enabled: false url: http://localhost:8080 user: admin ''' diff --git a/plugins/modules/web_infrastructure/jenkins_job_info.py b/plugins/modules/web_infrastructure/jenkins_job_info.py index 503fbbf159..1195a3e03d 100644 --- a/plugins/modules/web_infrastructure/jenkins_job_info.py +++ b/plugins/modules/web_infrastructure/jenkins_job_info.py @@ -1,9 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright: (c) Ansible Project +# Copyright (c) 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 @@ -118,7 +119,7 @@ EXAMPLES = ''' user: admin token: 126df5c60d66c66e3b75b11104a16a8a url: https://jenkins.example.com - validate_certs: False + validate_certs: false register: my_jenkins_job_info ''' diff --git a/plugins/modules/web_infrastructure/jenkins_plugin.py b/plugins/modules/web_infrastructure/jenkins_plugin.py index 6adb348156..27261bf815 100644 --- a/plugins/modules/web_infrastructure/jenkins_plugin.py +++ b/plugins/modules/web_infrastructure/jenkins_plugin.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2016, Jiri Tyr -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, Jiri Tyr +# 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 @@ -36,7 +37,7 @@ options: type: str description: - Plugin name. - required: yes + required: true owner: type: str description: @@ -113,7 +114,7 @@ options: - Defines whether to install plugin dependencies. - This option takes effect only if the I(version) is not defined. type: bool - default: yes + default: true notes: - Plugin installation should be run under root or the same user which owns @@ -140,7 +141,7 @@ EXAMPLES = ''' - name: Install plugin without its dependencies community.general.jenkins_plugin: name: build-pipeline-plugin - with_dependencies: no + with_dependencies: false - name: Make sure the plugin is always up-to-date community.general.jenkins_plugin: @@ -195,11 +196,11 @@ EXAMPLES = ''' vars: my_jenkins_plugins: token-macro: - enabled: yes + enabled: true build-pipeline-plugin: version: "1.4.9" - pinned: no - enabled: yes + pinned: false + enabled: true tasks: - name: Install plugins without a specific version community.general.jenkins_plugin: @@ -220,17 +221,17 @@ EXAMPLES = ''' - name: Initiate the fact ansible.builtin.set_fact: - jenkins_restart_required: no + jenkins_restart_required: false - name: Check if restart is required by any of the versioned plugins ansible.builtin.set_fact: - jenkins_restart_required: yes + jenkins_restart_required: true when: item.changed with_items: "{{ my_jenkins_plugin_versioned.results }}" - name: Check if restart is required by any of the unversioned plugins ansible.builtin.set_fact: - jenkins_restart_required: yes + jenkins_restart_required: true when: item.changed with_items: "{{ my_jenkins_plugin_unversioned.results }}" @@ -256,7 +257,7 @@ EXAMPLES = ''' - name: Reset the fact ansible.builtin.set_fact: - jenkins_restart_required: no + jenkins_restart_required: false when: jenkins_restart_required - name: Plugin pinning @@ -295,7 +296,6 @@ from ansible.module_utils.six.moves.urllib.parse import urlencode from ansible.module_utils.urls import fetch_url, url_argument_spec from ansible.module_utils.six import text_type, binary_type from ansible.module_utils.common.text.converters import to_native -import base64 import hashlib import io import json diff --git a/plugins/modules/web_infrastructure/jenkins_script.py b/plugins/modules/web_infrastructure/jenkins_script.py index 3ad51a9703..58d8e2c642 100644 --- a/plugins/modules/web_infrastructure/jenkins_script.py +++ b/plugins/modules/web_infrastructure/jenkins_script.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2016, James Hogarth -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, James Hogarth +# 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 @@ -32,11 +33,11 @@ options: default: http://localhost:8080 validate_certs: description: - - If set to C(no), the SSL certificates will not be validated. - This should only set to C(no) used on personally controlled sites + - If set to C(false), the SSL certificates will not be validated. + This should only set to C(false) used on personally controlled sites using self-signed certificates as it avoids verifying the source site. type: bool - default: 'yes' + default: true user: type: str description: @@ -89,7 +90,7 @@ EXAMPLES = ''' user: admin password: admin url: https://localhost - validate_certs: no + validate_certs: false ''' RETURN = ''' diff --git a/plugins/modules/web_infrastructure/jira.py b/plugins/modules/web_infrastructure/jira.py index d6c7653835..979dd6d69c 100644 --- a/plugins/modules/web_infrastructure/jira.py +++ b/plugins/modules/web_infrastructure/jira.py @@ -1,13 +1,14 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2014, Steve Smith +# Copyright (c) 2014, Steve Smith # Atlassian open-source approval reference OSR-76. # -# (c) 2020, Per Abildgaard Toft Search and update function -# (c) 2021, Brandon McNama Issue attachment functionality +# Copyright (c) 2020, Per Abildgaard Toft Search and update function +# Copyright (c) 2021, Brandon McNama Issue attachment functionality # -# 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 @@ -186,7 +187,7 @@ options: validate_certs: required: false description: - - Require valid SSL certificates (set to `false` if you'd like to use self-signed certificates) + - Require valid SSL certificates (set to C(false) if you'd like to use self-signed certificates) default: true type: bool diff --git a/plugins/modules/web_infrastructure/nginx_status_info.py b/plugins/modules/web_infrastructure/nginx_status_info.py index ada6881714..1c99fb2370 100644 --- a/plugins/modules/web_infrastructure/nginx_status_info.py +++ b/plugins/modules/web_infrastructure/nginx_status_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# (c) 2016, René Moser -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2016, René Moser +# 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/modules/web_infrastructure/rundeck_acl_policy.py b/plugins/modules/web_infrastructure/rundeck_acl_policy.py index 6356f5a166..6168cb5b64 100644 --- a/plugins/modules/web_infrastructure/rundeck_acl_policy.py +++ b/plugins/modules/web_infrastructure/rundeck_acl_policy.py @@ -1,10 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2017, Loic Blot +# Copyright (c) 2017, Loic Blot # Sponsored by Infopro Digital. http://www.infopro-digital.com/ # Sponsored by E.T.A.I. http://www.etai.fr/ -# 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 @@ -29,12 +30,12 @@ options: type: str description: - Sets the project name. - required: True + required: true url: type: str description: - Sets the rundeck instance URL. - required: True + required: true api_version: type: int description: @@ -45,7 +46,7 @@ options: type: str description: - Sets the token to authenticate against Rundeck API. - required: True + required: true project: type: str description: diff --git a/plugins/modules/web_infrastructure/rundeck_job_executions_info.py b/plugins/modules/web_infrastructure/rundeck_job_executions_info.py index 41418c66a1..2af6eb1d5f 100644 --- a/plugins/modules/web_infrastructure/rundeck_job_executions_info.py +++ b/plugins/modules/web_infrastructure/rundeck_job_executions_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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 @@ -126,11 +127,7 @@ executions: ] ''' -# Modules import -import json - from ansible.module_utils.basic import AnsibleModule -from ansible.module_utils.common.text.converters import to_native from ansible.module_utils.six.moves.urllib.parse import quote from ansible_collections.community.general.plugins.module_utils.rundeck import ( api_argument_spec, diff --git a/plugins/modules/web_infrastructure/rundeck_job_run.py b/plugins/modules/web_infrastructure/rundeck_job_run.py index 1a591ad15f..0416d86fa7 100644 --- a/plugins/modules/web_infrastructure/rundeck_job_run.py +++ b/plugins/modules/web_infrastructure/rundeck_job_run.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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 @@ -173,12 +174,10 @@ execution_info: ''' # Modules import -import json from datetime import datetime, timedelta from time import sleep from ansible.module_utils.basic import AnsibleModule -from ansible.module_utils.common.text.converters import to_native from ansible.module_utils.six.moves.urllib.parse import quote from ansible_collections.community.general.plugins.module_utils.rundeck import ( api_argument_spec, diff --git a/plugins/modules/web_infrastructure/rundeck_project.py b/plugins/modules/web_infrastructure/rundeck_project.py index ef78299596..88f4a78100 100644 --- a/plugins/modules/web_infrastructure/rundeck_project.py +++ b/plugins/modules/web_infrastructure/rundeck_project.py @@ -2,11 +2,12 @@ # -*- coding: utf-8 -*- # Ansible module to manage rundeck projects -# (c) 2017, Loic Blot +# Copyright (c) 2017, Loic Blot # Sponsored by Infopro Digital. http://www.infopro-digital.com/ # Sponsored by E.T.A.I. http://www.etai.fr/ # -# 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 @@ -31,12 +32,12 @@ options: type: str description: - Sets the project name. - required: True + required: true url: type: str description: - Sets the rundeck instance URL. - required: True + required: true api_version: type: int description: @@ -47,7 +48,7 @@ options: type: str description: - Sets the token to authenticate against Rundeck API. - required: True + required: true client_cert: version_added: '0.2.0' client_key: diff --git a/plugins/modules/web_infrastructure/sophos_utm/utm_aaa_group.py b/plugins/modules/web_infrastructure/sophos_utm/utm_aaa_group.py index e2fa6f5384..7d55449f63 100644 --- a/plugins/modules/web_infrastructure/sophos_utm/utm_aaa_group.py +++ b/plugins/modules/web_infrastructure/sophos_utm/utm_aaa_group.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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/modules/web_infrastructure/sophos_utm/utm_aaa_group_info.py b/plugins/modules/web_infrastructure/sophos_utm/utm_aaa_group_info.py index ca291ba88b..26d06cebfe 100644 --- a/plugins/modules/web_infrastructure/sophos_utm/utm_aaa_group_info.py +++ b/plugins/modules/web_infrastructure/sophos_utm/utm_aaa_group_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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 diff --git a/plugins/modules/web_infrastructure/sophos_utm/utm_ca_host_key_cert.py b/plugins/modules/web_infrastructure/sophos_utm/utm_ca_host_key_cert.py index f05a1e6809..693f25964a 100644 --- a/plugins/modules/web_infrastructure/sophos_utm/utm_ca_host_key_cert.py +++ b/plugins/modules/web_infrastructure/sophos_utm/utm_ca_host_key_cert.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2018, Stephan Schwarz -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2018, Stephan Schwarz +# 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 @@ -50,7 +51,7 @@ options: encrypted: description: - Optionally enable encryption. - default: False + default: false type: bool key: description: diff --git a/plugins/modules/web_infrastructure/sophos_utm/utm_ca_host_key_cert_info.py b/plugins/modules/web_infrastructure/sophos_utm/utm_ca_host_key_cert_info.py index 82eb42f620..f67960eeef 100644 --- a/plugins/modules/web_infrastructure/sophos_utm/utm_ca_host_key_cert_info.py +++ b/plugins/modules/web_infrastructure/sophos_utm/utm_ca_host_key_cert_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2018, Stephan Schwarz -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2018, Stephan Schwarz +# 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/modules/web_infrastructure/sophos_utm/utm_dns_host.py b/plugins/modules/web_infrastructure/sophos_utm/utm_dns_host.py index 4554384d2d..387b8301a0 100644 --- a/plugins/modules/web_infrastructure/sophos_utm/utm_dns_host.py +++ b/plugins/modules/web_infrastructure/sophos_utm/utm_dns_host.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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 @@ -52,12 +53,12 @@ options: resolved: description: - whether the hostname's ipv4 address is already resolved or not - default: False + default: false type: bool resolved6: description: - whether the hostname's ipv6 address is already resolved or not - default: False + default: false type: bool timeout: type: int diff --git a/plugins/modules/web_infrastructure/sophos_utm/utm_network_interface_address.py b/plugins/modules/web_infrastructure/sophos_utm/utm_network_interface_address.py index a5c2d1fd36..cb10ad49f4 100644 --- a/plugins/modules/web_infrastructure/sophos_utm/utm_network_interface_address.py +++ b/plugins/modules/web_infrastructure/sophos_utm/utm_network_interface_address.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2018, Juergen Wiebe -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2018, Juergen Wiebe +# 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/modules/web_infrastructure/sophos_utm/utm_network_interface_address_info.py b/plugins/modules/web_infrastructure/sophos_utm/utm_network_interface_address_info.py index fb449939fa..d7910e73e4 100644 --- a/plugins/modules/web_infrastructure/sophos_utm/utm_network_interface_address_info.py +++ b/plugins/modules/web_infrastructure/sophos_utm/utm_network_interface_address_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2018, Juergen Wiebe -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2018, Juergen Wiebe +# 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/modules/web_infrastructure/sophos_utm/utm_proxy_auth_profile.py b/plugins/modules/web_infrastructure/sophos_utm/utm_proxy_auth_profile.py index e519d3cf33..aab426cc03 100644 --- a/plugins/modules/web_infrastructure/sophos_utm/utm_proxy_auth_profile.py +++ b/plugins/modules/web_infrastructure/sophos_utm/utm_proxy_auth_profile.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2018, Stephan Schwarz -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2018, Stephan Schwarz +# 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 @@ -51,7 +52,7 @@ options: description: - Should the login data be stripped when proxying the request to the backend host type: bool - default: True + default: true choices: - True - False @@ -111,7 +112,7 @@ options: description: - Allow session persistency type: bool - default: False + default: false choices: - True - False @@ -124,7 +125,7 @@ options: description: - Specifies if limitation of session lifetime is active type: bool - default: True + default: true choices: - True - False @@ -146,7 +147,7 @@ options: description: - Specifies if session timeout is active type: bool - default: True + default: true choices: - True - False @@ -177,7 +178,7 @@ options: description: - Should a redirect to the requested URL be made type: bool - default: False + default: false choices: - True - False diff --git a/plugins/modules/web_infrastructure/sophos_utm/utm_proxy_exception.py b/plugins/modules/web_infrastructure/sophos_utm/utm_proxy_exception.py index 780bd68c92..f322bc8216 100644 --- a/plugins/modules/web_infrastructure/sophos_utm/utm_proxy_exception.py +++ b/plugins/modules/web_infrastructure/sophos_utm/utm_proxy_exception.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2018, Sebastian Schenzel -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2018, Sebastian Schenzel +# 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 @@ -26,7 +27,7 @@ options: name: description: - The name of the object. Will be used to identify the entry - required: True + required: true type: str op: description: @@ -35,7 +36,7 @@ options: choices: - 'AND' - 'OR' - required: False + required: false type: str path: description: @@ -43,82 +44,82 @@ options: type: list elements: str default: [] - required: False + required: false skip_custom_threats_filters: description: - A list of threats to be skipped type: list elements: str default: [] - required: False + required: false skip_threats_filter_categories: description: - Define which categories of threats are skipped type: list elements: str default: [] - required: False + required: false skipav: description: - Skip the Antivirus Scanning - default: False + default: false type: bool - required: False + required: false skipbadclients: description: - Block clients with bad reputation - default: False + default: false type: bool - required: False + required: false skipcookie: description: - Skip the Cookie Signing check - default: False + default: false type: bool - required: False + required: false skipform: description: - Enable form hardening - default: False + default: false type: bool - required: False + required: false skipform_missingtoken: description: - Enable form hardening with missing tokens - default: False + default: false type: bool - required: False + required: false skiphtmlrewrite: description: - Protection against SQL - default: False + default: false type: bool - required: False + required: false skiptft: description: - Enable true file type control - default: False + default: false type: bool - required: False + required: false skipurl: description: - Enable static URL hardening - default: False + default: false type: bool - required: False + required: false source: description: - Define which categories of threats are skipped type: list elements: str default: [] - required: False + required: false status: description: - Status of the exception rule set - default: True + default: true type: bool - required: False + required: false extends_documentation_fragment: - community.general.utm diff --git a/plugins/modules/web_infrastructure/sophos_utm/utm_proxy_frontend.py b/plugins/modules/web_infrastructure/sophos_utm/utm_proxy_frontend.py index 9d2bc7c6db..8f5a1e8686 100644 --- a/plugins/modules/web_infrastructure/sophos_utm/utm_proxy_frontend.py +++ b/plugins/modules/web_infrastructure/sophos_utm/utm_proxy_frontend.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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 @@ -32,7 +33,7 @@ options: description: - Whether to add the content type header or not type: bool - default: False + default: false address: type: str description: @@ -58,7 +59,7 @@ options: description: - Whether to enable the compression type: bool - default: False + default: false domain: type: list elements: str @@ -74,17 +75,17 @@ options: description: - Whether to enable html rewrite or not type: bool - default: False + default: false htmlrewrite_cookies: description: - Whether to enable html rewrite cookie or not type: bool - default: False + default: false implicitredirect: description: - Whether to enable implicit redirection or not type: bool - default: False + default: false lbmethod: type: str description: @@ -110,7 +111,7 @@ options: description: - Whether to preserve host header type: bool - default: False + default: false profile: type: str description: @@ -120,7 +121,7 @@ options: description: - Whether to activate the frontend entry or not type: bool - default: True + default: true type: type: str description: @@ -133,7 +134,7 @@ options: description: - Whether to pass the host header or not type: bool - default: False + default: false extends_documentation_fragment: - community.general.utm diff --git a/plugins/modules/web_infrastructure/sophos_utm/utm_proxy_frontend_info.py b/plugins/modules/web_infrastructure/sophos_utm/utm_proxy_frontend_info.py index b68bde633a..27a71a013e 100644 --- a/plugins/modules/web_infrastructure/sophos_utm/utm_proxy_frontend_info.py +++ b/plugins/modules/web_infrastructure/sophos_utm/utm_proxy_frontend_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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 diff --git a/plugins/modules/web_infrastructure/sophos_utm/utm_proxy_location.py b/plugins/modules/web_infrastructure/sophos_utm/utm_proxy_location.py index 4c0abb0608..5864cf1924 100644 --- a/plugins/modules/web_infrastructure/sophos_utm/utm_proxy_location.py +++ b/plugins/modules/web_infrastructure/sophos_utm/utm_proxy_location.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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 @@ -41,7 +42,8 @@ options: - A list of allowed networks type: list elements: str - default: REF_NetworkAny + default: + - REF_NetworkAny auth_profile: type: str description: @@ -70,7 +72,7 @@ options: description: - Activate hot standby mode type: bool - default: False + default: false path: type: str description: @@ -80,7 +82,7 @@ options: description: - Whether the location is active or not type: bool - default: True + default: true stickysession_id: type: str description: @@ -90,12 +92,12 @@ options: description: - Enable the stickysession type: bool - default: False + default: false websocket_passthrough: description: - Enable the websocket passthrough type: bool - default: False + default: false extends_documentation_fragment: - community.general.utm diff --git a/plugins/modules/web_infrastructure/sophos_utm/utm_proxy_location_info.py b/plugins/modules/web_infrastructure/sophos_utm/utm_proxy_location_info.py index eda9f6ee14..b46603f8f1 100644 --- a/plugins/modules/web_infrastructure/sophos_utm/utm_proxy_location_info.py +++ b/plugins/modules/web_infrastructure/sophos_utm/utm_proxy_location_info.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- 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 diff --git a/plugins/modules/web_infrastructure/supervisorctl.py b/plugins/modules/web_infrastructure/supervisorctl.py index bc4ef19af1..e108ebb81d 100644 --- a/plugins/modules/web_infrastructure/supervisorctl.py +++ b/plugins/modules/web_infrastructure/supervisorctl.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2012, Matt Wright -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2012, Matt Wright +# 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/modules/web_infrastructure/taiga_issue.py b/plugins/modules/web_infrastructure/taiga_issue.py index 729757590d..25f6557ea2 100644 --- a/plugins/modules/web_infrastructure/taiga_issue.py +++ b/plugins/modules/web_infrastructure/taiga_issue.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2015, Alejandro Guirao -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2015, Alejandro Guirao +# 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 @@ -26,17 +27,17 @@ options: type: str description: - Name of the project containing the issue. Must exist previously. - required: True + required: true subject: type: str description: - The issue subject. - required: True + required: true issue_type: type: str description: - The issue type. Must exist previously. - required: True + required: true priority: type: str description: diff --git a/plugins/test/a_module.py b/plugins/test/a_module.py index ee5fdcacbc..0d6cecac6a 100644 --- a/plugins/test/a_module.py +++ b/plugins/test/a_module.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/tests/.gitignore b/tests/.gitignore index ea1472ec1f..6edf5dc10c 100644 --- a/tests/.gitignore +++ b/tests/.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 + output/ diff --git a/tests/config.yml b/tests/config.yml index ba0238e305..38590f2e4e 100644 --- a/tests/config.yml +++ b/tests/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 + # See template for more information: # https://github.com/ansible/ansible/blob/devel/test/lib/ansible_test/config/config.yml modules: diff --git a/tests/integration/targets/__init__.py b/tests/integration/targets/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/integration/targets/aix_devices/aliases b/tests/integration/targets/aix_devices/aliases index e6cab07d71..8d841c56be 100644 --- a/tests/integration/targets/aix_devices/aliases +++ b/tests/integration/targets/aix_devices/aliases @@ -1,2 +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 + # No AIX LPAR available unsupported diff --git a/tests/integration/targets/aix_devices/tasks/main.yml b/tests/integration/targets/aix_devices/tasks/main.yml index 3bb3329b7b..d007e9b611 100644 --- a/tests/integration/targets/aix_devices/tasks/main.yml +++ b/tests/integration/targets/aix_devices/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Scan new devices. aix_devices: device: all diff --git a/tests/integration/targets/aix_filesystem/aliases b/tests/integration/targets/aix_filesystem/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/aix_filesystem/aliases +++ b/tests/integration/targets/aix_filesystem/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/aix_filesystem/tasks/main.yml b/tests/integration/targets/aix_filesystem/tasks/main.yml index ed326d933d..e17ec4d263 100644 --- a/tests/integration/targets/aix_filesystem/tasks/main.yml +++ b/tests/integration/targets/aix_filesystem/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Umounting /testfs aix_filesystem: filesystem: /testfs diff --git a/tests/integration/targets/alerta_customer/aliases b/tests/integration/targets/alerta_customer/aliases index 268da2c702..1a0d20b0b2 100644 --- a/tests/integration/targets/alerta_customer/aliases +++ b/tests/integration/targets/alerta_customer/aliases @@ -1,2 +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 + shippable/posix/group1 disabled diff --git a/tests/integration/targets/alerta_customer/defaults/main.yml b/tests/integration/targets/alerta_customer/defaults/main.yml index f07352a92d..3d4877b41f 100644 --- a/tests/integration/targets/alerta_customer/defaults/main.yml +++ b/tests/integration/targets/alerta_customer/defaults/main.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 + alerta_url: http://localhost:8080/ alerta_user: admin@example.com alerta_password: password diff --git a/tests/integration/targets/alerta_customer/tasks/main.yml b/tests/integration/targets/alerta_customer/tasks/main.yml index 8e80e5a323..b91c24b531 100644 --- a/tests/integration/targets/alerta_customer/tasks/main.yml +++ b/tests/integration/targets/alerta_customer/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Create customer (check mode) alerta_customer: alerta_url: "{{ alerta_url }}" diff --git a/tests/integration/targets/alternatives/aliases b/tests/integration/targets/alternatives/aliases index 64c02f24ff..d281365a46 100644 --- a/tests/integration/targets/alternatives/aliases +++ b/tests/integration/targets/alternatives/aliases @@ -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 + shippable/posix/group3 destructive needs/root diff --git a/tests/integration/targets/alternatives/tasks/main.yml b/tests/integration/targets/alternatives/tasks/main.yml index 1120cfd37d..eac512aa45 100644 --- a/tests/integration/targets/alternatives/tasks/main.yml +++ b/tests/integration/targets/alternatives/tasks/main.yml @@ -4,7 +4,8 @@ #################################################################### # Copyright (c) 2017 Pierre-Louis Bonicoli -# 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 - name: 'setup: create a dummy alternative' block: @@ -49,6 +50,9 @@ # Test that path is checked: alternatives must fail when path is nonexistent - import_tasks: path_is_checked.yml + # Test that subcommands commands work + - import_tasks: subcommands.yml + # Test operation of the 'state' parameter - block: - include_tasks: remove_links.yml @@ -63,6 +67,8 @@ state: absent with_items: - '{{ alternatives_dir }}/dummy' + - '{{ alternatives_dir }}/dummymain' + - '{{ alternatives_dir }}/dummysubcmd' - file: path: '/usr/bin/dummy{{ item }}' diff --git a/tests/integration/targets/alternatives/tasks/path_is_checked.yml b/tests/integration/targets/alternatives/tasks/path_is_checked.yml index ef0a3b4763..47ce1a54ef 100644 --- a/tests/integration/targets/alternatives/tasks/path_is_checked.yml +++ b/tests/integration/targets/alternatives/tasks/path_is_checked.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: Try with nonexistent path alternatives: name: dummy diff --git a/tests/integration/targets/alternatives/tasks/remove_links.yml b/tests/integration/targets/alternatives/tasks/remove_links.yml index a04baee027..de25b02cbc 100644 --- a/tests/integration/targets/alternatives/tasks/remove_links.yml +++ b/tests/integration/targets/alternatives/tasks/remove_links.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: remove links file: path: '{{ item }}' diff --git a/tests/integration/targets/alternatives/tasks/setup.yml b/tests/integration/targets/alternatives/tasks/setup.yml index 7e4a405340..ab2c398521 100644 --- a/tests/integration/targets/alternatives/tasks/setup.yml +++ b/tests/integration/targets/alternatives/tasks/setup.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 + - include_vars: '{{ item }}' with_first_found: - files: diff --git a/tests/integration/targets/alternatives/tasks/setup_test.yml b/tests/integration/targets/alternatives/tasks/setup_test.yml index 4475514745..77279c67f1 100644 --- a/tests/integration/targets/alternatives/tasks/setup_test.yml +++ b/tests/integration/targets/alternatives/tasks/setup_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 + - template: src: dummy_alternative dest: '{{ alternatives_dir }}/dummy' diff --git a/tests/integration/targets/alternatives/tasks/subcommands.yml b/tests/integration/targets/alternatives/tasks/subcommands.yml new file mode 100644 index 0000000000..e83fd6db3c --- /dev/null +++ b/tests/integration/targets/alternatives/tasks/subcommands.yml @@ -0,0 +1,222 @@ +--- +# 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: Try with subcommands + alternatives: + name: dummymain + path: '/usr/bin/dummy1' + link: '/usr/bin/dummymain' + subcommands: + - name: dummysubcmd + path: '/usr/bin/dummy2' + link: '/usr/bin/dummysubcmd' + register: alternative + +- name: Check expected command was executed + assert: + that: + - 'alternative is changed' + +- name: Execute the current dummymain command + command: dummymain + register: cmd + +- name: Ensure that the expected command was executed + assert: + that: + - cmd.stdout == "dummy1" + +- name: Execute the current dummysubcmd command + command: dummysubcmd + register: cmd + +- name: Ensure that the expected command was executed + assert: + that: + - cmd.stdout == "dummy2" + +- name: Get dummymain alternatives output + command: + cmd: '{{ alternatives_command }} --display dummymain' + register: result + +- name: Print result + debug: + var: result.stdout_lines + +- name: Subcommands are not removed if not specified + alternatives: + name: dummymain + path: '/usr/bin/dummy1' + link: '/usr/bin/dummymain' + register: alternative + +- name: Check expected command was executed + assert: + that: + - 'alternative is not changed' + +- name: Execute the current dummysubcmd command + command: dummysubcmd + register: cmd + +- name: Ensure that the expected command was executed + assert: + that: + - cmd.stdout == "dummy2" + +- name: Subcommands are removed if set to an empty list + alternatives: + name: dummymain + path: '/usr/bin/dummy1' + link: '/usr/bin/dummymain' + subcommands: [] + register: alternative + +- name: Check expected command was executed + assert: + that: + - 'alternative is changed' + +- name: Execute the current dummysubcmd command + command: dummysubcmd + register: cmd + ignore_errors: True + +- name: Ensure that the subcommand is gone + assert: + that: + - cmd.rc == 2 + - '"No such file" in cmd.msg' + +- name: Get dummymain alternatives output + command: + cmd: '{{ alternatives_command }} --display dummymain' + register: result + +- name: Print result + debug: + var: result.stdout_lines + +- name: Install other alternative with subcommands + alternatives: + name: dummymain + path: '/usr/bin/dummy3' + link: '/usr/bin/dummymain' + subcommands: + - name: dummysubcmd + path: '/usr/bin/dummy4' + link: '/usr/bin/dummysubcmd' + register: alternative + +- name: Check expected command was executed + assert: + that: + - 'alternative is changed' + +- name: Execute the current dummymain command + command: dummymain + register: cmd + +- name: Ensure that the expected command was executed + assert: + that: + - cmd.stdout == "dummy3" + +- name: Execute the current dummysubcmd command + command: dummysubcmd + register: cmd + +- name: Ensure that the expected command was executed + assert: + that: + - cmd.stdout == "dummy4" + +- name: Get dummymain alternatives output + command: + cmd: '{{ alternatives_command }} --display dummymain' + register: result + +- name: Print result + debug: + var: result.stdout_lines + +- name: Switch to first alternative + alternatives: + name: dummymain + path: '/usr/bin/dummy1' + register: alternative + +- name: Check expected command was executed + assert: + that: + - 'alternative is changed' + +- name: Execute the current dummymain command + command: dummymain + register: cmd + +- name: Ensure that the expected command was executed + assert: + that: + - cmd.stdout == "dummy1" + +- name: Execute the current dummysubcmd command + command: dummysubcmd + register: cmd + ignore_errors: True + +- name: Ensure that the subcommand is gone + assert: + that: + - cmd.rc == 2 + - '"No such file" in cmd.msg' + +- name: Get dummymain alternatives output + command: + cmd: '{{ alternatives_command }} --display dummymain' + register: result + +- name: Print result + debug: + var: result.stdout_lines + +- name: Switch to second alternative + alternatives: + name: dummymain + path: '/usr/bin/dummy3' + register: alternative + +- name: Check expected command was executed + assert: + that: + - 'alternative is changed' + +- name: Execute the current dummymain command + command: dummymain + register: cmd + +- name: Ensure that the expected command was executed + assert: + that: + - cmd.stdout == "dummy3" + +- name: Execute the current dummysubcmd command + command: dummysubcmd + register: cmd + +- name: Ensure that the expected command was executed + assert: + that: + - cmd.stdout == "dummy4" + +- name: Get dummymain alternatives output + command: + cmd: '{{ alternatives_command }} --display dummymain' + register: result + +- name: Print result + debug: + var: result.stdout_lines diff --git a/tests/integration/targets/alternatives/tasks/test.yml b/tests/integration/targets/alternatives/tasks/test.yml index 92721a995d..ca59a4b554 100644 --- a/tests/integration/targets/alternatives/tasks/test.yml +++ b/tests/integration/targets/alternatives/tasks/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 + - debug: msg: ' with_alternatives: {{ with_alternatives }}, mode: {{ mode }}' @@ -49,5 +54,3 @@ - name: check that alternative has been updated command: "grep -Pzq '/bin/dummy{{ item }}\\n' '{{ alternatives_dir }}/dummy'" - # priority doesn't seem updated - #command: "grep -Pzq '/bin/dummy{{ item }}\\n50' '{{ alternatives_dir }}/dummy'" diff --git a/tests/integration/targets/alternatives/tasks/tests.yml b/tests/integration/targets/alternatives/tasks/tests.yml index e0400dfd81..75e30cabea 100644 --- a/tests/integration/targets/alternatives/tasks/tests.yml +++ b/tests/integration/targets/alternatives/tasks/tests.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 + - block: - include_tasks: remove_links.yml - include_tasks: setup_test.yml diff --git a/tests/integration/targets/alternatives/tasks/tests_set_priority.yml b/tests/integration/targets/alternatives/tasks/tests_set_priority.yml index ab79f62a3c..46cf48e59b 100644 --- a/tests/integration/targets/alternatives/tasks/tests_set_priority.yml +++ b/tests/integration/targets/alternatives/tasks/tests_set_priority.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: update dummy alternative alternatives: name: dummy @@ -21,3 +26,29 @@ - name: check that alternative has been updated command: "grep -Pzq '/bin/dummy{{ item }}\\n{{ 60 + item|int }}' '{{ alternatives_dir }}/dummy'" + +- name: update dummy priority + alternatives: + name: dummy + path: '/usr/bin/dummy{{ item }}' + link: /usr/bin/dummy + priority: '{{ 70 + item|int }}' + register: alternative + +- name: check that alternative priority has been updated + command: "grep -Pzq '/bin/dummy{{ item }}\\n{{ 70 + item|int }}' '{{ alternatives_dir }}/dummy'" + +- name: no change without priority + alternatives: + name: dummy + path: '/usr/bin/dummy{{ item }}' + link: /usr/bin/dummy + register: alternative + +- name: check no change was triggered without priority + assert: + that: + - 'alternative is not changed' + +- name: check that alternative priority has not been changed + command: "grep -Pzq '/bin/dummy{{ item }}\\n{{ 70 + item|int }}' '{{ alternatives_dir }}/dummy'" diff --git a/tests/integration/targets/alternatives/tasks/tests_state.yml b/tests/integration/targets/alternatives/tasks/tests_state.yml index 357da315ed..92c8078c2b 100644 --- a/tests/integration/targets/alternatives/tasks/tests_state.yml +++ b/tests/integration/targets/alternatives/tasks/tests_state.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 + # Add a few dummy alternatives with state = present and make sure that the # group is in 'auto' mode and the highest priority alternative is selected. - name: Add some dummy alternatives with state = present @@ -49,6 +54,28 @@ - cmd.stdout == "dummy4" # Set the currently selected alternative to state = 'present' (was previously +# selected), and ensure that this results in the group not being set to 'auto' +# mode, and the alternative is still selected. +- name: Set current selected dummy to state = present + alternatives: + name: dummy + path: /usr/bin/dummy4 + link: /usr/bin/dummy + state: present + +- name: Ensure that the link group is in auto mode + shell: 'head -n1 {{ alternatives_dir }}/dummy | grep "^manual$"' + +- name: Execute the current dummy command + shell: dummy + register: cmd + +- name: Ensure that the expected command was executed + assert: + that: + - cmd.stdout == "dummy4" + +# Set the currently selected alternative to state = 'auto' (was previously # selected), and ensure that this results in the group being set to 'auto' # mode, and the highest priority alternative is selected. - name: Set current selected dummy to state = present @@ -56,7 +83,7 @@ name: dummy path: /usr/bin/dummy4 link: /usr/bin/dummy - state: present + state: auto - name: Ensure that the link group is in auto mode shell: 'head -n1 {{ alternatives_dir }}/dummy | grep "^auto$"' @@ -69,3 +96,25 @@ assert: that: - cmd.stdout == "dummy2" + +# Remove an alternative with state = 'absent' and make sure that +# this change results in the alternative being removed. +- name: Remove best dummy alternative with state = absent + alternatives: + name: dummy + path: /usr/bin/dummy2 + state: absent + +- name: Ensure that the link group is in auto mode + shell: 'grep "/usr/bin/dummy2" {{ alternatives_dir }}/dummy' + register: cmd + failed_when: cmd.rc == 0 + +- name: Execute the current dummy command + shell: dummy + register: cmd + +- name: Ensure that the expected command was executed + assert: + that: + - cmd.stdout == "dummy1" diff --git a/tests/integration/targets/alternatives/templates/dummy_alternative b/tests/integration/targets/alternatives/templates/dummy_alternative index 5dce8adde7..9b7136d565 100644 --- a/tests/integration/targets/alternatives/templates/dummy_alternative +++ b/tests/integration/targets/alternatives/templates/dummy_alternative @@ -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 +#} {{ mode }} /usr/bin/dummy diff --git a/tests/integration/targets/alternatives/templates/dummy_command b/tests/integration/targets/alternatives/templates/dummy_command index 332d9fe1a9..afd80e6733 100644 --- a/tests/integration/targets/alternatives/templates/dummy_command +++ b/tests/integration/targets/alternatives/templates/dummy_command @@ -1,2 +1,6 @@ #!/bin/sh +# 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 + echo dummy{{ item }} diff --git a/tests/integration/targets/alternatives/vars/Debian.yml b/tests/integration/targets/alternatives/vars/Debian.yml index 1e83283e4d..e7f87c59d2 100644 --- a/tests/integration/targets/alternatives/vars/Debian.yml +++ b/tests/integration/targets/alternatives/vars/Debian.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 + alternatives_dir: /var/lib/dpkg/alternatives/ +alternatives_command: update-alternatives diff --git a/tests/integration/targets/alternatives/vars/Suse-42.3.yml b/tests/integration/targets/alternatives/vars/Suse-42.3.yml index 37664ddb56..0d5a9cfec0 100644 --- a/tests/integration/targets/alternatives/vars/Suse-42.3.yml +++ b/tests/integration/targets/alternatives/vars/Suse-42.3.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 + alternatives_dir: /var/lib/rpm/alternatives/ +alternatives_command: update-alternatives diff --git a/tests/integration/targets/alternatives/vars/default.yml b/tests/integration/targets/alternatives/vars/default.yml index d00123ded3..68e1feafad 100644 --- a/tests/integration/targets/alternatives/vars/default.yml +++ b/tests/integration/targets/alternatives/vars/default.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 + alternatives_dir: /var/lib/alternatives/ +alternatives_command: update-alternatives diff --git a/tests/integration/targets/ansible_galaxy_install/aliases b/tests/integration/targets/ansible_galaxy_install/aliases index e9dc8635ac..de4a0e413a 100644 --- a/tests/integration/targets/ansible_galaxy_install/aliases +++ b/tests/integration/targets/ansible_galaxy_install/aliases @@ -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 + destructive shippable/posix/group3 skip/python2.6 diff --git a/tests/integration/targets/ansible_galaxy_install/files/test.yml b/tests/integration/targets/ansible_galaxy_install/files/test.yml index 9d2848e087..877b5fca40 100644 --- a/tests/integration/targets/ansible_galaxy_install/files/test.yml +++ b/tests/integration/targets/ansible_galaxy_install/files/test.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 + roles: # Install a role from Ansible Galaxy. - name: geerlingguy.java diff --git a/tests/integration/targets/ansible_galaxy_install/meta/main.yml b/tests/integration/targets/ansible_galaxy_install/meta/main.yml index 1810d4bec9..982de6eb03 100644 --- a/tests/integration/targets/ansible_galaxy_install/meta/main.yml +++ b/tests/integration/targets/ansible_galaxy_install/meta/main.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 + dependencies: - setup_remote_tmp_dir diff --git a/tests/integration/targets/ansible_galaxy_install/tasks/main.yml b/tests/integration/targets/ansible_galaxy_install/tasks/main.yml index db0ad4d2a5..44ad697930 100644 --- a/tests/integration/targets/ansible_galaxy_install/tasks/main.yml +++ b/tests/integration/targets/ansible_galaxy_install/tasks/main.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: Install collection netbox.netbox community.general.ansible_galaxy_install: diff --git a/tests/integration/targets/apache2_module/aliases b/tests/integration/targets/apache2_module/aliases index 0725da563f..64596c2b12 100644 --- a/tests/integration/targets/apache2_module/aliases +++ b/tests/integration/targets/apache2_module/aliases @@ -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 + destructive shippable/posix/group3 skip/aix diff --git a/tests/integration/targets/apache2_module/tasks/actualtest.yml b/tests/integration/targets/apache2_module/tasks/actualtest.yml index 886e746f07..156b54047d 100644 --- a/tests/integration/targets/apache2_module/tasks/actualtest.yml +++ b/tests/integration/targets/apache2_module/tasks/actualtest.yml @@ -1,17 +1,7 @@ -# 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 - name: disable userdir module community.general.apache2_module: diff --git a/tests/integration/targets/apache2_module/tasks/main.yml b/tests/integration/targets/apache2_module/tasks/main.yml index d840ff60e8..650e36474c 100644 --- a/tests/integration/targets/apache2_module/tasks/main.yml +++ b/tests/integration/targets/apache2_module/tasks/main.yml @@ -4,6 +4,9 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: install apache via apt apt: diff --git a/tests/integration/targets/archive/aliases b/tests/integration/targets/archive/aliases index 08f26ea447..421f918a39 100644 --- a/tests/integration/targets/archive/aliases +++ b/tests/integration/targets/archive/aliases @@ -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 + needs/root shippable/posix/group2 destructive diff --git a/tests/integration/targets/archive/files/bar.txt b/tests/integration/targets/archive/files/bar.txt index 5f34b0af07..32276adb82 100644 --- a/tests/integration/targets/archive/files/bar.txt +++ b/tests/integration/targets/archive/files/bar.txt @@ -1 +1,5 @@ -bar.txt \ No newline at end of file +# 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 + +bar.txt diff --git a/tests/integration/targets/archive/files/foo.txt b/tests/integration/targets/archive/files/foo.txt index 7c6ded14ec..a40d2f0080 100644 --- a/tests/integration/targets/archive/files/foo.txt +++ b/tests/integration/targets/archive/files/foo.txt @@ -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 + foo.txt diff --git a/tests/integration/targets/archive/meta/main.yml b/tests/integration/targets/archive/meta/main.yml index 56bc554611..ca1915e05c 100644 --- a/tests/integration/targets/archive/meta/main.yml +++ b/tests/integration/targets/archive/meta/main.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 + dependencies: - setup_pkg_mgr - setup_remote_tmp_dir diff --git a/tests/integration/targets/archive/tasks/main.yml b/tests/integration/targets/archive/tasks/main.yml index e7b6c44175..29742ccf9c 100644 --- a/tests/integration/targets/archive/tasks/main.yml +++ b/tests/integration/targets/archive/tasks/main.yml @@ -1,25 +1,14 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### # Test code for the archive module. -# (c) 2017, Abhijeet Kasurde +# Copyright (c) 2017, Abhijeet Kasurde +# 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 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 . # Make sure we start fresh # Test setup diff --git a/tests/integration/targets/archive/tests/broken-link.yml b/tests/integration/targets/archive/tests/broken-link.yml index 677ebe0bf7..8f8b534d58 100644 --- a/tests/integration/targets/archive/tests/broken-link.yml +++ b/tests/integration/targets/archive/tests/broken-link.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 + - block: - name: Create link - broken link ({{ format }}) file: diff --git a/tests/integration/targets/archive/tests/core.yml b/tests/integration/targets/archive/tests/core.yml index f3ae906429..1c4f4d1aaf 100644 --- a/tests/integration/targets/archive/tests/core.yml +++ b/tests/integration/targets/archive/tests/core.yml @@ -1,25 +1,14 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### # Test code for the archive module. -# (c) 2017, Abhijeet Kasurde +# Copyright (c) 2017, Abhijeet Kasurde +# 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 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 . # Make sure we start fresh # Core functionality tests diff --git a/tests/integration/targets/archive/tests/exclusions.yml b/tests/integration/targets/archive/tests/exclusions.yml index b2a8c7b890..3c5f1fc5cf 100644 --- a/tests/integration/targets/archive/tests/exclusions.yml +++ b/tests/integration/targets/archive/tests/exclusions.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: Archive - exclusion patterns ({{ format }}) archive: path: "{{ remote_tmp_dir }}/*.txt" diff --git a/tests/integration/targets/archive/tests/idempotency.yml b/tests/integration/targets/archive/tests/idempotency.yml index 5a44922adb..32f20a6569 100644 --- a/tests/integration/targets/archive/tests/idempotency.yml +++ b/tests/integration/targets/archive/tests/idempotency.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: Archive - file content idempotency ({{ format }}) archive: path: "{{ remote_tmp_dir }}/*.txt" diff --git a/tests/integration/targets/archive/tests/remove.yml b/tests/integration/targets/archive/tests/remove.yml index 08f16e98da..b58046af6a 100644 --- a/tests/integration/targets/archive/tests/remove.yml +++ b/tests/integration/targets/archive/tests/remove.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: Archive - remove source files ({{ format }}) archive: path: "{{ remote_tmp_dir }}/*.txt" diff --git a/tests/integration/targets/callback/inventory.yml b/tests/integration/targets/callback/inventory.yml index ada2e76127..8e1a47e9a6 100644 --- a/tests/integration/targets/callback/inventory.yml +++ b/tests/integration/targets/callback/inventory.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 + all: hosts: testhost: diff --git a/tests/integration/targets/callback/tasks/main.yml b/tests/integration/targets/callback/tasks/main.yml index 1b178f93bf..827217a532 100644 --- a/tests/integration/targets/callback/tasks/main.yml +++ b/tests/integration/targets/callback/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + - block: - name: Create temporary playbook files tempfile: diff --git a/tests/integration/targets/callback_diy/aliases b/tests/integration/targets/callback_diy/aliases index 252d6ceba4..c0ba6c5230 100644 --- a/tests/integration/targets/callback_diy/aliases +++ b/tests/integration/targets/callback_diy/aliases @@ -1,2 +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 + shippable/posix/group3 needs/target/callback diff --git a/tests/integration/targets/callback_diy/tasks/main.yml b/tests/integration/targets/callback_diy/tasks/main.yml index d087e452f5..fa468b52ba 100644 --- a/tests/integration/targets/callback_diy/tasks/main.yml +++ b/tests/integration/targets/callback_diy/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Run tests include_role: name: callback diff --git a/tests/integration/targets/callback_log_plays/aliases b/tests/integration/targets/callback_log_plays/aliases index b59832142f..7a0fc5c1ea 100644 --- a/tests/integration/targets/callback_log_plays/aliases +++ b/tests/integration/targets/callback_log_plays/aliases @@ -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 + shippable/posix/group3 diff --git a/tests/integration/targets/callback_log_plays/ping_log.yml b/tests/integration/targets/callback_log_plays/ping_log.yml index 8015726ebb..24f35f8996 100644 --- a/tests/integration/targets/callback_log_plays/ping_log.yml +++ b/tests/integration/targets/callback_log_plays/ping_log.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 + - hosts: localhost gather_facts: false tasks: diff --git a/tests/integration/targets/callback_log_plays/runme.sh b/tests/integration/targets/callback_log_plays/runme.sh index af4a974629..88eea16266 100755 --- a/tests/integration/targets/callback_log_plays/runme.sh +++ b/tests/integration/targets/callback_log_plays/runme.sh @@ -1,4 +1,7 @@ #!/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 set -eux diff --git a/tests/integration/targets/callback_yaml/aliases b/tests/integration/targets/callback_yaml/aliases index c6864963b5..56b63416e2 100644 --- a/tests/integration/targets/callback_yaml/aliases +++ b/tests/integration/targets/callback_yaml/aliases @@ -1,2 +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 + shippable/posix/group1 needs/target/callback diff --git a/tests/integration/targets/callback_yaml/tasks/main.yml b/tests/integration/targets/callback_yaml/tasks/main.yml index a764f44a6a..f3c36663da 100644 --- a/tests/integration/targets/callback_yaml/tasks/main.yml +++ b/tests/integration/targets/callback_yaml/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Run tests include_role: name: callback diff --git a/tests/integration/targets/cargo/aliases b/tests/integration/targets/cargo/aliases index 9a80b36fe0..190289e117 100644 --- a/tests/integration/targets/cargo/aliases +++ b/tests/integration/targets/cargo/aliases @@ -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 + destructive shippable/posix/group2 skip/aix diff --git a/tests/integration/targets/cargo/meta/main.yml b/tests/integration/targets/cargo/meta/main.yml index b63c3d017c..2fcd152f95 100644 --- a/tests/integration/targets/cargo/meta/main.yml +++ b/tests/integration/targets/cargo/meta/main.yml @@ -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 + dependencies: - setup_pkg_mgr diff --git a/tests/integration/targets/cargo/tasks/main.yml b/tests/integration/targets/cargo/tasks/main.yml index e8a11ea9f3..bb22e27c07 100644 --- a/tests/integration/targets/cargo/tasks/main.yml +++ b/tests/integration/targets/cargo/tasks/main.yml @@ -1,5 +1,20 @@ +--- +# 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 + - import_tasks: setup.yml +- name: Set default environment + set_fact: + cargo_environment: {} +- name: Set special environment to work around cargo bugs + set_fact: + cargo_environment: + # See https://github.com/rust-lang/cargo/issues/10230#issuecomment-1201662729: + CARGO_NET_GIT_FETCH_WITH_CLI: "true" + when: has_cargo | default(false) and ansible_distribution == 'Alpine' - block: - import_tasks: test_general.yml - import_tasks: test_version.yml + environment: "{{ cargo_environment }}" when: has_cargo | default(false) diff --git a/tests/integration/targets/cargo/tasks/setup.yml b/tests/integration/targets/cargo/tasks/setup.yml index 77104f6dfd..232658ab46 100644 --- a/tests/integration/targets/cargo/tasks/setup.yml +++ b/tests/integration/targets/cargo/tasks/setup.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 + - block: - name: Install cargo package: @@ -7,8 +11,18 @@ - set_fact: has_cargo: true when: - - ansible_system != 'FreeBSD' or ansible_distribution_version is version('13.0', '>') + - ansible_system != 'FreeBSD' - ansible_distribution != 'MacOSX' - ansible_distribution != 'RedHat' or ansible_distribution_version is version('8.0', '>=') - ansible_distribution != 'CentOS' or ansible_distribution_version is version('7.0', '>=') - ansible_distribution != 'Ubuntu' or ansible_distribution_version is version('18', '>=') + +- block: + - name: Install rust (containing cargo) + package: + name: rust + state: present + - set_fact: + has_cargo: true + when: + - ansible_system == 'FreeBSD' and ansible_distribution_version is version('13.0', '>') diff --git a/tests/integration/targets/cargo/tasks/test_general.yml b/tests/integration/targets/cargo/tasks/test_general.yml index dfc699a88c..e07264b517 100644 --- a/tests/integration/targets/cargo/tasks/test_general.yml +++ b/tests/integration/targets/cargo/tasks/test_general.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: Ensure application helloworld is uninstalled community.general.cargo: state: absent diff --git a/tests/integration/targets/cargo/tasks/test_version.yml b/tests/integration/targets/cargo/tasks/test_version.yml index 1db9d786dc..c1ab8e198d 100644 --- a/tests/integration/targets/cargo/tasks/test_version.yml +++ b/tests/integration/targets/cargo/tasks/test_version.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: Install application helloworld-yliu 0.1.0 community.general.cargo: name: helloworld-yliu diff --git a/tests/integration/targets/cloud_init_data_facts/aliases b/tests/integration/targets/cloud_init_data_facts/aliases index 1a7dd323f6..ce552edd9c 100644 --- a/tests/integration/targets/cloud_init_data_facts/aliases +++ b/tests/integration/targets/cloud_init_data_facts/aliases @@ -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 + destructive shippable/posix/group1 skip/aix diff --git a/tests/integration/targets/cloud_init_data_facts/meta/main.yml b/tests/integration/targets/cloud_init_data_facts/meta/main.yml index 5438ced5c3..2fcd152f95 100644 --- a/tests/integration/targets/cloud_init_data_facts/meta/main.yml +++ b/tests/integration/targets/cloud_init_data_facts/meta/main.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 + dependencies: - setup_pkg_mgr diff --git a/tests/integration/targets/cloud_init_data_facts/tasks/main.yml b/tests/integration/targets/cloud_init_data_facts/tasks/main.yml index 9565dc1199..fc634a972f 100644 --- a/tests/integration/targets/cloud_init_data_facts/tasks/main.yml +++ b/tests/integration/targets/cloud_init_data_facts/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: test cloud-init # TODO: check for a workaround # install 'cloud-init'' failed: dpkg-divert: error: `diversion of /etc/init/ureadahead.conf diff --git a/tests/integration/targets/cmd_runner/aliases b/tests/integration/targets/cmd_runner/aliases index 765b70da79..be75e3ddab 100644 --- a/tests/integration/targets/cmd_runner/aliases +++ b/tests/integration/targets/cmd_runner/aliases @@ -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 + shippable/posix/group2 diff --git a/tests/integration/targets/cmd_runner/library/cmd_echo.py b/tests/integration/targets/cmd_runner/library/cmd_echo.py index 842df7e131..cd87662647 100644 --- a/tests/integration/targets/cmd_runner/library/cmd_echo.py +++ b/tests/integration/targets/cmd_runner/library/cmd_echo.py @@ -1,48 +1,21 @@ #!/usr/bin/python # -*- 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 -import sys -DOCUMENTATION = ''' -module: cmd_echo -author: "Alexei Znamensky (@russoz)" -short_description: Simple module for testing -description: - - Simple module test description. -options: - command: - description: aaa - type: list - elements: str - required: true - arg_formats: - description: bbb - type: dict - required: true - arg_order: - description: ccc - type: raw - required: true - arg_values: - description: ddd - type: list - required: true - aa: - description: eee - type: raw -''' +DOCUMENTATION = "" EXAMPLES = "" RETURN = "" from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.general.plugins.module_utils.cmd_runner import CmdRunner, fmt +from ansible_collections.community.general.plugins.module_utils.cmd_runner import CmdRunner, cmd_runner_fmt as fmt def main(): @@ -51,11 +24,15 @@ def main(): arg_formats=dict(type="dict", default={}), arg_order=dict(type="raw", required=True), arg_values=dict(type="dict", default={}), + check_mode_skip=dict(type="bool", default=False), aa=dict(type="raw"), ), + supports_check_mode=True, ) p = module.params + info = None + arg_formats = {} for arg, fmt_spec in p['arg_formats'].items(): func = getattr(fmt, fmt_spec['func']) @@ -65,11 +42,11 @@ def main(): runner = CmdRunner(module, ['echo', '--'], arg_formats=arg_formats) - info = None - with runner.context(p['arg_order']) as ctx: + with runner.context(p['arg_order'], check_mode_skip=p['check_mode_skip']) as ctx: result = ctx.run(**p['arg_values']) info = ctx.run_info - rc, out, err = result + check = "check" + rc, out, err = result if result is not None else (None, None, None) module.exit_json(rc=rc, out=out, err=err, info=info) diff --git a/tests/integration/targets/cmd_runner/tasks/main.yml b/tests/integration/targets/cmd_runner/tasks/main.yml index 72cf506c6a..36ab039f0f 100644 --- a/tests/integration/targets/cmd_runner/tasks/main.yml +++ b/tests/integration/targets/cmd_runner/tasks/main.yml @@ -1,5 +1,6 @@ -# (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 - name: parameterized test cmd_echo ansible.builtin.include_tasks: diff --git a/tests/integration/targets/cmd_runner/tasks/test_cmd_echo.yml b/tests/integration/targets/cmd_runner/tasks/test_cmd_echo.yml index d00a468c04..1c2caf2b5a 100644 --- a/tests/integration/targets/cmd_runner/tasks/test_cmd_echo.yml +++ b/tests/integration/targets/cmd_runner/tasks/test_cmd_echo.yml @@ -1,11 +1,17 @@ --- +# 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: test cmd_echo [{{ item.name }}] cmd_echo: arg_formats: "{{ item.arg_formats|default(omit) }}" arg_order: "{{ item.arg_order }}" arg_values: "{{ item.arg_values|default(omit) }}" + check_mode_skip: "{{ item.check_mode_skip|default(omit) }}" aa: "{{ item.aa|default(omit) }}" register: test_result + check_mode: "{{ item.check_mode|default(omit) }}" ignore_errors: "{{ item.expect_error|default(omit) }}" - name: check results [{{ item.name }}] diff --git a/tests/integration/targets/cmd_runner/vars/main.yml b/tests/integration/targets/cmd_runner/vars/main.yml index ade4646a15..7f0027d499 100644 --- a/tests/integration/targets/cmd_runner/vars/main.yml +++ b/tests/integration/targets/cmd_runner/vars/main.yml @@ -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 cmd_echo_tests: - name: set aa and bb value @@ -82,3 +83,41 @@ cmd_echo_tests: - >- "MissingArgumentValue: Cannot find value for parameter bb" in test_result.module_stderr + + - name: set aa and bb value with check_mode on + arg_formats: + aa: + func: as_opt_eq_val + args: [--answer] + bb: + func: as_bool + args: [--bb-here] + arg_order: 'aa bb' + arg_values: + bb: true + aa: 11 + check_mode: true + assertions: + - test_result.rc == 0 + - test_result.out == "-- --answer=11 --bb-here\n" + - test_result.err == "" + + - name: set aa and bb value with check_mode and check_mode_skip on + arg_formats: + aa: + func: as_opt_eq_val + args: [--answer] + bb: + func: as_bool + args: [--bb-here] + arg_order: 'aa bb' + arg_values: + bb: true + check_mode_skip: true + aa: 11 + check_mode: true + expect_error: true # because if result contains rc != 0, ansible assumes error + assertions: + - test_result.rc == None + - test_result.out == None + - test_result.err == None diff --git a/tests/integration/targets/connection/aliases b/tests/integration/targets/connection/aliases index 136c05e0d0..a02a2d61a1 100644 --- a/tests/integration/targets/connection/aliases +++ b/tests/integration/targets/connection/aliases @@ -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 + hidden diff --git a/tests/integration/targets/connection/test.sh b/tests/integration/targets/connection/test.sh index 4e7aa8dda1..793a85dd38 100755 --- a/tests/integration/targets/connection/test.sh +++ b/tests/integration/targets/connection/test.sh @@ -1,4 +1,7 @@ #!/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 set -eux @@ -6,5 +9,8 @@ set -eux # Run connection tests with both the default and C locale. - ansible-playbook test_connection.yml -i "${INVENTORY}" "$@" -LC_ALL=C LANG=C ansible-playbook test_connection.yml -i "${INVENTORY}" "$@" +ansible-playbook test_connection.yml -i "${INVENTORY}" "$@" + +if ansible --version | grep ansible | grep -E ' 2\.(9|10|11|12|13)\.'; then + LC_ALL=C LANG=C ansible-playbook test_connection.yml -i "${INVENTORY}" "$@" +fi diff --git a/tests/integration/targets/connection/test_connection.yml b/tests/integration/targets/connection/test_connection.yml index a662e576ab..157a7821ba 100644 --- a/tests/integration/targets/connection/test_connection.yml +++ b/tests/integration/targets/connection/test_connection.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 + - hosts: "{{ target_hosts }}" gather_facts: no serial: 1 diff --git a/tests/integration/targets/connection_chroot/aliases b/tests/integration/targets/connection_chroot/aliases index c460dc3740..847f93469a 100644 --- a/tests/integration/targets/connection_chroot/aliases +++ b/tests/integration/targets/connection_chroot/aliases @@ -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 + needs/root shippable/posix/group3 skip/macos # Skipped due to limitation of macOS 10.15 SIP, please read https://github.com/ansible-collections/community.general/issues/1017#issuecomment-755088895 diff --git a/tests/integration/targets/connection_chroot/test_connection.inventory b/tests/integration/targets/connection_chroot/test_connection.inventory index db13a110fb..126b29c8a9 100644 --- a/tests/integration/targets/connection_chroot/test_connection.inventory +++ b/tests/integration/targets/connection_chroot/test_connection.inventory @@ -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 + [chroot] chroot-pipelining ansible_ssh_pipelining=true chroot-no-pipelining ansible_ssh_pipelining=false diff --git a/tests/integration/targets/connection_jail/aliases b/tests/integration/targets/connection_jail/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/connection_jail/aliases +++ b/tests/integration/targets/connection_jail/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/connection_jail/test_connection.inventory b/tests/integration/targets/connection_jail/test_connection.inventory index 466f7776eb..995c324441 100644 --- a/tests/integration/targets/connection_jail/test_connection.inventory +++ b/tests/integration/targets/connection_jail/test_connection.inventory @@ -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 + [jail] jail-pipelining ansible_ssh_pipelining=true jail-no-pipelining ansible_ssh_pipelining=false diff --git a/tests/integration/targets/connection_lxc/aliases b/tests/integration/targets/connection_lxc/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/connection_lxc/aliases +++ b/tests/integration/targets/connection_lxc/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/connection_lxc/test_connection.inventory b/tests/integration/targets/connection_lxc/test_connection.inventory index 5e3e3c3f40..cfcd7a32f9 100644 --- a/tests/integration/targets/connection_lxc/test_connection.inventory +++ b/tests/integration/targets/connection_lxc/test_connection.inventory @@ -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 + [lxc] lxc-pipelining ansible_ssh_pipelining=true lxc-no-pipelining ansible_ssh_pipelining=false diff --git a/tests/integration/targets/connection_lxd/aliases b/tests/integration/targets/connection_lxd/aliases index 33b258daef..5a0c470323 100644 --- a/tests/integration/targets/connection_lxd/aliases +++ b/tests/integration/targets/connection_lxd/aliases @@ -1,2 +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 + non_local unsupported diff --git a/tests/integration/targets/connection_lxd/test_connection.inventory b/tests/integration/targets/connection_lxd/test_connection.inventory index 73ab06561f..d2d2c10e35 100644 --- a/tests/integration/targets/connection_lxd/test_connection.inventory +++ b/tests/integration/targets/connection_lxd/test_connection.inventory @@ -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 + [lxd] lxd-pipelining ansible_ssh_pipelining=true lxd-no-pipelining ansible_ssh_pipelining=false diff --git a/tests/integration/targets/connection_posix/aliases b/tests/integration/targets/connection_posix/aliases index f5e09799b1..44561e2ff3 100644 --- a/tests/integration/targets/connection_posix/aliases +++ b/tests/integration/targets/connection_posix/aliases @@ -1,2 +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 + needs/target/connection hidden diff --git a/tests/integration/targets/connection_posix/test.sh b/tests/integration/targets/connection_posix/test.sh index d3976ff30b..9f31da64db 100755 --- a/tests/integration/targets/connection_posix/test.sh +++ b/tests/integration/targets/connection_posix/test.sh @@ -1,4 +1,7 @@ #!/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 set -eux diff --git a/tests/integration/targets/consul/aliases b/tests/integration/targets/consul/aliases index cc24e932c9..3b6b148f7e 100644 --- a/tests/integration/targets/consul/aliases +++ b/tests/integration/targets/consul/aliases @@ -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 + shippable/posix/group2 destructive skip/aix diff --git a/tests/integration/targets/consul/meta/main.yml b/tests/integration/targets/consul/meta/main.yml index f9bb8406a4..0909be2064 100644 --- a/tests/integration/targets/consul/meta/main.yml +++ b/tests/integration/targets/consul/meta/main.yml @@ -1,5 +1,10 @@ --- +# 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 + dependencies: - setup_pkg_mgr - setup_openssl - setup_remote_tmp_dir + - setup_remote_constraints diff --git a/tests/integration/targets/consul/tasks/consul_session.yml b/tests/integration/targets/consul/tasks/consul_session.yml index 1827c9c381..059e0a584a 100644 --- a/tests/integration/targets/consul/tasks/consul_session.yml +++ b/tests/integration/targets/consul/tasks/consul_session.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: list sessions consul_session: state: list @@ -158,3 +163,15 @@ that: - search_deleted is skipped # each iteration is skipped - search_deleted is not changed # and then unchanged + +- name: ensure session can be created with a ttl + consul_session: + state: present + name: session-with-ttl + ttl: 180 # sec + register: result + +- assert: + that: + - result is changed + - result['ttl'] == 180 diff --git a/tests/integration/targets/consul/tasks/main.yml b/tests/integration/targets/consul/tasks/main.yml index 1f7edce304..a2b63ac955 100644 --- a/tests/integration/targets/consul/tasks/main.yml +++ b/tests/integration/targets/consul/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Install Consul and test vars: consul_version: 1.5.0 @@ -12,12 +17,14 @@ - name: Install requests<2.20 (CentOS/RHEL 6) pip: name: requests<2.20 + extra_args: "-c {{ remote_constraints }}" register: result until: result is success when: ansible_distribution_file_variety|default() == 'RedHat' and ansible_distribution_major_version is version('6', '<=') - name: Install python-consul pip: name: python-consul + extra_args: "-c {{ remote_constraints }}" register: result until: result is success - name: Generate privatekey diff --git a/tests/integration/targets/consul/templates/consul_config.hcl.j2 b/tests/integration/targets/consul/templates/consul_config.hcl.j2 index 811c124bb7..96da5d6642 100644 --- a/tests/integration/targets/consul/templates/consul_config.hcl.j2 +++ b/tests/integration/targets/consul/templates/consul_config.hcl.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 +#} # {{ ansible_managed }} server = true pid_file = "{{ remote_dir }}/consul.pid" diff --git a/tests/integration/targets/copr/aliases b/tests/integration/targets/copr/aliases index 0ad5e1c80c..836e186b55 100644 --- a/tests/integration/targets/copr/aliases +++ b/tests/integration/targets/copr/aliases @@ -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 + shippable/posix/group1 needs/root skip/macos diff --git a/tests/integration/targets/copr/tasks/main.yml b/tests/integration/targets/copr/tasks/main.yml index 1c8afd992f..ac78255d48 100644 --- a/tests/integration/targets/copr/tasks/main.yml +++ b/tests/integration/targets/copr/tasks/main.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 + - when: ansible_distribution == 'Fedora' block: - name: enable copr project diff --git a/tests/integration/targets/cpanm/aliases b/tests/integration/targets/cpanm/aliases index d014dd3438..73181a8621 100644 --- a/tests/integration/targets/cpanm/aliases +++ b/tests/integration/targets/cpanm/aliases @@ -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 + shippable/posix/group3 destructive skip/macos diff --git a/tests/integration/targets/cpanm/meta/main.yml b/tests/integration/targets/cpanm/meta/main.yml index 5438ced5c3..2fcd152f95 100644 --- a/tests/integration/targets/cpanm/meta/main.yml +++ b/tests/integration/targets/cpanm/meta/main.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 + dependencies: - setup_pkg_mgr diff --git a/tests/integration/targets/cpanm/tasks/main.yml b/tests/integration/targets/cpanm/tasks/main.yml index 66f4396685..ed3c02b692 100644 --- a/tests/integration/targets/cpanm/tasks/main.yml +++ b/tests/integration/targets/cpanm/tasks/main.yml @@ -1,6 +1,7 @@ -# (c) 2020, Berkhan Berkdemir -# (c) 2021, Alexei Znamensky -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2020, Berkhan Berkdemir +# Copyright (c) 2021, 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 - name: bail out for non-supported platforms meta: end_play diff --git a/tests/integration/targets/cronvar/aliases b/tests/integration/targets/cronvar/aliases index 1c80472f94..77e5c4afa2 100644 --- a/tests/integration/targets/cronvar/aliases +++ b/tests/integration/targets/cronvar/aliases @@ -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 + destructive shippable/posix/group3 skip/aix diff --git a/tests/integration/targets/cronvar/defaults/main.yml b/tests/integration/targets/cronvar/defaults/main.yml index a22230ab66..11ef47d9d9 100644 --- a/tests/integration/targets/cronvar/defaults/main.yml +++ b/tests/integration/targets/cronvar/defaults/main.yml @@ -1 +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 + cron_config_path: /etc/cron.d diff --git a/tests/integration/targets/cronvar/meta/main.yml b/tests/integration/targets/cronvar/meta/main.yml index 2d2436a168..92d116f2a9 100644 --- a/tests/integration/targets/cronvar/meta/main.yml +++ b/tests/integration/targets/cronvar/meta/main.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 + dependencies: - setup_cron diff --git a/tests/integration/targets/cronvar/tasks/main.yml b/tests/integration/targets/cronvar/tasks/main.yml index f8090db1b6..73ec41abca 100644 --- a/tests/integration/targets/cronvar/tasks/main.yml +++ b/tests/integration/targets/cronvar/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Ensure /etc/cron.d directory exists file: path: /etc/cron.d diff --git a/tests/integration/targets/deploy_helper/aliases b/tests/integration/targets/deploy_helper/aliases index a6dafcf8cd..abc0d5476d 100644 --- a/tests/integration/targets/deploy_helper/aliases +++ b/tests/integration/targets/deploy_helper/aliases @@ -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 + shippable/posix/group1 diff --git a/tests/integration/targets/deploy_helper/meta/main.yml b/tests/integration/targets/deploy_helper/meta/main.yml index 1810d4bec9..982de6eb03 100644 --- a/tests/integration/targets/deploy_helper/meta/main.yml +++ b/tests/integration/targets/deploy_helper/meta/main.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 + dependencies: - setup_remote_tmp_dir diff --git a/tests/integration/targets/deploy_helper/tasks/main.yml b/tests/integration/targets/deploy_helper/tasks/main.yml index 6d03b8da0e..fdd8bd87b2 100644 --- a/tests/integration/targets/deploy_helper/tasks/main.yml +++ b/tests/integration/targets/deploy_helper/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: record the output directory set_fact: deploy_helper_test_root={{remote_tmp_dir}}/deploy_helper_test_root diff --git a/tests/integration/targets/discord/README.md b/tests/integration/targets/discord/README.md index 0cd3277924..528ea06432 100644 --- a/tests/integration/targets/discord/README.md +++ b/tests/integration/targets/discord/README.md @@ -1,3 +1,9 @@ + + The integration tests can be executed locally: 1. Create or use an existing discord server diff --git a/tests/integration/targets/discord/aliases b/tests/integration/targets/discord/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/discord/aliases +++ b/tests/integration/targets/discord/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/discord/defaults/main.yml b/tests/integration/targets/discord/defaults/main.yml index bf2b818178..ef01141ca0 100644 --- a/tests/integration/targets/discord/defaults/main.yml +++ b/tests/integration/targets/discord/defaults/main.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 + discord_id: 000 discord_token: xxx diff --git a/tests/integration/targets/discord/tasks/main.yml b/tests/integration/targets/discord/tasks/main.yml index 44cd663756..29314ba238 100644 --- a/tests/integration/targets/discord/tasks/main.yml +++ b/tests/integration/targets/discord/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Send basic message community.general.discord: webhook_id: "{{ discord_id }}" diff --git a/tests/integration/targets/django_manage/aliases b/tests/integration/targets/django_manage/aliases index d01e476f95..0e2bbfeb8e 100644 --- a/tests/integration/targets/django_manage/aliases +++ b/tests/integration/targets/django_manage/aliases @@ -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 + shippable/posix/group2 skip/python2 skip/freebsd @@ -7,3 +11,4 @@ skip/rhel8.2 skip/rhel8.3 skip/rhel8.4 skip/rhel8.5 +skip/rhel9.0 diff --git a/tests/integration/targets/django_manage/files/base_test/1045-single-app-project/single_app_project/core/settings.py b/tests/integration/targets/django_manage/files/base_test/1045-single-app-project/single_app_project/core/settings.py index 62107209ba..881221c066 100644 --- a/tests/integration/targets/django_manage/files/base_test/1045-single-app-project/single_app_project/core/settings.py +++ b/tests/integration/targets/django_manage/files/base_test/1045-single-app-project/single_app_project/core/settings.py @@ -1,2 +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 + # single_app_project/core/settings.py SECRET_KEY = 'testtesttesttesttest' diff --git a/tests/integration/targets/django_manage/files/base_test/1045-single-app-project/single_app_project/manage.py b/tests/integration/targets/django_manage/files/base_test/1045-single-app-project/single_app_project/manage.py index 1f5463a26b..4b4eddcb67 100755 --- a/tests/integration/targets/django_manage/files/base_test/1045-single-app-project/single_app_project/manage.py +++ b/tests/integration/targets/django_manage/files/base_test/1045-single-app-project/single_app_project/manage.py @@ -1,4 +1,7 @@ #!/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 from __future__ import absolute_import, division, print_function __metaclass__ = type diff --git a/tests/integration/targets/django_manage/files/base_test/simple_project/p1/manage.py b/tests/integration/targets/django_manage/files/base_test/simple_project/p1/manage.py index ea2cb4cd22..be3140f44d 100755 --- a/tests/integration/targets/django_manage/files/base_test/simple_project/p1/manage.py +++ b/tests/integration/targets/django_manage/files/base_test/simple_project/p1/manage.py @@ -1,4 +1,7 @@ #!/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 from __future__ import absolute_import, division, print_function __metaclass__ = type diff --git a/tests/integration/targets/django_manage/files/base_test/simple_project/p1/p1/__init__.py b/tests/integration/targets/django_manage/files/base_test/simple_project/p1/p1/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/integration/targets/django_manage/files/base_test/simple_project/p1/p1/settings.py b/tests/integration/targets/django_manage/files/base_test/simple_project/p1/p1/settings.py index f2472c1fe8..1b98a0dbff 100644 --- a/tests/integration/targets/django_manage/files/base_test/simple_project/p1/p1/settings.py +++ b/tests/integration/targets/django_manage/files/base_test/simple_project/p1/p1/settings.py @@ -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 + from __future__ import absolute_import, division, print_function __metaclass__ = type diff --git a/tests/integration/targets/django_manage/files/base_test/simple_project/p1/p1/urls.py b/tests/integration/targets/django_manage/files/base_test/simple_project/p1/p1/urls.py index 6710c0b7aa..36cb592756 100644 --- a/tests/integration/targets/django_manage/files/base_test/simple_project/p1/p1/urls.py +++ b/tests/integration/targets/django_manage/files/base_test/simple_project/p1/p1/urls.py @@ -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 + from __future__ import absolute_import, division, print_function __metaclass__ = type diff --git a/tests/integration/targets/django_manage/meta/main.yml b/tests/integration/targets/django_manage/meta/main.yml index b63c3d017c..2fcd152f95 100644 --- a/tests/integration/targets/django_manage/meta/main.yml +++ b/tests/integration/targets/django_manage/meta/main.yml @@ -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 + dependencies: - setup_pkg_mgr diff --git a/tests/integration/targets/django_manage/tasks/main.yaml b/tests/integration/targets/django_manage/tasks/main.yaml index 59104d788a..0d8c8acbef 100644 --- a/tests/integration/targets/django_manage/tasks/main.yaml +++ b/tests/integration/targets/django_manage/tasks/main.yaml @@ -1,22 +1,23 @@ # Test code for django_manage module # -# Copyright: (c) 2020, Alexei Znamensky -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2020, 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 - name: Create temporary test directory tempfile: state: directory suffix: .django_manage register: tmp_django_root -- name: Install virtualenv +- name: Install virtualenv on CentOS 8 package: name: virtualenv state: present when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '8' -- name: Install virtualenv - package: - name: python-virtualenv +- name: Install virtualenv on Arch Linux + pip: + name: virtualenv state: present when: ansible_os_family == 'Archlinux' diff --git a/tests/integration/targets/dnf_versionlock/aliases b/tests/integration/targets/dnf_versionlock/aliases index abe0a21e22..3cde3b1715 100644 --- a/tests/integration/targets/dnf_versionlock/aliases +++ b/tests/integration/targets/dnf_versionlock/aliases @@ -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 + shippable/posix/group1 skip/aix skip/freebsd diff --git a/tests/integration/targets/dnf_versionlock/tasks/install.yml b/tests/integration/targets/dnf_versionlock/tasks/install.yml index 8cdcc76e06..9773d87dc0 100644 --- a/tests/integration/targets/dnf_versionlock/tasks/install.yml +++ b/tests/integration/targets/dnf_versionlock/tasks/install.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: Install dnf versionlock plugin dnf: name: dnf-plugin-versionlock diff --git a/tests/integration/targets/dnf_versionlock/tasks/lock_bash.yml b/tests/integration/targets/dnf_versionlock/tasks/lock_bash.yml index 14db0388cb..56357e01c6 100644 --- a/tests/integration/targets/dnf_versionlock/tasks/lock_bash.yml +++ b/tests/integration/targets/dnf_versionlock/tasks/lock_bash.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: Clear locklist community.general.dnf_versionlock: state: clean diff --git a/tests/integration/targets/dnf_versionlock/tasks/lock_updates.yml b/tests/integration/targets/dnf_versionlock/tasks/lock_updates.yml index 36130f1666..edbfcabd40 100644 --- a/tests/integration/targets/dnf_versionlock/tasks/lock_updates.yml +++ b/tests/integration/targets/dnf_versionlock/tasks/lock_updates.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: Check packages with updates dnf: list: updates diff --git a/tests/integration/targets/dnf_versionlock/tasks/main.yml b/tests/integration/targets/dnf_versionlock/tasks/main.yml index efee237b69..51e823ffd7 100644 --- a/tests/integration/targets/dnf_versionlock/tasks/main.yml +++ b/tests/integration/targets/dnf_versionlock/tasks/main.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 + - block: - include_tasks: install.yml - include_tasks: lock_bash.yml diff --git a/tests/integration/targets/dpkg_divert/aliases b/tests/integration/targets/dpkg_divert/aliases index 6ab0a081c8..39a9de2b1b 100644 --- a/tests/integration/targets/dpkg_divert/aliases +++ b/tests/integration/targets/dpkg_divert/aliases @@ -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 + shippable/posix/group1 skip/aix skip/osx diff --git a/tests/integration/targets/dpkg_divert/tasks/main.yml b/tests/integration/targets/dpkg_divert/tasks/main.yml index 6e71f1bdcf..910f174e17 100644 --- a/tests/integration/targets/dpkg_divert/tasks/main.yml +++ b/tests/integration/targets/dpkg_divert/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: "include tasks for Debian family" include_tasks: prepare.yml when: ansible_pkg_mgr == "apt" diff --git a/tests/integration/targets/dpkg_divert/tasks/prepare.yml b/tests/integration/targets/dpkg_divert/tasks/prepare.yml index f30d14a175..7697d0fd2d 100644 --- a/tests/integration/targets/dpkg_divert/tasks/prepare.yml +++ b/tests/integration/targets/dpkg_divert/tasks/prepare.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: "set variables for the entire playbook" set_fact: foobarrc: "{{ foobarrc }}" diff --git a/tests/integration/targets/dpkg_divert/tasks/tests/01-basic.yml b/tests/integration/targets/dpkg_divert/tasks/tests/01-basic.yml index c23db91d56..0668a8aa02 100644 --- a/tests/integration/targets/dpkg_divert/tasks/tests/01-basic.yml +++ b/tests/integration/targets/dpkg_divert/tasks/tests/01-basic.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 + ################################################################################ # TEST 01: state=present diff --git a/tests/integration/targets/dpkg_divert/tasks/tests/02-rename.yml b/tests/integration/targets/dpkg_divert/tasks/tests/02-rename.yml index 69a46a8a20..077004029d 100644 --- a/tests/integration/targets/dpkg_divert/tasks/tests/02-rename.yml +++ b/tests/integration/targets/dpkg_divert/tasks/tests/02-rename.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 + ################################################################################ # TEST 05: rename=yes, state=present diff --git a/tests/integration/targets/etcd3/aliases b/tests/integration/targets/etcd3/aliases index 949f4250c7..b8da295be8 100644 --- a/tests/integration/targets/etcd3/aliases +++ b/tests/integration/targets/etcd3/aliases @@ -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 + shippable/posix/group1 destructive skip/aix diff --git a/tests/integration/targets/etcd3/meta/main.yml b/tests/integration/targets/etcd3/meta/main.yml index 48987c5426..f922f5506d 100644 --- a/tests/integration/targets/etcd3/meta/main.yml +++ b/tests/integration/targets/etcd3/meta/main.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 + dependencies: - setup_pkg_mgr - setup_etcd3 diff --git a/tests/integration/targets/etcd3/tasks/main.yml b/tests/integration/targets/etcd3/tasks/main.yml index a5f1c78add..2fe7435dc9 100644 --- a/tests/integration/targets/etcd3/tasks/main.yml +++ b/tests/integration/targets/etcd3/tasks/main.yml @@ -5,22 +5,9 @@ #################################################################### # test code for the etcd3 module -# (c) 2017, Jean-Philippe Evrard - -# 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) 2017, Jean-Philippe Evrard +# 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 # ============================================================ diff --git a/tests/integration/targets/etcd3/tasks/run_tests.yml b/tests/integration/targets/etcd3/tasks/run_tests.yml index 66b53830bd..4bd8fa4ec3 100644 --- a/tests/integration/targets/etcd3/tasks/run_tests.yml +++ b/tests/integration/targets/etcd3/tasks/run_tests.yml @@ -1,22 +1,9 @@ --- # test code for the etcd3 module -# (c) 2017, Jean-Philippe Evrard -# 2020, SCC France, Eric Belhomme - -# 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) 2017, Jean-Philippe Evrard +# Copyright 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 # ============================================================ diff --git a/tests/integration/targets/filesize/aliases b/tests/integration/targets/filesize/aliases index a6dafcf8cd..abc0d5476d 100644 --- a/tests/integration/targets/filesize/aliases +++ b/tests/integration/targets/filesize/aliases @@ -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 + shippable/posix/group1 diff --git a/tests/integration/targets/filesize/defaults/main.yml b/tests/integration/targets/filesize/defaults/main.yml index b575e029f0..d51108276a 100644 --- a/tests/integration/targets/filesize/defaults/main.yml +++ b/tests/integration/targets/filesize/defaults/main.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 + filesize_testdir: "/tmp/testdir" filesize_testfile: "{{ filesize_testdir }}/testfile" filesize_testlink: "{{ filesize_testdir }}/testlink" diff --git a/tests/integration/targets/filesize/tasks/basics.yml b/tests/integration/targets/filesize/tasks/basics.yml index 1d5281b7e1..ac99778a30 100644 --- a/tests/integration/targets/filesize/tasks/basics.yml +++ b/tests/integration/targets/filesize/tasks/basics.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 + # Test module with basic parameters. # Create a file, grow it, reduce it to its initial size and check the match # between initial and final checksums. Also check size formats consistency diff --git a/tests/integration/targets/filesize/tasks/errors.yml b/tests/integration/targets/filesize/tasks/errors.yml index ffb17d6187..ba65934e5a 100644 --- a/tests/integration/targets/filesize/tasks/errors.yml +++ b/tests/integration/targets/filesize/tasks/errors.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 + # Check error handling of the module. # 1. Missing or unknown parameters # 2. Wrong values (missing source device, invalid size...) diff --git a/tests/integration/targets/filesize/tasks/floats.yml b/tests/integration/targets/filesize/tasks/floats.yml index cf24b1b845..d7b5a4c9a7 100644 --- a/tests/integration/targets/filesize/tasks/floats.yml +++ b/tests/integration/targets/filesize/tasks/floats.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 + # Test module with floating point numbers (ensure they're not rounded too # wrongly), since in python floats are tricky: # 256.256 * 1000 == 256255.9999999997 diff --git a/tests/integration/targets/filesize/tasks/main.yml b/tests/integration/targets/filesize/tasks/main.yml index 14415dac9a..68cd8934cf 100644 --- a/tests/integration/targets/filesize/tasks/main.yml +++ b/tests/integration/targets/filesize/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Ensure the test dir is present ansible.builtin.file: path: "{{ filesize_testdir }}" diff --git a/tests/integration/targets/filesize/tasks/sparse.yml b/tests/integration/targets/filesize/tasks/sparse.yml index 6f864c2d15..9a8a9cfe90 100644 --- a/tests/integration/targets/filesize/tasks/sparse.yml +++ b/tests/integration/targets/filesize/tasks/sparse.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 + # Test module with sparse files - name: Create a huge sparse file of 4TB (check mode) diff --git a/tests/integration/targets/filesize/tasks/symlinks.yml b/tests/integration/targets/filesize/tasks/symlinks.yml index 61666497ff..ee75777101 100644 --- a/tests/integration/targets/filesize/tasks/symlinks.yml +++ b/tests/integration/targets/filesize/tasks/symlinks.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 + # Check that the module works with symlinks, as expected, i.e. as dd does: # follow symlinks. diff --git a/tests/integration/targets/filesystem/aliases b/tests/integration/targets/filesystem/aliases index 1ef4c3619a..86d2291bb5 100644 --- a/tests/integration/targets/filesystem/aliases +++ b/tests/integration/targets/filesystem/aliases @@ -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 + destructive shippable/posix/group1 skip/aix diff --git a/tests/integration/targets/filesystem/defaults/main.yml b/tests/integration/targets/filesystem/defaults/main.yml index 8b2928012b..947d4a1648 100644 --- a/tests/integration/targets/filesystem/defaults/main.yml +++ b/tests/integration/targets/filesystem/defaults/main.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 + tested_filesystems: # key: fstype # fssize: size (Mo) @@ -15,7 +19,7 @@ tested_filesystems: ext4dev: {fssize: 10, grow: True} ext3: {fssize: 10, grow: True} ext2: {fssize: 10, grow: True} - xfs: {fssize: 20, grow: False} # grow requires a mounted filesystem + xfs: {fssize: 300, grow: False} # grow requires a mounted filesystem btrfs: {fssize: 150, grow: False} # grow requires a mounted filesystem reiserfs: {fssize: 33, grow: False} # grow not implemented vfat: {fssize: 20, grow: True} diff --git a/tests/integration/targets/filesystem/meta/main.yml b/tests/integration/targets/filesystem/meta/main.yml index 7853656a5b..d3facee4f2 100644 --- a/tests/integration/targets/filesystem/meta/main.yml +++ b/tests/integration/targets/filesystem/meta/main.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 + dependencies: - setup_pkg_mgr - - setup_remote_tmp_dir + - setup_remote_tmp_dir_outside_tmp diff --git a/tests/integration/targets/filesystem/tasks/create_device.yml b/tests/integration/targets/filesystem/tasks/create_device.yml index ae314221a5..5229e19f25 100644 --- a/tests/integration/targets/filesystem/tasks/create_device.yml +++ b/tests/integration/targets/filesystem/tasks/create_device.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: 'Create a "disk" file' community.general.filesize: path: '{{ image_file }}' diff --git a/tests/integration/targets/filesystem/tasks/create_fs.yml b/tests/integration/targets/filesystem/tasks/create_fs.yml index 23f6e526c2..82f92f4cc3 100644 --- a/tests/integration/targets/filesystem/tasks/create_fs.yml +++ b/tests/integration/targets/filesystem/tasks/create_fs.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: "Create filesystem ({{ fstype }})" community.general.filesystem: dev: '{{ dev }}' diff --git a/tests/integration/targets/filesystem/tasks/freebsd_setup.yml b/tests/integration/targets/filesystem/tasks/freebsd_setup.yml index e08beca4a8..03fef66e66 100644 --- a/tests/integration/targets/filesystem/tasks/freebsd_setup.yml +++ b/tests/integration/targets/filesystem/tasks/freebsd_setup.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: "Uninstall e2fsprogs" ansible.builtin.package: name: e2fsprogs diff --git a/tests/integration/targets/filesystem/tasks/main.yml b/tests/integration/targets/filesystem/tasks/main.yml index 7de9df8e97..0ff0f23091 100644 --- a/tests/integration/targets/filesystem/tasks/main.yml +++ b/tests/integration/targets/filesystem/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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.builtin.debug: msg: '{{ role_name }}' - ansible.builtin.debug: @@ -58,6 +62,9 @@ - 'not (item.0.key == "vfat" and ansible_distribution == "Debian")' # TODO: figure out why it fails, fix it! # vfat resizing fails on ArchLinux - 'not (item.0.key == "vfat" and ansible_distribution == "Archlinux")' # TODO: figure out why it fails, fix it! + # vfat resizing fails on Ubuntu 22.04 + - 'not (item.0.key == "vfat" and ansible_distribution == "Ubuntu" and (ansible_facts.distribution_major_version | int == 22))' + # TODO: figure out why it fails, fix it! # btrfs-progs cannot be installed on ArchLinux - 'not (item.0.key == "btrfs" and ansible_distribution == "Archlinux")' # TODO: figure out why it fails, fix it! diff --git a/tests/integration/targets/filesystem/tasks/overwrite_another_fs.yml b/tests/integration/targets/filesystem/tasks/overwrite_another_fs.yml index 83a623fa75..25bc9a0699 100644 --- a/tests/integration/targets/filesystem/tasks/overwrite_another_fs.yml +++ b/tests/integration/targets/filesystem/tasks/overwrite_another_fs.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: 'Recreate "disk" file' community.general.filesize: path: '{{ image_file }}' diff --git a/tests/integration/targets/filesystem/tasks/remove_fs.yml b/tests/integration/targets/filesystem/tasks/remove_fs.yml index 3127dce559..aaa78ae563 100644 --- a/tests/integration/targets/filesystem/tasks/remove_fs.yml +++ b/tests/integration/targets/filesystem/tasks/remove_fs.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 + # We assume 'create_fs' tests have passed. - name: "Create filesystem" diff --git a/tests/integration/targets/filesystem/tasks/setup.yml b/tests/integration/targets/filesystem/tasks/setup.yml index b39b5418b6..97dafaeeec 100644 --- a/tests/integration/targets/filesystem/tasks/setup.yml +++ b/tests/integration/targets/filesystem/tasks/setup.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 + # By installing e2fsprogs on FreeBSD, we get a usable blkid command, but this # package conflicts with util-linux, that provides blkid too, but also wipefs # (required for filesystem state=absent). diff --git a/tests/integration/targets/filesystem/vars/Ubuntu-14.04.yml b/tests/integration/targets/filesystem/vars/Ubuntu-14.04.yml index e2ead0bf9d..d0cc5f2295 100644 --- a/tests/integration/targets/filesystem/vars/Ubuntu-14.04.yml +++ b/tests/integration/targets/filesystem/vars/Ubuntu-14.04.yml @@ -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 + ocfs2_fssize: 108 f2fs_fssize: 116 diff --git a/tests/integration/targets/filesystem/vars/default.yml b/tests/integration/targets/filesystem/vars/default.yml index 85b052d4c2..80151e40e5 100644 --- a/tests/integration/targets/filesystem/vars/default.yml +++ b/tests/integration/targets/filesystem/vars/default.yml @@ -1,2 +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 + ocfs2_fssize: 20 diff --git a/tests/integration/targets/filter_counter/aliases b/tests/integration/targets/filter_counter/aliases index f04737b845..d3b8ee2b84 100644 --- a/tests/integration/targets/filter_counter/aliases +++ b/tests/integration/targets/filter_counter/aliases @@ -1,2 +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 + shippable/posix/group2 skip/python2.6 # filters are controller only, and we no longer support Python 2.6 on the controller diff --git a/tests/integration/targets/filter_counter/tasks/main.yml b/tests/integration/targets/filter_counter/tasks/main.yml index 69f8bed3b0..881d55d2f6 100644 --- a/tests/integration/targets/filter_counter/tasks/main.yml +++ b/tests/integration/targets/filter_counter/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: test counter filter assert: that: diff --git a/tests/integration/targets/filter_dict/aliases b/tests/integration/targets/filter_dict/aliases index 3e81d77f98..2ae66ec51c 100644 --- a/tests/integration/targets/filter_dict/aliases +++ b/tests/integration/targets/filter_dict/aliases @@ -1,2 +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 + shippable/posix/group3 skip/python2.6 # filters are controller only, and we no longer support Python 2.6 on the controller diff --git a/tests/integration/targets/filter_dict/tasks/main.yml b/tests/integration/targets/filter_dict/tasks/main.yml index ab88d3ff3f..7b4cefde91 100644 --- a/tests/integration/targets/filter_dict/tasks/main.yml +++ b/tests/integration/targets/filter_dict/tasks/main.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: "Test dict filter" assert: that: diff --git a/tests/integration/targets/filter_dict_kv/aliases b/tests/integration/targets/filter_dict_kv/aliases index f04737b845..d3b8ee2b84 100644 --- a/tests/integration/targets/filter_dict_kv/aliases +++ b/tests/integration/targets/filter_dict_kv/aliases @@ -1,2 +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 + shippable/posix/group2 skip/python2.6 # filters are controller only, and we no longer support Python 2.6 on the controller diff --git a/tests/integration/targets/filter_dict_kv/tasks/main.yml b/tests/integration/targets/filter_dict_kv/tasks/main.yml index 871962e93d..47dc8e25dc 100644 --- a/tests/integration/targets/filter_dict_kv/tasks/main.yml +++ b/tests/integration/targets/filter_dict_kv/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: test dict_kv filter assert: that: diff --git a/tests/integration/targets/filter_from_csv/aliases b/tests/integration/targets/filter_from_csv/aliases index f04737b845..d3b8ee2b84 100644 --- a/tests/integration/targets/filter_from_csv/aliases +++ b/tests/integration/targets/filter_from_csv/aliases @@ -1,2 +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 + shippable/posix/group2 skip/python2.6 # filters are controller only, and we no longer support Python 2.6 on the controller diff --git a/tests/integration/targets/filter_from_csv/tasks/main.yml b/tests/integration/targets/filter_from_csv/tasks/main.yml index aafb28fbb0..f82e7d6069 100644 --- a/tests/integration/targets/filter_from_csv/tasks/main.yml +++ b/tests/integration/targets/filter_from_csv/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Parse valid csv input assert: that: @@ -14,7 +19,7 @@ - "valid_comma_separated_spaces | community.general.from_csv(skipinitialspace=True) == expected_result" - "valid_comma_separated_spaces | community.general.from_csv != expected_result" -- name: Parse valid csv input with no headers with/without specifiying fieldnames +- name: Parse valid csv input with no headers with/without specifying fieldnames assert: that: - "valid_comma_separated_no_headers | community.general.from_csv(fieldnames=['id','name','role']) == expected_result" diff --git a/tests/integration/targets/filter_from_csv/vars/main.yml b/tests/integration/targets/filter_from_csv/vars/main.yml index 5801bc20dc..7212c5aee4 100644 --- a/tests/integration/targets/filter_from_csv/vars/main.yml +++ b/tests/integration/targets/filter_from_csv/vars/main.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 + valid_comma_separated: | id,name,role 1,foo,bar diff --git a/tests/integration/targets/filter_groupby_as_dict/aliases b/tests/integration/targets/filter_groupby_as_dict/aliases index 3e81d77f98..2ae66ec51c 100644 --- a/tests/integration/targets/filter_groupby_as_dict/aliases +++ b/tests/integration/targets/filter_groupby_as_dict/aliases @@ -1,2 +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 + shippable/posix/group3 skip/python2.6 # filters are controller only, and we no longer support Python 2.6 on the controller diff --git a/tests/integration/targets/filter_groupby_as_dict/tasks/main.yml b/tests/integration/targets/filter_groupby_as_dict/tasks/main.yml index 219e047d4d..f4047f4ac6 100644 --- a/tests/integration/targets/filter_groupby_as_dict/tasks/main.yml +++ b/tests/integration/targets/filter_groupby_as_dict/tasks/main.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: Test functionality assert: that: diff --git a/tests/integration/targets/filter_groupby_as_dict/vars/main.yml b/tests/integration/targets/filter_groupby_as_dict/vars/main.yml index 15d38a351a..74e24dd3c7 100644 --- a/tests/integration/targets/filter_groupby_as_dict/vars/main.yml +++ b/tests/integration/targets/filter_groupby_as_dict/vars/main.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 + list1: - name: a x: y diff --git a/tests/integration/targets/filter_hashids/aliases b/tests/integration/targets/filter_hashids/aliases index f04737b845..d3b8ee2b84 100644 --- a/tests/integration/targets/filter_hashids/aliases +++ b/tests/integration/targets/filter_hashids/aliases @@ -1,2 +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 + shippable/posix/group2 skip/python2.6 # filters are controller only, and we no longer support Python 2.6 on the controller diff --git a/tests/integration/targets/filter_hashids/runme.sh b/tests/integration/targets/filter_hashids/runme.sh index 38b40e8ff3..c7a215a062 100755 --- a/tests/integration/targets/filter_hashids/runme.sh +++ b/tests/integration/targets/filter_hashids/runme.sh @@ -1,4 +1,7 @@ #!/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 set -eux diff --git a/tests/integration/targets/filter_hashids/runme.yml b/tests/integration/targets/filter_hashids/runme.yml index b2a39e27a6..3ac0e388f3 100644 --- a/tests/integration/targets/filter_hashids/runme.yml +++ b/tests/integration/targets/filter_hashids/runme.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 + - hosts: localhost roles: - { role: filter_hashids } diff --git a/tests/integration/targets/filter_hashids/tasks/main.yml b/tests/integration/targets/filter_hashids/tasks/main.yml index 95bcc91346..4a76540f6b 100644 --- a/tests/integration/targets/filter_hashids/tasks/main.yml +++ b/tests/integration/targets/filter_hashids/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Test valid hashable inputs assert: that: diff --git a/tests/integration/targets/filter_hashids/vars/main.yml b/tests/integration/targets/filter_hashids/vars/main.yml index 3f2b0c5f98..db65ef5622 100644 --- a/tests/integration/targets/filter_hashids/vars/main.yml +++ b/tests/integration/targets/filter_hashids/vars/main.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 + single_int: 1 int_list: [1, 2, 3] single_float: [2.718] diff --git a/tests/integration/targets/filter_jc/aliases b/tests/integration/targets/filter_jc/aliases index f49c8c7f6a..49b40f054d 100644 --- a/tests/integration/targets/filter_jc/aliases +++ b/tests/integration/targets/filter_jc/aliases @@ -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 + shippable/posix/group2 skip/python2.6 # filters are controller only, and we no longer support Python 2.6 on the controller skip/python2.7 # jc only supports python3.x diff --git a/tests/integration/targets/filter_jc/runme.sh b/tests/integration/targets/filter_jc/runme.sh index 17c5beca9d..c427b8b353 100755 --- a/tests/integration/targets/filter_jc/runme.sh +++ b/tests/integration/targets/filter_jc/runme.sh @@ -1,4 +1,7 @@ #!/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 set -eux diff --git a/tests/integration/targets/filter_jc/runme.yml b/tests/integration/targets/filter_jc/runme.yml index c624d120bb..6d6a89c002 100644 --- a/tests/integration/targets/filter_jc/runme.yml +++ b/tests/integration/targets/filter_jc/runme.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 + - hosts: localhost roles: - { role: filter_jc } diff --git a/tests/integration/targets/filter_jc/tasks/main.yml b/tests/integration/targets/filter_jc/tasks/main.yml index 3cae22d620..a06a0bfa45 100644 --- a/tests/integration/targets/filter_jc/tasks/main.yml +++ b/tests/integration/targets/filter_jc/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: test jc key/value parser assert: that: diff --git a/tests/integration/targets/filter_json_query/aliases b/tests/integration/targets/filter_json_query/aliases index 1603f4351b..08d571c495 100644 --- a/tests/integration/targets/filter_json_query/aliases +++ b/tests/integration/targets/filter_json_query/aliases @@ -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 + shippable/posix/group2 skip/python2.6 # filters are controller only, and we no longer support Python 2.6 on the controller skip/aix diff --git a/tests/integration/targets/filter_json_query/runme.sh b/tests/integration/targets/filter_json_query/runme.sh index a0db5e5400..b1fa994b36 100755 --- a/tests/integration/targets/filter_json_query/runme.sh +++ b/tests/integration/targets/filter_json_query/runme.sh @@ -1,4 +1,7 @@ #!/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 set -eux diff --git a/tests/integration/targets/filter_json_query/runme.yml b/tests/integration/targets/filter_json_query/runme.yml index 68f6372c2f..28281cffb4 100644 --- a/tests/integration/targets/filter_json_query/runme.yml +++ b/tests/integration/targets/filter_json_query/runme.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 + - hosts: localhost roles: - { role: filter_json_query } diff --git a/tests/integration/targets/filter_json_query/tasks/main.yml b/tests/integration/targets/filter_json_query/tasks/main.yml index 2cc3e12da2..92db6d876a 100644 --- a/tests/integration/targets/filter_json_query/tasks/main.yml +++ b/tests/integration/targets/filter_json_query/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Test json_query filter assert: that: diff --git a/tests/integration/targets/filter_json_query/vars/main.yml b/tests/integration/targets/filter_json_query/vars/main.yml index 36964115b4..1edd723be6 100644 --- a/tests/integration/targets/filter_json_query/vars/main.yml +++ b/tests/integration/targets/filter_json_query/vars/main.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 + users: - name: steve hosts: diff --git a/tests/integration/targets/filter_lists_mergeby/aliases b/tests/integration/targets/filter_lists_mergeby/aliases index f04737b845..d3b8ee2b84 100644 --- a/tests/integration/targets/filter_lists_mergeby/aliases +++ b/tests/integration/targets/filter_lists_mergeby/aliases @@ -1,2 +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 + shippable/posix/group2 skip/python2.6 # filters are controller only, and we no longer support Python 2.6 on the controller diff --git a/tests/integration/targets/filter_lists_mergeby/tasks/lists_mergeby_2-10.yml b/tests/integration/targets/filter_lists_mergeby/tasks/lists_mergeby_2-10.yml index 3a53f4033b..62896e1b01 100644 --- a/tests/integration/targets/filter_lists_mergeby/tasks/lists_mergeby_2-10.yml +++ b/tests/integration/targets/filter_lists_mergeby/tasks/lists_mergeby_2-10.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 - name: 101.Merge 2 lists by attribute name. list_merge='keep' block: diff --git a/tests/integration/targets/filter_lists_mergeby/tasks/lists_mergeby_default.yml b/tests/integration/targets/filter_lists_mergeby/tasks/lists_mergeby_default.yml index 5c634a9235..93917c97cc 100644 --- a/tests/integration/targets/filter_lists_mergeby/tasks/lists_mergeby_default.yml +++ b/tests/integration/targets/filter_lists_mergeby/tasks/lists_mergeby_default.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 - name: Debug ansible_version debug: diff --git a/tests/integration/targets/filter_lists_mergeby/tasks/main.yml b/tests/integration/targets/filter_lists_mergeby/tasks/main.yml index 87f0e350c4..d0bda368cd 100644 --- a/tests/integration/targets/filter_lists_mergeby/tasks/main.yml +++ b/tests/integration/targets/filter_lists_mergeby/tasks/main.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: Test list_merge default options import_tasks: lists_mergeby_default.yml diff --git a/tests/integration/targets/filter_lists_mergeby/vars/main.yml b/tests/integration/targets/filter_lists_mergeby/vars/main.yml index 83d831f278..f3b4928786 100644 --- a/tests/integration/targets/filter_lists_mergeby/vars/main.yml +++ b/tests/integration/targets/filter_lists_mergeby/vars/main.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 + list1: - name: myname01 param01: myparam01 diff --git a/tests/integration/targets/filter_path_join_shim/aliases b/tests/integration/targets/filter_path_join_shim/aliases index b167317cfe..b7419a24dd 100644 --- a/tests/integration/targets/filter_path_join_shim/aliases +++ b/tests/integration/targets/filter_path_join_shim/aliases @@ -1,2 +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 + shippable/posix/group1 skip/python2.6 # filters are controller only, and we no longer support Python 2.6 on the controller diff --git a/tests/integration/targets/filter_path_join_shim/tasks/main.yml b/tests/integration/targets/filter_path_join_shim/tasks/main.yml index 5f9eff3d4b..1462656fb5 100644 --- a/tests/integration/targets/filter_path_join_shim/tasks/main.yml +++ b/tests/integration/targets/filter_path_join_shim/tasks/main.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: "Test path_join filter" assert: that: diff --git a/tests/integration/targets/filter_random_mac/aliases b/tests/integration/targets/filter_random_mac/aliases index 1603f4351b..08d571c495 100644 --- a/tests/integration/targets/filter_random_mac/aliases +++ b/tests/integration/targets/filter_random_mac/aliases @@ -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 + shippable/posix/group2 skip/python2.6 # filters are controller only, and we no longer support Python 2.6 on the controller skip/aix diff --git a/tests/integration/targets/filter_random_mac/meta/main.yml b/tests/integration/targets/filter_random_mac/meta/main.yml index 1810d4bec9..982de6eb03 100644 --- a/tests/integration/targets/filter_random_mac/meta/main.yml +++ b/tests/integration/targets/filter_random_mac/meta/main.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 + dependencies: - setup_remote_tmp_dir diff --git a/tests/integration/targets/filter_random_mac/tasks/main.yml b/tests/integration/targets/filter_random_mac/tasks/main.yml index e09017c6fb..f9f85e986b 100644 --- a/tests/integration/targets/filter_random_mac/tasks/main.yml +++ b/tests/integration/targets/filter_random_mac/tasks/main.yml @@ -4,9 +4,10 @@ #################################################################### # test code for filters -# Copyright: (c) 2014, Michael DeHaan -# Copyright: (c) 2019, Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2014, Michael DeHaan +# Copyright (c) 2019, 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: Test random_mac filter bad argument type debug: diff --git a/tests/integration/targets/filter_time/aliases b/tests/integration/targets/filter_time/aliases index f04737b845..d3b8ee2b84 100644 --- a/tests/integration/targets/filter_time/aliases +++ b/tests/integration/targets/filter_time/aliases @@ -1,2 +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 + shippable/posix/group2 skip/python2.6 # filters are controller only, and we no longer support Python 2.6 on the controller diff --git a/tests/integration/targets/filter_time/tasks/main.yml b/tests/integration/targets/filter_time/tasks/main.yml index 7f0d092f34..bd8c53ac31 100644 --- a/tests/integration/targets/filter_time/tasks/main.yml +++ b/tests/integration/targets/filter_time/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: test zero is 0 assert: that: diff --git a/tests/integration/targets/filter_unicode_normalize/aliases b/tests/integration/targets/filter_unicode_normalize/aliases index f04737b845..d3b8ee2b84 100644 --- a/tests/integration/targets/filter_unicode_normalize/aliases +++ b/tests/integration/targets/filter_unicode_normalize/aliases @@ -1,2 +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 + shippable/posix/group2 skip/python2.6 # filters are controller only, and we no longer support Python 2.6 on the controller diff --git a/tests/integration/targets/filter_unicode_normalize/tasks/main.yml b/tests/integration/targets/filter_unicode_normalize/tasks/main.yml index 948ca74b4b..13902706e2 100644 --- a/tests/integration/targets/filter_unicode_normalize/tasks/main.yml +++ b/tests/integration/targets/filter_unicode_normalize/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Test 'NFC' normalization assert: that: diff --git a/tests/integration/targets/filter_unicode_normalize/vars/main.yml b/tests/integration/targets/filter_unicode_normalize/vars/main.yml index 88d19b20db..ed4e2968bb 100644 --- a/tests/integration/targets/filter_unicode_normalize/vars/main.yml +++ b/tests/integration/targets/filter_unicode_normalize/vars/main.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 + u_umlaut: "{{ '\u00fc' }}" u_umlaut_combining: "{{ 'u' + '\u0308' }}" roman_numeral_one: "{{ '\u2160' }}" diff --git a/tests/integration/targets/filter_version_sort/aliases b/tests/integration/targets/filter_version_sort/aliases index f04737b845..d3b8ee2b84 100644 --- a/tests/integration/targets/filter_version_sort/aliases +++ b/tests/integration/targets/filter_version_sort/aliases @@ -1,2 +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 + shippable/posix/group2 skip/python2.6 # filters are controller only, and we no longer support Python 2.6 on the controller diff --git a/tests/integration/targets/filter_version_sort/tasks/main.yml b/tests/integration/targets/filter_version_sort/tasks/main.yml index 2edca18c9c..08985d1bae 100644 --- a/tests/integration/targets/filter_version_sort/tasks/main.yml +++ b/tests/integration/targets/filter_version_sort/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: validate that versions are properly sorted in a stable way assert: that: diff --git a/tests/integration/targets/flatpak/aliases b/tests/integration/targets/flatpak/aliases index 39291d435b..3ac0267953 100644 --- a/tests/integration/targets/flatpak/aliases +++ b/tests/integration/targets/flatpak/aliases @@ -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 + shippable/posix/group3 destructive skip/aix diff --git a/tests/integration/targets/flatpak/files/serve.py b/tests/integration/targets/flatpak/files/serve.py index d9ca2d17a5..93df1036e2 100644 --- a/tests/integration/targets/flatpak/files/serve.py +++ b/tests/integration/targets/flatpak/files/serve.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 + # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) __metaclass__ = type diff --git a/tests/integration/targets/flatpak/meta/main.yml b/tests/integration/targets/flatpak/meta/main.yml index 258cd4345c..0ac87654df 100644 --- a/tests/integration/targets/flatpak/meta/main.yml +++ b/tests/integration/targets/flatpak/meta/main.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 + dependencies: - setup_flatpak_remote diff --git a/tests/integration/targets/flatpak/tasks/check_mode.yml b/tests/integration/targets/flatpak/tasks/check_mode.yml index 2270e0a9be..9f52dc1229 100644 --- a/tests/integration/targets/flatpak/tasks/check_mode.yml +++ b/tests/integration/targets/flatpak/tasks/check_mode.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 + # - Tests with absent flatpak -------------------------------------------------- # state=present on absent flatpak diff --git a/tests/integration/targets/flatpak/tasks/main.yml b/tests/integration/targets/flatpak/tasks/main.yml index 68d41d2efe..deaf354e8a 100644 --- a/tests/integration/targets/flatpak/tasks/main.yml +++ b/tests/integration/targets/flatpak/tasks/main.yml @@ -1,25 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### -# (c) 2018, Alexander Bethke -# (c) 2018, 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) 2018, Alexander Bethke +# 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 - block: diff --git a/tests/integration/targets/flatpak/tasks/setup.yml b/tests/integration/targets/flatpak/tasks/setup.yml index decf20d166..4dfdd68cb9 100644 --- a/tests/integration/targets/flatpak/tasks/setup.yml +++ b/tests/integration/targets/flatpak/tasks/setup.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: Install flatpak on Fedora dnf: name: flatpak diff --git a/tests/integration/targets/flatpak/tasks/test.yml b/tests/integration/targets/flatpak/tasks/test.yml index e1bfdbee09..29c4efbe95 100644 --- a/tests/integration/targets/flatpak/tasks/test.yml +++ b/tests/integration/targets/flatpak/tasks/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 + # state=present - name: Test addition - {{ method }} diff --git a/tests/integration/targets/flatpak_remote/aliases b/tests/integration/targets/flatpak_remote/aliases index 39291d435b..3ac0267953 100644 --- a/tests/integration/targets/flatpak_remote/aliases +++ b/tests/integration/targets/flatpak_remote/aliases @@ -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 + shippable/posix/group3 destructive skip/aix diff --git a/tests/integration/targets/flatpak_remote/meta/main.yml b/tests/integration/targets/flatpak_remote/meta/main.yml index 258cd4345c..0ac87654df 100644 --- a/tests/integration/targets/flatpak_remote/meta/main.yml +++ b/tests/integration/targets/flatpak_remote/meta/main.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 + dependencies: - setup_flatpak_remote diff --git a/tests/integration/targets/flatpak_remote/tasks/check_mode.yml b/tests/integration/targets/flatpak_remote/tasks/check_mode.yml index 1f4def86d9..9331531503 100644 --- a/tests/integration/targets/flatpak_remote/tasks/check_mode.yml +++ b/tests/integration/targets/flatpak_remote/tasks/check_mode.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 + # - Tests with absent flatpak remote ------------------------------------------- # state=present diff --git a/tests/integration/targets/flatpak_remote/tasks/main.yml b/tests/integration/targets/flatpak_remote/tasks/main.yml index 91fa7262df..1c50912328 100644 --- a/tests/integration/targets/flatpak_remote/tasks/main.yml +++ b/tests/integration/targets/flatpak_remote/tasks/main.yml @@ -1,25 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### -# (c) 2018, Alexander Bethke -# (c) 2018, 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) 2018, Alexander Bethke +# 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 - block: diff --git a/tests/integration/targets/flatpak_remote/tasks/setup.yml b/tests/integration/targets/flatpak_remote/tasks/setup.yml index 65e060f57d..83f344cc40 100644 --- a/tests/integration/targets/flatpak_remote/tasks/setup.yml +++ b/tests/integration/targets/flatpak_remote/tasks/setup.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: Install flatpak on Fedora dnf: name: flatpak diff --git a/tests/integration/targets/flatpak_remote/tasks/test.yml b/tests/integration/targets/flatpak_remote/tasks/test.yml index 66c43649b4..134eead173 100644 --- a/tests/integration/targets/flatpak_remote/tasks/test.yml +++ b/tests/integration/targets/flatpak_remote/tasks/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 + # state=present - name: Test addition - {{ method }} diff --git a/tests/integration/targets/gandi_livedns/aliases b/tests/integration/targets/gandi_livedns/aliases index 3ff69ca3a0..f69a127f4d 100644 --- a/tests/integration/targets/gandi_livedns/aliases +++ b/tests/integration/targets/gandi_livedns/aliases @@ -1,2 +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 + cloud/gandi unsupported diff --git a/tests/integration/targets/gandi_livedns/defaults/main.yml b/tests/integration/targets/gandi_livedns/defaults/main.yml index d27842ae0b..ec1808d8b5 100644 --- a/tests/integration/targets/gandi_livedns/defaults/main.yml +++ b/tests/integration/targets/gandi_livedns/defaults/main.yml @@ -1,8 +1,11 @@ -# Copyright: (c) 2020 Gregory Thiemonge -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) --- +# Copyright (c) 2020 Gregory Thiemonge +# 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 + gandi_livedns_domain_name: "ansible-tests.org" gandi_livedns_record_items: + # Single A record - record: test-www type: A diff --git a/tests/integration/targets/gandi_livedns/tasks/create_record.yml b/tests/integration/targets/gandi_livedns/tasks/create_record.yml index bfaff81393..9d764a4198 100644 --- a/tests/integration/targets/gandi_livedns/tasks/create_record.yml +++ b/tests/integration/targets/gandi_livedns/tasks/create_record.yml @@ -1,6 +1,8 @@ -# Copyright: (c) 2020 Gregory Thiemonge -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) --- +# Copyright (c) 2020 Gregory Thiemonge +# 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: test absent dns record community.general.gandi_livedns: api_key: "{{ gandi_api_key }}" diff --git a/tests/integration/targets/gandi_livedns/tasks/main.yml b/tests/integration/targets/gandi_livedns/tasks/main.yml index 5b11e8b9f3..19ba4d8fbf 100644 --- a/tests/integration/targets/gandi_livedns/tasks/main.yml +++ b/tests/integration/targets/gandi_livedns/tasks/main.yml @@ -1,5 +1,7 @@ -# Copyright: (c) 2020 Gregory Thiemonge -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) --- +# Copyright (c) 2020 Gregory Thiemonge +# 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 + - include_tasks: record.yml with_items: "{{ gandi_livedns_record_items }}" diff --git a/tests/integration/targets/gandi_livedns/tasks/record.yml b/tests/integration/targets/gandi_livedns/tasks/record.yml index 1e5977e3f9..d36e2e8574 100644 --- a/tests/integration/targets/gandi_livedns/tasks/record.yml +++ b/tests/integration/targets/gandi_livedns/tasks/record.yml @@ -1,6 +1,8 @@ -# Copyright: (c) 2020 Gregory Thiemonge -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) --- +# Copyright (c) 2020 Gregory Thiemonge +# 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 + - include_tasks: create_record.yml - include_tasks: update_record.yml - include_tasks: remove_record.yml diff --git a/tests/integration/targets/gandi_livedns/tasks/remove_record.yml b/tests/integration/targets/gandi_livedns/tasks/remove_record.yml index 78a0d2f42b..6f497d2375 100644 --- a/tests/integration/targets/gandi_livedns/tasks/remove_record.yml +++ b/tests/integration/targets/gandi_livedns/tasks/remove_record.yml @@ -1,6 +1,8 @@ -# Copyright: (c) 2020 Gregory Thiemonge -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) --- +# Copyright (c) 2020 Gregory Thiemonge +# 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: test remove a dns record in check mode community.general.gandi_livedns: api_key: "{{ gandi_api_key }}" diff --git a/tests/integration/targets/gandi_livedns/tasks/update_record.yml b/tests/integration/targets/gandi_livedns/tasks/update_record.yml index fdb1dc1e23..7489059de1 100644 --- a/tests/integration/targets/gandi_livedns/tasks/update_record.yml +++ b/tests/integration/targets/gandi_livedns/tasks/update_record.yml @@ -1,6 +1,8 @@ -# Copyright: (c) 2020 Gregory Thiemonge -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) --- +# Copyright (c) 2020 Gregory Thiemonge +# 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: test update or add another dns record in check mode community.general.gandi_livedns: api_key: "{{ gandi_api_key }}" diff --git a/tests/integration/targets/gem/aliases b/tests/integration/targets/gem/aliases index 1ef4c3619a..86d2291bb5 100644 --- a/tests/integration/targets/gem/aliases +++ b/tests/integration/targets/gem/aliases @@ -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 + destructive shippable/posix/group1 skip/aix diff --git a/tests/integration/targets/gem/meta/main.yml b/tests/integration/targets/gem/meta/main.yml index 56bc554611..ca1915e05c 100644 --- a/tests/integration/targets/gem/meta/main.yml +++ b/tests/integration/targets/gem/meta/main.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 + dependencies: - setup_pkg_mgr - setup_remote_tmp_dir diff --git a/tests/integration/targets/gem/tasks/main.yml b/tests/integration/targets/gem/tasks/main.yml index 1e6cd25ff7..edf813ba4a 100644 --- a/tests/integration/targets/gem/tasks/main.yml +++ b/tests/integration/targets/gem/tasks/main.yml @@ -1,25 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### # test code for the gem module -# (c) 2014, James Tanner - -# 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) 2014, James Tanner +# 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 - when: - not (ansible_os_family == 'Alpine') # TODO diff --git a/tests/integration/targets/gem/vars/FreeBSD.yml b/tests/integration/targets/gem/vars/FreeBSD.yml index 84e0b483d5..b9d9cc2c23 100644 --- a/tests/integration/targets/gem/vars/FreeBSD.yml +++ b/tests/integration/targets/gem/vars/FreeBSD.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 + test_packages: - "devel/ruby-gems" - "ruby" diff --git a/tests/integration/targets/gem/vars/RedHat.yml b/tests/integration/targets/gem/vars/RedHat.yml index c044d109b6..2bb724bfe3 100644 --- a/tests/integration/targets/gem/vars/RedHat.yml +++ b/tests/integration/targets/gem/vars/RedHat.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 + test_packages: - "rubygems" diff --git a/tests/integration/targets/gem/vars/default.yml b/tests/integration/targets/gem/vars/default.yml index 7d6e61ac46..b7496e12cd 100644 --- a/tests/integration/targets/gem/vars/default.yml +++ b/tests/integration/targets/gem/vars/default.yml @@ -1 +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 + test_packages: [] diff --git a/tests/integration/targets/git_config/aliases b/tests/integration/targets/git_config/aliases index 114ac22bb1..806c0598a4 100644 --- a/tests/integration/targets/git_config/aliases +++ b/tests/integration/targets/git_config/aliases @@ -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 + shippable/posix/group3 skip/aix destructive diff --git a/tests/integration/targets/git_config/files/gitconfig b/tests/integration/targets/git_config/files/gitconfig index 989aa1c8bf..92eeb7eb9f 100644 --- a/tests/integration/targets/git_config/files/gitconfig +++ b/tests/integration/targets/git_config/files/gitconfig @@ -1,2 +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 + [http] - proxy = foo \ No newline at end of file + proxy = foo diff --git a/tests/integration/targets/git_config/meta/main.yml b/tests/integration/targets/git_config/meta/main.yml index 1810d4bec9..982de6eb03 100644 --- a/tests/integration/targets/git_config/meta/main.yml +++ b/tests/integration/targets/git_config/meta/main.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 + dependencies: - setup_remote_tmp_dir diff --git a/tests/integration/targets/git_config/tasks/exclusion_state_list-all.yml b/tests/integration/targets/git_config/tasks/exclusion_state_list-all.yml index 09a6beee3e..d908f6e737 100644 --- a/tests/integration/targets/git_config/tasks/exclusion_state_list-all.yml +++ b/tests/integration/targets/git_config/tasks/exclusion_state_list-all.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 + - import_tasks: setup_no_value.yml - name: testing exclusion between state and list_all parameters diff --git a/tests/integration/targets/git_config/tasks/get_set_no_state.yml b/tests/integration/targets/git_config/tasks/get_set_no_state.yml index 7e9714a75e..4e41bf4e9d 100644 --- a/tests/integration/targets/git_config/tasks/get_set_no_state.yml +++ b/tests/integration/targets/git_config/tasks/get_set_no_state.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 + - import_tasks: setup_no_value.yml - name: setting value without state diff --git a/tests/integration/targets/git_config/tasks/get_set_state_present.yml b/tests/integration/targets/git_config/tasks/get_set_state_present.yml index 52d986d633..cfc3bbe78d 100644 --- a/tests/integration/targets/git_config/tasks/get_set_state_present.yml +++ b/tests/integration/targets/git_config/tasks/get_set_state_present.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 + - import_tasks: setup_no_value.yml - name: setting value with state=present diff --git a/tests/integration/targets/git_config/tasks/get_set_state_present_file.yml b/tests/integration/targets/git_config/tasks/get_set_state_present_file.yml index 5d46ed35c5..a61ffcc68c 100644 --- a/tests/integration/targets/git_config/tasks/get_set_state_present_file.yml +++ b/tests/integration/targets/git_config/tasks/get_set_state_present_file.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 + - import_tasks: setup_no_value.yml - name: setting value with state=present diff --git a/tests/integration/targets/git_config/tasks/main.yml b/tests/integration/targets/git_config/tasks/main.yml index c88d52e27a..4dc72824c8 100644 --- a/tests/integration/targets/git_config/tasks/main.yml +++ b/tests/integration/targets/git_config/tasks/main.yml @@ -5,6 +5,9 @@ #################################################################### # test code for the git_config module +# 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: setup import_tasks: setup.yml diff --git a/tests/integration/targets/git_config/tasks/precedence_between_unset_and_value.yml b/tests/integration/targets/git_config/tasks/precedence_between_unset_and_value.yml index 9eb4ca4034..a76fbab9cd 100644 --- a/tests/integration/targets/git_config/tasks/precedence_between_unset_and_value.yml +++ b/tests/integration/targets/git_config/tasks/precedence_between_unset_and_value.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 + - import_tasks: setup_value.yml - name: unsetting value diff --git a/tests/integration/targets/git_config/tasks/set_value_with_tilde.yml b/tests/integration/targets/git_config/tasks/set_value_with_tilde.yml index f55eb73066..f78e709bde 100644 --- a/tests/integration/targets/git_config/tasks/set_value_with_tilde.yml +++ b/tests/integration/targets/git_config/tasks/set_value_with_tilde.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 + #- import_tasks: setup_no_value.yml - name: setting value diff --git a/tests/integration/targets/git_config/tasks/setup.yml b/tests/integration/targets/git_config/tasks/setup.yml index 85e168fe65..0112011bd6 100644 --- a/tests/integration/targets/git_config/tasks/setup.yml +++ b/tests/integration/targets/git_config/tasks/setup.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: verify that git is installed so this test can continue command: which git register: git_installed @@ -8,4 +12,4 @@ shell: "git --version | grep 'git version' | sed 's/git version //'" register: git_version ignore_errors: yes -... \ No newline at end of file +... diff --git a/tests/integration/targets/git_config/tasks/setup_no_value.yml b/tests/integration/targets/git_config/tasks/setup_no_value.yml index 7bccfc0368..8e12c350cf 100644 --- a/tests/integration/targets/git_config/tasks/setup_no_value.yml +++ b/tests/integration/targets/git_config/tasks/setup_no_value.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 + # ------ # set up : deleting gitconfig file - name: set up without value diff --git a/tests/integration/targets/git_config/tasks/setup_value.yml b/tests/integration/targets/git_config/tasks/setup_value.yml index 748e838b3d..126b1ae4b5 100644 --- a/tests/integration/targets/git_config/tasks/setup_value.yml +++ b/tests/integration/targets/git_config/tasks/setup_value.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 + # ------ # set up : set gitconfig with value - name: set up with value diff --git a/tests/integration/targets/git_config/tasks/unset_check_mode.yml b/tests/integration/targets/git_config/tasks/unset_check_mode.yml index 43b9905373..52ab4a27f3 100644 --- a/tests/integration/targets/git_config/tasks/unset_check_mode.yml +++ b/tests/integration/targets/git_config/tasks/unset_check_mode.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 + - import_tasks: setup_value.yml - name: unsetting value with check mode diff --git a/tests/integration/targets/git_config/tasks/unset_no_value.yml b/tests/integration/targets/git_config/tasks/unset_no_value.yml index 5fb6b6bcb6..394276cad7 100644 --- a/tests/integration/targets/git_config/tasks/unset_no_value.yml +++ b/tests/integration/targets/git_config/tasks/unset_no_value.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 + - import_tasks: setup_no_value.yml - name: unsetting value diff --git a/tests/integration/targets/git_config/tasks/unset_value.yml b/tests/integration/targets/git_config/tasks/unset_value.yml index 6dda37736e..dfa535a2d3 100644 --- a/tests/integration/targets/git_config/tasks/unset_value.yml +++ b/tests/integration/targets/git_config/tasks/unset_value.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 + - import_tasks: setup_value.yml - name: unsetting value diff --git a/tests/integration/targets/git_config/vars/main.yml b/tests/integration/targets/git_config/vars/main.yml index 545110a5bf..3cca3ef6e4 100644 --- a/tests/integration/targets/git_config/vars/main.yml +++ b/tests/integration/targets/git_config/vars/main.yml @@ -1,6 +1,10 @@ --- +# 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 + git_version_supporting_includes: 1.7.10 option_name: http.proxy option_value: 'foo' option_scope: global -... \ No newline at end of file +... diff --git a/tests/integration/targets/github_issue/aliases b/tests/integration/targets/github_issue/aliases index a4c92ef853..abaeb52e6d 100644 --- a/tests/integration/targets/github_issue/aliases +++ b/tests/integration/targets/github_issue/aliases @@ -1,2 +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 + destructive shippable/posix/group1 diff --git a/tests/integration/targets/github_issue/tasks/main.yml b/tests/integration/targets/github_issue/tasks/main.yml index 7731a7a955..bb315bf9fb 100644 --- a/tests/integration/targets/github_issue/tasks/main.yml +++ b/tests/integration/targets/github_issue/tasks/main.yml @@ -5,8 +5,9 @@ # Test code for the github_issue module. # -# Copyright: (c) 2017-2018, Abhijeet Kasurde -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2017-2018, Abhijeet Kasurde +# 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: Check if GitHub issue is closed or not github_issue: diff --git a/tests/integration/targets/github_issue/vars/main.yml b/tests/integration/targets/github_issue/vars/main.yml index 52546d3f7c..8b2a2de6e3 100644 --- a/tests/integration/targets/github_issue/vars/main.yml +++ b/tests/integration/targets/github_issue/vars/main.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 issue: 23642 non_existent_issue: 1111111 diff --git a/tests/integration/targets/gitlab_branch/aliases b/tests/integration/targets/gitlab_branch/aliases index 268da2c702..1a0d20b0b2 100644 --- a/tests/integration/targets/gitlab_branch/aliases +++ b/tests/integration/targets/gitlab_branch/aliases @@ -1,2 +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 + shippable/posix/group1 disabled diff --git a/tests/integration/targets/gitlab_branch/defaults/main.yml b/tests/integration/targets/gitlab_branch/defaults/main.yml index ffe0d8dc47..a5f0a07510 100644 --- a/tests/integration/targets/gitlab_branch/defaults/main.yml +++ b/tests/integration/targets/gitlab_branch/defaults/main.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 + gitlab_branch: ansible_test_branch -gitlab_project_name: ansible_test_project \ No newline at end of file +gitlab_project_name: ansible_test_project diff --git a/tests/integration/targets/gitlab_branch/tasks/main.yml b/tests/integration/targets/gitlab_branch/tasks/main.yml index 78fe772012..e9b64fc3a3 100644 --- a/tests/integration/targets/gitlab_branch/tasks/main.yml +++ b/tests/integration/targets/gitlab_branch/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Install required libs pip: name: python-gitlab diff --git a/tests/integration/targets/gitlab_deploy_key/aliases b/tests/integration/targets/gitlab_deploy_key/aliases index ef7ed2e3b5..0d1cc45a85 100644 --- a/tests/integration/targets/gitlab_deploy_key/aliases +++ b/tests/integration/targets/gitlab_deploy_key/aliases @@ -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 + shippable/posix/group1 gitlab/ci disabled diff --git a/tests/integration/targets/gitlab_deploy_key/defaults/main.yml b/tests/integration/targets/gitlab_deploy_key/defaults/main.yml index 04d5b6ca83..8225571b66 100644 --- a/tests/integration/targets/gitlab_deploy_key/defaults/main.yml +++ b/tests/integration/targets/gitlab_deploy_key/defaults/main.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 + gitlab_project_name: ansible_test_project gitlab_deploy_key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJnTYY7CYk1F/wBklpdRxudxN6KeXgfhutkiCigSfPhe ansible_test" gitlab_deploy_key_new: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDL1TDkIY2uu6NYRD0G5qGeHTd/AoqQpCw1XENXDnTLDN5DNZVCO1+7xfA5DR5V2tcR691Q005BKxoCo+uUBd1aAM7JWyuXl050rZCXBj4oaUF7urjDANQ7FzYuvqp9h8NGkvzfBYz5YBfu4vh43ajnF0daSyZy4RlxeG9G44vnHElXTQ0igaOCSta/23FdERIYzKxuX4Ul42AwtSmCRwbkN4fC86o0UwW2q0zkgFOUoojtS/Avh0aX8UQyeagaPJFXCc/ldG1mMK020GQAEa8aQcUpysnEzZdq6no5Zyn/WQSobpnJ9CraHhdb1QQytg/+c+CgjSN0cERhTvLn0WsQ043jo5g1kSHNu+OiYXmVwTxe95nXCsoYmCNF/DmezjYVxe9BGlKRAEuHsNi87Il84nBnzKVHGlkq8eJNTR8ASjNkjI7pGS0zxCDB55c3LHh4Aa1xU+nwINRurn/TEDpDZc43/XOnt+aqbxkeWbMtOD/r2gfMj8lNZJ/IyamWy7HcFgGpTZJln4WxVLF+Cz56qa8Hf9WzJL+8Lq7eE3sJKOagn/zPgqeybXbTIPSr3fshq3yE8FYHpFKS4aLvQC/XSLCywrhr25DKBn9UHIZmgC9hxMnVJCKux+ltwGJOKIaoj+5n3+DvM+E3fK3fkADo5+Frzay6/rLTwKWUrzfjQQ== ansible_test_new" diff --git a/tests/integration/targets/gitlab_deploy_key/tasks/main.yml b/tests/integration/targets/gitlab_deploy_key/tasks/main.yml index 430d46f4ab..4330eb674c 100644 --- a/tests/integration/targets/gitlab_deploy_key/tasks/main.yml +++ b/tests/integration/targets/gitlab_deploy_key/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Install required libs pip: name: python-gitlab diff --git a/tests/integration/targets/gitlab_group/aliases b/tests/integration/targets/gitlab_group/aliases index ef7ed2e3b5..0d1cc45a85 100644 --- a/tests/integration/targets/gitlab_group/aliases +++ b/tests/integration/targets/gitlab_group/aliases @@ -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 + shippable/posix/group1 gitlab/ci disabled diff --git a/tests/integration/targets/gitlab_group/defaults/main.yml b/tests/integration/targets/gitlab_group/defaults/main.yml index 630926d922..01863abe33 100644 --- a/tests/integration/targets/gitlab_group/defaults/main.yml +++ b/tests/integration/targets/gitlab_group/defaults/main.yml @@ -1 +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 + gitlab_group: ansible_test_project diff --git a/tests/integration/targets/gitlab_group/tasks/main.yml b/tests/integration/targets/gitlab_group/tasks/main.yml index 0d17f6a9d4..a0355094f4 100644 --- a/tests/integration/targets/gitlab_group/tasks/main.yml +++ b/tests/integration/targets/gitlab_group/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Install required libs pip: name: python-gitlab diff --git a/tests/integration/targets/gitlab_group_members/aliases b/tests/integration/targets/gitlab_group_members/aliases index 89aea537d1..bd1f024441 100644 --- a/tests/integration/targets/gitlab_group_members/aliases +++ b/tests/integration/targets/gitlab_group_members/aliases @@ -1 +1,5 @@ -unsupported \ No newline at end of file +# 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 + +unsupported diff --git a/tests/integration/targets/gitlab_group_members/tasks/main.yml b/tests/integration/targets/gitlab_group_members/tasks/main.yml index 109a0f2bdb..aa75096daa 100644 --- a/tests/integration/targets/gitlab_group_members/tasks/main.yml +++ b/tests/integration/targets/gitlab_group_members/tasks/main.yml @@ -5,8 +5,9 @@ # Test code for gitlab_group_members module # -# Copyright: (c) 2020, Zainab Alsaffar -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2020, Zainab Alsaffar +# 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: Install required library pip: name: python-gitlab diff --git a/tests/integration/targets/gitlab_group_members/vars/main.yml b/tests/integration/targets/gitlab_group_members/vars/main.yml index 6a6b17319d..9082604186 100644 --- a/tests/integration/targets/gitlab_group_members/vars/main.yml +++ b/tests/integration/targets/gitlab_group_members/vars/main.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 + gitlab_server_url: https://gitlabserver.example.com gitlab_api_access_token: 126hngbscx890cv09b gitlab_group_name: groupname1 diff --git a/tests/integration/targets/gitlab_group_variable/aliases b/tests/integration/targets/gitlab_group_variable/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/gitlab_group_variable/aliases +++ b/tests/integration/targets/gitlab_group_variable/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/gitlab_group_variable/tasks/main.yml b/tests/integration/targets/gitlab_group_variable/tasks/main.yml index 1bba0c9d1d..0f4a93f461 100644 --- a/tests/integration/targets/gitlab_group_variable/tasks/main.yml +++ b/tests/integration/targets/gitlab_group_variable/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Install required libs pip: name: python-gitlab @@ -700,4 +704,3 @@ that: - gitlab_group_variable_state.changed - gitlab_group_variable_state.group_variable.removed|length == 1 - \ No newline at end of file diff --git a/tests/integration/targets/gitlab_hook/aliases b/tests/integration/targets/gitlab_hook/aliases index ef7ed2e3b5..0d1cc45a85 100644 --- a/tests/integration/targets/gitlab_hook/aliases +++ b/tests/integration/targets/gitlab_hook/aliases @@ -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 + shippable/posix/group1 gitlab/ci disabled diff --git a/tests/integration/targets/gitlab_hook/defaults/main.yml b/tests/integration/targets/gitlab_hook/defaults/main.yml index eda34a26e6..69cec7d33b 100644 --- a/tests/integration/targets/gitlab_hook/defaults/main.yml +++ b/tests/integration/targets/gitlab_hook/defaults/main.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 + gitlab_project_name: ansible_test_project gitlab_hook_url: http://gitlab.example.com/hook diff --git a/tests/integration/targets/gitlab_hook/tasks/main.yml b/tests/integration/targets/gitlab_hook/tasks/main.yml index 0ef6cb5c08..410af63e9f 100644 --- a/tests/integration/targets/gitlab_hook/tasks/main.yml +++ b/tests/integration/targets/gitlab_hook/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Install required libs pip: name: python-gitlab diff --git a/tests/integration/targets/gitlab_project/aliases b/tests/integration/targets/gitlab_project/aliases index ef7ed2e3b5..0d1cc45a85 100644 --- a/tests/integration/targets/gitlab_project/aliases +++ b/tests/integration/targets/gitlab_project/aliases @@ -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 + shippable/posix/group1 gitlab/ci disabled diff --git a/tests/integration/targets/gitlab_project/defaults/main.yml b/tests/integration/targets/gitlab_project/defaults/main.yml index 4e47591941..457129c227 100644 --- a/tests/integration/targets/gitlab_project/defaults/main.yml +++ b/tests/integration/targets/gitlab_project/defaults/main.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 + gitlab_project_name: ansible_test_project gitlab_deploy_key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJnTYY7CYk1F/wBklpdRxudxN6KeXgfhutkiCigSfPhe ansible_test" diff --git a/tests/integration/targets/gitlab_project/tasks/main.yml b/tests/integration/targets/gitlab_project/tasks/main.yml index 2e6dd0cfd3..611d6548f6 100644 --- a/tests/integration/targets/gitlab_project/tasks/main.yml +++ b/tests/integration/targets/gitlab_project/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Install required libs pip: name: python-gitlab diff --git a/tests/integration/targets/gitlab_project_members/aliases b/tests/integration/targets/gitlab_project_members/aliases index 89aea537d1..bd1f024441 100644 --- a/tests/integration/targets/gitlab_project_members/aliases +++ b/tests/integration/targets/gitlab_project_members/aliases @@ -1 +1,5 @@ -unsupported \ No newline at end of file +# 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 + +unsupported diff --git a/tests/integration/targets/gitlab_project_members/defaults/main.yml b/tests/integration/targets/gitlab_project_members/defaults/main.yml index 1b3ac19a47..72d5a68f15 100644 --- a/tests/integration/targets/gitlab_project_members/defaults/main.yml +++ b/tests/integration/targets/gitlab_project_members/defaults/main.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 + gitlab_server_url: https://gitlab.com gitlab_api_access_token: "token" gitlab_project: some_project diff --git a/tests/integration/targets/gitlab_project_members/tasks/main.yml b/tests/integration/targets/gitlab_project_members/tasks/main.yml index ade06d7ca2..215abad44f 100644 --- a/tests/integration/targets/gitlab_project_members/tasks/main.yml +++ b/tests/integration/targets/gitlab_project_members/tasks/main.yml @@ -5,8 +5,9 @@ # Test code for gitlab_project_members module # -# Copyright: (c) 2021, Sergey Mikhaltsov -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, Sergey Mikhaltsov +# 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: Install required library pip: diff --git a/tests/integration/targets/gitlab_project_variable/aliases b/tests/integration/targets/gitlab_project_variable/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/gitlab_project_variable/aliases +++ b/tests/integration/targets/gitlab_project_variable/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/gitlab_project_variable/tasks/main.yml b/tests/integration/targets/gitlab_project_variable/tasks/main.yml index 18dbf7eccd..3c90bfe467 100644 --- a/tests/integration/targets/gitlab_project_variable/tasks/main.yml +++ b/tests/integration/targets/gitlab_project_variable/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Install required libs pip: name: python-gitlab diff --git a/tests/integration/targets/gitlab_runner/aliases b/tests/integration/targets/gitlab_runner/aliases index ef7ed2e3b5..0d1cc45a85 100644 --- a/tests/integration/targets/gitlab_runner/aliases +++ b/tests/integration/targets/gitlab_runner/aliases @@ -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 + shippable/posix/group1 gitlab/ci disabled diff --git a/tests/integration/targets/gitlab_runner/defaults/main.yml b/tests/integration/targets/gitlab_runner/defaults/main.yml index bed980a238..ec7c0cfe1e 100644 --- a/tests/integration/targets/gitlab_runner/defaults/main.yml +++ b/tests/integration/targets/gitlab_runner/defaults/main.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 + gitlab_project_name: ansible_test_project gitlab_hook_url: http://gitlab.example.com/hook gitlab_runner_name: ansible_test_runner diff --git a/tests/integration/targets/gitlab_runner/tasks/main.yml b/tests/integration/targets/gitlab_runner/tasks/main.yml index 42b4182087..e4529f8ffc 100644 --- a/tests/integration/targets/gitlab_runner/tasks/main.yml +++ b/tests/integration/targets/gitlab_runner/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Install required libs pip: name: python-gitlab diff --git a/tests/integration/targets/gitlab_user/aliases b/tests/integration/targets/gitlab_user/aliases index ef7ed2e3b5..0d1cc45a85 100644 --- a/tests/integration/targets/gitlab_user/aliases +++ b/tests/integration/targets/gitlab_user/aliases @@ -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 + shippable/posix/group1 gitlab/ci disabled diff --git a/tests/integration/targets/gitlab_user/defaults/main.yml b/tests/integration/targets/gitlab_user/defaults/main.yml index bbe016b0a8..c7a4a5dd34 100644 --- a/tests/integration/targets/gitlab_user/defaults/main.yml +++ b/tests/integration/targets/gitlab_user/defaults/main.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 + gitlab_user: ansible_test_user gitlab_user_pass: Secr3tPassw00rd gitlab_user_email: root@localhost diff --git a/tests/integration/targets/gitlab_user/tasks/main.yml b/tests/integration/targets/gitlab_user/tasks/main.yml index dddf7aaea8..1f16074f70 100644 --- a/tests/integration/targets/gitlab_user/tasks/main.yml +++ b/tests/integration/targets/gitlab_user/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Install required libs pip: name: python-gitlab diff --git a/tests/integration/targets/gitlab_user/tasks/sshkey.yml b/tests/integration/targets/gitlab_user/tasks/sshkey.yml index 2d2067e74b..bba724d5ee 100644 --- a/tests/integration/targets/gitlab_user/tasks/sshkey.yml +++ b/tests/integration/targets/gitlab_user/tasks/sshkey.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Create gitlab user with sshkey credentials gitlab_user: api_url: "{{ gitlab_host }}" diff --git a/tests/integration/targets/hg/aliases b/tests/integration/targets/hg/aliases index 2f2db5bc12..8bda40608c 100644 --- a/tests/integration/targets/hg/aliases +++ b/tests/integration/targets/hg/aliases @@ -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 + shippable/posix/group2 skip/python3 skip/aix diff --git a/tests/integration/targets/hg/meta/main.yml b/tests/integration/targets/hg/meta/main.yml index 56bc554611..ca1915e05c 100644 --- a/tests/integration/targets/hg/meta/main.yml +++ b/tests/integration/targets/hg/meta/main.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 + dependencies: - setup_pkg_mgr - setup_remote_tmp_dir diff --git a/tests/integration/targets/hg/tasks/install.yml b/tests/integration/targets/hg/tasks/install.yml index 40aba5e2fc..1b89168808 100644 --- a/tests/integration/targets/hg/tasks/install.yml +++ b/tests/integration/targets/hg/tasks/install.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: get the default python version command: "{{ ansible_python_interpreter }} -V" register: default_python_version diff --git a/tests/integration/targets/hg/tasks/main.yml b/tests/integration/targets/hg/tasks/main.yml index 4d7efca5e2..a2cb8df903 100644 --- a/tests/integration/targets/hg/tasks/main.yml +++ b/tests/integration/targets/hg/tasks/main.yml @@ -4,9 +4,10 @@ #################################################################### # test code for the hg module -# Copyright: (c) 2014, James Tanner +# Copyright (c) 2014, James Tanner # -# 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 - name: determine if mercurial is already installed command: which hg diff --git a/tests/integration/targets/hg/tasks/run-tests.yml b/tests/integration/targets/hg/tasks/run-tests.yml index 0818f4f466..e38aeae104 100644 --- a/tests/integration/targets/hg/tasks/run-tests.yml +++ b/tests/integration/targets/hg/tasks/run-tests.yml @@ -1,7 +1,8 @@ # test code for the hg module -# Copyright: (c) 2018, Ansible Project +# 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 - name: set where to extract the repo diff --git a/tests/integration/targets/hg/tasks/uninstall.yml b/tests/integration/targets/hg/tasks/uninstall.yml index 305a2ffd33..80a28f0623 100644 --- a/tests/integration/targets/hg/tasks/uninstall.yml +++ b/tests/integration/targets/hg/tasks/uninstall.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: restore the updated python command: mv "{{ which_python.stdout }}.updated" "{{ which_python.stdout }}" diff --git a/tests/integration/targets/homebrew/aliases b/tests/integration/targets/homebrew/aliases index 7361196090..8f34f67cb8 100644 --- a/tests/integration/targets/homebrew/aliases +++ b/tests/integration/targets/homebrew/aliases @@ -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 + shippable/posix/group1 skip/aix skip/freebsd diff --git a/tests/integration/targets/homebrew/tasks/main.yml b/tests/integration/targets/homebrew/tasks/main.yml index b961d0e088..07cc81d034 100644 --- a/tests/integration/targets/homebrew/tasks/main.yml +++ b/tests/integration/targets/homebrew/tasks/main.yml @@ -1,12 +1,14 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### # Test code for the homebrew module. -# Copyright: (c) 2020, Abhijeet Kasurde -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ---- +# Copyright (c) 2020, Abhijeet Kasurde +# 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: Find brew binary command: which brew register: brew_which diff --git a/tests/integration/targets/homebrew_cask/aliases b/tests/integration/targets/homebrew_cask/aliases index 7361196090..8f34f67cb8 100644 --- a/tests/integration/targets/homebrew_cask/aliases +++ b/tests/integration/targets/homebrew_cask/aliases @@ -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 + shippable/posix/group1 skip/aix skip/freebsd diff --git a/tests/integration/targets/homebrew_cask/defaults/main.yml b/tests/integration/targets/homebrew_cask/defaults/main.yml index e9c23a3bc9..18ebd7b105 100644 --- a/tests/integration/targets/homebrew_cask/defaults/main.yml +++ b/tests/integration/targets/homebrew_cask/defaults/main.yml @@ -1 +1,6 @@ -cask: brooklyn \ No newline at end of file +--- +# 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 + +cask: brooklyn diff --git a/tests/integration/targets/homebrew_cask/tasks/main.yml b/tests/integration/targets/homebrew_cask/tasks/main.yml index a582427c56..9d7ac47b5a 100644 --- a/tests/integration/targets/homebrew_cask/tasks/main.yml +++ b/tests/integration/targets/homebrew_cask/tasks/main.yml @@ -1,12 +1,14 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### # Test code for the homebrew_cask module. -# Copyright: (c) 2022, Joseph Torcasso -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ---- +# Copyright (c) 2022, Joseph Torcasso +# 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: Find brew binary command: which brew register: brew_which diff --git a/tests/integration/targets/homectl/aliases b/tests/integration/targets/homectl/aliases index a2c5a3a804..8cee099853 100644 --- a/tests/integration/targets/homectl/aliases +++ b/tests/integration/targets/homectl/aliases @@ -1,5 +1,10 @@ +# 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 + shippable/posix/group1 skip/aix skip/freebsd skip/osx -skip/macos \ No newline at end of file +skip/macos +skip/rhel9.0 # See https://www.reddit.com/r/Fedora/comments/si7nzk/homectl/ diff --git a/tests/integration/targets/homectl/tasks/main.yml b/tests/integration/targets/homectl/tasks/main.yml index ded6173759..c57052c5d8 100644 --- a/tests/integration/targets/homectl/tasks/main.yml +++ b/tests/integration/targets/homectl/tasks/main.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 + # Get systemd version and if it doesn't exist don't run these tests. - name: check systemd version command: "systemctl --version" @@ -174,3 +179,4 @@ when: - systemd_version.rc == 0 and (systemd_version.stdout | regex_search('[0-9][0-9][0-9]') | int >= 245) and homectl_version.rc == 0 - ansible_distribution != 'Archlinux' # TODO! + - ansible_distribution != 'Fedora' or ansible_distribution_major_version|int < 36 # TODO! diff --git a/tests/integration/targets/hwc_ecs_instance/aliases b/tests/integration/targets/hwc_ecs_instance/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/hwc_ecs_instance/aliases +++ b/tests/integration/targets/hwc_ecs_instance/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/hwc_ecs_instance/tasks/main.yml b/tests/integration/targets/hwc_ecs_instance/tasks/main.yml index 4d36c11286..9322558f96 100644 --- a/tests/integration/targets/hwc_ecs_instance/tasks/main.yml +++ b/tests/integration/targets/hwc_ecs_instance/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + # Pre-test setup - name: create a vpc hwc_network_vpc: diff --git a/tests/integration/targets/hwc_evs_disk/aliases b/tests/integration/targets/hwc_evs_disk/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/hwc_evs_disk/aliases +++ b/tests/integration/targets/hwc_evs_disk/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/hwc_evs_disk/tasks/main.yml b/tests/integration/targets/hwc_evs_disk/tasks/main.yml index e2380450cd..e691169016 100644 --- a/tests/integration/targets/hwc_evs_disk/tasks/main.yml +++ b/tests/integration/targets/hwc_evs_disk/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: delete a disk hwc_evs_disk: availability_zone: "cn-north-1a" diff --git a/tests/integration/targets/hwc_network_vpc/aliases b/tests/integration/targets/hwc_network_vpc/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/hwc_network_vpc/aliases +++ b/tests/integration/targets/hwc_network_vpc/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/hwc_network_vpc/tasks/main.yml b/tests/integration/targets/hwc_network_vpc/tasks/main.yml index e3b979d0b5..3695fd2100 100644 --- a/tests/integration/targets/hwc_network_vpc/tasks/main.yml +++ b/tests/integration/targets/hwc_network_vpc/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** diff --git a/tests/integration/targets/hwc_smn_topic/aliases b/tests/integration/targets/hwc_smn_topic/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/hwc_smn_topic/aliases +++ b/tests/integration/targets/hwc_smn_topic/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/hwc_smn_topic/tasks/main.yml b/tests/integration/targets/hwc_smn_topic/tasks/main.yml index a9879aea54..323904773f 100644 --- a/tests/integration/targets/hwc_smn_topic/tasks/main.yml +++ b/tests/integration/targets/hwc_smn_topic/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: delete a smn topic hwc_smn_topic: identity_endpoint: "{{ identity_endpoint }}" diff --git a/tests/integration/targets/hwc_vpc_eip/aliases b/tests/integration/targets/hwc_vpc_eip/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/hwc_vpc_eip/aliases +++ b/tests/integration/targets/hwc_vpc_eip/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/hwc_vpc_eip/tasks/main.yml b/tests/integration/targets/hwc_vpc_eip/tasks/main.yml index bdf5d763a7..462b5ff93f 100644 --- a/tests/integration/targets/hwc_vpc_eip/tasks/main.yml +++ b/tests/integration/targets/hwc_vpc_eip/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + # Pre-test setup - name: create a vpc hwc_network_vpc: diff --git a/tests/integration/targets/hwc_vpc_peering_connect/aliases b/tests/integration/targets/hwc_vpc_peering_connect/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/hwc_vpc_peering_connect/aliases +++ b/tests/integration/targets/hwc_vpc_peering_connect/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/hwc_vpc_peering_connect/tasks/main.yml b/tests/integration/targets/hwc_vpc_peering_connect/tasks/main.yml index cb6a15f750..6a5eb19b89 100644 --- a/tests/integration/targets/hwc_vpc_peering_connect/tasks/main.yml +++ b/tests/integration/targets/hwc_vpc_peering_connect/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + # Pre-test setup - name: create a vpc hwc_network_vpc: diff --git a/tests/integration/targets/hwc_vpc_port/aliases b/tests/integration/targets/hwc_vpc_port/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/hwc_vpc_port/aliases +++ b/tests/integration/targets/hwc_vpc_port/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/hwc_vpc_port/tasks/main.yml b/tests/integration/targets/hwc_vpc_port/tasks/main.yml index 00f5ae8b2e..d78498cbb6 100644 --- a/tests/integration/targets/hwc_vpc_port/tasks/main.yml +++ b/tests/integration/targets/hwc_vpc_port/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + # Pre-test setup - name: create a vpc hwc_network_vpc: diff --git a/tests/integration/targets/hwc_vpc_private_ip/aliases b/tests/integration/targets/hwc_vpc_private_ip/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/hwc_vpc_private_ip/aliases +++ b/tests/integration/targets/hwc_vpc_private_ip/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/hwc_vpc_private_ip/tasks/main.yml b/tests/integration/targets/hwc_vpc_private_ip/tasks/main.yml index 5531d575f8..8bfd3e4d82 100644 --- a/tests/integration/targets/hwc_vpc_private_ip/tasks/main.yml +++ b/tests/integration/targets/hwc_vpc_private_ip/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + # Pre-test setup - name: create a vpc hwc_network_vpc: diff --git a/tests/integration/targets/hwc_vpc_route/aliases b/tests/integration/targets/hwc_vpc_route/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/hwc_vpc_route/aliases +++ b/tests/integration/targets/hwc_vpc_route/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/hwc_vpc_route/tasks/main.yml b/tests/integration/targets/hwc_vpc_route/tasks/main.yml index 9c9c37e8c0..c7ae7989ca 100644 --- a/tests/integration/targets/hwc_vpc_route/tasks/main.yml +++ b/tests/integration/targets/hwc_vpc_route/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + # Pre-test setup - name: create a vpc hwc_network_vpc: diff --git a/tests/integration/targets/hwc_vpc_security_group/aliases b/tests/integration/targets/hwc_vpc_security_group/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/hwc_vpc_security_group/aliases +++ b/tests/integration/targets/hwc_vpc_security_group/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/hwc_vpc_security_group/tasks/main.yml b/tests/integration/targets/hwc_vpc_security_group/tasks/main.yml index 9f853ca8e7..f9d8e5bf76 100644 --- a/tests/integration/targets/hwc_vpc_security_group/tasks/main.yml +++ b/tests/integration/targets/hwc_vpc_security_group/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + # Pre-test setup - name: delete a security group hwc_vpc_security_group: diff --git a/tests/integration/targets/hwc_vpc_security_group_rule/aliases b/tests/integration/targets/hwc_vpc_security_group_rule/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/hwc_vpc_security_group_rule/aliases +++ b/tests/integration/targets/hwc_vpc_security_group_rule/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/hwc_vpc_security_group_rule/tasks/main.yml b/tests/integration/targets/hwc_vpc_security_group_rule/tasks/main.yml index 04213e7162..0b7f99fd61 100644 --- a/tests/integration/targets/hwc_vpc_security_group_rule/tasks/main.yml +++ b/tests/integration/targets/hwc_vpc_security_group_rule/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + # Pre-test setup - name: create a security group hwc_vpc_security_group: diff --git a/tests/integration/targets/hwc_vpc_subnet/aliases b/tests/integration/targets/hwc_vpc_subnet/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/hwc_vpc_subnet/aliases +++ b/tests/integration/targets/hwc_vpc_subnet/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/hwc_vpc_subnet/tasks/main.yml b/tests/integration/targets/hwc_vpc_subnet/tasks/main.yml index c16ff85241..90243203f6 100644 --- a/tests/integration/targets/hwc_vpc_subnet/tasks/main.yml +++ b/tests/integration/targets/hwc_vpc_subnet/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + # Pre-test setup - name: create a vpc hwc_network_vpc: diff --git a/tests/integration/targets/ilo_redfish_config/aliases b/tests/integration/targets/ilo_redfish_config/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/ilo_redfish_config/aliases +++ b/tests/integration/targets/ilo_redfish_config/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/ilo_redfish_config/tasks/main.yml b/tests/integration/targets/ilo_redfish_config/tasks/main.yml index 97d066c6bf..30bfb4edd5 100644 --- a/tests/integration/targets/ilo_redfish_config/tasks/main.yml +++ b/tests/integration/targets/ilo_redfish_config/tasks/main.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: Set NTP Servers ilo_redfish_config: category: Manager diff --git a/tests/integration/targets/ilo_redfish_info/aliases b/tests/integration/targets/ilo_redfish_info/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/ilo_redfish_info/aliases +++ b/tests/integration/targets/ilo_redfish_info/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/ilo_redfish_info/tasks/main.yml b/tests/integration/targets/ilo_redfish_info/tasks/main.yml index 664a677cec..0f80207acd 100644 --- a/tests/integration/targets/ilo_redfish_info/tasks/main.yml +++ b/tests/integration/targets/ilo_redfish_info/tasks/main.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: Get sessions ilo_redfish_info: category: Sessions diff --git a/tests/integration/targets/influxdb_user/aliases b/tests/integration/targets/influxdb_user/aliases index 6fe31dda15..14d23a4da1 100644 --- a/tests/integration/targets/influxdb_user/aliases +++ b/tests/integration/targets/influxdb_user/aliases @@ -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 + destructive shippable/posix/group1 disabled diff --git a/tests/integration/targets/influxdb_user/meta/main.yml b/tests/integration/targets/influxdb_user/meta/main.yml index 941117026f..34b3a3a6cd 100644 --- a/tests/integration/targets/influxdb_user/meta/main.yml +++ b/tests/integration/targets/influxdb_user/meta/main.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 + dependencies: - setup_influxdb diff --git a/tests/integration/targets/influxdb_user/tasks/main.yml b/tests/integration/targets/influxdb_user/tasks/main.yml index ad625367e0..23c37b7960 100644 --- a/tests/integration/targets/influxdb_user/tasks/main.yml +++ b/tests/integration/targets/influxdb_user/tasks/main.yml @@ -4,6 +4,9 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 - include: tests.yml when: ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'trusty' diff --git a/tests/integration/targets/influxdb_user/tasks/tests.yml b/tests/integration/targets/influxdb_user/tasks/tests.yml index ad3396642b..be36ee691c 100644 --- a/tests/integration/targets/influxdb_user/tasks/tests.yml +++ b/tests/integration/targets/influxdb_user/tasks/tests.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 - name: Install influxdb python module pip: name=influxdb diff --git a/tests/integration/targets/ini_file/aliases b/tests/integration/targets/ini_file/aliases index 765b70da79..be75e3ddab 100644 --- a/tests/integration/targets/ini_file/aliases +++ b/tests/integration/targets/ini_file/aliases @@ -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 + shippable/posix/group2 diff --git a/tests/integration/targets/ini_file/meta/main.yml b/tests/integration/targets/ini_file/meta/main.yml index 1810d4bec9..982de6eb03 100644 --- a/tests/integration/targets/ini_file/meta/main.yml +++ b/tests/integration/targets/ini_file/meta/main.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 + dependencies: - setup_remote_tmp_dir diff --git a/tests/integration/targets/ini_file/tasks/main.yml b/tests/integration/targets/ini_file/tasks/main.yml index b3a1c85531..11c5bf3b23 100644 --- a/tests/integration/targets/ini_file/tasks/main.yml +++ b/tests/integration/targets/ini_file/tasks/main.yml @@ -5,22 +5,9 @@ #################################################################### # test code for ini_file plugins -# (c) 2017 Red Hat Inc. - -# 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) 2017 Red Hat 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 - name: record the output directory set_fact: diff --git a/tests/integration/targets/ini_file/tasks/tests/00-basic.yml b/tests/integration/targets/ini_file/tasks/tests/00-basic.yml index 8f8d345f7e..c619e937a5 100644 --- a/tests/integration/targets/ini_file/tasks/tests/00-basic.yml +++ b/tests/integration/targets/ini_file/tasks/tests/00-basic.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 + ## basiscs - name: test-basic 1 - specify both "value" and "values" and fail diff --git a/tests/integration/targets/ini_file/tasks/tests/01-value.yml b/tests/integration/targets/ini_file/tasks/tests/01-value.yml index 93499cc63d..9670cd20f9 100644 --- a/tests/integration/targets/ini_file/tasks/tests/01-value.yml +++ b/tests/integration/targets/ini_file/tasks/tests/01-value.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 ## testing value diff --git a/tests/integration/targets/ini_file/tasks/tests/02-values.yml b/tests/integration/targets/ini_file/tasks/tests/02-values.yml index 645490d111..23071ebccc 100644 --- a/tests/integration/targets/ini_file/tasks/tests/02-values.yml +++ b/tests/integration/targets/ini_file/tasks/tests/02-values.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 ## testing values diff --git a/tests/integration/targets/ini_file/tasks/tests/03-encoding.yml b/tests/integration/targets/ini_file/tasks/tests/03-encoding.yml index 6280ae1ffb..555dd576c4 100644 --- a/tests/integration/targets/ini_file/tasks/tests/03-encoding.yml +++ b/tests/integration/targets/ini_file/tasks/tests/03-encoding.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 # Regression test for https://github.com/ansible-collections/community.general/pull/2578#issuecomment-868092282 - name: Create UTF-8 test file diff --git a/tests/integration/targets/interfaces_file/aliases b/tests/integration/targets/interfaces_file/aliases index 765b70da79..be75e3ddab 100644 --- a/tests/integration/targets/interfaces_file/aliases +++ b/tests/integration/targets/interfaces_file/aliases @@ -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 + shippable/posix/group2 diff --git a/tests/integration/targets/interfaces_file/files/interfaces_ff b/tests/integration/targets/interfaces_file/files/interfaces_ff index c3319a4872..c7f0452df4 100644 --- a/tests/integration/targets/interfaces_file/files/interfaces_ff +++ b/tests/integration/targets/interfaces_file/files/interfaces_ff @@ -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 + iface eno1 inet static address 1.2.3.4 netmask 255.255.255.0 diff --git a/tests/integration/targets/interfaces_file/files/interfaces_ff_3841 b/tests/integration/targets/interfaces_file/files/interfaces_ff_3841 index 06f78dd74f..9f47879c59 100644 --- a/tests/integration/targets/interfaces_file/files/interfaces_ff_3841 +++ b/tests/integration/targets/interfaces_file/files/interfaces_ff_3841 @@ -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 + iface eth0 inet static address 1.2.3.4 netmask 255.255.255.0 diff --git a/tests/integration/targets/interfaces_file/meta/main.yml b/tests/integration/targets/interfaces_file/meta/main.yml index 1810d4bec9..982de6eb03 100644 --- a/tests/integration/targets/interfaces_file/meta/main.yml +++ b/tests/integration/targets/interfaces_file/meta/main.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 + dependencies: - setup_remote_tmp_dir diff --git a/tests/integration/targets/interfaces_file/tasks/main.yml b/tests/integration/targets/interfaces_file/tasks/main.yml index 5dbd983379..918a323319 100644 --- a/tests/integration/targets/interfaces_file/tasks/main.yml +++ b/tests/integration/targets/interfaces_file/tasks/main.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: set_fact: interfaces_testfile: '{{ remote_tmp_dir }}/interfaces' diff --git a/tests/integration/targets/ipify_facts/aliases b/tests/integration/targets/ipify_facts/aliases index 765b70da79..be75e3ddab 100644 --- a/tests/integration/targets/ipify_facts/aliases +++ b/tests/integration/targets/ipify_facts/aliases @@ -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 + shippable/posix/group2 diff --git a/tests/integration/targets/ipify_facts/tasks/main.yml b/tests/integration/targets/ipify_facts/tasks/main.yml index 7b620ff9ec..78e44e9462 100644 --- a/tests/integration/targets/ipify_facts/tasks/main.yml +++ b/tests/integration/targets/ipify_facts/tasks/main.yml @@ -1,26 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### # Test code for the ipify_facts -# (c) 2017, Abhijeet Kasurde - -# 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) 2017, Abhijeet Kasurde +# 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 - debug: var=ansible_distribution - debug: var=ansible_distribution_version diff --git a/tests/integration/targets/ipify_facts/vars/main.yml b/tests/integration/targets/ipify_facts/vars/main.yml index 1ccaab4669..3a47dfea82 100644 --- a/tests/integration/targets/ipify_facts/vars/main.yml +++ b/tests/integration/targets/ipify_facts/vars/main.yml @@ -1,2 +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 + validate_certs: true diff --git a/tests/integration/targets/iptables_state/aliases b/tests/integration/targets/iptables_state/aliases index 3cac4af522..9f4768782b 100644 --- a/tests/integration/targets/iptables_state/aliases +++ b/tests/integration/targets/iptables_state/aliases @@ -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 + destructive shippable/posix/group1 skip/docker # kernel modules not loadable diff --git a/tests/integration/targets/iptables_state/meta/main.yml b/tests/integration/targets/iptables_state/meta/main.yml index 5438ced5c3..2fcd152f95 100644 --- a/tests/integration/targets/iptables_state/meta/main.yml +++ b/tests/integration/targets/iptables_state/meta/main.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 + dependencies: - setup_pkg_mgr diff --git a/tests/integration/targets/iptables_state/tasks/main.yml b/tests/integration/targets/iptables_state/tasks/main.yml index 5e9bf88ecd..8ed0b46d0e 100644 --- a/tests/integration/targets/iptables_state/tasks/main.yml +++ b/tests/integration/targets/iptables_state/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: ensure iptables package is installed package: name: diff --git a/tests/integration/targets/iptables_state/tasks/tests/00-basic.yml b/tests/integration/targets/iptables_state/tasks/tests/00-basic.yml index fcd259ec55..722f362da9 100644 --- a/tests/integration/targets/iptables_state/tasks/tests/00-basic.yml +++ b/tests/integration/targets/iptables_state/tasks/tests/00-basic.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: "ensure our next backup is not there (file)" file: path: "{{ iptables_saved }}" diff --git a/tests/integration/targets/iptables_state/tasks/tests/01-tables.yml b/tests/integration/targets/iptables_state/tasks/tests/01-tables.yml index e09a26a9d9..2f00e175b4 100644 --- a/tests/integration/targets/iptables_state/tasks/tests/01-tables.yml +++ b/tests/integration/targets/iptables_state/tasks/tests/01-tables.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: "ensure our next rule is not there (iptables)" iptables: table: nat diff --git a/tests/integration/targets/iptables_state/tasks/tests/10-rollback.yml b/tests/integration/targets/iptables_state/tasks/tests/10-rollback.yml index 1a9db2900b..af49482114 100644 --- a/tests/integration/targets/iptables_state/tasks/tests/10-rollback.yml +++ b/tests/integration/targets/iptables_state/tasks/tests/10-rollback.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: "create a blocking ruleset with a DROP policy" copy: dest: "{{ iptables_tests }}" diff --git a/tests/integration/targets/ipwcli_dns/aliases b/tests/integration/targets/ipwcli_dns/aliases index bd8385aced..b469f71b07 100644 --- a/tests/integration/targets/ipwcli_dns/aliases +++ b/tests/integration/targets/ipwcli_dns/aliases @@ -1,2 +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 + # There is no Ericsson IPWorks unsupported diff --git a/tests/integration/targets/ipwcli_dns/tasks/main.yml b/tests/integration/targets/ipwcli_dns/tasks/main.yml index 870f249e07..ca47b4dece 100644 --- a/tests/integration/targets/ipwcli_dns/tasks/main.yml +++ b/tests/integration/targets/ipwcli_dns/tasks/main.yml @@ -1,9 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### # Test code for ipwcli_dns +# 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: variables username, password, container, tld must be set fail: diff --git a/tests/integration/targets/iso_create/aliases b/tests/integration/targets/iso_create/aliases index 9d694de923..f6ee7272f0 100644 --- a/tests/integration/targets/iso_create/aliases +++ b/tests/integration/targets/iso_create/aliases @@ -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 + shippable/posix/group1 destructive skip/aix diff --git a/tests/integration/targets/iso_create/files/test1.cfg b/tests/integration/targets/iso_create/files/test1.cfg index 1c6d0d0d86..8cd712916a 100644 --- a/tests/integration/targets/iso_create/files/test1.cfg +++ b/tests/integration/targets/iso_create/files/test1.cfg @@ -1,4 +1,9 @@ #version=DEVEL + +# 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 + # System authorization information auth --enableshadow --passalgo=sha512 # Use CDROM installation media diff --git a/tests/integration/targets/iso_create/files/test_dir/test2.cfg b/tests/integration/targets/iso_create/files/test_dir/test2.cfg index 1c6d0d0d86..8cd712916a 100644 --- a/tests/integration/targets/iso_create/files/test_dir/test2.cfg +++ b/tests/integration/targets/iso_create/files/test_dir/test2.cfg @@ -1,4 +1,9 @@ #version=DEVEL + +# 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 + # System authorization information auth --enableshadow --passalgo=sha512 # Use CDROM installation media diff --git a/tests/integration/targets/iso_create/meta/main.yml b/tests/integration/targets/iso_create/meta/main.yml index 56bc554611..e7127a2d65 100644 --- a/tests/integration/targets/iso_create/meta/main.yml +++ b/tests/integration/targets/iso_create/meta/main.yml @@ -1,3 +1,9 @@ +--- +# 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 + dependencies: - setup_pkg_mgr - setup_remote_tmp_dir + - setup_remote_constraints diff --git a/tests/integration/targets/iso_create/tasks/main.yml b/tests/integration/targets/iso_create/tasks/main.yml index 0e21e01aef..4d321c2d23 100644 --- a/tests/integration/targets/iso_create/tasks/main.yml +++ b/tests/integration/targets/iso_create/tasks/main.yml @@ -4,12 +4,14 @@ #################################################################### # Test code for iso_create module -# Copyright: (c) 2020, Diane Wang (Tomorrow9) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2020, Diane Wang (Tomorrow9) +# 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: install pycdlib pip: name: pycdlib # state: latest + extra_args: "-c {{ remote_constraints }}" register: install_pycdlib - debug: var=install_pycdlib @@ -104,7 +106,7 @@ - iso_result is changed - iso_file.stat.exists == True -- name: Create iso file with Rock Ridge extention +- name: Create iso file with Rock Ridge extension iso_create: src_files: - "{{ remote_tmp_dir }}/test1.cfg" @@ -123,7 +125,7 @@ - iso_result is changed - iso_file.stat.exists == True -- name: Create iso file with Joliet extention +- name: Create iso file with Joliet extension iso_create: src_files: - "{{ remote_tmp_dir }}/test1.cfg" diff --git a/tests/integration/targets/iso_create/tasks/prepare_dest_dir.yml b/tests/integration/targets/iso_create/tasks/prepare_dest_dir.yml index 8320c3942e..d1f405b5f9 100644 --- a/tests/integration/targets/iso_create/tasks/prepare_dest_dir.yml +++ b/tests/integration/targets/iso_create/tasks/prepare_dest_dir.yml @@ -1,6 +1,7 @@ # Test code for iso_create module -# Copyright: (c) 2020, Diane Wang (Tomorrow9) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2020, Diane Wang (Tomorrow9) +# 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: Make sure our testing sub-directory does not exist file: path: '{{ output_test_dir }}' diff --git a/tests/integration/targets/iso_extract/aliases b/tests/integration/targets/iso_extract/aliases index 5de0229f66..b0d05577af 100644 --- a/tests/integration/targets/iso_extract/aliases +++ b/tests/integration/targets/iso_extract/aliases @@ -1,4 +1,10 @@ +# 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 + shippable/posix/group1 +needs/target/setup_epel destructive skip/aix skip/osx # FIXME +skip/rhel9.0 # FIXME diff --git a/tests/integration/targets/iso_extract/files/test.iso.license b/tests/integration/targets/iso_extract/files/test.iso.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/iso_extract/files/test.iso.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/tests/integration/targets/iso_extract/meta/main.yml b/tests/integration/targets/iso_extract/meta/main.yml index 07990bd4ef..ca1915e05c 100644 --- a/tests/integration/targets/iso_extract/meta/main.yml +++ b/tests/integration/targets/iso_extract/meta/main.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 + dependencies: - setup_pkg_mgr - - setup_epel - setup_remote_tmp_dir diff --git a/tests/integration/targets/iso_extract/tasks/7zip.yml b/tests/integration/targets/iso_extract/tasks/7zip.yml index a6bf95ad84..3d3c12250a 100644 --- a/tests/integration/targets/iso_extract/tasks/7zip.yml +++ b/tests/integration/targets/iso_extract/tasks/7zip.yml @@ -1,21 +1,9 @@ +--- # Test code for the iso_extract module. -# (c) 2017, James Tanner -# (c) 2017, Dag Wieers - -# 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) 2017, James Tanner +# Copyright (c) 2017, 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 - name: Gather facts setup: diff --git a/tests/integration/targets/iso_extract/tasks/main.yml b/tests/integration/targets/iso_extract/tasks/main.yml index 18fd9b37a9..4a7097de8a 100644 --- a/tests/integration/targets/iso_extract/tasks/main.yml +++ b/tests/integration/targets/iso_extract/tasks/main.yml @@ -1,30 +1,25 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### # Test code for the iso_extract module. -# (c) 2017, James Tanner -# (c) 2017, Dag Wieers - -# 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) 2017, James Tanner +# Copyright (c) 2017, 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 - set_fact: output_test_dir: '{{ remote_tmp_dir }}/test_iso_extract' +- name: Install EPEL repository (RHEL only) + include_role: + name: setup_epel + when: + - ansible_distribution in ['RedHat', 'CentOS'] + - ansible_distribution_major_version is version('9', '<') + - name: Install 7zip import_tasks: 7zip.yml diff --git a/tests/integration/targets/iso_extract/tasks/prepare.yml b/tests/integration/targets/iso_extract/tasks/prepare.yml index 4e240caca6..57e10c0dbb 100644 --- a/tests/integration/targets/iso_extract/tasks/prepare.yml +++ b/tests/integration/targets/iso_extract/tasks/prepare.yml @@ -1,21 +1,9 @@ +--- # Test code for the iso_extract module. -# (c) 2017, James Tanner -# (c) 2017, Dag Wieers - -# 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) 2017, James Tanner +# Copyright (c) 2017, 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 - name: Make sure our testing sub-directory does not exist file: diff --git a/tests/integration/targets/iso_extract/tasks/tests.yml b/tests/integration/targets/iso_extract/tasks/tests.yml index 1475027adf..6919a7c2e3 100644 --- a/tests/integration/targets/iso_extract/tasks/tests.yml +++ b/tests/integration/targets/iso_extract/tasks/tests.yml @@ -1,21 +1,9 @@ +--- # Test code for the iso_extract module. -# (c) 2017, James Tanner -# (c) 2017, Dag Wieers - -# 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) 2017, James Tanner +# Copyright (c) 2017, 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 - name: Extract the iso iso_extract: diff --git a/tests/integration/targets/iso_extract/vars/Alpine.yml b/tests/integration/targets/iso_extract/vars/Alpine.yml index f9e7ca1a9a..bcb92f79bd 100644 --- a/tests/integration/targets/iso_extract/vars/Alpine.yml +++ b/tests/integration/targets/iso_extract/vars/Alpine.yml @@ -1 +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 + iso_extract_7zip_package: p7zip diff --git a/tests/integration/targets/iso_extract/vars/Archlinux.yml b/tests/integration/targets/iso_extract/vars/Archlinux.yml index f9e7ca1a9a..bcb92f79bd 100644 --- a/tests/integration/targets/iso_extract/vars/Archlinux.yml +++ b/tests/integration/targets/iso_extract/vars/Archlinux.yml @@ -1 +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 + iso_extract_7zip_package: p7zip diff --git a/tests/integration/targets/iso_extract/vars/Debian.yml b/tests/integration/targets/iso_extract/vars/Debian.yml index 219c495764..09436ceb05 100644 --- a/tests/integration/targets/iso_extract/vars/Debian.yml +++ b/tests/integration/targets/iso_extract/vars/Debian.yml @@ -1 +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 + iso_extract_7zip_package: p7zip-full diff --git a/tests/integration/targets/iso_extract/vars/FreeBSD.yml b/tests/integration/targets/iso_extract/vars/FreeBSD.yml index f9e7ca1a9a..bcb92f79bd 100644 --- a/tests/integration/targets/iso_extract/vars/FreeBSD.yml +++ b/tests/integration/targets/iso_extract/vars/FreeBSD.yml @@ -1 +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 + iso_extract_7zip_package: p7zip diff --git a/tests/integration/targets/iso_extract/vars/RedHat.yml b/tests/integration/targets/iso_extract/vars/RedHat.yml index aa925a79e9..2bcdf4bfff 100644 --- a/tests/integration/targets/iso_extract/vars/RedHat.yml +++ b/tests/integration/targets/iso_extract/vars/RedHat.yml @@ -1 +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 + iso_extract_7zip_package: p7zip-plugins diff --git a/tests/integration/targets/iso_extract/vars/Suse.yml b/tests/integration/targets/iso_extract/vars/Suse.yml index e525c8ff10..1b695ce721 100644 --- a/tests/integration/targets/iso_extract/vars/Suse.yml +++ b/tests/integration/targets/iso_extract/vars/Suse.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 + # The 7z executable moved from p7zip to p7zip-full; # see https://build.opensuse.org/package/view_file/openSUSE:Leap:15.2/p7zip/p7zip.changes?expand=1 iso_extract_7zip_package: p7zip-full diff --git a/tests/integration/targets/iso_extract/vars/Ubuntu.yml b/tests/integration/targets/iso_extract/vars/Ubuntu.yml index 219c495764..09436ceb05 100644 --- a/tests/integration/targets/iso_extract/vars/Ubuntu.yml +++ b/tests/integration/targets/iso_extract/vars/Ubuntu.yml @@ -1 +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 + iso_extract_7zip_package: p7zip-full diff --git a/tests/integration/targets/iso_extract/vars/default.yml b/tests/integration/targets/iso_extract/vars/default.yml index e69de29bb2..f55df21f81 100644 --- a/tests/integration/targets/iso_extract/vars/default.yml +++ b/tests/integration/targets/iso_extract/vars/default.yml @@ -0,0 +1,4 @@ +--- +# 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 diff --git a/tests/integration/targets/java_cert/aliases b/tests/integration/targets/java_cert/aliases index 49222305a9..b9305b0928 100644 --- a/tests/integration/targets/java_cert/aliases +++ b/tests/integration/targets/java_cert/aliases @@ -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 + destructive shippable/posix/group3 skip/aix diff --git a/tests/integration/targets/java_cert/defaults/main.yml b/tests/integration/targets/java_cert/defaults/main.yml index b391eeff2d..ebac2789b3 100644 --- a/tests/integration/targets/java_cert/defaults/main.yml +++ b/tests/integration/targets/java_cert/defaults/main.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 + test_pkcs12_path: testpkcs.p12 test_keystore_path: keystore.jks test_keystore2_path: "{{ remote_tmp_dir }}/keystore2.jks" diff --git a/tests/integration/targets/java_cert/files/setupSSLServer.py b/tests/integration/targets/java_cert/files/setupSSLServer.py index 9227eefd81..4b0a421859 100644 --- a/tests/integration/targets/java_cert/files/setupSSLServer.py +++ b/tests/integration/targets/java_cert/files/setupSSLServer.py @@ -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 + from __future__ import (absolute_import, division, print_function) __metaclass__ = type import ssl diff --git a/tests/integration/targets/java_cert/files/testpkcs.p12.license b/tests/integration/targets/java_cert/files/testpkcs.p12.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/java_cert/files/testpkcs.p12.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/tests/integration/targets/java_cert/meta/main.yml b/tests/integration/targets/java_cert/meta/main.yml index 1d78393199..0371df88e5 100644 --- a/tests/integration/targets/java_cert/meta/main.yml +++ b/tests/integration/targets/java_cert/meta/main.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 + dependencies: - setup_java_keytool - setup_openssl diff --git a/tests/integration/targets/java_cert/tasks/main.yml b/tests/integration/targets/java_cert/tasks/main.yml index 2088e3bfda..54d205c255 100644 --- a/tests/integration/targets/java_cert/tasks/main.yml +++ b/tests/integration/targets/java_cert/tasks/main.yml @@ -3,6 +3,11 @@ # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### + +# 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 + - when: has_java_keytool block: diff --git a/tests/integration/targets/java_cert/tasks/state_change.yml b/tests/integration/targets/java_cert/tasks/state_change.yml index c0b92c8d2a..114c51ef58 100644 --- a/tests/integration/targets/java_cert/tasks/state_change.yml +++ b/tests/integration/targets/java_cert/tasks/state_change.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 + # # Prepare X509 and PKCS#12 materials # diff --git a/tests/integration/targets/java_keystore/aliases b/tests/integration/targets/java_keystore/aliases index 49222305a9..b9305b0928 100644 --- a/tests/integration/targets/java_keystore/aliases +++ b/tests/integration/targets/java_keystore/aliases @@ -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 + destructive shippable/posix/group3 skip/aix diff --git a/tests/integration/targets/java_keystore/defaults/main.yml b/tests/integration/targets/java_keystore/defaults/main.yml index 1fce6b4601..b51461462f 100644 --- a/tests/integration/targets/java_keystore/defaults/main.yml +++ b/tests/integration/targets/java_keystore/defaults/main.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 + java_keystore_certs: - name: cert commonName: example.com diff --git a/tests/integration/targets/java_keystore/meta/main.yml b/tests/integration/targets/java_keystore/meta/main.yml index 1d78393199..0371df88e5 100644 --- a/tests/integration/targets/java_keystore/meta/main.yml +++ b/tests/integration/targets/java_keystore/meta/main.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 + dependencies: - setup_java_keytool - setup_openssl diff --git a/tests/integration/targets/java_keystore/tasks/main.yml b/tests/integration/targets/java_keystore/tasks/main.yml index b5f1f01624..2a95cfe502 100644 --- a/tests/integration/targets/java_keystore/tasks/main.yml +++ b/tests/integration/targets/java_keystore/tasks/main.yml @@ -3,6 +3,11 @@ # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### + +# 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 + - when: has_java_keytool connection: local block: diff --git a/tests/integration/targets/java_keystore/tasks/prepare.yml b/tests/integration/targets/java_keystore/tasks/prepare.yml index 04b7cbd9d8..7c4c5c98d5 100644 --- a/tests/integration/targets/java_keystore/tasks/prepare.yml +++ b/tests/integration/targets/java_keystore/tasks/prepare.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: Create test directory ansible.builtin.file: path: "{{ remote_tmp_dir }}" diff --git a/tests/integration/targets/java_keystore/tasks/tests.yml b/tests/integration/targets/java_keystore/tasks/tests.yml index 07b30ad97d..a3d6ebf7d9 100644 --- a/tests/integration/targets/java_keystore/tasks/tests.yml +++ b/tests/integration/targets/java_keystore/tasks/tests.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: Create test directory ansible.builtin.file: path: "{{ remote_tmp_dir }}" diff --git a/tests/integration/targets/jboss/aliases b/tests/integration/targets/jboss/aliases index 506d60c877..23525810c4 100644 --- a/tests/integration/targets/jboss/aliases +++ b/tests/integration/targets/jboss/aliases @@ -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 + destructive shippable/posix/group1 skip/aix diff --git a/tests/integration/targets/jboss/meta/main.yml b/tests/integration/targets/jboss/meta/main.yml index 000178657d..c2bf37df74 100644 --- a/tests/integration/targets/jboss/meta/main.yml +++ b/tests/integration/targets/jboss/meta/main.yml @@ -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 + dependencies: - setup_wildfly_server diff --git a/tests/integration/targets/jboss/tasks/jboss.yml b/tests/integration/targets/jboss/tasks/jboss.yml index 9f9720a72f..13d0c6bc70 100644 --- a/tests/integration/targets/jboss/tasks/jboss.yml +++ b/tests/integration/targets/jboss/tasks/jboss.yml @@ -1,9 +1,11 @@ -# Copyright: (c) 2019, Andrew Klychkov (@Andersson007) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +--- +# Copyright (c) 2019, Andrew Klychkov (@Andersson007) +# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # Integration tests for jboss module. +# SPDX-License-Identifier: GPL-3.0-or-later -# helloworld.war (got from https://github.com/aeimer/java-example-helloworld-war/) license: -# MIT License +# helloworld.war (got from https://github.com/aeimer/java-example-helloworld-war/) is licensed +# under the MIT license: # # Copyright (c) 2017 Alex Eimer # diff --git a/tests/integration/targets/jboss/tasks/main.yml b/tests/integration/targets/jboss/tasks/main.yml index fb3860bf6f..891c802d7d 100644 --- a/tests/integration/targets/jboss/tasks/main.yml +++ b/tests/integration/targets/jboss/tasks/main.yml @@ -1,6 +1,11 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + - import_tasks: jboss.yml diff --git a/tests/integration/targets/jira/aliases b/tests/integration/targets/jira/aliases index c368f6e800..a58c201a4c 100644 --- a/tests/integration/targets/jira/aliases +++ b/tests/integration/targets/jira/aliases @@ -1,2 +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 + unsupported shippable/posix/group3 diff --git a/tests/integration/targets/jira/tasks/main.yml b/tests/integration/targets/jira/tasks/main.yml index c1d24a275a..ffc03530dc 100644 --- a/tests/integration/targets/jira/tasks/main.yml +++ b/tests/integration/targets/jira/tasks/main.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: create test ticket community.general.jira: uri: "{{ uri }}" diff --git a/tests/integration/targets/jira/vars/main.yml b/tests/integration/targets/jira/vars/main.yml index f170cefcc9..781fde8caf 100644 --- a/tests/integration/targets/jira/vars/main.yml +++ b/tests/integration/targets/jira/vars/main.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 + uri: https://xxxx.atlassian.net/ user: xxx@xxxx.xxx pasw: supersecret diff --git a/tests/integration/targets/kernel_blacklist/aliases b/tests/integration/targets/kernel_blacklist/aliases index a6dafcf8cd..abc0d5476d 100644 --- a/tests/integration/targets/kernel_blacklist/aliases +++ b/tests/integration/targets/kernel_blacklist/aliases @@ -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 + shippable/posix/group1 diff --git a/tests/integration/targets/kernel_blacklist/files/blacklist b/tests/integration/targets/kernel_blacklist/files/blacklist index 4e815584eb..eeaf322460 100644 --- a/tests/integration/targets/kernel_blacklist/files/blacklist +++ b/tests/integration/targets/kernel_blacklist/files/blacklist @@ -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 + blacklist aaaa blacklist bbbb -blacklist cccc \ No newline at end of file +blacklist cccc diff --git a/tests/integration/targets/kernel_blacklist/meta/main.yml b/tests/integration/targets/kernel_blacklist/meta/main.yml index 1810d4bec9..982de6eb03 100644 --- a/tests/integration/targets/kernel_blacklist/meta/main.yml +++ b/tests/integration/targets/kernel_blacklist/meta/main.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 + dependencies: - setup_remote_tmp_dir diff --git a/tests/integration/targets/kernel_blacklist/tasks/main.yml b/tests/integration/targets/kernel_blacklist/tasks/main.yml index de3d5d8edd..e169d5479e 100644 --- a/tests/integration/targets/kernel_blacklist/tasks/main.yml +++ b/tests/integration/targets/kernel_blacklist/tasks/main.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: set destination filename set_fact: bl_file: '{{ remote_tmp_dir }}/blacklist-ansible.conf' @@ -40,7 +44,16 @@ - orig_stat.stat.size == stat_test_1.stat.size - orig_stat.stat.checksum == stat_test_1.stat.checksum - orig_stat.stat.mtime == stat_test_1.stat.mtime - - stat_test_1.stat.checksum == 'blacklist aaaa\nblacklist bbbb\nblacklist cccc'|checksum + - stat_test_1.stat.checksum == expected_content | checksum + vars: + expected_content: | + # 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 + + blacklist aaaa + blacklist bbbb + blacklist cccc - name: add new item to list community.general.kernel_blacklist: @@ -61,6 +74,10 @@ - slurp_test_2.content|b64decode == content vars: content: | + # 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 + blacklist aaaa blacklist bbbb blacklist cccc @@ -85,6 +102,10 @@ - slurp_test_3.content|b64decode == content vars: content: | + # 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 + blacklist aaaa blacklist cccc blacklist dddd diff --git a/tests/integration/targets/keycloak_client/README.md b/tests/integration/targets/keycloak_client/README.md index 06c2a4b414..d8bcc08ecc 100644 --- a/tests/integration/targets/keycloak_client/README.md +++ b/tests/integration/targets/keycloak_client/README.md @@ -1,3 +1,9 @@ + + The integration test can be performed as follows: ``` diff --git a/tests/integration/targets/keycloak_client/docker-compose.yml b/tests/integration/targets/keycloak_client/docker-compose.yml index d14a331e48..5e14e9aac1 100644 --- a/tests/integration/targets/keycloak_client/docker-compose.yml +++ b/tests/integration/targets/keycloak_client/docker-compose.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 + version: '3.4' services: diff --git a/tests/integration/targets/keycloak_client/tasks/main.yml b/tests/integration/targets/keycloak_client/tasks/main.yml index 322fc3e2f4..933f00bd15 100644 --- a/tests/integration/targets/keycloak_client/tasks/main.yml +++ b/tests/integration/targets/keycloak_client/tasks/main.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: Delete realm community.general.keycloak_realm: "{{ auth_args | combine(call_args) }}" vars: diff --git a/tests/integration/targets/keycloak_client/vars/main.yml b/tests/integration/targets/keycloak_client/vars/main.yml index 0b1555e4bb..53ba35fcad 100644 --- a/tests/integration/targets/keycloak_client/vars/main.yml +++ b/tests/integration/targets/keycloak_client/vars/main.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 + url: http://localhost:8080/auth admin_realm: master admin_user: admin diff --git a/tests/integration/targets/keycloak_identity_provider/aliases b/tests/integration/targets/keycloak_identity_provider/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/keycloak_identity_provider/aliases +++ b/tests/integration/targets/keycloak_identity_provider/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/keycloak_identity_provider/tasks/main.yml b/tests/integration/targets/keycloak_identity_provider/tasks/main.yml index 5bc0bc3fa0..79ba330494 100644 --- a/tests/integration/targets/keycloak_identity_provider/tasks/main.yml +++ b/tests/integration/targets/keycloak_identity_provider/tasks/main.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: Create realm community.general.keycloak_realm: auth_keycloak_url: "{{ url }}" diff --git a/tests/integration/targets/keycloak_identity_provider/vars/main.yml b/tests/integration/targets/keycloak_identity_provider/vars/main.yml index bd37149b31..6d2078ca0e 100644 --- a/tests/integration/targets/keycloak_identity_provider/vars/main.yml +++ b/tests/integration/targets/keycloak_identity_provider/vars/main.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 + url: http://localhost:8080/auth admin_realm: master admin_user: admin diff --git a/tests/integration/targets/keycloak_role/aliases b/tests/integration/targets/keycloak_role/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/keycloak_role/aliases +++ b/tests/integration/targets/keycloak_role/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/keycloak_role/tasks/main.yml b/tests/integration/targets/keycloak_role/tasks/main.yml index 683cfc8677..61b62629a4 100644 --- a/tests/integration/targets/keycloak_role/tasks/main.yml +++ b/tests/integration/targets/keycloak_role/tasks/main.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: Create realm community.general.keycloak_realm: auth_keycloak_url: "{{ url }}" diff --git a/tests/integration/targets/keycloak_role/vars/main.yml b/tests/integration/targets/keycloak_role/vars/main.yml index 0a725dc4a6..b003311e0f 100644 --- a/tests/integration/targets/keycloak_role/vars/main.yml +++ b/tests/integration/targets/keycloak_role/vars/main.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 + url: http://localhost:8080/auth admin_realm: master admin_user: admin diff --git a/tests/integration/targets/keycloak_user_federation/aliases b/tests/integration/targets/keycloak_user_federation/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/keycloak_user_federation/aliases +++ b/tests/integration/targets/keycloak_user_federation/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/keycloak_user_federation/tasks/main.yml b/tests/integration/targets/keycloak_user_federation/tasks/main.yml index bc81fcdec3..79e21dae03 100644 --- a/tests/integration/targets/keycloak_user_federation/tasks/main.yml +++ b/tests/integration/targets/keycloak_user_federation/tasks/main.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: Create realm community.general.keycloak_realm: auth_keycloak_url: "{{ url }}" diff --git a/tests/integration/targets/keycloak_user_federation/vars/main.yml b/tests/integration/targets/keycloak_user_federation/vars/main.yml index 2a31f9efcd..acf73e2cad 100644 --- a/tests/integration/targets/keycloak_user_federation/vars/main.yml +++ b/tests/integration/targets/keycloak_user_federation/vars/main.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 + url: http://localhost:8080/auth admin_realm: master admin_user: admin diff --git a/tests/integration/targets/keyring/aliases b/tests/integration/targets/keyring/aliases new file mode 100644 index 0000000000..bd1f024441 --- /dev/null +++ b/tests/integration/targets/keyring/aliases @@ -0,0 +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 + +unsupported diff --git a/tests/integration/targets/keyring/tasks/main.yml b/tests/integration/targets/keyring/tasks/main.yml new file mode 100644 index 0000000000..3833018e80 --- /dev/null +++ b/tests/integration/targets/keyring/tasks/main.yml @@ -0,0 +1,99 @@ +--- +# 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: Ensure required packages for headless keyring access are installed (RPM) + ansible.builtin.package: + name: gnome-keyring + become: true + when: "'localhost' not in inventory_hostname" + +- name: Ensure keyring is installed (RPM) + ansible.builtin.dnf: + name: python3-keyring + state: present + become: true + when: ansible_facts['os_family'] == 'RedHat' + +- name: Ensure keyring is installed (pip) + ansible.builtin.pip: + name: keyring + state: present + become: true + when: ansible_facts['os_family'] != 'RedHat' + +# Set password for new account +# Expected result: success +- name: Set password for test/test1 + community.general.keyring: + service: test + username: test1 + user_password: "{{ user_password }}" + keyring_password: "{{ keyring_password }}" + register: set_password + +- name: Assert that the password has been set + ansible.builtin.assert: + that: + - set_password.msg == "Passphrase has been updated for test@test1" + +# Print out password to confirm it has been set +# Expected result: success +- name: Retrieve password for test/test1 + community.general.keyring_info: + service: test + username: test1 + keyring_password: "{{ keyring_password }}" + register: test_set_password + +- name: Assert that the password exists + ansible.builtin.assert: + that: + - test_set_password.passphrase == user_password + +# Attempt to set password again +# Expected result: success - nothing should happen +- name: Attempt to re-set password for test/test1 + community.general.keyring: + service: test + username: test1 + user_password: "{{ user_password }}" + keyring_password: "{{ keyring_password }}" + register: second_set_password + +- name: Assert that the password has not been changed + ansible.builtin.assert: + that: + - second_set_password.msg == "Passphrase already set for test@test1" + +# Delete account +# Expected result: success +- name: Delete password for test/test1 + community.general.keyring: + service: test + username: test1 + user_password: "{{ user_password }}" + keyring_password: "{{ keyring_password }}" + state: absent + register: del_password + +- name: Assert that the password has been deleted + ansible.builtin.assert: + that: + - del_password.msg == "Passphrase has been removed for test@test1" + +# Attempt to get deleted account (to confirm it has been deleted). +# Don't use `no_log` as run completes due to failed task. +# Expected result: fail +- name: Retrieve password for test/test1 + community.general.keyring_info: + service: test + username: test1 + keyring_password: "{{ keyring_password }}" + register: test_del_password + +- name: Assert that the password no longer exists + ansible.builtin.assert: + that: + - test_del_password.passphrase is not defined diff --git a/tests/integration/targets/keyring/vars/main.yml b/tests/integration/targets/keyring/vars/main.yml new file mode 100644 index 0000000000..b4997b6d36 --- /dev/null +++ b/tests/integration/targets/keyring/vars/main.yml @@ -0,0 +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 + +keyring_password: Password123 +user_password: Test123 diff --git a/tests/integration/targets/launchd/aliases b/tests/integration/targets/launchd/aliases index a377870962..4507815d09 100644 --- a/tests/integration/targets/launchd/aliases +++ b/tests/integration/targets/launchd/aliases @@ -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 + shippable/posix/group1 skip/freebsd skip/rhel diff --git a/tests/integration/targets/launchd/files/ansible_test_service.py b/tests/integration/targets/launchd/files/ansible_test_service.py index 87a23fc47d..31de6c586b 100644 --- a/tests/integration/targets/launchd/files/ansible_test_service.py +++ b/tests/integration/targets/launchd/files/ansible_test_service.py @@ -1,4 +1,7 @@ #!/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 from __future__ import absolute_import, division, print_function __metaclass__ = type diff --git a/tests/integration/targets/launchd/tasks/main.yml b/tests/integration/targets/launchd/tasks/main.yml index d014f224b0..8f5b14a596 100644 --- a/tests/integration/targets/launchd/tasks/main.yml +++ b/tests/integration/targets/launchd/tasks/main.yml @@ -4,6 +4,9 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Test launchd module block: diff --git a/tests/integration/targets/launchd/tasks/setup.yml b/tests/integration/targets/launchd/tasks/setup.yml index 1ec57bf659..1df9667bf9 100644 --- a/tests/integration/targets/launchd/tasks/setup.yml +++ b/tests/integration/targets/launchd/tasks/setup.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 - name: "[{{ item }}] Deploy test service configuration" template: diff --git a/tests/integration/targets/launchd/tasks/teardown.yml b/tests/integration/targets/launchd/tasks/teardown.yml index 50b0a36a7b..e781757050 100644 --- a/tests/integration/targets/launchd/tasks/teardown.yml +++ b/tests/integration/targets/launchd/tasks/teardown.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 - name: "[{{ item }}] Unload service" launchd: diff --git a/tests/integration/targets/launchd/tasks/test.yml b/tests/integration/targets/launchd/tasks/test.yml index 211b051d7d..25a7bba009 100644 --- a/tests/integration/targets/launchd/tasks/test.yml +++ b/tests/integration/targets/launchd/tasks/test.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 - name: "Running {{ item }}" block: diff --git a/tests/integration/targets/launchd/tasks/tests/test_reload.yml b/tests/integration/targets/launchd/tasks/tests/test_reload.yml index fe2682abda..df2c1be9fa 100644 --- a/tests/integration/targets/launchd/tasks/tests/test_reload.yml +++ b/tests/integration/targets/launchd/tasks/tests/test_reload.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 # ----------------------------------------------------------- diff --git a/tests/integration/targets/launchd/tasks/tests/test_restart.yml b/tests/integration/targets/launchd/tasks/tests/test_restart.yml index 976775678d..08ef62d919 100644 --- a/tests/integration/targets/launchd/tasks/tests/test_restart.yml +++ b/tests/integration/targets/launchd/tasks/tests/test_restart.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 # ----------------------------------------------------------- diff --git a/tests/integration/targets/launchd/tasks/tests/test_runatload.yml b/tests/integration/targets/launchd/tasks/tests/test_runatload.yml index 08f21efce7..03059fc884 100644 --- a/tests/integration/targets/launchd/tasks/tests/test_runatload.yml +++ b/tests/integration/targets/launchd/tasks/tests/test_runatload.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: "[{{ item }}] Given a started service with RunAtLoad set to true..." diff --git a/tests/integration/targets/launchd/tasks/tests/test_start_stop.yml b/tests/integration/targets/launchd/tasks/tests/test_start_stop.yml index b3cc380e85..2a78f89c12 100644 --- a/tests/integration/targets/launchd/tasks/tests/test_start_stop.yml +++ b/tests/integration/targets/launchd/tasks/tests/test_start_stop.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 # ----------------------------------------------------------- diff --git a/tests/integration/targets/launchd/tasks/tests/test_unknown.yml b/tests/integration/targets/launchd/tasks/tests/test_unknown.yml index e005d87ee1..d18ea54535 100644 --- a/tests/integration/targets/launchd/tasks/tests/test_unknown.yml +++ b/tests/integration/targets/launchd/tasks/tests/test_unknown.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 # ----------------------------------------------------------- diff --git a/tests/integration/targets/launchd/tasks/tests/test_unload.yml b/tests/integration/targets/launchd/tasks/tests/test_unload.yml index b51a87fb3a..aee9d8b5ee 100644 --- a/tests/integration/targets/launchd/tasks/tests/test_unload.yml +++ b/tests/integration/targets/launchd/tasks/tests/test_unload.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 # ----------------------------------------------------------- diff --git a/tests/integration/targets/launchd/templates/launchd.test.service.plist.j2 b/tests/integration/targets/launchd/templates/launchd.test.service.plist.j2 index 27affa3b39..43f43c24fd 100644 --- a/tests/integration/targets/launchd/templates/launchd.test.service.plist.j2 +++ b/tests/integration/targets/launchd/templates/launchd.test.service.plist.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 +#} diff --git a/tests/integration/targets/launchd/templates/modified.launchd.test.service.plist.j2 b/tests/integration/targets/launchd/templates/modified.launchd.test.service.plist.j2 index ac25cab0d7..a41b655628 100644 --- a/tests/integration/targets/launchd/templates/modified.launchd.test.service.plist.j2 +++ b/tests/integration/targets/launchd/templates/modified.launchd.test.service.plist.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 +#} diff --git a/tests/integration/targets/launchd/vars/main.yml b/tests/integration/targets/launchd/vars/main.yml index 2d58be16ed..ce880ed9de 100644 --- a/tests/integration/targets/launchd/vars/main.yml +++ b/tests/integration/targets/launchd/vars/main.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 launchd_service_name: launchd.test.service launchd_plist_location: /Library/LaunchDaemons/{{ launchd_service_name }}.plist diff --git a/tests/integration/targets/ldap_search/aliases b/tests/integration/targets/ldap_search/aliases index 589aeadc72..76ff20c90e 100644 --- a/tests/integration/targets/ldap_search/aliases +++ b/tests/integration/targets/ldap_search/aliases @@ -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 + shippable/posix/group1 skip/aix skip/freebsd diff --git a/tests/integration/targets/ldap_search/meta/main.yml b/tests/integration/targets/ldap_search/meta/main.yml index 093fafe4a2..d282aa0dc8 100644 --- a/tests/integration/targets/ldap_search/meta/main.yml +++ b/tests/integration/targets/ldap_search/meta/main.yml @@ -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 + dependencies: - setup_openldap diff --git a/tests/integration/targets/ldap_search/tasks/main.yml b/tests/integration/targets/ldap_search/tasks/main.yml index f4a51013a8..521075b5e1 100644 --- a/tests/integration/targets/ldap_search/tasks/main.yml +++ b/tests/integration/targets/ldap_search/tasks/main.yml @@ -1,11 +1,16 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Run LDAP search module tests block: - include_tasks: "{{ item }}" with_fileglob: - 'tests/*.yml' - when: ansible_os_family in ['Ubuntu', 'Debian'] \ No newline at end of file + when: ansible_os_family in ['Ubuntu', 'Debian'] diff --git a/tests/integration/targets/ldap_search/tasks/run-test.yml b/tests/integration/targets/ldap_search/tasks/run-test.yml deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/integration/targets/ldap_search/tasks/tests/basic.yml b/tests/integration/targets/ldap_search/tasks/tests/basic.yml index 824be4aa78..ab6c745277 100644 --- a/tests/integration/targets/ldap_search/tasks/tests/basic.yml +++ b/tests/integration/targets/ldap_search/tasks/tests/basic.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 + - debug: msg: Running tests/basic.yml diff --git a/tests/integration/targets/listen_ports_facts/aliases b/tests/integration/targets/listen_ports_facts/aliases index c72768af29..5e86d2a3f4 100644 --- a/tests/integration/targets/listen_ports_facts/aliases +++ b/tests/integration/targets/listen_ports_facts/aliases @@ -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 + shippable/posix/group3 destructive skip/aix diff --git a/tests/integration/targets/listen_ports_facts/meta/main.yml b/tests/integration/targets/listen_ports_facts/meta/main.yml index b63c3d017c..2fcd152f95 100644 --- a/tests/integration/targets/listen_ports_facts/meta/main.yml +++ b/tests/integration/targets/listen_ports_facts/meta/main.yml @@ -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 + dependencies: - setup_pkg_mgr diff --git a/tests/integration/targets/listen_ports_facts/tasks/main.yml b/tests/integration/targets/listen_ports_facts/tasks/main.yml index a6915504c9..70649f5056 100644 --- a/tests/integration/targets/listen_ports_facts/tasks/main.yml +++ b/tests/integration/targets/listen_ports_facts/tasks/main.yml @@ -4,9 +4,10 @@ #################################################################### # Test playbook for the listen_ports_facts module -# Copyright: (c) 2019, Nathan Davison +# Copyright (c) 2019, Nathan Davison -# 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 - name: install netstat and netcat on deb ansible.builtin.package: @@ -58,14 +59,23 @@ listen_ports_facts: when: ansible_os_family == "RedHat" or ansible_os_family == "Debian" -- name: Gather listening ports facts explicitly via netstat +- name: check that the include_non_listening parameters ('state' and 'foreign_address') are not active in default setting + assert: + that: + - ansible_facts.tcp_listen | selectattr('state', 'defined') | list | length == 0 + - ansible_facts.tcp_listen | selectattr('foreign_address', 'defined') | list | length == 0 + when: ansible_os_family == "RedHat" or ansible_os_family == "Debian" + +- name: Gather listening ports facts explicitly via netstat and include_non_listening listen_ports_facts: command: 'netstat' + include_non_listening: 'yes' when: (ansible_os_family == "RedHat" and ansible_distribution_major_version|int < 7) or ansible_os_family == "Debian" -- name: Gather listening ports facts explicitly via ss +- name: Gather listening ports facts explicitly via ss and include_non_listening listen_ports_facts: command: 'ss' + include_non_listening: 'yes' when: ansible_os_family == "RedHat" and ansible_distribution_major_version|int >= 7 - name: check for ansible_facts.udp_listen exists @@ -78,6 +88,13 @@ that: ansible_facts.tcp_listen is defined when: ansible_os_family == "RedHat" or ansible_os_family == "Debian" +- name: check that the include_non_listening parameter 'state' and 'foreign_address' exists + assert: + that: + - ansible_facts.tcp_listen | selectattr('state', 'defined') | list | length > 0 + - ansible_facts.tcp_listen | selectattr('foreign_address', 'defined') | list | length > 0 + when: ansible_os_family == "RedHat" or ansible_os_family == "Debian" + - name: check TCP 5556 is in listening ports assert: that: 5556 in ansible_facts.tcp_listen | map(attribute='port') | sort | list diff --git a/tests/integration/targets/locale_gen/aliases b/tests/integration/targets/locale_gen/aliases index be6db963e7..5cbd0a392b 100644 --- a/tests/integration/targets/locale_gen/aliases +++ b/tests/integration/targets/locale_gen/aliases @@ -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 + destructive needs/root shippable/posix/group3 diff --git a/tests/integration/targets/locale_gen/tasks/locale_gen.yml b/tests/integration/targets/locale_gen/tasks/locale_gen.yml index ae316977f5..ea042796f7 100644 --- a/tests/integration/targets/locale_gen/tasks/locale_gen.yml +++ b/tests/integration/targets/locale_gen/tasks/locale_gen.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: Is the locale we're going to test against installed? shell: locale -a | grep pt_BR register: initial_state diff --git a/tests/integration/targets/locale_gen/tasks/main.yml b/tests/integration/targets/locale_gen/tasks/main.yml index 7ceb35fd49..1616f8fc32 100644 --- a/tests/integration/targets/locale_gen/tasks/main.yml +++ b/tests/integration/targets/locale_gen/tasks/main.yml @@ -1,24 +1,12 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### -# (c) 2014, James Tanner - -# 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) 2014, James Tanner +# 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 - include: 'locale_gen.yml' when: ansible_distribution in ('Ubuntu', 'Debian') diff --git a/tests/integration/targets/lookup_cartesian/aliases b/tests/integration/targets/lookup_cartesian/aliases index 07b8702010..1ad3384c7e 100644 --- a/tests/integration/targets/lookup_cartesian/aliases +++ b/tests/integration/targets/lookup_cartesian/aliases @@ -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 + shippable/posix/group1 skip/aix skip/python2.6 # lookups are controller only, and we no longer support Python 2.6 on the controller diff --git a/tests/integration/targets/lookup_cartesian/tasks/main.yml b/tests/integration/targets/lookup_cartesian/tasks/main.yml index 6e563e0cff..5575f22ba6 100644 --- a/tests/integration/targets/lookup_cartesian/tasks/main.yml +++ b/tests/integration/targets/lookup_cartesian/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Test cartesian lookup debug: var=item register: product diff --git a/tests/integration/targets/lookup_collection_version/aliases b/tests/integration/targets/lookup_collection_version/aliases index b59832142f..7a0fc5c1ea 100644 --- a/tests/integration/targets/lookup_collection_version/aliases +++ b/tests/integration/targets/lookup_collection_version/aliases @@ -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 + shippable/posix/group3 diff --git a/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll/galaxy.yml b/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll/galaxy.yml index f66a8af4c9..2243e0dba8 100644 --- a/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll/galaxy.yml +++ b/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll/galaxy.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 + namespace: testns name: testcoll version: 0.0.1 diff --git a/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll/plugins/modules/collection_module.py b/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll/plugins/modules/collection_module.py index 8db51c39a7..e7f1a987a4 100644 --- a/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll/plugins/modules/collection_module.py +++ b/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll/plugins/modules/collection_module.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (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/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_mf/FILES.json b/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_mf/FILES.json index 99eb4c0bfb..57bc66cc21 100644 --- a/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_mf/FILES.json +++ b/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_mf/FILES.json @@ -37,4 +37,4 @@ } ], "format": 1 -} \ No newline at end of file +} diff --git a/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_mf/FILES.json.license b/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_mf/FILES.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_mf/FILES.json.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/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_mf/MANIFEST.json b/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_mf/MANIFEST.json index f1d009a73f..e4a9e7d8f2 100644 --- a/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_mf/MANIFEST.json +++ b/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_mf/MANIFEST.json @@ -27,4 +27,4 @@ "format": 1 }, "format": 1 -} \ No newline at end of file +} diff --git a/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_mf/MANIFEST.json.license b/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_mf/MANIFEST.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_mf/MANIFEST.json.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/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_mf/plugins/modules/collection_module.py b/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_mf/plugins/modules/collection_module.py index 8db51c39a7..e7f1a987a4 100644 --- a/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_mf/plugins/modules/collection_module.py +++ b/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_mf/plugins/modules/collection_module.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (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/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_nothing/plugins/modules/collection_module.py b/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_nothing/plugins/modules/collection_module.py index 8db51c39a7..e7f1a987a4 100644 --- a/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_nothing/plugins/modules/collection_module.py +++ b/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_nothing/plugins/modules/collection_module.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (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/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_nv/galaxy.yml b/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_nv/galaxy.yml index 599a47e649..96aae3d644 100644 --- a/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_nv/galaxy.yml +++ b/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_nv/galaxy.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 + namespace: testns name: testcoll_nv authors: diff --git a/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_nv/plugins/modules/collection_module.py b/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_nv/plugins/modules/collection_module.py index 8db51c39a7..e7f1a987a4 100644 --- a/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_nv/plugins/modules/collection_module.py +++ b/tests/integration/targets/lookup_collection_version/collections/ansible_collections/testns/testcoll_nv/plugins/modules/collection_module.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (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/tests/integration/targets/lookup_collection_version/library/local_module.py b/tests/integration/targets/lookup_collection_version/library/local_module.py index 424c127ced..9e9e649cb4 100644 --- a/tests/integration/targets/lookup_collection_version/library/local_module.py +++ b/tests/integration/targets/lookup_collection_version/library/local_module.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (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/tests/integration/targets/lookup_collection_version/runme.sh b/tests/integration/targets/lookup_collection_version/runme.sh index a0a78be131..118abbc296 100755 --- a/tests/integration/targets/lookup_collection_version/runme.sh +++ b/tests/integration/targets/lookup_collection_version/runme.sh @@ -1,4 +1,7 @@ #!/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 set -eux diff --git a/tests/integration/targets/lookup_collection_version/runme.yml b/tests/integration/targets/lookup_collection_version/runme.yml index aed52bee2d..54c58614fa 100644 --- a/tests/integration/targets/lookup_collection_version/runme.yml +++ b/tests/integration/targets/lookup_collection_version/runme.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 + - hosts: localhost tasks: - name: Test collection_version diff --git a/tests/integration/targets/lookup_dependent/aliases b/tests/integration/targets/lookup_dependent/aliases index 45489be80c..fcbe73470c 100644 --- a/tests/integration/targets/lookup_dependent/aliases +++ b/tests/integration/targets/lookup_dependent/aliases @@ -1,2 +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 + shippable/posix/group2 skip/python2.6 # lookups are controller only, and we no longer support Python 2.6 on the controller diff --git a/tests/integration/targets/lookup_dependent/tasks/main.yml b/tests/integration/targets/lookup_dependent/tasks/main.yml index 0f1b8d34fb..b2f2097294 100644 --- a/tests/integration/targets/lookup_dependent/tasks/main.yml +++ b/tests/integration/targets/lookup_dependent/tasks/main.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: Test 1 set_fact: loop_result: >- @@ -132,7 +136,7 @@ assert: that: - eval_error is failed - - eval_error.msg.startswith("Caught \"'foo' is undefined\" while evaluating ") + - eval_error.msg.startswith("Caught \"'foo' is undefined") - name: "Test 5: same variable name reused" debug: @@ -147,7 +151,7 @@ assert: that: - eval_error is failed - - eval_error.msg.startswith("Caught \"'x' is undefined\" while evaluating ") + - eval_error.msg.startswith("Caught \"'x' is undefined") - name: "Test 6: multi-value dict" debug: diff --git a/tests/integration/targets/lookup_dig/aliases b/tests/integration/targets/lookup_dig/aliases new file mode 100644 index 0000000000..1def1a1485 --- /dev/null +++ b/tests/integration/targets/lookup_dig/aliases @@ -0,0 +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 + +shippable/posix/group1 +skip/python2.6 # lookups are controller only, and we no longer support Python 2.6 on the controller diff --git a/tests/integration/targets/lookup_dig/meta/main.yml b/tests/integration/targets/lookup_dig/meta/main.yml new file mode 100644 index 0000000000..fe9e33681d --- /dev/null +++ b/tests/integration/targets/lookup_dig/meta/main.yml @@ -0,0 +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 + +dependencies: + - setup_remote_constraints diff --git a/tests/integration/targets/lookup_dig/tasks/main.yml b/tests/integration/targets/lookup_dig/tasks/main.yml new file mode 100644 index 0000000000..5c0ebeb761 --- /dev/null +++ b/tests/integration/targets/lookup_dig/tasks/main.yml @@ -0,0 +1,37 @@ +--- +#################################################################### +# WARNING: These are designed specifically for Ansible tests # +# and should not be used as examples of how to write Ansible roles # +#################################################################### + +# 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: Install dnspython library + pip: + name: dnspython + state: present + extra_args: "-c {{ remote_constraints }}" + +- name: Test dig lookup with existing domain + set_fact: + dig_existing: "{{ lookup('community.general.dig', 'github.com.') }}" + +- name: Test dig lookup with non-existing domain and fail_on_error=no + set_fact: + dig_nonexisting_fail_no: "{{ lookup('community.general.dig', 'non-existing.domain.', 'fail_on_error=no') }}" + +- name: Verify that NXDOMAIN was returned + assert: + that: dig_nonexisting_fail_no == 'NXDOMAIN' + +- name: Test dig lookup with non-existing domain and fail_on_error=yes + set_fact: + dig_nonexisting_fail_yes: "{{ lookup('community.general.dig', 'non-existing.domain.', 'fail_on_error=yes') }}" + ignore_errors: yes + register: dig_nonexisting_fail_yes_result + +- name: Verify that the task failed + assert: + that: dig_nonexisting_fail_yes_result is failed diff --git a/tests/integration/targets/lookup_etcd3/aliases b/tests/integration/targets/lookup_etcd3/aliases index 25a1594d76..9ec6614633 100644 --- a/tests/integration/targets/lookup_etcd3/aliases +++ b/tests/integration/targets/lookup_etcd3/aliases @@ -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 + shippable/posix/group1 destructive needs/file/tests/utils/constraints.txt diff --git a/tests/integration/targets/lookup_etcd3/defaults/main.yml b/tests/integration/targets/lookup_etcd3/defaults/main.yml index 331ec312e7..de726382ba 100644 --- a/tests/integration/targets/lookup_etcd3/defaults/main.yml +++ b/tests/integration/targets/lookup_etcd3/defaults/main.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 etcd3_prefix: '/keyprefix/' etcd3_singlekey: '/singlekeypath' diff --git a/tests/integration/targets/lookup_etcd3/dependencies.yml b/tests/integration/targets/lookup_etcd3/dependencies.yml index e42f33badb..ea012594d8 100644 --- a/tests/integration/targets/lookup_etcd3/dependencies.yml +++ b/tests/integration/targets/lookup_etcd3/dependencies.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 + - hosts: localhost tasks: - name: Setup etcd3 diff --git a/tests/integration/targets/lookup_etcd3/meta/main.yml b/tests/integration/targets/lookup_etcd3/meta/main.yml index 5438ced5c3..2fcd152f95 100644 --- a/tests/integration/targets/lookup_etcd3/meta/main.yml +++ b/tests/integration/targets/lookup_etcd3/meta/main.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 + dependencies: - setup_pkg_mgr diff --git a/tests/integration/targets/lookup_etcd3/runme.sh b/tests/integration/targets/lookup_etcd3/runme.sh index 962201ffb3..1b37ae4f35 100755 --- a/tests/integration/targets/lookup_etcd3/runme.sh +++ b/tests/integration/targets/lookup_etcd3/runme.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash -# 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 set -eux ANSIBLE_ROLES_PATH=../ \ diff --git a/tests/integration/targets/lookup_etcd3/tasks/main.yml b/tests/integration/targets/lookup_etcd3/tasks/main.yml index 3a0c149a45..47f1916c02 100644 --- a/tests/integration/targets/lookup_etcd3/tasks/main.yml +++ b/tests/integration/targets/lookup_etcd3/tasks/main.yml @@ -5,8 +5,9 @@ #################################################################### # lookup_etcd3 integration tests -# 2020, SCC France, Eric Belhomme -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 - name: put key/values with an etcd prefix etcd3: diff --git a/tests/integration/targets/lookup_etcd3/tasks/tests.yml b/tests/integration/targets/lookup_etcd3/tasks/tests.yml index a1090b4809..929c6f142a 100644 --- a/tests/integration/targets/lookup_etcd3/tasks/tests.yml +++ b/tests/integration/targets/lookup_etcd3/tasks/tests.yml @@ -1,7 +1,8 @@ --- # lookup_etcd3 integration tests -# 2020, SCC France, Eric Belhomme -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright 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 - block: - name: 'Fetch secrets using "etcd3" lookup' diff --git a/tests/integration/targets/lookup_etcd3/test_lookup_etcd3.yml b/tests/integration/targets/lookup_etcd3/test_lookup_etcd3.yml index 583f2a6a08..c18138888a 100644 --- a/tests/integration/targets/lookup_etcd3/test_lookup_etcd3.yml +++ b/tests/integration/targets/lookup_etcd3/test_lookup_etcd3.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 + - hosts: localhost tasks: - name: Test lookup etcd3 diff --git a/tests/integration/targets/lookup_flattened/aliases b/tests/integration/targets/lookup_flattened/aliases index bc987654d9..708d3bcd12 100644 --- a/tests/integration/targets/lookup_flattened/aliases +++ b/tests/integration/targets/lookup_flattened/aliases @@ -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 + shippable/posix/group2 skip/aix skip/python2.6 # lookups are controller only, and we no longer support Python 2.6 on the controller diff --git a/tests/integration/targets/lookup_flattened/tasks/main.yml b/tests/integration/targets/lookup_flattened/tasks/main.yml index 7d69c6dfe4..37af1327bf 100644 --- a/tests/integration/targets/lookup_flattened/tasks/main.yml +++ b/tests/integration/targets/lookup_flattened/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: test with_flattened set_fact: '{{ item }}=flattened' with_community.general.flattened: diff --git a/tests/integration/targets/lookup_lmdb_kv/aliases b/tests/integration/targets/lookup_lmdb_kv/aliases index 08496766ce..7c50594f42 100644 --- a/tests/integration/targets/lookup_lmdb_kv/aliases +++ b/tests/integration/targets/lookup_lmdb_kv/aliases @@ -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 + shippable/posix/group2 destructive skip/aix diff --git a/tests/integration/targets/lookup_lmdb_kv/dependencies.yml b/tests/integration/targets/lookup_lmdb_kv/dependencies.yml index 17622d961e..9fc63b19fa 100644 --- a/tests/integration/targets/lookup_lmdb_kv/dependencies.yml +++ b/tests/integration/targets/lookup_lmdb_kv/dependencies.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 + - hosts: localhost tasks: - name: Install LMDB Python package diff --git a/tests/integration/targets/lookup_lmdb_kv/runme.sh b/tests/integration/targets/lookup_lmdb_kv/runme.sh index afdff7bb9d..71faa439d1 100755 --- a/tests/integration/targets/lookup_lmdb_kv/runme.sh +++ b/tests/integration/targets/lookup_lmdb_kv/runme.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash -# 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 set -eux ANSIBLE_ROLES_PATH=../ \ diff --git a/tests/integration/targets/lookup_lmdb_kv/test.yml b/tests/integration/targets/lookup_lmdb_kv/test.yml index 1fa0b6150f..3c39d4e251 100644 --- a/tests/integration/targets/lookup_lmdb_kv/test.yml +++ b/tests/integration/targets/lookup_lmdb_kv/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 + - hosts: localhost tasks: - debug: diff --git a/tests/integration/targets/lookup_lmdb_kv/test_db.py b/tests/integration/targets/lookup_lmdb_kv/test_db.py index f251b7f4a5..b906c4c397 100644 --- a/tests/integration/targets/lookup_lmdb_kv/test_db.py +++ b/tests/integration/targets/lookup_lmdb_kv/test_db.py @@ -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 + from __future__ import (absolute_import, division, print_function) __metaclass__ = type import lmdb diff --git a/tests/integration/targets/lookup_passwordstore/aliases b/tests/integration/targets/lookup_passwordstore/aliases index 7cc72b73d4..c9fb7e80db 100644 --- a/tests/integration/targets/lookup_passwordstore/aliases +++ b/tests/integration/targets/lookup_passwordstore/aliases @@ -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 + shippable/posix/group1 destructive skip/aix diff --git a/tests/integration/targets/lookup_passwordstore/meta/main.yml b/tests/integration/targets/lookup_passwordstore/meta/main.yml index 5438ced5c3..2fcd152f95 100644 --- a/tests/integration/targets/lookup_passwordstore/meta/main.yml +++ b/tests/integration/targets/lookup_passwordstore/meta/main.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 + dependencies: - setup_pkg_mgr diff --git a/tests/integration/targets/lookup_passwordstore/tasks/main.yml b/tests/integration/targets/lookup_passwordstore/tasks/main.yml index 882b4a35ae..c0b5eb5bdb 100644 --- a/tests/integration/targets/lookup_passwordstore/tasks/main.yml +++ b/tests/integration/targets/lookup_passwordstore/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + - block: - include_tasks: package.yml - include_tasks: tests.yml diff --git a/tests/integration/targets/lookup_passwordstore/tasks/package.yml b/tests/integration/targets/lookup_passwordstore/tasks/package.yml index 8ec108e089..89d750ee6d 100644 --- a/tests/integration/targets/lookup_passwordstore/tasks/package.yml +++ b/tests/integration/targets/lookup_passwordstore/tasks/package.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: Include distribution specific variables include_vars: "{{ lookup('first_found', params) }}" vars: @@ -31,6 +36,26 @@ disable_gpg_check: yes when: ansible_facts.pkg_mgr in ['zypper', 'community.general.zypper'] +# See https://github.com/gopasspw/gopass/issues/1849#issuecomment-802789285 +- name: Install gopass on Debian + when: ansible_facts.os_family == 'Debian' + become: yes + block: + - name: Fetch gopass repo keyring + ansible.builtin.get_url: + url: https://packages.gopass.pw/repos/gopass/gopass-archive-keyring.gpg + dest: /usr/share/keyrings/gopass-archive-keyring.gpg + - name: Add gopass repo + ansible.builtin.apt_repository: + repo: "deb [arch=amd64,arm64,armhf \ + signed-by=/usr/share/keyrings/gopass-archive-keyring.gpg] \ + https://packages.gopass.pw/repos/gopass stable main" + state: present + - name: Update apt-cache and install gopass package + ansible.builtin.apt: + name: gopass + update_cache: yes + - name: Install on macOS when: ansible_facts.distribution == 'MacOSX' block: @@ -48,6 +73,7 @@ name: - gnupg2 - pass + - gopass state: present update_homebrew: no become: yes diff --git a/tests/integration/targets/lookup_passwordstore/tasks/password_tests.yml b/tests/integration/targets/lookup_passwordstore/tasks/password_tests.yml new file mode 100644 index 0000000000..c701e199ae --- /dev/null +++ b/tests/integration/targets/lookup_passwordstore/tasks/password_tests.yml @@ -0,0 +1,130 @@ +--- +# 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: Create a password ({{ backend }}) + set_fact: + newpass: "{{ lookup('community.general.passwordstore', 'test-pass length=8 create=yes', backend=backend) }}" + + - name: Fetch password from an existing file ({{ backend }}) + set_fact: + readpass: "{{ lookup('community.general.passwordstore', 'test-pass', backend=backend) }}" + + - name: Verify password ({{ backend }}) + assert: + that: + - readpass == newpass + + - name: Create a password with equal sign ({{ backend }}) + set_fact: + newpass: "{{ lookup('community.general.passwordstore', 'test-pass-equal userpass=SimpleSample= create=yes', backend=backend) }}" + + - name: Fetch a password with equal sign ({{ backend }}) + set_fact: + readpass: "{{ lookup('community.general.passwordstore', 'test-pass-equal', backend=backend) }}" + + - name: Verify password ({{ backend }}) + assert: + that: + - readpass == newpass + + - name: Create a password using missing=create ({{ backend }}) + set_fact: + newpass: "{{ lookup('community.general.passwordstore', 'test-missing-create missing=create length=8', backend=backend) }}" + + - name: Fetch password from an existing file ({{ backend }}) + set_fact: + readpass: "{{ lookup('community.general.passwordstore', 'test-missing-create', backend=backend) }}" + + - name: Verify password ({{ backend }}) + assert: + that: + - readpass == newpass + + - name: Fetch password from existing file using missing=empty ({{ backend }}) + set_fact: + readpass: "{{ lookup('community.general.passwordstore', 'test-missing-create missing=empty', backend=backend) }}" + + - name: Verify password ({{ backend }}) + assert: + that: + - readpass == newpass + + - name: Fetch password from non-existing file using missing=empty ({{ backend }}) + set_fact: + readpass: "{{ query('community.general.passwordstore', 'test-missing-pass missing=empty', backend=backend) }}" + + - name: Verify password ({{ backend }}) + assert: + that: + - readpass == [ none ] + + - name: Create the YAML password ({{ backend }}) + command: "{{ backend }} insert -m -f test-yaml-pass" + args: + stdin: | + testpassword + key: | + multi + line + + - name: Fetch a password with YAML subkey ({{ backend }}) + set_fact: + readyamlpass: "{{ lookup('community.general.passwordstore', 'test-yaml-pass subkey=key', backend=backend) }}" + + - name: Read a yaml subkey ({{ backend }}) + assert: + that: + - readyamlpass == 'multi\nline\n' + + - name: Create a non-YAML multiline file ({{ backend }}) + command: "{{ backend }} insert -m -f test-multiline-pass" + args: + stdin: | + testpassword + random additional line + + - name: Fetch password from multiline file ({{ backend }}) + set_fact: + readyamlpass: "{{ lookup('community.general.passwordstore', 'test-multiline-pass', backend=backend) }}" + + - name: Multiline pass only returns first line ({{ backend }}) + assert: + that: + - readyamlpass == 'testpassword' + + - name: Fetch all from multiline file ({{ backend }}) + set_fact: + readyamlpass: "{{ lookup('community.general.passwordstore', 'test-multiline-pass returnall=yes', backend=backend) }}" + + - name: Multiline pass returnall returns everything in the file ({{ backend }}) + assert: + that: + - readyamlpass == 'testpassword\nrandom additional line\n' + + - name: Create a password in a folder ({{ backend }}) + set_fact: + newpass: "{{ lookup('community.general.passwordstore', 'folder/test-pass length=8 create=yes', backend=backend) }}" + + - name: Fetch password from folder ({{ backend }}) + set_fact: + readpass: "{{ lookup('community.general.passwordstore', 'folder/test-pass', backend=backend) }}" + + - name: Verify password from folder ({{ backend }}) + assert: + that: + - readpass == newpass + + - name: Try to read folder as passname ({{ backend }}) + set_fact: + newpass: "{{ lookup('community.general.passwordstore', 'folder', backend=backend) }}" + ignore_errors: true + register: eval_error + + - name: Make sure reading folder as passname failed ({{ backend }}) + assert: + that: + - eval_error is failed + - '"passname folder not found" in eval_error.msg' + when: backend != "gopass" # Remove this line once gopass backend can handle this diff --git a/tests/integration/targets/lookup_passwordstore/tasks/tests.yml b/tests/integration/targets/lookup_passwordstore/tasks/tests.yml index e69ba5e572..a18b58d651 100644 --- a/tests/integration/targets/lookup_passwordstore/tasks/tests.yml +++ b/tests/integration/targets/lookup_passwordstore/tasks/tests.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: Check name of gpg2 binary command: which gpg2 register: gpg2_check @@ -19,6 +24,54 @@ - "~/.gnupg" - "~/.password-store" +- name: Get path of pass executable + command: which pass + register: result + +- name: Store path of pass executable + set_fact: + passpath: "{{ result.stdout }}" + +- name: Move original pass into place if there was a leftover + command: + argv: + - mv + - "{{ passpath }}.testorig" + - "{{ passpath }}" + args: + removes: "{{ passpath }}.testorig" + +# having gopass is not required for this test, but we store +# its path in case it is installed, so we can restore it +- name: Try to find gopass in path + command: which gopass + register: result + +- name: Store path of gopass executable + set_fact: + gopasspath: "{{ result.stdout }}" + +- name: Move original gopass into place if there was a leftover + command: + argv: + - mv + - "{{ gopasspath }}.testorig" + - "{{ gopasspath }}" + args: + removes: "{{ gopasspath }}.testorig" + +- name: Get versions of tools + command: "{{ item }} --version" + register: versions + loop: + - "{{ gpg2_bin }}" + - pass + - gopass + +- name: Output versions of tools + debug: + msg: "{{ versions.results | map(attribute='stdout_lines') }}" + # How to generate a new GPG key: # gpg2 --batch --gen-key input # See templates/input # gpg2 --list-secret-keys --keyid-format LONG @@ -32,122 +85,153 @@ - name: Trust key shell: echo "D3E1CC8934E97270CEB066023AF1BD3619AB496A:6:" | {{ gpg2_bin }} --import-ownertrust -- name: Initialise passwordstore +- name: Initialise pass passwordstore command: pass init ansible-test -- name: Create a password - set_fact: - newpass: "{{ lookup('community.general.passwordstore', 'test-pass length=8 create=yes') }}" +- name: Initialise gopass passwordstore + command: gopass init --path $HOME/.gopass-store ansible-test + args: + creates: "{{ lookup('env','HOME') }}/.gopass-store" -- name: Fetch password from an existing file - set_fact: - readpass: "{{ lookup('community.general.passwordstore', 'test-pass') }}" +# these tests should apply to all backends +- name: Password tests + include_tasks: password_tests.yml + loop: + - pass + - gopass + loop_control: + loop_var: backend -- name: Verify password +- name: Change passwordstore location explicitly + set_fact: + passwordstore: "{{ lookup('env','HOME') }}/.password-store" + +- name: Make sure password store still works with explicit location set + set_fact: + newpass: "{{ lookup('community.general.passwordstore', 'test-pass') }}" + +- name: Change passwordstore location to a non-existent place + set_fact: + passwordstore: "somenonexistentplace" + +- name: Try reading from non-existent passwordstore location + set_fact: + newpass: "{{ lookup('community.general.passwordstore', 'test-pass') }}" + ignore_errors: true + register: eval_error + +- name: Make sure reading from non-existent passwordstore location failed assert: that: - - readpass == newpass + - eval_error is failed + - >- + "Passwordstore directory 'somenonexistentplace' does not exist" in eval_error.msg -- name: Create a password with equal sign - set_fact: - newpass: "{{ lookup('community.general.passwordstore', 'test-pass-equal userpass=SimpleSample= create=yes') }}" +- name: Test pass compatibility shim detection + block: + - name: Move original pass out of the way + command: + argv: + - mv + - "{{ passpath }}" + - "{{ passpath }}.testorig" + args: + creates: "{{ passpath }}.testorig" -- name: Fetch a password with equal sign - set_fact: - readpass: "{{ lookup('community.general.passwordstore', 'test-pass-equal') }}" + - name: Create dummy pass script + ansible.builtin.copy: + content: | + #!/bin/sh + echo "shim_ok" + dest: "{{ passpath }}" + mode: '0755' -- name: Verify password - assert: - that: - - readpass == newpass + - name: Try reading from non-existent passwordstore location with different pass utility + set_fact: + newpass: "{{ lookup('community.general.passwordstore', 'test-pass') }}" + environment: + PATH: "/tmp" -- name: Create a password using missing=create - set_fact: - newpass: "{{ lookup('community.general.passwordstore', 'test-missing-create missing=create length=8') }}" + - name: Verify password received from shim + assert: + that: + - newpass == "shim_ok" -- name: Fetch password from an existing file - set_fact: - readpass: "{{ lookup('community.general.passwordstore', 'test-missing-create') }}" + - name: Try to read folder as passname with a different pass utility + set_fact: + newpass: "{{ lookup('community.general.passwordstore', 'folder') }}" -- name: Verify password - assert: - that: - - readpass == newpass + - name: Verify password received from shim + assert: + that: + - newpass == "shim_ok" -- name: Fetch password from existing file using missing=empty - set_fact: - readpass: "{{ lookup('community.general.passwordstore', 'test-missing-create missing=empty') }}" + always: + - name: Move original pass back into place + command: + argv: + - mv + - "{{ passpath }}.testorig" + - "{{ passpath }}" + args: + removes: "{{ passpath }}.testorig" -- name: Verify password - assert: - that: - - readpass == newpass +# This are in addition to the real gopass tests above +# and verify plugin logic +- name: gopass plugin logic tests + vars: + passwordstore_backend: "gopass" + block: + - name: Check if gopass executable exists + stat: + path: "{{ gopasspath }}" + register: gopass_check -- name: Fetch password from non-existing file using missing=empty - set_fact: - readpass: "{{ query('community.general.passwordstore', 'test-missing-pass missing=empty') }}" + - name: Move original gopass out of the way + command: + argv: + - mv + - "{{ gopasspath }}" + - "{{ gopasspath }}.testorig" + args: + creates: "{{ gopasspath }}.testorig" + when: gopass_check.stat.exists == true -- name: Verify password - assert: - that: - - readpass == [ none ] + - name: Create mocked gopass script + ansible.builtin.copy: + content: | + #!/bin/sh + if [ "$GOPASS_NO_REMINDER" != "YES" ]; then + exit 1 + fi + if [ "$1" = "--version" ]; then + exit 2 + fi + echo "gopass_ok" + dest: "{{ gopasspath }}" + mode: '0755' -# As inserting multiline passwords on the commandline would require something -# like expect, simply create it by using default gpg on a file with the correct -# structure. -- name: Create the YAML password content - copy: - dest: "~/.password-store/test-yaml-pass" - content: | - testpassword - key: | - multi - line + - name: Try to read folder as passname using gopass mock + set_fact: + newpass: "{{ lookup('community.general.passwordstore', 'folder') }}" -- name: Read .gpg-id from .password-store - set_fact: - gpgid: "{{ lookup('file', '~/.password-store/.gpg-id') }}" + - name: Verify password received from gopass mock + assert: + that: + - newpass == "gopass_ok" -- name: Encrypt the file using the gpg key - command: "{{ gpg2_bin }} --batch --encrypt -r {{ gpgid }} ~/.password-store/test-yaml-pass" + always: + - name: Remove mocked gopass + ansible.builtin.file: + path: "{{ gopasspath }}" + state: absent -- name: Fetch a password with YAML subkey - set_fact: - readyamlpass: "{{ lookup('community.general.passwordstore', 'test-yaml-pass subkey=key') }}" - -- name: Read a yaml subkey - assert: - that: - - readyamlpass == 'multi\nline' - -- name: Create a non-YAML multiline file - copy: - dest: "~/.password-store/test-multiline-pass" - content: | - testpassword - random additional line - -- name: Read .gpg-id from .password-store - set_fact: - gpgid: "{{ lookup('file', '~/.password-store/.gpg-id') }}" - -- name: Encrypt the file using the gpg key - command: "{{ gpg2_bin }} --batch --encrypt -r {{ gpgid }} ~/.password-store/test-multiline-pass" - -- name: Fetch password from multiline file - set_fact: - readyamlpass: "{{ lookup('community.general.passwordstore', 'test-multiline-pass') }}" - -- name: Multiline pass only returns first line - assert: - that: - - readyamlpass == 'testpassword' - -- name: Fetch all from multiline file - set_fact: - readyamlpass: "{{ lookup('community.general.passwordstore', 'test-multiline-pass returnall=yes') }}" - -- name: Multiline pass returnall returns everything in the file - assert: - that: - - readyamlpass == 'testpassword\nrandom additional line' + - name: Move original gopass back into place + command: + argv: + - mv + - "{{ gopasspath }}.testorig" + - "{{ gopasspath }}" + args: + removes: "{{ gopasspath }}.testorig" + when: gopass_check.stat.exists == true diff --git a/tests/integration/targets/lookup_passwordstore/templates/input.license b/tests/integration/targets/lookup_passwordstore/templates/input.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/lookup_passwordstore/templates/input.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/tests/integration/targets/lookup_passwordstore/templates/security-privacy.repo.j2 b/tests/integration/targets/lookup_passwordstore/templates/security-privacy.repo.j2 index e698129aa1..72eca99ec9 100644 --- a/tests/integration/targets/lookup_passwordstore/templates/security-privacy.repo.j2 +++ b/tests/integration/targets/lookup_passwordstore/templates/security-privacy.repo.j2 @@ -1,3 +1,9 @@ +{# +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 +#} + [security_privacy] name=Crypto applications and utilities (openSUSE_Leap_{{ ansible_distribution_version }}) type=rpm-md diff --git a/tests/integration/targets/lookup_passwordstore/vars/Alpine.yml b/tests/integration/targets/lookup_passwordstore/vars/Alpine.yml index 3d1c4d45d5..f18329ed13 100644 --- a/tests/integration/targets/lookup_passwordstore/vars/Alpine.yml +++ b/tests/integration/targets/lookup_passwordstore/vars/Alpine.yml @@ -1,2 +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 + passwordstore_packages: + - gopass - pass diff --git a/tests/integration/targets/lookup_passwordstore/vars/Archlinux.yml b/tests/integration/targets/lookup_passwordstore/vars/Archlinux.yml index 3d1c4d45d5..f18329ed13 100644 --- a/tests/integration/targets/lookup_passwordstore/vars/Archlinux.yml +++ b/tests/integration/targets/lookup_passwordstore/vars/Archlinux.yml @@ -1,2 +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 + passwordstore_packages: + - gopass - pass diff --git a/tests/integration/targets/lookup_passwordstore/vars/Debian.yml b/tests/integration/targets/lookup_passwordstore/vars/Debian.yml index 3d1c4d45d5..825a6a8bb8 100644 --- a/tests/integration/targets/lookup_passwordstore/vars/Debian.yml +++ b/tests/integration/targets/lookup_passwordstore/vars/Debian.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 + passwordstore_packages: - pass diff --git a/tests/integration/targets/lookup_passwordstore/vars/Fedora.yml b/tests/integration/targets/lookup_passwordstore/vars/Fedora.yml index 3d1c4d45d5..f18329ed13 100644 --- a/tests/integration/targets/lookup_passwordstore/vars/Fedora.yml +++ b/tests/integration/targets/lookup_passwordstore/vars/Fedora.yml @@ -1,2 +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 + passwordstore_packages: + - gopass - pass diff --git a/tests/integration/targets/lookup_passwordstore/vars/FreeBSD.yml b/tests/integration/targets/lookup_passwordstore/vars/FreeBSD.yml index 39e51fbc2e..9e9da27721 100644 --- a/tests/integration/targets/lookup_passwordstore/vars/FreeBSD.yml +++ b/tests/integration/targets/lookup_passwordstore/vars/FreeBSD.yml @@ -1,3 +1,9 @@ +--- +# 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 + passwordstore_packages: + - gopass - gnupg - password-store diff --git a/tests/integration/targets/lookup_passwordstore/vars/default.yml b/tests/integration/targets/lookup_passwordstore/vars/default.yml index e69de29bb2..f55df21f81 100644 --- a/tests/integration/targets/lookup_passwordstore/vars/default.yml +++ b/tests/integration/targets/lookup_passwordstore/vars/default.yml @@ -0,0 +1,4 @@ +--- +# 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 diff --git a/tests/integration/targets/lookup_passwordstore/vars/main.yml b/tests/integration/targets/lookup_passwordstore/vars/main.yml index be954d7d2a..2b4fa1b221 100644 --- a/tests/integration/targets/lookup_passwordstore/vars/main.yml +++ b/tests/integration/targets/lookup_passwordstore/vars/main.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 + passwordstore_privkey: | -----BEGIN PGP PRIVATE KEY BLOCK----- Version: GnuPG v2.0.22 (GNU/Linux) diff --git a/tests/integration/targets/lookup_random_pet/aliases b/tests/integration/targets/lookup_random_pet/aliases index bc987654d9..708d3bcd12 100644 --- a/tests/integration/targets/lookup_random_pet/aliases +++ b/tests/integration/targets/lookup_random_pet/aliases @@ -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 + shippable/posix/group2 skip/aix skip/python2.6 # lookups are controller only, and we no longer support Python 2.6 on the controller diff --git a/tests/integration/targets/lookup_random_pet/dependencies.yml b/tests/integration/targets/lookup_random_pet/dependencies.yml index b6b679d966..464b5c428b 100644 --- a/tests/integration/targets/lookup_random_pet/dependencies.yml +++ b/tests/integration/targets/lookup_random_pet/dependencies.yml @@ -1,6 +1,10 @@ --- +# 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 + - hosts: localhost tasks: - name: Install Petname Python package pip: - name: petname \ No newline at end of file + name: petname diff --git a/tests/integration/targets/lookup_random_pet/runme.sh b/tests/integration/targets/lookup_random_pet/runme.sh index afdff7bb9d..71faa439d1 100755 --- a/tests/integration/targets/lookup_random_pet/runme.sh +++ b/tests/integration/targets/lookup_random_pet/runme.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash -# 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 set -eux ANSIBLE_ROLES_PATH=../ \ diff --git a/tests/integration/targets/lookup_random_pet/test.yml b/tests/integration/targets/lookup_random_pet/test.yml index 1ab619d2f4..31ce38c4d0 100644 --- a/tests/integration/targets/lookup_random_pet/test.yml +++ b/tests/integration/targets/lookup_random_pet/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 + - hosts: localhost gather_facts: no tasks: diff --git a/tests/integration/targets/lookup_random_string/aliases b/tests/integration/targets/lookup_random_string/aliases index bc987654d9..708d3bcd12 100644 --- a/tests/integration/targets/lookup_random_string/aliases +++ b/tests/integration/targets/lookup_random_string/aliases @@ -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 + shippable/posix/group2 skip/aix skip/python2.6 # lookups are controller only, and we no longer support Python 2.6 on the controller diff --git a/tests/integration/targets/lookup_random_string/runme.sh b/tests/integration/targets/lookup_random_string/runme.sh index 8ed6373823..35c79500ce 100755 --- a/tests/integration/targets/lookup_random_string/runme.sh +++ b/tests/integration/targets/lookup_random_string/runme.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash -# 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 set -eux ANSIBLE_ROLES_PATH=../ \ diff --git a/tests/integration/targets/lookup_random_string/test.yml b/tests/integration/targets/lookup_random_string/test.yml index edbf9fd035..2ce57ad2cb 100644 --- a/tests/integration/targets/lookup_random_string/test.yml +++ b/tests/integration/targets/lookup_random_string/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 + - hosts: localhost gather_facts: no tasks: diff --git a/tests/integration/targets/lookup_random_words/aliases b/tests/integration/targets/lookup_random_words/aliases index bc987654d9..708d3bcd12 100644 --- a/tests/integration/targets/lookup_random_words/aliases +++ b/tests/integration/targets/lookup_random_words/aliases @@ -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 + shippable/posix/group2 skip/aix skip/python2.6 # lookups are controller only, and we no longer support Python 2.6 on the controller diff --git a/tests/integration/targets/lookup_random_words/dependencies.yml b/tests/integration/targets/lookup_random_words/dependencies.yml index eef89942d7..1cb0b0d3a8 100644 --- a/tests/integration/targets/lookup_random_words/dependencies.yml +++ b/tests/integration/targets/lookup_random_words/dependencies.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 + - hosts: localhost tasks: - name: Install xkcdpass Python package diff --git a/tests/integration/targets/lookup_random_words/runme.sh b/tests/integration/targets/lookup_random_words/runme.sh index afdff7bb9d..71faa439d1 100755 --- a/tests/integration/targets/lookup_random_words/runme.sh +++ b/tests/integration/targets/lookup_random_words/runme.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash -# 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 set -eux ANSIBLE_ROLES_PATH=../ \ diff --git a/tests/integration/targets/lookup_random_words/test.yml b/tests/integration/targets/lookup_random_words/test.yml index 352cc684ae..90c6727304 100644 --- a/tests/integration/targets/lookup_random_words/test.yml +++ b/tests/integration/targets/lookup_random_words/test.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 + - hosts: localhost gather_facts: false tasks: diff --git a/tests/integration/targets/lvg/aliases b/tests/integration/targets/lvg/aliases index 79f3300ff1..01205a3972 100644 --- a/tests/integration/targets/lvg/aliases +++ b/tests/integration/targets/lvg/aliases @@ -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 + destructive needs/privileged shippable/posix/group1 diff --git a/tests/integration/targets/lvg/meta/main.yml b/tests/integration/targets/lvg/meta/main.yml index 56bc554611..ca1915e05c 100644 --- a/tests/integration/targets/lvg/meta/main.yml +++ b/tests/integration/targets/lvg/meta/main.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 + dependencies: - setup_pkg_mgr - setup_remote_tmp_dir diff --git a/tests/integration/targets/lvg/tasks/main.yml b/tests/integration/targets/lvg/tasks/main.yml index c9b92d00f8..e14c48c3fd 100644 --- a/tests/integration/targets/lvg/tasks/main.yml +++ b/tests/integration/targets/lvg/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Install required packages (Linux) package: name: lvm2 diff --git a/tests/integration/targets/lvg/tasks/setup.yml b/tests/integration/targets/lvg/tasks/setup.yml index e63c2d641e..92785e6d3d 100644 --- a/tests/integration/targets/lvg/tasks/setup.yml +++ b/tests/integration/targets/lvg/tasks/setup.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: "Create files to use as a disk devices" command: "dd if=/dev/zero of={{ remote_tmp_dir }}/img{{ item }} bs=1M count=10" with_sequence: 'count=2' diff --git a/tests/integration/targets/lvg/tasks/teardown.yml b/tests/integration/targets/lvg/tasks/teardown.yml index ed662f1e1f..027c1257fe 100644 --- a/tests/integration/targets/lvg/tasks/teardown.yml +++ b/tests/integration/targets/lvg/tasks/teardown.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: Remove test volume group lvg: vg: testvg diff --git a/tests/integration/targets/lvg/tasks/test_grow_reduce.yml b/tests/integration/targets/lvg/tasks/test_grow_reduce.yml index 1e98804538..5974a88aaf 100644 --- a/tests/integration/targets/lvg/tasks/test_grow_reduce.yml +++ b/tests/integration/targets/lvg/tasks/test_grow_reduce.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: "Create volume group on first disk" lvg: vg: testvg diff --git a/tests/integration/targets/lvg/tasks/test_indempotency.yml b/tests/integration/targets/lvg/tasks/test_indempotency.yml index 5007e56a5b..abaa262881 100644 --- a/tests/integration/targets/lvg/tasks/test_indempotency.yml +++ b/tests/integration/targets/lvg/tasks/test_indempotency.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: Create volume group on disk device lvg: vg: testvg diff --git a/tests/integration/targets/lvg/tasks/test_pvresize.yml b/tests/integration/targets/lvg/tasks/test_pvresize.yml index 9112f8bffa..c8a2c8edb5 100644 --- a/tests/integration/targets/lvg/tasks/test_pvresize.yml +++ b/tests/integration/targets/lvg/tasks/test_pvresize.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: "Create volume group on first disk" lvg: vg: testvg diff --git a/tests/integration/targets/lxd_project/aliases b/tests/integration/targets/lxd_project/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/lxd_project/aliases +++ b/tests/integration/targets/lxd_project/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/lxd_project/tasks/main.yml b/tests/integration/targets/lxd_project/tasks/main.yml index 0dc5178930..d1340eebd9 100644 --- a/tests/integration/targets/lxd_project/tasks/main.yml +++ b/tests/integration/targets/lxd_project/tasks/main.yml @@ -3,7 +3,9 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### -# 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 - name: Clean up test project lxd_project: diff --git a/tests/integration/targets/mail/aliases b/tests/integration/targets/mail/aliases index a6dafcf8cd..abc0d5476d 100644 --- a/tests/integration/targets/mail/aliases +++ b/tests/integration/targets/mail/aliases @@ -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 + shippable/posix/group1 diff --git a/tests/integration/targets/mail/files/smtpserver.crt b/tests/integration/targets/mail/files/smtpserver.crt index 44c18a243e..2fcbb3a1dd 100644 --- a/tests/integration/targets/mail/files/smtpserver.crt +++ b/tests/integration/targets/mail/files/smtpserver.crt @@ -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 + -----BEGIN CERTIFICATE----- MIIDrzCCApegAwIBAgIJAJyHQUcqSOQpMA0GCSqGSIb3DQEBCwUAMG4xCzAJBgNV BAYTAkJFMRMwEQYDVQQIDApWbGFhbmRlcmVuMQ0wCwYDVQQHDARHZW50MQ4wDAYD diff --git a/tests/integration/targets/mail/files/smtpserver.key b/tests/integration/targets/mail/files/smtpserver.key index 48ddf644c9..193ec9cdac 100644 --- a/tests/integration/targets/mail/files/smtpserver.key +++ b/tests/integration/targets/mail/files/smtpserver.key @@ -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 + -----BEGIN PRIVATE KEY----- MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDS6gRoCBeOFM0Y TbqRsEigHkyF0+J1zyCSpSItZE0kMLcsEJgcOpXgZb49asFO9/p4asEnJSK2Md5b diff --git a/tests/integration/targets/mail/files/smtpserver.py b/tests/integration/targets/mail/files/smtpserver.py index 01b257e189..18c6fbf9be 100644 --- a/tests/integration/targets/mail/files/smtpserver.py +++ b/tests/integration/targets/mail/files/smtpserver.py @@ -1,8 +1,9 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# 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) 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 @@ -61,7 +62,7 @@ if HAS_TLS and ssl_ctx is not None: smtp_server2 = smtpd_tls.DebuggingServer(('127.0.0.1', port2), None, ssl_ctx=ssl_ctx, starttls=False) else: print('Start SMTP server on port', port1) - smtp_server1 = smtpd.DebuggingServer(('127.0.0.1', port1), None) + smtp_server1 = smtpd.DebuggingServer(('127.0.0.1', port1), None) # pylint: disable=used-before-assignment if port2: print('WARNING: TLS is NOT supported on this system, not listening on port %s.' % port2) diff --git a/tests/integration/targets/mail/meta/main.yml b/tests/integration/targets/mail/meta/main.yml index 1810d4bec9..982de6eb03 100644 --- a/tests/integration/targets/mail/meta/main.yml +++ b/tests/integration/targets/mail/meta/main.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 + dependencies: - setup_remote_tmp_dir diff --git a/tests/integration/targets/mail/tasks/main.yml b/tests/integration/targets/mail/tasks/main.yml index 11c810da30..a79d9e9162 100644 --- a/tests/integration/targets/mail/tasks/main.yml +++ b/tests/integration/targets/mail/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + # TODO: Our current implementation does not handle SMTP authentication # NOTE: If the system does not support smtpd-tls (python 2.6 and older) we do basic tests diff --git a/tests/integration/targets/mas/aliases b/tests/integration/targets/mas/aliases index 57c4f1c080..ea236467f3 100644 --- a/tests/integration/targets/mas/aliases +++ b/tests/integration/targets/mas/aliases @@ -1,2 +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 + needs/root -unsupported \ No newline at end of file +unsupported diff --git a/tests/integration/targets/mas/tasks/main.yml b/tests/integration/targets/mas/tasks/main.yml index 811bb2110a..ce50c39eb1 100644 --- a/tests/integration/targets/mas/tasks/main.yml +++ b/tests/integration/targets/mas/tasks/main.yml @@ -1,12 +1,14 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### # Test code for the mas module. -# Copyright: (c) 2020, Lukas Bestle -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ---- +# Copyright (c) 2020, Lukas Bestle +# 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 + # Test preparation - name: Uninstall Rested to ensure consistent starting point mas: diff --git a/tests/integration/targets/memset_dns_reload/aliases b/tests/integration/targets/memset_dns_reload/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/memset_dns_reload/aliases +++ b/tests/integration/targets/memset_dns_reload/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/memset_dns_reload/meta/main.yml b/tests/integration/targets/memset_dns_reload/meta/main.yml index 73b314ff7c..f55df21f81 100644 --- a/tests/integration/targets/memset_dns_reload/meta/main.yml +++ b/tests/integration/targets/memset_dns_reload/meta/main.yml @@ -1 +1,4 @@ ---- \ No newline at end of file +--- +# 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 diff --git a/tests/integration/targets/memset_dns_reload/tasks/main.yml b/tests/integration/targets/memset_dns_reload/tasks/main.yml index 20b00b54bb..153df95ba9 100644 --- a/tests/integration/targets/memset_dns_reload/tasks/main.yml +++ b/tests/integration/targets/memset_dns_reload/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: request reload with invalid API key memset_dns_reload: api_key: "wa9aerahhie0eekee9iaphoorovooyia" diff --git a/tests/integration/targets/memset_memstore_info/aliases b/tests/integration/targets/memset_memstore_info/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/memset_memstore_info/aliases +++ b/tests/integration/targets/memset_memstore_info/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/memset_memstore_info/meta/main.yml b/tests/integration/targets/memset_memstore_info/meta/main.yml index 73b314ff7c..f55df21f81 100644 --- a/tests/integration/targets/memset_memstore_info/meta/main.yml +++ b/tests/integration/targets/memset_memstore_info/meta/main.yml @@ -1 +1,4 @@ ---- \ No newline at end of file +--- +# 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 diff --git a/tests/integration/targets/memset_memstore_info/tasks/main.yml b/tests/integration/targets/memset_memstore_info/tasks/main.yml index 6cc728189b..7dc7f7c698 100644 --- a/tests/integration/targets/memset_memstore_info/tasks/main.yml +++ b/tests/integration/targets/memset_memstore_info/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: query API with invalid API key memset_memstore_info: api_key: 'wa9aerahhie0eekee9iaphoorovooyia' diff --git a/tests/integration/targets/memset_server_info/aliases b/tests/integration/targets/memset_server_info/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/memset_server_info/aliases +++ b/tests/integration/targets/memset_server_info/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/memset_server_info/meta/main.yml b/tests/integration/targets/memset_server_info/meta/main.yml index 73b314ff7c..f55df21f81 100644 --- a/tests/integration/targets/memset_server_info/meta/main.yml +++ b/tests/integration/targets/memset_server_info/meta/main.yml @@ -1 +1,4 @@ ---- \ No newline at end of file +--- +# 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 diff --git a/tests/integration/targets/memset_server_info/tasks/main.yml b/tests/integration/targets/memset_server_info/tasks/main.yml index 1a8c776e99..79066fac7d 100644 --- a/tests/integration/targets/memset_server_info/tasks/main.yml +++ b/tests/integration/targets/memset_server_info/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: query API with invalid API key memset_server_info: api_key: 'wa9aerahhie0eekee9iaphoorovooyia' diff --git a/tests/integration/targets/memset_zone/aliases b/tests/integration/targets/memset_zone/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/memset_zone/aliases +++ b/tests/integration/targets/memset_zone/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/memset_zone/meta/main.yml b/tests/integration/targets/memset_zone/meta/main.yml index ed97d539c0..f55df21f81 100644 --- a/tests/integration/targets/memset_zone/meta/main.yml +++ b/tests/integration/targets/memset_zone/meta/main.yml @@ -1 +1,4 @@ --- +# 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 diff --git a/tests/integration/targets/memset_zone/tasks/main.yml b/tests/integration/targets/memset_zone/tasks/main.yml index abc61dd701..091bab8232 100644 --- a/tests/integration/targets/memset_zone/tasks/main.yml +++ b/tests/integration/targets/memset_zone/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: create random string set_fact: zone_name: "{{ 65535 | random | string }}.ansible.example.com" diff --git a/tests/integration/targets/memset_zone/vars/main.yml b/tests/integration/targets/memset_zone/vars/main.yml index 1f8f2eba1e..8828011b0a 100644 --- a/tests/integration/targets/memset_zone/vars/main.yml +++ b/tests/integration/targets/memset_zone/vars/main.yml @@ -1,2 +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 + random_string: "baiqui8ci6miedoo9eivohJ0aixei7oo" diff --git a/tests/integration/targets/memset_zone_domain/aliases b/tests/integration/targets/memset_zone_domain/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/memset_zone_domain/aliases +++ b/tests/integration/targets/memset_zone_domain/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/memset_zone_domain/meta/main.yml b/tests/integration/targets/memset_zone_domain/meta/main.yml index 73b314ff7c..f55df21f81 100644 --- a/tests/integration/targets/memset_zone_domain/meta/main.yml +++ b/tests/integration/targets/memset_zone_domain/meta/main.yml @@ -1 +1,4 @@ ---- \ No newline at end of file +--- +# 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 diff --git a/tests/integration/targets/memset_zone_domain/tasks/main.yml b/tests/integration/targets/memset_zone_domain/tasks/main.yml index 7edb809296..e92ffcdcf5 100644 --- a/tests/integration/targets/memset_zone_domain/tasks/main.yml +++ b/tests/integration/targets/memset_zone_domain/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: create domain with invalid API key memset_zone_domain: api_key: "wa9aerahhie0eekee9iaphoorovooyia" diff --git a/tests/integration/targets/memset_zone_domain/vars/main.yml b/tests/integration/targets/memset_zone_domain/vars/main.yml index 022e6a3cfc..e891ff49f7 100644 --- a/tests/integration/targets/memset_zone_domain/vars/main.yml +++ b/tests/integration/targets/memset_zone_domain/vars/main.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 + test_domain: ansible.example.com target_zone: ansible-dns-zone duplicate_zone: ansible-dns-zone-dupe diff --git a/tests/integration/targets/memset_zone_record/aliases b/tests/integration/targets/memset_zone_record/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/memset_zone_record/aliases +++ b/tests/integration/targets/memset_zone_record/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/memset_zone_record/meta/main.yml b/tests/integration/targets/memset_zone_record/meta/main.yml index ed97d539c0..f55df21f81 100644 --- a/tests/integration/targets/memset_zone_record/meta/main.yml +++ b/tests/integration/targets/memset_zone_record/meta/main.yml @@ -1 +1,4 @@ --- +# 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 diff --git a/tests/integration/targets/memset_zone_record/tasks/main.yml b/tests/integration/targets/memset_zone_record/tasks/main.yml index d8b245a148..c1bdd6873b 100644 --- a/tests/integration/targets/memset_zone_record/tasks/main.yml +++ b/tests/integration/targets/memset_zone_record/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: create record with incorrect API key memset_zone_record: api_key: "wa9aerahhie0eekee9iaphoorovooyia" diff --git a/tests/integration/targets/memset_zone_record/vars/main.yml b/tests/integration/targets/memset_zone_record/vars/main.yml index ae0598bd6f..857f1c7229 100644 --- a/tests/integration/targets/memset_zone_record/vars/main.yml +++ b/tests/integration/targets/memset_zone_record/vars/main.yml @@ -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 + test_zone: ansible-dns-record-tests duplicate_zone: ansible-dns-zone-dupe diff --git a/tests/integration/targets/module_helper/aliases b/tests/integration/targets/module_helper/aliases index 765b70da79..be75e3ddab 100644 --- a/tests/integration/targets/module_helper/aliases +++ b/tests/integration/targets/module_helper/aliases @@ -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 + shippable/posix/group2 diff --git a/tests/integration/targets/module_helper/library/mdepfail.py b/tests/integration/targets/module_helper/library/mdepfail.py index 614c50dbf8..d48727980a 100644 --- a/tests/integration/targets/module_helper/library/mdepfail.py +++ b/tests/integration/targets/module_helper/library/mdepfail.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2021, Alexei Znamensky +# Copyright (c) 2021, Alexei Znamensky # -# 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/tests/integration/targets/module_helper/library/msimple.py b/tests/integration/targets/module_helper/library/msimple.py index bde7f4fcc5..60a49dccb1 100644 --- a/tests/integration/targets/module_helper/library/msimple.py +++ b/tests/integration/targets/module_helper/library/msimple.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2021, Alexei Znamensky +# Copyright (c) 2021, Alexei Znamensky # -# 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/tests/integration/targets/module_helper/library/msimpleda.py b/tests/integration/targets/module_helper/library/msimpleda.py index fa7f5cf464..74ec4ba010 100644 --- a/tests/integration/targets/module_helper/library/msimpleda.py +++ b/tests/integration/targets/module_helper/library/msimpleda.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2021, Alexei Znamensky +# Copyright (c) 2021, Alexei Znamensky # -# 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 import collections diff --git a/tests/integration/targets/module_helper/library/mstate.py b/tests/integration/targets/module_helper/library/mstate.py index 4ae0c63a59..6c69f9c720 100644 --- a/tests/integration/targets/module_helper/library/mstate.py +++ b/tests/integration/targets/module_helper/library/mstate.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2021, Alexei Znamensky +# Copyright (c) 2021, Alexei Znamensky # -# 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/tests/integration/targets/module_helper/tasks/main.yml b/tests/integration/targets/module_helper/tasks/main.yml index f7e36537a6..90006f701d 100644 --- a/tests/integration/targets/module_helper/tasks/main.yml +++ b/tests/integration/targets/module_helper/tasks/main.yml @@ -1,5 +1,6 @@ -# (c) 2021, Alexei Znamensky -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, 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 - include_tasks: msimple.yml - include_tasks: mdepfail.yml diff --git a/tests/integration/targets/module_helper/tasks/mdepfail.yml b/tests/integration/targets/module_helper/tasks/mdepfail.yml index 01523513a3..3f4ed9039d 100644 --- a/tests/integration/targets/module_helper/tasks/mdepfail.yml +++ b/tests/integration/targets/module_helper/tasks/mdepfail.yml @@ -1,5 +1,6 @@ -# (c) 2021, Alexei Znamensky -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, 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 - name: test failing dependency mdepfail: diff --git a/tests/integration/targets/module_helper/tasks/msimple.yml b/tests/integration/targets/module_helper/tasks/msimple.yml index d539fa3f9f..9010c455ca 100644 --- a/tests/integration/targets/module_helper/tasks/msimple.yml +++ b/tests/integration/targets/module_helper/tasks/msimple.yml @@ -1,5 +1,6 @@ -# (c) 2021, Alexei Znamensky -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, 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 - name: test msimple (set a=80) msimple: diff --git a/tests/integration/targets/module_helper/tasks/msimpleda.yml b/tests/integration/targets/module_helper/tasks/msimpleda.yml index 04f670b1cf..e01b65e12c 100644 --- a/tests/integration/targets/module_helper/tasks/msimpleda.yml +++ b/tests/integration/targets/module_helper/tasks/msimpleda.yml @@ -1,5 +1,6 @@ -# (c) 2021, Alexei Znamensky -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, 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 - set_fact: attr2_d: diff --git a/tests/integration/targets/module_helper/tasks/mstate.yml b/tests/integration/targets/module_helper/tasks/mstate.yml index 581a8ba8a4..7a4e9ad3e4 100644 --- a/tests/integration/targets/module_helper/tasks/mstate.yml +++ b/tests/integration/targets/module_helper/tasks/mstate.yml @@ -1,5 +1,6 @@ -# (c) 2021, Alexei Znamensky -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, 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 - name: test mstate 1 mstate: diff --git a/tests/integration/targets/monit/aliases b/tests/integration/targets/monit/aliases index 547c800b8b..e60be5e504 100644 --- a/tests/integration/targets/monit/aliases +++ b/tests/integration/targets/monit/aliases @@ -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 + destructive needs/target/setup_epel shippable/posix/group2 diff --git a/tests/integration/targets/monit/defaults/main.yml b/tests/integration/targets/monit/defaults/main.yml index 71b22f442e..ec064643ce 100644 --- a/tests/integration/targets/monit/defaults/main.yml +++ b/tests/integration/targets/monit/defaults/main.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 + process_root: /opt/httpd_echo process_file: "{{ process_root }}/httpd_echo.py" process_venv: "{{ process_root }}/venv" diff --git a/tests/integration/targets/monit/files/httpd_echo.py b/tests/integration/targets/monit/files/httpd_echo.py index 561470372d..cd77da26b5 100644 --- a/tests/integration/targets/monit/files/httpd_echo.py +++ b/tests/integration/targets/monit/files/httpd_echo.py @@ -1,5 +1,6 @@ -# (c) 2020, Simon Kelly -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2020, Simon Kelly +# 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/tests/integration/targets/monit/meta/main.yml b/tests/integration/targets/monit/meta/main.yml index 5438ced5c3..2d6cafb56f 100644 --- a/tests/integration/targets/monit/meta/main.yml +++ b/tests/integration/targets/monit/meta/main.yml @@ -1,2 +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 + dependencies: - setup_pkg_mgr + - setup_remote_constraints diff --git a/tests/integration/targets/monit/tasks/check_state.yml b/tests/integration/targets/monit/tasks/check_state.yml index 9b5ff04293..bc8eb7c81a 100644 --- a/tests/integration/targets/monit/tasks/check_state.yml +++ b/tests/integration/targets/monit/tasks/check_state.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: "{{ reason }} ('up')" command: "curl -sf http://localhost:8082/hello" when: service_state == 'up' diff --git a/tests/integration/targets/monit/tasks/main.yml b/tests/integration/targets/monit/tasks/main.yml index 21404fe15a..73b6cfc8a6 100644 --- a/tests/integration/targets/monit/tasks/main.yml +++ b/tests/integration/targets/monit/tasks/main.yml @@ -1,12 +1,20 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + - block: - name: Install EPEL repository (RHEL only) include_role: name: setup_epel + when: + - ansible_distribution in ['RedHat', 'CentOS'] + - ansible_distribution_major_version is version('9', '<') - name: create required directories become: yes @@ -43,15 +51,15 @@ src: httpd_echo.py dest: "{{ process_file }}" - - name: Install virtualenv + - name: Install virtualenv on CentOS 8 package: name: virtualenv state: present when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '8' - - name: Install virtualenv - package: - name: python-virtualenv + - name: Install virtualenv on Arch Linux + pip: + name: virtualenv state: present when: ansible_os_family == 'Archlinux' @@ -59,6 +67,7 @@ pip: name: "{{ item }}" virtualenv: "{{ process_venv }}" + extra_args: "-c {{ remote_constraints }}" loop: - setuptools==44 - python-daemon diff --git a/tests/integration/targets/monit/tasks/test.yml b/tests/integration/targets/monit/tasks/test.yml index c36997fcec..42fd033c73 100644 --- a/tests/integration/targets/monit/tasks/test.yml +++ b/tests/integration/targets/monit/tasks/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 + # order is important - import_tasks: test_reload_present.yml diff --git a/tests/integration/targets/monit/tasks/test_errors.yml b/tests/integration/targets/monit/tasks/test_errors.yml index 4520fd8b85..3626723877 100644 --- a/tests/integration/targets/monit/tasks/test_errors.yml +++ b/tests/integration/targets/monit/tasks/test_errors.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: Check an error occurs when wrong process name is used monit: name: missing diff --git a/tests/integration/targets/monit/tasks/test_reload_present.yml b/tests/integration/targets/monit/tasks/test_reload_present.yml index 31f37e7476..0bd6cd073b 100644 --- a/tests/integration/targets/monit/tasks/test_reload_present.yml +++ b/tests/integration/targets/monit/tasks/test_reload_present.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: reload monit when process is missing monit: name: httpd_echo diff --git a/tests/integration/targets/monit/tasks/test_state.yml b/tests/integration/targets/monit/tasks/test_state.yml index f78fbc55e7..33a70c196a 100644 --- a/tests/integration/targets/monit/tasks/test_state.yml +++ b/tests/integration/targets/monit/tasks/test_state.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 + - import_tasks: check_state.yml vars: reason: verify initial service state diff --git a/tests/integration/targets/monit/templates/monitrc.j2 b/tests/integration/targets/monit/templates/monitrc.j2 index aba574c24d..4f1a6e2473 100644 --- a/tests/integration/targets/monit/templates/monitrc.j2 +++ b/tests/integration/targets/monit/templates/monitrc.j2 @@ -1,3 +1,9 @@ +{# +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 +#} + set daemon 2 set logfile /var/log/monit.log set idfile /var/lib/monit/id diff --git a/tests/integration/targets/monit/vars/Alpine.yml b/tests/integration/targets/monit/vars/Alpine.yml index cb76bac9e4..773c9d985a 100644 --- a/tests/integration/targets/monit/vars/Alpine.yml +++ b/tests/integration/targets/monit/vars/Alpine.yml @@ -1 +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 + monitrc: "/etc/monitrc" diff --git a/tests/integration/targets/monit/vars/Archlinux.yml b/tests/integration/targets/monit/vars/Archlinux.yml index cb76bac9e4..773c9d985a 100644 --- a/tests/integration/targets/monit/vars/Archlinux.yml +++ b/tests/integration/targets/monit/vars/Archlinux.yml @@ -1 +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 + monitrc: "/etc/monitrc" diff --git a/tests/integration/targets/monit/vars/CentOS-6.yml b/tests/integration/targets/monit/vars/CentOS-6.yml index 7b769cb460..9ff9c26410 100644 --- a/tests/integration/targets/monit/vars/CentOS-6.yml +++ b/tests/integration/targets/monit/vars/CentOS-6.yml @@ -1 +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 + monitrc: "/etc/monit.conf" diff --git a/tests/integration/targets/monit/vars/RedHat.yml b/tests/integration/targets/monit/vars/RedHat.yml index cb76bac9e4..773c9d985a 100644 --- a/tests/integration/targets/monit/vars/RedHat.yml +++ b/tests/integration/targets/monit/vars/RedHat.yml @@ -1 +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 + monitrc: "/etc/monitrc" diff --git a/tests/integration/targets/monit/vars/Suse.yml b/tests/integration/targets/monit/vars/Suse.yml index cb76bac9e4..773c9d985a 100644 --- a/tests/integration/targets/monit/vars/Suse.yml +++ b/tests/integration/targets/monit/vars/Suse.yml @@ -1 +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 + monitrc: "/etc/monitrc" diff --git a/tests/integration/targets/monit/vars/defaults.yml b/tests/integration/targets/monit/vars/defaults.yml index 5254ded926..74c76c7c9c 100644 --- a/tests/integration/targets/monit/vars/defaults.yml +++ b/tests/integration/targets/monit/vars/defaults.yml @@ -1 +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 + monitrc: "/etc/monit/monitrc" diff --git a/tests/integration/targets/mqtt/aliases b/tests/integration/targets/mqtt/aliases index 9a30a5a281..471b8e86f5 100644 --- a/tests/integration/targets/mqtt/aliases +++ b/tests/integration/targets/mqtt/aliases @@ -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 + shippable/posix/group1 skip/aix skip/osx diff --git a/tests/integration/targets/mqtt/meta/main.yml b/tests/integration/targets/mqtt/meta/main.yml index 86f3d04363..a9c2068edc 100644 --- a/tests/integration/targets/mqtt/meta/main.yml +++ b/tests/integration/targets/mqtt/meta/main.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 + dependencies: - setup_mosquitto diff --git a/tests/integration/targets/mqtt/tasks/main.yml b/tests/integration/targets/mqtt/tasks/main.yml index c5dcf3bec7..6403b20181 100644 --- a/tests/integration/targets/mqtt/tasks/main.yml +++ b/tests/integration/targets/mqtt/tasks/main.yml @@ -1,9 +1,14 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + - include: ubuntu.yml when: - ansible_distribution == 'Ubuntu' - - ansible_distribution_release not in ['trusty', 'focal'] + - ansible_distribution_release not in ['focal', 'jammy'] diff --git a/tests/integration/targets/mqtt/tasks/ubuntu.yml b/tests/integration/targets/mqtt/tasks/ubuntu.yml index 71ff3e90bc..0c0a12d041 100644 --- a/tests/integration/targets/mqtt/tasks/ubuntu.yml +++ b/tests/integration/targets/mqtt/tasks/ubuntu.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: Install pip packages pip: name: paho-mqtt>=1.4.0 diff --git a/tests/integration/targets/mssql_script/aliases b/tests/integration/targets/mssql_script/aliases index a6c2c7e086..ee4e2125f9 100644 --- a/tests/integration/targets/mssql_script/aliases +++ b/tests/integration/targets/mssql_script/aliases @@ -1,5 +1,9 @@ +# 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 + skip/osx skip/macos skip/freebsd skip/rhel -disabled \ No newline at end of file +disabled diff --git a/tests/integration/targets/mssql_script/defaults/main.yml b/tests/integration/targets/mssql_script/defaults/main.yml index 017e2cf725..42ad1d44b8 100644 --- a/tests/integration/targets/mssql_script/defaults/main.yml +++ b/tests/integration/targets/mssql_script/defaults/main.yml @@ -1,4 +1,9 @@ +--- +# 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 + mssql_host: localhost mssql_port: 14330 mssql_login_user: sa -mssql_login_password: "yourStrong(!)Password" \ No newline at end of file +mssql_login_password: "yourStrong(!)Password" diff --git a/tests/integration/targets/mssql_script/tasks/main.yml b/tests/integration/targets/mssql_script/tasks/main.yml index c17d3b764c..2ecfd51c15 100644 --- a/tests/integration/targets/mssql_script/tasks/main.yml +++ b/tests/integration/targets/mssql_script/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + # TODO: Find out how to setup mssql server for tests # For the moment you have to run the tests locally # docker run --name mssql-test -e "ACCEPT_EULA=Y" -e 'SA_PASSWORD={{ mssql_login_password }}' -p "{ mssql_port }"0:"{ mssql_port }" -d mcr.microsoft.com/mssql/server:2019-latest @@ -221,4 +226,3 @@ - empty_result.query_results[0][1] | length == 0 - empty_result.query_results[0][2][0][0] == 'msdb' failed_when: false # known issue - \ No newline at end of file diff --git a/tests/integration/targets/nomad/aliases b/tests/integration/targets/nomad/aliases index 3141aee60b..f9f52d7b84 100644 --- a/tests/integration/targets/nomad/aliases +++ b/tests/integration/targets/nomad/aliases @@ -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 + shippable/posix/group2 nomad_job_info destructive diff --git a/tests/integration/targets/nomad/files/job.hcl b/tests/integration/targets/nomad/files/job.hcl index abcc6854f8..8f01f04396 100644 --- a/tests/integration/targets/nomad/files/job.hcl +++ b/tests/integration/targets/nomad/files/job.hcl @@ -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 + # There can only be a single job definition per file. This job is named # "example" so it will create a job with the ID and Name "example". diff --git a/tests/integration/targets/nomad/meta/main.yml b/tests/integration/targets/nomad/meta/main.yml index f9bb8406a4..0909be2064 100644 --- a/tests/integration/targets/nomad/meta/main.yml +++ b/tests/integration/targets/nomad/meta/main.yml @@ -1,5 +1,10 @@ --- +# 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 + dependencies: - setup_pkg_mgr - setup_openssl - setup_remote_tmp_dir + - setup_remote_constraints diff --git a/tests/integration/targets/nomad/tasks/main.yml b/tests/integration/targets/nomad/tasks/main.yml index abf78aad98..1a143be059 100644 --- a/tests/integration/targets/nomad/tasks/main.yml +++ b/tests/integration/targets/nomad/tasks/main.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: Skip unsupported platforms meta: end_play # TODO: figure out why Alpine does not work! @@ -15,6 +20,7 @@ - name: Install requests<2.20 (CentOS/RHEL 6) pip: name: requests<2.20 + extra_args: "-c {{ remote_constraints }}" register: result until: result is success when: ansible_distribution_file_variety|default() == 'RedHat' and ansible_distribution_major_version is version('6', '<=') @@ -22,12 +28,14 @@ - name: Install python-nomad pip: name: python-nomad + extra_args: "-c {{ remote_constraints }}" register: result until: result is success - name: Install jmespath pip: name: jmespath + extra_args: "-c {{ remote_constraints }}" register: result until: result is success diff --git a/tests/integration/targets/nomad/tasks/nomad_job.yml b/tests/integration/targets/nomad/tasks/nomad_job.yml index f2137f4eff..2a4f223aa4 100644 --- a/tests/integration/targets/nomad/tasks/nomad_job.yml +++ b/tests/integration/targets/nomad/tasks/nomad_job.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 - name: run check deploy nomad job nomad_job: diff --git a/tests/integration/targets/npm/aliases b/tests/integration/targets/npm/aliases index e09dd4459f..b1c4f2872e 100644 --- a/tests/integration/targets/npm/aliases +++ b/tests/integration/targets/npm/aliases @@ -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 + shippable/posix/group2 destructive skip/aix diff --git a/tests/integration/targets/npm/meta/main.yml b/tests/integration/targets/npm/meta/main.yml index 230548b160..6147ad33e5 100644 --- a/tests/integration/targets/npm/meta/main.yml +++ b/tests/integration/targets/npm/meta/main.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 + dependencies: - setup_pkg_mgr - setup_gnutar diff --git a/tests/integration/targets/npm/tasks/main.yml b/tests/integration/targets/npm/tasks/main.yml index 8e1d388e2c..500e15fdb5 100644 --- a/tests/integration/targets/npm/tasks/main.yml +++ b/tests/integration/targets/npm/tasks/main.yml @@ -1,24 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### # test code for the npm module - -# 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 # ------------------------------------------------------------- # Setup steps diff --git a/tests/integration/targets/npm/tasks/no_bin_links.yml b/tests/integration/targets/npm/tasks/no_bin_links.yml index 5c89f70517..3588f76429 100644 --- a/tests/integration/targets/npm/tasks/no_bin_links.yml +++ b/tests/integration/targets/npm/tasks/no_bin_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 + - name: 'Remove any node modules' file: path: '{{ remote_dir }}/node_modules' diff --git a/tests/integration/targets/npm/tasks/run.yml b/tests/integration/targets/npm/tasks/run.yml index c82e7e4e37..9ce3802709 100644 --- a/tests/integration/targets/npm/tasks/run.yml +++ b/tests/integration/targets/npm/tasks/run.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 + - include_tasks: setup.yml - include_tasks: test.yml - include_tasks: no_bin_links.yml diff --git a/tests/integration/targets/npm/tasks/setup.yml b/tests/integration/targets/npm/tasks/setup.yml index a463b1f8b7..0c7a9eabfb 100644 --- a/tests/integration/targets/npm/tasks/setup.yml +++ b/tests/integration/targets/npm/tasks/setup.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: 'Download NPM' unarchive: src: 'https://ansible-ci-files.s3.amazonaws.com/test/integration/targets/npm/{{ nodejs_path }}.tar.gz' diff --git a/tests/integration/targets/npm/tasks/test.yml b/tests/integration/targets/npm/tasks/test.yml index d254710f0b..c8e83f6027 100644 --- a/tests/integration/targets/npm/tasks/test.yml +++ b/tests/integration/targets/npm/tasks/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 + - name: 'Remove any node modules' file: path: '{{ remote_dir }}/node_modules' diff --git a/tests/integration/targets/odbc/aliases b/tests/integration/targets/odbc/aliases index 4ced527402..75f18e362c 100644 --- a/tests/integration/targets/odbc/aliases +++ b/tests/integration/targets/odbc/aliases @@ -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 + destructive shippable/posix/group1 skip/osx skip/macos skip/rhel8.0 +skip/rhel9.0 skip/freebsd diff --git a/tests/integration/targets/odbc/defaults/main.yml b/tests/integration/targets/odbc/defaults/main.yml index aa8eeb74a5..dd75f54718 100644 --- a/tests/integration/targets/odbc/defaults/main.yml +++ b/tests/integration/targets/odbc/defaults/main.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 + # defaults file for test_postgresql_db my_user: 'ansible_user' my_pass: 'md5d5e044ccd9b4b8adc89e8fed2eb0db8a' diff --git a/tests/integration/targets/odbc/meta/main.yml b/tests/integration/targets/odbc/meta/main.yml index d88c3e1429..0d06eaa398 100644 --- a/tests/integration/targets/odbc/meta/main.yml +++ b/tests/integration/targets/odbc/meta/main.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 + dependencies: - setup_pkg_mgr - setup_postgresql_db diff --git a/tests/integration/targets/odbc/tasks/install_pyodbc.yml b/tests/integration/targets/odbc/tasks/install_pyodbc.yml index ab808b92fc..e0cefe14d3 100644 --- a/tests/integration/targets/odbc/tasks/install_pyodbc.yml +++ b/tests/integration/targets/odbc/tasks/install_pyodbc.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: "Install {{ ansible_os_family }} Libraries" package: name: "{{ packages[ansible_os_family] }}" diff --git a/tests/integration/targets/odbc/tasks/main.yml b/tests/integration/targets/odbc/tasks/main.yml index c28a6e5705..cdc925df69 100644 --- a/tests/integration/targets/odbc/tasks/main.yml +++ b/tests/integration/targets/odbc/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + - when: - ansible_os_family != 'Archlinux' # TODO install driver from AUR: https://aur.archlinux.org/packages/psqlodbc block: diff --git a/tests/integration/targets/odbc/tasks/negative_tests.yml b/tests/integration/targets/odbc/tasks/negative_tests.yml index a560b73cf9..56b7a9b824 100644 --- a/tests/integration/targets/odbc/tasks/negative_tests.yml +++ b/tests/integration/targets/odbc/tasks/negative_tests.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 + # # Missing params for the module # There is nothing you need to do here because the params are required diff --git a/tests/integration/targets/odbc/tasks/no_pyodbc.yml b/tests/integration/targets/odbc/tasks/no_pyodbc.yml index ac66edd94b..417549b63f 100644 --- a/tests/integration/targets/odbc/tasks/no_pyodbc.yml +++ b/tests/integration/targets/odbc/tasks/no_pyodbc.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: Testing the module without pyodbc odbc: dsn: "Test" diff --git a/tests/integration/targets/one_host/aliases b/tests/integration/targets/one_host/aliases index 1ff4e0b13e..7fba83598a 100644 --- a/tests/integration/targets/one_host/aliases +++ b/tests/integration/targets/one_host/aliases @@ -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 + cloud/opennebula shippable/cloud/group1 +disabled # FIXME diff --git a/tests/integration/targets/one_host/files/testhost/tmp/opennebula-fixtures.json.gz.license b/tests/integration/targets/one_host/files/testhost/tmp/opennebula-fixtures.json.gz.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/one_host/files/testhost/tmp/opennebula-fixtures.json.gz.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/tests/integration/targets/one_host/meta/main.yml b/tests/integration/targets/one_host/meta/main.yml index 86752df8dd..1a4a42fb57 100644 --- a/tests/integration/targets/one_host/meta/main.yml +++ b/tests/integration/targets/one_host/meta/main.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 + dependencies: - - setup_opennebula \ No newline at end of file + - setup_opennebula diff --git a/tests/integration/targets/one_host/tasks/main.yml b/tests/integration/targets/one_host/tasks/main.yml index 7d38c2a890..ffd5ac04ca 100644 --- a/tests/integration/targets/one_host/tasks/main.yml +++ b/tests/integration/targets/one_host/tasks/main.yml @@ -1,10 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### # test code for the one_host module - +# 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 # ENVIRONENT PREPARACTION diff --git a/tests/integration/targets/one_template/aliases b/tests/integration/targets/one_template/aliases index 1ff4e0b13e..7fba83598a 100644 --- a/tests/integration/targets/one_template/aliases +++ b/tests/integration/targets/one_template/aliases @@ -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 + cloud/opennebula shippable/cloud/group1 +disabled # FIXME diff --git a/tests/integration/targets/one_template/files/testhost/tmp/opennebula-fixtures.json.gz.license b/tests/integration/targets/one_template/files/testhost/tmp/opennebula-fixtures.json.gz.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/one_template/files/testhost/tmp/opennebula-fixtures.json.gz.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/tests/integration/targets/one_template/meta/main.yml b/tests/integration/targets/one_template/meta/main.yml index 86752df8dd..1a4a42fb57 100644 --- a/tests/integration/targets/one_template/meta/main.yml +++ b/tests/integration/targets/one_template/meta/main.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 + dependencies: - - setup_opennebula \ No newline at end of file + - setup_opennebula diff --git a/tests/integration/targets/one_template/tasks/main.yml b/tests/integration/targets/one_template/tasks/main.yml index fb60e5a98c..58bca9c6c5 100644 --- a/tests/integration/targets/one_template/tasks/main.yml +++ b/tests/integration/targets/one_template/tasks/main.yml @@ -1,10 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### # test code for the one_template module - +# 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 # ENVIRONMENT PREPARATION diff --git a/tests/integration/targets/osx_defaults/aliases b/tests/integration/targets/osx_defaults/aliases index 6e0b78e003..ee063facf6 100644 --- a/tests/integration/targets/osx_defaults/aliases +++ b/tests/integration/targets/osx_defaults/aliases @@ -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 + shippable/posix/group1 skip/aix skip/freebsd diff --git a/tests/integration/targets/osx_defaults/tasks/main.yml b/tests/integration/targets/osx_defaults/tasks/main.yml index af4667ce28..0de351991a 100644 --- a/tests/integration/targets/osx_defaults/tasks/main.yml +++ b/tests/integration/targets/osx_defaults/tasks/main.yml @@ -1,12 +1,14 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### # Test code for the osx_defaults module. -# Copyright: (c) 2019, Abhijeet Kasurde -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ---- +# Copyright (c) 2019, Abhijeet Kasurde +# 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: Check if name is required for present osx_defaults: domain: NSGlobalDomain diff --git a/tests/integration/targets/pacman/aliases b/tests/integration/targets/pacman/aliases index 4db7e45ee5..0262a240bb 100644 --- a/tests/integration/targets/pacman/aliases +++ b/tests/integration/targets/pacman/aliases @@ -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 + destructive shippable/posix/group1 skip/aix diff --git a/tests/integration/targets/pacman/meta/main.yml b/tests/integration/targets/pacman/meta/main.yml index add84cee60..08ce20c21d 100644 --- a/tests/integration/targets/pacman/meta/main.yml +++ b/tests/integration/targets/pacman/meta/main.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 + dependencies: - setup_remote_tmp_dir - setup_pkg_mgr diff --git a/tests/integration/targets/pacman/tasks/basic.yml b/tests/integration/targets/pacman/tasks/basic.yml index eac3bc4eec..ae2f9c0b56 100644 --- a/tests/integration/targets/pacman/tasks/basic.yml +++ b/tests/integration/targets/pacman/tasks/basic.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 + - vars: package_name: unarj block: diff --git a/tests/integration/targets/pacman/tasks/locally_installed_package.yml b/tests/integration/targets/pacman/tasks/locally_installed_package.yml index 308d39e442..a5f1832364 100644 --- a/tests/integration/targets/pacman/tasks/locally_installed_package.yml +++ b/tests/integration/targets/pacman/tasks/locally_installed_package.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 + - vars: package_name: ansible-test-foo username: ansible-regular-user diff --git a/tests/integration/targets/pacman/tasks/main.yml b/tests/integration/targets/pacman/tasks/main.yml index 4a34307c48..95f4374b75 100644 --- a/tests/integration/targets/pacman/tasks/main.yml +++ b/tests/integration/targets/pacman/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + - when: ansible_os_family == 'Archlinux' block: # Add more tests here by including more task files: @@ -12,3 +16,4 @@ - include: 'remove_nosave.yml' - include: 'update_cache.yml' - include: 'locally_installed_package.yml' + - include: 'reason.yml' diff --git a/tests/integration/targets/pacman/tasks/package_urls.yml b/tests/integration/targets/pacman/tasks/package_urls.yml index 4bb897b404..8cd4ddc01d 100644 --- a/tests/integration/targets/pacman/tasks/package_urls.yml +++ b/tests/integration/targets/pacman/tasks/package_urls.yml @@ -1,9 +1,17 @@ --- +# 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 + - vars: + http_port: 27617 reg_pkg: ed url_pkg: lemon + url_pkg_filename: url.pkg.zst + url_pkg_path: '/tmp/' + url_pkg_url: 'http://localhost:{{http_port}}/{{url_pkg_filename}}' file_pkg: hdparm - file_pkg_path: /tmp/pkg.zst + file_pkg_path: /tmp/file.pkg.zst extra_pkg: core/sdparm extra_pkg_outfmt: sdparm block: @@ -15,11 +23,33 @@ - '{{file_pkg}}' - '{{extra_pkg}}' state: absent + - name: Make sure that url package is not cached + file: + path: '/var/cache/pacman/pkg/{{url_pkg_filename}}' + state: absent - name: Get URL for {{url_pkg}} command: cmd: pacman --sync --print-format "%l" {{url_pkg}} - register: url_pkg_url + register: url_pkg_stdout + - name: Download {{url_pkg}} pkg + get_url: + url: '{{url_pkg_stdout.stdout}}' + dest: '{{url_pkg_path}}/{{url_pkg_filename}}' + - name: Download {{url_pkg}} pkg sig + get_url: + url: '{{url_pkg_stdout.stdout}}.sig' + dest: '{{url_pkg_path}}/{{url_pkg_filename}}.sig' + - name: Host {{url_pkg}} + shell: + cmd: 'python -m http.server --directory {{url_pkg_path}} {{http_port}} >/dev/null 2>&1' + async: 90 + poll: 0 + - name: Wait for http.server to come up online + wait_for: + host: 'localhost' + port: '{{http_port}}' + state: started - name: Get URL for {{file_pkg}} command: @@ -34,26 +64,50 @@ pacman: name: - '{{reg_pkg}}' - - '{{url_pkg_url.stdout}}' + - '{{url_pkg_url}}' - '{{file_pkg_path}}' check_mode: True register: install_1 + - name: Install packages from url (check mode, cached) + pacman: + name: + - '{{url_pkg_url}}' + check_mode: True + register: install_1c + - name: Delete cached {{url_pkg}} + file: + path: '/var/cache/pacman/pkg/{{url_pkg_filename}}' + state: absent + - name: Install packages from mixed sources pacman: name: - '{{reg_pkg}}' - - '{{url_pkg_url.stdout}}' + - '{{url_pkg_url}}' - '{{file_pkg_path}}' register: install_2 + - name: Delete cached {{url_pkg}} + file: + path: '/var/cache/pacman/pkg/{{url_pkg_filename}}' + state: absent - name: Install packages from mixed sources - (idempotency) pacman: name: - '{{reg_pkg}}' - - '{{url_pkg_url.stdout}}' + - '{{url_pkg_url}}' - '{{file_pkg_path}}' register: install_3 + - name: Install packages from url - (idempotency, cached) + pacman: + name: + - '{{url_pkg_url}}' + register: install_3c + - name: Delete cached {{url_pkg}} + file: + path: '/var/cache/pacman/pkg/{{url_pkg_filename}}' + state: absent - name: Install packages with their regular names (idempotency) pacman: @@ -62,54 +116,89 @@ - '{{url_pkg}}' - '{{file_pkg}}' register: install_4 + - name: Delete cached {{url_pkg}} + file: + path: '/var/cache/pacman/pkg/{{url_pkg_filename}}' + state: absent - name: Install new package with already installed packages from mixed sources pacman: name: - '{{reg_pkg}}' - - '{{url_pkg_url.stdout}}' + - '{{url_pkg_url}}' - '{{file_pkg_path}}' - '{{extra_pkg}}' register: install_5 + - name: Delete cached {{url_pkg}} + file: + path: '/var/cache/pacman/pkg/{{url_pkg_filename}}' + state: absent - name: Uninstall packages - mixed sources (check mode) pacman: state: absent name: - '{{reg_pkg}}' - - '{{url_pkg_url.stdout}}' + - '{{url_pkg_url}}' - '{{file_pkg_path}}' check_mode: True register: uninstall_1 + - name: Uninstall packages - url (check mode, cached) + pacman: + state: absent + name: + - '{{url_pkg_url}}' + check_mode: True + register: uninstall_1c + - name: Delete cached {{url_pkg}} + file: + path: '/var/cache/pacman/pkg/{{url_pkg_filename}}' + state: absent - name: Uninstall packages - mixed sources pacman: state: absent name: - '{{reg_pkg}}' - - '{{url_pkg_url.stdout}}' + - '{{url_pkg_url}}' - '{{file_pkg_path}}' register: uninstall_2 + - name: Delete cached {{url_pkg}} + file: + path: '/var/cache/pacman/pkg/{{url_pkg_filename}}' + state: absent - name: Uninstall packages - mixed sources (idempotency) pacman: state: absent name: - '{{reg_pkg}}' - - '{{url_pkg_url.stdout}}' + - '{{url_pkg_url}}' - '{{file_pkg_path}}' register: uninstall_3 + - name: Uninstall package - url (idempotency, cached) + pacman: + state: absent + name: + - '{{url_pkg_url}}' + register: uninstall_3c + - assert: that: - install_1 is changed - install_1.msg == 'Would have installed 3 packages' - install_1.packages|sort() == [reg_pkg, url_pkg, file_pkg]|sort() + - install_1c is changed + - install_1c.msg == 'Would have installed 1 packages' + - install_1c.packages|sort() == [url_pkg] - install_2 is changed - install_2.msg == 'Installed 3 package(s)' - - install_1.packages|sort() == [reg_pkg, url_pkg, file_pkg]|sort() + - install_2.packages|sort() == [reg_pkg, url_pkg, file_pkg]|sort() - install_3 is not changed - install_3.msg == 'package(s) already installed' + - install_3c is not changed + - install_3c.msg == 'package(s) already installed' - install_4 is not changed - install_4.msg == 'package(s) already installed' - install_5 is changed @@ -118,8 +207,13 @@ - uninstall_1 is changed - uninstall_1.msg == 'Would have removed 3 packages' - uninstall_1.packages | length() == 3 # pkgs have versions here + - uninstall_1c is changed + - uninstall_1c.msg == 'Would have removed 1 packages' + - uninstall_1c.packages | length() == 1 # pkgs have versions here - uninstall_2 is changed - uninstall_2.msg == 'Removed 3 package(s)' - uninstall_2.packages | length() == 3 - uninstall_3 is not changed - uninstall_3.msg == 'package(s) already absent' + - uninstall_3c is not changed + - uninstall_3c.msg == 'package(s) already absent' diff --git a/tests/integration/targets/pacman/tasks/reason.yml b/tests/integration/targets/pacman/tasks/reason.yml new file mode 100644 index 0000000000..3e7f2e11e4 --- /dev/null +++ b/tests/integration/targets/pacman/tasks/reason.yml @@ -0,0 +1,101 @@ +--- +# 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 + +- vars: + reg_pkg: ed + url_pkg: lemon + file_pkg: hdparm + file_pkg_path: /tmp/pkg.zst + extra_pkg: core/sdparm + extra_pkg_outfmt: sdparm + block: + - name: Make sure that test packages are not installed + pacman: + name: + - '{{reg_pkg}}' + - '{{url_pkg}}' + - '{{file_pkg}}' + - '{{extra_pkg}}' + state: absent + + - name: Get URL for {{url_pkg}} + command: + cmd: pacman --sync --print-format "%l" {{url_pkg}} + register: url_pkg_url + + - name: Get URL for {{file_pkg}} + command: + cmd: pacman --sync --print-format "%l" {{file_pkg}} + register: file_pkg_url + - name: Download {{file_pkg}} pkg + get_url: + url: '{{file_pkg_url.stdout}}' + dest: '{{file_pkg_path}}' + + - name: Install packages from mixed sources as dependency (check mode) + pacman: + name: + - '{{reg_pkg}}' + - '{{url_pkg_url.stdout}}' + - '{{file_pkg_path}}' + reason: dependency + check_mode: True + register: install_1 + + - name: Install packages from mixed sources as explicit + pacman: + name: + - '{{reg_pkg}}' + - '{{url_pkg_url.stdout}}' + - '{{file_pkg_path}}' + reason: explicit + register: install_2 + + - name: Install packages from mixed sources with new packages being installed as dependency - (idempotency) + pacman: + name: + - '{{reg_pkg}}' + - '{{url_pkg_url.stdout}}' + - '{{file_pkg_path}}' + reason: dependency + register: install_3 + + - name: Install new package with already installed packages from mixed sources as dependency + pacman: + name: + - '{{reg_pkg}}' + - '{{url_pkg_url.stdout}}' + - '{{file_pkg_path}}' + - '{{extra_pkg}}' + reason: dependency + register: install_4 + + - name: Set install reason for all packages to dependency + pacman: + name: + - '{{reg_pkg}}' + - '{{url_pkg_url.stdout}}' + - '{{file_pkg_path}}' + - '{{extra_pkg}}' + reason: dependency + reason_for: all + register: install_5 + + - assert: + that: + - install_1 is changed + - install_1.msg == 'Would have installed 3 packages' + - install_1.packages|sort() == [reg_pkg, url_pkg, file_pkg]|sort() + - install_2 is changed + - install_2.msg == 'Installed 3 package(s)' + - install_2.packages|sort() == [reg_pkg, url_pkg, file_pkg]|sort() + - install_3 is not changed + - install_3.msg == 'package(s) already installed' + - install_4 is changed + - install_4.msg == 'Installed 1 package(s)' + - install_4.packages == [extra_pkg_outfmt] + - install_5 is changed + - install_5.msg == 'Installed 3 package(s)' + - install_5.packages|sort() == [reg_pkg, url_pkg, file_pkg]|sort() diff --git a/tests/integration/targets/pacman/tasks/remove_nosave.yml b/tests/integration/targets/pacman/tasks/remove_nosave.yml index 54d056f33e..c6d1c961cb 100644 --- a/tests/integration/targets/pacman/tasks/remove_nosave.yml +++ b/tests/integration/targets/pacman/tasks/remove_nosave.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 + - vars: package_name: xinetd config_file: /etc/xinetd.conf diff --git a/tests/integration/targets/pacman/tasks/update_cache.yml b/tests/integration/targets/pacman/tasks/update_cache.yml index c9b33e65ff..ee2ac3b9f4 100644 --- a/tests/integration/targets/pacman/tasks/update_cache.yml +++ b/tests/integration/targets/pacman/tasks/update_cache.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: Make sure package cache is updated pacman: update_cache: true diff --git a/tests/integration/targets/pagerduty_user/aliases b/tests/integration/targets/pagerduty_user/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/pagerduty_user/aliases +++ b/tests/integration/targets/pagerduty_user/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/pagerduty_user/tasks/main.yml b/tests/integration/targets/pagerduty_user/tasks/main.yml index a6477ff1de..13a0a5e09a 100644 --- a/tests/integration/targets/pagerduty_user/tasks/main.yml +++ b/tests/integration/targets/pagerduty_user/tasks/main.yml @@ -1,7 +1,8 @@ # Test code for pagerduty_user module # -# Copyright: (c) 2020, Zainab Alsaffar -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2020, Zainab Alsaffar +# 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: Install required library pip: name: pdpyras @@ -21,4 +22,4 @@ access_token: "{{ pd_api_access_token }}" pd_user: "{{ fullname }}" pd_email: "{{ email }}" - state: "absent" \ No newline at end of file + state: "absent" diff --git a/tests/integration/targets/pagerduty_user/vars/main.yml b/tests/integration/targets/pagerduty_user/vars/main.yml index 384d4b9917..7237557271 100644 --- a/tests/integration/targets/pagerduty_user/vars/main.yml +++ b/tests/integration/targets/pagerduty_user/vars/main.yml @@ -1,5 +1,10 @@ +--- +# 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 + pd_api_access_token: your_api_access_token fullname: User Name email: user@email.com pd_role: observer -pd_teams: team1 \ No newline at end of file +pd_teams: team1 diff --git a/tests/integration/targets/pam_limits/aliases b/tests/integration/targets/pam_limits/aliases index abe0a21e22..3cde3b1715 100644 --- a/tests/integration/targets/pam_limits/aliases +++ b/tests/integration/targets/pam_limits/aliases @@ -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 + shippable/posix/group1 skip/aix skip/freebsd diff --git a/tests/integration/targets/pam_limits/files/test_pam_limits.conf b/tests/integration/targets/pam_limits/files/test_pam_limits.conf index 7310b4a021..7d5d8bc858 100644 --- a/tests/integration/targets/pam_limits/files/test_pam_limits.conf +++ b/tests/integration/targets/pam_limits/files/test_pam_limits.conf @@ -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 + # /etc/security/limits.conf diff --git a/tests/integration/targets/pam_limits/tasks/main.yml b/tests/integration/targets/pam_limits/tasks/main.yml index 840f8d244a..1c73394fb3 100644 --- a/tests/integration/targets/pam_limits/tasks/main.yml +++ b/tests/integration/targets/pam_limits/tasks/main.yml @@ -1,6 +1,7 @@ # Test code for the pam_limits module -# Copyright: (c) 2021, Abhijeet Kasurde -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, Abhijeet Kasurde +# 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: Set value for temp limit configuration set_fact: diff --git a/tests/integration/targets/pamd/aliases b/tests/integration/targets/pamd/aliases index abe0a21e22..3cde3b1715 100644 --- a/tests/integration/targets/pamd/aliases +++ b/tests/integration/targets/pamd/aliases @@ -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 + shippable/posix/group1 skip/aix skip/freebsd diff --git a/tests/integration/targets/pamd/tasks/main.yml b/tests/integration/targets/pamd/tasks/main.yml index 3835ff9db0..fdd16d166c 100644 --- a/tests/integration/targets/pamd/tasks/main.yml +++ b/tests/integration/targets/pamd/tasks/main.yml @@ -1,5 +1,6 @@ -# (c) 2021, Alexei Znamensky -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, 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 - name: Set value for temp limit configuration set_fact: diff --git a/tests/integration/targets/pids/aliases b/tests/integration/targets/pids/aliases index b59832142f..7a0fc5c1ea 100644 --- a/tests/integration/targets/pids/aliases +++ b/tests/integration/targets/pids/aliases @@ -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 + shippable/posix/group3 diff --git a/tests/integration/targets/pids/files/obtainpid.sh b/tests/integration/targets/pids/files/obtainpid.sh index 0cfa6a9e34..1090f87786 100644 --- a/tests/integration/targets/pids/files/obtainpid.sh +++ b/tests/integration/targets/pids/files/obtainpid.sh @@ -1,3 +1,7 @@ #!/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 + "$1" 100 & echo "$!" > "$2" diff --git a/tests/integration/targets/pids/files/sleeper.c b/tests/integration/targets/pids/files/sleeper.c index dcf9feaa6e..16d4b0eaa4 100644 --- a/tests/integration/targets/pids/files/sleeper.c +++ b/tests/integration/targets/pids/files/sleeper.c @@ -1,6 +1,7 @@ /* - * (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 */ #include diff --git a/tests/integration/targets/pids/meta/main.yml b/tests/integration/targets/pids/meta/main.yml index 1810d4bec9..982de6eb03 100644 --- a/tests/integration/targets/pids/meta/main.yml +++ b/tests/integration/targets/pids/meta/main.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 + dependencies: - setup_remote_tmp_dir diff --git a/tests/integration/targets/pids/tasks/main.yml b/tests/integration/targets/pids/tasks/main.yml index 52be9f1f99..ce7e221a0a 100644 --- a/tests/integration/targets/pids/tasks/main.yml +++ b/tests/integration/targets/pids/tasks/main.yml @@ -4,8 +4,9 @@ #################################################################### # Test code for the pids module -# Copyright: (c) 2019, Saranya Sridharan -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, Saranya Sridharan +# 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: Attempt installation of latest 'psutil' version pip: diff --git a/tests/integration/targets/pipx/aliases b/tests/integration/targets/pipx/aliases index 9f7f442b32..0f370b3776 100644 --- a/tests/integration/targets/pipx/aliases +++ b/tests/integration/targets/pipx/aliases @@ -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 + destructive shippable/posix/group2 skip/python2 diff --git a/tests/integration/targets/pipx/tasks/main.yml b/tests/integration/targets/pipx/tasks/main.yml index ebf2b31076..2318a59ba4 100644 --- a/tests/integration/targets/pipx/tasks/main.yml +++ b/tests/integration/targets/pipx/tasks/main.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: install pipx pip: name: pipx @@ -16,11 +20,14 @@ name: tox register: install_tox +- name: set fact latest_tox_version + set_fact: + latest_tox_version: "{{ install_tox.application.tox.version }}" + - name: install application tox again community.general.pipx: name: tox register: install_tox_again - ignore_errors: yes - name: install application tox again force community.general.pipx: @@ -37,12 +44,12 @@ - name: check assertions tox assert: that: - - install_tox is changed - - "'tox' in install_tox.application" - - install_tox_again is not changed - - install_tox_again_force is changed - - uninstall_tox is changed - - "'tox' not in uninstall_tox.application" + - install_tox is changed + - "'tox' in install_tox.application" + - install_tox_again is not changed + - install_tox_again_force is changed + - uninstall_tox is changed + - "'tox' not in uninstall_tox.application" ############################################################################## - name: install application tox 3.24.0 @@ -57,12 +64,24 @@ state: reinstall register: reinstall_tox_324 -- name: upgrade tox 3.24.0 +- name: reinstall without name + community.general.pipx: + state: reinstall + register: reinstall_noname + ignore_errors: yes + +- name: upgrade tox from 3.24.0 community.general.pipx: name: tox state: upgrade register: upgrade_tox_324 +- name: upgrade without name + community.general.pipx: + state: upgrade + register: upgrade_noname + ignore_errors: yes + - name: downgrade tox 3.24.0 community.general.pipx: name: tox @@ -79,17 +98,78 @@ - name: check assertions tox 3.24.0 assert: that: - - install_tox_324 is changed - - "'tox' in install_tox_324.application" - - install_tox_324.application.tox.version == '3.24.0' - - reinstall_tox_324 is changed - - reinstall_tox_324.application.tox.version == '3.24.0' - - upgrade_tox_324 is changed - - upgrade_tox_324.application.tox.version != '3.24.0' - - downgrade_tox_324 is changed - - downgrade_tox_324.application.tox.version == '3.24.0' - - uninstall_tox_324 is changed - - "'tox' not in uninstall_tox_324.application" + - install_tox_324 is changed + - "'tox' in install_tox_324.application" + - install_tox_324.application.tox.version == '3.24.0' + - reinstall_tox_324 is changed + - reinstall_tox_324.application.tox.version == '3.24.0' + - upgrade_tox_324 is changed + - upgrade_tox_324.application.tox.version != '3.24.0' + - downgrade_tox_324 is changed + - downgrade_tox_324.application.tox.version == '3.24.0' + - uninstall_tox_324 is changed + - "'tox' not in uninstall_tox_324.application" + - upgrade_noname is failed + - reinstall_noname is failed + +############################################################################## +- name: install application latest tox + community.general.pipx: + name: tox + state: latest + register: install_tox_latest + +- name: cleanup tox latest + community.general.pipx: + state: absent + name: tox + register: uninstall_tox_latest + +- name: install application tox 3.24.0 for latest + community.general.pipx: + name: tox + source: tox==3.24.0 + register: install_tox_324_for_latest + +- name: install application latest tox + community.general.pipx: + name: tox + state: latest + register: install_tox_latest_with_preinstall + +- name: install application latest tox again + community.general.pipx: + name: tox + state: latest + register: install_tox_latest_with_preinstall_again + +- name: install application latest tox + community.general.pipx: + name: tox + state: latest + force: true + register: install_tox_latest_with_preinstall_again_force + +- name: cleanup tox latest again + community.general.pipx: + state: absent + name: tox + register: uninstall_tox_latest_again + +- name: check assertions tox latest + assert: + that: + - install_tox_latest is changed + - uninstall_tox_latest is changed + - install_tox_324_for_latest is changed + - install_tox_324_for_latest.application.tox.version == '3.24.0' + - install_tox_latest_with_preinstall is changed + - install_tox_latest_with_preinstall.application.tox.version == latest_tox_version + - install_tox_latest_with_preinstall_again is not changed + - install_tox_latest_with_preinstall_again.application.tox.version == latest_tox_version + - install_tox_latest_with_preinstall_again_force is changed + - install_tox_latest_with_preinstall_again_force.application.tox.version == latest_tox_version + - uninstall_tox_latest_again is changed ############################################################################## - name: ensure application ansible-lint is uninstalled @@ -119,34 +199,34 @@ - name: check assertions inject_packages assert: that: - - install_ansible_lint is changed - - inject_pkgs_ansible_lint is changed - - '"ansible-lint" in inject_pkgs_ansible_lint.application' - - '"licenses" in inject_pkgs_ansible_lint.application["ansible-lint"]["injected"]' - - uninstall_ansible_lint is changed + - install_ansible_lint is changed + - inject_pkgs_ansible_lint is changed + - '"ansible-lint" in inject_pkgs_ansible_lint.application' + - '"licenses" in inject_pkgs_ansible_lint.application["ansible-lint"]["injected"]' + - uninstall_ansible_lint is changed ############################################################################## - name: install jupyter - not working smoothly in freebsd - block: - - name: ensure application jupyter is uninstalled - community.general.pipx: - name: jupyter - state: absent - - - name: install application jupyter - community.general.pipx: - name: jupyter - install_deps: true - register: install_jupyter - - - name: cleanup jupyter - community.general.pipx: - state: absent - name: jupyter - - - name: check assertions - assert: - that: - - install_jupyter is changed - - '"ipython" in install_jupyter.stdout' when: ansible_system != 'FreeBSD' + block: + - name: ensure application jupyter is uninstalled + community.general.pipx: + name: jupyter + state: absent + + - name: install application jupyter + community.general.pipx: + name: jupyter + install_deps: true + register: install_jupyter + + - name: cleanup jupyter + community.general.pipx: + state: absent + name: jupyter + + - name: check assertions + assert: + that: + - install_jupyter is changed + - '"ipython" in install_jupyter.stdout' diff --git a/tests/integration/targets/pipx_info/aliases b/tests/integration/targets/pipx_info/aliases new file mode 100644 index 0000000000..c42790aedf --- /dev/null +++ b/tests/integration/targets/pipx_info/aliases @@ -0,0 +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 + +destructive +shippable/posix/group3 +skip/python2 +skip/python3.5 diff --git a/tests/integration/targets/pipx_info/tasks/main.yml b/tests/integration/targets/pipx_info/tasks/main.yml new file mode 100644 index 0000000000..61163afd08 --- /dev/null +++ b/tests/integration/targets/pipx_info/tasks/main.yml @@ -0,0 +1,139 @@ +--- +# 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: install pipx + pip: + name: pipx + extra_args: --user + +############################################################################## +- name: ensure application tox is uninstalled + community.general.pipx: + state: absent + name: tox + +- name: retrieve applications (empty) + community.general.pipx_info: {} + register: info_empty + +- name: install application tox + community.general.pipx: + name: tox + +- name: retrieve applications + community.general.pipx_info: {} + register: info_all + +- name: retrieve applications (include_deps=true) + community.general.pipx_info: + include_deps: true + register: info_all_deps + +- name: retrieve application tox + community.general.pipx_info: + name: tox + include_deps: true + register: info_tox + +- name: uninstall application tox + community.general.pipx: + state: absent + name: tox + +- name: check assertions tox + assert: + that: + - info_empty.application|length == 0 + + - info_all.application|length == 1 + - info_all.application[0].name == "tox" + - "'version' in info_all.application[0]" + - "'dependencies' not in info_all.application[0]" + - "'injected' not in info_all.application[0]" + + - info_all_deps.application|length == 1 + - info_all_deps.application[0].name == "tox" + - "'version' in info_all_deps.application[0]" + - info_all_deps.application[0].dependencies == ["virtualenv"] + - "'injected' not in info_all.application[0]" + + - info_tox.application == info_all_deps.application + +############################################################################## +- name: set test applications + set_fact: + apps: + - name: tox + source: tox==3.24.0 + - name: ansible-lint + inject_packages: + - licenses + +- name: ensure applications are uninstalled + community.general.pipx: + name: "{{ item.name }}" + state: absent + loop: "{{ apps }}" + +- name: install applications + community.general.pipx: + name: "{{ item.name }}" + source: "{{ item.source|default(omit) }}" + loop: "{{ apps }}" + +- name: inject packages + community.general.pipx: + state: inject + name: "{{ item.name }}" + inject_packages: "{{ item.inject_packages }}" + when: "'inject_packages' in item" + loop: "{{ apps }}" + +- name: retrieve applications + community.general.pipx_info: {} + register: info2_all + +- name: retrieve applications (include_deps=true) + community.general.pipx_info: + include_deps: true + include_injected: true + register: info2_all_deps + +- name: retrieve application ansible-lint + community.general.pipx_info: + name: ansible-lint + include_deps: true + include_injected: true + register: info2_lint + +- name: ensure applications are uninstalled + community.general.pipx: + name: "{{ item.name }}" + state: absent + loop: "{{ apps }}" + +- name: check assertions multiple apps + assert: + that: + - all_apps|length == 2 + - all_apps[1].name == "tox" + - all_apps[1].version == "3.24.0" + - "'dependencies' not in all_apps[1]" + - "'injected' not in all_apps[1]" + + - all_apps_deps|length == 2 + - all_apps_deps[1].name == "tox" + - all_apps_deps[1].version == "3.24.0" + - all_apps_deps[1].dependencies == ["virtualenv"] + - "'injected' in all_apps_deps[0]" + - "'licenses' in all_apps_deps[0].injected" + + - lint|length == 1 + - all_apps_deps|length == 2 + - lint[0] == all_apps_deps[0] + vars: + all_apps: "{{ info2_all.application|sort(attribute='name') }}" + all_apps_deps: "{{ info2_all_deps.application|sort(attribute='name') }}" + lint: "{{ info2_lint.application|sort(attribute='name') }}" diff --git a/tests/integration/targets/pkgng/aliases b/tests/integration/targets/pkgng/aliases index 360849e61b..6972c2b6c8 100644 --- a/tests/integration/targets/pkgng/aliases +++ b/tests/integration/targets/pkgng/aliases @@ -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 + shippable/posix/group1 needs/root skip/docker diff --git a/tests/integration/targets/pkgng/tasks/create-outofdate-pkg.yml b/tests/integration/targets/pkgng/tasks/create-outofdate-pkg.yml index 7010aeaa0a..e63cb72312 100644 --- a/tests/integration/targets/pkgng/tasks/create-outofdate-pkg.yml +++ b/tests/integration/targets/pkgng/tasks/create-outofdate-pkg.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: Create temporary directory for package creation tempfile: state: directory diff --git a/tests/integration/targets/pkgng/tasks/freebsd.yml b/tests/integration/targets/pkgng/tasks/freebsd.yml index f5274d5c5d..d17a3083d3 100644 --- a/tests/integration/targets/pkgng/tasks/freebsd.yml +++ b/tests/integration/targets/pkgng/tasks/freebsd.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 + ## ## pkgng - prepare test environment ## @@ -461,7 +465,15 @@ # NOTE: FreeBSD 12.0 test runner receives a "connection reset by peer" after ~20% downloaded so we are # only running this on 12.1 or higher # - when: ansible_distribution_version is version('12.01', '>=') + # NOTE: FreeBSD 13.0 fails to update the package catalogue for unknown reasons (someone with FreeBSD + # knowledge has to take a look) + # + # NOTE: FreeBSD 13.1 fails to update the package catalogue for unknown reasons (someone with FreeBSD + # knowledge has to take a look) + # + when: >- + (ansible_distribution_version is version('12.01', '>=') and ansible_distribution_version is version('13.0', '<')) + or ansible_distribution_version is version('13.2', '>=') block: - name: Setup testjail include: setup-testjail.yml diff --git a/tests/integration/targets/pkgng/tasks/install_single_package.yml b/tests/integration/targets/pkgng/tasks/install_single_package.yml index 7115b8a8a1..00768085ca 100644 --- a/tests/integration/targets/pkgng/tasks/install_single_package.yml +++ b/tests/integration/targets/pkgng/tasks/install_single_package.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: Verify package sentinel file is not present stat: path: '{{ pkgng_test_install_prefix | default("") }}{{ pkgng_test_pkg_sentinelfile_path }}' diff --git a/tests/integration/targets/pkgng/tasks/main.yml b/tests/integration/targets/pkgng/tasks/main.yml index d9e340bd40..59ca83d9f0 100644 --- a/tests/integration/targets/pkgng/tasks/main.yml +++ b/tests/integration/targets/pkgng/tasks/main.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 + - import_tasks: freebsd.yml when: - ansible_facts.distribution == 'FreeBSD' diff --git a/tests/integration/targets/pkgng/tasks/setup-testjail.yml b/tests/integration/targets/pkgng/tasks/setup-testjail.yml index 22130745ef..99505af591 100644 --- a/tests/integration/targets/pkgng/tasks/setup-testjail.yml +++ b/tests/integration/targets/pkgng/tasks/setup-testjail.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 + # # Instructions for setting up a jail # https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails-ezjail.html diff --git a/tests/integration/targets/pkgng/templates/MANIFEST.json.j2.license b/tests/integration/targets/pkgng/templates/MANIFEST.json.j2.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/pkgng/templates/MANIFEST.json.j2.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/tests/integration/targets/pkgng/vars/main.yml b/tests/integration/targets/pkgng/vars/main.yml index d5aca65cdd..e32cc4110c 100644 --- a/tests/integration/targets/pkgng/vars/main.yml +++ b/tests/integration/targets/pkgng/vars/main.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 + pkgng_test_outofdate_pkg_path: "/tmp/ansible_pkgng_test_package.pkg" pkgng_test_pkg_name: zsh pkgng_test_pkg_category: shells diff --git a/tests/integration/targets/pkgutil/aliases b/tests/integration/targets/pkgutil/aliases index 5e163ed765..4232e0baa5 100644 --- a/tests/integration/targets/pkgutil/aliases +++ b/tests/integration/targets/pkgutil/aliases @@ -1,2 +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 + destructive unsupported diff --git a/tests/integration/targets/pkgutil/tasks/main.yml b/tests/integration/targets/pkgutil/tasks/main.yml index f2bf44e88c..e6f32ccc7a 100644 --- a/tests/integration/targets/pkgutil/tasks/main.yml +++ b/tests/integration/targets/pkgutil/tasks/main.yml @@ -1,7 +1,8 @@ # Test code for the pkgutil module -# Copyright: (c) 2019, Dag Wieers (@dagwieers) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, 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 # CLEAN ENVIRONMENT diff --git a/tests/integration/targets/proxmox/aliases b/tests/integration/targets/proxmox/aliases index caa35b7354..5e5957a5c2 100644 --- a/tests/integration/targets/proxmox/aliases +++ b/tests/integration/targets/proxmox/aliases @@ -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 + unsupported proxmox_domain_info proxmox_group_info diff --git a/tests/integration/targets/proxmox/tasks/main.yml b/tests/integration/targets/proxmox/tasks/main.yml index 5954d3f11f..fc7e084e90 100644 --- a/tests/integration/targets/proxmox/tasks/main.yml +++ b/tests/integration/targets/proxmox/tasks/main.yml @@ -3,8 +3,9 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### -# 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 - name: List domains proxmox_domain_info: diff --git a/tests/integration/targets/python_requirements_info/aliases b/tests/integration/targets/python_requirements_info/aliases index 765b70da79..be75e3ddab 100644 --- a/tests/integration/targets/python_requirements_info/aliases +++ b/tests/integration/targets/python_requirements_info/aliases @@ -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 + shippable/posix/group2 diff --git a/tests/integration/targets/python_requirements_info/tasks/main.yml b/tests/integration/targets/python_requirements_info/tasks/main.yml index 035306cdee..24a7d1366a 100644 --- a/tests/integration/targets/python_requirements_info/tasks/main.yml +++ b/tests/integration/targets/python_requirements_info/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: run python_requirements_info module python_requirements_info: register: basic_info diff --git a/tests/integration/targets/read_csv/aliases b/tests/integration/targets/read_csv/aliases index 765b70da79..be75e3ddab 100644 --- a/tests/integration/targets/read_csv/aliases +++ b/tests/integration/targets/read_csv/aliases @@ -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 + shippable/posix/group2 diff --git a/tests/integration/targets/read_csv/tasks/main.yml b/tests/integration/targets/read_csv/tasks/main.yml index e1379b1ccd..325a102c21 100644 --- a/tests/integration/targets/read_csv/tasks/main.yml +++ b/tests/integration/targets/read_csv/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + # Create basic CSV file - name: Create unique CSV file copy: diff --git a/tests/integration/targets/redis_info/aliases b/tests/integration/targets/redis_info/aliases index c8c8757ff2..8573c40daa 100644 --- a/tests/integration/targets/redis_info/aliases +++ b/tests/integration/targets/redis_info/aliases @@ -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 + destructive shippable/posix/group1 skip/aix diff --git a/tests/integration/targets/redis_info/defaults/main.yml b/tests/integration/targets/redis_info/defaults/main.yml index e1f03ee7ed..56e9c4386d 100644 --- a/tests/integration/targets/redis_info/defaults/main.yml +++ b/tests/integration/targets/redis_info/defaults/main.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 + redis_password: PASS master_port: 6379 replica_port: 6380 diff --git a/tests/integration/targets/redis_info/meta/main.yml b/tests/integration/targets/redis_info/meta/main.yml index 5b07837132..cd516fd239 100644 --- a/tests/integration/targets/redis_info/meta/main.yml +++ b/tests/integration/targets/redis_info/meta/main.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 + dependencies: - setup_redis_replication diff --git a/tests/integration/targets/redis_info/tasks/main.yml b/tests/integration/targets/redis_info/tasks/main.yml index dc76101157..e696066b26 100644 --- a/tests/integration/targets/redis_info/tasks/main.yml +++ b/tests/integration/targets/redis_info/tasks/main.yml @@ -3,8 +3,9 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### -# Copyright: (c) 2020, Pavlo Bashynskyi (@levonet) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2020, Pavlo Bashynskyi (@levonet) +# 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: redis_info - connect to master with default host/port community.general.redis_info: diff --git a/tests/integration/targets/rundeck/aliases b/tests/integration/targets/rundeck/aliases index 41c0922440..0da9ab1822 100644 --- a/tests/integration/targets/rundeck/aliases +++ b/tests/integration/targets/rundeck/aliases @@ -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 + destructive shippable/posix/group1 skip/aix diff --git a/tests/integration/targets/rundeck/defaults/main.yml b/tests/integration/targets/rundeck/defaults/main.yml index 1fe3871186..4d7ea31468 100644 --- a/tests/integration/targets/rundeck/defaults/main.yml +++ b/tests/integration/targets/rundeck/defaults/main.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 + rundeck_url: http://localhost:4440 rundeck_api_version: 39 rundeck_job_id: 3b8a6e54-69fb-42b7-b98f-f82e59238478 diff --git a/tests/integration/targets/rundeck/files/test_job.yaml b/tests/integration/targets/rundeck/files/test_job.yaml index baae3ac9d8..baa852ecce 100644 --- a/tests/integration/targets/rundeck/files/test_job.yaml +++ b/tests/integration/targets/rundeck/files/test_job.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 + - defaultTab: nodes description: '' executionEnabled: true diff --git a/tests/integration/targets/rundeck/meta/main.yml b/tests/integration/targets/rundeck/meta/main.yml index 3b4174fac6..c125e4046a 100644 --- a/tests/integration/targets/rundeck/meta/main.yml +++ b/tests/integration/targets/rundeck/meta/main.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 + dependencies: - setup_rundeck diff --git a/tests/integration/targets/rundeck/tasks/main.yml b/tests/integration/targets/rundeck/tasks/main.yml index e9bb2beb8d..0c7e5bd09d 100644 --- a/tests/integration/targets/rundeck/tasks/main.yml +++ b/tests/integration/targets/rundeck/tasks/main.yml @@ -1,8 +1,12 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Generate a Rundeck API Token ansible.builtin.command: java -jar {{ rdeck_base }}/rundeck-cli.jar tokens create -u admin -d 24h -r admin diff --git a/tests/integration/targets/scaleway_compute/aliases b/tests/integration/targets/scaleway_compute/aliases index f24a42a8e5..b2267f6311 100644 --- a/tests/integration/targets/scaleway_compute/aliases +++ b/tests/integration/targets/scaleway_compute/aliases @@ -1,2 +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 + cloud/scaleway unsupported diff --git a/tests/integration/targets/scaleway_compute/defaults/main.yml b/tests/integration/targets/scaleway_compute/defaults/main.yml index 4b2b2799c3..dfa104bdd0 100644 --- a/tests/integration/targets/scaleway_compute/defaults/main.yml +++ b/tests/integration/targets/scaleway_compute/defaults/main.yml @@ -1,5 +1,9 @@ -# Below information has been taken from https://developer.scaleway.com/#servers --- +# 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 + +# Below information has been taken from https://developer.scaleway.com/#servers scaleway_image_id: 6a601340-19c1-4ca7-9c1c-0704bcc9f5fe scaleway_organization: '{{ scw_org }}' scaleway_region: ams1 diff --git a/tests/integration/targets/scaleway_compute/tasks/ip.yml b/tests/integration/targets/scaleway_compute/tasks/ip.yml index 445e955d8c..f6b7840fd9 100644 --- a/tests/integration/targets/scaleway_compute/tasks/ip.yml +++ b/tests/integration/targets/scaleway_compute/tasks/ip.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: Create a server with no IP (Check) check_mode: yes scaleway_compute: @@ -198,4 +203,4 @@ - assert: that: - server_destroy_task is success - - server_destroy_task is changed \ No newline at end of file + - server_destroy_task is changed diff --git a/tests/integration/targets/scaleway_compute/tasks/main.yml b/tests/integration/targets/scaleway_compute/tasks/main.yml index 8945a41cc1..eca689b402 100644 --- a/tests/integration/targets/scaleway_compute/tasks/main.yml +++ b/tests/integration/targets/scaleway_compute/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + - include_tasks: state.yml - include_tasks: ip.yml - include_tasks: security_group.yml diff --git a/tests/integration/targets/scaleway_compute/tasks/pagination.yml b/tests/integration/targets/scaleway_compute/tasks/pagination.yml index 7b7dd49bd4..5a674b8014 100644 --- a/tests/integration/targets/scaleway_compute/tasks/pagination.yml +++ b/tests/integration/targets/scaleway_compute/tasks/pagination.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: Create a first server scaleway_compute: name: '{{ first_server_name }}' diff --git a/tests/integration/targets/scaleway_compute/tasks/security_group.yml b/tests/integration/targets/scaleway_compute/tasks/security_group.yml index a0e273c2ca..6126514212 100644 --- a/tests/integration/targets/scaleway_compute/tasks/security_group.yml +++ b/tests/integration/targets/scaleway_compute/tasks/security_group.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: Create a scaleway security_group scaleway_security_group: state: present diff --git a/tests/integration/targets/scaleway_compute/tasks/state.yml b/tests/integration/targets/scaleway_compute/tasks/state.yml index effd27e85f..8f015ad337 100644 --- a/tests/integration/targets/scaleway_compute/tasks/state.yml +++ b/tests/integration/targets/scaleway_compute/tasks/state.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: Create a server (Check) check_mode: yes scaleway_compute: diff --git a/tests/integration/targets/scaleway_database_backup/aliases b/tests/integration/targets/scaleway_database_backup/aliases index 03de00bcd8..b2267f6311 100644 --- a/tests/integration/targets/scaleway_database_backup/aliases +++ b/tests/integration/targets/scaleway_database_backup/aliases @@ -1,2 +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 + cloud/scaleway -unsupported \ No newline at end of file +unsupported diff --git a/tests/integration/targets/scaleway_database_backup/defaults/main.yml b/tests/integration/targets/scaleway_database_backup/defaults/main.yml index 0e2cdcb94a..1a5306ecf4 100644 --- a/tests/integration/targets/scaleway_database_backup/defaults/main.yml +++ b/tests/integration/targets/scaleway_database_backup/defaults/main.yml @@ -1,5 +1,9 @@ --- +# 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 + scaleway_name: scaleway_database_backup_test scaleway_region: fr-par scaleway_database_name: scaleway_database_test -scaleway_instance_id: \ No newline at end of file +scaleway_instance_id: diff --git a/tests/integration/targets/scaleway_database_backup/tasks/main.yml b/tests/integration/targets/scaleway_database_backup/tasks/main.yml index 11d06f8fff..b0af65c0ae 100644 --- a/tests/integration/targets/scaleway_database_backup/tasks/main.yml +++ b/tests/integration/targets/scaleway_database_backup/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Create a backup (Check) check_mode: yes scaleway_database_backup: diff --git a/tests/integration/targets/scaleway_image_info/aliases b/tests/integration/targets/scaleway_image_info/aliases index f24a42a8e5..b2267f6311 100644 --- a/tests/integration/targets/scaleway_image_info/aliases +++ b/tests/integration/targets/scaleway_image_info/aliases @@ -1,2 +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 + cloud/scaleway unsupported diff --git a/tests/integration/targets/scaleway_image_info/tasks/main.yml b/tests/integration/targets/scaleway_image_info/tasks/main.yml index 20513771c3..2cdf34fdd4 100644 --- a/tests/integration/targets/scaleway_image_info/tasks/main.yml +++ b/tests/integration/targets/scaleway_image_info/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Get image informations and register it in a variable scaleway_image_info: region: par1 diff --git a/tests/integration/targets/scaleway_ip/aliases b/tests/integration/targets/scaleway_ip/aliases index f24a42a8e5..b2267f6311 100644 --- a/tests/integration/targets/scaleway_ip/aliases +++ b/tests/integration/targets/scaleway_ip/aliases @@ -1,2 +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 + cloud/scaleway unsupported diff --git a/tests/integration/targets/scaleway_ip/defaults/main.yml b/tests/integration/targets/scaleway_ip/defaults/main.yml index fe7aa93baf..00ec26ff66 100644 --- a/tests/integration/targets/scaleway_ip/defaults/main.yml +++ b/tests/integration/targets/scaleway_ip/defaults/main.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 + scaleway_organization: '{{ scw_org }}' scaleway_region: ams1 scaleway_image_id: 89ee4018-f8c3-4dc4-a6b5-bca14f985ebe diff --git a/tests/integration/targets/scaleway_ip/tasks/main.yml b/tests/integration/targets/scaleway_ip/tasks/main.yml index dcb4fae754..fe0f578fa8 100644 --- a/tests/integration/targets/scaleway_ip/tasks/main.yml +++ b/tests/integration/targets/scaleway_ip/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Create IP (Check) check_mode: yes scaleway_ip: diff --git a/tests/integration/targets/scaleway_ip_info/aliases b/tests/integration/targets/scaleway_ip_info/aliases index f24a42a8e5..b2267f6311 100644 --- a/tests/integration/targets/scaleway_ip_info/aliases +++ b/tests/integration/targets/scaleway_ip_info/aliases @@ -1,2 +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 + cloud/scaleway unsupported diff --git a/tests/integration/targets/scaleway_ip_info/tasks/main.yml b/tests/integration/targets/scaleway_ip_info/tasks/main.yml index 519189794a..b560b56586 100644 --- a/tests/integration/targets/scaleway_ip_info/tasks/main.yml +++ b/tests/integration/targets/scaleway_ip_info/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Get ip informations and register it in a variable scaleway_ip_info: region: par1 diff --git a/tests/integration/targets/scaleway_lb/aliases b/tests/integration/targets/scaleway_lb/aliases index f24a42a8e5..b2267f6311 100644 --- a/tests/integration/targets/scaleway_lb/aliases +++ b/tests/integration/targets/scaleway_lb/aliases @@ -1,2 +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 + cloud/scaleway unsupported diff --git a/tests/integration/targets/scaleway_lb/defaults/main.yml b/tests/integration/targets/scaleway_lb/defaults/main.yml index 48d56e1089..c0d37800ad 100644 --- a/tests/integration/targets/scaleway_lb/defaults/main.yml +++ b/tests/integration/targets/scaleway_lb/defaults/main.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 + scaleway_region: fr-par name: lb_ansible_test description: Load-balancer used for testing scaleway_lb ansible module diff --git a/tests/integration/targets/scaleway_lb/tasks/main.yml b/tests/integration/targets/scaleway_lb/tasks/main.yml index 7da0bcbb71..05237e1a78 100644 --- a/tests/integration/targets/scaleway_lb/tasks/main.yml +++ b/tests/integration/targets/scaleway_lb/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Create a load-balancer (Check) check_mode: yes scaleway_lb: diff --git a/tests/integration/targets/scaleway_organization_info/aliases b/tests/integration/targets/scaleway_organization_info/aliases index f24a42a8e5..b2267f6311 100644 --- a/tests/integration/targets/scaleway_organization_info/aliases +++ b/tests/integration/targets/scaleway_organization_info/aliases @@ -1,2 +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 + cloud/scaleway unsupported diff --git a/tests/integration/targets/scaleway_organization_info/tasks/main.yml b/tests/integration/targets/scaleway_organization_info/tasks/main.yml index 3998360953..7326ca2266 100644 --- a/tests/integration/targets/scaleway_organization_info/tasks/main.yml +++ b/tests/integration/targets/scaleway_organization_info/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Get organization informations and register it in a variable scaleway_organization_info: register: organizations diff --git a/tests/integration/targets/scaleway_security_group/aliases b/tests/integration/targets/scaleway_security_group/aliases index f24a42a8e5..b2267f6311 100644 --- a/tests/integration/targets/scaleway_security_group/aliases +++ b/tests/integration/targets/scaleway_security_group/aliases @@ -1,2 +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 + cloud/scaleway unsupported diff --git a/tests/integration/targets/scaleway_security_group/defaults/main.yml b/tests/integration/targets/scaleway_security_group/defaults/main.yml index 13bbef06af..ffada80807 100644 --- a/tests/integration/targets/scaleway_security_group/defaults/main.yml +++ b/tests/integration/targets/scaleway_security_group/defaults/main.yml @@ -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 + scaleway_organization: '{{ scw_org }}' scaleway_region: ams1 diff --git a/tests/integration/targets/scaleway_security_group/tasks/main.yml b/tests/integration/targets/scaleway_security_group/tasks/main.yml index 1c4e409b63..362166e291 100644 --- a/tests/integration/targets/scaleway_security_group/tasks/main.yml +++ b/tests/integration/targets/scaleway_security_group/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Create security group check check_mode: yes scaleway_security_group: @@ -131,4 +136,4 @@ assert: that: - security_group_deletion is success - - security_group_deletion is not changed \ No newline at end of file + - security_group_deletion is not changed diff --git a/tests/integration/targets/scaleway_security_group_info/aliases b/tests/integration/targets/scaleway_security_group_info/aliases index f24a42a8e5..b2267f6311 100644 --- a/tests/integration/targets/scaleway_security_group_info/aliases +++ b/tests/integration/targets/scaleway_security_group_info/aliases @@ -1,2 +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 + cloud/scaleway unsupported diff --git a/tests/integration/targets/scaleway_security_group_info/tasks/main.yml b/tests/integration/targets/scaleway_security_group_info/tasks/main.yml index 1c0c0afcd9..8029a1e9aa 100644 --- a/tests/integration/targets/scaleway_security_group_info/tasks/main.yml +++ b/tests/integration/targets/scaleway_security_group_info/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Get security group informations and register it in a variable scaleway_security_group_info: region: par1 diff --git a/tests/integration/targets/scaleway_security_group_rule/aliases b/tests/integration/targets/scaleway_security_group_rule/aliases index f24a42a8e5..b2267f6311 100644 --- a/tests/integration/targets/scaleway_security_group_rule/aliases +++ b/tests/integration/targets/scaleway_security_group_rule/aliases @@ -1,2 +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 + cloud/scaleway unsupported diff --git a/tests/integration/targets/scaleway_security_group_rule/defaults/main.yml b/tests/integration/targets/scaleway_security_group_rule/defaults/main.yml index 9c56c4db77..965ccf594a 100644 --- a/tests/integration/targets/scaleway_security_group_rule/defaults/main.yml +++ b/tests/integration/targets/scaleway_security_group_rule/defaults/main.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 + scaleway_organization: '{{ scw_org }}' scaleway_region: par1 protocol: "TCP" diff --git a/tests/integration/targets/scaleway_security_group_rule/tasks/main.yml b/tests/integration/targets/scaleway_security_group_rule/tasks/main.yml index c6f6396b7b..3839421955 100644 --- a/tests/integration/targets/scaleway_security_group_rule/tasks/main.yml +++ b/tests/integration/targets/scaleway_security_group_rule/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Create a scaleway security_group scaleway_security_group: state: present @@ -244,4 +249,4 @@ stateful: true inbound_default_policy: accept outbound_default_policy: accept - organization_default: false \ No newline at end of file + organization_default: false diff --git a/tests/integration/targets/scaleway_server_info/aliases b/tests/integration/targets/scaleway_server_info/aliases index f24a42a8e5..b2267f6311 100644 --- a/tests/integration/targets/scaleway_server_info/aliases +++ b/tests/integration/targets/scaleway_server_info/aliases @@ -1,2 +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 + cloud/scaleway unsupported diff --git a/tests/integration/targets/scaleway_server_info/tasks/main.yml b/tests/integration/targets/scaleway_server_info/tasks/main.yml index a85a221f11..7274e8a85b 100644 --- a/tests/integration/targets/scaleway_server_info/tasks/main.yml +++ b/tests/integration/targets/scaleway_server_info/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Get server informations and register it in a variable scaleway_server_info: region: par1 diff --git a/tests/integration/targets/scaleway_snapshot_info/aliases b/tests/integration/targets/scaleway_snapshot_info/aliases index f24a42a8e5..b2267f6311 100644 --- a/tests/integration/targets/scaleway_snapshot_info/aliases +++ b/tests/integration/targets/scaleway_snapshot_info/aliases @@ -1,2 +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 + cloud/scaleway unsupported diff --git a/tests/integration/targets/scaleway_snapshot_info/tasks/main.yml b/tests/integration/targets/scaleway_snapshot_info/tasks/main.yml index 39807698f1..44f15d5156 100644 --- a/tests/integration/targets/scaleway_snapshot_info/tasks/main.yml +++ b/tests/integration/targets/scaleway_snapshot_info/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Get snapshot informations and register it in a variable scaleway_snapshot_info: region: par1 diff --git a/tests/integration/targets/scaleway_sshkey/aliases b/tests/integration/targets/scaleway_sshkey/aliases index f24a42a8e5..b2267f6311 100644 --- a/tests/integration/targets/scaleway_sshkey/aliases +++ b/tests/integration/targets/scaleway_sshkey/aliases @@ -1,2 +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 + cloud/scaleway unsupported diff --git a/tests/integration/targets/scaleway_sshkey/tasks/main.yml b/tests/integration/targets/scaleway_sshkey/tasks/main.yml index b951fbad18..2871086251 100644 --- a/tests/integration/targets/scaleway_sshkey/tasks/main.yml +++ b/tests/integration/targets/scaleway_sshkey/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + - scaleway_sshkey: ssh_pub_key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDf29yyommeGyKSIgSmX0ISVXP+3x6RUY4JDGLoAMFh2efkfDaRVdsvkvnFuUywgP2RewrjTyLE8w0NpCBHVS5Fm1BAn3yvxOUtTMxTbsQcw6HQ8swJ02+1tewJYjHPwc4GrBqiDo3Nmlq354Us0zBOJg/bBzuEnVD5eJ3GO3gKaCSUYTVrYwO0U4eJE0D9OJeUP9J48kl4ULbCub976+mTHdBvlzRw0Tzfl2kxgdDwlks0l2NefY/uiTdz2oMt092bAY3wZHxjto/DXoChxvaf5s2k8Zb+J7CjimUYnzPlH+zA9F6ROjP5AUu6ZWPd0jOIBl1nDWWb2j/qfNLYM43l sieben@sieben-macbook.local" state: present diff --git a/tests/integration/targets/scaleway_user_data/aliases b/tests/integration/targets/scaleway_user_data/aliases index f24a42a8e5..b2267f6311 100644 --- a/tests/integration/targets/scaleway_user_data/aliases +++ b/tests/integration/targets/scaleway_user_data/aliases @@ -1,2 +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 + cloud/scaleway unsupported diff --git a/tests/integration/targets/scaleway_user_data/defaults/main.yml b/tests/integration/targets/scaleway_user_data/defaults/main.yml index 69396fccaa..7c53696b69 100644 --- a/tests/integration/targets/scaleway_user_data/defaults/main.yml +++ b/tests/integration/targets/scaleway_user_data/defaults/main.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 cloud_init_script: ''' #cloud-config diff --git a/tests/integration/targets/scaleway_user_data/tasks/main.yml b/tests/integration/targets/scaleway_user_data/tasks/main.yml index df744709d9..b1cd856ec8 100644 --- a/tests/integration/targets/scaleway_user_data/tasks/main.yml +++ b/tests/integration/targets/scaleway_user_data/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Create a server scaleway_compute: name: foobar diff --git a/tests/integration/targets/scaleway_volume/aliases b/tests/integration/targets/scaleway_volume/aliases index f24a42a8e5..b2267f6311 100644 --- a/tests/integration/targets/scaleway_volume/aliases +++ b/tests/integration/targets/scaleway_volume/aliases @@ -1,2 +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 + cloud/scaleway unsupported diff --git a/tests/integration/targets/scaleway_volume/defaults/main.yml b/tests/integration/targets/scaleway_volume/defaults/main.yml index 13bbef06af..ffada80807 100644 --- a/tests/integration/targets/scaleway_volume/defaults/main.yml +++ b/tests/integration/targets/scaleway_volume/defaults/main.yml @@ -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 + scaleway_organization: '{{ scw_org }}' scaleway_region: ams1 diff --git a/tests/integration/targets/scaleway_volume/tasks/main.yml b/tests/integration/targets/scaleway_volume/tasks/main.yml index 3f983db9d3..2828a8502c 100644 --- a/tests/integration/targets/scaleway_volume/tasks/main.yml +++ b/tests/integration/targets/scaleway_volume/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Make sure volume is not there before tests scaleway_volume: name: ansible-test-volume diff --git a/tests/integration/targets/scaleway_volume_info/aliases b/tests/integration/targets/scaleway_volume_info/aliases index f24a42a8e5..b2267f6311 100644 --- a/tests/integration/targets/scaleway_volume_info/aliases +++ b/tests/integration/targets/scaleway_volume_info/aliases @@ -1,2 +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 + cloud/scaleway unsupported diff --git a/tests/integration/targets/scaleway_volume_info/tasks/main.yml b/tests/integration/targets/scaleway_volume_info/tasks/main.yml index ce3f13cb93..45995a54c4 100644 --- a/tests/integration/targets/scaleway_volume_info/tasks/main.yml +++ b/tests/integration/targets/scaleway_volume_info/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Get volume informations and register it in a variable scaleway_volume_info: region: par1 diff --git a/tests/integration/targets/sefcontext/aliases b/tests/integration/targets/sefcontext/aliases index 58a2a31e7e..3a1d1f7e34 100644 --- a/tests/integration/targets/sefcontext/aliases +++ b/tests/integration/targets/sefcontext/aliases @@ -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 + needs/root shippable/posix/group2 skip/aix diff --git a/tests/integration/targets/sefcontext/meta/main.yml b/tests/integration/targets/sefcontext/meta/main.yml index 5438ced5c3..2fcd152f95 100644 --- a/tests/integration/targets/sefcontext/meta/main.yml +++ b/tests/integration/targets/sefcontext/meta/main.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 + dependencies: - setup_pkg_mgr diff --git a/tests/integration/targets/sefcontext/tasks/main.yml b/tests/integration/targets/sefcontext/tasks/main.yml index e450dee977..8eeac62fb5 100644 --- a/tests/integration/targets/sefcontext/tasks/main.yml +++ b/tests/integration/targets/sefcontext/tasks/main.yml @@ -1,24 +1,12 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### -# (c) 2016, Dag Wieers - -# 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) 2016, 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 # FIXME: Unfortunately ansible_selinux could be a boolean or a dictionary ! - debug: diff --git a/tests/integration/targets/sefcontext/tasks/sefcontext.yml b/tests/integration/targets/sefcontext/tasks/sefcontext.yml index b452ea28c2..e4d2d50baa 100644 --- a/tests/integration/targets/sefcontext/tasks/sefcontext.yml +++ b/tests/integration/targets/sefcontext/tasks/sefcontext.yml @@ -1,19 +1,7 @@ -# (c) 2016, Dag Wieers - -# 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) 2016, 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 - name: install requirements for RHEL package: diff --git a/tests/integration/targets/sensu_client/aliases b/tests/integration/targets/sensu_client/aliases index 5dcaaac61c..225cabc08b 100644 --- a/tests/integration/targets/sensu_client/aliases +++ b/tests/integration/targets/sensu_client/aliases @@ -1,2 +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 + shippable/posix/group1 needs/root diff --git a/tests/integration/targets/sensu_client/tasks/main.yml b/tests/integration/targets/sensu_client/tasks/main.yml index 0203ee0cf9..61e49cda02 100644 --- a/tests/integration/targets/sensu_client/tasks/main.yml +++ b/tests/integration/targets/sensu_client/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Creating a client if the directory doesn't exist should work sensu_client: subscriptions: diff --git a/tests/integration/targets/sensu_handler/aliases b/tests/integration/targets/sensu_handler/aliases index 5dcaaac61c..225cabc08b 100644 --- a/tests/integration/targets/sensu_handler/aliases +++ b/tests/integration/targets/sensu_handler/aliases @@ -1,2 +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 + shippable/posix/group1 needs/root diff --git a/tests/integration/targets/sensu_handler/tasks/main.yml b/tests/integration/targets/sensu_handler/tasks/main.yml index 795cdfcb6b..606be6b789 100644 --- a/tests/integration/targets/sensu_handler/tasks/main.yml +++ b/tests/integration/targets/sensu_handler/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Creating a handler if the directory doesn't exist should work sensu_handler: name: "handler" diff --git a/tests/integration/targets/sensu_handler/tasks/pipe.yml b/tests/integration/targets/sensu_handler/tasks/pipe.yml index 02f59a4cd1..46fe240808 100644 --- a/tests/integration/targets/sensu_handler/tasks/pipe.yml +++ b/tests/integration/targets/sensu_handler/tasks/pipe.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 + # Note: Pipe handlers are also tested and used as part of basic main.yml coverage - name: Configuring a handler with missing pipe parameters should fail sensu_handler: diff --git a/tests/integration/targets/sensu_handler/tasks/set.yml b/tests/integration/targets/sensu_handler/tasks/set.yml index 393d711dc3..e9a86057c2 100644 --- a/tests/integration/targets/sensu_handler/tasks/set.yml +++ b/tests/integration/targets/sensu_handler/tasks/set.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: Configuring a handler with missing set parameters should fail sensu_handler: name: "set" diff --git a/tests/integration/targets/sensu_handler/tasks/tcp.yml b/tests/integration/targets/sensu_handler/tasks/tcp.yml index 076ea14e1e..a5db1d3973 100644 --- a/tests/integration/targets/sensu_handler/tasks/tcp.yml +++ b/tests/integration/targets/sensu_handler/tasks/tcp.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: Configuring a handler with missing tcp parameters should fail sensu_handler: name: "tcp" diff --git a/tests/integration/targets/sensu_handler/tasks/transport.yml b/tests/integration/targets/sensu_handler/tasks/transport.yml index 34816194fa..fa2563fa9b 100644 --- a/tests/integration/targets/sensu_handler/tasks/transport.yml +++ b/tests/integration/targets/sensu_handler/tasks/transport.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: Configuring a handler with missing transport parameters should fail sensu_handler: name: "transport" diff --git a/tests/integration/targets/sensu_handler/tasks/udp.yml b/tests/integration/targets/sensu_handler/tasks/udp.yml index 8f13a2a25e..60e88bb986 100644 --- a/tests/integration/targets/sensu_handler/tasks/udp.yml +++ b/tests/integration/targets/sensu_handler/tasks/udp.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: Configuring a handler with missing udp parameters should fail sensu_handler: name: "udp" diff --git a/tests/integration/targets/setup_cron/defaults/main.yml b/tests/integration/targets/setup_cron/defaults/main.yml index e4b0123da2..aa7de77fec 100644 --- a/tests/integration/targets/setup_cron/defaults/main.yml +++ b/tests/integration/targets/setup_cron/defaults/main.yml @@ -1 +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 + remote_dir: "{{ lookup('env', 'OUTPUT_DIR') }}" diff --git a/tests/integration/targets/setup_cron/meta/main.yml b/tests/integration/targets/setup_cron/meta/main.yml index 5438ced5c3..2fcd152f95 100644 --- a/tests/integration/targets/setup_cron/meta/main.yml +++ b/tests/integration/targets/setup_cron/meta/main.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 + dependencies: - setup_pkg_mgr diff --git a/tests/integration/targets/setup_cron/tasks/main.yml b/tests/integration/targets/setup_cron/tasks/main.yml index 5a83e025be..cca7071a3a 100644 --- a/tests/integration/targets/setup_cron/tasks/main.yml +++ b/tests/integration/targets/setup_cron/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + - when: - not (ansible_os_family == 'Alpine' and ansible_distribution_version is version('3.15', '<')) # TODO block: diff --git a/tests/integration/targets/setup_cron/vars/alpine.yml b/tests/integration/targets/setup_cron/vars/alpine.yml index ae713e3a8d..7c28829c60 100644 --- a/tests/integration/targets/setup_cron/vars/alpine.yml +++ b/tests/integration/targets/setup_cron/vars/alpine.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 + cron_pkg: cronie cron_service: cronie list_pkg_files: apk info -L diff --git a/tests/integration/targets/setup_cron/vars/archlinux.yml b/tests/integration/targets/setup_cron/vars/archlinux.yml index 2ebe8d11ca..c714683ada 100644 --- a/tests/integration/targets/setup_cron/vars/archlinux.yml +++ b/tests/integration/targets/setup_cron/vars/archlinux.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 + cron_pkg: cronie cron_service: cronie list_pkg_files: pacman -Ql diff --git a/tests/integration/targets/setup_cron/vars/debian.yml b/tests/integration/targets/setup_cron/vars/debian.yml index cd04871c5d..1eefe007c7 100644 --- a/tests/integration/targets/setup_cron/vars/debian.yml +++ b/tests/integration/targets/setup_cron/vars/debian.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 + cron_pkg: cron cron_service: cron list_pkg_files: dpkg -L diff --git a/tests/integration/targets/setup_cron/vars/default.yml b/tests/integration/targets/setup_cron/vars/default.yml index e69de29bb2..f55df21f81 100644 --- a/tests/integration/targets/setup_cron/vars/default.yml +++ b/tests/integration/targets/setup_cron/vars/default.yml @@ -0,0 +1,4 @@ +--- +# 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 diff --git a/tests/integration/targets/setup_cron/vars/fedora.yml b/tests/integration/targets/setup_cron/vars/fedora.yml index b80a51b54d..0d17db6bad 100644 --- a/tests/integration/targets/setup_cron/vars/fedora.yml +++ b/tests/integration/targets/setup_cron/vars/fedora.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 + cron_pkg: cronie cron_service: crond list_pkg_files: rpm -ql diff --git a/tests/integration/targets/setup_cron/vars/freebsd.yml b/tests/integration/targets/setup_cron/vars/freebsd.yml index 41ed449395..2848710160 100644 --- a/tests/integration/targets/setup_cron/vars/freebsd.yml +++ b/tests/integration/targets/setup_cron/vars/freebsd.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 + cron_pkg: cron_service: cron list_pkg_files: pkg info --list-files diff --git a/tests/integration/targets/setup_cron/vars/redhat.yml b/tests/integration/targets/setup_cron/vars/redhat.yml index 2dff13de09..2998f7b845 100644 --- a/tests/integration/targets/setup_cron/vars/redhat.yml +++ b/tests/integration/targets/setup_cron/vars/redhat.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 + cron_pkg: cronie cron_service: crond faketime_pkg: diff --git a/tests/integration/targets/setup_cron/vars/suse.yml b/tests/integration/targets/setup_cron/vars/suse.yml index cd3677a6e8..77e7e09e34 100644 --- a/tests/integration/targets/setup_cron/vars/suse.yml +++ b/tests/integration/targets/setup_cron/vars/suse.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 + cron_pkg: cron cron_service: cron list_pkg_files: rpm -ql diff --git a/tests/integration/targets/setup_epel/tasks/main.yml b/tests/integration/targets/setup_epel/tasks/main.yml index 21627cfa1d..186d515f41 100644 --- a/tests/integration/targets/setup_epel/tasks/main.yml +++ b/tests/integration/targets/setup_epel/tasks/main.yml @@ -1,10 +1,25 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Install EPEL yum: name: https://s3.amazonaws.com/ansible-ci-files/test/integration/targets/setup_epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm disable_gpg_check: true - when: ansible_facts.distribution in ['RedHat', 'CentOS'] + when: + - ansible_facts.distribution in ['RedHat', 'CentOS'] + - ansible_facts.distribution_major_version == '6' + +- name: Install EPEL + yum: + name: https://ci-files.testing.ansible.com/test/integration/targets/setup_epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm + disable_gpg_check: true + when: + - ansible_facts.distribution in ['RedHat', 'CentOS'] + - ansible_facts.distribution_major_version != '6' diff --git a/tests/integration/targets/setup_etcd3/defaults/main.yml b/tests/integration/targets/setup_etcd3/defaults/main.yml index 95e4b837a7..f185ef0c25 100644 --- a/tests/integration/targets/setup_etcd3/defaults/main.yml +++ b/tests/integration/targets/setup_etcd3/defaults/main.yml @@ -3,8 +3,9 @@ # (c) 2017, Jean-Philippe Evrard # 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) 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 +# # Copyright (c) 2018, Ansible Project # etcd3_ver: "v3.2.14" etcd3_download_server: "https://storage.googleapis.com/etcd" diff --git a/tests/integration/targets/setup_etcd3/meta/main.yml b/tests/integration/targets/setup_etcd3/meta/main.yml index 5438ced5c3..2fcd152f95 100644 --- a/tests/integration/targets/setup_etcd3/meta/main.yml +++ b/tests/integration/targets/setup_etcd3/meta/main.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 + dependencies: - setup_pkg_mgr diff --git a/tests/integration/targets/setup_etcd3/tasks/main.yml b/tests/integration/targets/setup_etcd3/tasks/main.yml index de7697e927..ddd7ab8988 100644 --- a/tests/integration/targets/setup_etcd3/tasks/main.yml +++ b/tests/integration/targets/setup_etcd3/tasks/main.yml @@ -5,23 +5,10 @@ #################################################################### # setup etcd3 for integration tests on module/lookup -# (c) 2017, Jean-Philippe Evrard -# 2020, SCC France, Eric Belhomme - -# 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 2017, Jean-Philippe Evrard +# Copyright 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 # ============================================================ diff --git a/tests/integration/targets/setup_etcd3/vars/RedHat-7.yml b/tests/integration/targets/setup_etcd3/vars/RedHat-7.yml index 2e0c082446..6e1017fe83 100644 --- a/tests/integration/targets/setup_etcd3/vars/RedHat-7.yml +++ b/tests/integration/targets/setup_etcd3/vars/RedHat-7.yml @@ -1 +1,6 @@ -etcd3_pip_module: etcd3<0.12 \ No newline at end of file +--- +# 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 + +etcd3_pip_module: etcd3<0.12 diff --git a/tests/integration/targets/setup_etcd3/vars/Suse-py3.yml b/tests/integration/targets/setup_etcd3/vars/Suse-py3.yml index bacd4a371a..4e7c275b89 100644 --- a/tests/integration/targets/setup_etcd3/vars/Suse-py3.yml +++ b/tests/integration/targets/setup_etcd3/vars/Suse-py3.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 + # SuSE's python 3.6.10 comes with six 1.11.0 as distutil # we restrict to etcd3 < 0.11 to avoid pip to try to upgrade six etcd3_pip_module: 'etcd3<0.11' diff --git a/tests/integration/targets/setup_etcd3/vars/Suse.yml b/tests/integration/targets/setup_etcd3/vars/Suse.yml index bacd4a371a..4e7c275b89 100644 --- a/tests/integration/targets/setup_etcd3/vars/Suse.yml +++ b/tests/integration/targets/setup_etcd3/vars/Suse.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 + # SuSE's python 3.6.10 comes with six 1.11.0 as distutil # we restrict to etcd3 < 0.11 to avoid pip to try to upgrade six etcd3_pip_module: 'etcd3<0.11' diff --git a/tests/integration/targets/setup_etcd3/vars/default.yml b/tests/integration/targets/setup_etcd3/vars/default.yml index 4a01b0ace8..f7e08fa314 100644 --- a/tests/integration/targets/setup_etcd3/vars/default.yml +++ b/tests/integration/targets/setup_etcd3/vars/default.yml @@ -1,2 +1,6 @@ --- -# default should don't touch anything \ No newline at end of file +# 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 + +# default should don't touch anything diff --git a/tests/integration/targets/setup_flatpak_remote/README.md b/tests/integration/targets/setup_flatpak_remote/README.md index d7916c14b3..44dfeb0c63 100644 --- a/tests/integration/targets/setup_flatpak_remote/README.md +++ b/tests/integration/targets/setup_flatpak_remote/README.md @@ -1,3 +1,9 @@ + + # Create a dummy flatpak repository remote This document describes how to create a local flatpak dummy repo. Just like the one contained in the `files/repo.tar.gxz` archive. diff --git a/tests/integration/targets/setup_flatpak_remote/create-repo.sh b/tests/integration/targets/setup_flatpak_remote/create-repo.sh index 3f44fe96f2..11c7621842 100755 --- a/tests/integration/targets/setup_flatpak_remote/create-repo.sh +++ b/tests/integration/targets/setup_flatpak_remote/create-repo.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 + set -eux # Delete traces from last run diff --git a/tests/integration/targets/setup_flatpak_remote/files/repo.tar.xz.license b/tests/integration/targets/setup_flatpak_remote/files/repo.tar.xz.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/setup_flatpak_remote/files/repo.tar.xz.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/tests/integration/targets/setup_flatpak_remote/handlers/main.yaml b/tests/integration/targets/setup_flatpak_remote/handlers/main.yaml index 9380dee96b..0c88d256e9 100644 --- a/tests/integration/targets/setup_flatpak_remote/handlers/main.yaml +++ b/tests/integration/targets/setup_flatpak_remote/handlers/main.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 + - name: remove temporary flatpak link file: state: absent diff --git a/tests/integration/targets/setup_flatpak_remote/meta/main.yaml b/tests/integration/targets/setup_flatpak_remote/meta/main.yaml index 75ee4583ac..1b3d5b8758 100644 --- a/tests/integration/targets/setup_flatpak_remote/meta/main.yaml +++ b/tests/integration/targets/setup_flatpak_remote/meta/main.yaml @@ -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 + dependencies: - setup_remote_tmp_dir diff --git a/tests/integration/targets/setup_flatpak_remote/tasks/main.yaml b/tests/integration/targets/setup_flatpak_remote/tasks/main.yaml index 65581abed7..037784738a 100644 --- a/tests/integration/targets/setup_flatpak_remote/tasks/main.yaml +++ b/tests/integration/targets/setup_flatpak_remote/tasks/main.yaml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Set up dummy flatpak repository remote when: | ansible_distribution == 'Fedora' or diff --git a/tests/integration/targets/setup_gnutar/handlers/main.yml b/tests/integration/targets/setup_gnutar/handlers/main.yml index b4f66cd393..975e0b47a8 100644 --- a/tests/integration/targets/setup_gnutar/handlers/main.yml +++ b/tests/integration/targets/setup_gnutar/handlers/main.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: uninstall gnu-tar community.general.homebrew: name: gnu-tar diff --git a/tests/integration/targets/setup_gnutar/tasks/main.yml b/tests/integration/targets/setup_gnutar/tasks/main.yml index 7b973d474b..c7024666b0 100644 --- a/tests/integration/targets/setup_gnutar/tasks/main.yml +++ b/tests/integration/targets/setup_gnutar/tasks/main.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 + - when: ansible_facts.distribution == 'MacOSX' block: - name: MACOS | Find brew binary diff --git a/tests/integration/targets/setup_influxdb/tasks/main.yml b/tests/integration/targets/setup_influxdb/tasks/main.yml index 6b2a59c52d..939a49da73 100644 --- a/tests/integration/targets/setup_influxdb/tasks/main.yml +++ b/tests/integration/targets/setup_influxdb/tasks/main.yml @@ -4,6 +4,9 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 - include: setup.yml when: ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'trusty' diff --git a/tests/integration/targets/setup_influxdb/tasks/setup.yml b/tests/integration/targets/setup_influxdb/tasks/setup.yml index 0069be1562..205bd27d8f 100644 --- a/tests/integration/targets/setup_influxdb/tasks/setup.yml +++ b/tests/integration/targets/setup_influxdb/tasks/setup.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 - name: Install https transport for apt and ca-certificates apt: name={{ item }} state=latest force=yes diff --git a/tests/integration/targets/setup_java_keytool/meta/main.yml b/tests/integration/targets/setup_java_keytool/meta/main.yml index 2be15776b7..d4a5c7d05a 100644 --- a/tests/integration/targets/setup_java_keytool/meta/main.yml +++ b/tests/integration/targets/setup_java_keytool/meta/main.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 + dependencies: - setup_remote_constraints - setup_pkg_mgr diff --git a/tests/integration/targets/setup_java_keytool/tasks/main.yml b/tests/integration/targets/setup_java_keytool/tasks/main.yml index be84495266..2ab57d59d6 100644 --- a/tests/integration/targets/setup_java_keytool/tasks/main.yml +++ b/tests/integration/targets/setup_java_keytool/tasks/main.yml @@ -3,6 +3,11 @@ # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### + +# 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 + - set_fact: has_java_keytool: >- {{ diff --git a/tests/integration/targets/setup_java_keytool/vars/Alpine.yml b/tests/integration/targets/setup_java_keytool/vars/Alpine.yml index 471da74d6b..4ff75ae8c3 100644 --- a/tests/integration/targets/setup_java_keytool/vars/Alpine.yml +++ b/tests/integration/targets/setup_java_keytool/vars/Alpine.yml @@ -1,2 +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 + keytool_package_name: openjdk11-jre-headless diff --git a/tests/integration/targets/setup_java_keytool/vars/Archlinux.yml b/tests/integration/targets/setup_java_keytool/vars/Archlinux.yml index 15acabe1e5..9e29065b3d 100644 --- a/tests/integration/targets/setup_java_keytool/vars/Archlinux.yml +++ b/tests/integration/targets/setup_java_keytool/vars/Archlinux.yml @@ -1,2 +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 + keytool_package_name: jre11-openjdk-headless diff --git a/tests/integration/targets/setup_java_keytool/vars/Debian.yml b/tests/integration/targets/setup_java_keytool/vars/Debian.yml index faace450a7..30ae5cd047 100644 --- a/tests/integration/targets/setup_java_keytool/vars/Debian.yml +++ b/tests/integration/targets/setup_java_keytool/vars/Debian.yml @@ -1,2 +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 + keytool_package_name: ca-certificates-java diff --git a/tests/integration/targets/setup_java_keytool/vars/RedHat.yml b/tests/integration/targets/setup_java_keytool/vars/RedHat.yml index d301dff436..c200091f81 100644 --- a/tests/integration/targets/setup_java_keytool/vars/RedHat.yml +++ b/tests/integration/targets/setup_java_keytool/vars/RedHat.yml @@ -1,2 +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 + keytool_package_name: java-11-openjdk-headless diff --git a/tests/integration/targets/setup_java_keytool/vars/Suse.yml b/tests/integration/targets/setup_java_keytool/vars/Suse.yml index d301dff436..c200091f81 100644 --- a/tests/integration/targets/setup_java_keytool/vars/Suse.yml +++ b/tests/integration/targets/setup_java_keytool/vars/Suse.yml @@ -1,2 +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 + keytool_package_name: java-11-openjdk-headless diff --git a/tests/integration/targets/setup_mosquitto/files/mosquitto.conf b/tests/integration/targets/setup_mosquitto/files/mosquitto.conf index 84a80b71c3..4503302939 100644 --- a/tests/integration/targets/setup_mosquitto/files/mosquitto.conf +++ b/tests/integration/targets/setup_mosquitto/files/mosquitto.conf @@ -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 + # Plain MQTT protocol listener 1883 diff --git a/tests/integration/targets/setup_mosquitto/meta/main.yml b/tests/integration/targets/setup_mosquitto/meta/main.yml index af05db79d4..488c355d06 100644 --- a/tests/integration/targets/setup_mosquitto/meta/main.yml +++ b/tests/integration/targets/setup_mosquitto/meta/main.yml @@ -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 + dependencies: - setup_tls diff --git a/tests/integration/targets/setup_mosquitto/tasks/main.yml b/tests/integration/targets/setup_mosquitto/tasks/main.yml index 6573ca4684..836d94529e 100644 --- a/tests/integration/targets/setup_mosquitto/tasks/main.yml +++ b/tests/integration/targets/setup_mosquitto/tasks/main.yml @@ -4,5 +4,9 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + - include: ubuntu.yml when: ansible_distribution == 'Ubuntu' diff --git a/tests/integration/targets/setup_mosquitto/tasks/ubuntu.yml b/tests/integration/targets/setup_mosquitto/tasks/ubuntu.yml index 5675cb8923..dd1c340d08 100644 --- a/tests/integration/targets/setup_mosquitto/tasks/ubuntu.yml +++ b/tests/integration/targets/setup_mosquitto/tasks/ubuntu.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: Install https transport for apt apt: name: apt-transport-https diff --git a/tests/integration/targets/setup_openldap/files/initial_config.ldif b/tests/integration/targets/setup_openldap/files/initial_config.ldif index 13397758f3..8f8c537bd3 100644 --- a/tests/integration/targets/setup_openldap/files/initial_config.ldif +++ b/tests/integration/targets/setup_openldap/files/initial_config.ldif @@ -19,4 +19,4 @@ cn: LDAP Test gecos: LDAP Test displayName: LDAP Test mail: ldap.test@example.com -sn: Test \ No newline at end of file +sn: Test diff --git a/tests/integration/targets/setup_openldap/files/initial_config.ldif.license b/tests/integration/targets/setup_openldap/files/initial_config.ldif.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/setup_openldap/files/initial_config.ldif.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/tests/integration/targets/setup_openldap/files/rootpw_cnconfig.ldif b/tests/integration/targets/setup_openldap/files/rootpw_cnconfig.ldif index 1fc061dde8..7fb34d93ba 100644 --- a/tests/integration/targets/setup_openldap/files/rootpw_cnconfig.ldif +++ b/tests/integration/targets/setup_openldap/files/rootpw_cnconfig.ldif @@ -1,4 +1,4 @@ dn: olcDatabase={0}config,cn=config changetype: modify replace: olcRootPW -olcRootPW: "Test1234!" \ No newline at end of file +olcRootPW: "Test1234!" diff --git a/tests/integration/targets/setup_openldap/files/rootpw_cnconfig.ldif.license b/tests/integration/targets/setup_openldap/files/rootpw_cnconfig.ldif.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/setup_openldap/files/rootpw_cnconfig.ldif.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/tests/integration/targets/setup_openldap/meta/main.yml b/tests/integration/targets/setup_openldap/meta/main.yml index b63c3d017c..2fcd152f95 100644 --- a/tests/integration/targets/setup_openldap/meta/main.yml +++ b/tests/integration/targets/setup_openldap/meta/main.yml @@ -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 + dependencies: - setup_pkg_mgr diff --git a/tests/integration/targets/setup_openldap/tasks/main.yml b/tests/integration/targets/setup_openldap/tasks/main.yml index dcf2cc7834..67f6d5c9c2 100644 --- a/tests/integration/targets/setup_openldap/tasks/main.yml +++ b/tests/integration/targets/setup_openldap/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Setup OpenLDAP on Debian or Ubuntu block: - name: Include OS-specific variables diff --git a/tests/integration/targets/setup_openldap/vars/Debian.yml b/tests/integration/targets/setup_openldap/vars/Debian.yml index bcc4feb9ed..3b4f198108 100644 --- a/tests/integration/targets/setup_openldap/vars/Debian.yml +++ b/tests/integration/targets/setup_openldap/vars/Debian.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 + python_ldap_package_name: python-ldap python_ldap_package_name_python3: python3-ldap openldap_packages_name: diff --git a/tests/integration/targets/setup_openldap/vars/Ubuntu.yml b/tests/integration/targets/setup_openldap/vars/Ubuntu.yml index bcc4feb9ed..3b4f198108 100644 --- a/tests/integration/targets/setup_openldap/vars/Ubuntu.yml +++ b/tests/integration/targets/setup_openldap/vars/Ubuntu.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 + python_ldap_package_name: python-ldap python_ldap_package_name_python3: python3-ldap openldap_packages_name: diff --git a/tests/integration/targets/setup_opennebula/meta/main.yml b/tests/integration/targets/setup_opennebula/meta/main.yml index 91a63627f6..fe9e33681d 100644 --- a/tests/integration/targets/setup_opennebula/meta/main.yml +++ b/tests/integration/targets/setup_opennebula/meta/main.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 + dependencies: - setup_remote_constraints diff --git a/tests/integration/targets/setup_opennebula/tasks/main.yml b/tests/integration/targets/setup_opennebula/tasks/main.yml index 6d18e147da..b7babbaab4 100644 --- a/tests/integration/targets/setup_opennebula/tasks/main.yml +++ b/tests/integration/targets/setup_opennebula/tasks/main.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: Install required library pip: name: pyone diff --git a/tests/integration/targets/setup_opennebula/vars/main.yml b/tests/integration/targets/setup_opennebula/vars/main.yml index 05cf47e2cf..39b48270a3 100644 --- a/tests/integration/targets/setup_opennebula/vars/main.yml +++ b/tests/integration/targets/setup_opennebula/vars/main.yml @@ -1,6 +1,9 @@ --- +# 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 opennebula_test: hosts: - hv1 - - hv2 \ No newline at end of file + - hv2 diff --git a/tests/integration/targets/setup_openssl/meta/main.yml b/tests/integration/targets/setup_openssl/meta/main.yml index 2be15776b7..d4a5c7d05a 100644 --- a/tests/integration/targets/setup_openssl/meta/main.yml +++ b/tests/integration/targets/setup_openssl/meta/main.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 + dependencies: - setup_remote_constraints - setup_pkg_mgr diff --git a/tests/integration/targets/setup_openssl/tasks/main.yml b/tests/integration/targets/setup_openssl/tasks/main.yml index a449926eaf..2ce926ba54 100644 --- a/tests/integration/targets/setup_openssl/tasks/main.yml +++ b/tests/integration/targets/setup_openssl/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Include OS-specific variables include_vars: '{{ lookup("first_found", search) }}' vars: diff --git a/tests/integration/targets/setup_openssl/vars/Alpine.yml b/tests/integration/targets/setup_openssl/vars/Alpine.yml index 664da81f7f..c5d4d23a4c 100644 --- a/tests/integration/targets/setup_openssl/vars/Alpine.yml +++ b/tests/integration/targets/setup_openssl/vars/Alpine.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 + cryptography_package_name: py-cryptography cryptography_package_name_python3: py3-cryptography pyopenssl_package_name: py-openssl diff --git a/tests/integration/targets/setup_openssl/vars/Archlinux.yml b/tests/integration/targets/setup_openssl/vars/Archlinux.yml index f503b8e9d0..b6ae2fe108 100644 --- a/tests/integration/targets/setup_openssl/vars/Archlinux.yml +++ b/tests/integration/targets/setup_openssl/vars/Archlinux.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 + cryptography_package_name: python-cryptography cryptography_package_name_python3: python-cryptography pyopenssl_package_name: python-pyopenssl diff --git a/tests/integration/targets/setup_openssl/vars/CentOS-8.yml b/tests/integration/targets/setup_openssl/vars/CentOS-8.yml index a3521337c9..875a697183 100644 --- a/tests/integration/targets/setup_openssl/vars/CentOS-8.yml +++ b/tests/integration/targets/setup_openssl/vars/CentOS-8.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 + cryptography_package_name: python-cryptography cryptography_package_name_python3: python3-cryptography openssl_package_name: openssl diff --git a/tests/integration/targets/setup_openssl/vars/Darwin.yml b/tests/integration/targets/setup_openssl/vars/Darwin.yml index 8dfa88ebae..b3dbd9811d 100644 --- a/tests/integration/targets/setup_openssl/vars/Darwin.yml +++ b/tests/integration/targets/setup_openssl/vars/Darwin.yml @@ -1 +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 + cryptography_from_pip: true diff --git a/tests/integration/targets/setup_openssl/vars/Debian.yml b/tests/integration/targets/setup_openssl/vars/Debian.yml index 8181922778..6ef3df1a10 100644 --- a/tests/integration/targets/setup_openssl/vars/Debian.yml +++ b/tests/integration/targets/setup_openssl/vars/Debian.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 + cryptography_package_name: python-cryptography cryptography_package_name_python3: python3-cryptography pyopenssl_package_name: python-openssl diff --git a/tests/integration/targets/setup_openssl/vars/FreeBSD.yml b/tests/integration/targets/setup_openssl/vars/FreeBSD.yml index 6de6920e5d..e5ad6812f0 100644 --- a/tests/integration/targets/setup_openssl/vars/FreeBSD.yml +++ b/tests/integration/targets/setup_openssl/vars/FreeBSD.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 + cryptography_package_name: py27-cryptography cryptography_package_name_python3: "py{{ ansible_python.version.major }}{{ ansible_python.version.minor }}-cryptography" pyopenssl_package_name: py27-openssl diff --git a/tests/integration/targets/setup_openssl/vars/RedHat-9.yml b/tests/integration/targets/setup_openssl/vars/RedHat-9.yml new file mode 100644 index 0000000000..ac9b3344eb --- /dev/null +++ b/tests/integration/targets/setup_openssl/vars/RedHat-9.yml @@ -0,0 +1,9 @@ +--- +# 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 + +cryptography_package_name: python-cryptography +cryptography_package_name_python3: python3-cryptography +openssl_package_name: openssl +cryptography_from_pip: false diff --git a/tests/integration/targets/setup_openssl/vars/RedHat.yml b/tests/integration/targets/setup_openssl/vars/RedHat.yml index 0ae46a475f..ef78bab01d 100644 --- a/tests/integration/targets/setup_openssl/vars/RedHat.yml +++ b/tests/integration/targets/setup_openssl/vars/RedHat.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 + cryptography_package_name: python-cryptography cryptography_package_name_python3: python3-cryptography pyopenssl_package_name: pyOpenSSL diff --git a/tests/integration/targets/setup_openssl/vars/Suse.yml b/tests/integration/targets/setup_openssl/vars/Suse.yml index 6725aa79b6..b7d246653c 100644 --- a/tests/integration/targets/setup_openssl/vars/Suse.yml +++ b/tests/integration/targets/setup_openssl/vars/Suse.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 + cryptography_package_name: python-cryptography cryptography_package_name_python3: python3-cryptography pyopenssl_package_name: python-pyOpenSSL diff --git a/tests/integration/targets/setup_pkg_mgr/tasks/archlinux.yml b/tests/integration/targets/setup_pkg_mgr/tasks/archlinux.yml index b92f22d2e1..fc75f84dfd 100644 --- a/tests/integration/targets/setup_pkg_mgr/tasks/archlinux.yml +++ b/tests/integration/targets/setup_pkg_mgr/tasks/archlinux.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 + # Since Arch Linux is a rolling distribution, it regularly needs its packages upgraded, otherwise some tests might # stop working due to conflicts during package installation. Since there is no good way to do this on container # startup time, we use the setup_pkg_mgr setup role to do this once per CI run (hopefully). In case the Arch Linux diff --git a/tests/integration/targets/setup_pkg_mgr/tasks/main.yml b/tests/integration/targets/setup_pkg_mgr/tasks/main.yml index 9e028ffeed..a42b4b4a03 100644 --- a/tests/integration/targets/setup_pkg_mgr/tasks/main.yml +++ b/tests/integration/targets/setup_pkg_mgr/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + - set_fact: pkg_mgr: community.general.pkgng ansible_pkg_mgr: community.general.pkgng diff --git a/tests/integration/targets/setup_postgresql_db/defaults/main.yml b/tests/integration/targets/setup_postgresql_db/defaults/main.yml index aea0244280..1a33ecafab 100644 --- a/tests/integration/targets/setup_postgresql_db/defaults/main.yml +++ b/tests/integration/targets/setup_postgresql_db/defaults/main.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 + postgresql_service: postgresql postgresql_packages: diff --git a/tests/integration/targets/setup_postgresql_db/files/dummy--1.0.sql b/tests/integration/targets/setup_postgresql_db/files/dummy--1.0.sql index 53c79666b4..89b318d77c 100644 --- a/tests/integration/targets/setup_postgresql_db/files/dummy--1.0.sql +++ b/tests/integration/targets/setup_postgresql_db/files/dummy--1.0.sql @@ -1,2 +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 + CREATE OR REPLACE FUNCTION dummy_display_ext_version() RETURNS text LANGUAGE SQL AS 'SELECT (''1.0'')::text'; diff --git a/tests/integration/targets/setup_postgresql_db/files/dummy--2.0.sql b/tests/integration/targets/setup_postgresql_db/files/dummy--2.0.sql index 227ba1b4c4..c9386cac49 100644 --- a/tests/integration/targets/setup_postgresql_db/files/dummy--2.0.sql +++ b/tests/integration/targets/setup_postgresql_db/files/dummy--2.0.sql @@ -1,2 +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 + CREATE OR REPLACE FUNCTION dummy_display_ext_version() RETURNS text LANGUAGE SQL AS 'SELECT (''2.0'')::text'; diff --git a/tests/integration/targets/setup_postgresql_db/files/dummy--3.0.sql b/tests/integration/targets/setup_postgresql_db/files/dummy--3.0.sql index 7d6a60e543..a96bc85874 100644 --- a/tests/integration/targets/setup_postgresql_db/files/dummy--3.0.sql +++ b/tests/integration/targets/setup_postgresql_db/files/dummy--3.0.sql @@ -1,2 +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 + CREATE OR REPLACE FUNCTION dummy_display_ext_version() RETURNS text LANGUAGE SQL AS 'SELECT (''3.0'')::text'; diff --git a/tests/integration/targets/setup_postgresql_db/files/dummy.control.license b/tests/integration/targets/setup_postgresql_db/files/dummy.control.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/setup_postgresql_db/files/dummy.control.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/tests/integration/targets/setup_postgresql_db/files/pg_hba.conf b/tests/integration/targets/setup_postgresql_db/files/pg_hba.conf index 58de3607f9..e6b14c4d79 100644 --- a/tests/integration/targets/setup_postgresql_db/files/pg_hba.conf +++ b/tests/integration/targets/setup_postgresql_db/files/pg_hba.conf @@ -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 + # !!! This file managed by Ansible. Any local changes may be overwritten. !!! # Database administrative login by UNIX sockets diff --git a/tests/integration/targets/setup_postgresql_db/meta/main.yml b/tests/integration/targets/setup_postgresql_db/meta/main.yml index 5438ced5c3..2fcd152f95 100644 --- a/tests/integration/targets/setup_postgresql_db/meta/main.yml +++ b/tests/integration/targets/setup_postgresql_db/meta/main.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 + dependencies: - setup_pkg_mgr diff --git a/tests/integration/targets/setup_postgresql_db/tasks/main.yml b/tests/integration/targets/setup_postgresql_db/tasks/main.yml index 4812cf2ab0..7c9baa4074 100644 --- a/tests/integration/targets/setup_postgresql_db/tasks/main.yml +++ b/tests/integration/targets/setup_postgresql_db/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + # Exit when Suse because it causes CI problems - meta: end_play when: ansible_os_family == 'Suse' diff --git a/tests/integration/targets/setup_postgresql_db/vars/Alpine-py3.yml b/tests/integration/targets/setup_postgresql_db/vars/Alpine-py3.yml index e7d9b5aea6..99a8a14b86 100644 --- a/tests/integration/targets/setup_postgresql_db/vars/Alpine-py3.yml +++ b/tests/integration/targets/setup_postgresql_db/vars/Alpine-py3.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 + postgresql_packages: - "postgresql" - "py3-psycopg2" diff --git a/tests/integration/targets/setup_postgresql_db/vars/Archlinux-py3.yml b/tests/integration/targets/setup_postgresql_db/vars/Archlinux-py3.yml index 693328e92b..40215d1ad9 100644 --- a/tests/integration/targets/setup_postgresql_db/vars/Archlinux-py3.yml +++ b/tests/integration/targets/setup_postgresql_db/vars/Archlinux-py3.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 + postgresql_packages: - "postgresql" - "python-psycopg2" diff --git a/tests/integration/targets/setup_postgresql_db/vars/Debian-11-py3.yml b/tests/integration/targets/setup_postgresql_db/vars/Debian-11-py3.yml index a46ecd2bd5..1ffd257b2e 100644 --- a/tests/integration/targets/setup_postgresql_db/vars/Debian-11-py3.yml +++ b/tests/integration/targets/setup_postgresql_db/vars/Debian-11-py3.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 + postgresql_packages: - "postgresql" - "postgresql-common" diff --git a/tests/integration/targets/setup_postgresql_db/vars/Debian-8.yml b/tests/integration/targets/setup_postgresql_db/vars/Debian-8.yml index c5c6795eac..87063214a8 100644 --- a/tests/integration/targets/setup_postgresql_db/vars/Debian-8.yml +++ b/tests/integration/targets/setup_postgresql_db/vars/Debian-8.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 + postgresql_packages: - "postgresql" - "postgresql-common" diff --git a/tests/integration/targets/setup_postgresql_db/vars/FreeBSD-11-py3.yml b/tests/integration/targets/setup_postgresql_db/vars/FreeBSD-11-py3.yml index e24226b4bc..a92de47cb2 100644 --- a/tests/integration/targets/setup_postgresql_db/vars/FreeBSD-11-py3.yml +++ b/tests/integration/targets/setup_postgresql_db/vars/FreeBSD-11-py3.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 + postgresql_packages: - postgresql95-server - "py{{ ansible_python.version.major }}{{ ansible_python.version.minor }}-psycopg2" diff --git a/tests/integration/targets/setup_postgresql_db/vars/FreeBSD-11.yml b/tests/integration/targets/setup_postgresql_db/vars/FreeBSD-11.yml index efb0603b5e..c38f3b59be 100644 --- a/tests/integration/targets/setup_postgresql_db/vars/FreeBSD-11.yml +++ b/tests/integration/targets/setup_postgresql_db/vars/FreeBSD-11.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 + postgresql_packages: - postgresql95-server - py27-psycopg2 diff --git a/tests/integration/targets/setup_postgresql_db/vars/FreeBSD-12.0-py3.yml b/tests/integration/targets/setup_postgresql_db/vars/FreeBSD-12.0-py3.yml index e24226b4bc..a92de47cb2 100644 --- a/tests/integration/targets/setup_postgresql_db/vars/FreeBSD-12.0-py3.yml +++ b/tests/integration/targets/setup_postgresql_db/vars/FreeBSD-12.0-py3.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 + postgresql_packages: - postgresql95-server - "py{{ ansible_python.version.major }}{{ ansible_python.version.minor }}-psycopg2" diff --git a/tests/integration/targets/setup_postgresql_db/vars/FreeBSD-12.0.yml b/tests/integration/targets/setup_postgresql_db/vars/FreeBSD-12.0.yml index 1fe6678262..7c5586f5bf 100644 --- a/tests/integration/targets/setup_postgresql_db/vars/FreeBSD-12.0.yml +++ b/tests/integration/targets/setup_postgresql_db/vars/FreeBSD-12.0.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 + postgresql_packages: - postgresql96-server - py27-psycopg2 diff --git a/tests/integration/targets/setup_postgresql_db/vars/FreeBSD-12.1-py3.yml b/tests/integration/targets/setup_postgresql_db/vars/FreeBSD-12.1-py3.yml index d116e42589..8e5ddfa137 100644 --- a/tests/integration/targets/setup_postgresql_db/vars/FreeBSD-12.1-py3.yml +++ b/tests/integration/targets/setup_postgresql_db/vars/FreeBSD-12.1-py3.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 + postgresql_packages: - postgresql11-server - "py{{ ansible_python.version.major }}{{ ansible_python.version.minor }}-psycopg2" diff --git a/tests/integration/targets/setup_postgresql_db/vars/FreeBSD-12.1.yml b/tests/integration/targets/setup_postgresql_db/vars/FreeBSD-12.1.yml index 0b1ab5b26e..0cdc22e13b 100644 --- a/tests/integration/targets/setup_postgresql_db/vars/FreeBSD-12.1.yml +++ b/tests/integration/targets/setup_postgresql_db/vars/FreeBSD-12.1.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 + postgresql_packages: - postgresql11-server - py27-psycopg2 diff --git a/tests/integration/targets/setup_postgresql_db/vars/RedHat-py3.yml b/tests/integration/targets/setup_postgresql_db/vars/RedHat-py3.yml index ee08372226..3892f2e451 100644 --- a/tests/integration/targets/setup_postgresql_db/vars/RedHat-py3.yml +++ b/tests/integration/targets/setup_postgresql_db/vars/RedHat-py3.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 + postgresql_packages: - "postgresql-server" - "python3-psycopg2" diff --git a/tests/integration/targets/setup_postgresql_db/vars/RedHat.yml b/tests/integration/targets/setup_postgresql_db/vars/RedHat.yml index 20c4b1f5b7..5670a7fc92 100644 --- a/tests/integration/targets/setup_postgresql_db/vars/RedHat.yml +++ b/tests/integration/targets/setup_postgresql_db/vars/RedHat.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 + postgresql_packages: - "postgresql-server" - "python-psycopg2" diff --git a/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-12.yml b/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-12.yml index 4b6e744b44..1d850de845 100644 --- a/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-12.yml +++ b/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-12.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 + postgresql_packages: - "postgresql" - "postgresql-common" diff --git a/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-14.yml b/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-14.yml index ffcc8dd496..881fc533ea 100644 --- a/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-14.yml +++ b/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-14.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 + postgresql_packages: - "postgresql" - "postgresql-common" diff --git a/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-16-py3.yml b/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-16-py3.yml index b088c3105e..482982fe1e 100644 --- a/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-16-py3.yml +++ b/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-16-py3.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 + postgresql_packages: - "postgresql" - "postgresql-common" diff --git a/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-16.yml b/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-16.yml index 897efd2c76..f2df72af7c 100644 --- a/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-16.yml +++ b/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-16.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 + postgresql_packages: - "postgresql" - "postgresql-common" diff --git a/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-18-py3.yml b/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-18-py3.yml index 10453bdf90..19213f4d6a 100644 --- a/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-18-py3.yml +++ b/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-18-py3.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 + postgresql_packages: - "postgresql" - "postgresql-common" diff --git a/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-20-py3.yml b/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-20-py3.yml index 7322bcb216..58fb8a06f7 100644 --- a/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-20-py3.yml +++ b/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-20-py3.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 + postgresql_packages: - "postgresql" - "postgresql-common" diff --git a/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-22-py3.yml b/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-22-py3.yml new file mode 100644 index 0000000000..8ea444099d --- /dev/null +++ b/tests/integration/targets/setup_postgresql_db/vars/Ubuntu-22-py3.yml @@ -0,0 +1,13 @@ +--- +# 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 + +postgresql_packages: + - "postgresql" + - "postgresql-common" + - "python3-psycopg2" + +pg_hba_location: "/etc/postgresql/14/main/pg_hba.conf" +pg_dir: "/var/lib/postgresql/14/main" +pg_ver: 14 diff --git a/tests/integration/targets/setup_postgresql_db/vars/default-py3.yml b/tests/integration/targets/setup_postgresql_db/vars/default-py3.yml index 19152a6435..6f96043a39 100644 --- a/tests/integration/targets/setup_postgresql_db/vars/default-py3.yml +++ b/tests/integration/targets/setup_postgresql_db/vars/default-py3.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 + postgresql_packages: - "postgresql-server" - "python3-psycopg2" diff --git a/tests/integration/targets/setup_postgresql_db/vars/default.yml b/tests/integration/targets/setup_postgresql_db/vars/default.yml index ab36dd9f1d..9d64d969aa 100644 --- a/tests/integration/targets/setup_postgresql_db/vars/default.yml +++ b/tests/integration/targets/setup_postgresql_db/vars/default.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 + postgresql_packages: - "postgresql-server" - "python-psycopg2" diff --git a/tests/integration/targets/setup_redis_replication/defaults/main.yml b/tests/integration/targets/setup_redis_replication/defaults/main.yml index 1ab3c53a15..46dae9898a 100644 --- a/tests/integration/targets/setup_redis_replication/defaults/main.yml +++ b/tests/integration/targets/setup_redis_replication/defaults/main.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 + # General redis_packages: Alpine: diff --git a/tests/integration/targets/setup_redis_replication/handlers/main.yml b/tests/integration/targets/setup_redis_replication/handlers/main.yml index 1b3cd57912..a0595cbe30 100644 --- a/tests/integration/targets/setup_redis_replication/handlers/main.yml +++ b/tests/integration/targets/setup_redis_replication/handlers/main.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: stop redis services shell: | kill -TERM $(cat /var/run/redis_{{ master_port }}.pid) diff --git a/tests/integration/targets/setup_redis_replication/meta/main.yml b/tests/integration/targets/setup_redis_replication/meta/main.yml index bfccf6072b..db2617f4ce 100644 --- a/tests/integration/targets/setup_redis_replication/meta/main.yml +++ b/tests/integration/targets/setup_redis_replication/meta/main.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 + dependencies: - setup_pkg_mgr - setup_remote_constraints diff --git a/tests/integration/targets/setup_redis_replication/tasks/main.yml b/tests/integration/targets/setup_redis_replication/tasks/main.yml index 6028a0fa1d..076a473594 100644 --- a/tests/integration/targets/setup_redis_replication/tasks/main.yml +++ b/tests/integration/targets/setup_redis_replication/tasks/main.yml @@ -3,8 +3,9 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### -# Copyright: (c) 2020, Pavlo Bashynskyi (@levonet) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2020, Pavlo Bashynskyi (@levonet) +# 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 - import_tasks: setup_redis_cluster.yml when: diff --git a/tests/integration/targets/setup_redis_replication/tasks/setup_redis_cluster.yml b/tests/integration/targets/setup_redis_replication/tasks/setup_redis_cluster.yml index 534f3d5686..dd48bf2b64 100644 --- a/tests/integration/targets/setup_redis_replication/tasks/setup_redis_cluster.yml +++ b/tests/integration/targets/setup_redis_replication/tasks/setup_redis_cluster.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 + # We run two servers listening different ports # to be able to check replication (one server for master, another for replica). diff --git a/tests/integration/targets/setup_remote_constraints/aliases b/tests/integration/targets/setup_remote_constraints/aliases index 1ad133ba0a..27ce6b0875 100644 --- a/tests/integration/targets/setup_remote_constraints/aliases +++ b/tests/integration/targets/setup_remote_constraints/aliases @@ -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 + needs/file/tests/utils/constraints.txt diff --git a/tests/integration/targets/setup_remote_constraints/meta/main.yml b/tests/integration/targets/setup_remote_constraints/meta/main.yml index 1810d4bec9..982de6eb03 100644 --- a/tests/integration/targets/setup_remote_constraints/meta/main.yml +++ b/tests/integration/targets/setup_remote_constraints/meta/main.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 + dependencies: - setup_remote_tmp_dir diff --git a/tests/integration/targets/setup_remote_constraints/tasks/main.yml b/tests/integration/targets/setup_remote_constraints/tasks/main.yml index d4f8148c82..a1ac1aeadc 100644 --- a/tests/integration/targets/setup_remote_constraints/tasks/main.yml +++ b/tests/integration/targets/setup_remote_constraints/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: record constraints.txt path on remote host set_fact: remote_constraints: "{{ remote_tmp_dir }}/constraints.txt" diff --git a/tests/integration/targets/setup_remote_tmp_dir/handlers/main.yml b/tests/integration/targets/setup_remote_tmp_dir/handlers/main.yml index 229037c8b2..f1c55b04f3 100644 --- a/tests/integration/targets/setup_remote_tmp_dir/handlers/main.yml +++ b/tests/integration/targets/setup_remote_tmp_dir/handlers/main.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: delete temporary directory include_tasks: default-cleanup.yml diff --git a/tests/integration/targets/setup_remote_tmp_dir/tasks/default-cleanup.yml b/tests/integration/targets/setup_remote_tmp_dir/tasks/default-cleanup.yml index 39872d749f..e19d903e6b 100644 --- a/tests/integration/targets/setup_remote_tmp_dir/tasks/default-cleanup.yml +++ b/tests/integration/targets/setup_remote_tmp_dir/tasks/default-cleanup.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: delete temporary directory file: path: "{{ remote_tmp_dir }}" diff --git a/tests/integration/targets/setup_remote_tmp_dir/tasks/default.yml b/tests/integration/targets/setup_remote_tmp_dir/tasks/default.yml index 1e0f51b890..c9d871c698 100644 --- a/tests/integration/targets/setup_remote_tmp_dir/tasks/default.yml +++ b/tests/integration/targets/setup_remote_tmp_dir/tasks/default.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: create temporary directory tempfile: state: directory diff --git a/tests/integration/targets/setup_remote_tmp_dir/tasks/main.yml b/tests/integration/targets/setup_remote_tmp_dir/tasks/main.yml index 93d786f0f3..6632cc8489 100644 --- a/tests/integration/targets/setup_remote_tmp_dir/tasks/main.yml +++ b/tests/integration/targets/setup_remote_tmp_dir/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: make sure we have the ansible_os_family and ansible_distribution_version facts setup: gather_subset: distribution diff --git a/tests/integration/targets/setup_remote_tmp_dir_outside_tmp/handlers/main.yml b/tests/integration/targets/setup_remote_tmp_dir_outside_tmp/handlers/main.yml new file mode 100644 index 0000000000..f1c55b04f3 --- /dev/null +++ b/tests/integration/targets/setup_remote_tmp_dir_outside_tmp/handlers/main.yml @@ -0,0 +1,10 @@ +--- +# 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: delete temporary directory + include_tasks: default-cleanup.yml + +- name: delete temporary directory (windows) + include_tasks: windows-cleanup.yml diff --git a/tests/integration/targets/setup_remote_tmp_dir_outside_tmp/tasks/default-cleanup.yml b/tests/integration/targets/setup_remote_tmp_dir_outside_tmp/tasks/default-cleanup.yml new file mode 100644 index 0000000000..e19d903e6b --- /dev/null +++ b/tests/integration/targets/setup_remote_tmp_dir_outside_tmp/tasks/default-cleanup.yml @@ -0,0 +1,10 @@ +--- +# 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: delete temporary directory + file: + path: "{{ remote_tmp_dir }}" + state: absent + no_log: yes diff --git a/tests/integration/targets/setup_remote_tmp_dir_outside_tmp/tasks/default.yml b/tests/integration/targets/setup_remote_tmp_dir_outside_tmp/tasks/default.yml new file mode 100644 index 0000000000..0aef57f99c --- /dev/null +++ b/tests/integration/targets/setup_remote_tmp_dir_outside_tmp/tasks/default.yml @@ -0,0 +1,22 @@ +--- +# 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: create ~/tmp + file: + path: '~/tmp' + state: directory + +- name: create temporary directory + tempfile: + state: directory + suffix: .test + path: ~/tmp + register: remote_tmp_dir + notify: + - delete temporary directory + +- name: record temporary directory + set_fact: + remote_tmp_dir: "{{ remote_tmp_dir.path }}" diff --git a/tests/integration/targets/setup_remote_tmp_dir_outside_tmp/tasks/main.yml b/tests/integration/targets/setup_remote_tmp_dir_outside_tmp/tasks/main.yml new file mode 100644 index 0000000000..6632cc8489 --- /dev/null +++ b/tests/integration/targets/setup_remote_tmp_dir_outside_tmp/tasks/main.yml @@ -0,0 +1,20 @@ +--- +#################################################################### +# WARNING: These are designed specifically for Ansible tests # +# and should not be used as examples of how to write Ansible roles # +#################################################################### + +# 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: make sure we have the ansible_os_family and ansible_distribution_version facts + setup: + gather_subset: distribution + when: ansible_facts == {} + +- include_tasks: "{{ lookup('first_found', files)}}" + vars: + files: + - "{{ ansible_os_family | lower }}.yml" + - "default.yml" diff --git a/tests/integration/targets/setup_rundeck/defaults/main.yml b/tests/integration/targets/setup_rundeck/defaults/main.yml index 5b6f45f527..c842901c0f 100644 --- a/tests/integration/targets/setup_rundeck/defaults/main.yml +++ b/tests/integration/targets/setup_rundeck/defaults/main.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 + rundeck_war_url: https://packagecloud.io/pagerduty/rundeck/packages/java/org.rundeck/rundeck-3.4.4-20210920.war/artifacts/rundeck-3.4.4-20210920.war/download rundeck_cli_url: https://github.com/rundeck/rundeck-cli/releases/download/v1.3.10/rundeck-cli-1.3.10-all.jar diff --git a/tests/integration/targets/setup_rundeck/meta/main.yml b/tests/integration/targets/setup_rundeck/meta/main.yml index b63c3d017c..2fcd152f95 100644 --- a/tests/integration/targets/setup_rundeck/meta/main.yml +++ b/tests/integration/targets/setup_rundeck/meta/main.yml @@ -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 + dependencies: - setup_pkg_mgr diff --git a/tests/integration/targets/setup_rundeck/tasks/main.yml b/tests/integration/targets/setup_rundeck/tasks/main.yml index 41c9f1c142..ea8b35f65e 100644 --- a/tests/integration/targets/setup_rundeck/tasks/main.yml +++ b/tests/integration/targets/setup_rundeck/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Skip unsupported platforms meta: end_play when: ansible_distribution not in ['CentOS', 'Fedora', 'Debian', 'Ubuntu'] diff --git a/tests/integration/targets/setup_rundeck/vars/Alpine.yml b/tests/integration/targets/setup_rundeck/vars/Alpine.yml index 7a5b937e3f..dbf16b7472 100644 --- a/tests/integration/targets/setup_rundeck/vars/Alpine.yml +++ b/tests/integration/targets/setup_rundeck/vars/Alpine.yml @@ -1 +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 + openjdk_pkg: openjdk11-jre-headless diff --git a/tests/integration/targets/setup_rundeck/vars/Archlinux.yml b/tests/integration/targets/setup_rundeck/vars/Archlinux.yml index a3b6a08ddf..fd4429c0bd 100644 --- a/tests/integration/targets/setup_rundeck/vars/Archlinux.yml +++ b/tests/integration/targets/setup_rundeck/vars/Archlinux.yml @@ -1 +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 + openjdk_pkg: jre11-openjdk-headless diff --git a/tests/integration/targets/setup_rundeck/vars/Debian.yml b/tests/integration/targets/setup_rundeck/vars/Debian.yml index b5f0c421c1..1407cede6a 100644 --- a/tests/integration/targets/setup_rundeck/vars/Debian.yml +++ b/tests/integration/targets/setup_rundeck/vars/Debian.yml @@ -1 +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 + openjdk_pkg: openjdk-11-jre-headless diff --git a/tests/integration/targets/setup_rundeck/vars/RedHat.yml b/tests/integration/targets/setup_rundeck/vars/RedHat.yml index 08e32950f8..314f0ef415 100644 --- a/tests/integration/targets/setup_rundeck/vars/RedHat.yml +++ b/tests/integration/targets/setup_rundeck/vars/RedHat.yml @@ -1 +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 + openjdk_pkg: java-1.8.0-openjdk diff --git a/tests/integration/targets/setup_snap/aliases b/tests/integration/targets/setup_snap/aliases new file mode 100644 index 0000000000..0a430dff10 --- /dev/null +++ b/tests/integration/targets/setup_snap/aliases @@ -0,0 +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 + +needs/target/setup_epel diff --git a/tests/integration/targets/setup_snap/defaults/main.yml b/tests/integration/targets/setup_snap/defaults/main.yml index 2290001f7e..7b4ab8dc7f 100644 --- a/tests/integration/targets/setup_snap/defaults/main.yml +++ b/tests/integration/targets/setup_snap/defaults/main.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 + has_snap: false snap_packages: diff --git a/tests/integration/targets/setup_snap/handlers/main.yml b/tests/integration/targets/setup_snap/handlers/main.yml index a80cc98e49..08c1a23f1d 100644 --- a/tests/integration/targets/setup_snap/handlers/main.yml +++ b/tests/integration/targets/setup_snap/handlers/main.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: Remove snapd package: name: "{{ snap_packages }}" diff --git a/tests/integration/targets/setup_snap/meta/main.yml b/tests/integration/targets/setup_snap/meta/main.yml index 0e51c36ebd..2fcd152f95 100644 --- a/tests/integration/targets/setup_snap/meta/main.yml +++ b/tests/integration/targets/setup_snap/meta/main.yml @@ -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 + dependencies: - setup_pkg_mgr - - setup_epel diff --git a/tests/integration/targets/setup_snap/tasks/D-RedHat-9.0.yml b/tests/integration/targets/setup_snap/tasks/D-RedHat-9.0.yml new file mode 120000 index 0000000000..0b06951496 --- /dev/null +++ b/tests/integration/targets/setup_snap/tasks/D-RedHat-9.0.yml @@ -0,0 +1 @@ +nothing.yml \ No newline at end of file diff --git a/tests/integration/targets/setup_snap/tasks/default.yml b/tests/integration/targets/setup_snap/tasks/default.yml index 938addc33a..391ae86f8d 100644 --- a/tests/integration/targets/setup_snap/tasks/default.yml +++ b/tests/integration/targets/setup_snap/tasks/default.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: Install snapd package: name: "{{ snap_packages }}" diff --git a/tests/integration/targets/setup_snap/tasks/main.yml b/tests/integration/targets/setup_snap/tasks/main.yml index 26e02ddc56..8f3744a70e 100644 --- a/tests/integration/targets/setup_snap/tasks/main.yml +++ b/tests/integration/targets/setup_snap/tasks/main.yml @@ -4,10 +4,21 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Print information on which we distinguish debug: msg: "Distribution '{{ ansible_facts.distribution }}', version '{{ ansible_facts.distribution_version }}', OS family '{{ ansible_facts.os_family }}'" +- name: Install EPEL repository (RHEL only) + include_role: + name: setup_epel + when: + - ansible_distribution in ['RedHat', 'CentOS'] + - ansible_distribution_major_version is version('9', '<') + - name: Include distribution specific tasks include_tasks: "{{ lookup('first_found', params) }}" vars: diff --git a/tests/integration/targets/setup_snap/tasks/nothing.yml b/tests/integration/targets/setup_snap/tasks/nothing.yml index 11642d1fcd..5bbfaff128 100644 --- a/tests/integration/targets/setup_snap/tasks/nothing.yml +++ b/tests/integration/targets/setup_snap/tasks/nothing.yml @@ -1,2 +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 + # Do nothing diff --git a/tests/integration/targets/setup_tls/files/ca_certificate.pem b/tests/integration/targets/setup_tls/files/ca_certificate.pem index a438d9266e..130e0a2daf 100644 --- a/tests/integration/targets/setup_tls/files/ca_certificate.pem +++ b/tests/integration/targets/setup_tls/files/ca_certificate.pem @@ -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 + -----BEGIN CERTIFICATE----- MIIDAjCCAeqgAwIBAgIJANguFROhaWocMA0GCSqGSIb3DQEBCwUAMDExIDAeBgNV BAMMF1RMU0dlblNlbGZTaWduZWR0Um9vdENBMQ0wCwYDVQQHDAQkJCQkMB4XDTE5 diff --git a/tests/integration/targets/setup_tls/files/ca_key.pem b/tests/integration/targets/setup_tls/files/ca_key.pem index 0a950eda06..d9dc5ca0f5 100644 --- a/tests/integration/targets/setup_tls/files/ca_key.pem +++ b/tests/integration/targets/setup_tls/files/ca_key.pem @@ -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 + -----BEGIN PRIVATE KEY----- MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDqVt84czSxWnWW 4Ng6hmKE3NarbLsycwtjrYBokV7Kk7Mp7PrBbYF05FOgSdJLvL6grlRSQK2VPsXd diff --git a/tests/integration/targets/setup_tls/files/client_certificate.pem b/tests/integration/targets/setup_tls/files/client_certificate.pem index 501d83897f..9e956e6b0f 100644 --- a/tests/integration/targets/setup_tls/files/client_certificate.pem +++ b/tests/integration/targets/setup_tls/files/client_certificate.pem @@ -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 + -----BEGIN CERTIFICATE----- MIIDRjCCAi6gAwIBAgIBAjANBgkqhkiG9w0BAQsFADAxMSAwHgYDVQQDDBdUTFNH ZW5TZWxmU2lnbmVkdFJvb3RDQTENMAsGA1UEBwwEJCQkJDAeFw0xOTAxMTEwODMz diff --git a/tests/integration/targets/setup_tls/files/client_key.pem b/tests/integration/targets/setup_tls/files/client_key.pem index 850260a87f..3848ad7cf1 100644 --- a/tests/integration/targets/setup_tls/files/client_key.pem +++ b/tests/integration/targets/setup_tls/files/client_key.pem @@ -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 + -----BEGIN RSA PRIVATE KEY----- MIIEowIBAAKCAQEAqDPjkNxwpwlAAM/Shhk8FgfYUG1HwGV5v7LZW9v7jgKd6zcM QJQrP4IspgRxOiLupqytNOlZ/mfYm6iKw9i7gjsXLtucvIKKhutk4HT+bGvcEfuf diff --git a/tests/integration/targets/setup_tls/files/server_certificate.pem b/tests/integration/targets/setup_tls/files/server_certificate.pem index 4a0ebc6ec0..b714ddbfb8 100644 --- a/tests/integration/targets/setup_tls/files/server_certificate.pem +++ b/tests/integration/targets/setup_tls/files/server_certificate.pem @@ -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 + -----BEGIN CERTIFICATE----- MIIDRjCCAi6gAwIBAgIBATANBgkqhkiG9w0BAQsFADAxMSAwHgYDVQQDDBdUTFNH ZW5TZWxmU2lnbmVkdFJvb3RDQTENMAsGA1UEBwwEJCQkJDAeFw0xOTAxMTEwODMz diff --git a/tests/integration/targets/setup_tls/files/server_key.pem b/tests/integration/targets/setup_tls/files/server_key.pem index c79ab64804..ec0134993e 100644 --- a/tests/integration/targets/setup_tls/files/server_key.pem +++ b/tests/integration/targets/setup_tls/files/server_key.pem @@ -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 + -----BEGIN RSA PRIVATE KEY----- MIIEowIBAAKCAQEAyMBKx8AHrEQX3fR4mZJgd1WIdvHNUJBPSPJ2MhySl9mQVIQM yvofNAZHEySfeNuualsgAh/8JeeF3v6HxVBaxmuL89Ks+FJC/yiNDhsNvGOKpyna diff --git a/tests/integration/targets/setup_tls/tasks/main.yml b/tests/integration/targets/setup_tls/tasks/main.yml index bbdc30ccf9..ea4b9ecaa1 100644 --- a/tests/integration/targets/setup_tls/tasks/main.yml +++ b/tests/integration/targets/setup_tls/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + # Generated certificate with: https://github.com/michaelklishin/tls-gen # ~/tls-gen/basic# make PASSWORD=bunnies CN=ansible.tls.tests # verify with: make info diff --git a/tests/integration/targets/setup_wildfly_server/defaults/main.yml b/tests/integration/targets/setup_wildfly_server/defaults/main.yml index 64019a04b3..03b12c95c5 100644 --- a/tests/integration/targets/setup_wildfly_server/defaults/main.yml +++ b/tests/integration/targets/setup_wildfly_server/defaults/main.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 + wf_tmp_dir: '{{ remote_tmp_dir }}/wildfly_tmp' wf_homedir: '{{ wf_tmp_dir }}/wildfly' wf_service_file_path: /etc/systemd/system/wildfly.service diff --git a/tests/integration/targets/setup_wildfly_server/files/wildfly.conf b/tests/integration/targets/setup_wildfly_server/files/wildfly.conf index 4ff3293b72..684ce12a21 100644 --- a/tests/integration/targets/setup_wildfly_server/files/wildfly.conf +++ b/tests/integration/targets/setup_wildfly_server/files/wildfly.conf @@ -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 + # The configuration you want to run WILDFLY_CONFIG=standalone.xml diff --git a/tests/integration/targets/setup_wildfly_server/handlers/main.yml b/tests/integration/targets/setup_wildfly_server/handlers/main.yml index 98db569dba..641025edb1 100644 --- a/tests/integration/targets/setup_wildfly_server/handlers/main.yml +++ b/tests/integration/targets/setup_wildfly_server/handlers/main.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: Stop wildfly (jboss) systemd: name: wildfly diff --git a/tests/integration/targets/setup_wildfly_server/meta/main.yml b/tests/integration/targets/setup_wildfly_server/meta/main.yml index 6dabc5c7e6..2d29ebb672 100644 --- a/tests/integration/targets/setup_wildfly_server/meta/main.yml +++ b/tests/integration/targets/setup_wildfly_server/meta/main.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 + dependencies: - setup_pkg_mgr - setup_remote_tmp_dir diff --git a/tests/integration/targets/setup_wildfly_server/tasks/main.yml b/tests/integration/targets/setup_wildfly_server/tasks/main.yml index beb58f8d14..e2bda5736e 100644 --- a/tests/integration/targets/setup_wildfly_server/tasks/main.yml +++ b/tests/integration/targets/setup_wildfly_server/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Skip unsupported platforms meta: end_play when: (ansible_distribution != 'CentOS') or diff --git a/tests/integration/targets/setup_wildfly_server/templates/launch.sh.j2 b/tests/integration/targets/setup_wildfly_server/templates/launch.sh.j2 index a01bcc513e..7a80251a14 100644 --- a/tests/integration/targets/setup_wildfly_server/templates/launch.sh.j2 +++ b/tests/integration/targets/setup_wildfly_server/templates/launch.sh.j2 @@ -1,4 +1,7 @@ #!/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 if [ "x$WILDFLY_HOME" = "x" ]; then WILDFLY_HOME="{{ wf_homedir }}" diff --git a/tests/integration/targets/setup_wildfly_server/templates/wildfly.service.j2 b/tests/integration/targets/setup_wildfly_server/templates/wildfly.service.j2 index 686c30193e..ec10551329 100644 --- a/tests/integration/targets/setup_wildfly_server/templates/wildfly.service.j2 +++ b/tests/integration/targets/setup_wildfly_server/templates/wildfly.service.j2 @@ -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 + [Unit] Description=The WildFly Application Server After=syslog.target network.target diff --git a/tests/integration/targets/shutdown/aliases b/tests/integration/targets/shutdown/aliases index a6dafcf8cd..abc0d5476d 100644 --- a/tests/integration/targets/shutdown/aliases +++ b/tests/integration/targets/shutdown/aliases @@ -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 + shippable/posix/group1 diff --git a/tests/integration/targets/shutdown/tasks/main.yml b/tests/integration/targets/shutdown/tasks/main.yml index 0f256c08bb..3f765ff059 100644 --- a/tests/integration/targets/shutdown/tasks/main.yml +++ b/tests/integration/targets/shutdown/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Install systemd-sysv on Ubuntu 18 and Debian apt: name: systemd-sysv diff --git a/tests/integration/targets/snap/aliases b/tests/integration/targets/snap/aliases index ee303bf346..b8fcb9ee4a 100644 --- a/tests/integration/targets/snap/aliases +++ b/tests/integration/targets/snap/aliases @@ -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 + shippable/posix/group1 skip/aix skip/freebsd diff --git a/tests/integration/targets/snap/meta/main.yml b/tests/integration/targets/snap/meta/main.yml index 6ee9a022c1..f36427f71a 100644 --- a/tests/integration/targets/snap/meta/main.yml +++ b/tests/integration/targets/snap/meta/main.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 + dependencies: - setup_snap diff --git a/tests/integration/targets/snap/tasks/main.yml b/tests/integration/targets/snap/tasks/main.yml index 502a82d914..367376202a 100644 --- a/tests/integration/targets/snap/tasks/main.yml +++ b/tests/integration/targets/snap/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + - block: - name: Make sure package is not installed (hello-world) community.general.snap: diff --git a/tests/integration/targets/snap_alias/aliases b/tests/integration/targets/snap_alias/aliases index ee303bf346..b8fcb9ee4a 100644 --- a/tests/integration/targets/snap_alias/aliases +++ b/tests/integration/targets/snap_alias/aliases @@ -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 + shippable/posix/group1 skip/aix skip/freebsd diff --git a/tests/integration/targets/snap_alias/meta/main.yml b/tests/integration/targets/snap_alias/meta/main.yml index 6ee9a022c1..f36427f71a 100644 --- a/tests/integration/targets/snap_alias/meta/main.yml +++ b/tests/integration/targets/snap_alias/meta/main.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 + dependencies: - setup_snap diff --git a/tests/integration/targets/snap_alias/tasks/main.yml b/tests/integration/targets/snap_alias/tasks/main.yml index 81b7c3618a..1934eeb9f6 100644 --- a/tests/integration/targets/snap_alias/tasks/main.yml +++ b/tests/integration/targets/snap_alias/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Test include_tasks: test.yml when: has_snap diff --git a/tests/integration/targets/snap_alias/tasks/test.yml b/tests/integration/targets/snap_alias/tasks/test.yml index 6bfcc04341..50e6e33b49 100644 --- a/tests/integration/targets/snap_alias/tasks/test.yml +++ b/tests/integration/targets/snap_alias/tasks/test.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: Ensure snap 'hello-world' is not installed community.general.snap: name: hello-world diff --git a/tests/integration/targets/spectrum_model_attrs/aliases b/tests/integration/targets/spectrum_model_attrs/aliases index ad7ccf7ada..bd1f024441 100644 --- a/tests/integration/targets/spectrum_model_attrs/aliases +++ b/tests/integration/targets/spectrum_model_attrs/aliases @@ -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 + unsupported diff --git a/tests/integration/targets/spectrum_model_attrs/tasks/main.yml b/tests/integration/targets/spectrum_model_attrs/tasks/main.yml index c39d5c3ba2..42e53d7d7d 100644 --- a/tests/integration/targets/spectrum_model_attrs/tasks/main.yml +++ b/tests/integration/targets/spectrum_model_attrs/tasks/main.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: "Verify required variables: model_name, model_type, oneclick_username, oneclick_password, oneclick_url" fail: msg: "One or more of the following variables are not set: model_name, model_type, oneclick_username, oneclick_password, oneclick_url" diff --git a/tests/integration/targets/ssh_config/aliases b/tests/integration/targets/ssh_config/aliases index 631a9b3e4a..6803185a41 100644 --- a/tests/integration/targets/ssh_config/aliases +++ b/tests/integration/targets/ssh_config/aliases @@ -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 + destructive shippable/posix/group2 skip/python2.6 # stromssh only supports python3 diff --git a/tests/integration/targets/ssh_config/meta/main.yml b/tests/integration/targets/ssh_config/meta/main.yml index 4c6838dbe1..4cdaaefbaf 100644 --- a/tests/integration/targets/ssh_config/meta/main.yml +++ b/tests/integration/targets/ssh_config/meta/main.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 + dependencies: - setup_remote_constraints - setup_remote_tmp_dir diff --git a/tests/integration/targets/ssh_config/tasks/main.yml b/tests/integration/targets/ssh_config/tasks/main.yml index 0d4c10a111..ce57493b84 100644 --- a/tests/integration/targets/ssh_config/tasks/main.yml +++ b/tests/integration/targets/ssh_config/tasks/main.yml @@ -1,6 +1,7 @@ # Test code for ssh_config module -# Copyright: (c) 2021, Abhijeet Kasurde (@Akasurde) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, Abhijeet Kasurde (@Akasurde) +# 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: Install required libs pip: diff --git a/tests/integration/targets/ssh_config/tasks/options.yml b/tests/integration/targets/ssh_config/tasks/options.yml index a8ab3010ef..04586873ad 100644 --- a/tests/integration/targets/ssh_config/tasks/options.yml +++ b/tests/integration/targets/ssh_config/tasks/options.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 + # Reset ssh_config before testing options - name: Copy sample config file copy: diff --git a/tests/integration/targets/sudoers/aliases b/tests/integration/targets/sudoers/aliases index 765b70da79..be75e3ddab 100644 --- a/tests/integration/targets/sudoers/aliases +++ b/tests/integration/targets/sudoers/aliases @@ -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 + shippable/posix/group2 diff --git a/tests/integration/targets/sudoers/tasks/main.yml b/tests/integration/targets/sudoers/tasks/main.yml index 9a632c4de4..682bd7efff 100644 --- a/tests/integration/targets/sudoers/tasks/main.yml +++ b/tests/integration/targets/sudoers/tasks/main.yml @@ -1,11 +1,20 @@ --- +# 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 + # Initialise environment -- name: Register sudoers.d directory +- name: Register variables set_fact: sudoers_path: /etc/sudoers.d alt_sudoers_path: /etc/sudoers_alt +- name: Install sudo package + ansible.builtin.package: + name: sudo + when: ansible_os_family != 'Darwin' + - name: Ensure sudoers directory exists ansible.builtin.file: path: "{{ sudoers_path }}" @@ -29,6 +38,11 @@ commands: /usr/local/bin/command register: rule_1 +- name: Stat my-sudo-rule-1 file + ansible.builtin.stat: + path: "{{ sudoers_path }}/my-sudo-rule-1" + register: rule_1_stat + - name: Grab contents of my-sudo-rule-1 ansible.builtin.slurp: src: "{{ sudoers_path }}/my-sudo-rule-1" @@ -130,8 +144,73 @@ register: revoke_rule_1_stat +# Validation testing + +- name: Attempt command without full path to executable + community.general.sudoers: + name: edge-case-1 + state: present + user: alice + commands: systemctl + ignore_errors: true + register: edge_case_1 + + +- name: Attempt command without full path to executable, but disabling validation + community.general.sudoers: + name: edge-case-2 + state: present + user: alice + commands: systemctl + validation: absent + sudoers_path: "{{ alt_sudoers_path }}" + register: edge_case_2 + +- name: find visudo + command: + cmd: which visudo + register: which_visudo + when: ansible_os_family != 'Darwin' + +- name: Prevent visudo being executed + file: + path: "{{ which_visudo.stdout }}" + mode: '-x' + when: ansible_os_family != 'Darwin' + +- name: Attempt command without full path to executable, but enforcing validation with no visudo present + community.general.sudoers: + name: edge-case-3 + state: present + user: alice + commands: systemctl + validation: required + ignore_errors: true + when: ansible_os_family != 'Darwin' + register: edge_case_3 + + +- name: Revoke non-existing rule + community.general.sudoers: + name: non-existing-rule + state: absent + register: revoke_non_existing_rule + +- name: Stat non-existing rule + ansible.builtin.stat: + path: "{{ sudoers_path }}/non-existing-rule" + register: revoke_non_existing_rule_stat + + # Run assertions +- name: Check rule 1 file stat + ansible.builtin.assert: + that: + - rule_1_stat.stat.exists + - rule_1_stat.stat.isreg + - rule_1_stat.stat.mode == '0440' + - name: Check changed status ansible.builtin.assert: that: @@ -139,6 +218,7 @@ - rule_1_again is not changed - rule_5 is changed - revoke_rule_1 is changed + - revoke_non_existing_rule is not changed - name: Check contents ansible.builtin.assert: @@ -150,7 +230,22 @@ - "rule_5_contents['content'] | b64decode == 'alice ALL=NOPASSWD: /usr/local/bin/command\n'" - "rule_6_contents['content'] | b64decode == 'alice ALL=(bob)NOPASSWD: /usr/local/bin/command\n'" -- name: Check stats +- name: Check revocation stat ansible.builtin.assert: that: - not revoke_rule_1_stat.stat.exists + - not revoke_non_existing_rule_stat.stat.exists + +- name: Check edge case responses + ansible.builtin.assert: + that: + - edge_case_1 is failed + - "'Failed to validate sudoers rule' in edge_case_1.msg" + - edge_case_2 is not failed + +- name: Check missing validation edge case + ansible.builtin.assert: + that: + - edge_case_3 is failed + - "'Failed to find required executable' in edge_case_3.msg" + when: ansible_os_family != 'Darwin' diff --git a/tests/integration/targets/supervisorctl/aliases b/tests/integration/targets/supervisorctl/aliases index 1dbdd80109..453d04cb3b 100644 --- a/tests/integration/targets/supervisorctl/aliases +++ b/tests/integration/targets/supervisorctl/aliases @@ -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 + destructive shippable/posix/group2 skip/python3 diff --git a/tests/integration/targets/supervisorctl/files/sendProcessStdin.py b/tests/integration/targets/supervisorctl/files/sendProcessStdin.py index 90b318cc82..8635b07491 100644 --- a/tests/integration/targets/supervisorctl/files/sendProcessStdin.py +++ b/tests/integration/targets/supervisorctl/files/sendProcessStdin.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 + # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) diff --git a/tests/integration/targets/supervisorctl/meta/main.yml b/tests/integration/targets/supervisorctl/meta/main.yml index 56bc554611..ca1915e05c 100644 --- a/tests/integration/targets/supervisorctl/meta/main.yml +++ b/tests/integration/targets/supervisorctl/meta/main.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 + dependencies: - setup_pkg_mgr - setup_remote_tmp_dir diff --git a/tests/integration/targets/supervisorctl/tasks/install_Linux.yml b/tests/integration/targets/supervisorctl/tasks/install_Linux.yml index ef2dab5eae..e5a7b009e0 100644 --- a/tests/integration/targets/supervisorctl/tasks/install_Linux.yml +++ b/tests/integration/targets/supervisorctl/tasks/install_Linux.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: install supervisor package: name: supervisor diff --git a/tests/integration/targets/supervisorctl/tasks/install_pip.yml b/tests/integration/targets/supervisorctl/tasks/install_pip.yml index e3582160c8..b1d3bd7796 100644 --- a/tests/integration/targets/supervisorctl/tasks/install_pip.yml +++ b/tests/integration/targets/supervisorctl/tasks/install_pip.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: install supervisord pip: name: supervisor<4.0.0 # supervisor version 4.0.0 fails tests diff --git a/tests/integration/targets/supervisorctl/tasks/main.yml b/tests/integration/targets/supervisorctl/tasks/main.yml index 0c3dd31b76..6f8c7968c0 100644 --- a/tests/integration/targets/supervisorctl/tasks/main.yml +++ b/tests/integration/targets/supervisorctl/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + - block: - tempfile: state: directory diff --git a/tests/integration/targets/supervisorctl/tasks/start_supervisord.yml b/tests/integration/targets/supervisorctl/tasks/start_supervisord.yml index 1354bc8632..906d7aca4d 100644 --- a/tests/integration/targets/supervisorctl/tasks/start_supervisord.yml +++ b/tests/integration/targets/supervisorctl/tasks/start_supervisord.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: start supervisord command: 'supervisord -c {{ remote_dir }}/supervisord.conf' diff --git a/tests/integration/targets/supervisorctl/tasks/stop_supervisord.yml b/tests/integration/targets/supervisorctl/tasks/stop_supervisord.yml index 4da09da222..52e064d153 100644 --- a/tests/integration/targets/supervisorctl/tasks/stop_supervisord.yml +++ b/tests/integration/targets/supervisorctl/tasks/stop_supervisord.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 + - name: stop supervisord command: "supervisorctl -c {{ remote_dir }}/supervisord.conf {% if credentials.username %}-u {{ credentials.username }} -p {{ credentials.password }}{% endif %} shutdown" diff --git a/tests/integration/targets/supervisorctl/tasks/test.yml b/tests/integration/targets/supervisorctl/tasks/test.yml index 9b43c21dec..5d1a867edc 100644 --- a/tests/integration/targets/supervisorctl/tasks/test.yml +++ b/tests/integration/targets/supervisorctl/tasks/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 + - name: generate supervisor configuration template: src: supervisord.conf diff --git a/tests/integration/targets/supervisorctl/tasks/test_start.yml b/tests/integration/targets/supervisorctl/tasks/test_start.yml index c05a7dd400..b814486cdb 100644 --- a/tests/integration/targets/supervisorctl/tasks/test_start.yml +++ b/tests/integration/targets/supervisorctl/tasks/test_start.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: start py1 service (without auth) supervisorctl: name: 'pys:py1' diff --git a/tests/integration/targets/supervisorctl/tasks/test_stop.yml b/tests/integration/targets/supervisorctl/tasks/test_stop.yml index 729f0ebd42..8d8fdd42af 100644 --- a/tests/integration/targets/supervisorctl/tasks/test_stop.yml +++ b/tests/integration/targets/supervisorctl/tasks/test_stop.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: stop py1 service supervisorctl: name: 'pys:py1' diff --git a/tests/integration/targets/supervisorctl/tasks/uninstall_Linux.yml b/tests/integration/targets/supervisorctl/tasks/uninstall_Linux.yml index 300239730b..442c61b729 100644 --- a/tests/integration/targets/supervisorctl/tasks/uninstall_Linux.yml +++ b/tests/integration/targets/supervisorctl/tasks/uninstall_Linux.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: uninstall supervisor package: name: supervisor diff --git a/tests/integration/targets/supervisorctl/tasks/uninstall_pip.yml b/tests/integration/targets/supervisorctl/tasks/uninstall_pip.yml index 5bb5ee130e..cf339dfd17 100644 --- a/tests/integration/targets/supervisorctl/tasks/uninstall_pip.yml +++ b/tests/integration/targets/supervisorctl/tasks/uninstall_pip.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: uninstall supervisord pip: name: supervisor diff --git a/tests/integration/targets/supervisorctl/templates/supervisord.conf b/tests/integration/targets/supervisorctl/templates/supervisord.conf index 28b6ac09f9..f3d36b92e7 100644 --- a/tests/integration/targets/supervisorctl/templates/supervisord.conf +++ b/tests/integration/targets/supervisorctl/templates/supervisord.conf @@ -1,3 +1,9 @@ +{# +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 +#} + [supervisord] pidfile={{ remote_dir }}/supervisord.pid logfile={{ remote_dir }}/supervisord.log diff --git a/tests/integration/targets/supervisorctl/vars/Debian.yml b/tests/integration/targets/supervisorctl/vars/Debian.yml index d4b1bdcca9..cba575a7c5 100644 --- a/tests/integration/targets/supervisorctl/vars/Debian.yml +++ b/tests/integration/targets/supervisorctl/vars/Debian.yml @@ -1 +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 + supervisor_service_name: supervisor diff --git a/tests/integration/targets/supervisorctl/vars/defaults.yml b/tests/integration/targets/supervisorctl/vars/defaults.yml index fc3aa0a81c..1df9ae2503 100644 --- a/tests/integration/targets/supervisorctl/vars/defaults.yml +++ b/tests/integration/targets/supervisorctl/vars/defaults.yml @@ -1 +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 + supervisor_service_name: supervisord diff --git a/tests/integration/targets/sysrc/aliases b/tests/integration/targets/sysrc/aliases index 360849e61b..6972c2b6c8 100644 --- a/tests/integration/targets/sysrc/aliases +++ b/tests/integration/targets/sysrc/aliases @@ -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 + shippable/posix/group1 needs/root skip/docker diff --git a/tests/integration/targets/sysrc/tasks/main.yml b/tests/integration/targets/sysrc/tasks/main.yml index b8292f785b..544dc63c65 100644 --- a/tests/integration/targets/sysrc/tasks/main.yml +++ b/tests/integration/targets/sysrc/tasks/main.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: Test on FreeBSD VMs when: - ansible_facts.virtualization_type != 'docker' @@ -334,4 +338,4 @@ - name: Restore /boot/loader.conf copy: content: "{{ cached_boot_loaderconf_content }}" - dest: /boot/loader.conf \ No newline at end of file + dest: /boot/loader.conf diff --git a/tests/integration/targets/sysrc/tasks/setup-testjail.yml b/tests/integration/targets/sysrc/tasks/setup-testjail.yml index e75957d19f..4ad0d63b16 100644 --- a/tests/integration/targets/sysrc/tasks/setup-testjail.yml +++ b/tests/integration/targets/sysrc/tasks/setup-testjail.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 + # # Instructions for setting up a jail # https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails-ezjail.html diff --git a/tests/integration/targets/terraform/.gitignore b/tests/integration/targets/terraform/.gitignore index 45b67fdab4..c477f5db78 100644 --- a/tests/integration/targets/terraform/.gitignore +++ b/tests/integration/targets/terraform/.gitignore @@ -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 + **/.terraform/* *.tfstate *.tfstate.* -.terraform.lock.hcl \ No newline at end of file +.terraform.lock.hcl diff --git a/tests/integration/targets/terraform/aliases b/tests/integration/targets/terraform/aliases index 71a9c13cf1..1f9abfc0a2 100644 --- a/tests/integration/targets/terraform/aliases +++ b/tests/integration/targets/terraform/aliases @@ -1,7 +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 + shippable/posix/group1 skip/windows skip/aix skip/osx skip/macos skip/freebsd -skip/python2 \ No newline at end of file +skip/python2 diff --git a/tests/integration/targets/terraform/meta/main.yml b/tests/integration/targets/terraform/meta/main.yml index 56bc554611..ca1915e05c 100644 --- a/tests/integration/targets/terraform/meta/main.yml +++ b/tests/integration/targets/terraform/meta/main.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 + dependencies: - setup_pkg_mgr - setup_remote_tmp_dir diff --git a/tests/integration/targets/terraform/tasks/main.yml b/tests/integration/targets/terraform/tasks/main.yml index f8ac3a919d..75c096bade 100644 --- a/tests/integration/targets/terraform/tasks/main.yml +++ b/tests/integration/targets/terraform/tasks/main.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 # This block checks and registers Terraform version of the binary found in path. @@ -67,4 +70,4 @@ tf_provider: "{{ terraform_provider_versions[provider_index] }}" loop: "{{ terraform_provider_versions }}" loop_control: - index_var: provider_index \ No newline at end of file + index_var: provider_index diff --git a/tests/integration/targets/terraform/tasks/test_provider_upgrade.yml b/tests/integration/targets/terraform/tasks/test_provider_upgrade.yml index 26cc0d842a..ac76c38837 100644 --- a/tests/integration/targets/terraform/tasks/test_provider_upgrade.yml +++ b/tests/integration/targets/terraform/tasks/test_provider_upgrade.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 - name: Output terraform provider test project ansible.builtin.template: @@ -20,4 +23,4 @@ register: terraform_init_result - assert: - that: terraform_init_result is not failed \ No newline at end of file + that: terraform_init_result is not failed diff --git a/tests/integration/targets/terraform/templates/provider_test/main.tf.j2 b/tests/integration/targets/terraform/templates/provider_test/main.tf.j2 index 58eb3a24bb..886a0c2de1 100644 --- a/tests/integration/targets/terraform/templates/provider_test/main.tf.j2 +++ b/tests/integration/targets/terraform/templates/provider_test/main.tf.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 +#} terraform { required_providers { {{ tf_provider['name'] }} = { @@ -5,4 +10,4 @@ terraform { version = "{{ tf_provider['version'] }}" } } -} \ No newline at end of file +} diff --git a/tests/integration/targets/terraform/vars/main.yml b/tests/integration/targets/terraform/vars/main.yml index 64307e889d..7474836387 100644 --- a/tests/integration/targets/terraform/vars/main.yml +++ b/tests/integration/targets/terraform/vars/main.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 # Terraform version that will be downloaded terraform_version: 1.1.7 diff --git a/tests/integration/targets/test_a_module/aliases b/tests/integration/targets/test_a_module/aliases index b59832142f..7a0fc5c1ea 100644 --- a/tests/integration/targets/test_a_module/aliases +++ b/tests/integration/targets/test_a_module/aliases @@ -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 + shippable/posix/group3 diff --git a/tests/integration/targets/test_a_module/collections/ansible_collections/testns/testcoll/galaxy.yml b/tests/integration/targets/test_a_module/collections/ansible_collections/testns/testcoll/galaxy.yml index f66a8af4c9..2243e0dba8 100644 --- a/tests/integration/targets/test_a_module/collections/ansible_collections/testns/testcoll/galaxy.yml +++ b/tests/integration/targets/test_a_module/collections/ansible_collections/testns/testcoll/galaxy.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 + namespace: testns name: testcoll version: 0.0.1 diff --git a/tests/integration/targets/test_a_module/collections/ansible_collections/testns/testcoll/plugins/modules/collection_module.py b/tests/integration/targets/test_a_module/collections/ansible_collections/testns/testcoll/plugins/modules/collection_module.py index 8db51c39a7..e7f1a987a4 100644 --- a/tests/integration/targets/test_a_module/collections/ansible_collections/testns/testcoll/plugins/modules/collection_module.py +++ b/tests/integration/targets/test_a_module/collections/ansible_collections/testns/testcoll/plugins/modules/collection_module.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (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/tests/integration/targets/test_a_module/library/local_module.py b/tests/integration/targets/test_a_module/library/local_module.py index 424c127ced..9e9e649cb4 100644 --- a/tests/integration/targets/test_a_module/library/local_module.py +++ b/tests/integration/targets/test_a_module/library/local_module.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (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/tests/integration/targets/test_a_module/runme.sh b/tests/integration/targets/test_a_module/runme.sh index a0a78be131..118abbc296 100755 --- a/tests/integration/targets/test_a_module/runme.sh +++ b/tests/integration/targets/test_a_module/runme.sh @@ -1,4 +1,7 @@ #!/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 set -eux diff --git a/tests/integration/targets/test_a_module/runme.yml b/tests/integration/targets/test_a_module/runme.yml index 1175bef20c..4b7a5ec2ce 100644 --- a/tests/integration/targets/test_a_module/runme.yml +++ b/tests/integration/targets/test_a_module/runme.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 + - hosts: localhost tasks: - name: Test a_module diff --git a/tests/integration/targets/timezone/aliases b/tests/integration/targets/timezone/aliases index 1ef4c3619a..86d2291bb5 100644 --- a/tests/integration/targets/timezone/aliases +++ b/tests/integration/targets/timezone/aliases @@ -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 + destructive shippable/posix/group1 skip/aix diff --git a/tests/integration/targets/timezone/meta/main.yml b/tests/integration/targets/timezone/meta/main.yml index b63c3d017c..2fcd152f95 100644 --- a/tests/integration/targets/timezone/meta/main.yml +++ b/tests/integration/targets/timezone/meta/main.yml @@ -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 + dependencies: - setup_pkg_mgr diff --git a/tests/integration/targets/timezone/tasks/main.yml b/tests/integration/targets/timezone/tasks/main.yml index 305a458639..3644eeafad 100644 --- a/tests/integration/targets/timezone/tasks/main.yml +++ b/tests/integration/targets/timezone/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + # Because hwclock usually isn't available inside Docker containers in Shippable # these tasks will detect if hwclock works and only run hwclock tests if it is # supported. That is why it is recommended to run these tests locally with @@ -66,7 +71,7 @@ - name: Run tests - # Skip tests on Fedora 31 and 32 because dbus fails to start unless the container is run in priveleged mode. + # Skip tests on Fedora 31 and 32 because dbus fails to start unless the container is run in privileged mode. # Even then, it starts unreliably. This may be due to the move to cgroup v2 in Fedora 31 and 32. # https://www.redhat.com/sysadmin/fedora-31-control-group-v2 when: diff --git a/tests/integration/targets/timezone/tasks/test.yml b/tests/integration/targets/timezone/tasks/test.yml index ec0d854df0..5a58559d7c 100644 --- a/tests/integration/targets/timezone/tasks/test.yml +++ b/tests/integration/targets/timezone/tasks/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 + ## ## test setting timezone, idempotency and checkmode ## @@ -287,7 +292,7 @@ - name: set_fact: - hwclock_supported: '{{ hwclock_test is successful or timedatectl_test is successful }}' + hwclock_supported: '{{ hwclock_test is successful or (timedatectl_test is successful and "RTC time: n/a" not in timedatectl_test.stdout) }}' ## ## test set hwclock, idempotency and checkmode ## diff --git a/tests/integration/targets/ufw/aliases b/tests/integration/targets/ufw/aliases index 7ab34d8e5e..ba9e581292 100644 --- a/tests/integration/targets/ufw/aliases +++ b/tests/integration/targets/ufw/aliases @@ -1,12 +1,15 @@ +# 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 + shippable/posix/group2 skip/aix skip/osx skip/macos skip/freebsd -skip/rhel8.0 -skip/rhel8.0b -skip/rhel8.1b +skip/rhel8.0 # FIXME +skip/rhel9.0 # FIXME skip/docker needs/root -destructive needs/target/setup_epel +destructive diff --git a/tests/integration/targets/ufw/meta/main.yml b/tests/integration/targets/ufw/meta/main.yml index 5438ced5c3..2fcd152f95 100644 --- a/tests/integration/targets/ufw/meta/main.yml +++ b/tests/integration/targets/ufw/meta/main.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 + dependencies: - setup_pkg_mgr diff --git a/tests/integration/targets/ufw/tasks/main.yml b/tests/integration/targets/ufw/tasks/main.yml index 3feb480cb0..c870f85d47 100644 --- a/tests/integration/targets/ufw/tasks/main.yml +++ b/tests/integration/targets/ufw/tasks/main.yml @@ -4,11 +4,17 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + # Make sure ufw is installed - name: Install EPEL repository (RHEL only) include_role: name: setup_epel - when: ansible_distribution == 'RedHat' + when: + - ansible_distribution in ['RedHat', 'CentOS'] + - ansible_distribution_major_version is version('9', '<') - name: Install iptables (SuSE only) package: name: iptables diff --git a/tests/integration/targets/ufw/tasks/run-test.yml b/tests/integration/targets/ufw/tasks/run-test.yml index e9c5d2929c..e9e7b33f5c 100644 --- a/tests/integration/targets/ufw/tasks/run-test.yml +++ b/tests/integration/targets/ufw/tasks/run-test.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 + - pause: # ufw creates backups of the rule files with a timestamp; if reset is called # twice in a row fast enough (so that both timestamps are taken in the same second), diff --git a/tests/integration/targets/ufw/tasks/tests/basic.yml b/tests/integration/targets/ufw/tasks/tests/basic.yml index 3c625112f3..9aac5e6dd8 100644 --- a/tests/integration/targets/ufw/tasks/tests/basic.yml +++ b/tests/integration/targets/ufw/tasks/tests/basic.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: Make sure it is off ufw: diff --git a/tests/integration/targets/ufw/tasks/tests/global-state.yml b/tests/integration/targets/ufw/tasks/tests/global-state.yml index 69b2cde938..3e8ab4460e 100644 --- a/tests/integration/targets/ufw/tasks/tests/global-state.yml +++ b/tests/integration/targets/ufw/tasks/tests/global-state.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: Enable ufw ufw: state: enabled diff --git a/tests/integration/targets/ufw/tasks/tests/insert_relative_to.yml b/tests/integration/targets/ufw/tasks/tests/insert_relative_to.yml index 3bb44a0e27..67328a0e3f 100644 --- a/tests/integration/targets/ufw/tasks/tests/insert_relative_to.yml +++ b/tests/integration/targets/ufw/tasks/tests/insert_relative_to.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: Enable ufw: state: enabled diff --git a/tests/integration/targets/ufw/tasks/tests/interface.yml b/tests/integration/targets/ufw/tasks/tests/interface.yml index 776a72f879..9c7c570dc7 100644 --- a/tests/integration/targets/ufw/tasks/tests/interface.yml +++ b/tests/integration/targets/ufw/tasks/tests/interface.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: Enable ufw: state: enabled diff --git a/tests/integration/targets/wakeonlan/aliases b/tests/integration/targets/wakeonlan/aliases index ed821c2754..4ed7114b08 100644 --- a/tests/integration/targets/wakeonlan/aliases +++ b/tests/integration/targets/wakeonlan/aliases @@ -1,2 +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 + shippable/posix/group2 skip/aix diff --git a/tests/integration/targets/wakeonlan/tasks/main.yml b/tests/integration/targets/wakeonlan/tasks/main.yml index 166bef9992..03df57e989 100644 --- a/tests/integration/targets/wakeonlan/tasks/main.yml +++ b/tests/integration/targets/wakeonlan/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Send a magic Wake-on-LAN packet to 00:00:5E:00:53:66 wakeonlan: mac: 00:00:5E:00:53:66 diff --git a/tests/integration/targets/xattr/aliases b/tests/integration/targets/xattr/aliases index 48e54c3f5f..093fe91e51 100644 --- a/tests/integration/targets/xattr/aliases +++ b/tests/integration/targets/xattr/aliases @@ -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 + shippable/posix/group2 skip/aix skip/docker diff --git a/tests/integration/targets/xattr/defaults/main.yml b/tests/integration/targets/xattr/defaults/main.yml index c208bf6fb9..29c6d5d15e 100644 --- a/tests/integration/targets/xattr/defaults/main.yml +++ b/tests/integration/targets/xattr/defaults/main.yml @@ -1 +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 + test_file: "{{ remote_tmp_dir }}/foo.txt" diff --git a/tests/integration/targets/xattr/meta/main.yml b/tests/integration/targets/xattr/meta/main.yml index 56bc554611..ca1915e05c 100644 --- a/tests/integration/targets/xattr/meta/main.yml +++ b/tests/integration/targets/xattr/meta/main.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 + dependencies: - setup_pkg_mgr - setup_remote_tmp_dir diff --git a/tests/integration/targets/xattr/tasks/main.yml b/tests/integration/targets/xattr/tasks/main.yml index 989d19ea0c..b5293db770 100644 --- a/tests/integration/targets/xattr/tasks/main.yml +++ b/tests/integration/targets/xattr/tasks/main.yml @@ -1,8 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Setup include: setup.yml diff --git a/tests/integration/targets/xattr/tasks/setup.yml b/tests/integration/targets/xattr/tasks/setup.yml index 674e250aea..0eda72d8c9 100644 --- a/tests/integration/targets/xattr/tasks/setup.yml +++ b/tests/integration/targets/xattr/tasks/setup.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: Install package: name: attr @@ -6,4 +11,4 @@ - name: Create file file: path: "{{ test_file }}" - state: touch \ No newline at end of file + state: touch diff --git a/tests/integration/targets/xattr/tasks/test.yml b/tests/integration/targets/xattr/tasks/test.yml index 616432681f..7fe852d77a 100644 --- a/tests/integration/targets/xattr/tasks/test.yml +++ b/tests/integration/targets/xattr/tasks/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 + - name: Set attributes xattr: path: "{{ test_file }}" diff --git a/tests/integration/targets/xfs_quota/aliases b/tests/integration/targets/xfs_quota/aliases index 8781d1ef7c..41006522bc 100644 --- a/tests/integration/targets/xfs_quota/aliases +++ b/tests/integration/targets/xfs_quota/aliases @@ -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 + needs/privileged needs/root shippable/posix/group1 diff --git a/tests/integration/targets/xfs_quota/defaults/main.yml b/tests/integration/targets/xfs_quota/defaults/main.yml index ff030ce79b..b209f949ab 100644 --- a/tests/integration/targets/xfs_quota/defaults/main.yml +++ b/tests/integration/targets/xfs_quota/defaults/main.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 + uquota_default_bsoft: 1m uquota_default_bhard: 2m uquota_default_isoft: 100 diff --git a/tests/integration/targets/xfs_quota/meta/main.yml b/tests/integration/targets/xfs_quota/meta/main.yml index 1810d4bec9..982de6eb03 100644 --- a/tests/integration/targets/xfs_quota/meta/main.yml +++ b/tests/integration/targets/xfs_quota/meta/main.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 + dependencies: - setup_remote_tmp_dir diff --git a/tests/integration/targets/xfs_quota/tasks/gquota.yml b/tests/integration/targets/xfs_quota/tasks/gquota.yml index daa50d9599..88c6799d1a 100644 --- a/tests/integration/targets/xfs_quota/tasks/gquota.yml +++ b/tests/integration/targets/xfs_quota/tasks/gquota.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: Create disk image command: 'dd if=/dev/zero of={{ remote_tmp_dir }}/img-gquota bs=1M count=20 diff --git a/tests/integration/targets/xfs_quota/tasks/main.yml b/tests/integration/targets/xfs_quota/tasks/main.yml index 0256d5cd44..e98b1452ab 100644 --- a/tests/integration/targets/xfs_quota/tasks/main.yml +++ b/tests/integration/targets/xfs_quota/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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 + - block: - name: Create test user user: diff --git a/tests/integration/targets/xfs_quota/tasks/pquota.yml b/tests/integration/targets/xfs_quota/tasks/pquota.yml index 4e82f059dc..58b92dff73 100644 --- a/tests/integration/targets/xfs_quota/tasks/pquota.yml +++ b/tests/integration/targets/xfs_quota/tasks/pquota.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: Create disk image command: 'dd if=/dev/zero of={{ remote_tmp_dir }}/img-pquota bs=1M count=20 diff --git a/tests/integration/targets/xfs_quota/tasks/uquota.yml b/tests/integration/targets/xfs_quota/tasks/uquota.yml index d2e5bfe241..1cca2adb2c 100644 --- a/tests/integration/targets/xfs_quota/tasks/uquota.yml +++ b/tests/integration/targets/xfs_quota/tasks/uquota.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: Create disk image command: 'dd if=/dev/zero of={{ remote_tmp_dir }}/img-uquota bs=1M count=20 diff --git a/tests/integration/targets/xml/aliases b/tests/integration/targets/xml/aliases index 0725da563f..64596c2b12 100644 --- a/tests/integration/targets/xml/aliases +++ b/tests/integration/targets/xml/aliases @@ -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 + destructive shippable/posix/group3 skip/aix diff --git a/tests/integration/targets/xml/fixtures/ansible-xml-beers-unicode.xml.license b/tests/integration/targets/xml/fixtures/ansible-xml-beers-unicode.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/fixtures/ansible-xml-beers-unicode.xml.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/tests/integration/targets/xml/fixtures/ansible-xml-beers.xml b/tests/integration/targets/xml/fixtures/ansible-xml-beers.xml index 5afc797414..f47909ac69 100644 --- a/tests/integration/targets/xml/fixtures/ansible-xml-beers.xml +++ b/tests/integration/targets/xml/fixtures/ansible-xml-beers.xml @@ -11,4 +11,4 @@
http://tastybeverageco.com
- \ No newline at end of file + diff --git a/tests/integration/targets/xml/fixtures/ansible-xml-beers.xml.license b/tests/integration/targets/xml/fixtures/ansible-xml-beers.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/fixtures/ansible-xml-beers.xml.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/tests/integration/targets/xml/fixtures/ansible-xml-namespaced-beers.xml b/tests/integration/targets/xml/fixtures/ansible-xml-namespaced-beers.xml index 61747d4bbb..acaca7f591 100644 --- a/tests/integration/targets/xml/fixtures/ansible-xml-namespaced-beers.xml +++ b/tests/integration/targets/xml/fixtures/ansible-xml-namespaced-beers.xml @@ -11,4 +11,4 @@
http://tastybeverageco.com
- \ No newline at end of file + diff --git a/tests/integration/targets/xml/fixtures/ansible-xml-namespaced-beers.xml.license b/tests/integration/targets/xml/fixtures/ansible-xml-namespaced-beers.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/fixtures/ansible-xml-namespaced-beers.xml.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/tests/integration/targets/xml/meta/main.yml b/tests/integration/targets/xml/meta/main.yml index 5438ced5c3..2fcd152f95 100644 --- a/tests/integration/targets/xml/meta/main.yml +++ b/tests/integration/targets/xml/meta/main.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 + dependencies: - setup_pkg_mgr diff --git a/tests/integration/targets/xml/results/test-add-children-elements-unicode.xml b/tests/integration/targets/xml/results/test-add-children-elements-unicode.xml index 525330c217..ebf02ecf5a 100644 --- a/tests/integration/targets/xml/results/test-add-children-elements-unicode.xml +++ b/tests/integration/targets/xml/results/test-add-children-elements-unicode.xml @@ -11,4 +11,4 @@
http://tastybeverageco.com
- \ No newline at end of file + diff --git a/tests/integration/targets/xml/results/test-add-children-elements-unicode.xml.license b/tests/integration/targets/xml/results/test-add-children-elements-unicode.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/results/test-add-children-elements-unicode.xml.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/tests/integration/targets/xml/results/test-add-children-elements.xml b/tests/integration/targets/xml/results/test-add-children-elements.xml index f9ff25176a..3fff3d0d2e 100644 --- a/tests/integration/targets/xml/results/test-add-children-elements.xml +++ b/tests/integration/targets/xml/results/test-add-children-elements.xml @@ -11,4 +11,4 @@
http://tastybeverageco.com
- \ No newline at end of file + diff --git a/tests/integration/targets/xml/results/test-add-children-elements.xml.license b/tests/integration/targets/xml/results/test-add-children-elements.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/results/test-add-children-elements.xml.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/tests/integration/targets/xml/results/test-add-children-from-groupvars.xml b/tests/integration/targets/xml/results/test-add-children-from-groupvars.xml index 565ba402b6..e9b59a6ac1 100644 --- a/tests/integration/targets/xml/results/test-add-children-from-groupvars.xml +++ b/tests/integration/targets/xml/results/test-add-children-from-groupvars.xml @@ -11,4 +11,4 @@
http://tastybeverageco.com
- \ No newline at end of file + diff --git a/tests/integration/targets/xml/results/test-add-children-from-groupvars.xml.license b/tests/integration/targets/xml/results/test-add-children-from-groupvars.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/results/test-add-children-from-groupvars.xml.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/tests/integration/targets/xml/results/test-add-children-insertafter.xml.license b/tests/integration/targets/xml/results/test-add-children-insertafter.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/results/test-add-children-insertafter.xml.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/tests/integration/targets/xml/results/test-add-children-insertbefore.xml.license b/tests/integration/targets/xml/results/test-add-children-insertbefore.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/results/test-add-children-insertbefore.xml.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/tests/integration/targets/xml/results/test-add-children-with-attributes-unicode.xml b/tests/integration/targets/xml/results/test-add-children-with-attributes-unicode.xml index 374652244f..f206af231b 100644 --- a/tests/integration/targets/xml/results/test-add-children-with-attributes-unicode.xml +++ b/tests/integration/targets/xml/results/test-add-children-with-attributes-unicode.xml @@ -11,4 +11,4 @@
http://tastybeverageco.com
- \ No newline at end of file + diff --git a/tests/integration/targets/xml/results/test-add-children-with-attributes-unicode.xml.license b/tests/integration/targets/xml/results/test-add-children-with-attributes-unicode.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/results/test-add-children-with-attributes-unicode.xml.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/tests/integration/targets/xml/results/test-add-children-with-attributes.xml b/tests/integration/targets/xml/results/test-add-children-with-attributes.xml index 5a3907f6f2..a4471b7f17 100644 --- a/tests/integration/targets/xml/results/test-add-children-with-attributes.xml +++ b/tests/integration/targets/xml/results/test-add-children-with-attributes.xml @@ -11,4 +11,4 @@
http://tastybeverageco.com
- \ No newline at end of file + diff --git a/tests/integration/targets/xml/results/test-add-children-with-attributes.xml.license b/tests/integration/targets/xml/results/test-add-children-with-attributes.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/results/test-add-children-with-attributes.xml.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/tests/integration/targets/xml/results/test-add-element-implicitly.yml b/tests/integration/targets/xml/results/test-add-element-implicitly.xml similarity index 100% rename from tests/integration/targets/xml/results/test-add-element-implicitly.yml rename to tests/integration/targets/xml/results/test-add-element-implicitly.xml diff --git a/tests/integration/targets/xml/results/test-add-element-implicitly.xml.license b/tests/integration/targets/xml/results/test-add-element-implicitly.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/results/test-add-element-implicitly.xml.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/tests/integration/targets/xml/results/test-add-namespaced-children-elements.xml b/tests/integration/targets/xml/results/test-add-namespaced-children-elements.xml index 3d27e8aa3c..dc53d2f8ad 100644 --- a/tests/integration/targets/xml/results/test-add-namespaced-children-elements.xml +++ b/tests/integration/targets/xml/results/test-add-namespaced-children-elements.xml @@ -11,4 +11,4 @@
http://tastybeverageco.com
- \ No newline at end of file + diff --git a/tests/integration/targets/xml/results/test-add-namespaced-children-elements.xml.license b/tests/integration/targets/xml/results/test-add-namespaced-children-elements.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/results/test-add-namespaced-children-elements.xml.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/tests/integration/targets/xml/results/test-pretty-print-only.xml.license b/tests/integration/targets/xml/results/test-pretty-print-only.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/results/test-pretty-print-only.xml.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/tests/integration/targets/xml/results/test-pretty-print.xml.license b/tests/integration/targets/xml/results/test-pretty-print.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/results/test-pretty-print.xml.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/tests/integration/targets/xml/results/test-remove-attribute.xml b/tests/integration/targets/xml/results/test-remove-attribute.xml index 8a621cf144..5797419186 100644 --- a/tests/integration/targets/xml/results/test-remove-attribute.xml +++ b/tests/integration/targets/xml/results/test-remove-attribute.xml @@ -11,4 +11,4 @@
http://tastybeverageco.com
- \ No newline at end of file + diff --git a/tests/integration/targets/xml/results/test-remove-attribute.xml.license b/tests/integration/targets/xml/results/test-remove-attribute.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/results/test-remove-attribute.xml.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/tests/integration/targets/xml/results/test-remove-element.xml b/tests/integration/targets/xml/results/test-remove-element.xml index 454d905cd4..b7b1a1a5c4 100644 --- a/tests/integration/targets/xml/results/test-remove-element.xml +++ b/tests/integration/targets/xml/results/test-remove-element.xml @@ -10,4 +10,4 @@
http://tastybeverageco.com
- \ No newline at end of file + diff --git a/tests/integration/targets/xml/results/test-remove-element.xml.license b/tests/integration/targets/xml/results/test-remove-element.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/results/test-remove-element.xml.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/tests/integration/targets/xml/results/test-remove-namespaced-attribute.xml b/tests/integration/targets/xml/results/test-remove-namespaced-attribute.xml index 732a0ed224..4c4dcb1807 100644 --- a/tests/integration/targets/xml/results/test-remove-namespaced-attribute.xml +++ b/tests/integration/targets/xml/results/test-remove-namespaced-attribute.xml @@ -11,4 +11,4 @@
http://tastybeverageco.com
- \ No newline at end of file + diff --git a/tests/integration/targets/xml/results/test-remove-namespaced-attribute.xml.license b/tests/integration/targets/xml/results/test-remove-namespaced-attribute.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/results/test-remove-namespaced-attribute.xml.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/tests/integration/targets/xml/results/test-remove-namespaced-element.xml b/tests/integration/targets/xml/results/test-remove-namespaced-element.xml index 16df98e201..e723120328 100644 --- a/tests/integration/targets/xml/results/test-remove-namespaced-element.xml +++ b/tests/integration/targets/xml/results/test-remove-namespaced-element.xml @@ -10,4 +10,4 @@
http://tastybeverageco.com
- \ No newline at end of file + diff --git a/tests/integration/targets/xml/results/test-remove-namespaced-element.xml.license b/tests/integration/targets/xml/results/test-remove-namespaced-element.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/results/test-remove-namespaced-element.xml.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/tests/integration/targets/xml/results/test-set-attribute-value-unicode.xml b/tests/integration/targets/xml/results/test-set-attribute-value-unicode.xml index de3bc3f600..df50daba4e 100644 --- a/tests/integration/targets/xml/results/test-set-attribute-value-unicode.xml +++ b/tests/integration/targets/xml/results/test-set-attribute-value-unicode.xml @@ -11,4 +11,4 @@
http://tastybeverageco.com
- \ No newline at end of file + diff --git a/tests/integration/targets/xml/results/test-set-attribute-value-unicode.xml.license b/tests/integration/targets/xml/results/test-set-attribute-value-unicode.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/results/test-set-attribute-value-unicode.xml.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/tests/integration/targets/xml/results/test-set-attribute-value.xml b/tests/integration/targets/xml/results/test-set-attribute-value.xml index 143fe7bf4e..28dcff81a8 100644 --- a/tests/integration/targets/xml/results/test-set-attribute-value.xml +++ b/tests/integration/targets/xml/results/test-set-attribute-value.xml @@ -11,4 +11,4 @@
http://tastybeverageco.com
- \ No newline at end of file + diff --git a/tests/integration/targets/xml/results/test-set-attribute-value.xml.license b/tests/integration/targets/xml/results/test-set-attribute-value.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/results/test-set-attribute-value.xml.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/tests/integration/targets/xml/results/test-set-children-elements-level.xml b/tests/integration/targets/xml/results/test-set-children-elements-level.xml index 0ef2b7e6e6..b985090d74 100644 --- a/tests/integration/targets/xml/results/test-set-children-elements-level.xml +++ b/tests/integration/targets/xml/results/test-set-children-elements-level.xml @@ -8,4 +8,4 @@
http://tastybeverageco.com
- \ No newline at end of file + diff --git a/tests/integration/targets/xml/results/test-set-children-elements-level.xml.license b/tests/integration/targets/xml/results/test-set-children-elements-level.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/results/test-set-children-elements-level.xml.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/tests/integration/targets/xml/results/test-set-children-elements-unicode.xml b/tests/integration/targets/xml/results/test-set-children-elements-unicode.xml index f19d53566a..3cd586dd05 100644 --- a/tests/integration/targets/xml/results/test-set-children-elements-unicode.xml +++ b/tests/integration/targets/xml/results/test-set-children-elements-unicode.xml @@ -8,4 +8,4 @@
http://tastybeverageco.com
- \ No newline at end of file + diff --git a/tests/integration/targets/xml/results/test-set-children-elements-unicode.xml.license b/tests/integration/targets/xml/results/test-set-children-elements-unicode.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/results/test-set-children-elements-unicode.xml.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/tests/integration/targets/xml/results/test-set-children-elements.xml b/tests/integration/targets/xml/results/test-set-children-elements.xml index be313a5a8d..6348c3e8fe 100644 --- a/tests/integration/targets/xml/results/test-set-children-elements.xml +++ b/tests/integration/targets/xml/results/test-set-children-elements.xml @@ -8,4 +8,4 @@
http://tastybeverageco.com
- \ No newline at end of file + diff --git a/tests/integration/targets/xml/results/test-set-children-elements.xml.license b/tests/integration/targets/xml/results/test-set-children-elements.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/results/test-set-children-elements.xml.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/tests/integration/targets/xml/results/test-set-element-value-empty.xml b/tests/integration/targets/xml/results/test-set-element-value-empty.xml index 785beb645d..5ecab798e9 100644 --- a/tests/integration/targets/xml/results/test-set-element-value-empty.xml +++ b/tests/integration/targets/xml/results/test-set-element-value-empty.xml @@ -11,4 +11,4 @@
- \ No newline at end of file + diff --git a/tests/integration/targets/xml/results/test-set-element-value-empty.xml.license b/tests/integration/targets/xml/results/test-set-element-value-empty.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/results/test-set-element-value-empty.xml.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/tests/integration/targets/xml/results/test-set-element-value-unicode.xml b/tests/integration/targets/xml/results/test-set-element-value-unicode.xml index 734fe6dbf1..6c5ca8dd96 100644 --- a/tests/integration/targets/xml/results/test-set-element-value-unicode.xml +++ b/tests/integration/targets/xml/results/test-set-element-value-unicode.xml @@ -11,4 +11,4 @@
http://tastybeverageco.com
-пять \ No newline at end of file +пять diff --git a/tests/integration/targets/xml/results/test-set-element-value-unicode.xml.license b/tests/integration/targets/xml/results/test-set-element-value-unicode.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/results/test-set-element-value-unicode.xml.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/tests/integration/targets/xml/results/test-set-element-value.xml b/tests/integration/targets/xml/results/test-set-element-value.xml index fc97ec3bed..59fb1e5163 100644 --- a/tests/integration/targets/xml/results/test-set-element-value.xml +++ b/tests/integration/targets/xml/results/test-set-element-value.xml @@ -11,4 +11,4 @@
http://tastybeverageco.com
-5 \ No newline at end of file +5 diff --git a/tests/integration/targets/xml/results/test-set-element-value.xml.license b/tests/integration/targets/xml/results/test-set-element-value.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/results/test-set-element-value.xml.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/tests/integration/targets/xml/results/test-set-namespaced-attribute-value.xml b/tests/integration/targets/xml/results/test-set-namespaced-attribute-value.xml index 44abda43f0..229b31ad72 100644 --- a/tests/integration/targets/xml/results/test-set-namespaced-attribute-value.xml +++ b/tests/integration/targets/xml/results/test-set-namespaced-attribute-value.xml @@ -11,4 +11,4 @@
http://tastybeverageco.com
- \ No newline at end of file + diff --git a/tests/integration/targets/xml/results/test-set-namespaced-attribute-value.xml.license b/tests/integration/targets/xml/results/test-set-namespaced-attribute-value.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/results/test-set-namespaced-attribute-value.xml.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/tests/integration/targets/xml/results/test-set-namespaced-element-value.xml b/tests/integration/targets/xml/results/test-set-namespaced-element-value.xml index 0cc8a79e39..f78873e7a0 100644 --- a/tests/integration/targets/xml/results/test-set-namespaced-element-value.xml +++ b/tests/integration/targets/xml/results/test-set-namespaced-element-value.xml @@ -11,4 +11,4 @@
http://tastybeverageco.com
- \ No newline at end of file + diff --git a/tests/integration/targets/xml/results/test-set-namespaced-element-value.xml.license b/tests/integration/targets/xml/results/test-set-namespaced-element-value.xml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/xml/results/test-set-namespaced-element-value.xml.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/tests/integration/targets/xml/tasks/main.yml b/tests/integration/targets/xml/tasks/main.yml index 928c46e0f3..fe46b3ae5c 100644 --- a/tests/integration/targets/xml/tasks/main.yml +++ b/tests/integration/targets/xml/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Install lxml (FreeBSD) package: name: 'py{{ ansible_python.version.major }}{{ ansible_python.version.minor }}-lxml' diff --git a/tests/integration/targets/xml/tasks/test-add-children-elements-unicode.yml b/tests/integration/targets/xml/tasks/test-add-children-elements-unicode.yml index d89c29ae27..fbc74a9367 100644 --- a/tests/integration/targets/xml/tasks/test-add-children-elements-unicode.yml +++ b/tests/integration/targets/xml/tasks/test-add-children-elements-unicode.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: Setup test fixture copy: src: fixtures/ansible-xml-beers.xml @@ -13,6 +17,9 @@ - beer: Окское register: add_children_elements_unicode + - name: Add trailing newline + shell: echo "" >> /tmp/ansible-xml-beers.xml + - name: Compare to expected result copy: src: results/test-add-children-elements-unicode.xml diff --git a/tests/integration/targets/xml/tasks/test-add-children-elements.yml b/tests/integration/targets/xml/tasks/test-add-children-elements.yml index 3c439c7ac2..7b5e0be42a 100644 --- a/tests/integration/targets/xml/tasks/test-add-children-elements.yml +++ b/tests/integration/targets/xml/tasks/test-add-children-elements.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: Setup test fixture copy: src: fixtures/ansible-xml-beers.xml @@ -13,6 +17,9 @@ - beer: Old Rasputin register: add_children_elements + - name: Add trailing newline + shell: echo "" >> /tmp/ansible-xml-beers.xml + - name: Compare to expected result copy: src: results/test-add-children-elements.xml diff --git a/tests/integration/targets/xml/tasks/test-add-children-from-groupvars.yml b/tests/integration/targets/xml/tasks/test-add-children-from-groupvars.yml index 818fdf09b9..f6733d6e82 100644 --- a/tests/integration/targets/xml/tasks/test-add-children-from-groupvars.yml +++ b/tests/integration/targets/xml/tasks/test-add-children-from-groupvars.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: Setup test fixture copy: src: fixtures/ansible-xml-beers.xml @@ -12,6 +16,9 @@ add_children: '{{ bad_beers }}' register: add_children_from_groupvars + - name: Add trailing newline + shell: echo "" >> /tmp/ansible-xml-beers.xml + - name: Compare to expected result copy: src: results/test-add-children-from-groupvars.xml diff --git a/tests/integration/targets/xml/tasks/test-add-children-insertafter.yml b/tests/integration/targets/xml/tasks/test-add-children-insertafter.yml index 479052ebdd..fbeff105b2 100644 --- a/tests/integration/targets/xml/tasks/test-add-children-insertafter.yml +++ b/tests/integration/targets/xml/tasks/test-add-children-insertafter.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: Setup test fixture copy: src: fixtures/ansible-xml-beers.xml diff --git a/tests/integration/targets/xml/tasks/test-add-children-insertbefore.yml b/tests/integration/targets/xml/tasks/test-add-children-insertbefore.yml index 9839d7cc91..3c3212c30e 100644 --- a/tests/integration/targets/xml/tasks/test-add-children-insertbefore.yml +++ b/tests/integration/targets/xml/tasks/test-add-children-insertbefore.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: Setup test fixture copy: src: fixtures/ansible-xml-beers.xml diff --git a/tests/integration/targets/xml/tasks/test-add-children-with-attributes-unicode.yml b/tests/integration/targets/xml/tasks/test-add-children-with-attributes-unicode.yml index 585157c970..7c928b239d 100644 --- a/tests/integration/targets/xml/tasks/test-add-children-with-attributes-unicode.yml +++ b/tests/integration/targets/xml/tasks/test-add-children-with-attributes-unicode.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: Setup test fixture copy: src: fixtures/ansible-xml-beers.xml @@ -15,6 +19,9 @@ type: экстра register: add_children_with_attributes_unicode + - name: Add trailing newline + shell: echo "" >> /tmp/ansible-xml-beers.xml + - name: Compare to expected result copy: src: results/test-add-children-with-attributes-unicode.xml diff --git a/tests/integration/targets/xml/tasks/test-add-children-with-attributes.yml b/tests/integration/targets/xml/tasks/test-add-children-with-attributes.yml index c3704801d9..e11dda7639 100644 --- a/tests/integration/targets/xml/tasks/test-add-children-with-attributes.yml +++ b/tests/integration/targets/xml/tasks/test-add-children-with-attributes.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: Setup test fixture copy: src: fixtures/ansible-xml-beers.xml @@ -15,6 +19,9 @@ type: light register: add_children_with_attributes + - name: Add trailing newline + shell: echo "" >> /tmp/ansible-xml-beers.xml + - name: Compare to expected result copy: src: results/test-add-children-with-attributes.xml diff --git a/tests/integration/targets/xml/tasks/test-add-element-implicitly.yml b/tests/integration/targets/xml/tasks/test-add-element-implicitly.yml index 6166cd46b9..e3ed8080f7 100644 --- a/tests/integration/targets/xml/tasks/test-add-element-implicitly.yml +++ b/tests/integration/targets/xml/tasks/test-add-element-implicitly.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: Setup test fixture copy: src: fixtures/ansible-xml-beers.xml @@ -99,7 +103,7 @@ - name: Compare to expected result copy: - src: results/test-add-element-implicitly.yml + src: results/test-add-element-implicitly.xml dest: /tmp/ansible-xml-beers-implicit.xml check_mode: yes diff: yes @@ -109,7 +113,7 @@ assert: that: - comparison is not changed # identical - #command: diff -u {{ role_path }}/results/test-add-element-implicitly.yml /tmp/ansible-xml-beers-implicit.xml + #command: diff -u {{ role_path }}/results/test-add-element-implicitly.xml /tmp/ansible-xml-beers-implicit.xml # Now we repeat the same, just to ensure proper use of namespaces diff --git a/tests/integration/targets/xml/tasks/test-add-namespaced-children-elements.yml b/tests/integration/targets/xml/tasks/test-add-namespaced-children-elements.yml index 2cac73e65c..dd3ada48e1 100644 --- a/tests/integration/targets/xml/tasks/test-add-namespaced-children-elements.yml +++ b/tests/integration/targets/xml/tasks/test-add-namespaced-children-elements.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: Setup test fixture copy: src: fixtures/ansible-xml-namespaced-beers.xml @@ -16,6 +20,9 @@ - beer: Old Rasputin register: add_namespaced_children_elements + - name: Add trailing newline + shell: echo "" >> /tmp/ansible-xml-namespaced-beers.xml + - name: Compare to expected result copy: src: results/test-add-namespaced-children-elements.xml diff --git a/tests/integration/targets/xml/tasks/test-children-elements-xml.yml b/tests/integration/targets/xml/tasks/test-children-elements-xml.yml index 6b50d819c3..139281fb34 100644 --- a/tests/integration/targets/xml/tasks/test-children-elements-xml.yml +++ b/tests/integration/targets/xml/tasks/test-children-elements-xml.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: Setup test fixture copy: src: fixtures/ansible-xml-beers.xml @@ -14,6 +18,9 @@ - 'Old Rasputin' register: children_elements + - name: Add trailing newline + shell: echo "" >> /tmp/ansible-xml-beers.xml + - name: Compare to expected result copy: src: results/test-add-children-elements.xml diff --git a/tests/integration/targets/xml/tasks/test-count-unicode.yml b/tests/integration/targets/xml/tasks/test-count-unicode.yml index a9a462b5da..58d01b8318 100644 --- a/tests/integration/targets/xml/tasks/test-count-unicode.yml +++ b/tests/integration/targets/xml/tasks/test-count-unicode.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: Setup test fixture copy: src: fixtures/ansible-xml-beers-unicode.xml diff --git a/tests/integration/targets/xml/tasks/test-count.yml b/tests/integration/targets/xml/tasks/test-count.yml index b8a21870f7..cc778ddcd6 100644 --- a/tests/integration/targets/xml/tasks/test-count.yml +++ b/tests/integration/targets/xml/tasks/test-count.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: Setup test fixture copy: src: fixtures/ansible-xml-beers.xml diff --git a/tests/integration/targets/xml/tasks/test-get-element-content-unicode.yml b/tests/integration/targets/xml/tasks/test-get-element-content-unicode.yml index 718f12d640..475f962ebe 100644 --- a/tests/integration/targets/xml/tasks/test-get-element-content-unicode.yml +++ b/tests/integration/targets/xml/tasks/test-get-element-content-unicode.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: Setup test fixture copy: src: fixtures/ansible-xml-beers-unicode.xml diff --git a/tests/integration/targets/xml/tasks/test-get-element-content.yml b/tests/integration/targets/xml/tasks/test-get-element-content.yml index d38aa70d95..c75bdb223a 100644 --- a/tests/integration/targets/xml/tasks/test-get-element-content.yml +++ b/tests/integration/targets/xml/tasks/test-get-element-content.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: Setup test fixture copy: src: fixtures/ansible-xml-beers.xml diff --git a/tests/integration/targets/xml/tasks/test-mutually-exclusive-attributes.yml b/tests/integration/targets/xml/tasks/test-mutually-exclusive-attributes.yml index 07a71f9153..0eb92fe083 100644 --- a/tests/integration/targets/xml/tasks/test-mutually-exclusive-attributes.yml +++ b/tests/integration/targets/xml/tasks/test-mutually-exclusive-attributes.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: Setup test fixture copy: src: fixtures/ansible-xml-beers.xml diff --git a/tests/integration/targets/xml/tasks/test-pretty-print-only.yml b/tests/integration/targets/xml/tasks/test-pretty-print-only.yml index 16fcf629c5..0657186ca5 100644 --- a/tests/integration/targets/xml/tasks/test-pretty-print-only.yml +++ b/tests/integration/targets/xml/tasks/test-pretty-print-only.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: Setup test fixture copy: src: fixtures/ansible-xml-beers.xml diff --git a/tests/integration/targets/xml/tasks/test-pretty-print.yml b/tests/integration/targets/xml/tasks/test-pretty-print.yml index fd47ff3d82..2ef0a0ce8b 100644 --- a/tests/integration/targets/xml/tasks/test-pretty-print.yml +++ b/tests/integration/targets/xml/tasks/test-pretty-print.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: Setup test fixture copy: src: fixtures/ansible-xml-beers.xml diff --git a/tests/integration/targets/xml/tasks/test-remove-attribute-nochange.yml b/tests/integration/targets/xml/tasks/test-remove-attribute-nochange.yml index fbd73237f1..97bc7f525a 100644 --- a/tests/integration/targets/xml/tasks/test-remove-attribute-nochange.yml +++ b/tests/integration/targets/xml/tasks/test-remove-attribute-nochange.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: Setup test fixture copy: src: results/test-remove-attribute.xml diff --git a/tests/integration/targets/xml/tasks/test-remove-attribute.yml b/tests/integration/targets/xml/tasks/test-remove-attribute.yml index 52b5214213..84e15aa446 100644 --- a/tests/integration/targets/xml/tasks/test-remove-attribute.yml +++ b/tests/integration/targets/xml/tasks/test-remove-attribute.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: Setup test fixture copy: src: fixtures/ansible-xml-beers.xml @@ -12,6 +16,9 @@ state: absent register: remove_attribute + - name: Add trailing newline + shell: echo "" >> /tmp/ansible-xml-beers.xml + - name: Compare to expected result copy: src: results/test-remove-attribute.xml diff --git a/tests/integration/targets/xml/tasks/test-remove-element-nochange.yml b/tests/integration/targets/xml/tasks/test-remove-element-nochange.yml index e548bfabf8..ada95029e8 100644 --- a/tests/integration/targets/xml/tasks/test-remove-element-nochange.yml +++ b/tests/integration/targets/xml/tasks/test-remove-element-nochange.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: Setup test fixture copy: src: results/test-remove-element.xml diff --git a/tests/integration/targets/xml/tasks/test-remove-element.yml b/tests/integration/targets/xml/tasks/test-remove-element.yml index 092ca3e033..243e148984 100644 --- a/tests/integration/targets/xml/tasks/test-remove-element.yml +++ b/tests/integration/targets/xml/tasks/test-remove-element.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: Setup test fixture copy: src: fixtures/ansible-xml-beers.xml @@ -12,6 +16,9 @@ state: absent register: remove_element + - name: Add trailing newline + shell: echo "" >> /tmp/ansible-xml-beers.xml + - name: Compare to expected result copy: src: results/test-remove-element.xml diff --git a/tests/integration/targets/xml/tasks/test-remove-namespaced-attribute-nochange.yml b/tests/integration/targets/xml/tasks/test-remove-namespaced-attribute-nochange.yml index 19c14dec8d..80dc6fee42 100644 --- a/tests/integration/targets/xml/tasks/test-remove-namespaced-attribute-nochange.yml +++ b/tests/integration/targets/xml/tasks/test-remove-namespaced-attribute-nochange.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: Setup test fixture copy: src: results/test-remove-namespaced-attribute.xml diff --git a/tests/integration/targets/xml/tasks/test-remove-namespaced-attribute.yml b/tests/integration/targets/xml/tasks/test-remove-namespaced-attribute.yml index 9e54911ba5..75c1a505d9 100644 --- a/tests/integration/targets/xml/tasks/test-remove-namespaced-attribute.yml +++ b/tests/integration/targets/xml/tasks/test-remove-namespaced-attribute.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: Setup test fixture copy: src: fixtures/ansible-xml-namespaced-beers.xml @@ -17,6 +21,9 @@ state: absent register: remove_namespaced_attribute + - name: Add trailing newline + shell: echo "" >> /tmp/ansible-xml-namespaced-beers.xml + - name: Compare to expected result copy: src: results/test-remove-namespaced-attribute.xml diff --git a/tests/integration/targets/xml/tasks/test-remove-namespaced-element-nochange.yml b/tests/integration/targets/xml/tasks/test-remove-namespaced-element-nochange.yml index b96f2a7819..5bbb9ef7c7 100644 --- a/tests/integration/targets/xml/tasks/test-remove-namespaced-element-nochange.yml +++ b/tests/integration/targets/xml/tasks/test-remove-namespaced-element-nochange.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: Setup test fixture copy: src: results/test-remove-element.xml diff --git a/tests/integration/targets/xml/tasks/test-remove-namespaced-element.yml b/tests/integration/targets/xml/tasks/test-remove-namespaced-element.yml index 660baa9840..70a86dcd30 100644 --- a/tests/integration/targets/xml/tasks/test-remove-namespaced-element.yml +++ b/tests/integration/targets/xml/tasks/test-remove-namespaced-element.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: Setup test fixture copy: src: fixtures/ansible-xml-namespaced-beers.xml @@ -17,6 +21,9 @@ state: absent register: remove_namespaced_element + - name: Add trailing newline + shell: echo "" >> /tmp/ansible-xml-namespaced-beers.xml + - name: Compare to expected result copy: src: results/test-remove-element.xml diff --git a/tests/integration/targets/xml/tasks/test-set-attribute-value-unicode.yml b/tests/integration/targets/xml/tasks/test-set-attribute-value-unicode.yml index b72d502f12..27e759c6b8 100644 --- a/tests/integration/targets/xml/tasks/test-set-attribute-value-unicode.yml +++ b/tests/integration/targets/xml/tasks/test-set-attribute-value-unicode.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: Setup test fixture copy: src: fixtures/ansible-xml-beers.xml @@ -13,6 +17,9 @@ value: нет register: set_attribute_value_unicode + - name: Add trailing newline + shell: echo "" >> /tmp/ansible-xml-beers.xml + - name: Compare to expected result copy: src: results/test-set-attribute-value-unicode.xml diff --git a/tests/integration/targets/xml/tasks/test-set-attribute-value.yml b/tests/integration/targets/xml/tasks/test-set-attribute-value.yml index 6a2aa6c511..ada4d9ab56 100644 --- a/tests/integration/targets/xml/tasks/test-set-attribute-value.yml +++ b/tests/integration/targets/xml/tasks/test-set-attribute-value.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: Setup test fixture copy: src: fixtures/ansible-xml-beers.xml @@ -13,6 +17,9 @@ value: 'false' register: set_attribute_value + - name: Add trailing newline + shell: echo "" >> /tmp/ansible-xml-beers.xml + - name: Compare to expected result copy: src: results/test-set-attribute-value.xml diff --git a/tests/integration/targets/xml/tasks/test-set-children-elements-level.yml b/tests/integration/targets/xml/tasks/test-set-children-elements-level.yml index 7fa926e879..7fb755bfcc 100644 --- a/tests/integration/targets/xml/tasks/test-set-children-elements-level.yml +++ b/tests/integration/targets/xml/tasks/test-set-children-elements-level.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: Setup test fixture copy: src: fixtures/ansible-xml-beers.xml @@ -36,6 +40,9 @@ quantity: 20g register: set_children_elements_level + - name: Add trailing newline + shell: echo "" >> /tmp/ansible-xml-beers.xml + - name: Compare to expected result copy: src: results/test-set-children-elements-level.xml diff --git a/tests/integration/targets/xml/tasks/test-set-children-elements-unicode.yml b/tests/integration/targets/xml/tasks/test-set-children-elements-unicode.yml index 3cc25cd999..5e3a7a5758 100644 --- a/tests/integration/targets/xml/tasks/test-set-children-elements-unicode.yml +++ b/tests/integration/targets/xml/tasks/test-set-children-elements-unicode.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: Setup test fixture copy: src: fixtures/ansible-xml-beers.xml @@ -14,6 +18,9 @@ - beer: Невское register: set_children_elements_unicode + - name: Add trailing newline + shell: echo "" >> /tmp/ansible-xml-beers.xml + - name: Compare to expected result copy: src: results/test-set-children-elements-unicode.xml diff --git a/tests/integration/targets/xml/tasks/test-set-children-elements.yml b/tests/integration/targets/xml/tasks/test-set-children-elements.yml index 7c305ead74..8ab14d5080 100644 --- a/tests/integration/targets/xml/tasks/test-set-children-elements.yml +++ b/tests/integration/targets/xml/tasks/test-set-children-elements.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: Setup test fixture copy: src: fixtures/ansible-xml-beers.xml @@ -14,6 +18,9 @@ - beer: Harvest Pumpkin Ale register: set_children_elements + - name: Add trailing newline + shell: echo "" >> /tmp/ansible-xml-beers.xml + - name: Compare to expected result copy: src: results/test-set-children-elements.xml diff --git a/tests/integration/targets/xml/tasks/test-set-element-value-empty.yml b/tests/integration/targets/xml/tasks/test-set-element-value-empty.yml index 4575d5e75f..49a4903ad0 100644 --- a/tests/integration/targets/xml/tasks/test-set-element-value-empty.yml +++ b/tests/integration/targets/xml/tasks/test-set-element-value-empty.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: Setup test fixture copy: src: fixtures/ansible-xml-beers.xml @@ -12,6 +16,9 @@ value: '' register: set_element_value_empty + - name: Add trailing newline + shell: echo "" >> /tmp/ansible-xml-beers.xml + - name: Compare to expected result copy: src: results/test-set-element-value-empty.xml diff --git a/tests/integration/targets/xml/tasks/test-set-element-value-unicode.yml b/tests/integration/targets/xml/tasks/test-set-element-value-unicode.yml index 139087fcd9..9dbb47b94b 100644 --- a/tests/integration/targets/xml/tasks/test-set-element-value-unicode.yml +++ b/tests/integration/targets/xml/tasks/test-set-element-value-unicode.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: Setup test fixture copy: src: fixtures/ansible-xml-beers.xml @@ -26,6 +30,9 @@ value: пять register: set_element_second_run + - name: Add trailing newline + shell: echo "" >> /tmp/ansible-xml-beers.xml + - name: Compare to expected result copy: src: results/test-set-element-value-unicode.xml diff --git a/tests/integration/targets/xml/tasks/test-set-element-value.yml b/tests/integration/targets/xml/tasks/test-set-element-value.yml index 2f845e949b..50bbe71f95 100644 --- a/tests/integration/targets/xml/tasks/test-set-element-value.yml +++ b/tests/integration/targets/xml/tasks/test-set-element-value.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: Setup test fixture copy: src: fixtures/ansible-xml-beers.xml @@ -26,6 +30,9 @@ value: '5' register: set_element_second_run + - name: Add trailing newline + shell: echo "" >> /tmp/ansible-xml-beers.xml + - name: Compare to expected result copy: src: results/test-set-element-value.xml diff --git a/tests/integration/targets/xml/tasks/test-set-namespaced-attribute-value.yml b/tests/integration/targets/xml/tasks/test-set-namespaced-attribute-value.yml index 2ba83a8330..90a9aef725 100644 --- a/tests/integration/targets/xml/tasks/test-set-namespaced-attribute-value.yml +++ b/tests/integration/targets/xml/tasks/test-set-namespaced-attribute-value.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: Setup test fixture copy: src: fixtures/ansible-xml-namespaced-beers.xml @@ -18,6 +22,9 @@ value: 'false' register: set_namespaced_attribute_value + - name: Add trailing newline + shell: echo "" >> /tmp/ansible-xml-namespaced-beers.xml + - name: Compare to expected result copy: src: results/test-set-namespaced-attribute-value.xml diff --git a/tests/integration/targets/xml/tasks/test-set-namespaced-children-elements.yml b/tests/integration/targets/xml/tasks/test-set-namespaced-children-elements.yml index 6204c8c74d..72d342c514 100644 --- a/tests/integration/targets/xml/tasks/test-set-namespaced-children-elements.yml +++ b/tests/integration/targets/xml/tasks/test-set-namespaced-children-elements.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: Setup test fixture copy: src: fixtures/ansible-xml-namespaced-beers.xml diff --git a/tests/integration/targets/xml/tasks/test-set-namespaced-element-value.yml b/tests/integration/targets/xml/tasks/test-set-namespaced-element-value.yml index cf6a8a7eb0..7b3839a2b3 100644 --- a/tests/integration/targets/xml/tasks/test-set-namespaced-element-value.yml +++ b/tests/integration/targets/xml/tasks/test-set-namespaced-element-value.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: Setup test fixture copy: src: fixtures/ansible-xml-namespaced-beers.xml @@ -29,6 +33,9 @@ value: '11' register: set_element_second_run + - name: Add trailing newline + shell: echo "" >> /tmp/ansible-xml-namespaced-beers.xml + - name: Compare to expected result copy: src: results/test-set-namespaced-element-value.xml diff --git a/tests/integration/targets/xml/tasks/test-xmlstring.yml b/tests/integration/targets/xml/tasks/test-xmlstring.yml index 82781fa94d..4a0e4ad343 100644 --- a/tests/integration/targets/xml/tasks/test-xmlstring.yml +++ b/tests/integration/targets/xml/tasks/test-xmlstring.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: Copy expected results to remote copy: src: "results/{{ item }}" diff --git a/tests/integration/targets/xml/vars/main.yml b/tests/integration/targets/xml/vars/main.yml index 7c5675bd93..a8dfc23962 100644 --- a/tests/integration/targets/xml/vars/main.yml +++ b/tests/integration/targets/xml/vars/main.yml @@ -1,5 +1,10 @@ -# -*- mode: yaml -* --- +# 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 + +# -*- mode: yaml -* + bad_beers: - beer: "Natty Lite" - beer: "Miller Lite" diff --git a/tests/integration/targets/yarn/aliases b/tests/integration/targets/yarn/aliases index 6cd621d42d..323adc00f3 100644 --- a/tests/integration/targets/yarn/aliases +++ b/tests/integration/targets/yarn/aliases @@ -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 + shippable/posix/group1 destructive skip/aix diff --git a/tests/integration/targets/yarn/meta/main.yml b/tests/integration/targets/yarn/meta/main.yml index 230548b160..6147ad33e5 100644 --- a/tests/integration/targets/yarn/meta/main.yml +++ b/tests/integration/targets/yarn/meta/main.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 + dependencies: - setup_pkg_mgr - setup_gnutar diff --git a/tests/integration/targets/yarn/tasks/main.yml b/tests/integration/targets/yarn/tasks/main.yml index 83ddea760f..e8f4d0e6a2 100644 --- a/tests/integration/targets/yarn/tasks/main.yml +++ b/tests/integration/targets/yarn/tasks/main.yml @@ -1,25 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### # Yarn package manager integration tests -# (c) 2018 David Gunter, - -# 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) 2018 David Gunter, +# 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 # ============================================================ diff --git a/tests/integration/targets/yarn/tasks/run.yml b/tests/integration/targets/yarn/tasks/run.yml index 906880797f..367d7dcf2c 100644 --- a/tests/integration/targets/yarn/tasks/run.yml +++ b/tests/integration/targets/yarn/tasks/run.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: 'Create directory for Node' file: path: /usr/local/lib/nodejs @@ -43,8 +48,8 @@ register: yarn_version - name: 'Create dummy package.json' - copy: - src: templates/package.j2 + template: + src: package.j2 dest: '{{ remote_tmp_dir }}/package.json' - name: 'Install all packages.' diff --git a/tests/integration/targets/yarn/templates/package.j2 b/tests/integration/targets/yarn/templates/package.j2 index 8ca73aa83a..3f5456ad2e 100644 --- a/tests/integration/targets/yarn/templates/package.j2 +++ b/tests/integration/targets/yarn/templates/package.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 +#} { "name": "ansible-yarn-testing", "version": "1.0.0", @@ -6,4 +11,4 @@ "iconv-lite": "^0.4.21", "@types/node": "^12.0.0" } -} \ No newline at end of file +} diff --git a/tests/integration/targets/yum_versionlock/aliases b/tests/integration/targets/yum_versionlock/aliases index 92b8e448f1..6bbff0fe26 100644 --- a/tests/integration/targets/yum_versionlock/aliases +++ b/tests/integration/targets/yum_versionlock/aliases @@ -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 + shippable/posix/group1 skip/aix skip/freebsd skip/osx skip/macos skip/rhel8.4 # TODO make sure that tests work on 8.4 as well! +disabled # TODO diff --git a/tests/integration/targets/yum_versionlock/tasks/main.yml b/tests/integration/targets/yum_versionlock/tasks/main.yml index 2e551b48ca..d1d6726247 100644 --- a/tests/integration/targets/yum_versionlock/tasks/main.yml +++ b/tests/integration/targets/yum_versionlock/tasks/main.yml @@ -4,6 +4,10 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +# 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: Update procps-ng temporary until issue (#2539) is fixed yum: name: procps-ng diff --git a/tests/integration/targets/zypper/aliases b/tests/integration/targets/zypper/aliases index 817614d6a7..58cfb98d53 100644 --- a/tests/integration/targets/zypper/aliases +++ b/tests/integration/targets/zypper/aliases @@ -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 + destructive shippable/posix/group1 skip/aix diff --git a/tests/integration/targets/zypper/files/empty.spec.license b/tests/integration/targets/zypper/files/empty.spec.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/integration/targets/zypper/files/empty.spec.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/tests/integration/targets/zypper/meta/main.yml b/tests/integration/targets/zypper/meta/main.yml index 1810d4bec9..982de6eb03 100644 --- a/tests/integration/targets/zypper/meta/main.yml +++ b/tests/integration/targets/zypper/meta/main.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 + dependencies: - setup_remote_tmp_dir diff --git a/tests/integration/targets/zypper/tasks/main.yml b/tests/integration/targets/zypper/tasks/main.yml index b0181e6930..e12c64839d 100644 --- a/tests/integration/targets/zypper/tasks/main.yml +++ b/tests/integration/targets/zypper/tasks/main.yml @@ -1,30 +1,15 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### -# test code for the zyppe module -# -# (c) 2015, Guido Günther -# +# test code for the zypper module +# Copyright 2015, Guido Günther # heavily based on the yum tests which are -# -# (c) 2014, James Tanner - -# 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 2014, James Tanner +# 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 - include: 'zypper.yml' when: ansible_os_family == 'Suse' diff --git a/tests/integration/targets/zypper/tasks/zypper.yml b/tests/integration/targets/zypper/tasks/zypper.yml index 3394b8154e..ab1bc179eb 100644 --- a/tests/integration/targets/zypper/tasks/zypper.yml +++ b/tests/integration/targets/zypper/tasks/zypper.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: get hello package version shell: zypper --xmlout se -svx hello | grep 'name="hello"' | grep 'repository="Main Repository"' | sed 's/.*edition="\([^ ]*\)".*/\1/' register: hello_version diff --git a/tests/integration/targets/zypper/templates/duplicate.spec.j2 b/tests/integration/targets/zypper/templates/duplicate.spec.j2 index 9d1dd56a53..6f63b665c8 100644 --- a/tests/integration/targets/zypper/templates/duplicate.spec.j2 +++ b/tests/integration/targets/zypper/templates/duplicate.spec.j2 @@ -1,3 +1,9 @@ +{# +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 +#} + Summary: Duplicate{{ item }} RPM. Installs one file that is a duplicate of other Duplicate# RPMs Name: duplicate{{ item }} Version: 1 diff --git a/tests/integration/targets/zypper_repository/aliases b/tests/integration/targets/zypper_repository/aliases index 817614d6a7..58cfb98d53 100644 --- a/tests/integration/targets/zypper_repository/aliases +++ b/tests/integration/targets/zypper_repository/aliases @@ -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 + destructive shippable/posix/group1 skip/aix diff --git a/tests/integration/targets/zypper_repository/files/systemsmanagement_Uyuni_Utils.repo b/tests/integration/targets/zypper_repository/files/systemsmanagement_Uyuni_Utils.repo index 1df76802a7..aaa486d929 100644 --- a/tests/integration/targets/zypper_repository/files/systemsmanagement_Uyuni_Utils.repo +++ b/tests/integration/targets/zypper_repository/files/systemsmanagement_Uyuni_Utils.repo @@ -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 + [systemsmanagement_Uyuni_Utils] name=Several utilities to develop, build or release Uyuni (openSUSE_Leap_15.3) type=rpm-md diff --git a/tests/integration/targets/zypper_repository/meta/main.yml b/tests/integration/targets/zypper_repository/meta/main.yml index 1810d4bec9..982de6eb03 100644 --- a/tests/integration/targets/zypper_repository/meta/main.yml +++ b/tests/integration/targets/zypper_repository/meta/main.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 + dependencies: - setup_remote_tmp_dir diff --git a/tests/integration/targets/zypper_repository/tasks/main.yml b/tests/integration/targets/zypper_repository/tasks/main.yml index bbba3bcc5b..67fd4dde35 100644 --- a/tests/integration/targets/zypper_repository/tasks/main.yml +++ b/tests/integration/targets/zypper_repository/tasks/main.yml @@ -1,26 +1,13 @@ +--- #################################################################### # WARNING: These are designed specifically for Ansible tests # # and should not be used as examples of how to write Ansible roles # #################################################################### # test code for the zypper repository module -# -# (c) 2016, Guido Günther - -# 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) 2016, Guido Günther +# 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 - include: 'test.yml' when: ansible_os_family == 'Suse' diff --git a/tests/integration/targets/zypper_repository/tasks/test.yml b/tests/integration/targets/zypper_repository/tasks/test.yml index 1033ee1e7d..2f030daf48 100644 --- a/tests/integration/targets/zypper_repository/tasks/test.yml +++ b/tests/integration/targets/zypper_repository/tasks/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 + - name: collect repo configuration before test shell: "grep . /etc/zypp/repos.d/*" register: before diff --git a/tests/integration/targets/zypper_repository/tasks/zypper_repository.yml b/tests/integration/targets/zypper_repository/tasks/zypper_repository.yml index dbd9bb0064..740cffd37d 100644 --- a/tests/integration/targets/zypper_repository/tasks/zypper_repository.yml +++ b/tests/integration/targets/zypper_repository/tasks/zypper_repository.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: Delete test repo community.general.zypper_repository: name: test @@ -207,50 +212,53 @@ that: - remove_repo is changed -- name: add new repository via url to .repo file - community.general.zypper_repository: - repo: http://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable/openSUSE_Leap_{{ ansible_distribution_version }}/systemsmanagement:Uyuni:Stable.repo - state: present - register: added_by_repo_file +# For now, the URL does not work for 15.4 +- when: ansible_distribution_version is version('15.4', '<') + block: + - name: add new repository via url to .repo file + community.general.zypper_repository: + repo: http://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable/openSUSE_Leap_{{ ansible_distribution_version }}/systemsmanagement:Uyuni:Stable.repo + state: present + register: added_by_repo_file -- name: get repository details from zypper - command: zypper lr systemsmanagement_Uyuni_Stable - register: get_repository_details_from_zypper + - name: get repository details from zypper + command: zypper lr systemsmanagement_Uyuni_Stable + register: get_repository_details_from_zypper -- name: verify adding via .repo file was successful - assert: - that: - - "added_by_repo_file is changed" - - "get_repository_details_from_zypper.rc == 0" - - "'/systemsmanagement:/Uyuni:/Stable/' in get_repository_details_from_zypper.stdout" + - name: verify adding via .repo file was successful + assert: + that: + - "added_by_repo_file is changed" + - "get_repository_details_from_zypper.rc == 0" + - "'/systemsmanagement:/Uyuni:/Stable/' in get_repository_details_from_zypper.stdout" -- name: add same repository via url to .repo file again to verify idempotency - community.general.zypper_repository: - repo: http://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable/openSUSE_Leap_{{ ansible_distribution_version }}/systemsmanagement:Uyuni:Stable.repo - state: present - register: added_again_by_repo_file + - name: add same repository via url to .repo file again to verify idempotency + community.general.zypper_repository: + repo: http://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable/openSUSE_Leap_{{ ansible_distribution_version }}/systemsmanagement:Uyuni:Stable.repo + state: present + register: added_again_by_repo_file -- name: verify nothing was changed adding a repo with the same .repo file - assert: - that: - - added_again_by_repo_file is not changed + - name: verify nothing was changed adding a repo with the same .repo file + assert: + that: + - added_again_by_repo_file is not changed -- name: remove repository via url to .repo file - community.general.zypper_repository: - repo: http://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable/openSUSE_Leap_{{ ansible_distribution_version }}/systemsmanagement:Uyuni:Stable.repo - state: absent - register: removed_by_repo_file + - name: remove repository via url to .repo file + community.general.zypper_repository: + repo: http://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable/openSUSE_Leap_{{ ansible_distribution_version }}/systemsmanagement:Uyuni:Stable.repo + state: absent + register: removed_by_repo_file -- name: get list of files in /etc/zypp/repos.d/ - command: ls /etc/zypp/repos.d/ - changed_when: false - register: etc_zypp_reposd + - name: get list of files in /etc/zypp/repos.d/ + command: ls /etc/zypp/repos.d/ + changed_when: false + register: etc_zypp_reposd -- name: verify removal via .repo file was successful, including cleanup of local .repo file in /etc/zypp/repos.d/ - assert: - that: - - "removed_by_repo_file" - - "'/systemsmanagement:/Uyuni:/Stable/' not in etc_zypp_reposd.stdout" + - name: verify removal via .repo file was successful, including cleanup of local .repo file in /etc/zypp/repos.d/ + assert: + that: + - "removed_by_repo_file" + - "'/systemsmanagement:/Uyuni:/Stable/' not in etc_zypp_reposd.stdout" - name: Copy test .repo file copy: diff --git a/tests/requirements.yml b/tests/requirements.yml index 7b431b1fe0..acad510733 100644 --- a/tests/requirements.yml +++ b/tests/requirements.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 + integration_tests_dependencies: - ansible.posix - community.crypto diff --git a/tests/sanity/extra/aliases.json.license b/tests/sanity/extra/aliases.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/sanity/extra/aliases.json.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/tests/sanity/extra/aliases.py b/tests/sanity/extra/aliases.py index cd6ec02159..b5b6fe0538 100755 --- a/tests/sanity/extra/aliases.py +++ b/tests/sanity/extra/aliases.py @@ -1,6 +1,7 @@ #!/usr/bin/env python # Copyright (c) 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 """Check extra collection docs with antsibull-docs.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type diff --git a/tests/sanity/extra/botmeta.json.license b/tests/sanity/extra/botmeta.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/sanity/extra/botmeta.json.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/tests/sanity/extra/botmeta.py b/tests/sanity/extra/botmeta.py index b4095cd54a..c6d677ae5e 100755 --- a/tests/sanity/extra/botmeta.py +++ b/tests/sanity/extra/botmeta.py @@ -1,6 +1,7 @@ #!/usr/bin/env python # Copyright (c) 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 """Check BOTMETA file.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type diff --git a/tests/sanity/extra/extra-docs.json.license b/tests/sanity/extra/extra-docs.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/sanity/extra/extra-docs.json.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/tests/sanity/extra/extra-docs.py b/tests/sanity/extra/extra-docs.py index f2746e51ba..6731049231 100755 --- a/tests/sanity/extra/extra-docs.py +++ b/tests/sanity/extra/extra-docs.py @@ -1,6 +1,7 @@ #!/usr/bin/env python # Copyright (c) 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 """Check extra collection docs with antsibull-docs.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type diff --git a/tests/sanity/extra/licenses.json b/tests/sanity/extra/licenses.json new file mode 100644 index 0000000000..50e47ca88b --- /dev/null +++ b/tests/sanity/extra/licenses.json @@ -0,0 +1,4 @@ +{ + "include_symlinks": false, + "output": "path-message" +} diff --git a/tests/sanity/extra/licenses.json.license b/tests/sanity/extra/licenses.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/sanity/extra/licenses.json.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/tests/sanity/extra/licenses.py b/tests/sanity/extra/licenses.py new file mode 100755 index 0000000000..6227ee22f2 --- /dev/null +++ b/tests/sanity/extra/licenses.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python +# Copyright (c) 2022, 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 +"""Prevent files without a correct license identifier from being added to the source tree.""" +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +import os +import glob +import sys + + +def format_license_list(licenses): + if not licenses: + return '(empty)' + return ', '.join(['"%s"' % license for license in licenses]) + + +def find_licenses(filename, relax=False): + spdx_license_identifiers = [] + other_license_identifiers = [] + has_copyright = False + try: + with open(filename, 'r', encoding='utf-8') as f: + for line in f: + line = line.rstrip() + if 'Copyright ' in line: + has_copyright = True + if 'Copyright: ' in line: + print('%s: found copyright line with "Copyright:". Please remove the colon.' % (filename, )) + if 'SPDX-FileCopyrightText: ' in line: + has_copyright = True + idx = line.find('SPDX-License-Identifier: ') + if idx >= 0: + lic_id = line[idx + len('SPDX-License-Identifier: '):] + spdx_license_identifiers.extend(lic_id.split(' OR ')) + if 'GNU General Public License' in line: + if 'v3.0+' in line: + other_license_identifiers.append('GPL-3.0-or-later') + if 'version 3 or later' in line: + other_license_identifiers.append('GPL-3.0-or-later') + if 'Simplified BSD License' in line: + other_license_identifiers.append('BSD-2-Clause') + if 'Apache License 2.0' in line: + other_license_identifiers.append('Apache-2.0') + if 'PSF License' in line or 'Python-2.0' in line: + other_license_identifiers.append('PSF-2.0') + if 'MIT License' in line: + other_license_identifiers.append('MIT') + except Exception as exc: + print('%s: error while processing file: %s' % (filename, exc)) + if len(set(spdx_license_identifiers)) < len(spdx_license_identifiers): + print('%s: found identical SPDX-License-Identifier values' % (filename, )) + if other_license_identifiers and set(other_license_identifiers) != set(spdx_license_identifiers): + print('%s: SPDX-License-Identifier yielded the license list %s, while manual guessing yielded the license list %s' % ( + filename, format_license_list(spdx_license_identifiers), format_license_list(other_license_identifiers))) + if not has_copyright and not relax: + print('%s: found no copyright notice' % (filename, )) + return sorted(spdx_license_identifiers) + + +def main(): + """Main entry point.""" + paths = sys.argv[1:] or sys.stdin.read().splitlines() + + # The following paths are allowed to have no license identifier + no_comments_allowed = [ + 'changelogs/fragments/*.yml', + 'changelogs/fragments/*.yaml', + ] + + # These files are completely ignored + ignore_paths = [ + '.ansible-test-timeout.json', + '.reuse/dep5', + 'LICENSES/*.txt', + 'COPYING', + ] + + no_comments_allowed = [fn for pattern in no_comments_allowed for fn in glob.glob(pattern)] + ignore_paths = [fn for pattern in ignore_paths for fn in glob.glob(pattern)] + + valid_licenses = [license_file[len('LICENSES/'):-len('.txt')] for license_file in glob.glob('LICENSES/*.txt')] + + for path in paths: + if path.startswith('./'): + path = path[2:] + if path in ignore_paths or path.startswith('tests/output/'): + continue + if os.stat(path).st_size == 0: + continue + if not path.endswith('.license') and os.path.exists(path + '.license'): + path = path + '.license' + valid_licenses_for_path = valid_licenses + if path.startswith('plugins/') and not path.startswith(('plugins/modules/', 'plugins/module_utils/', 'plugins/doc_fragments/')): + valid_licenses_for_path = [license for license in valid_licenses if license == 'GPL-3.0-or-later'] + licenses = find_licenses(path, relax=path in no_comments_allowed) + if not licenses: + if path not in no_comments_allowed: + print('%s: must have at least one license' % (path, )) + else: + for license in licenses: + if license not in valid_licenses_for_path: + print('%s: found not allowed license "%s", must be one of %s' % ( + path, license, format_license_list(valid_licenses_for_path))) + + +if __name__ == '__main__': + main() diff --git a/tests/sanity/extra/licenses.py.license b/tests/sanity/extra/licenses.py.license new file mode 100644 index 0000000000..6c4958feba --- /dev/null +++ b/tests/sanity/extra/licenses.py.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: 2022, Felix Fontein diff --git a/tests/sanity/extra/no-unwanted-files.json.license b/tests/sanity/extra/no-unwanted-files.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/sanity/extra/no-unwanted-files.json.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/tests/sanity/extra/no-unwanted-files.py b/tests/sanity/extra/no-unwanted-files.py index 4522f77e2b..b39df83a18 100755 --- a/tests/sanity/extra/no-unwanted-files.py +++ b/tests/sanity/extra/no-unwanted-files.py @@ -1,6 +1,7 @@ #!/usr/bin/env python # Copyright (c) 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 """Prevent unwanted files from being added to the source tree.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt deleted file mode 100644 index 83bf11e304..0000000000 --- a/tests/sanity/ignore-2.10.txt +++ /dev/null @@ -1,44 +0,0 @@ -.azure-pipelines/scripts/publish-codecov.py replace-urlopen -.azure-pipelines/scripts/publish-codecov.py compile-2.6!skip # Uses Python 3.6+ syntax -.azure-pipelines/scripts/publish-codecov.py compile-2.7!skip # Uses Python 3.6+ syntax -.azure-pipelines/scripts/publish-codecov.py compile-3.5!skip # Uses Python 3.6+ syntax -.azure-pipelines/scripts/publish-codecov.py future-import-boilerplate -.azure-pipelines/scripts/publish-codecov.py metaclass-boilerplate -plugins/module_utils/cloud.py pylint:bad-option-value # a pylint test that is disabled was modified over time -plugins/modules/cloud/lxc/lxc_container.py use-argspec-type-path -plugins/modules/cloud/lxc/lxc_container.py validate-modules:use-run-command-not-popen -plugins/modules/cloud/lxd/lxd_project.py use-argspec-type-path # expanduser() applied to constants -plugins/modules/cloud/misc/rhevm.py validate-modules:parameter-state-invalid-choice -plugins/modules/cloud/rackspace/rax.py use-argspec-type-path # fix needed -plugins/modules/cloud/rackspace/rax_files.py validate-modules:parameter-state-invalid-choice -plugins/modules/cloud/rackspace/rax_files_objects.py use-argspec-type-path -plugins/modules/cloud/rackspace/rax_scaling_group.py use-argspec-type-path # fix needed, expanduser() applied to dict values -plugins/modules/cloud/scaleway/scaleway_organization_info.py validate-modules:return-syntax-error -plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc -plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-list-no-elements -plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:undocumented-parameter -plugins/modules/cloud/univention/udm_share.py validate-modules:parameter-list-no-elements -plugins/modules/cloud/univention/udm_user.py validate-modules:parameter-list-no-elements -plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type -plugins/modules/clustering/consul/consul.py validate-modules:undocumented-parameter -plugins/modules/clustering/consul/consul_session.py validate-modules:parameter-state-invalid-choice -plugins/modules/packaging/language/yarn.py use-argspec-type-path -plugins/modules/packaging/os/redhat_subscription.py validate-modules:return-syntax-error -plugins/modules/remote_management/manageiq/manageiq_policies.py validate-modules:parameter-state-invalid-choice -plugins/modules/remote_management/manageiq/manageiq_provider.py validate-modules:doc-choices-do-not-match-spec # missing docs on suboptions -plugins/modules/remote_management/manageiq/manageiq_provider.py validate-modules:doc-missing-type # missing docs on suboptions -plugins/modules/remote_management/manageiq/manageiq_provider.py validate-modules:parameter-type-not-in-doc # missing docs on suboptions -plugins/modules/remote_management/manageiq/manageiq_provider.py validate-modules:undocumented-parameter # missing docs on suboptions -plugins/modules/remote_management/manageiq/manageiq_tags.py validate-modules:parameter-state-invalid-choice -plugins/modules/system/gconftool2.py validate-modules:parameter-state-invalid-choice -plugins/modules/system/iptables_state.py validate-modules:undocumented-parameter -plugins/modules/system/osx_defaults.py validate-modules:parameter-state-invalid-choice -plugins/modules/system/parted.py validate-modules:parameter-state-invalid-choice -plugins/modules/system/puppet.py use-argspec-type-path -plugins/modules/system/puppet.py validate-modules:parameter-invalid # invalid alias - removed in 7.0.0 -plugins/modules/system/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path -plugins/modules/system/xfconf.py validate-modules:return-syntax-error -plugins/modules/web_infrastructure/jenkins_plugin.py use-argspec-type-path -tests/integration/targets/django_manage/files/base_test/simple_project/p1/manage.py compile-2.6 # django generated code -tests/integration/targets/django_manage/files/base_test/simple_project/p1/manage.py compile-2.7 # django generated code diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt index b3ab408832..e6919b17b7 100644 --- a/tests/sanity/ignore-2.11.txt +++ b/tests/sanity/ignore-2.11.txt @@ -13,7 +13,7 @@ plugins/modules/cloud/rackspace/rax_files.py validate-modules:parameter-state-in plugins/modules/cloud/rackspace/rax_files_objects.py use-argspec-type-path plugins/modules/cloud/rackspace/rax_scaling_group.py use-argspec-type-path # fix needed, expanduser() applied to dict values plugins/modules/cloud/scaleway/scaleway_organization_info.py validate-modules:return-syntax-error -plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc +plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc # unused param - removed in 6.0.0 plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-list-no-elements plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-type-not-in-doc plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:undocumented-parameter @@ -22,6 +22,7 @@ plugins/modules/cloud/univention/udm_user.py validate-modules:parameter-list-no- plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type plugins/modules/clustering/consul/consul.py validate-modules:undocumented-parameter plugins/modules/clustering/consul/consul_session.py validate-modules:parameter-state-invalid-choice +plugins/modules/files/ini_file.py pylint:bad-option-value plugins/modules/packaging/language/yarn.py use-argspec-type-path plugins/modules/packaging/os/redhat_subscription.py validate-modules:return-syntax-error plugins/modules/remote_management/manageiq/manageiq_policies.py validate-modules:parameter-state-invalid-choice diff --git a/tests/sanity/ignore-2.11.txt.license b/tests/sanity/ignore-2.11.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/sanity/ignore-2.11.txt.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/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt index 164fc7daf5..ae52113f15 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.txt @@ -8,7 +8,7 @@ plugins/modules/cloud/rackspace/rax_files.py validate-modules:parameter-state-in plugins/modules/cloud/rackspace/rax_files_objects.py use-argspec-type-path plugins/modules/cloud/rackspace/rax_scaling_group.py use-argspec-type-path # fix needed, expanduser() applied to dict values plugins/modules/cloud/scaleway/scaleway_organization_info.py validate-modules:return-syntax-error -plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc +plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc # unused param - removed in 6.0.0 plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-list-no-elements plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-type-not-in-doc plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:undocumented-parameter @@ -17,6 +17,7 @@ plugins/modules/cloud/univention/udm_user.py validate-modules:parameter-list-no- plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type plugins/modules/clustering/consul/consul.py validate-modules:undocumented-parameter plugins/modules/clustering/consul/consul_session.py validate-modules:parameter-state-invalid-choice +plugins/modules/files/ini_file.py pylint:bad-option-value plugins/modules/packaging/language/yarn.py use-argspec-type-path plugins/modules/packaging/os/redhat_subscription.py validate-modules:return-syntax-error plugins/modules/remote_management/manageiq/manageiq_policies.py validate-modules:parameter-state-invalid-choice diff --git a/tests/sanity/ignore-2.12.txt.license b/tests/sanity/ignore-2.12.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/sanity/ignore-2.12.txt.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/tests/sanity/ignore-2.13.txt b/tests/sanity/ignore-2.13.txt index 164fc7daf5..ae52113f15 100644 --- a/tests/sanity/ignore-2.13.txt +++ b/tests/sanity/ignore-2.13.txt @@ -8,7 +8,7 @@ plugins/modules/cloud/rackspace/rax_files.py validate-modules:parameter-state-in plugins/modules/cloud/rackspace/rax_files_objects.py use-argspec-type-path plugins/modules/cloud/rackspace/rax_scaling_group.py use-argspec-type-path # fix needed, expanduser() applied to dict values plugins/modules/cloud/scaleway/scaleway_organization_info.py validate-modules:return-syntax-error -plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc +plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc # unused param - removed in 6.0.0 plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-list-no-elements plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-type-not-in-doc plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:undocumented-parameter @@ -17,6 +17,7 @@ plugins/modules/cloud/univention/udm_user.py validate-modules:parameter-list-no- plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type plugins/modules/clustering/consul/consul.py validate-modules:undocumented-parameter plugins/modules/clustering/consul/consul_session.py validate-modules:parameter-state-invalid-choice +plugins/modules/files/ini_file.py pylint:bad-option-value plugins/modules/packaging/language/yarn.py use-argspec-type-path plugins/modules/packaging/os/redhat_subscription.py validate-modules:return-syntax-error plugins/modules/remote_management/manageiq/manageiq_policies.py validate-modules:parameter-state-invalid-choice diff --git a/tests/sanity/ignore-2.13.txt.license b/tests/sanity/ignore-2.13.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/sanity/ignore-2.13.txt.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/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index 164fc7daf5..a2ccf20db3 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -1,4 +1,5 @@ .azure-pipelines/scripts/publish-codecov.py replace-urlopen +plugins/modules/cloud/univention/udm_user.py import-3.11 # Uses deprecated stdlib library 'crypt' plugins/modules/cloud/lxc/lxc_container.py use-argspec-type-path plugins/modules/cloud/lxc/lxc_container.py validate-modules:use-run-command-not-popen plugins/modules/cloud/lxd/lxd_project.py use-argspec-type-path # expanduser() applied to constants @@ -8,7 +9,7 @@ plugins/modules/cloud/rackspace/rax_files.py validate-modules:parameter-state-in plugins/modules/cloud/rackspace/rax_files_objects.py use-argspec-type-path plugins/modules/cloud/rackspace/rax_scaling_group.py use-argspec-type-path # fix needed, expanduser() applied to dict values plugins/modules/cloud/scaleway/scaleway_organization_info.py validate-modules:return-syntax-error -plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc +plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc # unused param - removed in 6.0.0 plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-list-no-elements plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-type-not-in-doc plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:undocumented-parameter @@ -26,6 +27,7 @@ plugins/modules/remote_management/manageiq/manageiq_provider.py validate-modules plugins/modules/remote_management/manageiq/manageiq_provider.py validate-modules:undocumented-parameter # missing docs on suboptions plugins/modules/remote_management/manageiq/manageiq_tags.py validate-modules:parameter-state-invalid-choice plugins/modules/system/gconftool2.py validate-modules:parameter-state-invalid-choice +plugins/modules/system/homectl.py import-3.11 # Uses deprecated stdlib library 'crypt' plugins/modules/system/iptables_state.py validate-modules:undocumented-parameter plugins/modules/system/osx_defaults.py validate-modules:parameter-state-invalid-choice plugins/modules/system/parted.py validate-modules:parameter-state-invalid-choice diff --git a/tests/sanity/ignore-2.14.txt.license b/tests/sanity/ignore-2.14.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/sanity/ignore-2.14.txt.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/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt deleted file mode 100644 index ffc4917389..0000000000 --- a/tests/sanity/ignore-2.9.txt +++ /dev/null @@ -1,33 +0,0 @@ -.azure-pipelines/scripts/publish-codecov.py replace-urlopen -.azure-pipelines/scripts/publish-codecov.py compile-2.6!skip # Uses Python 3.6+ syntax -.azure-pipelines/scripts/publish-codecov.py compile-2.7!skip # Uses Python 3.6+ syntax -.azure-pipelines/scripts/publish-codecov.py compile-3.5!skip # Uses Python 3.6+ syntax -.azure-pipelines/scripts/publish-codecov.py future-import-boilerplate -.azure-pipelines/scripts/publish-codecov.py metaclass-boilerplate -plugins/module_utils/cloud.py pylint:bad-option-value # a pylint test that is disabled was modified over time -plugins/modules/cloud/lxc/lxc_container.py use-argspec-type-path -plugins/modules/cloud/lxc/lxc_container.py validate-modules:use-run-command-not-popen -plugins/modules/cloud/lxd/lxd_project.py use-argspec-type-path # expanduser() applied to constants -plugins/modules/cloud/rackspace/rax.py use-argspec-type-path -plugins/modules/cloud/rackspace/rax_files_objects.py use-argspec-type-path -plugins/modules/cloud/rackspace/rax_scaling_group.py use-argspec-type-path # fix needed, expanduser() applied to dict values -plugins/modules/cloud/scaleway/scaleway_organization_info.py validate-modules:return-syntax-error -plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc -plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:undocumented-parameter -plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type -plugins/modules/clustering/consul/consul.py validate-modules:undocumented-parameter -plugins/modules/packaging/language/yarn.py use-argspec-type-path -plugins/modules/packaging/os/redhat_subscription.py validate-modules:return-syntax-error -plugins/modules/remote_management/manageiq/manageiq_provider.py validate-modules:doc-choices-do-not-match-spec # missing docs on suboptions -plugins/modules/remote_management/manageiq/manageiq_provider.py validate-modules:doc-missing-type # missing docs on suboptions -plugins/modules/remote_management/manageiq/manageiq_provider.py validate-modules:parameter-type-not-in-doc # missing docs on suboptions -plugins/modules/remote_management/manageiq/manageiq_provider.py validate-modules:undocumented-parameter # missing docs on suboptions -plugins/modules/system/iptables_state.py validate-modules:undocumented-parameter -plugins/modules/system/puppet.py use-argspec-type-path -plugins/modules/system/puppet.py validate-modules:parameter-invalid # invalid alias - removed in 7.0.0 -plugins/modules/system/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path -plugins/modules/system/xfconf.py validate-modules:return-syntax-error -plugins/modules/web_infrastructure/jenkins_plugin.py use-argspec-type-path -tests/integration/targets/django_manage/files/base_test/simple_project/p1/manage.py compile-2.6 # django generated code -tests/integration/targets/django_manage/files/base_test/simple_project/p1/manage.py compile-2.7 # django generated code diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/compat/builtins.py b/tests/unit/compat/builtins.py index f60ee67822..b0cc618676 100644 --- a/tests/unit/compat/builtins.py +++ b/tests/unit/compat/builtins.py @@ -1,19 +1,6 @@ -# (c) 2014, Toshio Kuratomi -# -# 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) 2014, Toshio Kuratomi +# 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/tests/unit/compat/mock.py b/tests/unit/compat/mock.py index 0972cd2e8e..f8f565dcf3 100644 --- a/tests/unit/compat/mock.py +++ b/tests/unit/compat/mock.py @@ -1,19 +1,6 @@ -# (c) 2014, Toshio Kuratomi -# -# 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) 2014, Toshio Kuratomi +# 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/tests/unit/compat/unittest.py b/tests/unit/compat/unittest.py index 98f08ad6a8..1872e58337 100644 --- a/tests/unit/compat/unittest.py +++ b/tests/unit/compat/unittest.py @@ -1,19 +1,6 @@ -# (c) 2014, Toshio Kuratomi -# -# 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) 2014, Toshio Kuratomi +# 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/tests/unit/mock/__init__.py b/tests/unit/mock/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/mock/loader.py b/tests/unit/mock/loader.py index 5389bdcb2f..948f4eecd9 100644 --- a/tests/unit/mock/loader.py +++ b/tests/unit/mock/loader.py @@ -1,6 +1,7 @@ -# (c) 2012-2014, Michael DeHaan +# Copyright (c) 2012-2014, Michael DeHaan # -# 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/tests/unit/mock/path.py b/tests/unit/mock/path.py index c1c075bc02..62ae023431 100644 --- a/tests/unit/mock/path.py +++ b/tests/unit/mock/path.py @@ -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 + from __future__ import (absolute_import, division, print_function) __metaclass__ = type diff --git a/tests/unit/mock/procenv.py b/tests/unit/mock/procenv.py index 5673863e16..4646d7f355 100644 --- a/tests/unit/mock/procenv.py +++ b/tests/unit/mock/procenv.py @@ -1,7 +1,8 @@ -# (c) 2016, Matt Davis -# (c) 2016, Toshio Kuratomi +# Copyright (c) 2016, Matt Davis +# Copyright (c) 2016, Toshio Kuratomi # -# 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/tests/unit/mock/vault_helper.py b/tests/unit/mock/vault_helper.py index 6bd2db9c32..2b116129f5 100644 --- a/tests/unit/mock/vault_helper.py +++ b/tests/unit/mock/vault_helper.py @@ -1,4 +1,6 @@ -# 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/tests/unit/mock/yaml_helper.py b/tests/unit/mock/yaml_helper.py index a646c0241c..ce1bd719b8 100644 --- a/tests/unit/mock/yaml_helper.py +++ b/tests/unit/mock/yaml_helper.py @@ -1,4 +1,6 @@ -# 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/tests/unit/plugins/__init__.py b/tests/unit/plugins/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/become/__init__.py b/tests/unit/plugins/become/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/become/conftest.py b/tests/unit/plugins/become/conftest.py index a04a5e2da9..93b593bdfd 100644 --- a/tests/unit/plugins/become/conftest.py +++ b/tests/unit/plugins/become/conftest.py @@ -1,7 +1,8 @@ -# (c) 2012-2014, Michael DeHaan -# (c) 2017 Ansible Project +# Copyright (c) 2012-2014, Michael DeHaan +# 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 # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) diff --git a/tests/unit/plugins/become/helper.py b/tests/unit/plugins/become/helper.py index 69e3ea6cd0..410738504b 100644 --- a/tests/unit/plugins/become/helper.py +++ b/tests/unit/plugins/become/helper.py @@ -1,8 +1,9 @@ # -*- coding: utf-8 -*- -# (c) 2012-2014, Michael DeHaan +# Copyright (c) 2012-2014, Michael DeHaan # -# 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/tests/unit/plugins/become/test_doas.py b/tests/unit/plugins/become/test_doas.py index 0474b3b615..4a922e9f2b 100644 --- a/tests/unit/plugins/become/test_doas.py +++ b/tests/unit/plugins/become/test_doas.py @@ -1,7 +1,8 @@ -# (c) 2012-2014, Michael DeHaan -# (c) 2020 Ansible Project +# Copyright (c) 2012-2014, Michael DeHaan +# 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 # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) diff --git a/tests/unit/plugins/become/test_dzdo.py b/tests/unit/plugins/become/test_dzdo.py index eb5932cd10..24af2b50c2 100644 --- a/tests/unit/plugins/become/test_dzdo.py +++ b/tests/unit/plugins/become/test_dzdo.py @@ -1,7 +1,8 @@ -# (c) 2012-2014, Michael DeHaan -# (c) 2020 Ansible Project +# Copyright (c) 2012-2014, Michael DeHaan +# 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 # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) diff --git a/tests/unit/plugins/become/test_ksu.py b/tests/unit/plugins/become/test_ksu.py index 87c337064a..3ec1716612 100644 --- a/tests/unit/plugins/become/test_ksu.py +++ b/tests/unit/plugins/become/test_ksu.py @@ -1,7 +1,8 @@ -# (c) 2012-2014, Michael DeHaan -# (c) 2020 Ansible Project +# Copyright (c) 2012-2014, Michael DeHaan +# 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 # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) diff --git a/tests/unit/plugins/become/test_pbrun.py b/tests/unit/plugins/become/test_pbrun.py index b8e369d274..eceea2e66b 100644 --- a/tests/unit/plugins/become/test_pbrun.py +++ b/tests/unit/plugins/become/test_pbrun.py @@ -1,7 +1,8 @@ -# (c) 2012-2014, Michael DeHaan -# (c) 2020 Ansible Project +# Copyright (c) 2012-2014, Michael DeHaan +# 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 # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) diff --git a/tests/unit/plugins/become/test_pfexec.py b/tests/unit/plugins/become/test_pfexec.py index 3adc2ed51d..445185c197 100644 --- a/tests/unit/plugins/become/test_pfexec.py +++ b/tests/unit/plugins/become/test_pfexec.py @@ -1,7 +1,8 @@ -# (c) 2012-2014, Michael DeHaan -# (c) 2020 Ansible Project +# Copyright (c) 2012-2014, Michael DeHaan +# 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 # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) diff --git a/tests/unit/plugins/become/test_sudosu.py b/tests/unit/plugins/become/test_sudosu.py index 6adf200d8e..f63f48df70 100644 --- a/tests/unit/plugins/become/test_sudosu.py +++ b/tests/unit/plugins/become/test_sudosu.py @@ -1,7 +1,8 @@ -# (c) 2012-2014, Michael DeHaan -# (c) 2021 Ansible Project +# Copyright (c) 2012-2014, Michael DeHaan +# 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 # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) diff --git a/tests/unit/plugins/cache/__init__.py b/tests/unit/plugins/cache/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/cache/test_memcached.py b/tests/unit/plugins/cache/test_memcached.py index bfa9deec6c..8e203cfabc 100644 --- a/tests/unit/plugins/cache/test_memcached.py +++ b/tests/unit/plugins/cache/test_memcached.py @@ -1,19 +1,6 @@ -# (c) 2012-2015, Michael DeHaan -# -# 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) 2012-2015, 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/tests/unit/plugins/cache/test_redis.py b/tests/unit/plugins/cache/test_redis.py index 9fdc3584ec..26f97c127e 100644 --- a/tests/unit/plugins/cache/test_redis.py +++ b/tests/unit/plugins/cache/test_redis.py @@ -1,19 +1,6 @@ -# (c) 2012-2015, Michael DeHaan -# -# 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) 2012-2015, 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/tests/unit/plugins/callback/__init__.py b/tests/unit/plugins/callback/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/callback/test_elastic.py b/tests/unit/plugins/callback/test_elastic.py index 8a50da038f..73f4a6c27c 100644 --- a/tests/unit/plugins/callback/test_elastic.py +++ b/tests/unit/plugins/callback/test_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/tests/unit/plugins/callback/test_loganalytics.py b/tests/unit/plugins/callback/test_loganalytics.py index 085e1163cb..a61ad32d3a 100644 --- a/tests/unit/plugins/callback/test_loganalytics.py +++ b/tests/unit/plugins/callback/test_loganalytics.py @@ -1,4 +1,6 @@ -# 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/tests/unit/plugins/callback/test_opentelemetry.py b/tests/unit/plugins/callback/test_opentelemetry.py index 41700fbcb7..1865e0b153 100644 --- a/tests/unit/plugins/callback/test_opentelemetry.py +++ b/tests/unit/plugins/callback/test_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 diff --git a/tests/unit/plugins/callback/test_splunk.py b/tests/unit/plugins/callback/test_splunk.py index 3230228da1..595d1530b6 100644 --- a/tests/unit/plugins/callback/test_splunk.py +++ b/tests/unit/plugins/callback/test_splunk.py @@ -1,17 +1,7 @@ -# 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/tests/unit/plugins/connection/__init__.py b/tests/unit/plugins/connection/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/connection/test_lxc.py b/tests/unit/plugins/connection/test_lxc.py index 28bfc33156..4a1139d6e9 100644 --- a/tests/unit/plugins/connection/test_lxc.py +++ b/tests/unit/plugins/connection/test_lxc.py @@ -1,20 +1,6 @@ -# -# (c) 2020 Red Hat Inc. -# -# 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 Red Hat 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 # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) diff --git a/tests/unit/plugins/filter/test_crc32.py b/tests/unit/plugins/filter/test_crc32.py new file mode 100644 index 0000000000..961840235d --- /dev/null +++ b/tests/unit/plugins/filter/test_crc32.py @@ -0,0 +1,17 @@ +# -*- 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_collections.community.general.tests.unit.compat import unittest +from ansible.errors import AnsibleError +from ansible_collections.community.general.plugins.filter.crc32 import crc32s + + +class TestFilterCrc32(unittest.TestCase): + + def test_checksum(self): + self.assertEqual(crc32s('test'), 'd87f7e0c') diff --git a/tests/unit/plugins/inventory/__init__.py b/tests/unit/plugins/inventory/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/inventory/fixtures/lxd_inventory.atd.license b/tests/unit/plugins/inventory/fixtures/lxd_inventory.atd.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/inventory/fixtures/lxd_inventory.atd.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/tests/unit/plugins/inventory/fixtures/opennebula_inventory.json.license b/tests/unit/plugins/inventory/fixtures/opennebula_inventory.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/inventory/fixtures/opennebula_inventory.json.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/tests/unit/plugins/inventory/test_cobbler.py b/tests/unit/plugins/inventory/test_cobbler.py index e184d166dc..6db9b91cbc 100644 --- a/tests/unit/plugins/inventory/test_cobbler.py +++ b/tests/unit/plugins/inventory/test_cobbler.py @@ -1,21 +1,7 @@ # -*- coding: utf-8 -*- - # Copyright 2020 Orion Poplawski -# -# 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/tests/unit/plugins/inventory/test_icinga2.py b/tests/unit/plugins/inventory/test_icinga2.py index bcb6aa9614..e3928b0dbe 100644 --- a/tests/unit/plugins/inventory/test_icinga2.py +++ b/tests/unit/plugins/inventory/test_icinga2.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # Copyright (c) 2021, Cliff Hults -# 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 # # The API responses used in these tests were recorded from PVE version 6.2. diff --git a/tests/unit/plugins/inventory/test_linode.py b/tests/unit/plugins/inventory/test_linode.py index d6c1794a91..60b3c8cb68 100644 --- a/tests/unit/plugins/inventory/test_linode.py +++ b/tests/unit/plugins/inventory/test_linode.py @@ -1,21 +1,7 @@ # -*- coding: utf-8 -*- - # Copyright 2018 Luke Murphy -# -# 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/tests/unit/plugins/inventory/test_lxd.py b/tests/unit/plugins/inventory/test_lxd.py index 42142c8d64..99c9e166c1 100644 --- a/tests/unit/plugins/inventory/test_lxd.py +++ b/tests/unit/plugins/inventory/test_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) diff --git a/tests/unit/plugins/inventory/test_opennebula.py b/tests/unit/plugins/inventory/test_opennebula.py index 88a5f29d2d..bbc2fe699a 100644 --- a/tests/unit/plugins/inventory/test_opennebula.py +++ b/tests/unit/plugins/inventory/test_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 # # The API responses used in these tests were recorded from OpenNebula version 5.10. diff --git a/tests/unit/plugins/inventory/test_proxmox.py b/tests/unit/plugins/inventory/test_proxmox.py index ae29ab0a35..13832c9387 100644 --- a/tests/unit/plugins/inventory/test_proxmox.py +++ b/tests/unit/plugins/inventory/test_proxmox.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # Copyright (c) 2020, Jeffrey van Pelt -# 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 # # The API responses used in these tests were recorded from PVE version 6.2. @@ -520,6 +521,99 @@ def get_json(url): } ] } + elif url == "https://localhost:8006/api2/json/nodes/testnode/lxc/100/status/current": + # _get_vm_status (lxc) + return { + "swap": 0, + "name": "test-lxc", + "diskread": 0, + "vmid": 100, + "diskwrite": 0, + "pid": 9000, + "mem": 89980928, + "netin": 1950776396424, + "disk": 4998168576, + "cpu": 0.00163430613110039, + "type": "lxc", + "uptime": 6793736, + "maxmem": 1073741824, + "status": "running", + "cpus": "1", + "ha": { + "group": 'null', + "state": "started", + "managed": 1 + }, + "maxdisk": 3348329267200, + "netout": 1947793356037, + "maxswap": 1073741824 + } + elif url == "https://localhost:8006/api2/json/nodes/testnode/qemu/101/status/current": + # _get_vm_status (qemu) + return { + "status": "stopped", + "uptime": 0, + "maxmem": 5364514816, + "maxdisk": 34359738368, + "netout": 0, + "cpus": 2, + "ha": { + "managed": 0 + }, + "diskread": 0, + "vmid": 101, + "diskwrite": 0, + "name": "test-qemu", + "cpu": 0, + "disk": 0, + "netin": 0, + "mem": 0, + "qmpstatus": "stopped" + } + elif url == "https://localhost:8006/api2/json/nodes/testnode/qemu/102/status/current": + # _get_vm_status (qemu) + return { + "status": "stopped", + "uptime": 0, + "maxmem": 5364514816, + "maxdisk": 34359738368, + "netout": 0, + "cpus": 2, + "ha": { + "managed": 0 + }, + "diskread": 0, + "vmid": 102, + "diskwrite": 0, + "name": "test-qemu-windows", + "cpu": 0, + "disk": 0, + "netin": 0, + "mem": 0, + "qmpstatus": "prelaunch" + } + elif url == "https://localhost:8006/api2/json/nodes/testnode/qemu/103/status/current": + # _get_vm_status (qemu) + return { + "status": "stopped", + "uptime": 0, + "maxmem": 5364514816, + "maxdisk": 34359738368, + "netout": 0, + "cpus": 2, + "ha": { + "managed": 0 + }, + "diskread": 0, + "vmid": 103, + "diskwrite": 0, + "name": "test-qemu-multi-nic", + "cpu": 0, + "disk": 0, + "netin": 0, + "mem": 0, + "qmpstatus": "paused" + } def get_vm_snapshots(node, properties, vmtype, vmid, name): @@ -537,21 +631,11 @@ def get_vm_snapshots(node, properties, vmtype, vmid, name): }] -def get_vm_status(properties, node, vmtype, vmid, name): - return True - - -def get_option(option): - if option == 'group_prefix': - return 'proxmox_' - if option == 'facts_prefix': - return 'proxmox_' - elif option == 'want_facts': - return True - elif option == 'want_proxmox_nodes_ansible_host': - return True - else: - return False +def get_option(opts): + def fn(option): + default = opts.get('default', False) + return opts.get(option, default) + return fn def test_populate(inventory, mocker): @@ -563,12 +647,19 @@ def test_populate(inventory, mocker): inventory.facts_prefix = 'proxmox_' inventory.strict = False + opts = { + 'group_prefix': 'proxmox_', + 'facts_prefix': 'proxmox_', + 'want_facts': True, + 'want_proxmox_nodes_ansible_host': True, + 'qemu_extended_statuses': True + } + # bypass authentication and API fetch calls inventory._get_auth = mocker.MagicMock(side_effect=get_auth) inventory._get_json = mocker.MagicMock(side_effect=get_json) - inventory._get_vm_status = mocker.MagicMock(side_effect=get_vm_status) inventory._get_vm_snapshots = mocker.MagicMock(side_effect=get_vm_snapshots) - inventory.get_option = mocker.MagicMock(side_effect=get_option) + inventory.get_option = mocker.MagicMock(side_effect=get_option(opts)) inventory._can_add_host = mocker.MagicMock(return_value=True) inventory._populate() @@ -610,3 +701,45 @@ def test_populate(inventory, mocker): # check that offline node is in inventory assert inventory.inventory.get_host('testnode2') + + # make sure that ['prelaunch', 'paused'] are in the group list + for group in ['paused', 'prelaunch']: + assert ('%sall_%s' % (inventory.group_prefix, group)) in inventory.inventory.groups + + # check if qemu-windows is in the prelaunch group + group_prelaunch = inventory.inventory.groups['proxmox_all_prelaunch'] + assert group_prelaunch.hosts == [host_qemu_windows] + + # check if qemu-multi-nic is in the paused group + group_paused = inventory.inventory.groups['proxmox_all_paused'] + assert group_paused.hosts == [host_qemu_multi_nic] + + +def test_populate_missing_qemu_extended_groups(inventory, mocker): + # module settings + inventory.proxmox_user = 'root@pam' + inventory.proxmox_password = 'password' + inventory.proxmox_url = 'https://localhost:8006' + inventory.group_prefix = 'proxmox_' + inventory.facts_prefix = 'proxmox_' + inventory.strict = False + + opts = { + 'group_prefix': 'proxmox_', + 'facts_prefix': 'proxmox_', + 'want_facts': True, + 'want_proxmox_nodes_ansible_host': True, + 'qemu_extended_statuses': False + } + + # bypass authentication and API fetch calls + inventory._get_auth = mocker.MagicMock(side_effect=get_auth) + inventory._get_json = mocker.MagicMock(side_effect=get_json) + inventory._get_vm_snapshots = mocker.MagicMock(side_effect=get_vm_snapshots) + inventory.get_option = mocker.MagicMock(side_effect=get_option(opts)) + inventory._can_add_host = mocker.MagicMock(return_value=True) + inventory._populate() + + # make sure that ['prelaunch', 'paused'] are not in the group list + for group in ['paused', 'prelaunch']: + assert ('%sall_%s' % (inventory.group_prefix, group)) not in inventory.inventory.groups diff --git a/tests/unit/plugins/inventory/test_stackpath_compute.py b/tests/unit/plugins/inventory/test_stackpath_compute.py index 8a409becd6..781db50b73 100644 --- a/tests/unit/plugins/inventory/test_stackpath_compute.py +++ b/tests/unit/plugins/inventory/test_stackpath_compute.py @@ -1,7 +1,7 @@ # Copyright (c) 2020 Shay Rybak # Copyright (c) 2020 Ansible Project -# GNGeneral 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 @@ -107,7 +107,7 @@ def test_validate_config(inventory): } with pytest.raises(AnsibleError) as error_message: inventory._validate_config(config) - assert "config missing client_secret, a required paramter" in error_message + assert "config missing client_secret, a required parameter" in error_message config = { "client_secret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", @@ -116,7 +116,7 @@ def test_validate_config(inventory): } with pytest.raises(AnsibleError) as error_message: inventory._validate_config(config) - assert "config missing client_id, a required paramter" in error_message + assert "config missing client_id, a required parameter" in error_message def test_populate(inventory): diff --git a/tests/unit/plugins/inventory/test_xen_orchestra.py b/tests/unit/plugins/inventory/test_xen_orchestra.py index 4916446c13..7d51f6f183 100644 --- a/tests/unit/plugins/inventory/test_xen_orchestra.py +++ b/tests/unit/plugins/inventory/test_xen_orchestra.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # Copyright (c) 2020, Jeffrey van Pelt -# 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 # # The API responses used in these tests were recorded from PVE version 6.2. diff --git a/tests/unit/plugins/lookup/__init__.py b/tests/unit/plugins/lookup/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/lookup/test_bitwarden.py b/tests/unit/plugins/lookup/test_bitwarden.py new file mode 100644 index 0000000000..7f86c39697 --- /dev/null +++ b/tests/unit/plugins/lookup/test_bitwarden.py @@ -0,0 +1,162 @@ +# -*- 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 + +from argparse import ArgumentParser + +from ansible_collections.community.general.tests.unit.compat import unittest +from ansible_collections.community.general.tests.unit.compat.mock import patch + +from ansible.errors import AnsibleError +from ansible.module_utils import six +from ansible.plugins.loader import lookup_loader +from ansible_collections.community.general.plugins.lookup.bitwarden import LookupModule, Bitwarden, BitwardenException + + +MOCK_RECORDS = [ + { + "collectionIds": [], + "deletedDate": None, + "favorite": False, + "fields": [ + { + "linkedId": None, + "name": "a_new_secret", + "type": 1, + "value": "this is a new secret" + }, + { + "linkedId": None, + "name": "not so secret", + "type": 0, + "value": "not secret" + } + ], + "folderId": "3b12a9da-7c49-40b8-ad33-aede017a7ead", + "id": "90992f63-ddb6-4e76-8bfc-aede016ca5eb", + "login": { + "password": "passwordA3", + "passwordRevisionDate": "2022-07-26T23:03:23.399Z", + "totp": None, + "username": "userA" + }, + "name": "a_test", + "notes": None, + "object": "item", + "organizationId": None, + "passwordHistory": [ + { + "lastUsedDate": "2022-07-26T23:03:23.405Z", + "password": "a_new_secret: this is secret" + }, + { + "lastUsedDate": "2022-07-26T23:03:23.399Z", + "password": "passwordA2" + }, + { + "lastUsedDate": "2022-07-26T22:59:52.885Z", + "password": "passwordA" + } + ], + "reprompt": 0, + "revisionDate": "2022-07-26T23:03:23.743Z", + "type": 1 + }, + { + "collectionIds": [], + "deletedDate": None, + "favorite": False, + "folderId": None, + "id": "5ebd4d31-104c-49fc-a09c-aedf003d28ad", + "login": { + "password": "b", + "passwordRevisionDate": None, + "totp": None, + "username": "a" + }, + "name": "dupe_name", + "notes": None, + "object": "item", + "organizationId": None, + "reprompt": 0, + "revisionDate": "2022-07-27T03:42:40.353Z", + "type": 1 + }, + { + "collectionIds": [], + "deletedDate": None, + "favorite": False, + "folderId": None, + "id": "90657653-6695-496d-9431-aedf003d3015", + "login": { + "password": "d", + "passwordRevisionDate": None, + "totp": None, + "username": "c" + }, + "name": "dupe_name", + "notes": None, + "object": "item", + "organizationId": None, + "reprompt": 0, + "revisionDate": "2022-07-27T03:42:46.673Z", + "type": 1 + } +] + + +class MockBitwarden(Bitwarden): + + logged_in = True + + def _get_matches(self, search_value, search_field="name"): + return list(filter(lambda record: record[search_field] == search_value, MOCK_RECORDS)) + + +class LoggedOutMockBitwarden(MockBitwarden): + + logged_in = False + + +class TestLookupModule(unittest.TestCase): + + def setUp(self): + self.lookup = lookup_loader.get('community.general.bitwarden') + + @patch('ansible_collections.community.general.plugins.lookup.bitwarden._bitwarden', new=MockBitwarden()) + def test_bitwarden_plugin_no_match(self): + # Entry 0, "a_test" of the test input should have no duplicates. + self.assertEqual([], self.lookup.run(['not_here'], field='password')[0]) + + @patch('ansible_collections.community.general.plugins.lookup.bitwarden._bitwarden', new=MockBitwarden()) + def test_bitwarden_plugin_fields(self): + # Entry 0, "a_test" of the test input should have no duplicates. + record = MOCK_RECORDS[0] + record_name = record['name'] + for k, v in six.iteritems(record['login']): + self.assertEqual([v], + self.lookup.run([record_name], field=k)[0]) + + @patch('ansible_collections.community.general.plugins.lookup.bitwarden._bitwarden', new=MockBitwarden()) + def test_bitwarden_plugin_duplicates(self): + # There are two records with name dupe_name; we need to be order-insensitive with + # checking what was retrieved. + self.assertEqual(set(['b', 'd']), + set(self.lookup.run(['dupe_name'], field='password')[0])) + + @patch('ansible_collections.community.general.plugins.lookup.bitwarden._bitwarden', new=MockBitwarden()) + def test_bitwarden_plugin_full_item(self): + # Try to retrieve the full record of the first entry where the name is "a_name". + self.assertEqual([MOCK_RECORDS[0]], + self.lookup.run(['a_test'])[0]) + + @patch('ansible_collections.community.general.plugins.lookup.bitwarden._bitwarden', LoggedOutMockBitwarden()) + def test_bitwarden_plugin_logged_out(self): + record = MOCK_RECORDS[0] + record_name = record['name'] + with self.assertRaises(AnsibleError): + self.lookup.run([record_name], field='password') diff --git a/tests/unit/plugins/lookup/test_dependent.py b/tests/unit/plugins/lookup/test_dependent.py index f2a31ff4b6..74d7c41239 100644 --- a/tests/unit/plugins/lookup/test_dependent.py +++ b/tests/unit/plugins/lookup/test_dependent.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- -# (c) 2020-2021, Felix Fontein -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2020-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 # Make coding more python3-ish from __future__ import absolute_import, division, print_function diff --git a/tests/unit/plugins/lookup/test_dsv.py b/tests/unit/plugins/lookup/test_dsv.py index 376bd7250a..a9a2d30ee6 100644 --- a/tests/unit/plugins/lookup/test_dsv.py +++ b/tests/unit/plugins/lookup/test_dsv.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- -# (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 # Make coding more python3-ish from __future__ import absolute_import, division, print_function diff --git a/tests/unit/plugins/lookup/test_etcd3.py b/tests/unit/plugins/lookup/test_etcd3.py index b0663dff66..798d537ed9 100644 --- a/tests/unit/plugins/lookup/test_etcd3.py +++ b/tests/unit/plugins/lookup/test_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/tests/unit/plugins/lookup/test_lastpass.py b/tests/unit/plugins/lookup/test_lastpass.py index cce693d347..f9749716d7 100644 --- a/tests/unit/plugins/lookup/test_lastpass.py +++ b/tests/unit/plugins/lookup/test_lastpass.py @@ -1,19 +1,6 @@ -# (c)2016 Andrew Zenk -# -# 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) 2016 Andrew Zenk +# 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) @@ -26,6 +13,7 @@ from ansible_collections.community.general.tests.unit.compat.mock import patch from ansible.errors import AnsibleError from ansible.module_utils import six +from ansible.plugins.loader import lookup_loader from ansible_collections.community.general.plugins.lookup.lastpass import LookupModule, LPass, LPassException @@ -126,6 +114,9 @@ class LoggedOutMockLPass(MockLPass): class TestLPass(unittest.TestCase): + def setUp(self): + self.lookup = lookup_loader.get('community.general.lastpass') + def test_lastpass_cli_path(self): lp = MockLPass(path='/dev/null') self.assertEqual('/dev/null', lp.cli_path) @@ -158,30 +149,27 @@ class TestLPass(unittest.TestCase): class TestLastpassPlugin(unittest.TestCase): + def setUp(self): + self.lookup = lookup_loader.get('community.general.lastpass') + @patch('ansible_collections.community.general.plugins.lookup.lastpass.LPass', new=MockLPass) def test_lastpass_plugin_normal(self): - lookup_plugin = LookupModule() - for entry in MOCK_ENTRIES: entry_id = entry.get('id') for k, v in six.iteritems(entry): self.assertEqual(v.strip(), - lookup_plugin.run([entry_id], field=k)[0]) + self.lookup.run([entry_id], field=k)[0]) @patch('ansible_collections.community.general.plugins.lookup.lastpass.LPass', LoggedOutMockLPass) def test_lastpass_plugin_logged_out(self): - lookup_plugin = LookupModule() - entry = MOCK_ENTRIES[0] entry_id = entry.get('id') with self.assertRaises(AnsibleError): - lookup_plugin.run([entry_id], field='password') + self.lookup.run([entry_id], field='password') @patch('ansible_collections.community.general.plugins.lookup.lastpass.LPass', DisconnectedMockLPass) def test_lastpass_plugin_disconnected(self): - lookup_plugin = LookupModule() - entry = MOCK_ENTRIES[0] entry_id = entry.get('id') with self.assertRaises(AnsibleError): - lookup_plugin.run([entry_id], field='password') + self.lookup.run([entry_id], field='password') diff --git a/tests/unit/plugins/lookup/test_manifold.py b/tests/unit/plugins/lookup/test_manifold.py index 0eb49c8cea..e9fd912b2b 100644 --- a/tests/unit/plugins/lookup/test_manifold.py +++ b/tests/unit/plugins/lookup/test_manifold.py @@ -1,6 +1,7 @@ -# (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/tests/unit/plugins/lookup/test_onepassword.py b/tests/unit/plugins/lookup/test_onepassword.py index 0312a0e048..e639dcddbe 100644 --- a/tests/unit/plugins/lookup/test_onepassword.py +++ b/tests/unit/plugins/lookup/test_onepassword.py @@ -1,6 +1,7 @@ -# (c) 2018, Scott Buchanan -# (c) 2016, Andrew Zenk (test_lastpass.py used as starting point) -# 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 (test_lastpass.py used as starting point) +# 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/tests/unit/plugins/lookup/test_revbitspss.py b/tests/unit/plugins/lookup/test_revbitspss.py index 352e61d0fa..5109992068 100644 --- a/tests/unit/plugins/lookup/test_revbitspss.py +++ b/tests/unit/plugins/lookup/test_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/tests/unit/plugins/lookup/test_tss.py b/tests/unit/plugins/lookup/test_tss.py index 97073d34be..47ca79a697 100644 --- a/tests/unit/plugins/lookup/test_tss.py +++ b/tests/unit/plugins/lookup/test_tss.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- -# (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 # Make coding more python3-ish from __future__ import absolute_import, division, print_function diff --git a/tests/unit/plugins/module_utils/__init__.py b/tests/unit/plugins/module_utils/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/module_utils/cloud/__init__.py b/tests/unit/plugins/module_utils/cloud/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/module_utils/cloud/test_backoff.py b/tests/unit/plugins/module_utils/cloud/test_backoff.py index 5d0438b794..5a5188669a 100644 --- a/tests/unit/plugins/module_utils/cloud/test_backoff.py +++ b/tests/unit/plugins/module_utils/cloud/test_backoff.py @@ -1,4 +1,6 @@ -# 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/tests/unit/plugins/module_utils/conftest.py b/tests/unit/plugins/module_utils/conftest.py index 61ed0acd27..2217dd39f9 100644 --- a/tests/unit/plugins/module_utils/conftest.py +++ b/tests/unit/plugins/module_utils/conftest.py @@ -1,5 +1,6 @@ # 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/tests/unit/plugins/module_utils/hwc/__init__.py b/tests/unit/plugins/module_utils/hwc/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/module_utils/hwc/test_dict_comparison.py b/tests/unit/plugins/module_utils/hwc/test_dict_comparison.py index bcdfc4e2ca..037305d3f9 100644 --- a/tests/unit/plugins/module_utils/hwc/test_dict_comparison.py +++ b/tests/unit/plugins/module_utils/hwc/test_dict_comparison.py @@ -1,9 +1,10 @@ # -*- coding: utf-8 -*- # 2018.07.26 --- use DictComparison instead of GcpRequest # -# (c) 2016, Tom Melendez +# Copyright (c) 2016, Tom Melendez # -# 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/tests/unit/plugins/module_utils/hwc/test_hwc_utils.py b/tests/unit/plugins/module_utils/hwc/test_hwc_utils.py index 1891875959..1344496b18 100644 --- a/tests/unit/plugins/module_utils/hwc/test_hwc_utils.py +++ b/tests/unit/plugins/module_utils/hwc/test_hwc_utils.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/tests/unit/plugins/module_utils/identity/__init__.py b/tests/unit/plugins/module_utils/identity/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/module_utils/identity/keycloak/__init__.py b/tests/unit/plugins/module_utils/identity/keycloak/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/module_utils/identity/keycloak/test_keycloak_connect.py b/tests/unit/plugins/module_utils/identity/keycloak/test_keycloak_connect.py index 49692a412e..9a816cfe25 100644 --- a/tests/unit/plugins/module_utils/identity/keycloak/test_keycloak_connect.py +++ b/tests/unit/plugins/module_utils/identity/keycloak/test_keycloak_connect.py @@ -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 + from __future__ import (absolute_import, division, print_function) __metaclass__ = type diff --git a/tests/unit/plugins/module_utils/net_tools/__init__.py b/tests/unit/plugins/module_utils/net_tools/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/module_utils/net_tools/pritunl/__init__.py b/tests/unit/plugins/module_utils/net_tools/pritunl/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/module_utils/net_tools/pritunl/test_api.py b/tests/unit/plugins/module_utils/net_tools/pritunl/test_api.py index 4039f7c57a..6ddc827a14 100644 --- a/tests/unit/plugins/module_utils/net_tools/pritunl/test_api.py +++ b/tests/unit/plugins/module_utils/net_tools/pritunl/test_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 from __future__ import absolute_import, division, print_function diff --git a/tests/unit/plugins/module_utils/remote_management/__init__.py b/tests/unit/plugins/module_utils/remote_management/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/module_utils/test_cmd_runner.py b/tests/unit/plugins/module_utils/test_cmd_runner.py index b5145ec815..5fdc5fb5fc 100644 --- a/tests/unit/plugins/module_utils/test_cmd_runner.py +++ b/tests/unit/plugins/module_utils/test_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 @@ -246,7 +247,7 @@ TC_RUNNER_IDS = sorted(TC_RUNNER.keys()) @pytest.mark.parametrize('runner_input, cmd_execution, expected', (TC_RUNNER[tc] for tc in TC_RUNNER_IDS), ids=TC_RUNNER_IDS) -def test_runner(runner_input, cmd_execution, expected): +def test_runner_context(runner_input, cmd_execution, expected): arg_spec = {} params = {} arg_formats = {} @@ -304,3 +305,66 @@ def test_runner(runner_input, cmd_execution, expected): with runner.context(**runner_input['runner_ctx_args']) as ctx: results = ctx.run(**cmd_execution['runner_ctx_run_args']) _assert_run(runner_input, cmd_execution, expected, ctx, results) + + +@pytest.mark.parametrize('runner_input, cmd_execution, expected', + (TC_RUNNER[tc] for tc in TC_RUNNER_IDS), + ids=TC_RUNNER_IDS) +def test_runner_callable(runner_input, cmd_execution, expected): + arg_spec = {} + params = {} + arg_formats = {} + for k, v in runner_input['args_bundle'].items(): + try: + arg_spec[k] = {'type': v['type']} + except KeyError: + pass + try: + params[k] = v['value'] + except KeyError: + pass + try: + arg_formats[k] = v['fmt_func'](v['fmt_arg']) + except KeyError: + pass + + orig_results = tuple(cmd_execution[x] for x in ('rc', 'out', 'err')) + + print("arg_spec={0}\nparams={1}\narg_formats={2}\n".format( + arg_spec, + params, + arg_formats, + )) + + module = MagicMock() + type(module).argument_spec = PropertyMock(return_value=arg_spec) + type(module).params = PropertyMock(return_value=params) + module.get_bin_path.return_value = '/mock/bin/testing' + module.run_command.return_value = orig_results + + runner = CmdRunner( + module=module, + command="testing", + arg_formats=arg_formats, + **runner_input['runner_init_args'] + ) + + def _assert_run_info(actual, expected): + reduced = dict((k, actual[k]) for k in expected.keys()) + assert reduced == expected, "{0}".format(reduced) + + def _assert_run(runner_input, cmd_execution, expected, ctx, results): + _assert_run_info(ctx.run_info, expected['run_info']) + assert results == expected.get('results', orig_results) + + exc = expected.get("exc") + if exc: + with pytest.raises(exc): + with runner(**runner_input['runner_ctx_args']) as ctx: + results = ctx.run(**cmd_execution['runner_ctx_run_args']) + _assert_run(runner_input, cmd_execution, expected, ctx, results) + + else: + with runner(**runner_input['runner_ctx_args']) as ctx: + results = ctx.run(**cmd_execution['runner_ctx_run_args']) + _assert_run(runner_input, cmd_execution, expected, ctx, results) diff --git a/tests/unit/plugins/module_utils/test_csv.py b/tests/unit/plugins/module_utils/test_csv.py index b31915d66d..8b83908e79 100644 --- a/tests/unit/plugins/module_utils/test_csv.py +++ b/tests/unit/plugins/module_utils/test_csv.py @@ -1,6 +1,8 @@ # -*- 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/tests/unit/plugins/module_utils/test_database.py b/tests/unit/plugins/module_utils/test_database.py index f5784a598a..c766712025 100644 --- a/tests/unit/plugins/module_utils/test_database.py +++ b/tests/unit/plugins/module_utils/test_database.py @@ -1,4 +1,6 @@ -# 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/tests/unit/plugins/module_utils/test_known_hosts.py b/tests/unit/plugins/module_utils/test_known_hosts.py index e7c57eb3dd..25e76b66f5 100644 --- a/tests/unit/plugins/module_utils/test_known_hosts.py +++ b/tests/unit/plugins/module_utils/test_known_hosts.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # (c) 2015, 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 diff --git a/tests/unit/plugins/module_utils/test_module_helper.py b/tests/unit/plugins/module_utils/test_module_helper.py index 00667fcea3..18251cf2e9 100644 --- a/tests/unit/plugins/module_utils/test_module_helper.py +++ b/tests/unit/plugins/module_utils/test_module_helper.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # (c) 2020, Alexei Znamensky # 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/tests/unit/plugins/module_utils/test_saslprep.py b/tests/unit/plugins/module_utils/test_saslprep.py index 4829f55b83..d7a302248f 100644 --- a/tests/unit/plugins/module_utils/test_saslprep.py +++ b/tests/unit/plugins/module_utils/test_saslprep.py @@ -1,6 +1,8 @@ # -*- coding: utf-8 -*- -# Copyright: (c) 2019, Andrey Tuzhilin -# Copyright: (c) 2020, Andrew Klychkov (@Andersson007) +# Copyright (c) 2019, Andrey Tuzhilin +# Copyright (c) 2020, Andrew Klychkov (@Andersson007) +# 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/tests/unit/plugins/module_utils/test_utm_utils.py b/tests/unit/plugins/module_utils/test_utm_utils.py index f28d5dc85d..1cab58d639 100644 --- a/tests/unit/plugins/module_utils/test_utm_utils.py +++ b/tests/unit/plugins/module_utils/test_utm_utils.py @@ -4,9 +4,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/tests/unit/plugins/module_utils/xenserver/FakeAnsibleModule.py b/tests/unit/plugins/module_utils/xenserver/FakeAnsibleModule.py index c443dfdb6e..bdcc21793f 100644 --- a/tests/unit/plugins/module_utils/xenserver/FakeAnsibleModule.py +++ b/tests/unit/plugins/module_utils/xenserver/FakeAnsibleModule.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # -# Copyright: (c) 2019, Bojan Vitnik -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, 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/tests/unit/plugins/module_utils/xenserver/FakeXenAPI.py b/tests/unit/plugins/module_utils/xenserver/FakeXenAPI.py index 2493317561..bc9d69c77c 100644 --- a/tests/unit/plugins/module_utils/xenserver/FakeXenAPI.py +++ b/tests/unit/plugins/module_utils/xenserver/FakeXenAPI.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # -# Copyright: (c) 2019, Bojan Vitnik -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, 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/tests/unit/plugins/module_utils/xenserver/__init__.py b/tests/unit/plugins/module_utils/xenserver/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/module_utils/xenserver/common.py b/tests/unit/plugins/module_utils/xenserver/common.py index 52a01c990e..0aee3197ef 100644 --- a/tests/unit/plugins/module_utils/xenserver/common.py +++ b/tests/unit/plugins/module_utils/xenserver/common.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # -# Copyright: (c) 2019, Bojan Vitnik -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, 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/tests/unit/plugins/module_utils/xenserver/conftest.py b/tests/unit/plugins/module_utils/xenserver/conftest.py index 52f654bcc6..3fcea55617 100644 --- a/tests/unit/plugins/module_utils/xenserver/conftest.py +++ b/tests/unit/plugins/module_utils/xenserver/conftest.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # -# Copyright: (c) 2019, Bojan Vitnik -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, 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 @@ -39,7 +40,7 @@ def XenAPI(): """Imports and returns fake XenAPI module.""" # Import of fake XenAPI module is wrapped by fixture so that it does not - # affect other unit tests which could potentialy also use XenAPI module. + # affect other unit tests which could potentially also use XenAPI module. # First we use importlib.import_module() to import the module and assign # it to a local symbol. diff --git a/tests/unit/plugins/module_utils/xenserver/fixtures/ansible-test-vm-1-facts.json.license b/tests/unit/plugins/module_utils/xenserver/fixtures/ansible-test-vm-1-facts.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/module_utils/xenserver/fixtures/ansible-test-vm-1-facts.json.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/tests/unit/plugins/module_utils/xenserver/fixtures/ansible-test-vm-1-params.json.license b/tests/unit/plugins/module_utils/xenserver/fixtures/ansible-test-vm-1-params.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/module_utils/xenserver/fixtures/ansible-test-vm-1-params.json.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/tests/unit/plugins/module_utils/xenserver/fixtures/ansible-test-vm-2-facts.json.license b/tests/unit/plugins/module_utils/xenserver/fixtures/ansible-test-vm-2-facts.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/module_utils/xenserver/fixtures/ansible-test-vm-2-facts.json.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/tests/unit/plugins/module_utils/xenserver/fixtures/ansible-test-vm-2-params.json.license b/tests/unit/plugins/module_utils/xenserver/fixtures/ansible-test-vm-2-params.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/module_utils/xenserver/fixtures/ansible-test-vm-2-params.json.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/tests/unit/plugins/module_utils/xenserver/fixtures/ansible-test-vm-3-facts.json.license b/tests/unit/plugins/module_utils/xenserver/fixtures/ansible-test-vm-3-facts.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/module_utils/xenserver/fixtures/ansible-test-vm-3-facts.json.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/tests/unit/plugins/module_utils/xenserver/fixtures/ansible-test-vm-3-params.json.license b/tests/unit/plugins/module_utils/xenserver/fixtures/ansible-test-vm-3-params.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/module_utils/xenserver/fixtures/ansible-test-vm-3-params.json.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/tests/unit/plugins/module_utils/xenserver/test_gather_vm_params_and_facts.py b/tests/unit/plugins/module_utils/xenserver/test_gather_vm_params_and_facts.py index b1020bee70..37e54b2b5f 100644 --- a/tests/unit/plugins/module_utils/xenserver/test_gather_vm_params_and_facts.py +++ b/tests/unit/plugins/module_utils/xenserver/test_gather_vm_params_and_facts.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # -# Copyright: (c) 2019, Bojan Vitnik -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, 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/tests/unit/plugins/module_utils/xenserver/test_get_object_ref.py b/tests/unit/plugins/module_utils/xenserver/test_get_object_ref.py index 0fe7a7c1bf..242e1debdd 100644 --- a/tests/unit/plugins/module_utils/xenserver/test_get_object_ref.py +++ b/tests/unit/plugins/module_utils/xenserver/test_get_object_ref.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # -# Copyright: (c) 2019, Bojan Vitnik -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, 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/tests/unit/plugins/module_utils/xenserver/test_misc.py b/tests/unit/plugins/module_utils/xenserver/test_misc.py index 3fad0ee50d..b22e4aa351 100644 --- a/tests/unit/plugins/module_utils/xenserver/test_misc.py +++ b/tests/unit/plugins/module_utils/xenserver/test_misc.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # -# Copyright: (c) 2019, Bojan Vitnik -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, 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/tests/unit/plugins/module_utils/xenserver/test_netaddr_functions.py b/tests/unit/plugins/module_utils/xenserver/test_netaddr_functions.py index d4b80f47dc..d072ce2076 100644 --- a/tests/unit/plugins/module_utils/xenserver/test_netaddr_functions.py +++ b/tests/unit/plugins/module_utils/xenserver/test_netaddr_functions.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # -# Copyright: (c) 2019, Bojan Vitnik -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, 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/tests/unit/plugins/module_utils/xenserver/test_set_vm_power_state.py b/tests/unit/plugins/module_utils/xenserver/test_set_vm_power_state.py index a3048f4331..279dc9912f 100644 --- a/tests/unit/plugins/module_utils/xenserver/test_set_vm_power_state.py +++ b/tests/unit/plugins/module_utils/xenserver/test_set_vm_power_state.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # -# Copyright: (c) 2019, Bojan Vitnik -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, 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/tests/unit/plugins/module_utils/xenserver/test_wait_for_functions.py b/tests/unit/plugins/module_utils/xenserver/test_wait_for_functions.py index c06ad6de6b..3f31f030e0 100644 --- a/tests/unit/plugins/module_utils/xenserver/test_wait_for_functions.py +++ b/tests/unit/plugins/module_utils/xenserver/test_wait_for_functions.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # -# Copyright: (c) 2019, Bojan Vitnik -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, 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/tests/unit/plugins/module_utils/xenserver/test_xapi.py b/tests/unit/plugins/module_utils/xenserver/test_xapi.py index 3b553d1237..86965b4e55 100644 --- a/tests/unit/plugins/module_utils/xenserver/test_xapi.py +++ b/tests/unit/plugins/module_utils/xenserver/test_xapi.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # -# Copyright: (c) 2019, Bojan Vitnik -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, 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/tests/unit/plugins/module_utils/xenserver/test_xenserverobject.py b/tests/unit/plugins/module_utils/xenserver/test_xenserverobject.py index 60570e03cb..2d758fd4eb 100644 --- a/tests/unit/plugins/module_utils/xenserver/test_xenserverobject.py +++ b/tests/unit/plugins/module_utils/xenserver/test_xenserverobject.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # -# Copyright: (c) 2019, Bojan Vitnik -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, 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/tests/unit/plugins/modules/__init__.py b/tests/unit/plugins/modules/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/cloud/__init__.py b/tests/unit/plugins/modules/cloud/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/cloud/linode/__init__.py b/tests/unit/plugins/modules/cloud/linode/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/cloud/linode/conftest.py b/tests/unit/plugins/modules/cloud/linode/conftest.py index 6ce13a7273..33a704d343 100644 --- a/tests/unit/plugins/modules/cloud/linode/conftest.py +++ b/tests/unit/plugins/modules/cloud/linode/conftest.py @@ -1,4 +1,6 @@ -# 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/tests/unit/plugins/modules/cloud/linode/test_linode.py b/tests/unit/plugins/modules/cloud/linode/test_linode.py index 51e9b805b8..ad769eba6e 100644 --- a/tests/unit/plugins/modules/cloud/linode/test_linode.py +++ b/tests/unit/plugins/modules/cloud/linode/test_linode.py @@ -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 + from __future__ import (absolute_import, division, print_function) __metaclass__ = type diff --git a/tests/unit/plugins/modules/cloud/linode/test_linode_v4.py b/tests/unit/plugins/modules/cloud/linode/test_linode_v4.py index c966f79d5b..6e0bdea007 100644 --- a/tests/unit/plugins/modules/cloud/linode/test_linode_v4.py +++ b/tests/unit/plugins/modules/cloud/linode/test_linode_v4.py @@ -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 + from __future__ import (absolute_import, division, print_function) __metaclass__ = type diff --git a/tests/unit/plugins/modules/cloud/misc/__init__.py b/tests/unit/plugins/modules/cloud/misc/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/cloud/misc/test_proxmox_kvm.py b/tests/unit/plugins/modules/cloud/misc/test_proxmox_kvm.py index 4aaf326db3..489ee8df62 100644 --- a/tests/unit/plugins/modules/cloud/misc/test_proxmox_kvm.py +++ b/tests/unit/plugins/modules/cloud/misc/test_proxmox_kvm.py @@ -1,7 +1,8 @@ # -*- 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 diff --git a/tests/unit/plugins/modules/cloud/misc/test_proxmox_snap.py b/tests/unit/plugins/modules/cloud/misc/test_proxmox_snap.py index 1ee14d81ef..3ef121cddd 100644 --- a/tests/unit/plugins/modules/cloud/misc/test_proxmox_snap.py +++ b/tests/unit/plugins/modules/cloud/misc/test_proxmox_snap.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # -# Copyright: (c) 2019, Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, 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/tests/unit/plugins/modules/cloud/misc/test_proxmox_tasks_info.py b/tests/unit/plugins/modules/cloud/misc/test_proxmox_tasks_info.py index c712460593..9d1bd74e69 100644 --- a/tests/unit/plugins/modules/cloud/misc/test_proxmox_tasks_info.py +++ b/tests/unit/plugins/modules/cloud/misc/test_proxmox_tasks_info.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # -# Copyright: (c) 2021, Andreas Botzner (@paginabianca) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, Andreas Botzner (@paginabianca) +# 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 # # Proxmox Tasks module unit tests. # The API responses used in these tests were recorded from PVE version 6.4-8 diff --git a/tests/unit/plugins/modules/cloud/misc/test_terraform.py b/tests/unit/plugins/modules/cloud/misc/test_terraform.py index 898f99f2b8..7b0318dbb3 100644 --- a/tests/unit/plugins/modules/cloud/misc/test_terraform.py +++ b/tests/unit/plugins/modules/cloud/misc/test_terraform.py @@ -1,5 +1,6 @@ -# Copyright: (c) 2019, Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, 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/tests/unit/plugins/modules/cloud/scaleway/test_scaleway_compute_private_network.py b/tests/unit/plugins/modules/cloud/scaleway/test_scaleway_compute_private_network.py new file mode 100644 index 0000000000..68bc1653d8 --- /dev/null +++ b/tests/unit/plugins/modules/cloud/scaleway/test_scaleway_compute_private_network.py @@ -0,0 +1,180 @@ +# Copyright (c) 2019, 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 + +import os +import json +import pytest + + +from ansible_collections.community.general.plugins.modules.cloud.scaleway import scaleway_compute_private_network +from ansible_collections.community.general.plugins.module_utils.scaleway import Scaleway, Response +from ansible_collections.community.general.tests.unit.plugins.modules.utils import set_module_args +from ansible_collections.community.general.tests.unit.compat.mock import patch + + +def response_without_nics(): + info = {"status": 200, + "body": '{ "private_nics": []}' + } + return Response(None, info) + + +def response_with_nics(): + info = {"status": 200, + "body": ('{ "private_nics": [{' + '"id": "c123b4cd-ef5g-678h-90i1-jk2345678l90",' + '"private_network_id": "b589b4cd-ef5g-678h-90i1-jk2345678l90",' + '"server_id": "c004b4cd-ef5g-678h-90i1-jk2345678l90",' + '"mac_address": "02:00:00:00:12:23",' + '"state": "available",' + '"creation_date": "2022-03-30T06:25:28.155973+00:00",' + '"modification_date": "2022-03-30T06:25:28.155973+00:00",' + '"zone": "fr-par-1"' + '}]}' + ) + } + return Response(None, info) + + +def response_when_add_nics(): + info = {"status": 200, + "body": ('{ "private_nics": {' + '"id": "c123b4cd-ef5g-678h-90i1-jk2345678l90",' + '"private_network_id": "b589b4cd-ef5g-678h-90i1-jk2345678l90",' + '"server_id": "c004b4cd-ef5g-678h-90i1-jk2345678l90",' + '"mac_address": "02:00:00:00:12:23",' + '"state": "available",' + '"creation_date": "2022-03-30T06:25:28.155973+00:00",' + '"modification_date": "2022-03-30T06:25:28.155973+00:00",' + '"zone": "fr-par-1"' + '}}' + ) + } + return Response(None, info) + + +def response_remove_nics(): + info = {"status": 200} + return Response(None, info) + + +def test_scaleway_private_network_without_arguments(capfd): + set_module_args({}) + with pytest.raises(SystemExit) as results: + scaleway_compute_private_network.main() + out, err = capfd.readouterr() + + assert not err + assert json.loads(out)['failed'] + + +def test_scaleway_add_nic(capfd): + os.environ['SCW_API_TOKEN'] = 'notrealtoken' + pnid = 'b589b4cd-ef5g-678h-90i1-jk2345678l90' + cid = 'c004b4cd-ef5g-678h-90i1-jk2345678l90' + url = 'servers/' + cid + '/private_nics' + + set_module_args({"project": "a123b4cd-ef5g-678h-90i1-jk2345678l90", + "state": "present", + "region": "par1", + "compute_id": cid, + "private_network_id": pnid + }) + + with patch.object(Scaleway, 'get') as mock_scw_get: + mock_scw_get.return_value = response_without_nics() + with patch.object(Scaleway, 'post') as mock_scw_post: + mock_scw_post.return_value = response_when_add_nics() + with pytest.raises(SystemExit) as results: + scaleway_compute_private_network.main() + mock_scw_post.assert_any_call(path=url, data={"private_network_id": pnid}) + mock_scw_get.assert_any_call(url) + + out, err = capfd.readouterr() + del os.environ['SCW_API_TOKEN'] + assert not err + assert json.loads(out)['changed'] + + +def test_scaleway_add_existing_nic(capfd): + os.environ['SCW_API_TOKEN'] = 'notrealtoken' + pnid = 'b589b4cd-ef5g-678h-90i1-jk2345678l90' + cid = 'c004b4cd-ef5g-678h-90i1-jk2345678l90' + url = 'servers/' + cid + '/private_nics' + + set_module_args({"project": "a123b4cd-ef5g-678h-90i1-jk2345678l90", + "state": "present", + "region": "par1", + "compute_id": cid, + "private_network_id": pnid + }) + + with patch.object(Scaleway, 'get') as mock_scw_get: + mock_scw_get.return_value = response_with_nics() + with pytest.raises(SystemExit) as results: + scaleway_compute_private_network.main() + mock_scw_get.assert_any_call(url) + + out, err = capfd.readouterr() + del os.environ['SCW_API_TOKEN'] + assert not err + assert not json.loads(out)['changed'] + + +def test_scaleway_remove_existing_nic(capfd): + os.environ['SCW_API_TOKEN'] = 'notrealtoken' + pnid = 'b589b4cd-ef5g-678h-90i1-jk2345678l90' + cid = 'c004b4cd-ef5g-678h-90i1-jk2345678l90' + nicid = 'c123b4cd-ef5g-678h-90i1-jk2345678l90' + url = 'servers/' + cid + '/private_nics' + urlremove = 'servers/' + cid + '/private_nics/' + nicid + + set_module_args({"project": "a123b4cd-ef5g-678h-90i1-jk2345678l90", + "state": "absent", + "region": "par1", + "compute_id": cid, + "private_network_id": pnid + }) + + with patch.object(Scaleway, 'get') as mock_scw_get: + mock_scw_get.return_value = response_with_nics() + with patch.object(Scaleway, 'delete') as mock_scw_delete: + mock_scw_delete.return_value = response_remove_nics() + with pytest.raises(SystemExit) as results: + scaleway_compute_private_network.main() + mock_scw_delete.assert_any_call(urlremove) + mock_scw_get.assert_any_call(url) + + out, err = capfd.readouterr() + + del os.environ['SCW_API_TOKEN'] + assert not err + assert json.loads(out)['changed'] + + +def test_scaleway_remove_absent_nic(capfd): + os.environ['SCW_API_TOKEN'] = 'notrealtoken' + pnid = 'b589b4cd-ef5g-678h-90i1-jk2345678l90' + cid = 'c004b4cd-ef5g-678h-90i1-jk2345678l90' + url = 'servers/' + cid + '/private_nics' + + set_module_args({"project": "a123b4cd-ef5g-678h-90i1-jk2345678l90", + "state": "absent", + "region": "par1", + "compute_id": cid, + "private_network_id": pnid + }) + + with patch.object(Scaleway, 'get') as mock_scw_get: + mock_scw_get.return_value = response_without_nics() + with pytest.raises(SystemExit) as results: + scaleway_compute_private_network.main() + mock_scw_get.assert_any_call(url) + + out, err = capfd.readouterr() + del os.environ['SCW_API_TOKEN'] + assert not err + assert not json.loads(out)['changed'] diff --git a/tests/unit/plugins/modules/cloud/scaleway/test_scaleway_private_network.py b/tests/unit/plugins/modules/cloud/scaleway/test_scaleway_private_network.py index be7d6fd798..9d9a725f12 100644 --- a/tests/unit/plugins/modules/cloud/scaleway/test_scaleway_private_network.py +++ b/tests/unit/plugins/modules/cloud/scaleway/test_scaleway_private_network.py @@ -1,6 +1,7 @@ -# Copyright: (c) 2019, Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, 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/tests/unit/plugins/modules/cloud/xenserver/FakeAnsibleModule.py b/tests/unit/plugins/modules/cloud/xenserver/FakeAnsibleModule.py index c443dfdb6e..bdcc21793f 100644 --- a/tests/unit/plugins/modules/cloud/xenserver/FakeAnsibleModule.py +++ b/tests/unit/plugins/modules/cloud/xenserver/FakeAnsibleModule.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # -# Copyright: (c) 2019, Bojan Vitnik -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, 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/tests/unit/plugins/modules/cloud/xenserver/FakeXenAPI.py b/tests/unit/plugins/modules/cloud/xenserver/FakeXenAPI.py index 2493317561..bc9d69c77c 100644 --- a/tests/unit/plugins/modules/cloud/xenserver/FakeXenAPI.py +++ b/tests/unit/plugins/modules/cloud/xenserver/FakeXenAPI.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # -# Copyright: (c) 2019, Bojan Vitnik -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, 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/tests/unit/plugins/modules/cloud/xenserver/__init__.py b/tests/unit/plugins/modules/cloud/xenserver/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/cloud/xenserver/common.py b/tests/unit/plugins/modules/cloud/xenserver/common.py index 9d6ff0aef7..d3ebb484d0 100644 --- a/tests/unit/plugins/modules/cloud/xenserver/common.py +++ b/tests/unit/plugins/modules/cloud/xenserver/common.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # -# Copyright: (c) 2019, Bojan Vitnik -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, 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/tests/unit/plugins/modules/cloud/xenserver/conftest.py b/tests/unit/plugins/modules/cloud/xenserver/conftest.py index d2bfcd0e8d..cb3ce9b076 100644 --- a/tests/unit/plugins/modules/cloud/xenserver/conftest.py +++ b/tests/unit/plugins/modules/cloud/xenserver/conftest.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # -# Copyright: (c) 2019, Bojan Vitnik -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, 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 @@ -35,7 +36,7 @@ def XenAPI(): """Imports and returns fake XenAPI module.""" # Import of fake XenAPI module is wrapped by fixture so that it does not - # affect other unit tests which could potentialy also use XenAPI module. + # affect other unit tests which could potentially also use XenAPI module. # First we use importlib.import_module() to import the module and assign # it to a local symbol. diff --git a/tests/unit/plugins/modules/cloud/xenserver/test_xenserver_guest_info.py b/tests/unit/plugins/modules/cloud/xenserver/test_xenserver_guest_info.py index 16f209c287..149b2cdc8c 100644 --- a/tests/unit/plugins/modules/cloud/xenserver/test_xenserver_guest_info.py +++ b/tests/unit/plugins/modules/cloud/xenserver/test_xenserver_guest_info.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # -# Copyright: (c) 2019, Bojan Vitnik -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, 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/tests/unit/plugins/modules/cloud/xenserver/test_xenserver_guest_powerstate.py b/tests/unit/plugins/modules/cloud/xenserver/test_xenserver_guest_powerstate.py index ae8735c35a..1cc543e48b 100644 --- a/tests/unit/plugins/modules/cloud/xenserver/test_xenserver_guest_powerstate.py +++ b/tests/unit/plugins/modules/cloud/xenserver/test_xenserver_guest_powerstate.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # -# Copyright: (c) 2019, Bojan Vitnik -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, 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/tests/unit/plugins/modules/conftest.py b/tests/unit/plugins/modules/conftest.py index 9d8c52e6c5..0ed3dd447c 100644 --- a/tests/unit/plugins/modules/conftest.py +++ b/tests/unit/plugins/modules/conftest.py @@ -1,5 +1,6 @@ # 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/tests/unit/plugins/modules/database/__init__.py b/tests/unit/plugins/modules/database/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/database/misc/__init__.py b/tests/unit/plugins/modules/database/misc/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/database/misc/test_redis_data.py b/tests/unit/plugins/modules/database/misc/test_redis_data.py index b7bbf5b6ea..16d768e0d8 100644 --- a/tests/unit/plugins/modules/database/misc/test_redis_data.py +++ b/tests/unit/plugins/modules/database/misc/test_redis_data.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/tests/unit/plugins/modules/database/misc/test_redis_data_incr.py b/tests/unit/plugins/modules/database/misc/test_redis_data_incr.py index be7ebfbdfb..496a00313e 100644 --- a/tests/unit/plugins/modules/database/misc/test_redis_data_incr.py +++ b/tests/unit/plugins/modules/database/misc/test_redis_data_incr.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/tests/unit/plugins/modules/database/misc/test_redis_data_info.py b/tests/unit/plugins/modules/database/misc/test_redis_data_info.py index 808c583e37..fc16cabe86 100644 --- a/tests/unit/plugins/modules/database/misc/test_redis_data_info.py +++ b/tests/unit/plugins/modules/database/misc/test_redis_data_info.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/tests/unit/plugins/modules/database/misc/test_redis_info.py b/tests/unit/plugins/modules/database/misc/test_redis_info.py index 4ff1efc5c5..df23964a46 100644 --- a/tests/unit/plugins/modules/database/misc/test_redis_info.py +++ b/tests/unit/plugins/modules/database/misc/test_redis_info.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- -# Copyright: (c) 2020, Pavlo Bashynskyi (@levonet) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2020, Pavlo Bashynskyi (@levonet) +# 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/tests/unit/plugins/modules/database/saphana/__init__.py b/tests/unit/plugins/modules/database/saphana/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/database/saphana/test_hana_query.py b/tests/unit/plugins/modules/database/saphana/test_hana_query.py index f7525b34f8..f70b3003b8 100644 --- a/tests/unit/plugins/modules/database/saphana/test_hana_query.py +++ b/tests/unit/plugins/modules/database/saphana/test_hana_query.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- -# Copyright: (c) 2021, Rainer Leber (@rainerleber) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, Rainer Leber (@rainerleber) +# 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/tests/unit/plugins/modules/files/__init__.py b/tests/unit/plugins/modules/files/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/files/test_archive.py b/tests/unit/plugins/modules/files/test_archive.py index 9fae51e7b7..00c16db33c 100644 --- a/tests/unit/plugins/modules/files/test_archive.py +++ b/tests/unit/plugins/modules/files/test_archive.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/tests/unit/plugins/modules/files/test_sapcar_extract.py b/tests/unit/plugins/modules/files/test_sapcar_extract.py index 05946e8217..58a3b227ee 100644 --- a/tests/unit/plugins/modules/files/test_sapcar_extract.py +++ b/tests/unit/plugins/modules/files/test_sapcar_extract.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- -# Copyright: (c) 2021, Rainer Leber (@rainerleber) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, Rainer Leber (@rainerleber) +# 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/tests/unit/plugins/modules/identity/__init__.py b/tests/unit/plugins/modules/identity/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/identity/ipa/__init__.py b/tests/unit/plugins/modules/identity/ipa/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/identity/ipa/test_ipa_otpconfig.py b/tests/unit/plugins/modules/identity/ipa/test_ipa_otpconfig.py index cae905942a..a13ae32c0f 100644 --- a/tests/unit/plugins/modules/identity/ipa/test_ipa_otpconfig.py +++ b/tests/unit/plugins/modules/identity/ipa/test_ipa_otpconfig.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- -# Copyright: (c) 2020, Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# 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 from __future__ import absolute_import, division, print_function __metaclass__ = type diff --git a/tests/unit/plugins/modules/identity/ipa/test_ipa_otptoken.py b/tests/unit/plugins/modules/identity/ipa/test_ipa_otptoken.py index ecea5920a0..4781b242e9 100644 --- a/tests/unit/plugins/modules/identity/ipa/test_ipa_otptoken.py +++ b/tests/unit/plugins/modules/identity/ipa/test_ipa_otptoken.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- -# Copyright: (c) 2020, Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# 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 from __future__ import absolute_import, division, print_function __metaclass__ = type diff --git a/tests/unit/plugins/modules/identity/ipa/test_ipa_pwpolicy.py b/tests/unit/plugins/modules/identity/ipa/test_ipa_pwpolicy.py index 22353b89f2..35201a2cbe 100644 --- a/tests/unit/plugins/modules/identity/ipa/test_ipa_pwpolicy.py +++ b/tests/unit/plugins/modules/identity/ipa/test_ipa_pwpolicy.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- -# Copyright: (c) 2020, Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# 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 from __future__ import absolute_import, division, print_function __metaclass__ = type diff --git a/tests/unit/plugins/modules/identity/keycloak/__init__.py b/tests/unit/plugins/modules/identity/keycloak/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_authentication.py b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_authentication.py index 91e34eea7b..226a3bad7c 100644 --- a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_authentication.py +++ b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_authentication.py @@ -1,7 +1,8 @@ # -*- 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 diff --git a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_client.py b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_client.py index e017a5985c..1f9fa8bc67 100644 --- a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_client.py +++ b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_client.py @@ -1,7 +1,8 @@ # -*- 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 diff --git a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_client_rolemapping.py b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_client_rolemapping.py index 8e753bc6d0..d3a3516660 100644 --- a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_client_rolemapping.py +++ b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_client_rolemapping.py @@ -1,7 +1,8 @@ # -*- 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 diff --git a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_clientscope.py b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_clientscope.py index 0954562d95..011d451b4d 100644 --- a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_clientscope.py +++ b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_clientscope.py @@ -1,7 +1,8 @@ # -*- 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 diff --git a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_identity_provider.py b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_identity_provider.py index 3faea34c51..7bcc4b41a2 100644 --- a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_identity_provider.py +++ b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_identity_provider.py @@ -1,7 +1,8 @@ # -*- 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 diff --git a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_realm.py b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_realm.py index 06548ad3e6..4158f320ba 100644 --- a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_realm.py +++ b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_realm.py @@ -1,7 +1,8 @@ # -*- 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 diff --git a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_realm_info.py b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_realm_info.py index b6833d7949..7ac381b974 100644 --- a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_realm_info.py +++ b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_realm_info.py @@ -1,7 +1,8 @@ # -*- 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 diff --git a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_role.py b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_role.py index cffae17807..4e27bfcae9 100644 --- a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_role.py +++ b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_role.py @@ -1,7 +1,8 @@ # -*- 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 diff --git a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_user_federation.py b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_user_federation.py index a37ea1bb11..88b61ac559 100644 --- a/tests/unit/plugins/modules/identity/keycloak/test_keycloak_user_federation.py +++ b/tests/unit/plugins/modules/identity/keycloak/test_keycloak_user_federation.py @@ -1,7 +1,8 @@ # -*- 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 diff --git a/tests/unit/plugins/modules/messaging/__init__.py b/tests/unit/plugins/modules/messaging/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/monitoring/__init__.py b/tests/unit/plugins/modules/monitoring/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/monitoring/test_alerta_customer.py b/tests/unit/plugins/modules/monitoring/test_alerta_customer.py index 8ad46db363..21f6804d8a 100644 --- a/tests/unit/plugins/modules/monitoring/test_alerta_customer.py +++ b/tests/unit/plugins/modules/monitoring/test_alerta_customer.py @@ -1,4 +1,6 @@ -# 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/tests/unit/plugins/modules/monitoring/test_circonus_annotation.py b/tests/unit/plugins/modules/monitoring/test_circonus_annotation.py index b380e857b1..34f1bc6914 100644 --- a/tests/unit/plugins/modules/monitoring/test_circonus_annotation.py +++ b/tests/unit/plugins/modules/monitoring/test_circonus_annotation.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/tests/unit/plugins/modules/monitoring/test_datadog_downtime.py.disabled b/tests/unit/plugins/modules/monitoring/test_datadog_downtime.py.disabled index c7ab6612d7..52f27710cf 100644 --- a/tests/unit/plugins/modules/monitoring/test_datadog_downtime.py.disabled +++ b/tests/unit/plugins/modules/monitoring/test_datadog_downtime.py.disabled @@ -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) diff --git a/tests/unit/plugins/modules/monitoring/test_icinga2_feature.py b/tests/unit/plugins/modules/monitoring/test_icinga2_feature.py index 52398a8495..379071963f 100644 --- a/tests/unit/plugins/modules/monitoring/test_icinga2_feature.py +++ b/tests/unit/plugins/modules/monitoring/test_icinga2_feature.py @@ -3,7 +3,8 @@ # Copyright (c) 2018, Ansible Project # Copyright (c) 2018, Abhijeet Kasurde # -# 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/tests/unit/plugins/modules/monitoring/test_monit.py b/tests/unit/plugins/modules/monitoring/test_monit.py index 849d567057..7e5744a10e 100644 --- a/tests/unit/plugins/modules/monitoring/test_monit.py +++ b/tests/unit/plugins/modules/monitoring/test_monit.py @@ -1,4 +1,6 @@ -# 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/tests/unit/plugins/modules/monitoring/test_pagerduty.py b/tests/unit/plugins/modules/monitoring/test_pagerduty.py index 3c9c28a4d4..47aae12b3e 100644 --- a/tests/unit/plugins/modules/monitoring/test_pagerduty.py +++ b/tests/unit/plugins/modules/monitoring/test_pagerduty.py @@ -1,4 +1,6 @@ -# 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/tests/unit/plugins/modules/monitoring/test_pagerduty_alert.py b/tests/unit/plugins/modules/monitoring/test_pagerduty_alert.py index e0951dcf7e..d076bc4f38 100644 --- a/tests/unit/plugins/modules/monitoring/test_pagerduty_alert.py +++ b/tests/unit/plugins/modules/monitoring/test_pagerduty_alert.py @@ -1,4 +1,6 @@ -# 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/tests/unit/plugins/modules/monitoring/test_pagerduty_change.py b/tests/unit/plugins/modules/monitoring/test_pagerduty_change.py index 57b62a51ed..d8cd3d5a99 100644 --- a/tests/unit/plugins/modules/monitoring/test_pagerduty_change.py +++ b/tests/unit/plugins/modules/monitoring/test_pagerduty_change.py @@ -1,4 +1,7 @@ -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)from __future__ import (absolute_import, division, print_function) +# 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/tests/unit/plugins/modules/monitoring/test_statsd.py b/tests/unit/plugins/modules/monitoring/test_statsd.py index 205080e754..05613e369b 100644 --- a/tests/unit/plugins/modules/monitoring/test_statsd.py +++ b/tests/unit/plugins/modules/monitoring/test_statsd.py @@ -1,4 +1,6 @@ -# 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/tests/unit/plugins/modules/net_tools/__init__.py b/tests/unit/plugins/modules/net_tools/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/net_tools/pritunl/test_pritunl_org.py b/tests/unit/plugins/modules/net_tools/pritunl/test_pritunl_org.py index 39071974c8..308d352517 100644 --- a/tests/unit/plugins/modules/net_tools/pritunl/test_pritunl_org.py +++ b/tests/unit/plugins/modules/net_tools/pritunl/test_pritunl_org.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- -# (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 @@ -109,7 +110,7 @@ class TestPritunlOrg(ModuleTestCase): idempotent_exc = idempotent_result.exception.args[0] # Ensure both calls resulted in the same returned value - # except for changed which sould be false the second time + # except for changed which should be false the second time for k, v in iteritems(idempotent_exc): if k == "changed": self.assertFalse(idempotent_exc[k]) @@ -158,7 +159,7 @@ class TestPritunlOrg(ModuleTestCase): idempotent_exc = idempotent_result.exception.args[0] # Ensure both calls resulted in the same returned value - # except for changed which sould be false the second time + # except for changed which should be false the second time self.assertFalse(idempotent_exc["changed"]) self.assertEqual(idempotent_exc["response"], delete_exc["response"]) diff --git a/tests/unit/plugins/modules/net_tools/pritunl/test_pritunl_org_info.py b/tests/unit/plugins/modules/net_tools/pritunl/test_pritunl_org_info.py index 54922f4b75..f82b963220 100644 --- a/tests/unit/plugins/modules/net_tools/pritunl/test_pritunl_org_info.py +++ b/tests/unit/plugins/modules/net_tools/pritunl/test_pritunl_org_info.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 from __future__ import absolute_import, division, print_function diff --git a/tests/unit/plugins/modules/net_tools/pritunl/test_pritunl_user.py b/tests/unit/plugins/modules/net_tools/pritunl/test_pritunl_user.py index 114fe8a81a..d66cf63711 100644 --- a/tests/unit/plugins/modules/net_tools/pritunl/test_pritunl_user.py +++ b/tests/unit/plugins/modules/net_tools/pritunl/test_pritunl_user.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- -# (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/tests/unit/plugins/modules/net_tools/pritunl/test_pritunl_user_info.py b/tests/unit/plugins/modules/net_tools/pritunl/test_pritunl_user_info.py index b253dc27ec..266869884a 100644 --- a/tests/unit/plugins/modules/net_tools/pritunl/test_pritunl_user_info.py +++ b/tests/unit/plugins/modules/net_tools/pritunl/test_pritunl_user_info.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 from __future__ import absolute_import, division, print_function diff --git a/tests/unit/plugins/modules/net_tools/test_dnsimple.py b/tests/unit/plugins/modules/net_tools/test_dnsimple.py index b9dce3c215..2e246e5f66 100644 --- a/tests/unit/plugins/modules/net_tools/test_dnsimple.py +++ b/tests/unit/plugins/modules/net_tools/test_dnsimple.py @@ -1,6 +1,8 @@ # -*- 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 diff --git a/tests/unit/plugins/modules/net_tools/test_dnsimple_info.py b/tests/unit/plugins/modules/net_tools/test_dnsimple_info.py index 158f38f352..bd08df4ee5 100644 --- a/tests/unit/plugins/modules/net_tools/test_dnsimple_info.py +++ b/tests/unit/plugins/modules/net_tools/test_dnsimple_info.py @@ -1,6 +1,8 @@ # -*- 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 diff --git a/tests/unit/plugins/modules/net_tools/test_nmcli.py b/tests/unit/plugins/modules/net_tools/test_nmcli.py index 546cae20e8..cfc1282c83 100644 --- a/tests/unit/plugins/modules/net_tools/test_nmcli.py +++ b/tests/unit/plugins/modules/net_tools/test_nmcli.py @@ -1,5 +1,6 @@ -# 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) __metaclass__ = type @@ -98,6 +99,12 @@ TESTCASE_CONNECTION = [ 'state': 'absent', '_ansible_check_mode': True, }, + { + 'type': 'vpn', + 'conn_name': 'non_existent_nw_device', + 'state': 'absent', + '_ansible_check_mode': True, + }, ] TESTCASE_GENERIC = [ @@ -449,6 +456,17 @@ ipv6.ignore-auto-dns: no ipv6.ignore-auto-routes: no """ +TESTCASE_GENERIC_ZONE_ONLY = [ + { + 'type': 'generic', + 'conn_name': 'non_existent_nw_device', + 'ifname': 'generic_non_existant', + 'state': 'present', + 'zone': 'public', + '_ansible_check_mode': False, + } +] + TESTCASE_BOND = [ { 'type': 'bond', @@ -1177,6 +1195,82 @@ wireguard.ip4-auto-default-route: -1 (default) wireguard.ip6-auto-default-route: -1 (default) """ +TESTCASE_VPN_L2TP = [ + { + 'type': 'vpn', + 'conn_name': 'vpn_l2tp', + 'vpn': { + 'permissions': 'brittany', + 'service-type': 'org.freedesktop.NetworkManager.l2tp', + 'gateway': 'vpn.example.com', + 'password-flags': '2', + 'user': 'brittany', + 'ipsec-enabled': 'true', + 'ipsec-psk': 'QnJpdHRhbnkxMjM=', + }, + 'gw4_ignore_auto': True, + 'routes4': ['192.168.200.0/24'], + 'autoconnect': 'false', + 'state': 'present', + '_ansible_check_mode': False, + }, +] + +TESTCASE_VPN_L2TP_SHOW_OUTPUT = """\ +connection.id: vpn_l2tp +connection.type: vpn +connection.autoconnect: no +connection.permissions: brittany +ipv4.method: auto +ipv4.routes: { ip = 192.168.200.0/24 } +ipv4.never-default: no +ipv4.may-fail: yes +ipv4.ignore-auto-dns: no +ipv4.ignore-auto-routes: yes +ipv6.method: auto +ipv6.ignore-auto-dns: no +ipv6.ignore-auto-routes: no +vpn.service-type: org.freedesktop.NetworkManager.l2tp +vpn.data: gateway = vpn.example.com, ipsec-enabled = true, ipsec-psk = QnJpdHRhbnkxMjM=, password-flags = 2, user = brittany +vpn.secrets: ipsec-psk = QnJpdHRhbnkxMjM= +vpn.persistent: no +vpn.timeout: 0 +""" + +TESTCASE_VPN_PPTP = [ + { + 'type': 'vpn', + 'conn_name': 'vpn_pptp', + 'vpn': { + 'permissions': 'brittany', + 'service-type': 'org.freedesktop.NetworkManager.pptp', + 'gateway': 'vpn.example.com', + 'password-flags': '2', + 'user': 'brittany', + }, + 'autoconnect': 'false', + 'state': 'present', + '_ansible_check_mode': False, + }, +] + +TESTCASE_VPN_PPTP_SHOW_OUTPUT = """\ +connection.id: vpn_pptp +connection.type: vpn +connection.autoconnect: no +connection.permissions: brittany +ipv4.method: auto +ipv4.never-default: no +ipv4.may-fail: yes +ipv4.ignore-auto-dns: no +ipv4.ignore-auto-routes: no +ipv6.method: auto +ipv6.ignore-auto-dns: no +ipv6.ignore-auto-routes: no +vpn.service-type: org.freedesktop.NetworkManager.pptp +vpn.data: gateway=vpn.example.com, password-flags=2, user=brittany +""" + def mocker_set(mocker, connection_exists=False, @@ -1547,6 +1641,20 @@ def mocked_wireguard_connection_unchanged(mocker): execute_return=(0, TESTCASE_WIREGUARD_SHOW_OUTPUT, "")) +@pytest.fixture +def mocked_vpn_l2tp_connection_unchanged(mocker): + mocker_set(mocker, + connection_exists=True, + execute_return=(0, TESTCASE_VPN_L2TP_SHOW_OUTPUT, "")) + + +@pytest.fixture +def mocked_vpn_pptp_connection_unchanged(mocker): + mocker_set(mocker, + connection_exists=True, + execute_return=(0, TESTCASE_VPN_PPTP_SHOW_OUTPUT, "")) + + @pytest.mark.parametrize('patch_ansible_module', TESTCASE_BOND, indirect=['patch_ansible_module']) def test_bond_connection_create(mocked_generic_connection_create, capfd): """ @@ -1805,6 +1913,30 @@ def test_generic_connection_zone_unchanged(mocked_generic_connection_zone_unchan assert not results['changed'] +@pytest.mark.parametrize('patch_ansible_module', TESTCASE_GENERIC_ZONE_ONLY, indirect=['patch_ansible_module']) +def test_generic_connection_modify_zone_only(mocked_generic_connection_modify, capfd): + """ + Test : Generic connection modified with zone only + """ + with pytest.raises(SystemExit): + nmcli.main() + + assert nmcli.Nmcli.execute_command.call_count == 1 + arg_list = nmcli.Nmcli.execute_command.call_args_list + args, kwargs = arg_list[0] + + assert 'connection.zone' in args[0] + assert 'ipv4.addresses' not in args[0] + assert 'ipv4.gateway' not in args[0] + assert 'ipv6.addresses' not in args[0] + assert 'ipv6.gateway' not in args[0] + + out, err = capfd.readouterr() + results = json.loads(out) + assert not results.get('failed') + assert results['changed'] + + @pytest.mark.parametrize('patch_ansible_module', TESTCASE_CONNECTION, indirect=['patch_ansible_module']) def test_zone_none(mocked_connection_exists, capfd): """ @@ -3191,7 +3323,7 @@ def test_gsm_connection_unchanged(mocked_gsm_connection_unchanged, capfd): @pytest.mark.parametrize('patch_ansible_module', TESTCASE_ETHERNET_STATIC_MULTIPLE_IP4_ADDRESSES, indirect=['patch_ansible_module']) -def test_create_ethernet_with_mulitple_ip4_addresses_static(mocked_generic_connection_create, capfd): +def test_create_ethernet_with_multiple_ip4_addresses_static(mocked_generic_connection_create, capfd): """ Test : Create ethernet connection with static IP configuration """ @@ -3231,7 +3363,7 @@ def test_create_ethernet_with_mulitple_ip4_addresses_static(mocked_generic_conne @pytest.mark.parametrize('patch_ansible_module', TESTCASE_ETHERNET_STATIC_MULTIPLE_IP6_ADDRESSES, indirect=['patch_ansible_module']) -def test_create_ethernet_with_mulitple_ip6_addresses_static(mocked_generic_connection_create, capfd): +def test_create_ethernet_with_multiple_ip6_addresses_static(mocked_generic_connection_create, capfd): """ Test : Create ethernet connection with multiple IPv6 addresses configuration """ @@ -3271,7 +3403,7 @@ def test_create_ethernet_with_mulitple_ip6_addresses_static(mocked_generic_conne @pytest.mark.parametrize('patch_ansible_module', TESTCASE_ETHERNET_STATIC_MULTIPLE_IP4_ADDRESSES, indirect=['patch_ansible_module']) -def test_ethernet_connection_static_with_mulitple_ip4_addresses_unchanged(mocked_ethernet_connection_static_multiple_ip4_addresses_unchanged, capfd): +def test_ethernet_connection_static_with_multiple_ip4_addresses_unchanged(mocked_ethernet_connection_static_multiple_ip4_addresses_unchanged, capfd): """ Test : Ethernet connection with static IP configuration unchanged """ @@ -3285,7 +3417,7 @@ def test_ethernet_connection_static_with_mulitple_ip4_addresses_unchanged(mocked @pytest.mark.parametrize('patch_ansible_module', TESTCASE_ETHERNET_STATIC_MULTIPLE_IP6_ADDRESSES, indirect=['patch_ansible_module']) -def test_ethernet_connection_static_with_mulitple_ip6_addresses_unchanged(mocked_ethernet_connection_static_multiple_ip6_addresses_unchanged, capfd): +def test_ethernet_connection_static_with_multiple_ip6_addresses_unchanged(mocked_ethernet_connection_static_multiple_ip6_addresses_unchanged, capfd): """ Test : Ethernet connection with multiple IPv6 addresses configuration unchanged """ @@ -3367,7 +3499,7 @@ def test_create_ethernet_addr_gen_mode_and_ip6_privacy_static(mocked_generic_con @pytest.mark.parametrize('patch_ansible_module', TESTCASE_ETHERNET_STATIC_IP6_PRIVACY_AND_ADDR_GEN_MODE, indirect=['patch_ansible_module']) -def test_ethernet_connection_static_with_mulitple_ip4_addresses_unchanged(mocked_ethernet_connection_static_ip6_privacy_and_addr_gen_mode_unchange, capfd): +def test_ethernet_connection_static_with_multiple_ip4_addresses_unchanged(mocked_ethernet_connection_static_ip6_privacy_and_addr_gen_mode_unchange, capfd): """ Test : Ethernet connection with static IP configuration unchanged """ @@ -3456,3 +3588,111 @@ def test_wireguard_mod(mocked_generic_connection_modify, capfd): results = json.loads(out) assert not results.get('failed') assert results['changed'] + + +@pytest.mark.parametrize('patch_ansible_module', TESTCASE_VPN_L2TP, indirect=['patch_ansible_module']) +def test_vpn_l2tp_connection_unchanged(mocked_vpn_l2tp_connection_unchanged, capfd): + """ + Test : L2TP VPN connection unchanged + """ + with pytest.raises(SystemExit): + nmcli.main() + + out, err = capfd.readouterr() + results = json.loads(out) + assert not results.get('failed') + assert not results['changed'] + + +@pytest.mark.parametrize('patch_ansible_module', TESTCASE_VPN_PPTP, indirect=['patch_ansible_module']) +def test_vpn_pptp_connection_unchanged(mocked_vpn_pptp_connection_unchanged, capfd): + """ + Test : PPTP VPN connection unchanged + """ + with pytest.raises(SystemExit): + nmcli.main() + + out, err = capfd.readouterr() + results = json.loads(out) + assert not results.get('failed') + assert not results['changed'] + + +@pytest.mark.parametrize('patch_ansible_module', TESTCASE_VPN_L2TP, indirect=['patch_ansible_module']) +def test_create_vpn_l2tp(mocked_generic_connection_create, capfd): + """ + Test : Create L2TP VPN connection + """ + + with pytest.raises(SystemExit): + nmcli.main() + + assert nmcli.Nmcli.execute_command.call_count == 1 + arg_list = nmcli.Nmcli.execute_command.call_args_list + add_args, add_kw = arg_list[0] + + assert add_args[0][0] == '/usr/bin/nmcli' + assert add_args[0][1] == 'con' + assert add_args[0][2] == 'add' + assert add_args[0][3] == 'type' + assert add_args[0][4] == 'vpn' + assert add_args[0][5] == 'con-name' + assert add_args[0][6] == 'vpn_l2tp' + + add_args_text = list(map(to_text, add_args[0])) + + for param in ['connection.autoconnect', 'no', + 'connection.permissions', 'brittany', + 'vpn.data', 'vpn.service-type', 'org.freedesktop.NetworkManager.l2tp', + ]: + assert param in add_args_text + + vpn_data_index = add_args_text.index('vpn.data') + 1 + args_vpn_data = add_args_text[vpn_data_index] + for vpn_data in ['gateway=vpn.example.com', 'password-flags=2', 'user=brittany', 'ipsec-enabled=true', 'ipsec-psk=QnJpdHRhbnkxMjM=']: + assert vpn_data in args_vpn_data + + out, err = capfd.readouterr() + results = json.loads(out) + assert not results.get('failed') + assert results['changed'] + + +@pytest.mark.parametrize('patch_ansible_module', TESTCASE_VPN_PPTP, indirect=['patch_ansible_module']) +def test_create_vpn_pptp(mocked_generic_connection_create, capfd): + """ + Test : Create PPTP VPN connection + """ + + with pytest.raises(SystemExit): + nmcli.main() + + assert nmcli.Nmcli.execute_command.call_count == 1 + arg_list = nmcli.Nmcli.execute_command.call_args_list + add_args, add_kw = arg_list[0] + + assert add_args[0][0] == '/usr/bin/nmcli' + assert add_args[0][1] == 'con' + assert add_args[0][2] == 'add' + assert add_args[0][3] == 'type' + assert add_args[0][4] == 'vpn' + assert add_args[0][5] == 'con-name' + assert add_args[0][6] == 'vpn_pptp' + + add_args_text = list(map(to_text, add_args[0])) + + for param in ['connection.autoconnect', 'no', + 'connection.permissions', 'brittany', + 'vpn.data', 'vpn.service-type', 'org.freedesktop.NetworkManager.pptp', + ]: + assert param in add_args_text + + vpn_data_index = add_args_text.index('vpn.data') + 1 + args_vpn_data = add_args_text[vpn_data_index] + for vpn_data in ['password-flags=2', 'gateway=vpn.example.com', 'user=brittany']: + assert vpn_data in args_vpn_data + + out, err = capfd.readouterr() + results = json.loads(out) + assert not results.get('failed') + assert results['changed'] diff --git a/tests/unit/plugins/modules/notification/__init__.py b/tests/unit/plugins/modules/notification/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/notification/test_campfire.py b/tests/unit/plugins/modules/notification/test_campfire.py index 72bbd57921..f05cc239da 100644 --- a/tests/unit/plugins/modules/notification/test_campfire.py +++ b/tests/unit/plugins/modules/notification/test_campfire.py @@ -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 from __future__ import (absolute_import, division, print_function) __metaclass__ = type diff --git a/tests/unit/plugins/modules/notification/test_discord.py b/tests/unit/plugins/modules/notification/test_discord.py index 257b0d4dab..20f9547d43 100644 --- a/tests/unit/plugins/modules/notification/test_discord.py +++ b/tests/unit/plugins/modules/notification/test_discord.py @@ -1,4 +1,6 @@ -# 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/tests/unit/plugins/modules/notification/test_slack.py b/tests/unit/plugins/modules/notification/test_slack.py index 85f9b100f0..fd6fe0e4bf 100644 --- a/tests/unit/plugins/modules/notification/test_slack.py +++ b/tests/unit/plugins/modules/notification/test_slack.py @@ -1,4 +1,6 @@ -# 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 @@ -37,7 +39,7 @@ class TestSlackModule(ModuleTestCase): with self.assertRaises(AnsibleFailJson): self.module.main() - def test_sucessful_message(self): + def test_successful_message(self): """tests sending a message. This is example 1 from the docs""" set_module_args({ 'token': 'XXXX/YYYY/ZZZZ', diff --git a/tests/unit/plugins/modules/packaging/__init__.py b/tests/unit/plugins/modules/packaging/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/packaging/language/__init__.py b/tests/unit/plugins/modules/packaging/language/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/packaging/language/test_cpanm.py b/tests/unit/plugins/modules/packaging/language/test_cpanm.py index 10a2955019..1426b26d75 100644 --- a/tests/unit/plugins/modules/packaging/language/test_cpanm.py +++ b/tests/unit/plugins/modules/packaging/language/test_cpanm.py @@ -2,7 +2,11 @@ # Largely adapted from test_redhat_subscription by # Jiri Hnidek (jhnidek@redhat.com) # -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) Alexei Znamensky (russoz@gmail.com) +# Copyright (c) Jiri Hnidek (jhnidek@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 @@ -19,7 +23,7 @@ TESTED_MODULE = cpanm.__name__ @pytest.fixture def patch_cpanm(mocker): """ - Function used for mocking some parts of redhat_subscribtion module + Function used for mocking some parts of redhat_subscription module """ mocker.patch('ansible_collections.community.general.plugins.module_utils.module_helper.AnsibleModule.get_bin_path', return_value='/testbin/cpanm') diff --git a/tests/unit/plugins/modules/packaging/language/test_gem.py b/tests/unit/plugins/modules/packaging/language/test_gem.py index 41f504f6c0..5e8abe7816 100644 --- a/tests/unit/plugins/modules/packaging/language/test_gem.py +++ b/tests/unit/plugins/modules/packaging/language/test_gem.py @@ -1,5 +1,6 @@ # Copyright (c) 2018 Antoine Catton -# MIT License (see licenses/MIT-license.txt or https://opensource.org/licenses/MIT) +# MIT License (see LICENSES/MIT.txt or https://opensource.org/licenses/MIT) +# SPDX-License-Identifier: MIT from __future__ import (absolute_import, division, print_function) __metaclass__ = type diff --git a/tests/unit/plugins/modules/packaging/language/test_maven_artifact.py b/tests/unit/plugins/modules/packaging/language/test_maven_artifact.py index 1cd7e243f6..262aee6e72 100644 --- a/tests/unit/plugins/modules/packaging/language/test_maven_artifact.py +++ b/tests/unit/plugins/modules/packaging/language/test_maven_artifact.py @@ -1,5 +1,6 @@ # 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/tests/unit/plugins/modules/packaging/language/test_npm.py b/tests/unit/plugins/modules/packaging/language/test_npm.py index 6e30a5d41d..e9a8d486fa 100644 --- a/tests/unit/plugins/modules/packaging/language/test_npm.py +++ b/tests/unit/plugins/modules/packaging/language/test_npm.py @@ -1,6 +1,7 @@ # -# Copyright: (c) 2021, Abhijeet Kasurde -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, Abhijeet Kasurde +# 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/tests/unit/plugins/modules/packaging/os/__init__.py b/tests/unit/plugins/modules/packaging/os/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/packaging/os/conftest.py b/tests/unit/plugins/modules/packaging/os/conftest.py index 408a023762..a8f890050e 100644 --- a/tests/unit/plugins/modules/packaging/os/conftest.py +++ b/tests/unit/plugins/modules/packaging/os/conftest.py @@ -1,4 +1,6 @@ -# 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/tests/unit/plugins/modules/packaging/os/test_apk.py b/tests/unit/plugins/modules/packaging/os/test_apk.py index 9577e892ee..a7f3bee895 100644 --- a/tests/unit/plugins/modules/packaging/os/test_apk.py +++ b/tests/unit/plugins/modules/packaging/os/test_apk.py @@ -1,4 +1,6 @@ -# 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/tests/unit/plugins/modules/packaging/os/test_homebrew.py b/tests/unit/plugins/modules/packaging/os/test_homebrew.py index c2297fd47d..a1b561906e 100644 --- a/tests/unit/plugins/modules/packaging/os/test_homebrew.py +++ b/tests/unit/plugins/modules/packaging/os/test_homebrew.py @@ -1,4 +1,6 @@ -# 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) diff --git a/tests/unit/plugins/modules/packaging/os/test_homebrew_cask.py b/tests/unit/plugins/modules/packaging/os/test_homebrew_cask.py index 57cf225a94..ac872c7b6c 100644 --- a/tests/unit/plugins/modules/packaging/os/test_homebrew_cask.py +++ b/tests/unit/plugins/modules/packaging/os/test_homebrew_cask.py @@ -1,4 +1,6 @@ -# 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) diff --git a/tests/unit/plugins/modules/packaging/os/test_macports.py b/tests/unit/plugins/modules/packaging/os/test_macports.py index ef7c522f0f..189f9616fe 100644 --- a/tests/unit/plugins/modules/packaging/os/test_macports.py +++ b/tests/unit/plugins/modules/packaging/os/test_macports.py @@ -1,4 +1,6 @@ -# 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/tests/unit/plugins/modules/packaging/os/test_pacman.py b/tests/unit/plugins/modules/packaging/os/test_pacman.py index bbc8f3435c..6826ee81e2 100644 --- a/tests/unit/plugins/modules/packaging/os/test_pacman.py +++ b/tests/unit/plugins/modules/packaging/os/test_pacman.py @@ -1,4 +1,6 @@ -# 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 @@ -100,6 +102,19 @@ valid_inventory = { "upgradable_pkgs": { "sqlite": VersionTuple(current="3.36.0-1", latest="3.37.0-1"), }, + "pkg_reasons": { + "file": "explicit", + "filesystem": "explicit", + "findutils": "explicit", + "gawk": "explicit", + "gettext": "explicit", + "grep": "explicit", + "gzip": "explicit", + "pacman": "explicit", + "pacman-mirrorlist": "dependency", + "sed": "explicit", + "sqlite": "explicit", + }, } empty_inventory = { @@ -108,6 +123,7 @@ empty_inventory = { "installed_groups": {}, "available_groups": {}, "upgradable_pkgs": {}, + "pkg_reasons": {}, } @@ -255,6 +271,27 @@ class TestPacman: """, "", ), + ( # pacman --query --explicit + 0, + """file 5.41-1 + filesystem 2021.11.11-1 + findutils 4.8.0-1 + gawk 5.1.1-1 + gettext 0.21-1 + grep 3.7-1 + gzip 1.11-1 + pacman 6.0.1-2 + sed 4.8-1 + sqlite 3.36.0-1 + """, + "", + ), + ( # pacman --query --deps + 0, + """pacman-mirrorlist 20211114-1 + """, + "", + ), ], None, ), @@ -272,6 +309,8 @@ class TestPacman: "", "warning: config file /etc/pacman.conf, line 34: directive 'TotalDownload' in section 'options' not recognized.", ), + (0, "", ""), + (0, "", ""), ], None, ), @@ -288,6 +327,8 @@ class TestPacman: "partial\npkg\\nlist", "some warning", ), + (0, "", ""), + (0, "", ""), ], AnsibleFailJson, ), @@ -375,6 +416,8 @@ class TestPacman: (["pacman", "--query", "--groups"], {'check_rc': True}, 0, '', ''), (["pacman", "--sync", "--groups", "--groups"], {'check_rc': True}, 0, '', ''), (["pacman", "--query", "--upgrades"], {'check_rc': False}, 0, '', ''), + (["pacman", "--query", "--explicit"], {'check_rc': True}, 0, 'foo 1.0.0-1', ''), + (["pacman", "--query", "--deps"], {'check_rc': True}, 0, '', ''), ], False, ), @@ -843,7 +886,7 @@ class TestPacman: ], "state": "present", }, - ["sudo", "somepackage", "otherpkg"], + ["otherpkg", "somepackage", "sudo"], [ Package("sudo", "sudo"), Package("grep", "grep"), diff --git a/tests/unit/plugins/modules/packaging/os/test_pacman_key.py b/tests/unit/plugins/modules/packaging/os/test_pacman_key.py index 757fee4e87..fc41e8f86e 100644 --- a/tests/unit/plugins/modules/packaging/os/test_pacman_key.py +++ b/tests/unit/plugins/modules/packaging/os/test_pacman_key.py @@ -1,5 +1,6 @@ -# Copyright: (c) 2019, George Rawlinson -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2019, George Rawlinson +# 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/tests/unit/plugins/modules/packaging/os/test_pkgin.py b/tests/unit/plugins/modules/packaging/os/test_pkgin.py index a53cfd493b..4504e46963 100644 --- a/tests/unit/plugins/modules/packaging/os/test_pkgin.py +++ b/tests/unit/plugins/modules/packaging/os/test_pkgin.py @@ -1,4 +1,6 @@ -# 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/tests/unit/plugins/modules/packaging/os/test_redhat_subscription.py b/tests/unit/plugins/modules/packaging/os/test_redhat_subscription.py index 7f430ee72c..95c02137b9 100644 --- a/tests/unit/plugins/modules/packaging/os/test_redhat_subscription.py +++ b/tests/unit/plugins/modules/packaging/os/test_redhat_subscription.py @@ -1,6 +1,8 @@ -# Author: Jiri Hnidek (jhnidek@redhat.com) +# -*- coding: utf-8 -*- +# Copyright (c) Jiri Hnidek (jhnidek@redhat.com) # -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# GNU General Public License v3.0+ (see 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 @@ -118,7 +120,7 @@ TEST_CASES = [ (0, 'system identity: b26df632-25ed-4452-8f89-0308bfd167cb', '') ), ( - ['/testbin/subscription-manager', 'unsubscribe', '--all'], + ['/testbin/subscription-manager', 'remove', '--all'], {'check_rc': True}, (0, '', '') ), @@ -755,7 +757,7 @@ Entitlement Type: Physical ( [ '/testbin/subscription-manager', - 'unsubscribe', + 'remove', '--serial=7807912223970164816', ], {'check_rc': True}, diff --git a/tests/unit/plugins/modules/packaging/os/test_rhn_channel.py b/tests/unit/plugins/modules/packaging/os/test_rhn_channel.py index 548deaabcc..bda110c74c 100644 --- a/tests/unit/plugins/modules/packaging/os/test_rhn_channel.py +++ b/tests/unit/plugins/modules/packaging/os/test_rhn_channel.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # Copyright (c) 2017 Pierre-Louis Bonicoli -# 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/tests/unit/plugins/modules/packaging/os/test_rhn_register.py b/tests/unit/plugins/modules/packaging/os/test_rhn_register.py index 9dde4bae7d..cfbdfb36f4 100644 --- a/tests/unit/plugins/modules/packaging/os/test_rhn_register.py +++ b/tests/unit/plugins/modules/packaging/os/test_rhn_register.py @@ -1,4 +1,6 @@ -# 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/tests/unit/plugins/modules/packaging/os/test_rhsm_release.py b/tests/unit/plugins/modules/packaging/os/test_rhsm_release.py index 98db6e2840..54fde2138a 100644 --- a/tests/unit/plugins/modules/packaging/os/test_rhsm_release.py +++ b/tests/unit/plugins/modules/packaging/os/test_rhsm_release.py @@ -1,5 +1,6 @@ -# (c) 2018, Sean Myers -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2018, Sean Myers +# 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/tests/unit/plugins/modules/packaging/os/test_rpm_ostree_pkg.py b/tests/unit/plugins/modules/packaging/os/test_rpm_ostree_pkg.py index 537a50d980..3f3dd5e017 100644 --- a/tests/unit/plugins/modules/packaging/os/test_rpm_ostree_pkg.py +++ b/tests/unit/plugins/modules/packaging/os/test_rpm_ostree_pkg.py @@ -1,6 +1,7 @@ # -# Copyright: (c) 2021, Abhijeet Kasurde -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) 2021, Abhijeet Kasurde +# 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/tests/unit/plugins/modules/remote_management/__init__.py b/tests/unit/plugins/modules/remote_management/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/remote_management/lenovoxcc/test_xcc_redfish_command.py b/tests/unit/plugins/modules/remote_management/lenovoxcc/test_xcc_redfish_command.py index 418474c578..035d4c9852 100644 --- a/tests/unit/plugins/modules/remote_management/lenovoxcc/test_xcc_redfish_command.py +++ b/tests/unit/plugins/modules/remote_management/lenovoxcc/test_xcc_redfish_command.py @@ -1,4 +1,6 @@ -# 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 @@ -72,14 +74,16 @@ class TestXCCRedfishCommand(unittest.TestCase): 'transfer_protocol_type': 'NFS' } }) - with patch.object(module.XCCRedfishUtils, '_find_managers_resource') as mock__find_managers_resource: - mock__find_managers_resource.return_value = {'ret': True, 'changed': True, 'msg': 'success'} + with patch.object(module.XCCRedfishUtils, '_find_systems_resource') as mock__find_systems_resource: + mock__find_systems_resource.return_value = {'ret': True, 'changed': True, 'msg': 'success'} + with patch.object(module.XCCRedfishUtils, '_find_managers_resource') as mock__find_managers_resource: + mock__find_managers_resource.return_value = {'ret': True, 'changed': True, 'msg': 'success'} - with patch.object(module.XCCRedfishUtils, 'virtual_media_insert') as mock_virtual_media_insert: - mock_virtual_media_insert.return_value = {'ret': True, 'changed': True, 'msg': 'success'} + with patch.object(module.XCCRedfishUtils, 'virtual_media_insert') as mock_virtual_media_insert: + mock_virtual_media_insert.return_value = {'ret': True, 'changed': True, 'msg': 'success'} - with self.assertRaises(AnsibleExitJson) as result: - module.main() + with self.assertRaises(AnsibleExitJson) as result: + module.main() def test_module_command_VirtualMediaEject_pass(self): set_module_args({ @@ -93,14 +97,16 @@ class TestXCCRedfishCommand(unittest.TestCase): 'image_url': "nfs://10.245.52.18:/home/nfs/bootable-sr635-20210111-autorun.iso", } }) - with patch.object(module.XCCRedfishUtils, '_find_managers_resource') as mock__find_managers_resource: - mock__find_managers_resource.return_value = {'ret': True, 'changed': True, 'msg': 'success'} + with patch.object(module.XCCRedfishUtils, '_find_systems_resource') as mock__find_systems_resource: + mock__find_systems_resource.return_value = {'ret': True, 'changed': True, 'msg': 'success'} + with patch.object(module.XCCRedfishUtils, '_find_managers_resource') as mock__find_managers_resource: + mock__find_managers_resource.return_value = {'ret': True, 'changed': True, 'msg': 'success'} - with patch.object(module.XCCRedfishUtils, 'virtual_media_eject') as mock_virtual_media_eject: - mock_virtual_media_eject.return_value = {'ret': True, 'changed': True, 'msg': 'success'} + with patch.object(module.XCCRedfishUtils, 'virtual_media_eject') as mock_virtual_media_eject: + mock_virtual_media_eject.return_value = {'ret': True, 'changed': True, 'msg': 'success'} - with self.assertRaises(AnsibleExitJson) as result: - module.main() + with self.assertRaises(AnsibleExitJson) as result: + module.main() def test_module_command_VirtualMediaEject_fail_when_required_args_missing(self): with self.assertRaises(AnsibleFailJson): diff --git a/tests/unit/plugins/modules/remote_management/lxca/__init__.py b/tests/unit/plugins/modules/remote_management/lxca/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/remote_management/lxca/test_lxca_cmms.py b/tests/unit/plugins/modules/remote_management/lxca/test_lxca_cmms.py index ab1333de9d..95e73054a0 100644 --- a/tests/unit/plugins/modules/remote_management/lxca/test_lxca_cmms.py +++ b/tests/unit/plugins/modules/remote_management/lxca/test_lxca_cmms.py @@ -1,4 +1,6 @@ -# 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 @@ -73,8 +75,8 @@ class TestMyModule(): } mod_obj.params = args lxca_cmms.main() - assert(mock.call(argument_spec=expected_arguments_spec, - supports_check_mode=False) == ansible_mod_cls.call_args) + assert mock.call(argument_spec=expected_arguments_spec, + supports_check_mode=False) == ansible_mod_cls.call_args @mock.patch('ansible_collections.community.general.plugins.module_utils.remote_management.lxca.common.setup_conn', autospec=True) @mock.patch('ansible_collections.community.general.plugins.modules.remote_management.lxca.lxca_cmms._cmms_by_uuid', diff --git a/tests/unit/plugins/modules/remote_management/lxca/test_lxca_nodes.py b/tests/unit/plugins/modules/remote_management/lxca/test_lxca_nodes.py index 7b009ef27b..4e46547d82 100644 --- a/tests/unit/plugins/modules/remote_management/lxca/test_lxca_nodes.py +++ b/tests/unit/plugins/modules/remote_management/lxca/test_lxca_nodes.py @@ -1,4 +1,6 @@ -# 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 @@ -77,8 +79,8 @@ class TestMyModule(): } mod_obj.params = args lxca_nodes.main() - assert(mock.call(argument_spec=expected_arguments_spec, - supports_check_mode=False) == ansible_mod_cls.call_args) + assert mock.call(argument_spec=expected_arguments_spec, + supports_check_mode=False) == ansible_mod_cls.call_args @mock.patch('ansible_collections.community.general.plugins.module_utils.remote_management.lxca.common.setup_conn', autospec=True) @mock.patch('ansible_collections.community.general.plugins.modules.remote_management.lxca.lxca_nodes._nodes_by_uuid', diff --git a/tests/unit/plugins/modules/remote_management/oneview/__init__.py b/tests/unit/plugins/modules/remote_management/oneview/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/remote_management/oneview/conftest.py b/tests/unit/plugins/modules/remote_management/oneview/conftest.py index 740c71740a..f86543d7cb 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/conftest.py +++ b/tests/unit/plugins/modules/remote_management/oneview/conftest.py @@ -1,5 +1,6 @@ # 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) +# 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/tests/unit/plugins/modules/remote_management/oneview/hpe_test_utils.py b/tests/unit/plugins/modules/remote_management/oneview/hpe_test_utils.py index ec0e85070a..a41066c6b0 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/hpe_test_utils.py +++ b/tests/unit/plugins/modules/remote_management/oneview/hpe_test_utils.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # # Copyright (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) +# 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/tests/unit/plugins/modules/remote_management/oneview/oneview_module_loader.py b/tests/unit/plugins/modules/remote_management/oneview/oneview_module_loader.py index 3b41cee1b5..e4c9c98166 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/oneview_module_loader.py +++ b/tests/unit/plugins/modules/remote_management/oneview/oneview_module_loader.py @@ -1,5 +1,6 @@ # 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) +# 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/tests/unit/plugins/modules/remote_management/oneview/test_oneview_datacenter_info.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_datacenter_info.py index d694d4a306..6226513595 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_datacenter_info.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_datacenter_info.py @@ -1,5 +1,6 @@ # 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) +# 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/tests/unit/plugins/modules/remote_management/oneview/test_oneview_enclosure_info.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_enclosure_info.py index 493b83ed5e..2f59916d71 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_enclosure_info.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_enclosure_info.py @@ -1,5 +1,6 @@ # 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) +# 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/tests/unit/plugins/modules/remote_management/oneview/test_oneview_ethernet_network.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_ethernet_network.py index d2d11cb42b..f1398740ee 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_ethernet_network.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_ethernet_network.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # # Copyright (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) +# 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/tests/unit/plugins/modules/remote_management/oneview/test_oneview_ethernet_network_info.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_ethernet_network_info.py index bc25a030b1..4a2813e2f8 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_ethernet_network_info.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_ethernet_network_info.py @@ -1,5 +1,6 @@ # 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) +# 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/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fc_network.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fc_network.py index 04bb42ba42..6def80fc43 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fc_network.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fc_network.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # # Copyright (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) +# 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/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fc_network_info.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fc_network_info.py index 6096aff756..236ce136ad 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fc_network_info.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fc_network_info.py @@ -1,5 +1,6 @@ # 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) +# 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/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fcoe_network.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fcoe_network.py index af00803fc6..224e5471e9 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fcoe_network.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fcoe_network.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # # Copyright (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) +# 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/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fcoe_network_info.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fcoe_network_info.py index 7dd7309d9f..a83a7e1513 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fcoe_network_info.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_fcoe_network_info.py @@ -1,5 +1,6 @@ # 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) +# 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/tests/unit/plugins/modules/remote_management/oneview/test_oneview_logical_interconnect_group.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_logical_interconnect_group.py index be7d9662ad..f8b3101c62 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_logical_interconnect_group.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_logical_interconnect_group.py @@ -1,5 +1,6 @@ # 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) +# 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/tests/unit/plugins/modules/remote_management/oneview/test_oneview_logical_interconnect_group_info.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_logical_interconnect_group_info.py index dc16031f31..b1f0d24725 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_logical_interconnect_group_info.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_logical_interconnect_group_info.py @@ -1,5 +1,6 @@ # 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) +# 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/tests/unit/plugins/modules/remote_management/oneview/test_oneview_network_set.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_network_set.py index b410606465..f801cd102a 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_network_set.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_network_set.py @@ -1,5 +1,6 @@ # 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) +# 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/tests/unit/plugins/modules/remote_management/oneview/test_oneview_network_set_info.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_network_set_info.py index dd0a5cf4f9..13cd0400a4 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_network_set_info.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_network_set_info.py @@ -1,5 +1,6 @@ # 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) +# 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/tests/unit/plugins/modules/remote_management/oneview/test_oneview_san_manager.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_san_manager.py index 82c265700b..d675c3b353 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_san_manager.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_san_manager.py @@ -1,5 +1,6 @@ # 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) +# 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/tests/unit/plugins/modules/remote_management/oneview/test_oneview_san_manager_info.py b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_san_manager_info.py index df011b701f..be1f243161 100644 --- a/tests/unit/plugins/modules/remote_management/oneview/test_oneview_san_manager_info.py +++ b/tests/unit/plugins/modules/remote_management/oneview/test_oneview_san_manager_info.py @@ -1,5 +1,6 @@ # 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) +# 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/tests/unit/plugins/modules/remote_management/wdc/test_wdc_redfish_command.py b/tests/unit/plugins/modules/remote_management/wdc/test_wdc_redfish_command.py new file mode 100644 index 0000000000..1b2d3d3420 --- /dev/null +++ b/tests/unit/plugins/modules/remote_management/wdc/test_wdc_redfish_command.py @@ -0,0 +1,911 @@ +# -*- 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 + +import shutil +import uuid +import tarfile +import tempfile +import os + +from ansible_collections.community.general.tests.unit.compat.mock import patch +from ansible_collections.community.general.tests.unit.compat import unittest +from ansible.module_utils import basic +import ansible_collections.community.general.plugins.modules.remote_management.redfish.wdc_redfish_command as module +from ansible_collections.community.general.tests.unit.plugins.modules.utils import AnsibleExitJson, AnsibleFailJson +from ansible_collections.community.general.tests.unit.plugins.modules.utils import set_module_args, exit_json, fail_json + +MOCK_SUCCESSFUL_HTTP_EMPTY_RESPONSE = { + "ret": True, + "data": { + } +} + +MOCK_GET_ENCLOSURE_RESPONSE_SINGLE_TENANT = { + "ret": True, + "data": { + "SerialNumber": "12345" + } +} + +MOCK_GET_ENCLOSURE_RESPONSE_MULTI_TENANT = { + "ret": True, + "data": { + "SerialNumber": "12345-A" + } +} + +MOCK_URL_ERROR = { + "ret": False, + "msg": "This is a mock URL error", + "status": 500 +} + +MOCK_SUCCESSFUL_RESPONSE_WITH_UPDATE_SERVICE_RESOURCE = { + "ret": True, + "data": { + "UpdateService": { + "@odata.id": "/UpdateService" + }, + "Chassis": { + "@odata.id": "/Chassis" + } + } +} + +MOCK_SUCCESSFUL_RESPONSE_CHASSIS = { + "ret": True, + "data": { + "Members": [ + { + "@odata.id": "/redfish/v1/Chassis/Enclosure" + } + ] + } +} + +MOCK_SUCCESSFUL_RESPONSE_CHASSIS_ENCLOSURE = { + "ret": True, + "data": { + "Id": "Enclosure", + "IndicatorLED": "Off", + "Actions": { + "Oem": { + "WDC": { + "#Chassis.Locate": { + "target": "/Chassis.Locate" + }, + "#Chassis.PowerMode": { + "target": "/redfish/v1/Chassis/Enclosure/Actions/Chassis.PowerMode", + } + } + } + }, + "Oem": { + "WDC": { + "PowerMode": "Normal" + } + } + } +} + +MOCK_SUCCESSFUL_RESPONSE_WITH_SIMPLE_UPDATE_AND_FW_ACTIVATE = { + "ret": True, + "data": { + "Actions": { + "#UpdateService.SimpleUpdate": { + "target": "mocked value" + }, + "Oem": { + "WDC": { + "#UpdateService.FWActivate": { + "title": "Activate the downloaded firmware.", + "target": "/redfish/v1/UpdateService/Actions/UpdateService.FWActivate" + } + } + } + } + } +} + +MOCK_SUCCESSFUL_RESPONSE_WITH_ACTIONS = { + "ret": True, + "data": { + "Actions": {} + } +} + +MOCK_GET_IOM_A_MULTI_TENANT = { + "ret": True, + "data": { + "Id": "IOModuleAFRU" + } +} + +MOCK_GET_IOM_B_MULTI_TENANAT = { + "ret": True, + "data": { + "error": { + "message": "IOM Module B cannot be read" + } + } +} + + +MOCK_READY_FOR_FW_UPDATE = { + "ret": True, + "entries": { + "Description": "Ready for FW update", + "StatusCode": 0 + } +} + +MOCK_FW_UPDATE_IN_PROGRESS = { + "ret": True, + "entries": { + "Description": "FW update in progress", + "StatusCode": 1 + } +} + +MOCK_WAITING_FOR_ACTIVATION = { + "ret": True, + "entries": { + "Description": "FW update completed. Waiting for activation.", + "StatusCode": 2 + } +} + +MOCK_SIMPLE_UPDATE_STATUS_LIST = [ + MOCK_READY_FOR_FW_UPDATE, + MOCK_FW_UPDATE_IN_PROGRESS, + MOCK_WAITING_FOR_ACTIVATION +] + + +def get_bin_path(self, arg, required=False): + """Mock AnsibleModule.get_bin_path""" + return arg + + +def get_exception_message(ansible_exit_json): + """From an AnsibleExitJson exception, get the message string.""" + return ansible_exit_json.exception.args[0]["msg"] + + +def is_changed(ansible_exit_json): + """From an AnsibleExitJson exception, return the value of the changed flag""" + return ansible_exit_json.exception.args[0]["changed"] + + +def mock_simple_update(*args, **kwargs): + return { + "ret": True + } + + +def mocked_url_response(*args, **kwargs): + """Mock to just return a generic string.""" + return "/mockedUrl" + + +def mock_update_url(*args, **kwargs): + """Mock of the update url""" + return "/UpdateService" + + +def mock_fw_activate_url(*args, **kwargs): + """Mock of the FW Activate URL""" + return "/UpdateService.FWActivate" + + +def empty_return(*args, **kwargs): + """Mock to just return an empty successful return.""" + return {"ret": True} + + +def mock_get_simple_update_status_ready_for_fw_update(*args, **kwargs): + """Mock to return simple update status Ready for FW update""" + return MOCK_READY_FOR_FW_UPDATE + + +def mock_get_request_enclosure_single_tenant(*args, **kwargs): + """Mock for get_request for single-tenant enclosure.""" + if args[1].endswith("/redfish/v1") or args[1].endswith("/redfish/v1/"): + return MOCK_SUCCESSFUL_RESPONSE_WITH_UPDATE_SERVICE_RESOURCE + elif args[1].endswith("/mockedUrl"): + return MOCK_SUCCESSFUL_HTTP_EMPTY_RESPONSE + elif args[1].endswith("Chassis/Enclosure"): + return MOCK_GET_ENCLOSURE_RESPONSE_SINGLE_TENANT + elif args[1].endswith("/UpdateService"): + return MOCK_SUCCESSFUL_RESPONSE_WITH_SIMPLE_UPDATE_AND_FW_ACTIVATE + else: + raise RuntimeError("Illegal call to get_request in test: " + args[1]) + + +def mock_get_request_enclosure_multi_tenant(*args, **kwargs): + """Mock for get_request with multi-tenant enclosure.""" + if args[1].endswith("/redfish/v1") or args[1].endswith("/redfish/v1/"): + return MOCK_SUCCESSFUL_RESPONSE_WITH_UPDATE_SERVICE_RESOURCE + elif args[1].endswith("/mockedUrl"): + return MOCK_SUCCESSFUL_HTTP_EMPTY_RESPONSE + elif args[1].endswith("Chassis/Enclosure"): + return MOCK_GET_ENCLOSURE_RESPONSE_MULTI_TENANT + elif args[1].endswith("/UpdateService"): + return MOCK_SUCCESSFUL_RESPONSE_WITH_SIMPLE_UPDATE_AND_FW_ACTIVATE + elif args[1].endswith("/IOModuleAFRU"): + return MOCK_GET_IOM_A_MULTI_TENANT + elif args[1].endswith("/IOModuleBFRU"): + return MOCK_GET_IOM_B_MULTI_TENANAT + else: + raise RuntimeError("Illegal call to get_request in test: " + args[1]) + + +def mock_get_request(*args, **kwargs): + """Mock for get_request for simple resource tests.""" + if args[1].endswith("/redfish/v1") or args[1].endswith("/redfish/v1/"): + return MOCK_SUCCESSFUL_RESPONSE_WITH_UPDATE_SERVICE_RESOURCE + elif args[1].endswith("/Chassis"): + return MOCK_SUCCESSFUL_RESPONSE_CHASSIS + elif args[1].endswith("Chassis/Enclosure"): + return MOCK_SUCCESSFUL_RESPONSE_CHASSIS_ENCLOSURE + else: + raise RuntimeError("Illegal call to get_request in test: " + args[1]) + + +def mock_post_request(*args, **kwargs): + """Mock post_request with successful response.""" + valid_endpoints = [ + "/UpdateService.FWActivate", + "/Chassis.Locate", + "/Chassis.PowerMode", + ] + for endpoint in valid_endpoints: + if args[1].endswith(endpoint): + return { + "ret": True, + "data": ACTION_WAS_SUCCESSFUL_MESSAGE + } + raise RuntimeError("Illegal POST call to: " + args[1]) + + +def mock_get_firmware_inventory_version_1_2_3(*args, **kwargs): + return { + "ret": True, + "entries": [ + { + "Id": "IOModuleA_OOBM", + "Version": "1.2.3" + }, + { + "Id": "IOModuleB_OOBM", + "Version": "1.2.3" + } + ] + } + + +ERROR_MESSAGE_UNABLE_TO_EXTRACT_BUNDLE_VERSION = "Unable to extract bundle version or multi-tenant status from update image tarfile" +ACTION_WAS_SUCCESSFUL_MESSAGE = "Action was successful" + + +class TestWdcRedfishCommand(unittest.TestCase): + + def setUp(self): + self.mock_module_helper = patch.multiple(basic.AnsibleModule, + exit_json=exit_json, + fail_json=fail_json, + get_bin_path=get_bin_path) + self.mock_module_helper.start() + self.addCleanup(self.mock_module_helper.stop) + self.tempdir = tempfile.mkdtemp() + + def tearDown(self): + shutil.rmtree(self.tempdir) + + def test_module_fail_when_required_args_missing(self): + with self.assertRaises(AnsibleFailJson): + set_module_args({}) + module.main() + + def test_module_fail_when_unknown_category(self): + with self.assertRaises(AnsibleFailJson): + set_module_args({ + 'category': 'unknown', + 'command': 'FWActivate', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + 'ioms': [], + }) + module.main() + + def test_module_fail_when_unknown_command(self): + with self.assertRaises(AnsibleFailJson): + set_module_args({ + 'category': 'Update', + 'command': 'unknown', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + 'ioms': [], + }) + module.main() + + def test_module_chassis_power_mode_low(self): + """Test setting chassis power mode to low (happy path).""" + module_args = { + 'category': 'Chassis', + 'command': 'PowerModeLow', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + 'resource_id': 'Enclosure', + 'baseuri': 'example.com' + } + set_module_args(module_args) + with patch.multiple("ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.WdcRedfishUtils", + get_request=mock_get_request, + post_request=mock_post_request): + with self.assertRaises(AnsibleExitJson) as ansible_exit_json: + module.main() + self.assertEqual(ACTION_WAS_SUCCESSFUL_MESSAGE, + get_exception_message(ansible_exit_json)) + self.assertTrue(is_changed(ansible_exit_json)) + + def test_module_chassis_power_mode_normal_when_already_normal(self): + """Test setting chassis power mode to normal when it already is. Verify we get changed=False.""" + module_args = { + 'category': 'Chassis', + 'command': 'PowerModeNormal', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + 'resource_id': 'Enclosure', + 'baseuri': 'example.com' + } + set_module_args(module_args) + with patch.multiple("ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.WdcRedfishUtils", + get_request=mock_get_request): + with self.assertRaises(AnsibleExitJson) as ansible_exit_json: + module.main() + self.assertEqual(ACTION_WAS_SUCCESSFUL_MESSAGE, + get_exception_message(ansible_exit_json)) + self.assertFalse(is_changed(ansible_exit_json)) + + def test_module_chassis_power_mode_invalid_command(self): + """Test that we get an error when issuing an invalid PowerMode command.""" + module_args = { + 'category': 'Chassis', + 'command': 'PowerModeExtraHigh', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + 'resource_id': 'Enclosure', + 'baseuri': 'example.com' + } + set_module_args(module_args) + with patch.multiple("ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.WdcRedfishUtils", + get_request=mock_get_request): + with self.assertRaises(AnsibleFailJson) as ansible_fail_json: + module.main() + expected_error_message = "Invalid Command 'PowerModeExtraHigh'" + self.assertIn(expected_error_message, + get_exception_message(ansible_fail_json)) + + def test_module_enclosure_led_indicator_on(self): + """Test turning on a valid LED indicator (in this case we use the Enclosure resource).""" + module_args = { + 'category': 'Chassis', + 'command': 'IndicatorLedOn', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + "resource_id": "Enclosure", + "baseuri": "example.com" + } + set_module_args(module_args) + + with patch.multiple("ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.WdcRedfishUtils", + get_request=mock_get_request, + post_request=mock_post_request): + with self.assertRaises(AnsibleExitJson) as ansible_exit_json: + module.main() + self.assertEqual(ACTION_WAS_SUCCESSFUL_MESSAGE, + get_exception_message(ansible_exit_json)) + self.assertTrue(is_changed(ansible_exit_json)) + + def test_module_invalid_resource_led_indicator_on(self): + """Test turning LED on for an invalid resource id.""" + module_args = { + 'category': 'Chassis', + 'command': 'IndicatorLedOn', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + "resource_id": "Disk99", + "baseuri": "example.com" + } + set_module_args(module_args) + + with patch.multiple("ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.WdcRedfishUtils", + get_request=mock_get_request, + post_request=mock_post_request): + with self.assertRaises(AnsibleFailJson) as ansible_fail_json: + module.main() + expected_error_message = "Chassis resource Disk99 not found" + self.assertEqual(expected_error_message, + get_exception_message(ansible_fail_json)) + + def test_module_enclosure_led_off_already_off(self): + """Test turning LED indicator off when it's already off. Confirm changed is False and no POST occurs.""" + module_args = { + 'category': 'Chassis', + 'command': 'IndicatorLedOff', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + "resource_id": "Enclosure", + "baseuri": "example.com" + } + set_module_args(module_args) + + with patch.multiple("ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.WdcRedfishUtils", + get_request=mock_get_request): + with self.assertRaises(AnsibleExitJson) as ansible_exit_json: + module.main() + self.assertEqual(ACTION_WAS_SUCCESSFUL_MESSAGE, + get_exception_message(ansible_exit_json)) + self.assertFalse(is_changed(ansible_exit_json)) + + def test_module_fw_activate_first_iom_unavailable(self): + """Test that if the first IOM is not available, the 2nd one is used.""" + ioms = [ + "bad.example.com", + "good.example.com" + ] + module_args = { + 'category': 'Update', + 'command': 'FWActivate', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + 'ioms': ioms + } + set_module_args(module_args) + + def mock_get_request(*args, **kwargs): + """Mock for get_request that will fail on the 'bad' IOM.""" + if "bad.example.com" in args[1]: + return MOCK_URL_ERROR + else: + return mock_get_request_enclosure_single_tenant(*args, **kwargs) + + with patch.multiple(module.WdcRedfishUtils, + _firmware_activate_uri=mock_fw_activate_url, + _update_uri=mock_update_url, + _find_updateservice_resource=empty_return, + _find_updateservice_additional_uris=empty_return, + get_request=mock_get_request, + post_request=mock_post_request): + with self.assertRaises(AnsibleExitJson) as cm: + module.main() + self.assertEqual(ACTION_WAS_SUCCESSFUL_MESSAGE, + get_exception_message(cm)) + + def test_module_fw_activate_pass(self): + """Test the FW Activate command in a passing scenario.""" + # Run the same test twice -- once specifying ioms, and once specifying baseuri. + # Both should work the same way. + uri_specifiers = [ + { + "ioms": ["example1.example.com"] + }, + { + "baseuri": "example1.example.com" + } + ] + for uri_specifier in uri_specifiers: + module_args = { + 'category': 'Update', + 'command': 'FWActivate', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + } + module_args.update(uri_specifier) + set_module_args(module_args) + + with patch.multiple("ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.WdcRedfishUtils", + _firmware_activate_uri=mock_fw_activate_url, + _update_uri=mock_update_url, + _find_updateservice_resource=empty_return, + _find_updateservice_additional_uris=empty_return, + get_request=mock_get_request_enclosure_single_tenant, + post_request=mock_post_request): + with self.assertRaises(AnsibleExitJson) as ansible_exit_json: + module.main() + self.assertEqual(ACTION_WAS_SUCCESSFUL_MESSAGE, + get_exception_message(ansible_exit_json)) + self.assertTrue(is_changed(ansible_exit_json)) + + def test_module_fw_activate_service_does_not_support_fw_activate(self): + """Test FW Activate when it is not supported.""" + expected_error_message = "Service does not support FWActivate" + set_module_args({ + 'category': 'Update', + 'command': 'FWActivate', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + 'ioms': ["example1.example.com"] + }) + + def mock_update_uri_response(*args, **kwargs): + return { + "ret": True, + "data": {} # No Actions + } + + with patch.multiple(module.WdcRedfishUtils, + _firmware_activate_uri=mocked_url_response, + _update_uri=mock_update_url, + _find_updateservice_resource=empty_return, + _find_updateservice_additional_uris=empty_return, + get_request=mock_update_uri_response): + with self.assertRaises(AnsibleFailJson) as cm: + module.main() + self.assertEqual(expected_error_message, + get_exception_message(cm)) + + def test_module_update_and_activate_image_uri_not_http(self): + """Test Update and Activate when URI is not http(s)""" + expected_error_message = "Bundle URI must be HTTP or HTTPS" + set_module_args({ + 'category': 'Update', + 'command': 'UpdateAndActivate', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + 'ioms': ["example1.example.com"], + 'update_image_uri': "ftp://example.com/image" + }) + with patch.multiple(module.WdcRedfishUtils, + _firmware_activate_uri=mocked_url_response, + _update_uri=mock_update_url, + _find_updateservice_resource=empty_return, + _find_updateservice_additional_uris=empty_return): + with self.assertRaises(AnsibleFailJson) as cm: + module.main() + self.assertEqual(expected_error_message, + get_exception_message(cm)) + + def test_module_update_and_activate_target_not_ready_for_fw_update(self): + """Test Update and Activate when target is not in the correct state.""" + mock_status_code = 999 + mock_status_description = "mock status description" + expected_error_message = "Target is not ready for FW update. Current status: {0} ({1})".format( + mock_status_code, + mock_status_description + ) + set_module_args({ + 'category': 'Update', + 'command': 'UpdateAndActivate', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + 'ioms': ["example1.example.com"], + 'update_image_uri': "http://example.com/image" + }) + with patch.object(module.WdcRedfishUtils, "get_simple_update_status") as mock_get_simple_update_status: + mock_get_simple_update_status.return_value = { + "ret": True, + "entries": { + "StatusCode": mock_status_code, + "Description": mock_status_description + } + } + + with patch.multiple(module.WdcRedfishUtils, + _firmware_activate_uri=mocked_url_response, + _update_uri=mock_update_url, + _find_updateservice_resource=empty_return, + _find_updateservice_additional_uris=empty_return): + with self.assertRaises(AnsibleFailJson) as cm: + module.main() + self.assertEqual(expected_error_message, + get_exception_message(cm)) + + def test_module_update_and_activate_bundle_not_a_tarfile(self): + """Test Update and Activate when bundle is not a tarfile""" + mock_filename = os.path.abspath(__file__) + expected_error_message = ERROR_MESSAGE_UNABLE_TO_EXTRACT_BUNDLE_VERSION + set_module_args({ + 'category': 'Update', + 'command': 'UpdateAndActivate', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + 'ioms': ["example1.example.com"], + 'update_image_uri': "http://example.com/image", + "update_creds": { + "username": "image_user", + "password": "image_password" + } + }) + with patch('ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.fetch_file') as mock_fetch_file: + mock_fetch_file.return_value = mock_filename + with patch.multiple(module.WdcRedfishUtils, + get_simple_update_status=mock_get_simple_update_status_ready_for_fw_update, + _firmware_activate_uri=mocked_url_response, + _update_uri=mock_update_url, + _find_updateservice_resource=empty_return, + _find_updateservice_additional_uris=empty_return): + with self.assertRaises(AnsibleFailJson) as cm: + module.main() + self.assertEqual(expected_error_message, + get_exception_message(cm)) + + def test_module_update_and_activate_bundle_contains_no_firmware_version(self): + """Test Update and Activate when bundle contains no firmware version""" + expected_error_message = ERROR_MESSAGE_UNABLE_TO_EXTRACT_BUNDLE_VERSION + set_module_args({ + 'category': 'Update', + 'command': 'UpdateAndActivate', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + 'ioms': ["example1.example.com"], + 'update_image_uri': "http://example.com/image", + "update_creds": { + "username": "image_user", + "password": "image_password" + } + }) + + tar_name = "empty_tarfile{0}.tar".format(uuid.uuid4()) + empty_tarfile = tarfile.open(os.path.join(self.tempdir, tar_name), "w") + empty_tarfile.close() + with patch('ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.fetch_file') as mock_fetch_file: + mock_fetch_file.return_value = os.path.join(self.tempdir, tar_name) + with patch.multiple(module.WdcRedfishUtils, + get_simple_update_status=mock_get_simple_update_status_ready_for_fw_update, + _firmware_activate_uri=mocked_url_response, + _update_uri=mock_update_url, + _find_updateservice_resource=empty_return, + _find_updateservice_additional_uris=empty_return): + with self.assertRaises(AnsibleFailJson) as cm: + module.main() + self.assertEqual(expected_error_message, + get_exception_message(cm)) + + def test_module_update_and_activate_version_already_installed(self): + """Test Update and Activate when the bundle version is already installed""" + mock_firmware_version = "1.2.3" + expected_error_message = ACTION_WAS_SUCCESSFUL_MESSAGE + set_module_args({ + 'category': 'Update', + 'command': 'UpdateAndActivate', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + 'ioms': ["example1.example.com"], + 'update_image_uri': "http://example.com/image", + "update_creds": { + "username": "image_user", + "password": "image_password" + } + }) + + tar_name = self.generate_temp_bundlefile(mock_firmware_version=mock_firmware_version, + is_multi_tenant=False) + with patch('ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.fetch_file') as mock_fetch_file: + mock_fetch_file.return_value = os.path.join(self.tempdir, tar_name) + with patch.multiple(module.WdcRedfishUtils, + get_firmware_inventory=mock_get_firmware_inventory_version_1_2_3, + get_simple_update_status=mock_get_simple_update_status_ready_for_fw_update, + _firmware_activate_uri=mocked_url_response, + _update_uri=mock_update_url, + _find_updateservice_resource=empty_return, + _find_updateservice_additional_uris=empty_return, + get_request=mock_get_request_enclosure_single_tenant): + with self.assertRaises(AnsibleExitJson) as result: + module.main() + self.assertEqual(expected_error_message, + get_exception_message(result)) + self.assertFalse(is_changed(result)) + + def test_module_update_and_activate_version_already_installed_multi_tenant(self): + """Test Update and Activate on multi-tenant when version is already installed""" + mock_firmware_version = "1.2.3" + expected_error_message = ACTION_WAS_SUCCESSFUL_MESSAGE + set_module_args({ + 'category': 'Update', + 'command': 'UpdateAndActivate', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + 'ioms': ["example1.example.com"], + 'update_image_uri': "http://example.com/image", + "update_creds": { + "username": "image_user", + "password": "image_password" + } + }) + + tar_name = self.generate_temp_bundlefile(mock_firmware_version=mock_firmware_version, + is_multi_tenant=True) + with patch('ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.fetch_file') as mock_fetch_file: + mock_fetch_file.return_value = os.path.join(self.tempdir, tar_name) + with patch.multiple(module.WdcRedfishUtils, + get_firmware_inventory=mock_get_firmware_inventory_version_1_2_3, + get_simple_update_status=mock_get_simple_update_status_ready_for_fw_update, + _firmware_activate_uri=mocked_url_response, + _update_uri=mock_update_url, + _find_updateservice_resource=empty_return, + _find_updateservice_additional_uris=empty_return, + get_request=mock_get_request_enclosure_multi_tenant): + with self.assertRaises(AnsibleExitJson) as result: + module.main() + self.assertEqual(expected_error_message, + get_exception_message(result)) + self.assertFalse(is_changed(result)) + + def test_module_update_and_activate_pass(self): + """Test Update and Activate (happy path)""" + mock_firmware_version = "1.2.2" + set_module_args({ + 'category': 'Update', + 'command': 'UpdateAndActivate', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + 'ioms': ["example1.example.com"], + 'update_image_uri': "http://example.com/image", + "update_creds": { + "username": "image_user", + "password": "image_password" + } + }) + + tar_name = self.generate_temp_bundlefile(mock_firmware_version=mock_firmware_version, + is_multi_tenant=False) + + with patch('ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.fetch_file') as mock_fetch_file: + mock_fetch_file.return_value = os.path.join(self.tempdir, tar_name) + with patch.multiple("ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.WdcRedfishUtils", + get_firmware_inventory=mock_get_firmware_inventory_version_1_2_3, + simple_update=mock_simple_update, + _simple_update_status_uri=mocked_url_response, + # _find_updateservice_resource=empty_return, + # _find_updateservice_additional_uris=empty_return, + get_request=mock_get_request_enclosure_single_tenant, + post_request=mock_post_request): + + with patch("ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.WdcRedfishUtils.get_simple_update_status" + ) as mock_get_simple_update_status: + mock_get_simple_update_status.side_effect = MOCK_SIMPLE_UPDATE_STATUS_LIST + with self.assertRaises(AnsibleExitJson) as ansible_exit_json: + module.main() + self.assertTrue(is_changed(ansible_exit_json)) + self.assertEqual(ACTION_WAS_SUCCESSFUL_MESSAGE, get_exception_message(ansible_exit_json)) + + def test_module_update_and_activate_pass_multi_tenant(self): + """Test Update and Activate with multi-tenant (happy path)""" + mock_firmware_version = "1.2.2" + set_module_args({ + 'category': 'Update', + 'command': 'UpdateAndActivate', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + 'ioms': ["example1.example.com"], + 'update_image_uri': "http://example.com/image", + "update_creds": { + "username": "image_user", + "password": "image_password" + } + }) + + tar_name = self.generate_temp_bundlefile(mock_firmware_version=mock_firmware_version, + is_multi_tenant=True) + + with patch('ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.fetch_file') as mock_fetch_file: + mock_fetch_file.return_value = os.path.join(self.tempdir, tar_name) + with patch.multiple(module.WdcRedfishUtils, + get_firmware_inventory=mock_get_firmware_inventory_version_1_2_3, + simple_update=mock_simple_update, + _simple_update_status_uri=mocked_url_response, + # _find_updateservice_resource=empty_return, + # _find_updateservice_additional_uris=empty_return, + get_request=mock_get_request_enclosure_multi_tenant, + post_request=mock_post_request): + with patch("ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.WdcRedfishUtils.get_simple_update_status" + ) as mock_get_simple_update_status: + mock_get_simple_update_status.side_effect = MOCK_SIMPLE_UPDATE_STATUS_LIST + with self.assertRaises(AnsibleExitJson) as ansible_exit_json: + module.main() + self.assertTrue(is_changed(ansible_exit_json)) + self.assertEqual(ACTION_WAS_SUCCESSFUL_MESSAGE, get_exception_message(ansible_exit_json)) + + def test_module_fw_update_multi_tenant_firmware_single_tenant_enclosure(self): + """Test Update and Activate using multi-tenant bundle on single-tenant enclosure""" + mock_firmware_version = "1.1.1" + expected_error_message = "Enclosure multi-tenant is False but bundle multi-tenant is True" + set_module_args({ + 'category': 'Update', + 'command': 'UpdateAndActivate', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + 'ioms': ["example1.example.com"], + 'update_image_uri': "http://example.com/image", + "update_creds": { + "username": "image_user", + "password": "image_password" + } + }) + + tar_name = self.generate_temp_bundlefile(mock_firmware_version=mock_firmware_version, + is_multi_tenant=True) + with patch('ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.fetch_file') as mock_fetch_file: + mock_fetch_file.return_value = os.path.join(self.tempdir, tar_name) + with patch.multiple(module.WdcRedfishUtils, + get_firmware_inventory=mock_get_firmware_inventory_version_1_2_3(), + get_simple_update_status=mock_get_simple_update_status_ready_for_fw_update, + _firmware_activate_uri=mocked_url_response, + _update_uri=mock_update_url, + _find_updateservice_resource=empty_return, + _find_updateservice_additional_uris=empty_return, + get_request=mock_get_request_enclosure_single_tenant): + with self.assertRaises(AnsibleFailJson) as result: + module.main() + self.assertEqual(expected_error_message, + get_exception_message(result)) + + def test_module_fw_update_single_tentant_firmware_multi_tenant_enclosure(self): + """Test Update and Activate using singe-tenant bundle on multi-tenant enclosure""" + mock_firmware_version = "1.1.1" + expected_error_message = "Enclosure multi-tenant is True but bundle multi-tenant is False" + set_module_args({ + 'category': 'Update', + 'command': 'UpdateAndActivate', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + 'ioms': ["example1.example.com"], + 'update_image_uri': "http://example.com/image", + "update_creds": { + "username": "image_user", + "password": "image_password" + } + }) + + tar_name = self.generate_temp_bundlefile(mock_firmware_version=mock_firmware_version, + is_multi_tenant=False) + with patch('ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.fetch_file') as mock_fetch_file: + mock_fetch_file.return_value = os.path.join(self.tempdir, tar_name) + with patch.multiple(module.WdcRedfishUtils, + get_firmware_inventory=mock_get_firmware_inventory_version_1_2_3(), + get_simple_update_status=mock_get_simple_update_status_ready_for_fw_update, + _firmware_activate_uri=mocked_url_response, + _update_uri=mock_update_url, + _find_updateservice_resource=empty_return, + _find_updateservice_additional_uris=empty_return, + get_request=mock_get_request_enclosure_multi_tenant): + with self.assertRaises(AnsibleFailJson) as result: + module.main() + self.assertEqual(expected_error_message, + get_exception_message(result)) + + def generate_temp_bundlefile(self, + mock_firmware_version, + is_multi_tenant): + """Generate a temporary fake bundle file. + + :param str mock_firmware_version: The simulated firmware version for the bundle. + :param bool is_multi_tenant: Is the simulated bundle multi-tenant? + + This can be used for a mock FW update. + """ + tar_name = "tarfile{0}.tar".format(uuid.uuid4()) + + bundle_tarfile = tarfile.open(os.path.join(self.tempdir, tar_name), "w") + package_filename = "oobm-{0}.pkg".format(mock_firmware_version) + package_filename_path = os.path.join(self.tempdir, package_filename) + package_file = open(package_filename_path, "w") + package_file.close() + bundle_tarfile.add(os.path.join(self.tempdir, package_filename), arcname=package_filename) + bin_filename = "firmware.bin" + bin_filename_path = os.path.join(self.tempdir, bin_filename) + bin_file = open(bin_filename_path, "wb") + byte_to_write = b'\x80' if is_multi_tenant else b'\xFF' + bin_file.write(byte_to_write * 12) + bin_file.close() + for filename in [package_filename, bin_filename]: + bundle_tarfile.add(os.path.join(self.tempdir, filename), arcname=filename) + bundle_tarfile.close() + return tar_name diff --git a/tests/unit/plugins/modules/remote_management/wdc/test_wdc_redfish_info.py b/tests/unit/plugins/modules/remote_management/wdc/test_wdc_redfish_info.py new file mode 100644 index 0000000000..c9b7cf8a7f --- /dev/null +++ b/tests/unit/plugins/modules/remote_management/wdc/test_wdc_redfish_info.py @@ -0,0 +1,216 @@ +# -*- 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 + +from ansible_collections.community.general.tests.unit.compat.mock import patch +from ansible_collections.community.general.tests.unit.compat import unittest +from ansible.module_utils import basic +import ansible_collections.community.general.plugins.modules.remote_management.redfish.wdc_redfish_info as module +from ansible_collections.community.general.tests.unit.plugins.modules.utils import AnsibleExitJson, AnsibleFailJson +from ansible_collections.community.general.tests.unit.plugins.modules.utils import set_module_args, exit_json, fail_json + +MOCK_SUCCESSFUL_RESPONSE_WITH_ACTIONS = { + "ret": True, + "data": { + "Actions": {} + } +} + +MOCK_SUCCESSFUL_HTTP_EMPTY_RESPONSE = { + "ret": True, + "data": { + } +} + +MOCK_SUCCESSFUL_RESPONSE_WITH_UPDATE_SERVICE_RESOURCE = { + "ret": True, + "data": { + "UpdateService": { + "@odata.id": "/UpdateService" + } + } +} + +MOCK_SUCCESSFUL_RESPONSE_WITH_SIMPLE_UPDATE_BUT_NO_FW_ACTIVATE = { + "ret": True, + "data": { + "Actions": { + "#UpdateService.SimpleUpdate": { + "target": "mocked value" + }, + "Oem": { + "WDC": {} # No #UpdateService.FWActivate + } + } + } +} + + +def get_bin_path(self, arg, required=False): + """Mock AnsibleModule.get_bin_path""" + return arg + + +def get_redfish_facts(ansible_exit_json): + """From an AnsibleExitJson exception, get the redfish facts dict.""" + return ansible_exit_json.exception.args[0]["redfish_facts"] + + +def get_exception_message(ansible_exit_json): + """From an AnsibleExitJson exception, get the message string.""" + return ansible_exit_json.exception.args[0]["msg"] + + +class TestWdcRedfishInfo(unittest.TestCase): + + def setUp(self): + self.mock_module_helper = patch.multiple(basic.AnsibleModule, + exit_json=exit_json, + fail_json=fail_json, + get_bin_path=get_bin_path) + self.mock_module_helper.start() + self.addCleanup(self.mock_module_helper.stop) + + def test_module_fail_when_required_args_missing(self): + with self.assertRaises(AnsibleFailJson): + set_module_args({}) + module.main() + + def test_module_fail_when_unknown_category(self): + with self.assertRaises(AnsibleFailJson): + set_module_args({ + 'category': 'unknown', + 'command': 'SimpleUpdateStatus', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + 'ioms': [], + }) + module.main() + + def test_module_fail_when_unknown_command(self): + with self.assertRaises(AnsibleFailJson): + set_module_args({ + 'category': 'Update', + 'command': 'unknown', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + 'ioms': [], + }) + module.main() + + def test_module_simple_update_status_pass(self): + set_module_args({ + 'category': 'Update', + 'command': 'SimpleUpdateStatus', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + 'ioms': ["example1.example.com"], + }) + + def mock_simple_update_status(*args, **kwargs): + return { + "ret": True, + "data": { + "Description": "Ready for FW update", + "ErrorCode": 0, + "EstimatedRemainingMinutes": 0, + "StatusCode": 0 + } + } + + def mocked_string_response(*args, **kwargs): + return "mockedUrl" + + def empty_return(*args, **kwargs): + return {"ret": True} + + with patch.multiple(module.WdcRedfishUtils, + _simple_update_status_uri=mocked_string_response, + _find_updateservice_resource=empty_return, + _find_updateservice_additional_uris=empty_return, + get_request=mock_simple_update_status): + with self.assertRaises(AnsibleExitJson) as ansible_exit_json: + module.main() + redfish_facts = get_redfish_facts(ansible_exit_json) + self.assertEqual(mock_simple_update_status()["data"], + redfish_facts["simple_update_status"]["entries"]) + + def test_module_simple_update_status_updateservice_resource_not_found(self): + set_module_args({ + 'category': 'Update', + 'command': 'SimpleUpdateStatus', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + 'ioms': ["example1.example.com"], + }) + with patch.object(module.WdcRedfishUtils, 'get_request') as mock_get_request: + mock_get_request.return_value = { + "ret": True, + "data": {} # Missing UpdateService property + } + with self.assertRaises(AnsibleFailJson) as ansible_exit_json: + module.main() + self.assertEqual("UpdateService resource not found", + get_exception_message(ansible_exit_json)) + + def test_module_simple_update_status_service_does_not_support_simple_update(self): + set_module_args({ + 'category': 'Update', + 'command': 'SimpleUpdateStatus', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + 'ioms': ["example1.example.com"], + }) + + def mock_get_request_function(uri): + mock_url_string = "mockURL" + if mock_url_string in uri: + return { + "ret": True, + "data": { + "Actions": { # No #UpdateService.SimpleUpdate + } + } + } + else: + return { + "ret": True, + "data": mock_url_string + } + + with patch.object(module.WdcRedfishUtils, 'get_request') as mock_get_request: + mock_get_request.side_effect = mock_get_request_function + with self.assertRaises(AnsibleFailJson) as ansible_exit_json: + module.main() + self.assertEqual("UpdateService resource not found", + get_exception_message(ansible_exit_json)) + + def test_module_simple_update_status_service_does_not_support_fw_activate(self): + set_module_args({ + 'category': 'Update', + 'command': 'SimpleUpdateStatus', + 'username': 'USERID', + 'password': 'PASSW0RD=21', + 'ioms': ["example1.example.com"], + }) + + def mock_get_request_function(uri): + if uri.endswith("/redfish/v1") or uri.endswith("/redfish/v1/"): + return MOCK_SUCCESSFUL_RESPONSE_WITH_UPDATE_SERVICE_RESOURCE + elif uri.endswith("/mockedUrl"): + return MOCK_SUCCESSFUL_HTTP_EMPTY_RESPONSE + elif uri.endswith("/UpdateService"): + return MOCK_SUCCESSFUL_RESPONSE_WITH_SIMPLE_UPDATE_BUT_NO_FW_ACTIVATE + else: + raise RuntimeError("Illegal call to get_request in test: " + uri) + + with patch("ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils.WdcRedfishUtils.get_request") as mock_get_request: + mock_get_request.side_effect = mock_get_request_function + with self.assertRaises(AnsibleFailJson) as ansible_exit_json: + module.main() + self.assertEqual("Service does not support FWActivate", + get_exception_message(ansible_exit_json)) diff --git a/tests/unit/plugins/modules/source_control/__init__.py b/tests/unit/plugins/modules/source_control/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/source_control/bitbucket/__init__.py b/tests/unit/plugins/modules/source_control/bitbucket/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_access_key.py b/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_access_key.py index f92ec8e16d..4c53cd8246 100644 --- a/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_access_key.py +++ b/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_access_key.py @@ -1,4 +1,6 @@ -# 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/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_pipeline_key_pair.py b/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_pipeline_key_pair.py index 50dda90258..8b370a10ed 100644 --- a/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_pipeline_key_pair.py +++ b/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_pipeline_key_pair.py @@ -1,4 +1,6 @@ -# 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/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_pipeline_known_host.py b/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_pipeline_known_host.py index 199ec0b96a..faf8ca009a 100644 --- a/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_pipeline_known_host.py +++ b/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_pipeline_known_host.py @@ -1,4 +1,6 @@ -# 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/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_pipeline_variable.py b/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_pipeline_variable.py index df085fb237..ad9ec58044 100644 --- a/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_pipeline_variable.py +++ b/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_pipeline_variable.py @@ -1,4 +1,6 @@ -# 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/tests/unit/plugins/modules/source_control/github/__init__.py b/tests/unit/plugins/modules/source_control/github/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/source_control/github/test_github_repo.py b/tests/unit/plugins/modules/source_control/github/test_github_repo.py index 9c6a7037d1..2f494f7957 100644 --- a/tests/unit/plugins/modules/source_control/github/test_github_repo.py +++ b/tests/unit/plugins/modules/source_control/github/test_github_repo.py @@ -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 + from __future__ import (absolute_import, division, print_function) __metaclass__ = type diff --git a/tests/unit/plugins/modules/source_control/gitlab/__init__.py b/tests/unit/plugins/modules/source_control/gitlab/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/source_control/gitlab/gitlab.py b/tests/unit/plugins/modules/source_control/gitlab/gitlab.py index 5c39c9afaf..13fc35f899 100644 --- a/tests/unit/plugins/modules/source_control/gitlab/gitlab.py +++ b/tests/unit/plugins/modules/source_control/gitlab/gitlab.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- -# Copyright: (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr) -# 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) +# 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/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_deploy_key.py b/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_deploy_key.py index 194790cbb7..c0e91dbaf9 100644 --- a/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_deploy_key.py +++ b/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_deploy_key.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- -# Copyright: (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr) -# 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) +# 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/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_group.py b/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_group.py index 1b07f80510..2dc341d7a7 100644 --- a/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_group.py +++ b/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_group.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- -# Copyright: (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr) -# 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) +# 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/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_hook.py b/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_hook.py index 8d38317126..e3bf124b1a 100644 --- a/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_hook.py +++ b/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_hook.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- -# Copyright: (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr) -# 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) +# 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/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_project.py b/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_project.py index 898bd38b11..c462f5d2cd 100644 --- a/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_project.py +++ b/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_project.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- -# Copyright: (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr) -# 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) +# 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/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_protected_branch.py b/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_protected_branch.py index 65a29c61ce..16222a8f33 100644 --- a/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_protected_branch.py +++ b/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_protected_branch.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- -# Copyright: (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr) -# 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) +# 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/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_runner.py b/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_runner.py index d86e27493d..efccaa6b47 100644 --- a/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_runner.py +++ b/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_runner.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- -# Copyright: (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr) -# 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) +# 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/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_user.py b/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_user.py index 8e439befda..0d7e184bf0 100644 --- a/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_user.py +++ b/tests/unit/plugins/modules/source_control/gitlab/test_gitlab_user.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- -# Copyright: (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr) -# 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) +# 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/tests/unit/plugins/modules/storage/__init__.py b/tests/unit/plugins/modules/storage/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/storage/hpe3par/__init__.py b/tests/unit/plugins/modules/storage/hpe3par/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/storage/hpe3par/test_ss_3par_cpg.py b/tests/unit/plugins/modules/storage/hpe3par/test_ss_3par_cpg.py index 8e32e150c7..791ba6aa7b 100644 --- a/tests/unit/plugins/modules/storage/hpe3par/test_ss_3par_cpg.py +++ b/tests/unit/plugins/modules/storage/hpe3par/test_ss_3par_cpg.py @@ -1,5 +1,6 @@ -# 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/tests/unit/plugins/modules/storage/pmem/test_pmem.py b/tests/unit/plugins/modules/storage/pmem/test_pmem.py index b3d072080b..116ace745b 100644 --- a/tests/unit/plugins/modules/storage/pmem/test_pmem.py +++ b/tests/unit/plugins/modules/storage/pmem/test_pmem.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # Copyright (c) 2022, Masayoshi Mizuma -# 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 @@ -314,9 +315,9 @@ class TestPmem(ModuleTestCase): test_result = result.exception.args[0]['result'] expected = json.loads(namespace) - for i, notuse in enumerate(test_result): - self.assertEqual(test_result[i]['dev'], expected[i]['dev']) - self.assertEqual(test_result[i]['size'], expected[i]['size']) + for i, result in enumerate(test_result): + self.assertEqual(result['dev'], expected[i]['dev']) + self.assertEqual(result['size'], expected[i]['size']) def test_fail_when_required_args_missing(self): with self.assertRaises(AnsibleFailJson): diff --git a/tests/unit/plugins/modules/system/__init__.py b/tests/unit/plugins/modules/system/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/system/interfaces_file/README.md b/tests/unit/plugins/modules/system/interfaces_file/README.md index a10c659db0..b0c22f3dc3 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/README.md +++ b/tests/unit/plugins/modules/system/interfaces_file/README.md @@ -1,9 +1,15 @@ + + # interfaces_file unit tests ## Tests structure - `input` directory contains interfaces configuration files -- `test_interfaces_file.py` runs each hardcoded test agains all configurations in `input` directory and compares results with golden outputs in `golden_output` +- `test_interfaces_file.py` runs each hardcoded test against all configurations in `input` directory and compares results with golden outputs in `golden_output` ## Running unit tests with docker diff --git a/tests/unit/plugins/modules/system/interfaces_file/__init__.py b/tests/unit/plugins/modules/system/interfaces_file/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/__init__.py b/tests/unit/plugins/modules/system/interfaces_file/fixtures/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family.test_no_changes.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family.test_no_changes.json index ee632bd542..8903ee647c 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family.test_no_changes.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family.test_no_changes.json @@ -18,4 +18,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family.test_no_changes.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family.test_no_changes.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family.test_no_changes.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family.test_no_changes.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family.test_no_changes.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family.test_no_changes.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up.exceptions.txt index 8d223b041b..bb6a333ab0 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up.exceptions.txt @@ -5,4 +5,4 @@ options: "option": "up", "state": "present", "value": "route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up.json index ee632bd542..8903ee647c 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up.json @@ -18,4 +18,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up_twice.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up_twice.exceptions.txt index a90dd1cafa..f1bdb5fd13 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up_twice.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up_twice.exceptions.txt @@ -14,4 +14,4 @@ options: "option": "up", "state": "present", "value": "route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up_twice.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up_twice.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up_twice.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up_twice.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up_twice.json index ee632bd542..8903ee647c 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up_twice.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up_twice.json @@ -18,4 +18,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up_twice.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up_twice.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up_twice.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up_twice.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up_twice.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_aggi_up_twice.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_and_delete_aggi_up.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_and_delete_aggi_up.exceptions.txt index 1c9adbd9fc..53c9acd13b 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_and_delete_aggi_up.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_and_delete_aggi_up.exceptions.txt @@ -14,4 +14,4 @@ options: "option": "up", "state": "absent", "value": null -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_and_delete_aggi_up.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_and_delete_aggi_up.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_and_delete_aggi_up.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_and_delete_aggi_up.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_and_delete_aggi_up.json index ee632bd542..8903ee647c 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_and_delete_aggi_up.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_and_delete_aggi_up.json @@ -18,4 +18,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_and_delete_aggi_up.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_and_delete_aggi_up.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_and_delete_aggi_up.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_and_delete_aggi_up.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_and_delete_aggi_up.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_add_and_delete_aggi_up.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_aggi_remove_dup.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_aggi_remove_dup.exceptions.txt index 7e1aa336c2..122f18652b 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_aggi_remove_dup.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_aggi_remove_dup.exceptions.txt @@ -14,4 +14,4 @@ options: "option": "up", "state": "present", "value": "route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_aggi_remove_dup.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_aggi_remove_dup.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_aggi_remove_dup.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_aggi_remove_dup.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_aggi_remove_dup.json index ee632bd542..8903ee647c 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_aggi_remove_dup.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_aggi_remove_dup.json @@ -18,4 +18,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_aggi_remove_dup.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_aggi_remove_dup.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_aggi_remove_dup.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_aggi_remove_dup.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_aggi_remove_dup.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_aggi_remove_dup.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4.json index ee632bd542..8903ee647c 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4.json @@ -18,4 +18,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4_post_up.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4_post_up.json index ee632bd542..8903ee647c 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4_post_up.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4_post_up.json @@ -18,4 +18,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4_post_up.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4_post_up.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4_post_up.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4_post_up.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4_post_up.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4_post_up.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4_pre_up.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4_pre_up.json index ee632bd542..8903ee647c 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4_pre_up.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4_pre_up.json @@ -18,4 +18,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4_pre_up.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4_pre_up.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4_pre_up.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4_pre_up.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4_pre_up.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv4_pre_up.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6.json index ee632bd542..8903ee647c 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6.json @@ -18,4 +18,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6_post_up.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6_post_up.json index ee632bd542..8903ee647c 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6_post_up.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6_post_up.json @@ -18,4 +18,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6_post_up.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6_post_up.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6_post_up.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6_post_up.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6_post_up.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6_post_up.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6_pre_up.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6_pre_up.json index ee632bd542..8903ee647c 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6_pre_up.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6_pre_up.json @@ -18,4 +18,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6_pre_up.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6_pre_up.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6_pre_up.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6_pre_up.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6_pre_up.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_ipv6_pre_up.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_method.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_method.exceptions.txt index 050a983971..6e0ba79f38 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_method.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_method.exceptions.txt @@ -5,4 +5,4 @@ options: "option": "method", "state": "present", "value": "dhcp" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_method.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_method.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_method.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_method.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_method.json index ee632bd542..8903ee647c 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_method.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_method.json @@ -18,4 +18,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_method.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_method.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_method.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_method.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_method.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_change_method.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_revert.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_revert.json index ee632bd542..8903ee647c 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_revert.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_revert.json @@ -18,4 +18,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_revert.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_revert.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_revert.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_revert.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_revert.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_revert.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_and_eth0_mtu.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_and_eth0_mtu.exceptions.txt index 3f0da8b1c7..8b9c5a14b2 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_and_eth0_mtu.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_and_eth0_mtu.exceptions.txt @@ -5,4 +5,4 @@ options: "option": "mtu", "state": "present", "value": "1350" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_and_eth0_mtu.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_and_eth0_mtu.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_and_eth0_mtu.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_and_eth0_mtu.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_and_eth0_mtu.json index ee632bd542..8903ee647c 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_and_eth0_mtu.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_and_eth0_mtu.json @@ -18,4 +18,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_and_eth0_mtu.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_and_eth0_mtu.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_and_eth0_mtu.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_and_eth0_mtu.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_and_eth0_mtu.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_and_eth0_mtu.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_slaves.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_slaves.exceptions.txt index 0af87750b7..a6ce9ad69d 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_slaves.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_slaves.exceptions.txt @@ -5,4 +5,4 @@ options: "option": "slaves", "state": "present", "value": "int1 int3" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_slaves.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_slaves.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_slaves.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_slaves.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_slaves.json index ee632bd542..8903ee647c 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_slaves.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_slaves.json @@ -18,4 +18,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_slaves.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_slaves.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_slaves.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_slaves.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_slaves.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/address_family_set_aggi_slaves.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp.test_no_changes.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp.test_no_changes.json index bffc17a989..782b4d0fb4 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp.test_no_changes.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp.test_no_changes.json @@ -15,4 +15,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp.test_no_changes.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp.test_no_changes.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp.test_no_changes.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp.test_no_changes.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp.test_no_changes.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp.test_no_changes.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up.exceptions.txt index 8d223b041b..bb6a333ab0 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up.exceptions.txt @@ -5,4 +5,4 @@ options: "option": "up", "state": "present", "value": "route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up.json index bffc17a989..782b4d0fb4 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up.json @@ -15,4 +15,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up_twice.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up_twice.exceptions.txt index a90dd1cafa..f1bdb5fd13 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up_twice.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up_twice.exceptions.txt @@ -14,4 +14,4 @@ options: "option": "up", "state": "present", "value": "route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up_twice.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up_twice.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up_twice.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up_twice.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up_twice.json index bffc17a989..782b4d0fb4 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up_twice.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up_twice.json @@ -15,4 +15,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up_twice.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up_twice.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up_twice.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up_twice.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up_twice.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_aggi_up_twice.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_and_delete_aggi_up.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_and_delete_aggi_up.exceptions.txt index 1c9adbd9fc..53c9acd13b 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_and_delete_aggi_up.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_and_delete_aggi_up.exceptions.txt @@ -14,4 +14,4 @@ options: "option": "up", "state": "absent", "value": null -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_and_delete_aggi_up.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_and_delete_aggi_up.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_and_delete_aggi_up.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_and_delete_aggi_up.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_and_delete_aggi_up.json index bffc17a989..782b4d0fb4 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_and_delete_aggi_up.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_and_delete_aggi_up.json @@ -15,4 +15,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_and_delete_aggi_up.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_and_delete_aggi_up.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_and_delete_aggi_up.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_and_delete_aggi_up.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_and_delete_aggi_up.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_add_and_delete_aggi_up.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_aggi_remove_dup.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_aggi_remove_dup.exceptions.txt index 7e1aa336c2..122f18652b 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_aggi_remove_dup.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_aggi_remove_dup.exceptions.txt @@ -14,4 +14,4 @@ options: "option": "up", "state": "present", "value": "route add -net 224.0.0.0 netmask 240.0.0.0 dev aggi" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_aggi_remove_dup.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_aggi_remove_dup.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_aggi_remove_dup.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_aggi_remove_dup.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_aggi_remove_dup.json index bffc17a989..782b4d0fb4 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_aggi_remove_dup.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_aggi_remove_dup.json @@ -15,4 +15,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_aggi_remove_dup.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_aggi_remove_dup.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_aggi_remove_dup.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_aggi_remove_dup.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_aggi_remove_dup.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_aggi_remove_dup.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4.json index bffc17a989..782b4d0fb4 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4.json @@ -15,4 +15,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4_post_up.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4_post_up.json index bffc17a989..782b4d0fb4 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4_post_up.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4_post_up.json @@ -15,4 +15,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4_post_up.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4_post_up.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4_post_up.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4_post_up.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4_post_up.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4_post_up.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4_pre_up.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4_pre_up.json index bffc17a989..782b4d0fb4 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4_pre_up.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4_pre_up.json @@ -15,4 +15,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4_pre_up.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4_pre_up.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4_pre_up.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4_pre_up.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4_pre_up.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv4_pre_up.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6.exceptions.txt index 04c2089186..0150522757 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6.exceptions.txt @@ -6,4 +6,4 @@ options: "option": "address", "state": "present", "value": "fc00::42" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6.json index bffc17a989..782b4d0fb4 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6.json @@ -15,4 +15,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_post_up.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_post_up.exceptions.txt index 48cb29b0aa..2a73a2b777 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_post_up.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_post_up.exceptions.txt @@ -6,4 +6,4 @@ options: "option": "post-up", "state": "present", "value": "XXXX_ipv6" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_post_up.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_post_up.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_post_up.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_post_up.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_post_up.json index bffc17a989..782b4d0fb4 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_post_up.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_post_up.json @@ -15,4 +15,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_post_up.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_post_up.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_post_up.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_post_up.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_post_up.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_post_up.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_pre_up.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_pre_up.exceptions.txt index fbfed6be37..262ffe9f34 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_pre_up.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_pre_up.exceptions.txt @@ -6,4 +6,4 @@ options: "option": "pre-up", "state": "present", "value": "XXXX_ipv6" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_pre_up.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_pre_up.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_pre_up.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_pre_up.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_pre_up.json index bffc17a989..782b4d0fb4 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_pre_up.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_pre_up.json @@ -15,4 +15,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_pre_up.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_pre_up.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_pre_up.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_pre_up.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_pre_up.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_ipv6_pre_up.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_method.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_method.exceptions.txt index 050a983971..6e0ba79f38 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_method.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_method.exceptions.txt @@ -5,4 +5,4 @@ options: "option": "method", "state": "present", "value": "dhcp" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_method.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_method.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_method.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_method.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_method.json index bffc17a989..782b4d0fb4 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_method.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_method.json @@ -15,4 +15,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_method.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_method.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_method.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_method.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_method.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_change_method.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_revert.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_revert.json index bffc17a989..782b4d0fb4 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_revert.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_revert.json @@ -15,4 +15,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_revert.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_revert.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_revert.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_revert.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_revert.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_revert.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_and_eth0_mtu.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_and_eth0_mtu.exceptions.txt index 3f0da8b1c7..8b9c5a14b2 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_and_eth0_mtu.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_and_eth0_mtu.exceptions.txt @@ -5,4 +5,4 @@ options: "option": "mtu", "state": "present", "value": "1350" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_and_eth0_mtu.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_and_eth0_mtu.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_and_eth0_mtu.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_and_eth0_mtu.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_and_eth0_mtu.json index bffc17a989..782b4d0fb4 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_and_eth0_mtu.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_and_eth0_mtu.json @@ -15,4 +15,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_and_eth0_mtu.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_and_eth0_mtu.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_and_eth0_mtu.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_and_eth0_mtu.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_and_eth0_mtu.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_and_eth0_mtu.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_slaves.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_slaves.exceptions.txt index 0af87750b7..a6ce9ad69d 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_slaves.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_slaves.exceptions.txt @@ -5,4 +5,4 @@ options: "option": "slaves", "state": "present", "value": "int1 int3" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_slaves.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_slaves.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_slaves.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_slaves.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_slaves.json index bffc17a989..782b4d0fb4 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_slaves.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_slaves.json @@ -15,4 +15,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_slaves.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_slaves.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_slaves.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_slaves.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_slaves.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/default_dhcp_set_aggi_slaves.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com.test_no_changes.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com.test_no_changes.json index 9e97da32aa..c854211970 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com.test_no_changes.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com.test_no_changes.json @@ -106,4 +106,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com.test_no_changes.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com.test_no_changes.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com.test_no_changes.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com.test_no_changes.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com.test_no_changes.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com.test_no_changes.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_aggi_up.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_aggi_up.json index 9e97da32aa..c854211970 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_aggi_up.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_aggi_up.json @@ -106,4 +106,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_aggi_up.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_aggi_up.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_aggi_up.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_aggi_up.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_aggi_up.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_aggi_up.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_aggi_up_twice.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_aggi_up_twice.json index 9e97da32aa..c854211970 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_aggi_up_twice.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_aggi_up_twice.json @@ -106,4 +106,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_aggi_up_twice.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_aggi_up_twice.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_aggi_up_twice.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_aggi_up_twice.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_aggi_up_twice.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_aggi_up_twice.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_and_delete_aggi_up.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_and_delete_aggi_up.json index 9e97da32aa..c854211970 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_and_delete_aggi_up.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_and_delete_aggi_up.json @@ -106,4 +106,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_and_delete_aggi_up.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_and_delete_aggi_up.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_and_delete_aggi_up.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_and_delete_aggi_up.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_and_delete_aggi_up.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_add_and_delete_aggi_up.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_aggi_remove_dup.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_aggi_remove_dup.json index 9e97da32aa..c854211970 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_aggi_remove_dup.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_aggi_remove_dup.json @@ -106,4 +106,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_aggi_remove_dup.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_aggi_remove_dup.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_aggi_remove_dup.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_aggi_remove_dup.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_aggi_remove_dup.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_aggi_remove_dup.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4.exceptions.txt index a1600d9a67..bab7cce06e 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4.exceptions.txt @@ -6,4 +6,4 @@ options: "option": "address", "state": "present", "value": "192.168.0.42" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4.json index 9e97da32aa..c854211970 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4.json @@ -106,4 +106,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_post_up.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_post_up.exceptions.txt index e1e0152320..d1ce159755 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_post_up.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_post_up.exceptions.txt @@ -6,4 +6,4 @@ options: "option": "post-up", "state": "present", "value": "XXXX_ipv4" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_post_up.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_post_up.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_post_up.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_post_up.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_post_up.json index 9e97da32aa..c854211970 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_post_up.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_post_up.json @@ -106,4 +106,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_post_up.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_post_up.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_post_up.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_post_up.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_post_up.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_post_up.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_pre_up.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_pre_up.exceptions.txt index 9e510654c2..8a439db4c0 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_pre_up.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_pre_up.exceptions.txt @@ -6,4 +6,4 @@ options: "option": "pre-up", "state": "present", "value": "XXXX_ipv4" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_pre_up.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_pre_up.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_pre_up.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_pre_up.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_pre_up.json index 9e97da32aa..c854211970 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_pre_up.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_pre_up.json @@ -106,4 +106,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_pre_up.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_pre_up.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_pre_up.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_pre_up.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_pre_up.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv4_pre_up.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6.exceptions.txt index 04c2089186..0150522757 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6.exceptions.txt @@ -6,4 +6,4 @@ options: "option": "address", "state": "present", "value": "fc00::42" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6.json index 9e97da32aa..c854211970 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6.json @@ -106,4 +106,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_post_up.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_post_up.exceptions.txt index 48cb29b0aa..2a73a2b777 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_post_up.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_post_up.exceptions.txt @@ -6,4 +6,4 @@ options: "option": "post-up", "state": "present", "value": "XXXX_ipv6" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_post_up.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_post_up.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_post_up.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_post_up.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_post_up.json index 9e97da32aa..c854211970 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_post_up.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_post_up.json @@ -106,4 +106,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_post_up.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_post_up.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_post_up.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_post_up.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_post_up.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_post_up.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_pre_up.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_pre_up.exceptions.txt index fbfed6be37..262ffe9f34 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_pre_up.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_pre_up.exceptions.txt @@ -6,4 +6,4 @@ options: "option": "pre-up", "state": "present", "value": "XXXX_ipv6" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_pre_up.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_pre_up.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_pre_up.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_pre_up.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_pre_up.json index 9e97da32aa..c854211970 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_pre_up.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_pre_up.json @@ -106,4 +106,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_pre_up.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_pre_up.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_pre_up.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_pre_up.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_pre_up.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_ipv6_pre_up.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_method.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_method.json index 8e9863b2ea..6df01a42ff 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_method.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_method.json @@ -106,4 +106,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_method.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_method.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_method.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_method.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_method.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_change_method.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_revert.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_revert.exceptions.txt index fddf3b3b0a..57f3fe6f76 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_revert.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_revert.exceptions.txt @@ -5,4 +5,4 @@ options: "option": "mtu", "state": "absent", "value": "1350" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_revert.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_revert.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_revert.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_revert.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_revert.json index 9e97da32aa..c854211970 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_revert.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_revert.json @@ -106,4 +106,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_revert.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_revert.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_revert.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_revert.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_revert.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_revert.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_and_eth0_mtu.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_and_eth0_mtu.exceptions.txt index 764c9cb016..007dd44446 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_and_eth0_mtu.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_and_eth0_mtu.exceptions.txt @@ -5,4 +5,4 @@ options: "option": "mtu", "state": "present", "value": "1350" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_and_eth0_mtu.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_and_eth0_mtu.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_and_eth0_mtu.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_and_eth0_mtu.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_and_eth0_mtu.json index 9e97da32aa..c854211970 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_and_eth0_mtu.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_and_eth0_mtu.json @@ -106,4 +106,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_and_eth0_mtu.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_and_eth0_mtu.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_and_eth0_mtu.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_and_eth0_mtu.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_and_eth0_mtu.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_and_eth0_mtu.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_slaves.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_slaves.json index 9e97da32aa..c854211970 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_slaves.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_slaves.json @@ -106,4 +106,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_slaves.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_slaves.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_slaves.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_slaves.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_slaves.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/servers.com_set_aggi_slaves.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup.test_no_changes.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup.test_no_changes.json index d21e3317ca..80b7c210c5 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup.test_no_changes.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup.test_no_changes.json @@ -21,4 +21,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup.test_no_changes.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup.test_no_changes.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup.test_no_changes.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup.test_no_changes.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup.test_no_changes.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup.test_no_changes.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_aggi_up.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_aggi_up.json index d21e3317ca..80b7c210c5 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_aggi_up.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_aggi_up.json @@ -21,4 +21,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_aggi_up.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_aggi_up.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_aggi_up.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_aggi_up.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_aggi_up.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_aggi_up.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_aggi_up_twice.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_aggi_up_twice.json index d21e3317ca..80b7c210c5 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_aggi_up_twice.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_aggi_up_twice.json @@ -21,4 +21,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_aggi_up_twice.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_aggi_up_twice.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_aggi_up_twice.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_aggi_up_twice.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_aggi_up_twice.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_aggi_up_twice.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_and_delete_aggi_up.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_and_delete_aggi_up.json index d21e3317ca..80b7c210c5 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_and_delete_aggi_up.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_and_delete_aggi_up.json @@ -21,4 +21,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_and_delete_aggi_up.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_and_delete_aggi_up.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_and_delete_aggi_up.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_and_delete_aggi_up.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_and_delete_aggi_up.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_add_and_delete_aggi_up.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_aggi_remove_dup.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_aggi_remove_dup.json index d21e3317ca..80b7c210c5 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_aggi_remove_dup.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_aggi_remove_dup.json @@ -21,4 +21,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_aggi_remove_dup.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_aggi_remove_dup.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_aggi_remove_dup.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_aggi_remove_dup.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_aggi_remove_dup.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_aggi_remove_dup.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4.exceptions.txt index a1600d9a67..bab7cce06e 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4.exceptions.txt @@ -6,4 +6,4 @@ options: "option": "address", "state": "present", "value": "192.168.0.42" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4.json index d21e3317ca..80b7c210c5 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4.json @@ -21,4 +21,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_post_up.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_post_up.exceptions.txt index e1e0152320..d1ce159755 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_post_up.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_post_up.exceptions.txt @@ -6,4 +6,4 @@ options: "option": "post-up", "state": "present", "value": "XXXX_ipv4" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_post_up.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_post_up.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_post_up.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_post_up.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_post_up.json index d21e3317ca..80b7c210c5 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_post_up.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_post_up.json @@ -21,4 +21,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_post_up.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_post_up.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_post_up.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_post_up.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_post_up.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_post_up.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_pre_up.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_pre_up.exceptions.txt index 9e510654c2..8a439db4c0 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_pre_up.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_pre_up.exceptions.txt @@ -6,4 +6,4 @@ options: "option": "pre-up", "state": "present", "value": "XXXX_ipv4" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_pre_up.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_pre_up.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_pre_up.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_pre_up.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_pre_up.json index d21e3317ca..80b7c210c5 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_pre_up.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_pre_up.json @@ -21,4 +21,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_pre_up.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_pre_up.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_pre_up.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_pre_up.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_pre_up.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv4_pre_up.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6.exceptions.txt index 04c2089186..0150522757 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6.exceptions.txt @@ -6,4 +6,4 @@ options: "option": "address", "state": "present", "value": "fc00::42" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6.json index d21e3317ca..80b7c210c5 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6.json @@ -21,4 +21,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_post_up.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_post_up.exceptions.txt index 48cb29b0aa..2a73a2b777 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_post_up.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_post_up.exceptions.txt @@ -6,4 +6,4 @@ options: "option": "post-up", "state": "present", "value": "XXXX_ipv6" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_post_up.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_post_up.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_post_up.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_post_up.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_post_up.json index d21e3317ca..80b7c210c5 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_post_up.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_post_up.json @@ -21,4 +21,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_post_up.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_post_up.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_post_up.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_post_up.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_post_up.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_post_up.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_pre_up.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_pre_up.exceptions.txt index fbfed6be37..262ffe9f34 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_pre_up.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_pre_up.exceptions.txt @@ -6,4 +6,4 @@ options: "option": "pre-up", "state": "present", "value": "XXXX_ipv6" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_pre_up.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_pre_up.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_pre_up.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_pre_up.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_pre_up.json index d21e3317ca..80b7c210c5 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_pre_up.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_pre_up.json @@ -21,4 +21,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_pre_up.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_pre_up.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_pre_up.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_pre_up.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_pre_up.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_ipv6_pre_up.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_method.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_method.exceptions.txt index 050a983971..6e0ba79f38 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_method.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_method.exceptions.txt @@ -5,4 +5,4 @@ options: "option": "method", "state": "present", "value": "dhcp" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_method.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_method.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_method.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_method.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_method.json index d21e3317ca..80b7c210c5 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_method.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_method.json @@ -21,4 +21,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_method.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_method.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_method.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_method.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_method.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_change_method.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_revert.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_revert.exceptions.txt index fddf3b3b0a..57f3fe6f76 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_revert.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_revert.exceptions.txt @@ -5,4 +5,4 @@ options: "option": "mtu", "state": "absent", "value": "1350" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_revert.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_revert.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_revert.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_revert.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_revert.json index d21e3317ca..80b7c210c5 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_revert.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_revert.json @@ -21,4 +21,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_revert.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_revert.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_revert.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_revert.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_revert.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_revert.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_and_eth0_mtu.exceptions.txt b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_and_eth0_mtu.exceptions.txt index 764c9cb016..007dd44446 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_and_eth0_mtu.exceptions.txt +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_and_eth0_mtu.exceptions.txt @@ -5,4 +5,4 @@ options: "option": "mtu", "state": "present", "value": "1350" -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_and_eth0_mtu.exceptions.txt.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_and_eth0_mtu.exceptions.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_and_eth0_mtu.exceptions.txt.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_and_eth0_mtu.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_and_eth0_mtu.json index d21e3317ca..80b7c210c5 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_and_eth0_mtu.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_and_eth0_mtu.json @@ -21,4 +21,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_and_eth0_mtu.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_and_eth0_mtu.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_and_eth0_mtu.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_and_eth0_mtu.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_and_eth0_mtu.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_and_eth0_mtu.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_slaves.json b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_slaves.json index d21e3317ca..80b7c210c5 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_slaves.json +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_slaves.json @@ -21,4 +21,4 @@ "pre-up": [], "up": [] } -} \ No newline at end of file +} diff --git a/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_slaves.json.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_slaves.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_slaves.json.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_slaves.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_slaves.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/golden_output/up_down_dup_set_aggi_slaves.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/input/address_family.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/input/address_family.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/input/address_family.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/input/default_dhcp.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/input/default_dhcp.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/input/default_dhcp.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/input/servers.com.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/input/servers.com.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/input/servers.com.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/tests/unit/plugins/modules/system/interfaces_file/fixtures/input/up_down_dup.license b/tests/unit/plugins/modules/system/interfaces_file/fixtures/input/up_down_dup.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/unit/plugins/modules/system/interfaces_file/fixtures/input/up_down_dup.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/tests/unit/plugins/modules/system/interfaces_file/test_interfaces_file.py b/tests/unit/plugins/modules/system/interfaces_file/test_interfaces_file.py index fd2ee9d7c9..60303234a3 100644 --- a/tests/unit/plugins/modules/system/interfaces_file/test_interfaces_file.py +++ b/tests/unit/plugins/modules/system/interfaces_file/test_interfaces_file.py @@ -1,8 +1,9 @@ -# (c) 2017, Roman Belyakovsky +# Copyright (c) 2017, Roman Belyakovsky # # This file is part of Ansible # -# 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 @@ -45,6 +46,7 @@ golden_output_path = os.path.join(os.path.dirname(__file__), 'fixtures', 'golden class TestInterfacesFileModule(unittest.TestCase): def getTestFiles(self, include_filter=None, exclude_filter=None): flist = next(os.walk(fixture_path))[2] + flist = [file for file in flist if not file.endswith('.license')] if include_filter: flist = filter(lambda x: re.match(include_filter, x), flist) if exclude_filter: @@ -76,6 +78,8 @@ class TestInterfacesFileModule(unittest.TestCase): def compareStringWithFile(self, string, path): # self.assertEqual("","_",msg=path) testfilepath = os.path.join(golden_output_path, path) + if string and not string.endswith('\n'): + string += '\n' goldenstring = string if not os.path.isfile(testfilepath): f = io.open(testfilepath, 'wb') diff --git a/tests/unit/plugins/modules/system/test_gconftool2_info.py b/tests/unit/plugins/modules/system/test_gconftool2_info.py new file mode 100644 index 0000000000..1847dce428 --- /dev/null +++ b/tests/unit/plugins/modules/system/test_gconftool2_info.py @@ -0,0 +1,103 @@ +# -*- coding: utf-8 -*- +# Copyright (c) Alexei Znamensky (russoz@gmail.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 + +import json + +from ansible_collections.community.general.plugins.modules.system import gconftool2_info + +import pytest + +TESTED_MODULE = gconftool2_info.__name__ + + +@pytest.fixture +def patch_gconftool2_info(mocker): + """ + Function used for mocking some parts of redhat_subscription module + """ + mocker.patch('ansible_collections.community.general.plugins.module_utils.mh.module_helper.AnsibleModule.get_bin_path', + return_value='/testbin/gconftool-2') + + +TEST_CASES = [ + [ + {'key': '/desktop/gnome/background/picture_filename'}, + { + 'id': 'test_simple_element_get', + 'run_command.calls': [ + ( + # Calling of following command will be asserted + ['/testbin/gconftool-2', '--get', '/desktop/gnome/background/picture_filename'], + # Was return code checked? + {'environ_update': {'LANGUAGE': 'C', 'LC_ALL': 'C'}, 'check_rc': True}, + # Mock of returned code, stdout and stderr + (0, '100\n', '',), + ), + ], + 'value': '100', + } + ], + [ + {'key': '/desktop/gnome/background/picture_filename'}, + { + 'id': 'test_simple_element_get_not_found', + 'run_command.calls': [ + ( + # Calling of following command will be asserted + ['/testbin/gconftool-2', '--get', '/desktop/gnome/background/picture_filename'], + # Was return code checked? + {'environ_update': {'LANGUAGE': 'C', 'LC_ALL': 'C'}, 'check_rc': True}, + # Mock of returned code, stdout and stderr + (0, '', "No value set for `/desktop/gnome/background/picture_filename'\n",), + ), + ], + 'value': None, + } + ], +] +TEST_CASES_IDS = [item[1]['id'] for item in TEST_CASES] + + +@pytest.mark.parametrize('patch_ansible_module, testcase', + TEST_CASES, + ids=TEST_CASES_IDS, + indirect=['patch_ansible_module']) +@pytest.mark.usefixtures('patch_ansible_module') +def test_gconftool2_info(mocker, capfd, patch_gconftool2_info, testcase): + """ + Run unit tests for test cases listen in TEST_CASES + """ + + # Mock function used for running commands first + call_results = [item[2] for item in testcase['run_command.calls']] + mock_run_command = mocker.patch( + 'ansible_collections.community.general.plugins.module_utils.mh.module_helper.AnsibleModule.run_command', + side_effect=call_results) + + # Try to run test case + with pytest.raises(SystemExit): + gconftool2_info.main() + + out, err = capfd.readouterr() + results = json.loads(out) + print("testcase =\n%s" % testcase) + print("results =\n%s" % results) + + for conditional_test_result in ('value',): + if conditional_test_result in testcase: + assert conditional_test_result in results, "'{0}' not found in {1}".format(conditional_test_result, results) + assert results[conditional_test_result] == testcase[conditional_test_result], \ + "'{0}': '{1}' != '{2}'".format(conditional_test_result, results[conditional_test_result], testcase[conditional_test_result]) + + assert mock_run_command.call_count == len(testcase['run_command.calls']) + if mock_run_command.call_count: + call_args_list = [(item[0][0], item[1]) for item in mock_run_command.call_args_list] + expected_call_args_list = [(item[0], item[1]) for item in testcase['run_command.calls']] + print("call args list =\n%s" % call_args_list) + print("expected args list =\n%s" % expected_call_args_list) + assert call_args_list == expected_call_args_list diff --git a/tests/unit/plugins/modules/system/test_java_keystore.py b/tests/unit/plugins/modules/system/test_java_keystore.py index 7d078ac0f9..7ebc8e20e4 100644 --- a/tests/unit/plugins/modules/system/test_java_keystore.py +++ b/tests/unit/plugins/modules/system/test_java_keystore.py @@ -3,7 +3,8 @@ # Copyright (c) 2018, Ansible Project # Copyright (c) 2018, Abhijeet Kasurde # -# 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/tests/unit/plugins/modules/system/test_modprobe.py b/tests/unit/plugins/modules/system/test_modprobe.py index 6f2c6b3d19..306399375b 100644 --- a/tests/unit/plugins/modules/system/test_modprobe.py +++ b/tests/unit/plugins/modules/system/test_modprobe.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/tests/unit/plugins/modules/system/test_pamd.py b/tests/unit/plugins/modules/system/test_pamd.py index 19c9d7352a..cf89acf5c6 100644 --- a/tests/unit/plugins/modules/system/test_pamd.py +++ b/tests/unit/plugins/modules/system/test_pamd.py @@ -1,4 +1,6 @@ -# 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/tests/unit/plugins/modules/system/test_parted.py b/tests/unit/plugins/modules/system/test_parted.py index 18faf6a6ab..bec024f110 100644 --- a/tests/unit/plugins/modules/system/test_parted.py +++ b/tests/unit/plugins/modules/system/test_parted.py @@ -1,5 +1,6 @@ # (c) 2017 Red Hat Inc. -# 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/tests/unit/plugins/modules/system/test_sap_task_list_execute.py b/tests/unit/plugins/modules/system/test_sap_task_list_execute.py index 9d2299cacb..fb8bfa9d7f 100644 --- a/tests/unit/plugins/modules/system/test_sap_task_list_execute.py +++ b/tests/unit/plugins/modules/system/test_sap_task_list_execute.py @@ -1,4 +1,6 @@ -# 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/tests/unit/plugins/modules/system/test_solaris_zone.py b/tests/unit/plugins/modules/system/test_solaris_zone.py index 4cf5c5ff7a..f8be6fc47a 100644 --- a/tests/unit/plugins/modules/system/test_solaris_zone.py +++ b/tests/unit/plugins/modules/system/test_solaris_zone.py @@ -1,5 +1,6 @@ # Copyright (c) 2020 Justin Bronn -# 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/tests/unit/plugins/modules/system/test_sysupgrade.py b/tests/unit/plugins/modules/system/test_sysupgrade.py index 1ea8bf208c..4811e686a2 100644 --- a/tests/unit/plugins/modules/system/test_sysupgrade.py +++ b/tests/unit/plugins/modules/system/test_sysupgrade.py @@ -1,4 +1,6 @@ -# 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/tests/unit/plugins/modules/system/test_ufw.py b/tests/unit/plugins/modules/system/test_ufw.py index a522ba98a8..f7b1ec0da5 100644 --- a/tests/unit/plugins/modules/system/test_ufw.py +++ b/tests/unit/plugins/modules/system/test_ufw.py @@ -1,4 +1,5 @@ -# 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/tests/unit/plugins/modules/system/test_xfconf.py b/tests/unit/plugins/modules/system/test_xfconf.py index e8de07ae0b..14ac62fc6b 100644 --- a/tests/unit/plugins/modules/system/test_xfconf.py +++ b/tests/unit/plugins/modules/system/test_xfconf.py @@ -1,8 +1,13 @@ +# -*- coding: utf-8 -*- # Author: Alexei Znamensky (russoz@gmail.com) # Largely adapted from test_redhat_subscription by # Jiri Hnidek (jhnidek@redhat.com) # -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) Alexei Znamensky (russoz@gmail.com) +# Copyright (c) Jiri Hnidek (jhnidek@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 @@ -19,7 +24,7 @@ TESTED_MODULE = xfconf.__name__ @pytest.fixture def patch_xfconf(mocker): """ - Function used for mocking some parts of redhat_subscribtion module + Function used for mocking some parts of redhat_subscription module """ mocker.patch('ansible_collections.community.general.plugins.module_utils.mh.module_helper.AnsibleModule.get_bin_path', return_value='/testbin/xfconf-query') @@ -110,6 +115,41 @@ TEST_CASES = [ 'value': '90', }, ], + [ + { + 'channel': 'xfce4-session', + 'property': '/general/SaveOnExit', + 'state': 'present', + 'value_type': 'bool', + 'value': False, + }, + { + 'id': 'test_property_set_property_bool_false', + 'run_command.calls': [ + ( + # Calling of following command will be asserted + ['/testbin/xfconf-query', '--channel', 'xfce4-session', '--property', '/general/SaveOnExit'], + # Was return code checked? + {'environ_update': {'LANGUAGE': 'C', 'LC_ALL': 'C'}, 'check_rc': False}, + # Mock of returned code, stdout and stderr + (0, 'true\n', '',), + ), + ( + # Calling of following command will be asserted + ['/testbin/xfconf-query', '--channel', 'xfce4-session', '--property', '/general/SaveOnExit', + '--create', '--type', 'bool', '--set', 'false'], + # Was return code checked? + {'environ_update': {'LANGUAGE': 'C', 'LC_ALL': 'C'}, 'check_rc': False}, + # Mock of returned code, stdout and stderr + (0, 'false\n', '',), + ), + ], + 'changed': True, + 'previous_value': 'true', + 'value_type': 'bool', + 'value': 'False', + }, + ], [ { 'channel': 'xfwm4', @@ -232,7 +272,7 @@ def test_xfconf(mocker, capfd, patch_xfconf, testcase): # Mock function used for running commands first call_results = [item[2] for item in testcase['run_command.calls']] mock_run_command = mocker.patch( - 'ansible_collections.community.general.plugins.module_utils.mh.module_helper.AnsibleModule.run_command', + 'ansible.module_utils.basic.AnsibleModule.run_command', side_effect=call_results) # Try to run test case @@ -252,12 +292,6 @@ def test_xfconf(mocker, capfd, patch_xfconf, testcase): assert results[test_result] == results['invocation']['module_args'][test_result], \ "'{0}': '{1}' != '{2}'".format(test_result, results[test_result], results['invocation']['module_args'][test_result]) - for conditional_test_result in ('msg', 'value', 'previous_value'): - if conditional_test_result in testcase: - assert conditional_test_result in results, "'{0}' not found in {1}".format(conditional_test_result, results) - assert results[conditional_test_result] == testcase[conditional_test_result], \ - "'{0}': '{1}' != '{2}'".format(conditional_test_result, results[conditional_test_result], testcase[conditional_test_result]) - assert mock_run_command.call_count == len(testcase['run_command.calls']) if mock_run_command.call_count: call_args_list = [(item[0][0], item[1]) for item in mock_run_command.call_args_list] @@ -265,3 +299,14 @@ def test_xfconf(mocker, capfd, patch_xfconf, testcase): print("call args list =\n%s" % call_args_list) print("expected args list =\n%s" % expected_call_args_list) assert call_args_list == expected_call_args_list + + expected_cmd, dummy, expected_res = testcase['run_command.calls'][-1] + assert results['cmd'] == expected_cmd + assert results['stdout'] == expected_res[1] + assert results['stderr'] == expected_res[2] + + for conditional_test_result in ('msg', 'value', 'previous_value'): + if conditional_test_result in testcase: + assert conditional_test_result in results, "'{0}' not found in {1}".format(conditional_test_result, results) + assert results[conditional_test_result] == testcase[conditional_test_result], \ + "'{0}': '{1}' != '{2}'".format(conditional_test_result, results[conditional_test_result], testcase[conditional_test_result]) diff --git a/tests/unit/plugins/modules/system/test_xfconf_info.py b/tests/unit/plugins/modules/system/test_xfconf_info.py index 528622d0ee..cdb59e81af 100644 --- a/tests/unit/plugins/modules/system/test_xfconf_info.py +++ b/tests/unit/plugins/modules/system/test_xfconf_info.py @@ -1,5 +1,6 @@ -# Author: Alexei Znamensky (russoz@gmail.com) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# Copyright (c) Alexei Znamensky (russoz@gmail.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 @@ -16,7 +17,7 @@ TESTED_MODULE = xfconf_info.__name__ @pytest.fixture def patch_xfconf_info(mocker): """ - Function used for mocking some parts of redhat_subscribtion module + Function used for mocking some parts of redhat_subscription module """ mocker.patch('ansible_collections.community.general.plugins.module_utils.mh.module_helper.AnsibleModule.get_bin_path', return_value='/testbin/xfconf-query') diff --git a/tests/unit/plugins/modules/utils.py b/tests/unit/plugins/modules/utils.py index 6a00fd25fc..1f7f14722f 100644 --- a/tests/unit/plugins/modules/utils.py +++ b/tests/unit/plugins/modules/utils.py @@ -1,4 +1,6 @@ -# 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/tests/unit/plugins/modules/web_infrastructure/__init__.py b/tests/unit/plugins/modules/web_infrastructure/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/plugins/modules/web_infrastructure/test_apache2_module.py b/tests/unit/plugins/modules/web_infrastructure/test_apache2_module.py index db3f04ddf8..b39bc99a8c 100644 --- a/tests/unit/plugins/modules/web_infrastructure/test_apache2_module.py +++ b/tests/unit/plugins/modules/web_infrastructure/test_apache2_module.py @@ -1,4 +1,6 @@ -# 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/tests/unit/plugins/modules/web_infrastructure/test_jenkins_build.py b/tests/unit/plugins/modules/web_infrastructure/test_jenkins_build.py index 687ef0f766..bf32068897 100644 --- a/tests/unit/plugins/modules/web_infrastructure/test_jenkins_build.py +++ b/tests/unit/plugins/modules/web_infrastructure/test_jenkins_build.py @@ -1,4 +1,6 @@ -# 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/tests/unit/plugins/modules/web_infrastructure/test_jenkins_plugin.py b/tests/unit/plugins/modules/web_infrastructure/test_jenkins_plugin.py index b928ad824c..f8a65be23e 100644 --- a/tests/unit/plugins/modules/web_infrastructure/test_jenkins_plugin.py +++ b/tests/unit/plugins/modules/web_infrastructure/test_jenkins_plugin.py @@ -1,4 +1,6 @@ -# 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/tests/unit/requirements.txt b/tests/unit/requirements.txt index 59ea49ed90..788fa4cb6c 100644 --- a/tests/unit/requirements.txt +++ b/tests/unit/requirements.txt @@ -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 + unittest2 ; python_version < '2.7' importlib ; python_version < '2.7' @@ -29,10 +33,11 @@ dnsimple >= 2 ; python_version >= '3.6' dataclasses ; python_version == '3.6' # requirement for the opentelemetry callback plugin -# WARNING: these libraries depend on grpcio, which takes 7 minutes (!) to build in CI on Python 3.10 -opentelemetry-api ; python_version >= '3.6' and python_version < '3.10' -opentelemetry-exporter-otlp ; python_version >= '3.6' and python_version < '3.10' -opentelemetry-sdk ; python_version >= '3.6' and python_version < '3.10' +# WARNING: these libraries rely on Protobuf for Python, which regularly stops installing. +# That's why they are disabled for now. +# opentelemetry-api ; python_version >= '3.6' and python_version < '3.10' +# opentelemetry-exporter-otlp ; python_version >= '3.6' and python_version < '3.10' +# opentelemetry-sdk ; python_version >= '3.6' and python_version < '3.10' # requirement for the elastic callback plugin elastic-apm ; python_version >= '3.6' diff --git a/tests/utils/constraints.txt b/tests/utils/constraints.txt index 99636b6885..af2b326ddd 100644 --- a/tests/utils/constraints.txt +++ b/tests/utils/constraints.txt @@ -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 + +certifi < 2022.5.18 ; python_version < '3.5' # certifi 2022.5.18 requires Python 3.5 or later coverage >= 4.2, < 5.0.0, != 4.3.2 ; python_version <= '3.7' # features in 4.2+ required, avoid known bug in 4.3.2 on python 2.6, coverage 5.0+ incompatible coverage >= 4.5.4, < 5.0.0 ; python_version > '3.7' # coverage had a bug in < 4.5.4 that would cause unit tests to hang in Python 3.8, coverage 5.0+ incompatible cryptography < 2.2 ; python_version < '2.7' # cryptography 2.2 drops support for python 2.6 @@ -22,6 +27,7 @@ pytest-forked < 1.0.2 ; python_version < '2.7' # pytest-forked 1.0.2 and later r pytest-forked >= 1.0.2 ; python_version >= '2.7' # pytest-forked before 1.0.2 does not work with pytest 4.2.0+ (which requires python 2.7+) ntlm-auth >= 1.3.0 # message encryption support using cryptography requests < 2.20.0 ; python_version < '2.7' # requests 2.20.0 drops support for python 2.6 +requests < 2.28 ; python_version >= '2.7' and python_version < '3.7' # requests 2.28.0 drops support for python 3.6 and before requests-ntlm >= 1.1.0 # message encryption support requests-credssp >= 0.1.0 # message encryption support voluptuous >= 0.11.0 # Schema recursion via Self @@ -47,6 +53,9 @@ cffi >= 1.14.2, != 1.14.3 # Yanked version which older versions of pip will stil redis == 2.10.6 ; python_version < '2.7' redis < 4.0.0 ; python_version >= '2.7' and python_version < '3.6' redis ; python_version >= '3.6' +pycdlib < 1.13.0 ; python_version < '3' # 1.13.0 does not work with Python 2, while not declaring that +python-daemon <= 2.3.0 ; python_version < '3' +bcrypt < 4.0.0 # TEMP: restrict to < 4.0.0 since installing 4.0.0 fails on RHEL 8 # freeze pylint and its requirements for consistent test results astroid == 2.2.5 diff --git a/tests/utils/shippable/cloud.sh b/tests/utils/shippable/cloud.sh index d76c32282d..a2e6ebf2be 100755 --- a/tests/utils/shippable/cloud.sh +++ b/tests/utils/shippable/cloud.sh @@ -1,4 +1,7 @@ #!/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 set -o pipefail -eux diff --git a/tests/utils/shippable/linux-community.sh b/tests/utils/shippable/linux-community.sh index e68bdf387e..5adafa0cff 100755 --- a/tests/utils/shippable/linux-community.sh +++ b/tests/utils/shippable/linux-community.sh @@ -1,4 +1,7 @@ #!/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 set -o pipefail -eux diff --git a/tests/utils/shippable/linux.sh b/tests/utils/shippable/linux.sh index 9cc2f966cb..ce3ac34df3 100755 --- a/tests/utils/shippable/linux.sh +++ b/tests/utils/shippable/linux.sh @@ -1,4 +1,7 @@ #!/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 set -o pipefail -eux diff --git a/tests/utils/shippable/remote.sh b/tests/utils/shippable/remote.sh index 76065b8178..725c199b90 100755 --- a/tests/utils/shippable/remote.sh +++ b/tests/utils/shippable/remote.sh @@ -1,4 +1,7 @@ #!/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 set -o pipefail -eux diff --git a/tests/utils/shippable/sanity.sh b/tests/utils/shippable/sanity.sh index eacbd81609..5b88a26778 100755 --- a/tests/utils/shippable/sanity.sh +++ b/tests/utils/shippable/sanity.sh @@ -1,4 +1,7 @@ #!/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 set -o pipefail -eux diff --git a/tests/utils/shippable/shippable.sh b/tests/utils/shippable/shippable.sh index a562342a39..ba8842d97b 100755 --- a/tests/utils/shippable/shippable.sh +++ b/tests/utils/shippable/shippable.sh @@ -1,4 +1,7 @@ #!/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 set -o pipefail -eux diff --git a/tests/utils/shippable/units.sh b/tests/utils/shippable/units.sh index b24b08432a..f591ec25aa 100755 --- a/tests/utils/shippable/units.sh +++ b/tests/utils/shippable/units.sh @@ -1,4 +1,7 @@ #!/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 set -o pipefail -eux