diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-18 05:52:35 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-18 05:52:35 +0000 |
commit | 7fec0b69a082aaeec72fee0612766aa42f6b1b4d (patch) | |
tree | efb569b86ca4da888717f5433e757145fa322e08 /ansible_collections/community/windows | |
parent | Releasing progress-linux version 7.7.0+dfsg-3~progress7.99u1. (diff) | |
download | ansible-7fec0b69a082aaeec72fee0612766aa42f6b1b4d.tar.xz ansible-7fec0b69a082aaeec72fee0612766aa42f6b1b4d.zip |
Merging upstream version 9.4.0+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ansible_collections/community/windows')
93 files changed, 769 insertions, 1261 deletions
diff --git a/ansible_collections/community/windows/.ansible-lint b/ansible_collections/community/windows/.ansible-lint new file mode 100644 index 000000000..cad3b8e14 --- /dev/null +++ b/ansible_collections/community/windows/.ansible-lint @@ -0,0 +1,11 @@ +profile: production + +exclude_paths: + # This file is autogenerated so we cannot change the format + - changelogs/changelog.yaml + # Incorrect error around supported ansible versions in this file + - meta/runtime.yml + - tests/integration/ + # We skip a rule that has to be skipped + - tests/sanity/ignore-*.txt + - tests/unit/ diff --git a/ansible_collections/community/windows/.azure-pipelines/azure-pipelines.yml b/ansible_collections/community/windows/.azure-pipelines/azure-pipelines.yml index 2b5d2e8b0..8e434aa48 100644 --- a/ansible_collections/community/windows/.azure-pipelines/azure-pipelines.yml +++ b/ansible_collections/community/windows/.azure-pipelines/azure-pipelines.yml @@ -36,7 +36,7 @@ variables: resources: containers: - container: default - image: quay.io/ansible/azure-pipelines-test-container:3.0.0 + image: quay.io/ansible/azure-pipelines-test-container:4.0.1 pool: Standard @@ -44,89 +44,77 @@ stages: - stage: Dependencies displayName: Dependencies jobs: - - job: dep_download - displayName: Download Dependencies - pool: - vmImage: ubuntu-latest - steps: - - checkout: self - fetchDepth: 1 - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.10' - - bash: python -m pip install ansible-core - displayName: Install Ansible - - bash: ansible-galaxy collection install -r tests/requirements.yml -p collections - displayName: Install collection requirements - - task: PublishPipelineArtifact@1 - inputs: - targetPath: collections - artifactName: CollectionRequirements + - job: dep_download + displayName: Download Dependencies + pool: + vmImage: ubuntu-latest + steps: + - checkout: self + fetchDepth: 1 + - task: UsePythonVersion@0 + inputs: + versionSpec: "3.10" + - bash: python -m pip install ansible-core + displayName: Install Ansible + - bash: ansible-galaxy collection install -r tests/requirements.yml -p collections + displayName: Install collection requirements + - task: PublishPipelineArtifact@1 + inputs: + targetPath: collections + artifactName: CollectionRequirements - stage: Ansible_devel displayName: Ansible devel dependsOn: - - Dependencies + - Dependencies jobs: - template: templates/matrix.yml parameters: - nameFormat: '{0}' - testFormat: 'devel/{0}' + nameFormat: "{0}" + testFormat: "devel/{0}" targets: - name: Sanity test: sanity - name: Units test: units - - stage: Ansible_2_15 - displayName: Ansible 2.15 + - name: Lint + test: lint + - stage: Ansible_2_16 + displayName: Ansible 2.16 dependsOn: - - Dependencies + - Dependencies jobs: - template: templates/matrix.yml parameters: - nameFormat: '{0}' - testFormat: '2.15/{0}' + nameFormat: "{0}" + testFormat: "2.16/{0}" targets: - name: Sanity test: sanity - name: Units test: units - - stage: Ansible_2_14 - displayName: Ansible 2.14 - dependsOn: - - Dependencies - jobs: - - template: templates/matrix.yml - parameters: - nameFormat: '{0}' - testFormat: '2.14/{0}' - targets: - - name: Sanity - test: sanity - - name: Units - test: units - - stage: Ansible_2_13 - displayName: Ansible 2.13 + - stage: Ansible_2_15 + displayName: Ansible 2.15 dependsOn: - - Dependencies + - Dependencies jobs: - template: templates/matrix.yml parameters: - nameFormat: '{0}' - testFormat: '2.13/{0}' + nameFormat: "{0}" + testFormat: "2.15/{0}" targets: - name: Sanity test: sanity - name: Units test: units - - stage: Ansible_2_12 - displayName: Ansible 2.12 + - stage: Ansible_2_14 + displayName: Ansible 2.14 dependsOn: - - Dependencies + - Dependencies jobs: - template: templates/matrix.yml parameters: - nameFormat: '{0}' - testFormat: '2.12/{0}' + nameFormat: "{0}" + testFormat: "2.14/{0}" targets: - name: Sanity test: sanity @@ -135,15 +123,13 @@ stages: - stage: Windows displayName: Windows dependsOn: - - Dependencies + - Dependencies jobs: - template: templates/matrix.yml parameters: nameFormat: Server {0} testFormat: devel/windows/{0} targets: - - test: 2012 - - test: 2012-R2 - test: 2016 - test: 2019 - test: 2022 @@ -157,10 +143,9 @@ stages: condition: succeededOrFailed() dependsOn: - Ansible_devel + - Ansible_2_16 - Ansible_2_15 - Ansible_2_14 - - Ansible_2_13 - - Ansible_2_12 - Windows jobs: - template: templates/coverage.yml diff --git a/ansible_collections/community/windows/.github/workflows/docs-pr.yml b/ansible_collections/community/windows/.github/workflows/docs-pr.yml index 3b89bc6a7..cc0320a93 100644 --- a/ansible_collections/community/windows/.github/workflows/docs-pr.yml +++ b/ansible_collections/community/windows/.github/workflows/docs-pr.yml @@ -2,7 +2,7 @@ name: Collection Docs concurrency: group: docs-pr-${{ github.head_ref }} cancel-in-progress: true -on: +"on": pull_request_target: types: [opened, synchronize, reopened, closed] @@ -44,7 +44,7 @@ jobs: - name: PR comment uses: ansible-community/github-docs-build/actions/ansible-docs-build-comment@main with: - body-includes: '## Docs Build' + body-includes: "## Docs Build" reactions: heart action: ${{ needs.build-docs.outputs.changed != 'true' && 'remove' || '' }} on-closed-action: remove diff --git a/ansible_collections/community/windows/.github/workflows/docs-push.yml b/ansible_collections/community/windows/.github/workflows/docs-push.yml index a59f1553d..736e4db60 100644 --- a/ansible_collections/community/windows/.github/workflows/docs-push.yml +++ b/ansible_collections/community/windows/.github/workflows/docs-push.yml @@ -2,14 +2,14 @@ name: Collection Docs concurrency: group: docs-push-${{ github.sha }} cancel-in-progress: true -on: +"on": push: branches: - main tags: - - '*' + - "*" schedule: - - cron: '0 13 * * *' + - cron: "0 13 * * *" jobs: build-docs: diff --git a/ansible_collections/community/windows/.github/workflows/stale.yml b/ansible_collections/community/windows/.github/workflows/stale.yml index aef40d7fd..ae3719413 100644 --- a/ansible_collections/community/windows/.github/workflows/stale.yml +++ b/ansible_collections/community/windows/.github/workflows/stale.yml @@ -1,7 +1,7 @@ name: Stale pull request handler -on: +"on": schedule: - - cron: 0 0 * * * + - cron: 0 0 * * * permissions: pull-requests: write @@ -11,13 +11,13 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/stale@v4.0.0 - id: stale - with: - days-before-stale: -1 - days-before-pr-stale: 28 - days-before-pr-close: 14 - stale-pr-label: stale - stale-pr-message: >- - This pull request is stale because it has been open for 4 weeks with no activity. - Remove stale label or comment or this will be closed in 2 weeks. + - uses: actions/stale@v4.0.0 + id: stale + with: + days-before-stale: -1 + days-before-pr-stale: 28 + days-before-pr-close: 14 + stale-pr-label: stale + stale-pr-message: >- + This pull request is stale because it has been open for 4 weeks with no activity. + Remove stale label or comment or this will be closed in 2 weeks. diff --git a/ansible_collections/community/windows/CHANGELOG.rst b/ansible_collections/community/windows/CHANGELOG.rst index 45b4f6eaa..a034d4423 100644 --- a/ansible_collections/community/windows/CHANGELOG.rst +++ b/ansible_collections/community/windows/CHANGELOG.rst @@ -4,6 +4,83 @@ Community Windows Release Notes .. contents:: Topics +v2.2.0 +====== + +Release Summary +--------------- + +Release summary for v2.2.0 + +Minor Changes +------------- + +- win_regmerge - Add content 'content' parameter for specifying registry file contents directly + +Bugfixes +-------- + +- win_format, win_partition - Add support for Windows failover cluster disks +- win_psmodule - Fix up error message with ``state=latest`` +- win_robocopy - Fix up ``cmd`` return value to include the executable ``robocopy`` + +v2.1.0 +====== + +Release Summary +--------------- + +Release summary for v2.1.0 + +Minor Changes +------------- + +- Set minimum supported Ansible version to 2.14 to align with the versions still supported by Ansible. + +Bugfixes +-------- + +- Remove some code which is no longer valid for dotnet 5+ +- community.windows.win_psmodule_info - exception thrown when host has no Installed Module. Fix now checks that variable $installedModules is not null before calling the .Contains(..) function on it. +- win_rabbitmq_plugin - Avoid using ``Invoke-Expression`` when running external commands +- win_rds_rap - The module crashed when creating a RAP with Gateway Managed Computer Group (https://github.com/ansible-collections/community.windows/issues/184). + +v2.0.0 +====== + +Release Summary +--------------- + +Version ``2.0.0`` is a major release of the ``community.windows`` collection that removes some deprecated features. Please review the changelog to see what deprecated features have been removed in this release. + +Minor Changes +------------- + +- win_dns_record - Added ``zone_scope`` option to manage a record in a specific zone scope + +Deprecated Features +------------------- + +- win_domain_computer - Module is deprecated in favour of the ``microsoft.ad.computer`` module, the ``community.windows.win_domain_computer`` module will be removed in the ``3.0.0`` release of this collection. +- win_domain_group - Module is deprecated in favour of the ``microsoft.ad.group`` module, the ``community.windows.win_domain_group`` module will be removed in the ``3.0.0`` release of this collection. +- win_domain_group_membership - Module is deprecated in favour of the ``microsoft.ad.group`` module, the ``community.windows.win_domain_group_membership`` module will be removed in the ``3.0.0`` release of this collection. +- win_domain_object_info - Module is deprecated in favour of the ``microsoft.ad.object_info`` module, the ``community.windows.win_domain_object_info`` module will be removed in the ``3.0.0`` release of this collection. +- win_domain_ou - Module is deprecated in favour of the ``microsoft.ad.ou`` module, the ``community.windows.win_domain_ou`` module will be removed in the ``3.0.0`` release of this collection. +- win_domain_user - Module is deprecated in favour of the ``microsoft.ad.user`` module, the ``community.windows.win_domain_user`` module will be removed in the ``3.0.0`` release of this collection. + +Removed Features (previously deprecated) +---------------------------------------- + +- Removed testing for Server 2012 and Server 2012 R2 as they are reaching End of Life status from Microsoft. These OS versions may continue to work but will not be tested in CI. +- win_nssm - Removed the deprecated module option ``app_parameters``, use ``arguments`` instead. +- win_psmodule - Removed the deprecated module option ``url``, use ``community.windows.win_psrepository`` to manage repositories instead +- win_psmodule - Will no longer remove the ``repository`` specified when ``state: absent``, use ``community.windows.win_psrepository`` to manage repositories instead +- win_scheduled_tasks - Removed support for a trigger ``repetition`` to be defined as a list of dictionary entries. Specify the ``repetition`` as a dictionary value rather than a list of dictionaries. + +Bugfixes +-------- + +- win_psmodule - fix requireLicenseAcceptance test so that it is no longer always true v1.13.0 ======= @@ -326,7 +403,6 @@ Release Summary This is the first proper release of the ``community.windows`` collection on 2020-07-18. The changelog describes all changes made to the modules and plugins included in this collection since Ansible 2.9.0. - Minor Changes ------------- diff --git a/ansible_collections/community/windows/FILES.json b/ansible_collections/community/windows/FILES.json index 284a5a7ca..59c335f9d 100644 --- a/ansible_collections/community/windows/FILES.json +++ b/ansible_collections/community/windows/FILES.json @@ -102,7 +102,7 @@ "name": ".azure-pipelines/azure-pipelines.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ada52203f7901d9d80e8d41e6eebc59286cf5714861b6116f0f97e3b5a1b3ef6", + "chksum_sha256": "f9e66cbce7db2f8e7037e82c31b18245226c70b681dcf42fc63c96f3fe077b15", "format": 1 }, { @@ -123,21 +123,21 @@ "name": ".github/workflows/docs-pr.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "391d92c0465a8e47effc66a9cf324f29d0c4e2a930f88a51e3b59f293f3bd5af", + "chksum_sha256": "e04671e2fc8ead695e9c803b7bc515653a265704d2f15b1c42b3294ab022e202", "format": 1 }, { "name": ".github/workflows/docs-push.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ba71916285a82cf9cacc58f577512499bb43f41fd2ba27c00ac874218bae07a0", + "chksum_sha256": "ea42c6f23a4ca65338c3b6c60ba8c3685be82953436b90637c9d98c0911c45ae", "format": 1 }, { "name": ".github/workflows/stale.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "3cc60f9f80d3ba1aa09b8a9567584d3afbe528096b3d51d54fd6d5c4059f6853", + "chksum_sha256": "504e98827023f00fa37cd0bc7e8cab6e0eecbf080bdd87a99f4201ed34899026", "format": 1 }, { @@ -193,14 +193,14 @@ "name": "changelogs/changelog.yaml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "5419d8ff3c4a72c1f34b09c65c2eb2ce65de539ca84131eb529ecc3f42c26796", + "chksum_sha256": "acc734e50ec2397abfa8a2b4c04c16f5f5fe6e5aeee829752838aeada0a1004e", "format": 1 }, { "name": "changelogs/config.yaml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "8f873bb78d459bee3cdc629a2699cbf3ee098b5fb23a9638debb3b6329a3c4cc", + "chksum_sha256": "6891b73b4bb0d0c9e85070ec6a3976e347181b3c9cdd9456c0a7b85766b6422b", "format": 1 }, { @@ -235,7 +235,7 @@ "name": "meta/runtime.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b3ac5ce6c7ef3a7d47cad35d9a0b4256e079e80aed408946b73baf607016ce00", + "chksum_sha256": "f4d1aaefc9e52171511e57cb7f1cfc178ec4dff4f9d08853075bdcbb4a0ddea4", "format": 1 }, { @@ -298,7 +298,7 @@ "name": "plugins/modules/psexec.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "a156009dfc461486b41ddfa6b4693cc641873b89937ae03da7002ab4200e5997", + "chksum_sha256": "6b30a7063f4c36bea72ba06612b22c18fbd0e6bcb07ca1bac3d3fe006a1eb14c", "format": 1 }, { @@ -333,7 +333,7 @@ "name": "plugins/modules/win_auto_logon.ps1", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "84aba3946501f41523f0e41c064b312178f101337e41bf99c4b555978de90215", + "chksum_sha256": "51c0066bd04cc4568704cff9170b7a1821973afa6c11e6196b16e4ad7feab303", "format": 1 }, { @@ -375,14 +375,14 @@ "name": "plugins/modules/win_credential.ps1", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "80fa527239f1bfcfecdd6bf1c616f2d87c6189bd172d743738543a9e9cd0b321", + "chksum_sha256": "6f0eb7e5bdc435018d488e3c947e7deed3bc1477ca9e9702ebd147a8d73b87ac", "format": 1 }, { "name": "plugins/modules/win_credential.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "30a85aba06521091552b1fa44a137d7d988514ca81eeed77e86ade699d101e05", + "chksum_sha256": "da90b006141a7a03bd4128ebfa0bcc7161bff107f96638aff21b4a93a1f13da3", "format": 1 }, { @@ -459,14 +459,14 @@ "name": "plugins/modules/win_dns_record.ps1", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "1657585583bbc73e932b55cbe86945ae68c931170771430415024258d7cf984d", + "chksum_sha256": "1806634992e7f38ed8218ddbf79a37141ea46936fa1b1dc59dfd1dc824c9e67c", "format": 1 }, { "name": "plugins/modules/win_dns_record.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "10a9b6919bef02f4034f83dd03560f1b77aff0406f00150b2d36c87a71b19060", + "chksum_sha256": "75d23179a2ccf6f8d71f9da78173790e3e0c7cdec719140d5485908e04e5a957", "format": 1 }, { @@ -494,7 +494,7 @@ "name": "plugins/modules/win_domain_computer.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "101d6fd2f2ef02c41c2cec63b4fa1ee8f460b11248c1dfc745c994a5d0ab9175", + "chksum_sha256": "d0e9b4bc1f347f99580946baae8359d88e01461d8db274b1efe27de7dea24390", "format": 1 }, { @@ -508,7 +508,7 @@ "name": "plugins/modules/win_domain_group.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "fb916eeb85dce7f787139f38710681470a7a8a840d9361d9221bc9214c463884", + "chksum_sha256": "270c7869c34c1dc5a61db813da0690e9919570c841c759174875abc79625ad52", "format": 1 }, { @@ -522,7 +522,7 @@ "name": "plugins/modules/win_domain_group_membership.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "97fa2920c38801363c85556ea90f53b22f9ff066f54d9e5bcd3f06f0381616ac", + "chksum_sha256": "616cd688337e94fb1cb7e31f153700c8c515f7ef3719aac23c17afde7686e79f", "format": 1 }, { @@ -536,7 +536,7 @@ "name": "plugins/modules/win_domain_object_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "aa05994f622b5165b24eba67fcfdddede7b1f5cda26ac73a9f15eafbac2e9cbe", + "chksum_sha256": "fe2becb52bf28e56fe877c1f377752703d302d2e1868b45e66645a4693646939", "format": 1 }, { @@ -550,7 +550,7 @@ "name": "plugins/modules/win_domain_ou.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "4043273060a7c06c086008b2227f612aa36dfaffb261004419e80c8cbadbedd1", + "chksum_sha256": "3fd9171adaf9d95b36b0c76d4001a8922d55a386617a3c084e356319709b5d73", "format": 1 }, { @@ -564,7 +564,7 @@ "name": "plugins/modules/win_domain_user.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ffe798e9c9350f6a1fc4289269c6693f6cc20128050e09d8fdcf74cbdeb9b1bd", + "chksum_sha256": "7c1593bcaaed2711f41ef6366e0d5ba50d6989c9bec255b627ab1e5476bcf352", "format": 1 }, { @@ -683,7 +683,7 @@ "name": "plugins/modules/win_format.ps1", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "f34249c8490c3805bdf9318ad5312716ad163663266b8e493e9af3f7d910bde0", + "chksum_sha256": "87c46e72f4ffbcab5a7760e5eed9668c90401297192f59d6798570094f263267", "format": 1 }, { @@ -774,7 +774,7 @@ "name": "plugins/modules/win_iis_webapppool.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "4bbaa7ca07e530b819b95fd1ba1afa424373362d53a03cd7a1b386121926a29e", + "chksum_sha256": "a0616e1302bd9afc15fb1fe6f27df0ebd984ca7d331924bcf0ec255e6e2201a8", "format": 1 }, { @@ -809,7 +809,7 @@ "name": "plugins/modules/win_inet_proxy.ps1", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d347533fbe138a3c22b01a6543a098ff43d01a2fbd663e1744e7ffadbab570b6", + "chksum_sha256": "69f8260ba7ff90407d0deb521fcc4156d276f397a2b73746edaebec3523f31a7", "format": 1 }, { @@ -865,7 +865,7 @@ "name": "plugins/modules/win_mapped_drive.ps1", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "5758175d8fbf5bb442624ddb44497b9325faacb7fff23e9967916df5b75db8d6", + "chksum_sha256": "9581ca7440a217b919e60dca32cb6eeb489e912851dcd704aa8b0c32aafbe58a", "format": 1 }, { @@ -921,14 +921,14 @@ "name": "plugins/modules/win_nssm.ps1", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "40a69e606cb129c93644a67b1b18c49dd1cb1f93d28f51e3b5129189ebaa3c5a", + "chksum_sha256": "10f9bcd315bc9a413eb1ff032c77865048091ff47e11dbb38e88535a3f7a1ebe", "format": 1 }, { "name": "plugins/modules/win_nssm.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "03a2671f21160afbe8065cfb359a397683403edffe889099f78751f4dc7fc236", + "chksum_sha256": "4d5fee450a9ff0f5780f7874891c34c297ed1524b9a22614957c8554b197dc28", "format": 1 }, { @@ -949,7 +949,7 @@ "name": "plugins/modules/win_partition.ps1", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "f74e3a9f1e375f074bf162a20f3a0724f7e18d78ba5730c555b047112c4dceb9", + "chksum_sha256": "dba5c80d079a7479dc93c692792cbed0d4ddd6947293527f03ae0dee4d337a93", "format": 1 }, { @@ -1019,21 +1019,21 @@ "name": "plugins/modules/win_psmodule.ps1", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "892a75069e7880102b5816ff654fcc0d730e3d04d5fc9ae139e1b6ed57af4435", + "chksum_sha256": "d01a267bd3a69ab50e8c4ff2a57496ee9c0d5c89afcb86bc724f7f54dcbb8bbe", "format": 1 }, { "name": "plugins/modules/win_psmodule.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "133ad88c1854ddfabc775e9bd0c3298f294cbe17170a1374bee0d38011dd5df9", + "chksum_sha256": "ac7931ddce525878bb89e73581bd55943788d8fe6f53eee18fb15da3c2d5d6b4", "format": 1 }, { "name": "plugins/modules/win_psmodule_info.ps1", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "59f0097dbee173d19af29d9e403d1979cbe67ee82dd3983b561743f3d9faf98a", + "chksum_sha256": "1d30f60c398b7b53f51df29944788a80d6a0f05ea983e8bcd4eeee080939a6c2", "format": 1 }, { @@ -1131,7 +1131,7 @@ "name": "plugins/modules/win_rabbitmq_plugin.ps1", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "07addf969c9dd2aa3976166d666088f9b2ae983c14d9b093f11df73e85427fcc", + "chksum_sha256": "6cbf960ac3ba845976971b9607ba696a099229f27273a2bdf9e02aa7cccc533d", "format": 1 }, { @@ -1159,7 +1159,7 @@ "name": "plugins/modules/win_rds_rap.ps1", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "a68868e66f66e4a61770a9ee796e99e8ebbe357115f84ad4da828c64526d2227", + "chksum_sha256": "818f11da75fd59f1acb92311d3d1c3aaa694818a20a3d65ff0bb346c544787bd", "format": 1 }, { @@ -1187,7 +1187,7 @@ "name": "plugins/modules/win_region.ps1", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "dc30a601eb36f93f8eebe60b3c72fe465dd5ce398158592c3987188009348b01", + "chksum_sha256": "58e3f10a8730f2c06443cdaab0823ed530e4fc8a90ce312505bc630bce998c70", "format": 1 }, { @@ -1201,21 +1201,21 @@ "name": "plugins/modules/win_regmerge.ps1", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "4f2dbcc0eb79462e852a0c5fd980b8648a5afadbbb10340e8360281e30daadbf", + "chksum_sha256": "5bdcb076d4ec4daad3f3878ebf570249d06cd9aa2c73e5a5bac7766d9e690648", "format": 1 }, { "name": "plugins/modules/win_regmerge.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "681d727dab3d657faa5066afdf8297e0a7aeb7a2541ce671d31ae155b7e7999b", + "chksum_sha256": "16353c422cb513a4aa95557c50a661c0f9a81b3ce2ac60d7a47bda69540bb8e7", "format": 1 }, { "name": "plugins/modules/win_robocopy.ps1", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "9598922f7696810f4a460223401cb9b068095bb93fc2b8a75729b80328c1ec45", + "chksum_sha256": "0aab4398e3f5c84be878d111112b0b96400a976864e6d35a47fce968951fa253", "format": 1 }, { @@ -1257,7 +1257,7 @@ "name": "plugins/modules/win_scheduled_task.ps1", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "3e96402641385a6f49b4de9570cb1c389015fe32dbdb111006ed9e9e5d5a3036", + "chksum_sha256": "a24a38351245c1ecbb5c75d7bfbfe4ae48f10071f46f46bfe49a084c31cb7c28", "format": 1 }, { @@ -1698,7 +1698,7 @@ "name": "tests/integration/targets/setup_win_device/library/win_device.ps1", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ebab88c2d4b9e18e34416b0c2950c53667ac82f3541ddce608336a3bfedfe016", + "chksum_sha256": "dd14c9de24e7d4b98933ec647855943f9c7ce2bc3a620e7afdceab312967b6a3", "format": 1 }, { @@ -1838,7 +1838,7 @@ "name": "tests/integration/targets/win_audit_rule/library/test_get_audit_rule.ps1", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "950e0feb2ffb782733e73110d4b97461351c78795fd8e3f08f221bda9174dbc1", + "chksum_sha256": "ed0025cc73f469716c8078170b5e843143e8e1141b04f12e5a767965d96efda7", "format": 1 }, { @@ -1915,7 +1915,7 @@ "name": "tests/integration/targets/win_auto_logon/library/test_autologon_info.ps1", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "5ee3deabbadcd11357c7215a8d8b61967d58fae1541e06fd7f6a6f06a6acc88f", + "chksum_sha256": "f9344d3e8ea22a902f00f4938a5f225a9fe42453b3213363edbb32886c9c5749", "format": 1 }, { @@ -2118,7 +2118,7 @@ "name": "tests/integration/targets/win_credential/library/test_cred_facts.ps1", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "30545f69012f834c56b0bacfe121e2ea81d14f3fb513b1ff9de9401c8c0c2646", + "chksum_sha256": "1a65f992212e4e2e045b79b6014b27bc94314c784d184cc8862c24cd10045046", "format": 1 }, { @@ -2195,14 +2195,14 @@ "name": "tests/integration/targets/win_data_deduplication/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "11015c09652cce419325b63f7e5a8a2243ee87d5174a119d569c51a774776990", + "chksum_sha256": "e140d411afb8b79a7577198b20fe365c681d01055384a292d42806f668e6ddd2", "format": 1 }, { "name": "tests/integration/targets/win_data_deduplication/tasks/pre_test.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "a0005d284731b397c14fce162751f7df806f1ce3bde97f9e5af79dd46412d991", + "chksum_sha256": "99f1637ea650578796bd4eee82135ee1ad6bb95b2aa16592aa48fcd48bf547c0", "format": 1 }, { @@ -2237,7 +2237,7 @@ "name": "tests/integration/targets/win_data_deduplication/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "73346dc8234e120681840b8d2642d4ebd05e1d25db50cb2cbe9376e5632528c8", + "chksum_sha256": "758d23e7651820af7b1af35846b0a80daee9e3c321fd9e93a0f60b929035610f", "format": 1 }, { @@ -2314,7 +2314,7 @@ "name": "tests/integration/targets/win_disk_facts/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "25d09891b2275f91de4d285b10e8d93437e1be449691bfa328875b963e841084", + "chksum_sha256": "e0ee323b8dc5a00d08437896e844ed7f5586d761baaca2689439df816384762a", "format": 1 }, { @@ -2370,7 +2370,7 @@ "name": "tests/integration/targets/win_dns_record/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "f9cee2e389f87db84fe355d51e7517db5737663e1373765c2ff5b923eaf19e92", + "chksum_sha256": "522e5f3cb38a169d18a5363bd0cdeddd6577b3abdd4db3113a5b15736ad89597", "format": 1 }, { @@ -2503,7 +2503,7 @@ "name": "tests/integration/targets/win_dns_zone/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "8ba362a47e99d88d85643228ff2a522e7e4c1496b38e09d024fa05b20b993542", + "chksum_sha256": "5663f103af71f218bb9a50a0d25b7dd6cc83f8761d3ef3c93c7f697f6b6bd1c0", "format": 1 }, { @@ -2685,7 +2685,7 @@ "name": "tests/integration/targets/win_domain_ou/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "247913365e3e278d856d0a3264801f680390008f151e1824e53419c04471bb0e", + "chksum_sha256": "1aabf18b3e493a2bf65e8256494940c15795202c0132ef951482454ec995d2da", "format": 1 }, { @@ -2748,7 +2748,7 @@ "name": "tests/integration/targets/win_domain_user/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "247913365e3e278d856d0a3264801f680390008f151e1824e53419c04471bb0e", + "chksum_sha256": "1aabf18b3e493a2bf65e8256494940c15795202c0132ef951482454ec995d2da", "format": 1 }, { @@ -3007,7 +3007,7 @@ "name": "tests/integration/targets/win_firewall/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "7f5f4eb215f2a504baa753e868434b6942a07378e5d8a65ded04fd355964c8fa", + "chksum_sha256": "d7127ace6c1571fdf343a57b543cd35ed5b5181a330ab6e79ea892bf1ffff082", "format": 1 }, { @@ -3070,14 +3070,14 @@ "name": "tests/integration/targets/win_format/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "caf4a8024c4bc4133974d5f64086f381e7acbae8e4a4b005bbd896e14751ff5d", + "chksum_sha256": "e1697f5d2174eace51fd9c5a9fd39e3b0f385d390b77b16714e9026e17e82423", "format": 1 }, { "name": "tests/integration/targets/win_format/tasks/pre_test.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "7c0849818d5413031a20e8a0d22152d8bb8ee8428b87df32ae335ef1935c5e2b", + "chksum_sha256": "605dde22f21960667693488dc68a4af01fe646025a431482835dae4da6c3f7c7", "format": 1 }, { @@ -3553,7 +3553,7 @@ "name": "tests/integration/targets/win_inet_proxy/library/win_inet_proxy_info.ps1", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "802f94faa392e3437e2ca6b3344fd646d28de42b3003788dcf23813acce5b279", + "chksum_sha256": "d8dc6e3a2400e0e84f217ae62073adaa904db15e6b2a5a8c804fb8bbef225f0b", "format": 1 }, { @@ -3623,7 +3623,7 @@ "name": "tests/integration/targets/win_initialize_disk/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "a919bbc05e30662072f7cffef03f934527564d1952fab12370f466f53e0e7a5b", + "chksum_sha256": "bf6852c5596e05cc768a17b95ccb2b4f4d168918c252f6a9dbc9dd6f3d12e9f7", "format": 1 }, { @@ -4239,7 +4239,7 @@ "name": "tests/integration/targets/win_nssm/tasks/tests.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "6ea9f0f86fd003478b4a1b284f6ed3f278912e5dfe5bfd4825ac8a8a74195f3e", + "chksum_sha256": "7cbfa6b4edf95562b9e47afc6081d6d2a5f6c03897905cf0e7fadca86886b43e", "format": 1 }, { @@ -4323,7 +4323,7 @@ "name": "tests/integration/targets/win_partition/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b11173553bfb63c218e5f4100c538d6d2cceb11a0f09771d0da768d50efa880e", + "chksum_sha256": "7f6faaa2b8815d0e608a72f50b1ae4acb36f9def21768645e22f61b22cbeb8e2", "format": 1 }, { @@ -4589,14 +4589,14 @@ "name": "tests/integration/targets/win_psmodule/files/module/template.psd1", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e3c123b79dc7d6c177aad7aec2340f3fd67c42bbbb58f056c792f416bc165160", + "chksum_sha256": "5a411be05c13817cfaab55b0b70616364d5c4278bc4e64863e760dc2edd141f3", "format": 1 }, { "name": "tests/integration/targets/win_psmodule/files/module/template.psm1", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "c3af1c293b061aeae55a75922f682b72fe073d23a0214a92ecdf0330ae236c74", + "chksum_sha256": "9b49040430524eab09037994e7b0d8f2f6d0f843cd0f77d4081a2e6d81ab0a70", "format": 1 }, { @@ -4610,14 +4610,14 @@ "name": "tests/integration/targets/win_psmodule/files/setup_certs.sh", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "4db82cd49211a1b4463ec62639d894099c781468198ea22d1448edc8f56d2a01", + "chksum_sha256": "4b11bc1ba1c7d92fc8d9d9d4a544a76e4991ea5d00b3458a2d3f43f8f002f7b6", "format": 1 }, { "name": "tests/integration/targets/win_psmodule/files/setup_modules.ps1", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "71ab33b143470a2ca97ee569f906401cfcef2efdebd2758ef37c26df35c41624", + "chksum_sha256": "e7c6c6a7553f7c07ce0e5d4ef3c07324bf87f4d55e41ca53737bef27cfb56b2e", "format": 1 }, { @@ -4659,14 +4659,14 @@ "name": "tests/integration/targets/win_psmodule/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "1b2adee5ca3e7db150c1ad9adcbe1b485ac72c2d8fc9b614949a0414950a6784", + "chksum_sha256": "f9c5ee848b771149076768be9c678aed807c33c1f233f4a29eebd7f3fb5f5c16", "format": 1 }, { "name": "tests/integration/targets/win_psmodule/tasks/setup.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "91ab3cbcd9536663ad8f68671add4d794152923e3eb76c04d3aea439aa9e60c3", + "chksum_sha256": "c7ccb7644b101659b949b7836f7e0f7400b417b09f2b0d7d3c334ce9f8b898fe", "format": 1 }, { @@ -5531,6 +5531,13 @@ "format": 1 }, { + "name": "tests/integration/targets/win_regmerge/files/settings1c.reg", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9821422fa24c2ed02b15e97aeb9e71250a97a2f76edbc08dc688ce095cd97907", + "format": 1 + }, + { "name": "tests/integration/targets/win_regmerge/files/settings2.reg", "ftype": "file", "chksum_type": "sha256", @@ -5545,6 +5552,13 @@ "format": 1 }, { + "name": "tests/integration/targets/win_regmerge/files/settings3c.reg", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "597165b8a39656ac0f00b52eaee83bd3f8913f33b6e77d692dbac94c528c6216", + "format": 1 + }, + { "name": "tests/integration/targets/win_regmerge/meta", "ftype": "dir", "chksum_type": null, @@ -5569,7 +5583,7 @@ "name": "tests/integration/targets/win_regmerge/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "334193f120c8b5dff8a7ce25f0b81f5b7eb2b47aea9ef93ea44fe77ad418cc96", + "chksum_sha256": "3898860d5721005f107dbac08d111a16f2447d6b9b892eed76f65b45d54d14e4", "format": 1 }, { @@ -5639,7 +5653,7 @@ "name": "tests/integration/targets/win_route/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "131541f93918493fa5b08f5c3530f3f061a9ba09527b6d30ba7a2aa5fdb983e9", + "chksum_sha256": "9ac97039b67100936e00412c2750abcfc2f9fb72a3738d0254c880a7511f6eb8", "format": 1 }, { @@ -5751,7 +5765,7 @@ "name": "tests/integration/targets/win_scheduled_task/tasks/triggers.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "276ab72db53df66741541bbf8307dc0d93d2223b6d05ca703606736e3b377618", + "chksum_sha256": "95ca035a21af310338182001ea0e56b434c51d72665fcc287ab24c8f78466395", "format": 1 }, { @@ -5856,7 +5870,7 @@ "name": "tests/integration/targets/win_scoop/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "7ca8e11325c78f2d61739d8993cb9846c41a74083f1a52399e6bafd8ffcbe2c7", + "chksum_sha256": "758d23e7651820af7b1af35846b0a80daee9e3c321fd9e93a0f60b929035610f", "format": 1 }, { @@ -5905,7 +5919,7 @@ "name": "tests/integration/targets/win_scoop_bucket/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "dfe04062f14c840d5f0ba976715b69d7f347084312eee07a233081f28bd78bb6", + "chksum_sha256": "1aabf18b3e493a2bf65e8256494940c15795202c0132ef951482454ec995d2da", "format": 1 }, { @@ -6462,139 +6476,41 @@ "format": 1 }, { - "name": "tests/sanity/ignore-2.12.txt", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "adbb2b958c5689ab8a5376528853a261f23292a7386a16f2ee445894b513ccfc", - "format": 1 - }, - { - "name": "tests/sanity/ignore-2.13.txt", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "adbb2b958c5689ab8a5376528853a261f23292a7386a16f2ee445894b513ccfc", - "format": 1 - }, - { "name": "tests/sanity/ignore-2.14.txt", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "adbb2b958c5689ab8a5376528853a261f23292a7386a16f2ee445894b513ccfc", + "chksum_sha256": "34d5db2339487ea46fe63a62a31074ae416d290c53f05d3097674fb7ad5c8cd4", "format": 1 }, { "name": "tests/sanity/ignore-2.15.txt", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "adbb2b958c5689ab8a5376528853a261f23292a7386a16f2ee445894b513ccfc", + "chksum_sha256": "34d5db2339487ea46fe63a62a31074ae416d290c53f05d3097674fb7ad5c8cd4", "format": 1 }, { "name": "tests/sanity/ignore-2.16.txt", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "adbb2b958c5689ab8a5376528853a261f23292a7386a16f2ee445894b513ccfc", - "format": 1 - }, - { - "name": "tests/unit", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, - "format": 1 - }, - { - "name": "tests/unit/compat", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, - "format": 1 - }, - { - "name": "tests/unit/compat/__init__.py", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "format": 1 - }, - { - "name": "tests/unit/compat/mock.py", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "a4c95e1616f09fd8cecc228b798dc4a15936d96764e3d9ccdfd7a0d65bec38e4", - "format": 1 - }, - { - "name": "tests/unit/mock", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, - "format": 1 - }, - { - "name": "tests/unit/mock/__init__.py", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "format": 1 - }, - { - "name": "tests/unit/mock/loader.py", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "3b51ec0d45347a3568300e50f688998007e346f052bd2e961c2ac6d13f7cee4d", - "format": 1 - }, - { - "name": "tests/unit/mock/path.py", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "94808cc4dc172c6b671c9b01db06c497c2af358ab989d16ab0638701e88f1921", + "chksum_sha256": "34d5db2339487ea46fe63a62a31074ae416d290c53f05d3097674fb7ad5c8cd4", "format": 1 }, { - "name": "tests/unit/mock/procenv.py", + "name": "tests/sanity/ignore-2.17.txt", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "f924e8a25cfa0531e00bc35df6e3b9790469302296f662c225374b12797bba7b", + "chksum_sha256": "34d5db2339487ea46fe63a62a31074ae416d290c53f05d3097674fb7ad5c8cd4", "format": 1 }, { - "name": "tests/unit/mock/vault_helper.py", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "4535613601c419f7d20f0c21e638dabccf69b4a7fac99d5f6f9b81d1519dafd6", - "format": 1 - }, - { - "name": "tests/unit/mock/yaml_helper.py", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "fada9f3506c951e21c60c2a0e68d3cdf3cadd71c8858b2d14a55c4b778f10983", - "format": 1 - }, - { - "name": "tests/unit/modules", + "name": "tests/unit", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/unit/modules/__init__.py", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "format": 1 - }, - { - "name": "tests/unit/modules/utils.py", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "f69d69fb3ae2f709ff2470342f81bd8db3d7a03bc6296e099a0791d782faffb6", - "format": 1 - }, - { "name": "tests/unit/plugins", "ftype": "dir", "chksum_type": null, @@ -6609,20 +6525,6 @@ "format": 1 }, { - "name": "tests/unit/plugins/lookup/fixtures", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, - "format": 1 - }, - { - "name": "tests/unit/plugins/lookup/fixtures/avi.json", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "3739de410d134591fada61f62053bfab6fcbd5c80fe2267faa7971f9fe36570d", - "format": 1 - }, - { "name": "tests/unit/plugins/lookup/__init__.py", "ftype": "file", "chksum_type": "sha256", @@ -6633,7 +6535,7 @@ "name": "tests/unit/plugins/lookup/test_laps_password.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d23071d213784b71a61661cc7c63ce4308c177ea8f758e3c53c14420675923f2", + "chksum_sha256": "750dc241398eb37b8185e37e920df70a2dfca313ee677a8f8af802df6975d48b", "format": 1 }, { @@ -6679,6 +6581,13 @@ "format": 1 }, { + "name": "tests/utils/shippable/lint.sh", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f945142c1487de0996b9bc46bc18c82d5c0b6c9470f0f48b87634c2e4b0eabf5", + "format": 1 + }, + { "name": "tests/utils/shippable/sanity.sh", "ftype": "file", "chksum_type": "sha256", @@ -6717,7 +6626,14 @@ "name": "tests/requirements.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "bd88d210dd7925cf3eb92089130a1b224d03d9b5819460d8f5c2730e36b660b2", + "chksum_sha256": "2cc0597c9b37871d09d40b2bb2621a9a283c77bf7ff156aab15b9e7d2eb3c1c0", + "format": 1 + }, + { + "name": ".ansible-lint", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "33235ea099dc7bd2061e0271afcef60424799834d3023d14652b6296e3f133c2", "format": 1 }, { @@ -6738,7 +6654,7 @@ "name": "CHANGELOG.rst", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d7402c38ff658706bd14d6c7db15c7b50fbcafad51d03d4ef81ea4c2094cf20c", + "chksum_sha256": "c19e618b935eb0588c50cf40f93359070055ef669fbcbfdc94a339cca07c4258", "format": 1 }, { @@ -6752,7 +6668,7 @@ "name": "README.md", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d41e4c3d8b7699c6d9770a9824f75094b45c3cf933a76fcdfa1d6736ba33a3d3", + "chksum_sha256": "98b212d39e176b17d4495994075de095d518680b0c61300404878f9c040c7712", "format": 1 } ], diff --git a/ansible_collections/community/windows/MANIFEST.json b/ansible_collections/community/windows/MANIFEST.json index 9ccb7a7c3..d70dd8520 100644 --- a/ansible_collections/community/windows/MANIFEST.json +++ b/ansible_collections/community/windows/MANIFEST.json @@ -2,7 +2,7 @@ "collection_info": { "namespace": "community", "name": "windows", - "version": "1.13.0", + "version": "2.2.0", "authors": [ "Jordan Borean @jborean93", "Matt Davis @nitzmahone" @@ -15,7 +15,7 @@ "license": [], "license_file": "COPYING", "dependencies": { - "ansible.windows": ">=0.0.0,<2.0.0" + "ansible.windows": ">=1.0.0,<3.0.0" }, "repository": "https://github.com/ansible-collections/community.windows", "documentation": "https://docs.ansible.com/ansible/devel/collections/community/windows", @@ -26,7 +26,7 @@ "name": "FILES.json", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "3052b173ce376c2ede2b3307a6074b34d1bf10f772e8941fca335477e66958b8", + "chksum_sha256": "0c430f767a4fe9b34435d4387118a1ba094819990922437b39aa7a95673f1367", "format": 1 }, "format": 1 diff --git a/ansible_collections/community/windows/README.md b/ansible_collections/community/windows/README.md index 895999ee2..489e2b836 100644 --- a/ansible_collections/community/windows/README.md +++ b/ansible_collections/community/windows/README.md @@ -8,7 +8,7 @@ The `community.windows` collection includes the community plugins supported by A ## Ansible version compatibility -This collection has been tested against following Ansible versions: **>=2.12**. +This collection has been tested against following Ansible versions: **>=2.14**. Plugins and modules within a collection may be tested with only specific Ansible versions. A collection may contain metadata that identifies these versions. diff --git a/ansible_collections/community/windows/changelogs/changelog.yaml b/ansible_collections/community/windows/changelogs/changelog.yaml index d64c61b79..58d105a3b 100644 --- a/ansible_collections/community/windows/changelogs/changelog.yaml +++ b/ansible_collections/community/windows/changelogs/changelog.yaml @@ -462,3 +462,97 @@ releases: - 347_win_iis_virtualdirectory.yml - release-2.9.0.yml release_date: '2021-12-21' + 2.0.0: + changes: + bugfixes: + - win_psmodule - fix requireLicenseAcceptance test so that it is no longer always + true + deprecated_features: + - win_domain_computer - Module is deprecated in favour of the ``microsoft.ad.computer`` + module, the ``community.windows.win_domain_computer`` module will be removed + in the ``3.0.0`` release of this collection. + - win_domain_group - Module is deprecated in favour of the ``microsoft.ad.group`` + module, the ``community.windows.win_domain_group`` module will be removed + in the ``3.0.0`` release of this collection. + - win_domain_group_membership - Module is deprecated in favour of the ``microsoft.ad.group`` + module, the ``community.windows.win_domain_group_membership`` module will + be removed in the ``3.0.0`` release of this collection. + - win_domain_object_info - Module is deprecated in favour of the ``microsoft.ad.object_info`` + module, the ``community.windows.win_domain_object_info`` module will be removed + in the ``3.0.0`` release of this collection. + - win_domain_ou - Module is deprecated in favour of the ``microsoft.ad.ou`` + module, the ``community.windows.win_domain_ou`` module will be removed in + the ``3.0.0`` release of this collection. + - win_domain_user - Module is deprecated in favour of the ``microsoft.ad.user`` + module, the ``community.windows.win_domain_user`` module will be removed in + the ``3.0.0`` release of this collection. + minor_changes: + - win_dns_record - Added ``zone_scope`` option to manage a record in a specific + zone scope + release_summary: Version ``2.0.0`` is a major release of the ``community.windows`` + collection that removes some deprecated features. Please review the changelog + to see what deprecated features have been removed in this release. + removed_features: + - Removed testing for Server 2012 and Server 2012 R2 as they are reaching End + of Life status from Microsoft. These OS versions may continue to work but + will not be tested in CI. + - win_nssm - Removed the deprecated module option ``app_parameters``, use ``arguments`` + instead. + - win_psmodule - Removed the deprecated module option ``url``, use ``community.windows.win_psrepository`` + to manage repositories instead + - 'win_psmodule - Will no longer remove the ``repository`` specified when ``state: + absent``, use ``community.windows.win_psrepository`` to manage repositories + instead' + - win_scheduled_tasks - Removed support for a trigger ``repetition`` to be defined + as a list of dictionary entries. Specify the ``repetition`` as a dictionary + value rather than a list of dictionaries. + fragments: + - 522-win_psmodule-requirelicenseacceptance.yml + - microsoft-ad-deprecations.yml + - release_summary.yml + - server2012.yml + - win_dns_record-zone-scope.yml + - win_nssm-removed-features.yml + - win_psmodule-removed-features.yml + - win_scheduled_task-removed-features.yml + release_date: '2023-06-14' + 2.1.0: + changes: + bugfixes: + - Remove some code which is no longer valid for dotnet 5+ + - community.windows.win_psmodule_info - exception thrown when host has no Installed + Module. Fix now checks that variable $installedModules is not null before + calling the .Contains(..) function on it. + - win_rabbitmq_plugin - Avoid using ``Invoke-Expression`` when running external + commands + - win_rds_rap - The module crashed when creating a RAP with Gateway Managed + Computer Group (https://github.com/ansible-collections/community.windows/issues/184). + minor_changes: + - Set minimum supported Ansible version to 2.14 to align with the versions still + supported by Ansible. + release_summary: Release summary for v2.1.0 + fragments: + - 534-rds-rap-fix-gw-managed-comp-groups.yml + - ansible_support.yml + - dotnet-preparation.yml + - release_summary.yml + - win_psmodule_info.yml + - win_rabbitmq_plugin_iex.yml + release_date: '2023-11-16' + 2.2.0: + changes: + bugfixes: + - win_format, win_partition - Add support for Windows failover cluster disks + - win_psmodule - Fix up error message with ``state=latest`` + - win_robocopy - Fix up ``cmd`` return value to include the executable ``robocopy`` + minor_changes: + - win_regmerge - Add content 'content' parameter for specifying registry file + contents directly + release_summary: Release summary for v2.2.0 + fragments: + - 543-support_for_failover_cluster.yaml + - 546-win_regmerge-add_content_parameter.yaml + - release-summary.yml + - win_psmodule-error.yml + - win_robocopy-cmd.yml + release_date: '2024-03-20' diff --git a/ansible_collections/community/windows/changelogs/config.yaml b/ansible_collections/community/windows/changelogs/config.yaml index 78e36a2b4..92ae1e2b8 100644 --- a/ansible_collections/community/windows/changelogs/config.yaml +++ b/ansible_collections/community/windows/changelogs/config.yaml @@ -9,21 +9,21 @@ notesdir: fragments prelude_section_name: release_summary prelude_section_title: Release Summary sections: -- - major_changes - - Major Changes -- - minor_changes - - Minor Changes -- - breaking_changes - - Breaking Changes / Porting Guide -- - deprecated_features - - Deprecated Features -- - removed_features - - Removed Features (previously deprecated) -- - security_fixes - - Security Fixes -- - bugfixes - - Bugfixes -- - known_issues - - Known Issues + - - major_changes + - Major Changes + - - minor_changes + - Minor Changes + - - breaking_changes + - Breaking Changes / Porting Guide + - - deprecated_features + - Deprecated Features + - - removed_features + - Removed Features (previously deprecated) + - - security_fixes + - Security Fixes + - - bugfixes + - Bugfixes + - - known_issues + - Known Issues title: Community Windows trivial_section_name: trivial diff --git a/ansible_collections/community/windows/meta/runtime.yml b/ansible_collections/community/windows/meta/runtime.yml index 1f0649152..34003e06c 100644 --- a/ansible_collections/community/windows/meta/runtime.yml +++ b/ansible_collections/community/windows/meta/runtime.yml @@ -1 +1,27 @@ -requires_ansible: '>=2.12' +requires_ansible: '>=2.14' +plugin_routing: + modules: + win_domain_computer: + deprecation: + removal_version: 3.0.0 + warning_text: Use microsoft.ad.computer instead. + win_domain_group_membership: + deprecation: + removal_version: 3.0.0 + warning_text: Use microsoft.ad.group instead. + win_domain_group: + deprecation: + removal_version: 3.0.0 + warning_text: Use microsoft.ad.group instead. + win_domain_object_info: + deprecation: + removal_version: 3.0.0 + warning_text: Use microsoft.ad.object_info instead. + win_domain_ou: + deprecation: + removal_version: 3.0.0 + warning_text: Use microsoft.ad.ou instead. + win_domain_user: + deprecation: + removal_version: 3.0.0 + warning_text: Use microsoft.ad.user instead.
\ No newline at end of file diff --git a/ansible_collections/community/windows/plugins/modules/psexec.py b/ansible_collections/community/windows/plugins/modules/psexec.py index 36541ca67..c2d96f293 100644 --- a/ansible_collections/community/windows/plugins/modules/psexec.py +++ b/ansible_collections/community/windows/plugins/modules/psexec.py @@ -283,7 +283,7 @@ EXAMPLES = r''' $sec_protocols = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::SystemDefault $sec_protocols = $sec_protocols -bor [Net.SecurityProtocolType]::Tls12 [Net.ServicePointManager]::SecurityProtocol = $sec_protocols - $url = "https://github.com/ansible/ansible/raw/devel/examples/scripts/ConfigureRemotingForAnsible.ps1" + $url = "https://github.com/ansible/ansible-documentation/raw/devel/examples/scripts/ConfigureRemotingForAnsible.ps1" Invoke-Expression ((New-Object Net.WebClient).DownloadString($url)) exit delegate_to: localhost diff --git a/ansible_collections/community/windows/plugins/modules/win_auto_logon.ps1 b/ansible_collections/community/windows/plugins/modules/win_auto_logon.ps1 index 66a20dd9e..ee76c4f7a 100644 --- a/ansible_collections/community/windows/plugins/modules/win_auto_logon.ps1 +++ b/ansible_collections/community/windows/plugins/modules/win_auto_logon.ps1 @@ -53,7 +53,6 @@ if ($state -eq 'absent') { Add-CSharpType -AnsibleModule $module -References @' using Microsoft.Win32.SafeHandles; using System; -using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; using System.Text; @@ -154,8 +153,6 @@ namespace Ansible.WinAutoLogon { internal SafeLsaMemory() : base(true) { } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - protected override bool ReleaseHandle() { return NativeMethods.LsaFreeMemory(handle) == 0; @@ -171,8 +168,6 @@ namespace Ansible.WinAutoLogon base.SetHandle(ptr); } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - protected override bool ReleaseHandle() { if (handle != IntPtr.Zero) @@ -185,8 +180,6 @@ namespace Ansible.WinAutoLogon { internal SafeLsaHandle() : base(true) { } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - protected override bool ReleaseHandle() { return NativeMethods.LsaClose(handle) == 0; diff --git a/ansible_collections/community/windows/plugins/modules/win_credential.ps1 b/ansible_collections/community/windows/plugins/modules/win_credential.ps1 index b39bff57e..72fd6960c 100644 --- a/ansible_collections/community/windows/plugins/modules/win_credential.ps1 +++ b/ansible_collections/community/windows/plugins/modules/win_credential.ps1 @@ -60,7 +60,6 @@ using Microsoft.Win32.SafeHandles; using System; using System.Collections.Generic; using System.Linq; -using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; using System.Text; @@ -223,7 +222,6 @@ namespace Ansible.CredentialManager { public SafeCredentialBuffer() : base(true) { } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] protected override bool ReleaseHandle() { NativeMethods.CredFree(handle); @@ -242,7 +240,6 @@ namespace Ansible.CredentialManager { base.SetHandle(handle); } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] protected override bool ReleaseHandle() { Marshal.FreeHGlobal(handle); diff --git a/ansible_collections/community/windows/plugins/modules/win_credential.py b/ansible_collections/community/windows/plugins/modules/win_credential.py index fd605f0d0..ca942d926 100644 --- a/ansible_collections/community/windows/plugins/modules/win_credential.py +++ b/ansible_collections/community/windows/plugins/modules/win_credential.py @@ -97,7 +97,7 @@ options: - When C(absent), the credential specified by I(name) and I(type) is removed. - When C(present), the credential specified by I(name) and I(type) is - removed. + added. type: str choices: [ absent, present ] default: present diff --git a/ansible_collections/community/windows/plugins/modules/win_dns_record.ps1 b/ansible_collections/community/windows/plugins/modules/win_dns_record.ps1 index f19d9d3c4..5212d1ace 100644 --- a/ansible_collections/community/windows/plugins/modules/win_dns_record.ps1 +++ b/ansible_collections/community/windows/plugins/modules/win_dns_record.ps1 @@ -17,6 +17,7 @@ $spec = @{ value = @{ type = "list"; elements = "str"; default = @() ; aliases = @( 'values' ) } weight = @{ type = "int" } zone = @{ type = "str"; required = $true } + zone_scope = @{ type = "str" } computer_name = @{ type = "str" } } required_if = @(, @("type", "SRV", @("port", "priority", "weight"))) @@ -34,6 +35,7 @@ $type = $module.Params.type $values = $module.Params.value $weight = $module.Params.weight $zone = $module.Params.zone +$zone_scope = $module.Params.zone_scope $dns_computer_name = $module.Params.computer_name $extra_args = @{} @@ -42,6 +44,9 @@ $extra_args_new_records = @{} if ($null -ne $dns_computer_name) { $extra_args.ComputerName = $dns_computer_name } +if ($null -ne $zone_scope) { + $extra_args.ZoneScope = $zone_scope +} if ($aging -eq $true) { $extra_args_new_records.AgeRecord = $true } @@ -118,7 +123,8 @@ if ($null -ne $records) { $record_value = $record.RecordData.$(Get-DnsServerResourceRecordDataPropertyName).ToString() if ((-Not $required_values.ContainsKey($record_value)) -Or (-Not $record_aging_old -eq $aging)) { $record | Remove-DnsServerResourceRecord -ZoneName $zone -Force -WhatIf:$module.CheckMode @extra_args - $changes.before += "[$zone] $($record.HostName) $($record.TimeToLive.TotalSeconds) IN $type $record_value`n" + $changes.before += "[$zone{0}] $($record.HostName) $($record.TimeToLive.TotalSeconds) IN $type $record_value`n" ` + -f ("", "/$zone_scope")[$null -ne $zone_scope] $module.Result.changed = $true } else { @@ -136,10 +142,12 @@ if ($null -ne $records) { Set-DnsServerResourceRecord -ZoneName $zone -OldInputObject $record -NewInputObject $new_record -WhatIf:$module.CheckMode @extra_args $changes.before += -join @( - "[$zone] $($record.HostName) $($record.TimeToLive.TotalSeconds) IN " + "[$zone{0}] $($record.HostName) $($record.TimeToLive.TotalSeconds) IN " ` + -f ("", "/$zone_scope")[$null -ne $zone_scope] "$type $record_value $record_port_old $record_weight_old $record_priority_old`n" ) - $changes.after += "[$zone] $($record.HostName) $($ttl.TotalSeconds) IN $type $record_value $port $weight $priority`n" + $changes.after += "[$zone{0}] $($record.HostName) $($ttl.TotalSeconds) IN $type $record_value $port $weight $priority`n" ` + -f ("", "/$zone_scope")[$null -ne $zone_scope] $module.Result.changed = $true } } @@ -149,8 +157,10 @@ if ($null -ne $records) { $new_record = $record.Clone() $new_record.TimeToLive = $ttl Set-DnsServerResourceRecord -ZoneName $zone -OldInputObject $record -NewInputObject $new_record -WhatIf:$module.CheckMode @extra_args - $changes.before += "[$zone] $($record.HostName) $($record.TimeToLive.TotalSeconds) IN $type $record_value`n" - $changes.after += "[$zone] $($record.HostName) $($ttl.TotalSeconds) IN $type $record_value`n" + $changes.before += "[$zone{0}] $($record.HostName) $($record.TimeToLive.TotalSeconds) IN $type $record_value`n" ` + -f ("", "/$zone_scope")[$null -ne $zone_scope] + $changes.after += "[$zone{0}] $($record.HostName) $($ttl.TotalSeconds) IN $type $record_value`n" ` + -f ("", "/$zone_scope")[$null -ne $zone_scope] $module.Result.changed = $true } } @@ -184,7 +194,8 @@ if ($null -ne $values -and $values.Count -gt 0) { catch { $module.FailJson("Error adding DNS $type resource $name in zone $zone with value $value", $_) } - $changes.after += "[$zone] $name $($ttl.TotalSeconds) IN $type $value`n" + $changes.after += "[$zone{0}] $name $($ttl.TotalSeconds) IN $type $value`n" ` + -f ("", "/$zone_scope")[$null -ne $zone_scope] } $module.Result.changed = $true } @@ -199,12 +210,14 @@ else { $records_end = Get-DnsServerResourceRecord -ZoneName $zone -Name $name -RRType $type -Node -ErrorAction:Ignore @extra_args | Sort-Object $module.Diff.before = @( $records | ForEach-Object { - "[$zone] $($_.HostName) $($_.TimeToLive.TotalSeconds) IN $type $($_.RecordData.$(Get-DnsServerResourceRecordDataPropertyName).ToString())`n" + "[$zone{0}] $($_.HostName) $($_.TimeToLive.TotalSeconds) IN $type $($_.RecordData.$(Get-DnsServerResourceRecordDataPropertyName).ToString())`n" ` + -f ("", "/$zone_scope")[$null -ne $zone_scope] } ) -join '' $module.Diff.after = @( $records_end | ForEach-Object { - "[$zone] $($_.HostName) $($_.TimeToLive.TotalSeconds) IN $type $($_.RecordData.$(Get-DnsServerResourceRecordDataPropertyName).ToString())`n" + "[$zone{0}] $($_.HostName) $($_.TimeToLive.TotalSeconds) IN $type $($_.RecordData.$(Get-DnsServerResourceRecordDataPropertyName).ToString())`n" ` + -f ("", "/$zone_scope")[$null -ne $zone_scope] } ) -join '' } diff --git a/ansible_collections/community/windows/plugins/modules/win_dns_record.py b/ansible_collections/community/windows/plugins/modules/win_dns_record.py index 38692e311..97242c949 100644 --- a/ansible_collections/community/windows/plugins/modules/win_dns_record.py +++ b/ansible_collections/community/windows/plugins/modules/win_dns_record.py @@ -91,6 +91,13 @@ options: - The zone must already exist. required: yes type: str + zone_scope: + description: + - The name of the zone scope to manage (eg C(ScopeAZ)). + - The zone must already exist. + required: no + type: str + version_added: 2.0.0 computer_name: description: - Specifies a DNS server. @@ -193,6 +200,16 @@ EXAMPLES = r''' type: "TXT" value: "justavalue" zone: "example.com" + +# Demostrate creating a A record to Zone Scope + +- name: Create database server record + community.windows.win_dns_record: + name: "cgyl1404p.amer.example.com" + type: "A" + value: "10.1.1.1" + zone: "amer.example.com" + zone_scope: "external" ''' RETURN = r''' diff --git a/ansible_collections/community/windows/plugins/modules/win_domain_computer.py b/ansible_collections/community/windows/plugins/modules/win_domain_computer.py index aff0f4687..b19b0760e 100644 --- a/ansible_collections/community/windows/plugins/modules/win_domain_computer.py +++ b/ansible_collections/community/windows/plugins/modules/win_domain_computer.py @@ -13,6 +13,10 @@ description: - Create, read, update and delete computers in Active Directory using a windows bridge computer to launch New-ADComputer, Get-ADComputer, Set-ADComputer, Remove-ADComputer and Move-ADObject powershell commands. +deprecated: + removed_in: 3.0.0 + why: This module has been moved into the C(microsoft.ad) collection. + alternative: Use the M(microsoft.ad.computer) module instead. options: name: description: diff --git a/ansible_collections/community/windows/plugins/modules/win_domain_group.py b/ansible_collections/community/windows/plugins/modules/win_domain_group.py index b761055e8..729f6f6f7 100644 --- a/ansible_collections/community/windows/plugins/modules/win_domain_group.py +++ b/ansible_collections/community/windows/plugins/modules/win_domain_group.py @@ -11,6 +11,10 @@ short_description: Creates, modifies or removes domain groups description: - Creates, modifies or removes groups in Active Directory. - For local groups, use the M(ansible.windows.win_group) module instead. +deprecated: + removed_in: 3.0.0 + why: This module has been moved into the C(microsoft.ad) collection. + alternative: Use the M(microsoft.ad.group) module instead. options: attributes: description: diff --git a/ansible_collections/community/windows/plugins/modules/win_domain_group_membership.py b/ansible_collections/community/windows/plugins/modules/win_domain_group_membership.py index 5e10ac3b2..d3e0901f9 100644 --- a/ansible_collections/community/windows/plugins/modules/win_domain_group_membership.py +++ b/ansible_collections/community/windows/plugins/modules/win_domain_group_membership.py @@ -11,6 +11,10 @@ short_description: Manage Windows domain group membership description: - Allows the addition and removal of domain users and domain groups from/to a domain group. +deprecated: + removed_in: 3.0.0 + why: This module has been moved into the C(microsoft.ad) collection. + alternative: Use the M(microsoft.ad.group) module instead. options: name: description: diff --git a/ansible_collections/community/windows/plugins/modules/win_domain_object_info.py b/ansible_collections/community/windows/plugins/modules/win_domain_object_info.py index c7efac7fe..ddd0ab2d0 100644 --- a/ansible_collections/community/windows/plugins/modules/win_domain_object_info.py +++ b/ansible_collections/community/windows/plugins/modules/win_domain_object_info.py @@ -10,6 +10,10 @@ module: win_domain_object_info short_description: Gather information an Active Directory object description: - Gather information about multiple Active Directory object(s). +deprecated: + removed_in: 3.0.0 + why: This module has been moved into the C(microsoft.ad) collection. + alternative: Use the M(microsoft.ad.object_info) module instead. options: domain_password: description: diff --git a/ansible_collections/community/windows/plugins/modules/win_domain_ou.py b/ansible_collections/community/windows/plugins/modules/win_domain_ou.py index e144b8373..30ad0ed86 100644 --- a/ansible_collections/community/windows/plugins/modules/win_domain_ou.py +++ b/ansible_collections/community/windows/plugins/modules/win_domain_ou.py @@ -18,6 +18,10 @@ description: - Manage Active Directory Organizational Units - Adds, Removes and Modifies Active Directory Organizational Units - Task should be delegated to a Windows Active Directory Domain Controller +deprecated: + removed_in: 3.0.0 + why: This module has been moved into the C(microsoft.ad) collection. + alternative: Use the M(microsoft.ad.ou) module instead. options: name: description: diff --git a/ansible_collections/community/windows/plugins/modules/win_domain_user.py b/ansible_collections/community/windows/plugins/modules/win_domain_user.py index aee5efd0a..3e7290fff 100644 --- a/ansible_collections/community/windows/plugins/modules/win_domain_user.py +++ b/ansible_collections/community/windows/plugins/modules/win_domain_user.py @@ -9,6 +9,10 @@ module: win_domain_user short_description: Manages Windows Active Directory user accounts description: - Manages Windows Active Directory user accounts. +deprecated: + removed_in: 3.0.0 + why: This module has been moved into the C(microsoft.ad) collection. + alternative: Use the M(microsoft.ad.user) module instead. options: name: description: diff --git a/ansible_collections/community/windows/plugins/modules/win_format.ps1 b/ansible_collections/community/windows/plugins/modules/win_format.ps1 index 0746fbe47..86d918e0b 100644 --- a/ansible_collections/community/windows/plugins/modules/win_format.ps1 +++ b/ansible_collections/community/windows/plugins/modules/win_format.ps1 @@ -74,7 +74,13 @@ function Get-AnsibleVolume { if ($null -ne $DriveLetter) { try { - $volume = Get-Volume -DriveLetter $DriveLetter + # This needs to be a two step process so that we can support Windows failover cluster disks. + # With Windows failover cluster disks every node sees every disk participating in that cluster. + # For example a clustered disk in a three node cluster will show up three times. + # Fortunatly we can differentiate local from remote disk as only local disk will ever have a disk number. + # So with that we just ignore all disk without a number which will result in a local disk being picked. + $partition = Get-Partition -DriveLetter $DriveLetter | Where-Object { $null -ne $_.DiskNumber } + $volume = Get-Volume -Partition $partition } catch { $module.FailJson("There was an error retrieving the volume using drive_letter $($DriveLetter): $($_.Exception.Message)", $_) diff --git a/ansible_collections/community/windows/plugins/modules/win_iis_webapppool.py b/ansible_collections/community/windows/plugins/modules/win_iis_webapppool.py index 7cca2e3bf..5397b9df5 100644 --- a/ansible_collections/community/windows/plugins/modules/win_iis_webapppool.py +++ b/ansible_collections/community/windows/plugins/modules/win_iis_webapppool.py @@ -94,6 +94,14 @@ EXAMPLES = r''' managedRuntimeVersion: v4.0 autoStart: no +- name: Creates an application pool with "No Managed Code" for .Net compatibility + community.windows.win_iis_webapppool: + name: AnotherAppPool + state: started + attributes: + managedRuntimeVersion: '' + autoStart: false + # In the below example we are setting attributes in child element processModel # https://www.iis.net/configreference/system.applicationhost/applicationpools/add/processmodel - name: Manage child element and set identity of application pool diff --git a/ansible_collections/community/windows/plugins/modules/win_inet_proxy.ps1 b/ansible_collections/community/windows/plugins/modules/win_inet_proxy.ps1 index 769a8f725..e210057c9 100644 --- a/ansible_collections/community/windows/plugins/modules/win_inet_proxy.ps1 +++ b/ansible_collections/community/windows/plugins/modules/win_inet_proxy.ps1 @@ -68,7 +68,6 @@ $win_inet_invoke = @' using Microsoft.Win32.SafeHandles; using System; using System.Collections.Generic; -using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; namespace Ansible.WinINetProxy @@ -197,7 +196,6 @@ namespace Ansible.WinINetProxy base.SetHandle(handle); } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] protected override bool ReleaseHandle() { Marshal.FreeHGlobal(handle); diff --git a/ansible_collections/community/windows/plugins/modules/win_mapped_drive.ps1 b/ansible_collections/community/windows/plugins/modules/win_mapped_drive.ps1 index 210ae223a..ff1898884 100644 --- a/ansible_collections/community/windows/plugins/modules/win_mapped_drive.ps1 +++ b/ansible_collections/community/windows/plugins/modules/win_mapped_drive.ps1 @@ -41,7 +41,6 @@ Add-CSharpType -AnsibleModule $module -References @' using Microsoft.Win32.SafeHandles; using System; using System.Collections.Generic; -using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; namespace Ansible.MappedDrive @@ -160,7 +159,6 @@ namespace Ansible.MappedDrive base.SetHandle(handle); } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] protected override bool ReleaseHandle() { Marshal.FreeHGlobal(handle); diff --git a/ansible_collections/community/windows/plugins/modules/win_nssm.ps1 b/ansible_collections/community/windows/plugins/modules/win_nssm.ps1 index 3b951cf19..966780552 100644 --- a/ansible_collections/community/windows/plugins/modules/win_nssm.ps1 +++ b/ansible_collections/community/windows/plugins/modules/win_nssm.ps1 @@ -31,7 +31,6 @@ $description = Get-AnsibleParam -obj $params -name 'description' -type 'str' $application = Get-AnsibleParam -obj $params -name "application" -type "path" $appDirectory = Get-AnsibleParam -obj $params -name "working_directory" -aliases "app_directory", "chdir" -type "path" -$appParameters = Get-AnsibleParam -obj $params -name "app_parameters" $appArguments = Get-AnsibleParam -obj $params -name "arguments" -aliases "app_parameters_free_form" $stdoutFile = Get-AnsibleParam -obj $params -name "stdout_file" -type "path" @@ -46,7 +45,6 @@ $app_rotate_online = Get-AnsibleParam -obj $params -name "app_rotate_online" -ty $app_stop_method_console = Get-AnsibleParam -obj $params -name "app_stop_method_console" -type "int" $app_stop_method_skip = Get-AnsibleParam -obj $params -name "app_stop_method_skip" -type "int" -validateset 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 -# Deprecated options, will be removed in a major release after 2021-07-01. $startMode = Get-AnsibleParam -obj $params -name "start_mode" -type "str" -default "auto" -validateset $start_modes_map.Keys -resultobj $result $dependencies = Get-AnsibleParam -obj $params -name "dependencies" -type "list" $user = Get-AnsibleParam -obj $params -name "username" -type "str" -aliases "user" @@ -297,27 +295,6 @@ function Stop-NssmService { } } -function Add-DepByDate { - [CmdletBinding()] - param( - [Parameter(Mandatory = $true)] - [String]$Message, - - [Parameter(Mandatory = $true)] - [String]$Date - ) - - # Legacy doesn't natively support deprecate by date, need to do this manually until we use Ansible.Basic - if (-not $result.ContainsKey('deprecations')) { - $result.deprecations = @() - } - $result.deprecations += @{ - msg = $Message - date = $Date - collection_name = "community.windows" - } -} - Function ConvertTo-NormalizedUser { [CmdletBinding()] param ( @@ -380,38 +357,6 @@ Function ConvertTo-NormalizedUser { } } -if (($null -ne $appParameters) -and ($null -ne $appArguments)) { - Fail-Json $result "'app_parameters' and 'arguments' are mutually exclusive but have both been set." -} - -# Backward compatibility for old parameters style. Remove the block bellow in 2.12 -if ($null -ne $appParameters) { - $dep = @{ - Message = "The parameter 'app_parameters' will be removed soon, use 'arguments' instead" - Date = "2022-07-01" - } - Add-DepByDate @dep - - if ($appParameters -isnot [string]) { - Fail-Json -obj $result -message "The app_parameters parameter must be a string representing a dictionary." - } - - # Convert dict-as-string form to list - $escapedAppParameters = $appParameters.TrimStart("@").TrimStart("{").TrimEnd("}").Replace("; ", "`n").Replace("\", "\\") - $appParametersHash = ConvertFrom-StringData -StringData $escapedAppParameters - - $appParamsArray = @() - $appParametersHash.GetEnumerator() | Foreach-Object { - if ($_.Name -ne "_") { - $appParamsArray += $_.Name - } - $appParamsArray += $_.Value - } - $appArguments = @($appParamsArray) - - # The rest of the code should use only the new $appArguments variable -} - if ($state -ne 'absent') { if ($null -eq $application) { Fail-Json -obj $result -message "The application parameter must be defined when the state is not absent." diff --git a/ansible_collections/community/windows/plugins/modules/win_nssm.py b/ansible_collections/community/windows/plugins/modules/win_nssm.py index d79f638b8..8cc434a5a 100644 --- a/ansible_collections/community/windows/plugins/modules/win_nssm.py +++ b/ansible_collections/community/windows/plugins/modules/win_nssm.py @@ -56,17 +56,10 @@ options: description: - Path to receive error output. type: path - app_parameters: - description: - - A string representing a dictionary of parameters to be passed to the application when it starts. - - DEPRECATED since v2.8, please use I(arguments) instead. - - This is mutually exclusive with I(arguments). - type: str arguments: description: - Parameters to be passed to the application when it starts. - This can be either a simple string or a list. - - This is mutually exclusive with I(app_parameters). aliases: [ app_parameters_free_form ] type: str dependencies: diff --git a/ansible_collections/community/windows/plugins/modules/win_partition.ps1 b/ansible_collections/community/windows/plugins/modules/win_partition.ps1 index 6e4517690..a6ce1d5c4 100644 --- a/ansible_collections/community/windows/plugins/modules/win_partition.ps1 +++ b/ansible_collections/community/windows/plugins/modules/win_partition.ps1 @@ -100,7 +100,12 @@ if ($null -ne $disk_number -and $null -ne $partition_number) { # Check if drive_letter is either auto-assigned or a character from A-Z elseif ($drive_letter -and $drive_letter -ne "auto" -and -not ($disk_number -and $partition_number)) { if ($drive_letter -match "^[a-zA-Z]$") { - $ansible_partition = Get-Partition -DriveLetter $drive_letter -ErrorAction SilentlyContinue + # This step need to be a bit more complex so that we can support Windows failover cluster disks. + # With Windows failover cluster disks every node sees every disk participating in that cluster. + # For example a clustered disk in a three node cluster will show up three times. + # Fortunatly we can differentiate local from remote disk as only local disk will ever have a disk number. + # So with that we just ignore all disk without a number which will result in a local disk being picked. + $ansible_partition = Get-Partition -DriveLetter $drive_letter -ErrorAction SilentlyContinue | Where-Object { $null -ne $_.DiskNumber } } else { $module.FailJson("Incorrect usage of drive_letter: specify a drive letter from A-Z or use 'auto' to automatically assign a drive letter") diff --git a/ansible_collections/community/windows/plugins/modules/win_psmodule.ps1 b/ansible_collections/community/windows/plugins/modules/win_psmodule.ps1 index f755e8dda..788519143 100644 --- a/ansible_collections/community/windows/plugins/modules/win_psmodule.ps1 +++ b/ansible_collections/community/windows/plugins/modules/win_psmodule.ps1 @@ -18,7 +18,6 @@ $maximum_version = Get-AnsibleParam -obj $params -name "maximum_version" -type " $repo = Get-AnsibleParam -obj $params -name "repository" -type "str" $repo_user = Get-AnsibleParam -obj $params -name "username" -type "str" $repo_pass = Get-AnsibleParam -obj $params -name "password" -type "str" -$url = Get-AnsibleParam -obj $params -name "url" -type str $state = Get-AnsibleParam -obj $params -name "state" -type "str" -default "present" -validateset "present", "absent", "latest" $allow_clobber = Get-AnsibleParam -obj $params -name "allow_clobber" -type "bool" -default $false $skip_publisher_check = Get-AnsibleParam -obj $params -name "skip_publisher_check" -type "bool" -default $false @@ -255,8 +254,11 @@ Function Install-PsModule { "Repository", "Credential") $ht = Add-DefinedParameter -Hashtable $ht -ParametersNames $ParametersNames - # When module require License Acceptance, `-Force` is mandatory to skip interactive prompt - if ((Find-Module @ht).AdditionalMetadata.requireLicenseAcceptance) { + # When module require License Acceptance, or repository is Untrusted. + # `-Force` is mandatory to skip interactive prompt + $psgetModuleInfo = Find-Module @ht + if (($psgetModuleInfo.AdditionalMetadata.requireLicenseAcceptance -eq "True") -or + ((Get-PSRepository -Name $psgetModuleInfo.Repository).InstallationPolicy -eq "Untrusted")) { $ht["Force"] = $true } else { @@ -363,82 +365,6 @@ Function Find-LatestPsModule { $LatestModuleVersion } -Function Install-Repository { - Param( - [Parameter(Mandatory = $true)] - [string]$Name, - [Parameter(Mandatory = $true)] - [string]$Url, - [bool]$CheckMode - ) - # Legacy doesn't natively support deprecate by date, need to do this manually until we use Ansible.Basic - if (-not $result.ContainsKey('deprecations')) { - $result.deprecations = @() - } - $msg = -join @( - "Adding a repo with this module is deprecated, the repository parameter should only be used to select a repo. " - "Use community.windows.win_psrepository to manage repos" - ) - $result.deprecations += @{ - msg = $msg - date = "2021-07-01" - collection_name = "community.windows" - } - # Install NuGet provider if needed. - Install-NugetProvider -CheckMode $CheckMode - - $Repos = (Get-PSRepository).SourceLocation - - # If repository isn't already present, try to register it as trusted. - if ($Repos -notcontains $Url) { - try { - if ( -not ($CheckMode) ) { - Register-PSRepository -Name $Name -SourceLocation $Url -InstallationPolicy Trusted -ErrorAction Stop - } - $result.changed = $true - $result.repository_changed = $true - } - catch { - $ErrorMessage = "Problems registering $($Name) repository: $($_.Exception.Message)" - Fail-Json $result $ErrorMessage - } - } -} - -Function Remove-Repository { - Param( - [Parameter(Mandatory = $true)] - [string]$Name, - [bool]$CheckMode - ) - # Legacy doesn't natively support deprecate by date, need to do this manually until we use Ansible.Basic - if (-not $result.ContainsKey('deprecations')) { - $result.deprecations = @() - } - $result.deprecations += @{ - msg = "Removing a repo with this module is deprecated, use community.windows.win_psrepository to manage repos" - date = "2021-07-01" - collection_name = "community.windows" - } - - $Repo = (Get-PSRepository).Name - - # Try to remove the repository - if ($Repo -contains $Name) { - try { - if ( -not ($CheckMode) ) { - Unregister-PSRepository -Name $Name -ErrorAction Stop - } - $result.changed = $true - $result.repository_changed = $true - } - catch [ System.Exception ] { - $ErrorMessage = "Problems unregistering $($Name)repository: $($_.Exception.Message)" - Fail-Json $result $ErrorMessage - } - } -} - # Check PowerShell version, fail if < 5.0 and required modules are not installed $PsVersion = $PSVersionTable.PSVersion if ($PsVersion.Major -lt 5 ) { @@ -469,11 +395,11 @@ if ( $allow_prerelease -and $state -eq "absent" ) { if ( ($state -eq "latest") -and ( $required_version -or $minimum_version -or $maximum_version ) ) { - $ErrorMessage = "When the parameter state is equal 'latest' you can use any of required_version, minimum_version, maximum_version." + $ErrorMessage = "When the parameter state is equal to 'latest' you can't use any of required_version, minimum_version, maximum_version." Fail-Json $result $ErrorMessage } -if ( $repo -and (-not $url) ) { +if ( $repo ) { $RepositoryExists = Get-PSRepository -Name $repo -ErrorAction SilentlyContinue if ( $null -eq $RepositoryExists) { $ErrorMessage = "The repository $repo doesn't exist." @@ -498,13 +424,6 @@ if ( ($allow_clobber -or $allow_prerelease -or $skip_publisher_check -or Import-Module -Name PackageManagement, PowerShellGet -Force if ($state -eq "present") { - if (($repo) -and ($url)) { - Install-Repository -Name $repo -Url $url -CheckMode $check_mode - } - else { - $ErrorMessage = "Repository Name and Url are mandatory if you want to add a new repository" - } - if ($name) { $ht = @{ Name = $name @@ -524,10 +443,6 @@ if ($state -eq "present") { } } elseif ($state -eq "absent") { - if ($repo) { - Remove-Repository -Name $repo -CheckMode $check_mode - } - if ($name) { $ht = @{ Name = $Name diff --git a/ansible_collections/community/windows/plugins/modules/win_psmodule.py b/ansible_collections/community/windows/plugins/modules/win_psmodule.py index ce2053aad..c3b3cbb5e 100644 --- a/ansible_collections/community/windows/plugins/modules/win_psmodule.py +++ b/ansible_collections/community/windows/plugins/modules/win_psmodule.py @@ -95,12 +95,6 @@ options: required: no default: false version_added: '1.13.0' - url: - description: - - URL of the custom repository to register. - - DEPRECATED, will be removed in a major release after C(2021-07-01), please use the - M(community.windows.win_psrepository) module instead. - type: str notes: - PowerShell modules needed - PowerShellGet >= 1.6.0 diff --git a/ansible_collections/community/windows/plugins/modules/win_psmodule_info.ps1 b/ansible_collections/community/windows/plugins/modules/win_psmodule_info.ps1 index b0932a79c..080949af2 100644 --- a/ansible_collections/community/windows/plugins/modules/win_psmodule_info.ps1 +++ b/ansible_collections/community/windows/plugins/modules/win_psmodule_info.ps1 @@ -263,7 +263,7 @@ function Add-ModuleRepositoryInfo { Process { $moduleName = $InputObject.Name - $installed = if ($installedModules.Contains($moduleName)) { + $installed = if ($installedModules -and $installedModules.Contains($moduleName)) { # we know at least one version of this module was installed from PowerShellGet # if the version of this local modle matches what we got it in the initial installed module list # use it diff --git a/ansible_collections/community/windows/plugins/modules/win_rabbitmq_plugin.ps1 b/ansible_collections/community/windows/plugins/modules/win_rabbitmq_plugin.ps1 index f4ac711c6..dbe914042 100644 --- a/ansible_collections/community/windows/plugins/modules/win_rabbitmq_plugin.ps1 +++ b/ansible_collections/community/windows/plugins/modules/win_rabbitmq_plugin.ps1 @@ -6,33 +6,30 @@ #Requires -Module Ansible.ModuleUtils.Legacy function Get-EnabledPlugin($rabbitmq_plugins_cmd) { - $list_plugins_cmd = "$rabbitmq_plugins_cmd list -E -m" try { - $enabled_plugins = @(Invoke-Expression "& $list_plugins_cmd" | Where-Object { $_ }) + $enabled_plugins = @(& $rabbitmq_plugins_cmd list -E -m | Where-Object { $_ }) return , $enabled_plugins } catch { - Fail-Json -obj $result -message "Can't execute `"$($list_plugins_cmd)`": $($_.Exception.Message)" + Fail-Json -obj $result -message "Can't execute '$rabbitmq_plugins_cmd list -E -m': $($_.Exception.Message)" } } function Enable-Plugin($rabbitmq_plugins_cmd, $plugin_name) { - $enable_plugin_cmd = "$rabbitmq_plugins_cmd enable $plugin_name" try { - Invoke-Expression "& $enable_plugin_cmd" + & $rabbitmq_plugins_cmd enable $plugin_name } catch { - Fail-Json -obj $result -message "Can't execute `"$($enable_plugin_cmd)`": $($_.Exception.Message)" + Fail-Json -obj $result -message "Can't execute '$rabbitmq_plugins_cmd enable $plugin_name': $($_.Exception.Message)" } } function Disable-Plugin($rabbitmq_plugins_cmd, $plugin_name) { - $enable_plugin_cmd = "$rabbitmq_plugins_cmd disable $plugin_name" try { - Invoke-Expression "& $enable_plugin_cmd" + & $rabbitmq_plugins_cmd disable $plugin_name } catch { - Fail-Json -obj $result -message "Can't execute `"$($enable_plugin_cmd)`": $($_.Exception.Message)" + Fail-Json -obj $result -message "Can't execute '$rabbitmq_plugins_cmd disable $plugin_name': $($_.Exception.Message)" } } diff --git a/ansible_collections/community/windows/plugins/modules/win_rds_rap.ps1 b/ansible_collections/community/windows/plugins/modules/win_rds_rap.ps1 index 956a812dd..2c4bb65bc 100644 --- a/ansible_collections/community/windows/plugins/modules/win_rds_rap.ps1 +++ b/ansible_collections/community/windows/plugins/modules/win_rds_rap.ps1 @@ -140,6 +140,11 @@ if ($null -ne $user_groups) { $user_groups = @($user_groups) } +# Ensure RemoteDesktopServices module is loaded +if ($null -eq (Get-Module -Name RemoteDesktopServices -ErrorAction SilentlyContinue)) { + Import-Module -Name RemoteDesktopServices +} + # Validate computer group parameter if ($computer_group_type -eq "allow_any" -and $null -ne $computer_group) { Add-Warning -obj $result -message "Parameter 'computer_group' ignored because the computer_group_type is set to allow_any." @@ -165,11 +170,6 @@ if ($null -ne $allowed_ports) { } } -# Ensure RemoteDesktopServices module is loaded -if ($null -eq (Get-Module -Name RemoteDesktopServices -ErrorAction SilentlyContinue)) { - Import-Module -Name RemoteDesktopServices -} - # Check if a RAP with the given name already exists $rap_exist = Test-Path -LiteralPath "RDS:\GatewayServer\RAP\$name" diff --git a/ansible_collections/community/windows/plugins/modules/win_region.ps1 b/ansible_collections/community/windows/plugins/modules/win_region.ps1 index 90713c12e..796854051 100644 --- a/ansible_collections/community/windows/plugins/modules/win_region.ps1 +++ b/ansible_collections/community/windows/plugins/modules/win_region.ps1 @@ -186,7 +186,11 @@ Function Get-UserLocaleName { return $user_locale } -Function Get-ValidGeoId($cultures) { +Function Get-ValidGeoId { + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingEmptyCatchBlock', '', + Justification = 'We dont care about the error here')] + param($cultures) + $geo_ids = @() foreach ($culture in $cultures) { try { diff --git a/ansible_collections/community/windows/plugins/modules/win_regmerge.ps1 b/ansible_collections/community/windows/plugins/modules/win_regmerge.ps1 index 8d511cc20..20942ba0e 100644 --- a/ansible_collections/community/windows/plugins/modules/win_regmerge.ps1 +++ b/ansible_collections/community/windows/plugins/modules/win_regmerge.ps1 @@ -7,6 +7,10 @@ #Requires -Module Ansible.ModuleUtils.CommandUtil #Requires -Module Ansible.ModuleUtils.Legacy +[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSCustomUseLiteralPath', '', + Justification = 'This module has supported wildcard comparison since it was created')] +param() + Function Convert-RegistryPath { Param ( [parameter(Mandatory = $True)] @@ -24,17 +28,34 @@ $result = @{ } $params = Parse-Args $args -$path = Get-AnsibleParam -obj $params -name "path" -type "path" -failifempty $true -resultobj $result +$path = Get-AnsibleParam -obj $params -name "path" -type "path" -resultobj $result +$content = Get-AnsibleParam -obj $params -name "content" -type "str" -resultobj $result $compare_to = Get-AnsibleParam -obj $params -name "compare_to" -type "str" -resultobj $result +if ( !$path -and !$content ) { + Fail-Json -obj $result -message "Missing required arguments: path or content. At lease one must be provided." +} + +if ( $path -and $content ) { + Fail-Json -obj $result -message "Extra arguments: path or content. Only one must be provided." +} + +if ( $content ) { + $path = [System.IO.Path]::GetTempFileName() + + Set-Content -LiteralPath $path -Value $content + + $remove_path = $True +} + # check it looks like a reg key, warn if key not present - will happen first time # only accepting PS-Drive style key names (starting with HKLM etc, not HKEY_LOCAL_MACHINE etc) $do_comparison = $False -If ($compare_to) { +If ( $compare_to ) { $compare_to_key = $params.compare_to.ToString() - If (Test-Path $compare_to_key -pathType container ) { + If (Test-Path $compare_to_key -PathType container ) { $do_comparison = $True } Else { @@ -96,4 +117,8 @@ Else { $result.compared = $false } +if ( $remove_path ) { + Remove-Item $path +} + Exit-Json $result diff --git a/ansible_collections/community/windows/plugins/modules/win_regmerge.py b/ansible_collections/community/windows/plugins/modules/win_regmerge.py index 073f54c9a..62c9be08c 100644 --- a/ansible_collections/community/windows/plugins/modules/win_regmerge.py +++ b/ansible_collections/community/windows/plugins/modules/win_regmerge.py @@ -21,8 +21,12 @@ options: description: - The full path including file name to the registry file on the remote machine to be merged type: path - required: yes - compare_key: + content: + description: + - When used instead of O(path), merges the value specified into the Windows registry. It must not include the Byte Order Mark. + type: str + version_added: 2.2.0 + compare_to: description: - The parent key to use when comparing the contents of the registry to the contents of the file. Needs to be in HKLM or HKCU part of registry. Use a PS-Drive style path for example HKLM:\SOFTWARE not HKEY_LOCAL_MACHINE\SOFTWARE @@ -53,6 +57,23 @@ EXAMPLES = r''' community.windows.win_regmerge: path: C:\autodeploy\myCompany-settings.reg compare_to: HKLM:\SOFTWARE\myCompany + +- name: Merge in a registry file specified as content without comparing to current registry + community.windows.win_regmerge: + content: | + Windows Registry Editor Version 5.00 + + [HKEY_LOCAL_MACHINE\SOFTWARE\myCompany] + "ExampleKey"=dword:00000001 + +- name: Compare and merge registry file specified as content + community.windows.win_regmerge: + content: | + Windows Registry Editor Version 5.00 + + [HKEY_LOCAL_MACHINE\SOFTWARE\myCompany] + "ExampleKey"=dword:00000001 + compare_to: HKLM:\SOFTWARE\myCompany ''' RETURN = r''' diff --git a/ansible_collections/community/windows/plugins/modules/win_robocopy.ps1 b/ansible_collections/community/windows/plugins/modules/win_robocopy.ps1 index 2d3e05805..4975d2566 100644 --- a/ansible_collections/community/windows/plugins/modules/win_robocopy.ps1 +++ b/ansible_collections/community/windows/plugins/modules/win_robocopy.ps1 @@ -5,6 +5,10 @@ #Requires -Module Ansible.ModuleUtils.Legacy +[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSCustomUseLiteralPath', '', + Justification = 'This module has supported wildcard comparison since it was created')] +param() + $params = Parse-Args $args -supports_check_mode $true $check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -type "bool" -default $false @@ -33,12 +37,12 @@ Function SearchForError($cmd_output, $default_msg) { } if ($separator_count -ne 3) { - if (Select-String -InputObject $line -pattern "^(\s+)?(\-+)(\s+)?$") { + if (Select-String -InputObject $line -Pattern "^(\s+)?(\-+)(\s+)?$") { $separator_count += 1 } } else { - if (Select-String -InputObject $line -pattern "error") { + if (Select-String -InputObject $line -Pattern "error") { $error_msg = $line break } @@ -75,7 +79,7 @@ else { } $result.flags = $flags -$result.cmd = "$robocopy $robocopy_opts" +$result.cmd = "robocopy $robocopy_opts" Try { $robocopy_output = &robocopy $robocopy_opts diff --git a/ansible_collections/community/windows/plugins/modules/win_scheduled_task.ps1 b/ansible_collections/community/windows/plugins/modules/win_scheduled_task.ps1 index 02cd012f8..fd1f52135 100644 --- a/ansible_collections/community/windows/plugins/modules/win_scheduled_task.ps1 +++ b/ansible_collections/community/windows/plugins/modules/win_scheduled_task.ps1 @@ -814,19 +814,6 @@ for ($i = 0; $i -lt $triggers.Count; $i++) { } if ($trigger.ContainsKey("repetition")) { - if ($trigger.repetition -is [Array]) { - # Legacy doesn't natively support deprecate by date, need to do this manually until we use Ansible.Basic - if (-not $result.ContainsKey('deprecations')) { - $result.deprecations = @() - } - $result.deprecations += @{ - msg = "repetition is a list, should be defined as a dict" - date = "2021-07-01" - collection_name = "community.windows" - } - $trigger.repetition = $trigger.repetition[0] - } - $interval_timespan = $null if ($trigger.repetition.ContainsKey("interval") -and $null -ne $trigger.repetition.interval) { $interval_timespan = Test-XmlDurationFormat -key "interval" -value $trigger.repetition.interval diff --git a/ansible_collections/community/windows/tests/integration/targets/setup_win_device/library/win_device.ps1 b/ansible_collections/community/windows/tests/integration/targets/setup_win_device/library/win_device.ps1 index 77fac9086..6674ddb26 100644 --- a/ansible_collections/community/windows/tests/integration/targets/setup_win_device/library/win_device.ps1 +++ b/ansible_collections/community/windows/tests/integration/targets/setup_win_device/library/win_device.ps1 @@ -30,7 +30,6 @@ Add-CSharpType -References @' using Microsoft.Win32.SafeHandles; using System; using System.ComponentModel; -using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; using System.Text; @@ -246,7 +245,6 @@ namespace Ansible.Device { public SafeDeviceInfoSet() : base(true) { } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] protected override bool ReleaseHandle() { return NativeMethods.SetupDiDestroyDeviceInfoList(handle); @@ -271,7 +269,6 @@ namespace Ansible.Device base.SetHandle(Marshal.StringToHGlobalUni(sz)); } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] protected override bool ReleaseHandle() { Marshal.FreeHGlobal(handle); diff --git a/ansible_collections/community/windows/tests/integration/targets/win_audit_rule/library/test_get_audit_rule.ps1 b/ansible_collections/community/windows/tests/integration/targets/win_audit_rule/library/test_get_audit_rule.ps1 index 37096c21a..ab113356f 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_audit_rule/library/test_get_audit_rule.ps1 +++ b/ansible_collections/community/windows/tests/integration/targets/win_audit_rule/library/test_get_audit_rule.ps1 @@ -6,6 +6,10 @@ #Requires -Module Ansible.ModuleUtils.Legacy #Requires -Module Ansible.ModuleUtils.SID +[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSCustomUseLiteralPath', '', + Justification = 'LiteralPath with Get-Acl is problematic')] +param() + $params = Parse-Args -arguments $args -supports_check_mode $true # these are your module parameters diff --git a/ansible_collections/community/windows/tests/integration/targets/win_auto_logon/library/test_autologon_info.ps1 b/ansible_collections/community/windows/tests/integration/targets/win_auto_logon/library/test_autologon_info.ps1 index 2819151ff..d352f2ff7 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_auto_logon/library/test_autologon_info.ps1 +++ b/ansible_collections/community/windows/tests/integration/targets/win_auto_logon/library/test_autologon_info.ps1 @@ -8,7 +8,6 @@ $module = [Ansible.Basic.AnsibleModule]::Create($args, @{}) Add-CSharpType -AnsibleModule $module -References @' using Microsoft.Win32.SafeHandles; using System; -using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; using System.Text; @@ -103,8 +102,6 @@ namespace Ansible.TestAutoLogonInfo { internal SafeLsaMemory() : base(true) { } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - protected override bool ReleaseHandle() { return NativeMethods.LsaFreeMemory(handle) == 0; @@ -120,8 +117,6 @@ namespace Ansible.TestAutoLogonInfo base.SetHandle(ptr); } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - protected override bool ReleaseHandle() { if (handle != IntPtr.Zero) @@ -134,8 +129,6 @@ namespace Ansible.TestAutoLogonInfo { internal SafeLsaHandle() : base(true) { } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - protected override bool ReleaseHandle() { return NativeMethods.LsaClose(handle) == 0; diff --git a/ansible_collections/community/windows/tests/integration/targets/win_credential/library/test_cred_facts.ps1 b/ansible_collections/community/windows/tests/integration/targets/win_credential/library/test_cred_facts.ps1 index 59206638f..fc2721f05 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_credential/library/test_cred_facts.ps1 +++ b/ansible_collections/community/windows/tests/integration/targets/win_credential/library/test_cred_facts.ps1 @@ -24,7 +24,6 @@ using Microsoft.Win32.SafeHandles; using System; using System.Collections.Generic; using System.Linq; -using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; using System.Text; @@ -187,7 +186,6 @@ namespace Ansible.CredentialManager { public SafeCredentialBuffer() : base(true) { } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] protected override bool ReleaseHandle() { NativeMethods.CredFree(handle); @@ -206,7 +204,6 @@ namespace Ansible.CredentialManager { base.SetHandle(handle); } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] protected override bool ReleaseHandle() { Marshal.FreeHGlobal(handle); diff --git a/ansible_collections/community/windows/tests/integration/targets/win_data_deduplication/aliases b/ansible_collections/community/windows/tests/integration/targets/win_data_deduplication/aliases index 2a4f8cc66..3cf5b97e8 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_data_deduplication/aliases +++ b/ansible_collections/community/windows/tests/integration/targets/win_data_deduplication/aliases @@ -1,2 +1 @@ shippable/windows/group3 -skip/windows/2012 diff --git a/ansible_collections/community/windows/tests/integration/targets/win_data_deduplication/tasks/main.yml b/ansible_collections/community/windows/tests/integration/targets/win_data_deduplication/tasks/main.yml index ae6be90ec..83c7197c6 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_data_deduplication/tasks/main.yml +++ b/ansible_collections/community/windows/tests/integration/targets/win_data_deduplication/tasks/main.yml @@ -1,2 +1,2 @@ --- -- include: pre_test.yml +- import_tasks: pre_test.yml diff --git a/ansible_collections/community/windows/tests/integration/targets/win_data_deduplication/tasks/pre_test.yml b/ansible_collections/community/windows/tests/integration/targets/win_data_deduplication/tasks/pre_test.yml index d63468990..8028cb17b 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_data_deduplication/tasks/pre_test.yml +++ b/ansible_collections/community/windows/tests/integration/targets/win_data_deduplication/tasks/pre_test.yml @@ -34,7 +34,7 @@ - name: Run tests block: - - include: tests.yml + - import_tasks: tests.yml always: - name: Detach disk ansible.windows.win_command: diskpart.exe /s {{ remote_tmp_dir }}\partition_deletion_script.txt diff --git a/ansible_collections/community/windows/tests/integration/targets/win_disk_facts/tasks/main.yml b/ansible_collections/community/windows/tests/integration/targets/win_disk_facts/tasks/main.yml index f1873efa7..d55a7221c 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_disk_facts/tasks/main.yml +++ b/ansible_collections/community/windows/tests/integration/targets/win_disk_facts/tasks/main.yml @@ -10,4 +10,4 @@ block: - name: Test in normal mode - include: tests.yml + import_tasks: tests.yml diff --git a/ansible_collections/community/windows/tests/integration/targets/win_dns_record/tasks/main.yml b/ansible_collections/community/windows/tests/integration/targets/win_dns_record/tasks/main.yml index 9b06a65b0..32f754d08 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_dns_record/tasks/main.yml +++ b/ansible_collections/community/windows/tests/integration/targets/win_dns_record/tasks/main.yml @@ -8,5 +8,5 @@ register: os_supported - name: run tests on supported hosts - include: tests.yml + import_tasks: tests.yml when: os_supported.stdout | trim | bool diff --git a/ansible_collections/community/windows/tests/integration/targets/win_dns_zone/aliases b/ansible_collections/community/windows/tests/integration/targets/win_dns_zone/aliases index df7c2d121..4cd27b3cb 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_dns_zone/aliases +++ b/ansible_collections/community/windows/tests/integration/targets/win_dns_zone/aliases @@ -1,2 +1 @@ shippable/windows/group1 -skip/windows/2012
\ No newline at end of file diff --git a/ansible_collections/community/windows/tests/integration/targets/win_domain_ou/aliases b/ansible_collections/community/windows/tests/integration/targets/win_domain_ou/aliases index 22f581bfd..423ce3910 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_domain_ou/aliases +++ b/ansible_collections/community/windows/tests/integration/targets/win_domain_ou/aliases @@ -1,2 +1 @@ shippable/windows/group2 -skip/windows/2012 diff --git a/ansible_collections/community/windows/tests/integration/targets/win_domain_user/aliases b/ansible_collections/community/windows/tests/integration/targets/win_domain_user/aliases index 22f581bfd..423ce3910 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_domain_user/aliases +++ b/ansible_collections/community/windows/tests/integration/targets/win_domain_user/aliases @@ -1,2 +1 @@ shippable/windows/group2 -skip/windows/2012 diff --git a/ansible_collections/community/windows/tests/integration/targets/win_firewall/aliases b/ansible_collections/community/windows/tests/integration/targets/win_firewall/aliases index c8fd90a1f..4f4664b68 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_firewall/aliases +++ b/ansible_collections/community/windows/tests/integration/targets/win_firewall/aliases @@ -1,3 +1 @@ shippable/windows/group5 -skip/windows/2012 -skip/windows/2012-R2 diff --git a/ansible_collections/community/windows/tests/integration/targets/win_format/tasks/main.yml b/ansible_collections/community/windows/tests/integration/targets/win_format/tasks/main.yml index 5ea27a6f0..71b897aac 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_format/tasks/main.yml +++ b/ansible_collections/community/windows/tests/integration/targets/win_format/tasks/main.yml @@ -3,5 +3,5 @@ ansible.windows.win_shell: if (Get-Command -Name Format-Volume -ErrorAction SilentlyContinue) { $true } else { $false } register: module_present -- include: pre_test.yml +- include_tasks: pre_test.yml when: module_present.stdout | trim | bool diff --git a/ansible_collections/community/windows/tests/integration/targets/win_format/tasks/pre_test.yml b/ansible_collections/community/windows/tests/integration/targets/win_format/tasks/pre_test.yml index a29a47bbe..0fce957ef 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_format/tasks/pre_test.yml +++ b/ansible_collections/community/windows/tests/integration/targets/win_format/tasks/pre_test.yml @@ -15,7 +15,7 @@ - name: Run tests block: - - include: tests.yml + - import_tasks: tests.yml always: - name: Detach disk ansible.windows.win_command: diskpart.exe /s {{ remote_tmp_dir }}\partition_deletion_script.txt diff --git a/ansible_collections/community/windows/tests/integration/targets/win_inet_proxy/library/win_inet_proxy_info.ps1 b/ansible_collections/community/windows/tests/integration/targets/win_inet_proxy/library/win_inet_proxy_info.ps1 index 76bf03ec9..810c8ba97 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_inet_proxy/library/win_inet_proxy_info.ps1 +++ b/ansible_collections/community/windows/tests/integration/targets/win_inet_proxy/library/win_inet_proxy_info.ps1 @@ -22,7 +22,6 @@ using Microsoft.Win32.SafeHandles; using System; using System.Collections.Generic; using System.ComponentModel; -using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; namespace Ansible.WinINetProxyInfo @@ -138,7 +137,6 @@ namespace Ansible.WinINetProxyInfo base.SetHandle(handle); } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] protected override bool ReleaseHandle() { Marshal.FreeHGlobal(handle); diff --git a/ansible_collections/community/windows/tests/integration/targets/win_initialize_disk/tasks/main.yml b/ansible_collections/community/windows/tests/integration/targets/win_initialize_disk/tasks/main.yml index b752a7913..303723e9e 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_initialize_disk/tasks/main.yml +++ b/ansible_collections/community/windows/tests/integration/targets/win_initialize_disk/tasks/main.yml @@ -17,7 +17,7 @@ - name: Run tests block: - - include: tests.yml + - import_tasks: tests.yml always: - name: Detach disk ansible.windows.win_command: diskpart.exe /s C:\win_initialize_disk_tests\vhdx_deletion_script.txt diff --git a/ansible_collections/community/windows/tests/integration/targets/win_nssm/tasks/tests.yml b/ansible_collections/community/windows/tests/integration/targets/win_nssm/tasks/tests.yml index cf8f0cfbe..b4ed06efd 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_nssm/tasks/tests.yml +++ b/ansible_collections/community/windows/tests/integration/targets/win_nssm/tasks/tests.yml @@ -401,52 +401,6 @@ - install_service_reset_appenv.changed == true - install_service_reset_appenv_actual.stdout == '\r\n' -# deprecated in 2.12 -- name: install service with dict-as-string parameters - win_nssm: - name: '{{ test_service_name }}' - application: C:\Windows\System32\cmd.exe - app_parameters: foo=true; -file.out=output.bat; -path=C:\with space\; -str=test"quotes; _=bar - register: mixed_params - -# deprecated in 2.12 -- name: get result of install service with dict-as-string parameters - ansible.windows.win_shell: '$service = ''{{ test_service_name }}''; {{ test_service_cmd }}' - register: mixed_params_actual - -# deprecated in 2.12 -- name: assert results of install service with dict-as-string parameters - assert: - that: - - mixed_params.changed == true - - (mixed_params_actual.stdout|from_json).Exists == true - - (mixed_params_actual.stdout|from_json).Parameters.Application == "C:\Windows\System32\cmd.exe" - # Expected value: bar -file.out output.bat -str "test\"quotes" foo true -path "C:\with space\\" (backslashes doubled for jinja) - - (mixed_params_actual.stdout|from_json).Parameters.AppParameters == 'bar -file.out output.bat -str "test\\"quotes" foo true -path "C:\\with space\\\\"' - -# deprecated in 2.12 -- name: install service with dict-as-string parameters (idempotent) - win_nssm: - name: '{{ test_service_name }}' - application: C:\Windows\System32\cmd.exe - app_parameters: foo=true; -file.out=output.bat; -path=C:\with space\; -str=test"quotes; _=bar - register: mixed_params_again - -# deprecated in 2.12 -- name: get result of install service with dict-as-string parameters (idempotent) - ansible.windows.win_shell: '$service = ''{{ test_service_name }}''; {{ test_service_cmd }}' - register: mixed_params_again_actual - -# deprecated in 2.12 -- name: assert results of install service with dict-as-string parameters (idempotent) - assert: - that: - - mixed_params_again.changed == false - - (mixed_params_again_actual.stdout|from_json).Exists == true - - (mixed_params_again_actual.stdout|from_json).Parameters.Application == "C:\Windows\System32\cmd.exe" - # Expected value: bar -file.out output.bat -str "test\"quotes" foo true -path "C:\with space\\" (backslashes doubled for jinja) - - (mixed_params_again_actual.stdout|from_json).Parameters.AppParameters == 'bar -file.out output.bat -str "test\\"quotes" foo true -path "C:\\with space\\\\"' - - name: install service with list of parameters win_nssm: name: '{{ test_service_name }}' diff --git a/ansible_collections/community/windows/tests/integration/targets/win_partition/tasks/main.yml b/ansible_collections/community/windows/tests/integration/targets/win_partition/tasks/main.yml index 50d086ae1..54e7f8a9d 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_partition/tasks/main.yml +++ b/ansible_collections/community/windows/tests/integration/targets/win_partition/tasks/main.yml @@ -12,7 +12,7 @@ - name: Run tests block: - - include: tests.yml + - import_tasks: tests.yml always: - name: Detach disk ansible.windows.win_command: diskpart.exe /s "{{ remote_tmp_dir }}\vhdx_deletion_script.txt" diff --git a/ansible_collections/community/windows/tests/integration/targets/win_psmodule/files/module/template.psd1 b/ansible_collections/community/windows/tests/integration/targets/win_psmodule/files/module/template.psd1 index cd6709722..f4441fd87 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_psmodule/files/module/template.psd1 +++ b/ansible_collections/community/windows/tests/integration/targets/win_psmodule/files/module/template.psd1 @@ -10,8 +10,6 @@ "--- FUNCTION ---" ) PrivateData = @{ - PSData = @{ ---- PS_DATA --- - } + PSData = @{} } } diff --git a/ansible_collections/community/windows/tests/integration/targets/win_psmodule/files/module/template.psm1 b/ansible_collections/community/windows/tests/integration/targets/win_psmodule/files/module/template.psm1 index ac38fb5ed..3f76721d3 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_psmodule/files/module/template.psm1 +++ b/ansible_collections/community/windows/tests/integration/targets/win_psmodule/files/module/template.psm1 @@ -1,4 +1,17 @@ -Function --- FUNCTION --- { +Function Get-Function { + <# + .SYNOPSIS + Help for Get-Function + + .DESCRIPTION + Description for Get-Function + + .EXAMPLE + Get-Function + + .NOTES + Notes for Get-Function + #> return [PSCustomObject]@{ Name = "--- NAME ---" Version = "--- VERSION ---" @@ -6,5 +19,5 @@ Function --- FUNCTION --- { } } -Export-ModuleMember -Function --- FUNCTION --- +Export-ModuleMember -Function Get-Function diff --git a/ansible_collections/community/windows/tests/integration/targets/win_psmodule/files/setup_certs.sh b/ansible_collections/community/windows/tests/integration/targets/win_psmodule/files/setup_certs.sh index 258567316..fcae5f0e6 100644..100755 --- a/ansible_collections/community/windows/tests/integration/targets/win_psmodule/files/setup_certs.sh +++ b/ansible_collections/community/windows/tests/integration/targets/win_psmodule/files/setup_certs.sh @@ -16,4 +16,8 @@ openssl req -new -key sign.key -out sign.csr -subj "/CN=Ansible Sign" -config op openssl x509 -req -in sign.csr -CA ca.pem -CAkey ca.key -CAcreateserial -out sign.pem -days 365 -extfile openssl.conf -extensions req_sign -passin pass:password # Create pfx that includes signing cert and cert with the pass 'password' -openssl pkcs12 -export -out sign.pfx -inkey sign.key -in sign.pem -passin pass:password -passout pass:password +pfx_args=() +if [ "${1}" == "-use-legacy" ]; then + pfx_args=("-certpbe" "PBE-SHA1-3DES" "-keypbe" "PBE-SHA1-3DES" "-macalg" "SHA1") +fi +openssl pkcs12 -export -out sign.pfx -inkey sign.key -in sign.pem -passin pass:password -passout pass:password "${pfx_args[@]}" diff --git a/ansible_collections/community/windows/tests/integration/targets/win_psmodule/files/setup_modules.ps1 b/ansible_collections/community/windows/tests/integration/targets/win_psmodule/files/setup_modules.ps1 index 48d55b574..b08aca8b2 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_psmodule/files/setup_modules.ps1 +++ b/ansible_collections/community/windows/tests/integration/targets/win_psmodule/files/setup_modules.ps1 @@ -28,8 +28,8 @@ $packages = @( foreach ($package in $packages) { $tmp_dir = Join-Path -Path $template_path -ChildPath $package.name - if (Test-Path -Path $tmp_dir) { - Remove-Item -Path $tmp_dir -Force -Recurse + if (Test-Path -LiteralPath $tmp_dir) { + Remove-Item -LiteralPath $tmp_dir -Force -Recurse } New-Item -Path $tmp_dir -ItemType Directory > $null @@ -50,15 +50,15 @@ foreach ($package in $packages) { $manifest = $manifest.Replace('--- NAME ---', $package.name).Replace('--- VERSION ---', $package.version) $manifest = $manifest.Replace('--- GUID ---', [Guid]::NewGuid()).Replace('--- FUNCTION ---', $package.function) - $manifest = $manifest.Replace('--- PS_DATA ---', $ps_data -join "`n") + $manifest = $manifest.Replace('PSData = @{}', "PSData = @{`n$($ps_data -join "`n")`n}") $manifest_path = Join-Path -Path $tmp_dir -ChildPath "$($package.name).psd1" - Set-Content -Path $manifest_path -Value $manifest + Set-Content -LiteralPath $manifest_path -Value $manifest $script = [System.IO.File]::ReadAllText($template_script) $script = $script.Replace('--- NAME ---', $package.name).Replace('--- VERSION ---', $package.version) - $script = $script.Replace('--- REPO ---', $package.repo).Replace('--- FUNCTION ---', $package.function) + $script = $script.Replace('--- REPO ---', $package.repo).Replace('Get-Function', $package.function) $script_path = Join-Path -Path $tmp_dir -ChildPath "$($package.name).psm1" - Set-Content -Path $script_path -Value $script + Set-Content -LiteralPath $script_path -Value $script $signed = if ($package.ContainsKey("signed")) { $package.signed } else { $true } if ($signed) { @@ -74,16 +74,16 @@ foreach ($package in $packages) { $nuspec = $nuspec.Replace('--- NAME ---', $package.name).Replace('--- VERSION ---', $nuget_version) $nuspec = $nuspec.Replace('--- FUNCTION ---', $package.function) $nuspec = $nuspec.Replace('--- LICACC ---', ($package.require_license -as [bool]).ToString().ToLower()) - Set-Content -Path (Join-Path -Path $tmp_dir -ChildPath "$($package.name).nuspec") -Value $nuspec + Set-Content -LiteralPath (Join-Path -Path $tmp_dir -ChildPath "$($package.name).nuspec") -Value $nuspec &$nuget_exe pack "$tmp_dir\$($package.name).nuspec" -outputdirectory $tmp_dir $repo_path = Join-Path -Path $template_path -ChildPath $package.repo $nupkg_filename = "$($package.name).$($nuget_version).nupkg" - Copy-Item -Path (Join-Path -Path $tmp_dir -ChildPath $nupkg_filename) ` + Copy-Item -LiteralPath (Join-Path -Path $tmp_dir -ChildPath $nupkg_filename) ` -Destination (Join-Path -Path $repo_path -ChildPath $nupkg_filename) } finally { - Remove-Item -Path $tmp_dir -Force -Recurse + Remove-Item -LiteralPath $tmp_dir -Force -Recurse } } diff --git a/ansible_collections/community/windows/tests/integration/targets/win_psmodule/tasks/main.yml b/ansible_collections/community/windows/tests/integration/targets/win_psmodule/tasks/main.yml index ffe1a0978..fe264cc0e 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_psmodule/tasks/main.yml +++ b/ansible_collections/community/windows/tests/integration/targets/win_psmodule/tasks/main.yml @@ -6,25 +6,6 @@ - name: setup test repos and modules import_tasks: setup.yml -# Remove the below task in Ansible 2.12 -- name: ensure warning is fired when adding a repo - win_psmodule: - name: ansible-test1 - repository: some repo - url: '{{ remote_tmp_dir }}' - state: present - register: dep_repo_add - ignore_errors: yes # will fail because this repo doesn't actually have this module - check_mode: yes - -- name: assert warning is fired when adding a repo - assert: - that: - - dep_repo_add is changed - - dep_repo_add.deprecations|length == 1 - - dep_repo_add.deprecations[0].msg == 'Adding a repo with this module is deprecated, the repository parameter should only be used to select a repo. Use community.windows.win_psrepository to manage repos' - - dep_repo_add.deprecations[0].date == '2021-07-01' - ### licensed module checks # it is not known in check mode that a module requires # license acceptance, so we don't do check mode tests diff --git a/ansible_collections/community/windows/tests/integration/targets/win_psmodule/tasks/setup.yml b/ansible_collections/community/windows/tests/integration/targets/win_psmodule/tasks/setup.yml index 42049a3e3..14b591fcd 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_psmodule/tasks/setup.yml +++ b/ansible_collections/community/windows/tests/integration/targets/win_psmodule/tasks/setup.yml @@ -66,8 +66,16 @@ delegate_to: localhost register: output_dir_abs +- name: check if we can use the default AES encryption + ansible.windows.win_powershell: + script: | + $osVersion = [Version](Get-Item -LiteralPath "$env:SystemRoot\System32\kernel32.dll").VersionInfo.ProductVersion + $osVersion -ge [Version]"10.0.17763" + changed_when: false + register: aes256_support + - name: create certificates for code signing - script: setup_certs.sh + script: setup_certs.sh {{ '' if aes256_support.output[0] else '-use-legacy' }} args: chdir: '{{ output_dir_abs.stdout }}' delegate_to: localhost diff --git a/ansible_collections/community/windows/tests/integration/targets/win_regmerge/files/settings1c.reg b/ansible_collections/community/windows/tests/integration/targets/win_regmerge/files/settings1c.reg new file mode 100644 index 000000000..26208be0c --- /dev/null +++ b/ansible_collections/community/windows/tests/integration/targets/win_regmerge/files/settings1c.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Cow Corp\Moosic\ILikeToMooveIt] +"WorkingDirectory"="C:\\Program Files (x86)\\Cow Corp\\MadeUpFolder\\" diff --git a/ansible_collections/community/windows/tests/integration/targets/win_regmerge/files/settings3c.reg b/ansible_collections/community/windows/tests/integration/targets/win_regmerge/files/settings3c.reg new file mode 100644 index 000000000..a3ae31ba2 --- /dev/null +++ b/ansible_collections/community/windows/tests/integration/targets/win_regmerge/files/settings3c.reg @@ -0,0 +1,30 @@ +Windows Registry Editor Version 5.00 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Cow Corp\Moo Monitor] +"BIGCAT_HOME"="C:\\Bigcat97" + +[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Cow Corp\Moo Monitor\Tasks] + +[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Cow Corp\Moo Monitor\Tasks\FishTank] +"ComponentID"=dword:00000000 +"Name"="Bigcat7" +"Version"="" +"Archive"="" +"InstallDate"=hex:00,00,00,00,00,00,00,00 +"Product"="FishTank" +"IsBusStopOnly"=dword:00000000 +"MaxEggCount"=dword:00000005 +"MaxEggDuration"=dword:00000001 +"StopTimeout"=dword:00001388 +"IsService"=dword:00000001 +"IsDCOMService"=dword:00000000 +"Command"="" +"NumberOfMoos"=dword:00000000 +"StatusOnShutdown"=hex:02,00,00,00 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Cow Corp\Moo Monitor\Tasks\FishTank\Counters] + +[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Cow Corp\Moo Monitor\Tasks\FishTank\Udders] + +[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Cow Corp\Moo Monitor\Tasks\FishTank\Hooves] + diff --git a/ansible_collections/community/windows/tests/integration/targets/win_regmerge/tasks/main.yml b/ansible_collections/community/windows/tests/integration/targets/win_regmerge/tasks/main.yml index af640eb93..e3a171ed6 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_regmerge/tasks/main.yml +++ b/ansible_collections/community/windows/tests/integration/targets/win_regmerge/tasks/main.yml @@ -130,4 +130,103 @@ - settings2.reg - settings3.reg +# re-run all tests above using 'content' parameter instead of 'path' using similar reg files but without the BOM + +# clear the area of the registry we are using for tests +- name: remove setting + ansible.windows.win_regedit: + key: 'HKLM:\SOFTWARE\Wow6432Node\Cow Corp' + state: absent + +# test 1 - basic test of changed behaviour +# merge in REG_SZ +- name: test 1 merge in a setting using 'content' + win_regmerge: + content: "{{ lookup('file', 'settings1c.reg') }}" + register: merge11_result + +- assert: + that: + - "merge11_result.changed == true" + +# re run the merge +- name: test 1 merge in the setting again using 'content' + win_regmerge: + content: "{{ lookup('file', 'settings1c.reg') }}" + register: merge12_result + +# without a compare to key, should always report changed +- assert: + that: + - "merge12_result.changed == true" +# assert changed false + +# prune reg key +- name: test 1 remove setting + ansible.windows.win_regedit: + key: 'HKLM:\SOFTWARE\Wow6432Node\Cow Corp' + state: absent + +# +# test 2, observe behaviour when compare_to param is set +# +- name: test 2 merge in a setting using 'content' + win_regmerge: + content: "{{ lookup('file', 'settings1c.reg') }}" + compare_to: 'HKLM:\SOFTWARE\Wow6432Node\Cow Corp\Moosic\ILikeToMooveIt' + register: merge21_result + +- assert: + that: + - "merge21_result.changed == true" + +# re run the merge +- name: test 2 merge in the setting again but with compare_key using 'content' + win_regmerge: + content: "{{ lookup('file', 'settings1c.reg') }}" + compare_to: 'HKLM:\SOFTWARE\Wow6432Node\Cow Corp\Moosic\ILikeToMooveIt' + register: merge22_result + +# with a compare to key, should now report not changed +- assert: + that: + - "merge22_result.changed == false" +# assert changed false + +# prune the contents of the registry from the parent of the compare key downwards +- name: test 2 clean up remove setting + ansible.windows.win_regedit: + key: 'HKLM:\SOFTWARE\Wow6432Node\Cow Corp' + state: absent + +# test 3 merge in more complex settings +- name: test 3 merge in a setting using 'content' + win_regmerge: + content: "{{ lookup('file', 'settings3c.reg') }}" + compare_to: 'HKLM:\SOFTWARE\Wow6432Node\Cow Corp\Moo Monitor' + register: merge31_result + +- assert: + that: + - "merge31_result.changed == true" + +# re run the merge +- name: test 3 merge in the setting again but with compare_key check using 'content' + win_regmerge: + content: "{{ lookup('file', 'settings3c.reg') }}" + compare_to: 'HKLM:\SOFTWARE\Wow6432Node\Cow Corp\Moo Monitor' + register: merge32_result + +# with a compare to key, should now report not changed +- assert: + that: + - "merge32_result.changed == false" +# assert changed false + +# prune the contents of the registry from the compare key downwards +- name: test 3 clean up remove setting + ansible.windows.win_regedit: + key: 'HKLM:\SOFTWARE\Wow6432Node\Cow Corp' + state: absent + # END OF win_regmerge tests diff --git a/ansible_collections/community/windows/tests/integration/targets/win_route/tasks/main.yml b/ansible_collections/community/windows/tests/integration/targets/win_route/tasks/main.yml index 4bbdee5b5..5e5a01adc 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_route/tasks/main.yml +++ b/ansible_collections/community/windows/tests/integration/targets/win_route/tasks/main.yml @@ -22,8 +22,6 @@ ansible.windows.win_shell: '[Environment]::OSVersion.Version -ge [Version]"6.3"' register: os -- name: Perform with os Windows 2012R2 or newer +- name: run all tasks + include_tasks: tests.yml when: os.stdout_lines[0] == "True" - block: - - name: run all tasks - include: tests.yml diff --git a/ansible_collections/community/windows/tests/integration/targets/win_scheduled_task/tasks/triggers.yml b/ansible_collections/community/windows/tests/integration/targets/win_scheduled_task/tasks/triggers.yml index eae42c98a..5055e107a 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_scheduled_task/tasks/triggers.yml +++ b/ansible_collections/community/windows/tests/integration/targets/win_scheduled_task/tasks/triggers.yml @@ -305,8 +305,7 @@ triggers: - type: registration repetition: - # TODO: change to dict in 2.12 as a list format is deprecated - - interval: PT1M + interval: PT1M duration: PT5M stop_at_duration_end: yes register: create_trigger_repetition_check @@ -322,9 +321,6 @@ assert: that: - create_trigger_repetition_check is changed - - create_trigger_repetition_check.deprecations|count == 1 - - create_trigger_repetition_check.deprecations[0].date == "2021-07-01" - - create_trigger_repetition_check.deprecations[0].msg == "repetition is a list, should be defined as a dict" - create_trigger_repetition_result_check.task_exists == True - create_trigger_repetition_result_check.triggers|count == 1 - create_trigger_repetition_result_check.triggers[0].type == "TASK_TRIGGER_MONTHLYDOW" diff --git a/ansible_collections/community/windows/tests/integration/targets/win_scoop/aliases b/ansible_collections/community/windows/tests/integration/targets/win_scoop/aliases index e2eacc2b6..3cf5b97e8 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_scoop/aliases +++ b/ansible_collections/community/windows/tests/integration/targets/win_scoop/aliases @@ -1,3 +1 @@ shippable/windows/group3 -skip/windows/2012 # Need pwsh 5+ -skip/windows/2012-R2 # Need pwsh 5+ diff --git a/ansible_collections/community/windows/tests/integration/targets/win_scoop_bucket/aliases b/ansible_collections/community/windows/tests/integration/targets/win_scoop_bucket/aliases index 9a9d0737d..423ce3910 100644 --- a/ansible_collections/community/windows/tests/integration/targets/win_scoop_bucket/aliases +++ b/ansible_collections/community/windows/tests/integration/targets/win_scoop_bucket/aliases @@ -1,3 +1 @@ shippable/windows/group2 -skip/windows/2012 # Need pwsh 5+ -skip/windows/2012-R2 # Need pwsh 5+ diff --git a/ansible_collections/community/windows/tests/requirements.yml b/ansible_collections/community/windows/tests/requirements.yml index 4f4960ebd..d3c5aea88 100644 --- a/ansible_collections/community/windows/tests/requirements.yml +++ b/ansible_collections/community/windows/tests/requirements.yml @@ -1,6 +1,6 @@ collections: -- name: ansible.windows -- name: chocolatey.chocolatey - # Chocolatey 1.3.0 broke compatibiltiy wtih WinPS 3 and 4 so we are stuck with 1.2.0 - # https://github.com/chocolatey/chocolatey-ansible/issues/96 - version: <1.3.0
\ No newline at end of file + - name: ansible.windows + - name: chocolatey.chocolatey + # Chocolatey 1.3.0 broke compatibiltiy wtih WinPS 3 and 4 so we are stuck with 1.2.0 + # https://github.com/chocolatey/chocolatey-ansible/issues/96 + version: <1.3.0 diff --git a/ansible_collections/community/windows/tests/sanity/ignore-2.12.txt b/ansible_collections/community/windows/tests/sanity/ignore-2.12.txt deleted file mode 100644 index 84d7bb121..000000000 --- a/ansible_collections/community/windows/tests/sanity/ignore-2.12.txt +++ /dev/null @@ -1,13 +0,0 @@ -plugins/modules/win_audit_rule.ps1 pslint:PSCustomUseLiteralPath -plugins/modules/win_rabbitmq_plugin.ps1 pslint:PSAvoidUsingInvokeExpression -plugins/modules/win_region.ps1 pslint:PSAvoidUsingEmptyCatchBlock # Keep -plugins/modules/win_regmerge.ps1 pslint:PSCustomUseLiteralPath -plugins/modules/win_robocopy.ps1 pslint:PSCustomUseLiteralPath -tests/integration/targets/win_audit_rule/library/test_get_audit_rule.ps1 pslint:PSCustomUseLiteralPath -tests/integration/targets/win_lineinfile/files/expectations/23_utf8_bom.txt shebang -tests/integration/targets/win_lineinfile/files/expectations/24_utf8_bom_line_added.txt shebang -tests/integration/targets/win_lineinfile/files/expectations/30_linebreaks_checksum_bad.txt line-endings -tests/integration/targets/win_psmodule/files/module/template.psd1 pslint!skip -tests/integration/targets/win_psmodule/files/module/template.psm1 pslint!skip -tests/integration/targets/win_psmodule/files/setup_modules.ps1 pslint:PSCustomUseLiteralPath -tests/integration/targets/win_regmerge/templates/win_line_ending.j2 line-endings diff --git a/ansible_collections/community/windows/tests/sanity/ignore-2.13.txt b/ansible_collections/community/windows/tests/sanity/ignore-2.13.txt deleted file mode 100644 index 84d7bb121..000000000 --- a/ansible_collections/community/windows/tests/sanity/ignore-2.13.txt +++ /dev/null @@ -1,13 +0,0 @@ -plugins/modules/win_audit_rule.ps1 pslint:PSCustomUseLiteralPath -plugins/modules/win_rabbitmq_plugin.ps1 pslint:PSAvoidUsingInvokeExpression -plugins/modules/win_region.ps1 pslint:PSAvoidUsingEmptyCatchBlock # Keep -plugins/modules/win_regmerge.ps1 pslint:PSCustomUseLiteralPath -plugins/modules/win_robocopy.ps1 pslint:PSCustomUseLiteralPath -tests/integration/targets/win_audit_rule/library/test_get_audit_rule.ps1 pslint:PSCustomUseLiteralPath -tests/integration/targets/win_lineinfile/files/expectations/23_utf8_bom.txt shebang -tests/integration/targets/win_lineinfile/files/expectations/24_utf8_bom_line_added.txt shebang -tests/integration/targets/win_lineinfile/files/expectations/30_linebreaks_checksum_bad.txt line-endings -tests/integration/targets/win_psmodule/files/module/template.psd1 pslint!skip -tests/integration/targets/win_psmodule/files/module/template.psm1 pslint!skip -tests/integration/targets/win_psmodule/files/setup_modules.ps1 pslint:PSCustomUseLiteralPath -tests/integration/targets/win_regmerge/templates/win_line_ending.j2 line-endings diff --git a/ansible_collections/community/windows/tests/sanity/ignore-2.14.txt b/ansible_collections/community/windows/tests/sanity/ignore-2.14.txt index 84d7bb121..82f6c2fac 100644 --- a/ansible_collections/community/windows/tests/sanity/ignore-2.14.txt +++ b/ansible_collections/community/windows/tests/sanity/ignore-2.14.txt @@ -1,13 +1,5 @@ -plugins/modules/win_audit_rule.ps1 pslint:PSCustomUseLiteralPath -plugins/modules/win_rabbitmq_plugin.ps1 pslint:PSAvoidUsingInvokeExpression -plugins/modules/win_region.ps1 pslint:PSAvoidUsingEmptyCatchBlock # Keep -plugins/modules/win_regmerge.ps1 pslint:PSCustomUseLiteralPath -plugins/modules/win_robocopy.ps1 pslint:PSCustomUseLiteralPath -tests/integration/targets/win_audit_rule/library/test_get_audit_rule.ps1 pslint:PSCustomUseLiteralPath +plugins/modules/win_audit_rule.ps1 pslint:PSCustomUseLiteralPath # Unsure if we can fix this or not so keep ignoring for now tests/integration/targets/win_lineinfile/files/expectations/23_utf8_bom.txt shebang tests/integration/targets/win_lineinfile/files/expectations/24_utf8_bom_line_added.txt shebang tests/integration/targets/win_lineinfile/files/expectations/30_linebreaks_checksum_bad.txt line-endings -tests/integration/targets/win_psmodule/files/module/template.psd1 pslint!skip -tests/integration/targets/win_psmodule/files/module/template.psm1 pslint!skip -tests/integration/targets/win_psmodule/files/setup_modules.ps1 pslint:PSCustomUseLiteralPath tests/integration/targets/win_regmerge/templates/win_line_ending.j2 line-endings diff --git a/ansible_collections/community/windows/tests/sanity/ignore-2.15.txt b/ansible_collections/community/windows/tests/sanity/ignore-2.15.txt index 84d7bb121..82f6c2fac 100644 --- a/ansible_collections/community/windows/tests/sanity/ignore-2.15.txt +++ b/ansible_collections/community/windows/tests/sanity/ignore-2.15.txt @@ -1,13 +1,5 @@ -plugins/modules/win_audit_rule.ps1 pslint:PSCustomUseLiteralPath -plugins/modules/win_rabbitmq_plugin.ps1 pslint:PSAvoidUsingInvokeExpression -plugins/modules/win_region.ps1 pslint:PSAvoidUsingEmptyCatchBlock # Keep -plugins/modules/win_regmerge.ps1 pslint:PSCustomUseLiteralPath -plugins/modules/win_robocopy.ps1 pslint:PSCustomUseLiteralPath -tests/integration/targets/win_audit_rule/library/test_get_audit_rule.ps1 pslint:PSCustomUseLiteralPath +plugins/modules/win_audit_rule.ps1 pslint:PSCustomUseLiteralPath # Unsure if we can fix this or not so keep ignoring for now tests/integration/targets/win_lineinfile/files/expectations/23_utf8_bom.txt shebang tests/integration/targets/win_lineinfile/files/expectations/24_utf8_bom_line_added.txt shebang tests/integration/targets/win_lineinfile/files/expectations/30_linebreaks_checksum_bad.txt line-endings -tests/integration/targets/win_psmodule/files/module/template.psd1 pslint!skip -tests/integration/targets/win_psmodule/files/module/template.psm1 pslint!skip -tests/integration/targets/win_psmodule/files/setup_modules.ps1 pslint:PSCustomUseLiteralPath tests/integration/targets/win_regmerge/templates/win_line_ending.j2 line-endings diff --git a/ansible_collections/community/windows/tests/sanity/ignore-2.16.txt b/ansible_collections/community/windows/tests/sanity/ignore-2.16.txt index 84d7bb121..82f6c2fac 100644 --- a/ansible_collections/community/windows/tests/sanity/ignore-2.16.txt +++ b/ansible_collections/community/windows/tests/sanity/ignore-2.16.txt @@ -1,13 +1,5 @@ -plugins/modules/win_audit_rule.ps1 pslint:PSCustomUseLiteralPath -plugins/modules/win_rabbitmq_plugin.ps1 pslint:PSAvoidUsingInvokeExpression -plugins/modules/win_region.ps1 pslint:PSAvoidUsingEmptyCatchBlock # Keep -plugins/modules/win_regmerge.ps1 pslint:PSCustomUseLiteralPath -plugins/modules/win_robocopy.ps1 pslint:PSCustomUseLiteralPath -tests/integration/targets/win_audit_rule/library/test_get_audit_rule.ps1 pslint:PSCustomUseLiteralPath +plugins/modules/win_audit_rule.ps1 pslint:PSCustomUseLiteralPath # Unsure if we can fix this or not so keep ignoring for now tests/integration/targets/win_lineinfile/files/expectations/23_utf8_bom.txt shebang tests/integration/targets/win_lineinfile/files/expectations/24_utf8_bom_line_added.txt shebang tests/integration/targets/win_lineinfile/files/expectations/30_linebreaks_checksum_bad.txt line-endings -tests/integration/targets/win_psmodule/files/module/template.psd1 pslint!skip -tests/integration/targets/win_psmodule/files/module/template.psm1 pslint!skip -tests/integration/targets/win_psmodule/files/setup_modules.ps1 pslint:PSCustomUseLiteralPath tests/integration/targets/win_regmerge/templates/win_line_ending.j2 line-endings diff --git a/ansible_collections/community/windows/tests/sanity/ignore-2.17.txt b/ansible_collections/community/windows/tests/sanity/ignore-2.17.txt new file mode 100644 index 000000000..82f6c2fac --- /dev/null +++ b/ansible_collections/community/windows/tests/sanity/ignore-2.17.txt @@ -0,0 +1,5 @@ +plugins/modules/win_audit_rule.ps1 pslint:PSCustomUseLiteralPath # Unsure if we can fix this or not so keep ignoring for now +tests/integration/targets/win_lineinfile/files/expectations/23_utf8_bom.txt shebang +tests/integration/targets/win_lineinfile/files/expectations/24_utf8_bom_line_added.txt shebang +tests/integration/targets/win_lineinfile/files/expectations/30_linebreaks_checksum_bad.txt line-endings +tests/integration/targets/win_regmerge/templates/win_line_ending.j2 line-endings diff --git a/ansible_collections/community/windows/tests/unit/compat/__init__.py b/ansible_collections/community/windows/tests/unit/compat/__init__.py deleted file mode 100644 index e69de29bb..000000000 --- a/ansible_collections/community/windows/tests/unit/compat/__init__.py +++ /dev/null diff --git a/ansible_collections/community/windows/tests/unit/compat/mock.py b/ansible_collections/community/windows/tests/unit/compat/mock.py deleted file mode 100644 index 3dcd2687f..000000000 --- a/ansible_collections/community/windows/tests/unit/compat/mock.py +++ /dev/null @@ -1,42 +0,0 @@ -# (c) 2014, Toshio Kuratomi <tkuratomi@ansible.com> -# -# 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 <http://www.gnu.org/licenses/>. - -# Make coding more python3-ish -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -''' -Compat module for Python3.x's unittest.mock module -''' - -# Python 2.7 - -# Note: Could use the pypi mock library on python3.x as well as python2.x. It -# is the same as the python3 stdlib mock library - -try: - # Allow wildcard import because we really do want to import all of mock's - # symbols into this compat shim - # pylint: disable=wildcard-import,unused-wildcard-import - from unittest.mock import * -except ImportError: - # Python 2 - # pylint: disable=wildcard-import,unused-wildcard-import - try: - from mock import * - except ImportError: - print('You need the mock library installed on python2.x to run tests') diff --git a/ansible_collections/community/windows/tests/unit/mock/__init__.py b/ansible_collections/community/windows/tests/unit/mock/__init__.py deleted file mode 100644 index e69de29bb..000000000 --- a/ansible_collections/community/windows/tests/unit/mock/__init__.py +++ /dev/null diff --git a/ansible_collections/community/windows/tests/unit/mock/loader.py b/ansible_collections/community/windows/tests/unit/mock/loader.py deleted file mode 100644 index e5dff78c1..000000000 --- a/ansible_collections/community/windows/tests/unit/mock/loader.py +++ /dev/null @@ -1,116 +0,0 @@ -# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> -# -# 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 <http://www.gnu.org/licenses/>. - -# Make coding more python3-ish -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -import os - -from ansible.errors import AnsibleParserError -from ansible.parsing.dataloader import DataLoader -from ansible.module_utils._text import to_bytes, to_text - - -class DictDataLoader(DataLoader): - - def __init__(self, file_mapping=None): - file_mapping = {} if file_mapping is None else file_mapping - assert type(file_mapping) == dict - - super(DictDataLoader, self).__init__() - - self._file_mapping = file_mapping - self._build_known_directories() - self._vault_secrets = None - - def load_from_file(self, path, cache=True, unsafe=False): - path = to_text(path) - if path in self._file_mapping: - return self.load(self._file_mapping[path], path) - return None - - # TODO: the real _get_file_contents returns a bytestring, so we actually convert the - # unicode/text it's created with to utf-8 - def _get_file_contents(self, file_name): - path = to_text(file_name) - if path in self._file_mapping: - return (to_bytes(self._file_mapping[path]), False) - else: - raise AnsibleParserError("file not found: %s" % path) - - def path_exists(self, path): - path = to_text(path) - return path in self._file_mapping or path in self._known_directories - - def is_file(self, path): - path = to_text(path) - return path in self._file_mapping - - def is_directory(self, path): - path = to_text(path) - return path in self._known_directories - - def list_directory(self, path): - ret = [] - path = to_text(path) - for x in (list(self._file_mapping.keys()) + self._known_directories): - if x.startswith(path): - if os.path.dirname(x) == path: - ret.append(os.path.basename(x)) - return ret - - def is_executable(self, path): - # FIXME: figure out a way to make paths return true for this - return False - - def _add_known_directory(self, directory): - if directory not in self._known_directories: - self._known_directories.append(directory) - - def _build_known_directories(self): - self._known_directories = [] - for path in self._file_mapping: - dirname = os.path.dirname(path) - while dirname not in ('/', ''): - self._add_known_directory(dirname) - dirname = os.path.dirname(dirname) - - def push(self, path, content): - rebuild_dirs = False - if path not in self._file_mapping: - rebuild_dirs = True - - self._file_mapping[path] = content - - if rebuild_dirs: - self._build_known_directories() - - def pop(self, path): - if path in self._file_mapping: - del self._file_mapping[path] - self._build_known_directories() - - def clear(self): - self._file_mapping = dict() - self._known_directories = [] - - def get_basedir(self): - return os.getcwd() - - def set_vault_secrets(self, vault_secrets): - self._vault_secrets = vault_secrets diff --git a/ansible_collections/community/windows/tests/unit/mock/path.py b/ansible_collections/community/windows/tests/unit/mock/path.py deleted file mode 100644 index 54858b13d..000000000 --- a/ansible_collections/community/windows/tests/unit/mock/path.py +++ /dev/null @@ -1,8 +0,0 @@ -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -from ansible_collections.ansible.windows.tests.unit.compat.mock import MagicMock -from ansible.utils.path import unfrackpath - - -mock_unfrackpath_noop = MagicMock(spec_set=unfrackpath, side_effect=lambda x, *args, **kwargs: x) diff --git a/ansible_collections/community/windows/tests/unit/mock/procenv.py b/ansible_collections/community/windows/tests/unit/mock/procenv.py deleted file mode 100644 index 3cb1b5b2f..000000000 --- a/ansible_collections/community/windows/tests/unit/mock/procenv.py +++ /dev/null @@ -1,90 +0,0 @@ -# (c) 2016, Matt Davis <mdavis@ansible.com> -# (c) 2016, Toshio Kuratomi <tkuratomi@ansible.com> -# -# 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 <http://www.gnu.org/licenses/>. - -# Make coding more python3-ish -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -import sys -import json - -from contextlib import contextmanager -from io import BytesIO, StringIO -from ansible_collections.community.windows.tests.unit.compat import unittest -from ansible.module_utils.six import PY3 -from ansible.module_utils._text import to_bytes - - -@contextmanager -def swap_stdin_and_argv(stdin_data='', argv_data=tuple()): - """ - context manager that temporarily masks the test runner's values for stdin and argv - """ - real_stdin = sys.stdin - real_argv = sys.argv - - if PY3: - fake_stream = StringIO(stdin_data) - fake_stream.buffer = BytesIO(to_bytes(stdin_data)) - else: - fake_stream = BytesIO(to_bytes(stdin_data)) - - try: - sys.stdin = fake_stream - sys.argv = argv_data - - yield - finally: - sys.stdin = real_stdin - sys.argv = real_argv - - -@contextmanager -def swap_stdout(): - """ - context manager that temporarily replaces stdout for tests that need to verify output - """ - old_stdout = sys.stdout - - if PY3: - fake_stream = StringIO() - else: - fake_stream = BytesIO() - - try: - sys.stdout = fake_stream - - yield fake_stream - finally: - sys.stdout = old_stdout - - -class ModuleTestCase(unittest.TestCase): - def setUp(self, module_args=None): - if module_args is None: - module_args = {'_ansible_remote_tmp': '/tmp', '_ansible_keep_remote_files': False} - - args = json.dumps(dict(ANSIBLE_MODULE_ARGS=module_args)) - - # unittest doesn't have a clean place to use a context manager, so we have to enter/exit manually - self.stdin_swap = swap_stdin_and_argv(stdin_data=args) - self.stdin_swap.__enter__() - - def tearDown(self): - # unittest doesn't have a clean place to use a context manager, so we have to enter/exit manually - self.stdin_swap.__exit__(None, None, None) diff --git a/ansible_collections/community/windows/tests/unit/mock/vault_helper.py b/ansible_collections/community/windows/tests/unit/mock/vault_helper.py deleted file mode 100644 index dcce9c784..000000000 --- a/ansible_collections/community/windows/tests/unit/mock/vault_helper.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 <http://www.gnu.org/licenses/>. - -# Make coding more python3-ish -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -from ansible.module_utils._text import to_bytes - -from ansible.parsing.vault import VaultSecret - - -class TextVaultSecret(VaultSecret): - '''A secret piece of text. ie, a password. Tracks text encoding. - - The text encoding of the text may not be the default text encoding so - we keep track of the encoding so we encode it to the same bytes.''' - - def __init__(self, text, encoding=None, errors=None, _bytes=None): - super(TextVaultSecret, self).__init__() - self.text = text - self.encoding = encoding or 'utf-8' - self._bytes = _bytes - self.errors = errors or 'strict' - - @property - def bytes(self): - '''The text encoded with encoding, unless we specifically set _bytes.''' - return self._bytes or to_bytes(self.text, encoding=self.encoding, errors=self.errors) diff --git a/ansible_collections/community/windows/tests/unit/mock/yaml_helper.py b/ansible_collections/community/windows/tests/unit/mock/yaml_helper.py deleted file mode 100644 index 1ef172159..000000000 --- a/ansible_collections/community/windows/tests/unit/mock/yaml_helper.py +++ /dev/null @@ -1,124 +0,0 @@ -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -import io -import yaml - -from ansible.module_utils.six import PY3 -from ansible.parsing.yaml.loader import AnsibleLoader -from ansible.parsing.yaml.dumper import AnsibleDumper - - -class YamlTestUtils(object): - """Mixin class to combine with a unittest.TestCase subclass.""" - def _loader(self, stream): - """Vault related tests will want to override this. - - Vault cases should setup a AnsibleLoader that has the vault password.""" - return AnsibleLoader(stream) - - def _dump_stream(self, obj, stream, dumper=None): - """Dump to a py2-unicode or py3-string stream.""" - if PY3: - return yaml.dump(obj, stream, Dumper=dumper) - else: - return yaml.dump(obj, stream, Dumper=dumper, encoding=None) - - def _dump_string(self, obj, dumper=None): - """Dump to a py2-unicode or py3-string""" - if PY3: - return yaml.dump(obj, Dumper=dumper) - else: - return yaml.dump(obj, Dumper=dumper, encoding=None) - - def _dump_load_cycle(self, obj): - # Each pass though a dump or load revs the 'generation' - # obj to yaml string - string_from_object_dump = self._dump_string(obj, dumper=AnsibleDumper) - - # wrap a stream/file like StringIO around that yaml - stream_from_object_dump = io.StringIO(string_from_object_dump) - loader = self._loader(stream_from_object_dump) - # load the yaml stream to create a new instance of the object (gen 2) - obj_2 = loader.get_data() - - # dump the gen 2 objects directory to strings - string_from_object_dump_2 = self._dump_string(obj_2, - dumper=AnsibleDumper) - - # The gen 1 and gen 2 yaml strings - self.assertEqual(string_from_object_dump, string_from_object_dump_2) - # the gen 1 (orig) and gen 2 py object - self.assertEqual(obj, obj_2) - - # again! gen 3... load strings into py objects - stream_3 = io.StringIO(string_from_object_dump_2) - loader_3 = self._loader(stream_3) - obj_3 = loader_3.get_data() - - string_from_object_dump_3 = self._dump_string(obj_3, dumper=AnsibleDumper) - - self.assertEqual(obj, obj_3) - # should be transitive, but... - self.assertEqual(obj_2, obj_3) - self.assertEqual(string_from_object_dump, string_from_object_dump_3) - - def _old_dump_load_cycle(self, obj): - '''Dump the passed in object to yaml, load it back up, dump again, compare.''' - stream = io.StringIO() - - yaml_string = self._dump_string(obj, dumper=AnsibleDumper) - self._dump_stream(obj, stream, dumper=AnsibleDumper) - - yaml_string_from_stream = stream.getvalue() - - # reset stream - stream.seek(0) - - loader = self._loader(stream) - # loader = AnsibleLoader(stream, vault_password=self.vault_password) - obj_from_stream = loader.get_data() - - stream_from_string = io.StringIO(yaml_string) - loader2 = self._loader(stream_from_string) - # loader2 = AnsibleLoader(stream_from_string, vault_password=self.vault_password) - obj_from_string = loader2.get_data() - - stream_obj_from_stream = io.StringIO() - stream_obj_from_string = io.StringIO() - - if PY3: - yaml.dump(obj_from_stream, stream_obj_from_stream, Dumper=AnsibleDumper) - yaml.dump(obj_from_stream, stream_obj_from_string, Dumper=AnsibleDumper) - else: - yaml.dump(obj_from_stream, stream_obj_from_stream, Dumper=AnsibleDumper, encoding=None) - yaml.dump(obj_from_stream, stream_obj_from_string, Dumper=AnsibleDumper, encoding=None) - - yaml_string_stream_obj_from_stream = stream_obj_from_stream.getvalue() - yaml_string_stream_obj_from_string = stream_obj_from_string.getvalue() - - stream_obj_from_stream.seek(0) - stream_obj_from_string.seek(0) - - if PY3: - yaml_string_obj_from_stream = yaml.dump(obj_from_stream, Dumper=AnsibleDumper) - yaml_string_obj_from_string = yaml.dump(obj_from_string, Dumper=AnsibleDumper) - else: - yaml_string_obj_from_stream = yaml.dump(obj_from_stream, Dumper=AnsibleDumper, encoding=None) - yaml_string_obj_from_string = yaml.dump(obj_from_string, Dumper=AnsibleDumper, encoding=None) - - assert yaml_string == yaml_string_obj_from_stream - assert yaml_string == yaml_string_obj_from_stream == yaml_string_obj_from_string - assert (yaml_string == yaml_string_obj_from_stream == yaml_string_obj_from_string == yaml_string_stream_obj_from_stream == - yaml_string_stream_obj_from_string) - assert obj == obj_from_stream - assert obj == obj_from_string - assert obj == yaml_string_obj_from_stream - assert obj == yaml_string_obj_from_string - assert obj == obj_from_stream == obj_from_string == yaml_string_obj_from_stream == yaml_string_obj_from_string - return {'obj': obj, - 'yaml_string': yaml_string, - 'yaml_string_from_stream': yaml_string_from_stream, - 'obj_from_stream': obj_from_stream, - 'obj_from_string': obj_from_string, - 'yaml_string_obj_from_string': yaml_string_obj_from_string} diff --git a/ansible_collections/community/windows/tests/unit/modules/__init__.py b/ansible_collections/community/windows/tests/unit/modules/__init__.py deleted file mode 100644 index e69de29bb..000000000 --- a/ansible_collections/community/windows/tests/unit/modules/__init__.py +++ /dev/null diff --git a/ansible_collections/community/windows/tests/unit/modules/utils.py b/ansible_collections/community/windows/tests/unit/modules/utils.py deleted file mode 100644 index bc627df64..000000000 --- a/ansible_collections/community/windows/tests/unit/modules/utils.py +++ /dev/null @@ -1,50 +0,0 @@ -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -import json - -from ansible_collections.community.windows.tests.unit.compat import unittest -from ansible_collections.community.windows.tests.unit.compat.mock import patch -from ansible.module_utils import basic -from ansible.module_utils._text import to_bytes - - -def set_module_args(args): - if '_ansible_remote_tmp' not in args: - args['_ansible_remote_tmp'] = '/tmp' - if '_ansible_keep_remote_files' not in args: - args['_ansible_keep_remote_files'] = False - - args = json.dumps({'ANSIBLE_MODULE_ARGS': args}) - basic._ANSIBLE_ARGS = to_bytes(args) - - -class AnsibleExitJson(Exception): - pass - - -class AnsibleFailJson(Exception): - pass - - -def exit_json(*args, **kwargs): - if 'changed' not in kwargs: - kwargs['changed'] = False - raise AnsibleExitJson(kwargs) - - -def fail_json(*args, **kwargs): - kwargs['failed'] = True - raise AnsibleFailJson(kwargs) - - -class ModuleTestCase(unittest.TestCase): - - def setUp(self): - self.mock_module = patch.multiple(basic.AnsibleModule, exit_json=exit_json, fail_json=fail_json) - self.mock_module.start() - self.mock_sleep = patch('time.sleep') - self.mock_sleep.start() - set_module_args({}) - self.addCleanup(self.mock_module.stop) - self.addCleanup(self.mock_sleep.stop) diff --git a/ansible_collections/community/windows/tests/unit/plugins/lookup/fixtures/avi.json b/ansible_collections/community/windows/tests/unit/plugins/lookup/fixtures/avi.json deleted file mode 100644 index ae89ca689..000000000 --- a/ansible_collections/community/windows/tests/unit/plugins/lookup/fixtures/avi.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "mock_single_obj": { - "_last_modified": "", - "cloud_ref": "https://192.0.2.132/api/cloud/cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "dhcp_enabled": true, - "exclude_discovered_subnets": false, - "name": "PG-123", - "synced_from_se": true, - "tenant_ref": "https://192.0.2.132/api/tenant/admin", - "url": "https://192.0.2.132/api/network/dvportgroup-2084-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "uuid": "dvportgroup-2084-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vcenter_dvs": true, - "vimgrnw_ref": "https://192.0.2.132/api/vimgrnwruntime/dvportgroup-2084-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vrf_context_ref": "https://192.0.2.132/api/vrfcontext/vrfcontext-31f1b55f-319c-44eb-862f-69d79ffdf295" - }, - "mock_multiple_obj": { - "results": [ - { - "_last_modified": "", - "cloud_ref": "https://192.0.2.132/api/cloud/cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "dhcp_enabled": true, - "exclude_discovered_subnets": false, - "name": "J-PG-0682", - "synced_from_se": true, - "tenant_ref": "https://192.0.2.132/api/tenant/admin", - "url": "https://192.0.2.132/api/network/dvportgroup-2084-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "uuid": "dvportgroup-2084-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vcenter_dvs": true, - "vimgrnw_ref": "https://192.0.2.132/api/vimgrnwruntime/dvportgroup-2084-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vrf_context_ref": "https://192.0.2.132/api/vrfcontext/vrfcontext-31f1b55f-319c-44eb-862f-69d79ffdf295" - }, - { - "_last_modified": "", - "cloud_ref": "https://192.0.2.132/api/cloud/cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "dhcp_enabled": true, - "exclude_discovered_subnets": false, - "name": "J-PG-0231", - "synced_from_se": true, - "tenant_ref": "https://192.0.2.132/api/tenant/admin", - "url": "https://192.0.2.132/api/network/dvportgroup-1627-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "uuid": "dvportgroup-1627-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vcenter_dvs": true, - "vimgrnw_ref": "https://192.0.2.132/api/vimgrnwruntime/dvportgroup-1627-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vrf_context_ref": "https://192.0.2.132/api/vrfcontext/vrfcontext-31f1b55f-319c-44eb-862f-69d79ffdf295" - }, - { - "_last_modified": "", - "cloud_ref": "https://192.0.2.132/api/cloud/cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "dhcp_enabled": true, - "exclude_discovered_subnets": false, - "name": "J-PG-0535", - "synced_from_se": true, - "tenant_ref": "https://192.0.2.132/api/tenant/admin", - "url": "https://192.0.2.132/api/network/dvportgroup-1934-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "uuid": "dvportgroup-1934-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vcenter_dvs": true, - "vimgrnw_ref": "https://192.0.2.132/api/vimgrnwruntime/dvportgroup-1934-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vrf_context_ref": "https://192.0.2.132/api/vrfcontext/vrfcontext-31f1b55f-319c-44eb-862f-69d79ffdf295" - }, - { - "_last_modified": "", - "cloud_ref": "https://192.0.2.132/api/cloud/cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "dhcp_enabled": true, - "exclude_discovered_subnets": false, - "name": "J-PG-0094", - "synced_from_se": true, - "tenant_ref": "https://192.0.2.132/api/tenant/admin", - "url": "https://192.0.2.132/api/network/dvportgroup-1458-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "uuid": "dvportgroup-1458-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vcenter_dvs": true, - "vimgrnw_ref": "https://192.0.2.132/api/vimgrnwruntime/dvportgroup-1458-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vrf_context_ref": "https://192.0.2.132/api/vrfcontext/vrfcontext-31f1b55f-319c-44eb-862f-69d79ffdf295" - }, - { - "_last_modified": "", - "cloud_ref": "https://192.0.2.132/api/cloud/cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "dhcp_enabled": true, - "exclude_discovered_subnets": false, - "name": "J-PG-0437", - "synced_from_se": true, - "tenant_ref": "https://192.0.2.132/api/tenant/admin", - "url": "https://192.0.2.132/api/network/dvportgroup-1836-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "uuid": "dvportgroup-1836-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vcenter_dvs": true, - "vimgrnw_ref": "https://192.0.2.132/api/vimgrnwruntime/dvportgroup-1836-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vrf_context_ref": "https://192.0.2.132/api/vrfcontext/vrfcontext-31f1b55f-319c-44eb-862f-69d79ffdf295" - }, - { - "_last_modified": "", - "cloud_ref": "https://192.0.2.132/api/cloud/cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "dhcp_enabled": true, - "exclude_discovered_subnets": false, - "name": "J-PG-0673", - "synced_from_se": true, - "tenant_ref": "https://192.0.2.132/api/tenant/admin", - "url": "https://192.0.2.132/api/network/dvportgroup-2075-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "uuid": "dvportgroup-2075-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vcenter_dvs": true, - "vimgrnw_ref": "https://192.0.2.132/api/vimgrnwruntime/dvportgroup-2075-cloud-4d063be1-99c2-44cf-8b28-977bd970524c", - "vrf_context_ref": "https://192.0.2.132/api/vrfcontext/vrfcontext-31f1b55f-319c-44eb-862f-69d79ffdf295" - } - ] - } -} diff --git a/ansible_collections/community/windows/tests/unit/plugins/lookup/test_laps_password.py b/ansible_collections/community/windows/tests/unit/plugins/lookup/test_laps_password.py index 29e2b938a..d15fc109f 100644 --- a/ansible_collections/community/windows/tests/unit/plugins/lookup/test_laps_password.py +++ b/ansible_collections/community/windows/tests/unit/plugins/lookup/test_laps_password.py @@ -10,8 +10,8 @@ import os import platform import pytest import sys +from unittest.mock import MagicMock -from ansible_collections.community.windows.tests.unit.compat.mock import MagicMock from ansible.errors import AnsibleLookupError from ansible.plugins.loader import lookup_loader diff --git a/ansible_collections/community/windows/tests/utils/shippable/lint.sh b/ansible_collections/community/windows/tests/utils/shippable/lint.sh new file mode 100755 index 000000000..12b5b4cd2 --- /dev/null +++ b/ansible_collections/community/windows/tests/utils/shippable/lint.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -o pipefail -eux + +# This is aligned with the galaxy-importer used by AH +# https://github.com/ansible/galaxy-importer/blob/d4b5e6d12088ba452f129f4824bd049be5543358/setup.cfg#L22C4-L22C33 +python -m pip install \ + 'ansible-lint>=6.2.2,<=6.14.3' + +ansible-lint |