diff options
Diffstat (limited to 'ansible_collections/azure')
445 files changed, 16444 insertions, 15194 deletions
diff --git a/ansible_collections/azure/azcollection/.idea/.gitignore b/ansible_collections/azure/azcollection/.idea/.gitignore new file mode 100644 index 000000000..1c2fda565 --- /dev/null +++ b/ansible_collections/azure/azcollection/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/ansible_collections/azure/azcollection/.idea/azcollection.iml b/ansible_collections/azure/azcollection/.idea/azcollection.iml new file mode 100644 index 000000000..6db416ffe --- /dev/null +++ b/ansible_collections/azure/azcollection/.idea/azcollection.iml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<module type="PYTHON_MODULE" version="4">
+ <component name="NewModuleRootManager">
+ <content url="file://$MODULE_DIR$" />
+ <orderEntry type="jdk" jdkName="Python 3.10.12 WSL (Ubuntu-22.04): (/home/eric/workspace/ansible-workspace/mymodule/test/bin/python3)" jdkType="Python SDK" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ </component>
+ <component name="PyDocumentationSettings">
+ <option name="format" value="PLAIN" />
+ <option name="myDocStringFormat" value="Plain" />
+ </component>
+</module>
\ No newline at end of file diff --git a/ansible_collections/azure/azcollection/.idea/inspectionProfiles/profiles_settings.xml b/ansible_collections/azure/azcollection/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 000000000..105ce2da2 --- /dev/null +++ b/ansible_collections/azure/azcollection/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ +<component name="InspectionProjectProfileManager"> + <settings> + <option name="USE_PROJECT_PROFILE" value="false" /> + <version value="1.0" /> + </settings> +</component>
\ No newline at end of file diff --git a/ansible_collections/azure/azcollection/.idea/misc.xml b/ansible_collections/azure/azcollection/.idea/misc.xml new file mode 100644 index 000000000..ecadf7f30 --- /dev/null +++ b/ansible_collections/azure/azcollection/.idea/misc.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="Black">
+ <option name="sdkName" value="Python 3.10.12 WSL (Ubuntu-22.04): (/home/eric/workspace/ansible-workspace/mymodule/test/bin/python3)" />
+ </component>
+ <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10.12 WSL (Ubuntu-22.04): (/home/eric/workspace/ansible-workspace/mymodule/test/bin/python3)" project-jdk-type="Python SDK" />
+</project>
\ No newline at end of file diff --git a/ansible_collections/azure/azcollection/.idea/modules.xml b/ansible_collections/azure/azcollection/.idea/modules.xml new file mode 100644 index 000000000..2701c413f --- /dev/null +++ b/ansible_collections/azure/azcollection/.idea/modules.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ProjectModuleManager">
+ <modules>
+ <module fileurl="file://$PROJECT_DIR$/.idea/azcollection.iml" filepath="$PROJECT_DIR$/.idea/azcollection.iml" />
+ </modules>
+ </component>
+</project>
\ No newline at end of file diff --git a/ansible_collections/azure/azcollection/.idea/vcs.xml b/ansible_collections/azure/azcollection/.idea/vcs.xml new file mode 100644 index 000000000..c8397c94c --- /dev/null +++ b/ansible_collections/azure/azcollection/.idea/vcs.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="VcsDirectoryMappings">
+ <mapping directory="" vcs="Git" />
+ </component>
+</project>
\ No newline at end of file diff --git a/ansible_collections/azure/azcollection/.idea/workspace.xml b/ansible_collections/azure/azcollection/.idea/workspace.xml new file mode 100644 index 000000000..88ec9a9b1 --- /dev/null +++ b/ansible_collections/azure/azcollection/.idea/workspace.xml @@ -0,0 +1,138 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="AutoImportSettings">
+ <option name="autoReloadType" value="SELECTIVE" />
+ </component>
+ <component name="ChangeListManager">
+ <list default="true" id="d047ab49-1c87-4a80-9a8a-6e10b8f617c7" name="Changes" comment="deprecate tenant ID" />
+ <option name="SHOW_DIALOG" value="false" />
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+ <option name="LAST_RESOLUTION" value="IGNORE" />
+ </component>
+ <component name="Git.Settings">
+ <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
+ </component>
+ <component name="MarkdownSettingsMigration">
+ <option name="stateVersion" value="1" />
+ </component>
+ <component name="ProjectColorInfo">{ + "associatedIndex": 3 +}</component>
+ <component name="ProjectId" id="2V04ePwIacqirqMx6z2ILJcwwz8" />
+ <component name="ProjectViewState">
+ <option name="hideEmptyMiddlePackages" value="true" />
+ <option name="showLibraryContents" value="true" />
+ </component>
+ <component name="PropertiesComponent">{ + "keyToString": { + "RunOnceActivity.OpenProjectViewOnStart": "true", + "RunOnceActivity.ShowReadmeOnStart": "true", + "WebServerToolWindowFactoryState": "false", + "git-widget-placeholder": "f/msgraph__beta", + "last_opened_file_path": "//wsl$/Ubuntu-22.04/home/eric/workspace/ansible-workspace/azcollection", + "node.js.detected.package.eslint": "true", + "node.js.detected.package.tslint": "true", + "node.js.selected.package.eslint": "(autodetect)", + "node.js.selected.package.tslint": "(autodetect)", + "nodejs_package_manager_path": "npm", + "settings.editor.selected.configurable": "com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable", + "vue.rearranger.settings.migration": "true" + } +}</component>
+ <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
+ <component name="TaskManager">
+ <task active="true" id="Default" summary="Default task">
+ <changelist id="d047ab49-1c87-4a80-9a8a-6e10b8f617c7" name="Changes" comment="" />
+ <created>1693959760639</created>
+ <option name="number" value="Default" />
+ <option name="presentableId" value="Default" />
+ <updated>1693959760639</updated>
+ <workItem from="1693959762094" duration="3039000" />
+ <workItem from="1693972601745" duration="6259000" />
+ <workItem from="1694156355409" duration="318000" />
+ <workItem from="1695017100314" duration="636000" />
+ <workItem from="1697608879446" duration="1750000" />
+ <workItem from="1697612810177" duration="444000" />
+ <workItem from="1697697857011" duration="781000" />
+ <workItem from="1698046408261" duration="2057000" />
+ <workItem from="1698115035079" duration="743000" />
+ </task>
+ <task id="LOCAL-00001" summary="msgraph client">
+ <option name="closed" value="true" />
+ <created>1693977495938</created>
+ <option name="number" value="00001" />
+ <option name="presentableId" value="LOCAL-00001" />
+ <option name="project" value="LOCAL" />
+ <updated>1693977495938</updated>
+ </task>
+ <task id="LOCAL-00002" summary="msgraph client">
+ <option name="closed" value="true" />
+ <created>1693977569076</created>
+ <option name="number" value="00002" />
+ <option name="presentableId" value="LOCAL-00002" />
+ <option name="project" value="LOCAL" />
+ <updated>1693977569076</updated>
+ </task>
+ <task id="LOCAL-00003" summary="migrate account API from graphrbac to msgraph">
+ <option name="closed" value="true" />
+ <created>1693977622517</created>
+ <option name="number" value="00003" />
+ <option name="presentableId" value="LOCAL-00003" />
+ <option name="project" value="LOCAL" />
+ <updated>1693977622517</updated>
+ </task>
+ <task id="LOCAL-00004" summary="fix sanity">
+ <option name="closed" value="true" />
+ <created>1695017609087</created>
+ <option name="number" value="00004" />
+ <option name="presentableId" value="LOCAL-00004" />
+ <option name="project" value="LOCAL" />
+ <updated>1695017609087</updated>
+ </task>
+ <task id="LOCAL-00005" summary="fix sanity">
+ <option name="closed" value="true" />
+ <created>1697611839381</created>
+ <option name="number" value="00005" />
+ <option name="presentableId" value="LOCAL-00005" />
+ <option name="project" value="LOCAL" />
+ <updated>1697611839381</updated>
+ </task>
+ <task id="LOCAL-00006" summary="fix sanity">
+ <option name="closed" value="true" />
+ <created>1697613231431</created>
+ <option name="number" value="00006" />
+ <option name="presentableId" value="LOCAL-00006" />
+ <option name="project" value="LOCAL" />
+ <updated>1697613231431</updated>
+ </task>
+ <task id="LOCAL-00007" summary="deprecate tenant ID">
+ <option name="closed" value="true" />
+ <created>1697698300998</created>
+ <option name="number" value="00007" />
+ <option name="presentableId" value="LOCAL-00007" />
+ <option name="project" value="LOCAL" />
+ <updated>1697698300998</updated>
+ </task>
+ <task id="LOCAL-00008" summary="deprecate tenant ID">
+ <option name="closed" value="true" />
+ <created>1698048324225</created>
+ <option name="number" value="00008" />
+ <option name="presentableId" value="LOCAL-00008" />
+ <option name="project" value="LOCAL" />
+ <updated>1698048324225</updated>
+ </task>
+ <option name="localTasksCounter" value="9" />
+ <servers />
+ </component>
+ <component name="TypeScriptGeneratedFilesManager">
+ <option name="version" value="3" />
+ </component>
+ <component name="VcsManagerConfiguration">
+ <MESSAGE value="msgraph client" />
+ <MESSAGE value="migrate account API from graphrbac to msgraph" />
+ <MESSAGE value="fix sanity" />
+ <MESSAGE value="deprecate tenant ID" />
+ <option name="LAST_COMMIT_MESSAGE" value="deprecate tenant ID" />
+ </component>
+</project>
\ No newline at end of file diff --git a/ansible_collections/azure/azcollection/CHANGELOG.md b/ansible_collections/azure/azcollection/CHANGELOG.md index 8de6021a3..e25da8d72 100644 --- a/ansible_collections/azure/azcollection/CHANGELOG.md +++ b/ansible_collections/azure/azcollection/CHANGELOG.md @@ -1,5 +1,78 @@ # Change Log +## v1.19.0 (2023-11-6) + +### FEATURE ENHANCEMENT + - Update all test case Ubuntu Image version to 20.04-LTS, 16.04-LTS will be deprecated ([#1288](https://github.com/ansible-collections/azure/pull/1288)) + - Migrate `msrestazure` to `azure-mgmt-core` and `azure-identity` ([#1267](https://github.com/ansible-collections/azure/pull/1267)) + - Support `ansible-lint` test to `azure.azcollection` ([#1292](https://github.com/ansible-collections/azure/pull/1292)) + +### BUG FIXING + - plugins/module_utls/azure_rm_common.py: Add support for custom ADFS endpoint ([#1299](https://github.com/ansible-collections/azure/pull/1299)) + - azure_rm_virtualmachine: Fix `disable_password_authentication` not set bug ([#1301](https://github.com/ansible-collections/azure/pull/1301)) + - azure_rm_azurefiewall_info: Fix `nat_rule_collections` not set bug ([#1308](https://github.com/ansible-collections/azure/pull/1308)) + - azure_rm_*.py: Fixed sanity errors in the module ([#1296](https://github.com/ansible-collections/azure/pull/1296)) + - Add required description to the document ([#1314](https://github.com/ansible-collections/azure/pull/1314)) + +## v1.18.1 (2023-9-25) + +### BUG FIXING + - inventory/azure_rm: Fix authorization initialization bug. [#1271](https://github.com/ansible-collections/azure/pull/1271) + - azure_rm_managementgroup_info: Fix `azure_object.type` to equal `Microsoft.Management/managementGroups`. [#1252](https://github.com/ansible-collections/azure/pull/1252) + +## v1.18.0 (2023-9-22) + +### FEATURE ENHANCEMENT + - Migrate `msrest` to `azure-core`. [#1245](https://github.com/ansible-collections/azure/pull/1245) + - Upgrade `GenericRestClient` authorization from ADAL to MSAL - [#1245](https://github.com/ansible-collections/azure/pull/1245) + - Lazy initialization of AD resource credentials. [#1268](https://github.com/ansible-collections/azure/pull/1268) + +## v1.17.0 (2023-8-23) + +### FEATURE ENHANCEMENT + - azure_rm_virtualmachine: + - Support update User Assigned and System assigned identities ([#1177](https://github.com/ansible-collections/azure/pull/1177)) + - Add support force power off([#1186](https://github.com/ansible-collections/azure/pull/1186)) + - Allow to set boot diagnostics storage account to managed ([#1206](https://github.com/ansible-collections/azure/pull/1206)) + - azure_rm.py: + - Add creation timestamp to `hostvars` ([#1221](https://github.com/ansible-collections/azure/pull/1221)) + - Add an example on how to add a domain to hostname for dynamic inventory ((#1211](https://github.com/ansible-collections/azure/pull/1211)) + - azure_rm_virtualnetwork: Improve documentation ([#1203](https://github.com/ansible-collections/azure/pull/1203)) + - azure_rm_storageshare: Add support for `enabled_protocols` and `root_squash` ([#1216](https://github.com/ansible-collections/azure/pull/1216)) + - azure_rm_common: Migrate ADAL to MSAL, remove ADAL from direct dependencies ([#1239](https://github.com/ansible-collections/azure/pull/1239)) + - sanity-requirements-azure.txt: + - Bump cryptography from v38.0.3 to v39.0.1 ([#1076](https://github.com/ansible-collections/azure/pull/1076)) + - Bump cryptography from v39.0.1 to v41.0.3 ([#1244](https://github.com/ansible-collections/azure/pull/1244)) + - azure_rm_batchaccount: Upgrade `azure-mgmt-batch` to v17.0.0 ([#1202](https://github.com/ansible-collections/azure/pull/1202)) + - azure_rm_batchaccount_info: Upgrade `azure-mgmt-batch` to v17.0.0 ([#1202](https://github.com/ansible-collections/azure/pull/1202)) + - pr-pipelines.yml: Update test Ansible version to v2.14.0 ([#1182](https://github.com/ansible-collections/azure/pull/1182)) + - runtime.yml: Keep action_groups and modules list consistent for v1.15.0 and v1.16.0 ([#1188](https://github.com/ansible-collections/azure/pull/1188)) + - azure_rm_aks_info: Support to list all managed cluster ([#1229](https://github.com/ansible-collections/azure/pull/1229)) + +### BUG FIXING + - azure_rm_virtualmachine: + - Fix `version_added in azure_rm_virtualmachine document ([#1180](https://github.com/ansible-collections/azure/pull/1180)) + - Fix setting of encryption at host for VMs ([#1207](https://github.com/ansible-collections/azure/pull/1207)) + - Fix typo `update_security_profle` ([#1194](https://github.com/ansible-collections/azure/pull/1194)) + - README.md: Fix document link in README ([#1189](https://github.com/ansible-collections/azure/pull/1189)) + - azure_rm_keyvaultkey: + - Fix an error when `client_id` and `secret` are empty ([#1185](https://github.com/ansible-collections/azure/pull/1185)) + - Upgrade `azure-keyvault` to v4.2.0 ([#1198](https://github.com/ansible-collections/azure/pull/1198)) + - azure_rm_keyvaultkey_info: + - Fix an error when `client_id` and `secret` are empty ([#1185](https://github.com/ansible-collections/azure/pull/1185)) + - Upgrade `azure-keyvault` to v4.2.0 ([#1198](https://github.com/ansible-collections/azure/pull/1198)) + - azure_rm_keyvaultsecret: + - Fix an error when `client_id` and `secret` are empty ([#1185](https://github.com/ansible-collections/azure/pull/1185)) + - Upgrade `azure-keyvault` to v4.2.0 ([#1198](https://github.com/ansible-collections/azure/pull/1198)) + - azure_rm_keyvaultsecret_info: + - Fix an error when `client_id` and `secret` are empty ([#1185](https://github.com/ansible-collections/azure/pull/1185)) + - Upgrade `azure-keyvault` to v4.2.0 ([#1198](https://github.com/ansible-collections/azure/pull/1198)) + - azure_rm_manageddisk: source_account_id should be storage_account_id ([#1187](https://github.com/ansible-collections/azure/pull/1187)) + - azure_rm_mmultipleanageddisk: `source_account_id` should be ~~~~`storage_account_id` ([#1187](https://github.com/ansible-collections/azure/pull/1187)) + - azure_rm_virtualmachine_info: Fix the issue when `security_profile` not returned ([#1205](https://github.com/ansible-collections/azure/pull/1205)) + - azure_rm_backupazurevm: Use the module configured `subscrtion_id` if available ([#1225](https://github.com/ansible-collections/azure/pull/1225)) + - azure_keyvault_secret: Removed subscription_id from azure_keyvault_secret lookup when using az cli auth ([#1175](https://github.com/ansible-collections/azure/pull/1175)) + ## v1.16.0 (2023-5-31) ### NEW MODULES diff --git a/ansible_collections/azure/azcollection/FILES.json b/ansible_collections/azure/azcollection/FILES.json index d314f7c22..3ef548ee8 100644 --- a/ansible_collections/azure/azcollection/FILES.json +++ b/ansible_collections/azure/azcollection/FILES.json @@ -8,10 +8,10 @@ "format": 1 }, { - "name": "requirements-azure.txt", + "name": "README.md", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "0d3ab574844946a3cb88cb12cac8a4380b0c7c8acb99bed574c5fb481f6d88c3", + "chksum_sha256": "5c2cfcffcf93c51cab4c38238a262431adacb67bd106fd484e730cc8cd17679c", "format": 1 }, { @@ -22,6 +22,13 @@ "format": 1 }, { + "name": "requirements-azure.txt", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "575dc8b28a49511996ebd91849dc2d61bc5789bf68d2e1c28c9309a7d2ddc887", + "format": 1 + }, + { "name": "meta", "ftype": "dir", "chksum_type": null, @@ -32,7 +39,7 @@ "name": "meta/runtime.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "af114eb0e48183137f2fde23d6d77ea8970147a687c837e52a20cb78604b580e", + "chksum_sha256": "f348a65f8d5a078d41b7f9608bef523b5a63d577cea802bb31755bd21c62fd01", "format": 1 }, { @@ -43,17 +50,17 @@ "format": 1 }, { - "name": ".gitignore", + "name": "pr-pipelines.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "702d6332d579931561017161f2d96eb3b023a006c94ed262d789411d0f21bd26", + "chksum_sha256": "b58b22a0b119202301503af60a15be12426baa3a8c9c82928bea87c9706b2979", "format": 1 }, { - "name": "README.md", + "name": "CredScanSuppressions.json", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "47923e21e1b1f0068efe3fed7da6302d7025459aef915dd0a2502d9645e993ef", + "chksum_sha256": "98c0ee6a0b7a115787cf109a8c0e2ea4a61df6751ecda37915b22ffb44a1128d", "format": 1 }, { @@ -74,7 +81,7 @@ "name": "plugins/lookup/azure_keyvault_secret.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b5657c1cee7e677d0c6bbb107978a38267d1e07d9b050fad19cbec413b41adea", + "chksum_sha256": "6f20418149499651d651da69502e509ad913074c5da1d4005a37b86b96eda0ce", "format": 1 }, { @@ -85,17 +92,17 @@ "format": 1 }, { - "name": "plugins/doc_fragments/azure_tags.py", + "name": "plugins/doc_fragments/azure_rm.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e8c9d720dbc7605d3ee66799e8e81d0886e404c9a07b6b9b8edc844e0646de64", + "chksum_sha256": "e19514cc0040e3b896fe05729dc6d5c5bc22698aff5bfa12d85e5195fb019634", "format": 1 }, { - "name": "plugins/doc_fragments/azure_rm.py", + "name": "plugins/doc_fragments/azure_tags.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e19514cc0040e3b896fe05729dc6d5c5bc22698aff5bfa12d85e5195fb019634", + "chksum_sha256": "e8c9d720dbc7605d3ee66799e8e81d0886e404c9a07b6b9b8edc844e0646de64", "format": 1 }, { @@ -116,826 +123,805 @@ "name": "plugins/module_utils/azure_rm_common_ext.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "4acbc55dc634fdeb3e4c055b444523acf354e6709b958596050f163568592baa", + "chksum_sha256": "ebf7c0c6f4ad7a05a04d740ca989a05cc4b22728acbd6390d9aa90931eca1647", "format": 1 }, { - "name": "plugins/module_utils/azure_rm_common.py", + "name": "plugins/module_utils/azure_rm_common_rest.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "606edcc9cca3e648db7d5c88e7561e8d4148c3cc523b9ad2142eac5804a81126", + "chksum_sha256": "81845c1924ae3be8f567d3d1eac2c01ddb1ae2a6bf72d41197423b4f37e59253", "format": 1 }, { - "name": "plugins/module_utils/azure_rm_common_rest.py", + "name": "plugins/module_utils/azure_rm_common.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "53ae072d4b4c3943049b405b0872a222a28c29f4f64ef430b120313c25d0ea51", + "chksum_sha256": "54a254f8975e14c17a5e60c7727ff1eb540e3027b1622066197184d5cb449267", "format": 1 }, { - "name": "plugins/modules", + "name": "plugins/inventory", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "plugins/modules/azure_rm_postgresqlserver.py", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "ac36eabbde56c6ed8d32e1e708e86e0b02a6ac85ba8a1069b3cf2b91c7c1f6ee", - "format": 1 - }, - { - "name": "plugins/modules/azure_rm_datafactory.py", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "1da36c4fd0cd07a25878ed7859039c2ddd6597bcfa01720a68347492dd101831", - "format": 1 - }, - { - "name": "plugins/modules/azure_rm_rediscache.py", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "557b83629f97b2b2307c641483cd158803a28659e5f8efd40aa25fea37c462e4", - "format": 1 - }, - { - "name": "plugins/modules/azure_rm_deployment_info.py", + "name": "plugins/inventory/azure_rm.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "292c3a0f562b370b6f572a5d5b03e0ba82fd9609406b48a75e9d2d2b13b9f130", + "chksum_sha256": "bed3077d86f3b8db29b588d99a2f8899e8b1c1a745727d85719ad9a1d264b71a", "format": 1 }, { - "name": "plugins/modules/azure_rm_dnszone.py", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "f825ef2bc97fa1d8bee35f4180d873600af36063458d9ad901dc4a3c660de504", + "name": "plugins/modules", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, "format": 1 }, { - "name": "plugins/modules/azure_rm_keyvaultsecret.py", + "name": "plugins/modules/azure_rm_devtestlabartifactsource_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "04d1a312ebdb537b49cf8fa68d4a3893f4d3d0bb8a7a820a3fc44f3c4e75286b", + "chksum_sha256": "53f584ee94c091e0879eb336194eaef6b94504dfe999f493bd1d029e30d03127", "format": 1 }, { - "name": "plugins/modules/azure_rm_recoveryservicesvault_info.py", + "name": "plugins/modules/azure_rm_gallery_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "7fbb41c71996147f8d3d87cae800d7e7282cac0c22344b0b24b1c5f264a73ac7", + "chksum_sha256": "e1b22cd1253e69c51442a1e402ef64fbdccaa8ce61b05839041fd7c35a5a44ab", "format": 1 }, { - "name": "plugins/modules/azure_rm_mariadbfirewallrule_info.py", + "name": "plugins/modules/azure_rm_automationaccount_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "01735c5b13076bf7addd1b0252a7cbfd13393cf9935fe8bcabe365781959d25e", + "chksum_sha256": "048a0c9b532196427437575202beaf31f8314efb70c67aa86733e6cccc14a98c", "format": 1 }, { - "name": "plugins/modules/azure_rm_virtualnetworkpeering.py", + "name": "plugins/modules/azure_rm_privateendpointdnszonegroup_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "1205bd5e4b0cf149badbf1548eb8053df46be138e94b5b83c9676087c15ba522", + "chksum_sha256": "70582f1fa2c40f77e166f00242bd6bff2e7c018368beaa2ac960328c341faa77", "format": 1 }, { - "name": "plugins/modules/azure_rm_availabilityset_info.py", + "name": "plugins/modules/azure_rm_virtualnetwork_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "c464064706e7c2e53445766acdd4a670d2b68a9b2b2ddf0ba4b9c5879dea325d", + "chksum_sha256": "39cbe4ccb66acb4dd36b893c9cb000846535c0726b8960e541a47f576fa2ed6f", "format": 1 }, { - "name": "plugins/modules/azure_rm_virtualhubconnection.py", + "name": "plugins/modules/azure_rm_rediscache.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "7360b65211c92c73677c4953ba206ecb13312762c2c620a57cff6333e0c2733f", + "chksum_sha256": "2323900cb0386fdd65ca6edada0a669ae12d6d87a9c08afb9bc92e150612a36d", "format": 1 }, { - "name": "plugins/modules/azure_rm_devtestlabenvironment_info.py", + "name": "plugins/modules/azure_rm_privatednszone_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "92878bbd684969558369a571b7fd9ade1db9cdbd9ad89547d3f89372bcdf05e5", + "chksum_sha256": "d1ed854fff931a8a0295b9a4f82235bb9ed8cf5bb947377c51931bcf94dc4c9f", "format": 1 }, { - "name": "plugins/modules/azure_rm_appserviceplan_info.py", + "name": "plugins/modules/azure_rm_mysqlconfiguration.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e4f0fc5c72974480e9bede435bbfc0648a4ce37fc33cd65388fe90dd9cb19fec", + "chksum_sha256": "fff34c89e959affced009f321ef5cd6b6ad9955e711d69306f339ca4c15392e0", "format": 1 }, { - "name": "plugins/modules/azure_rm_containerregistryreplication.py", + "name": "plugins/modules/azure_rm_loadbalancer_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "477a310f9303dc7b696ccb724f77bd234b2c45ee4bfcbe2ca8f4cda4f1889822", + "chksum_sha256": "b6b508842cc40fd4310a90e2bbad7733a50b7c43e29dc73dbccb304940b0f53c", "format": 1 }, { - "name": "plugins/modules/azure_rm_devtestlabcustomimage_info.py", + "name": "plugins/modules/azure_rm_ddosprotectionplan_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ebc5d1ef44b5f012c125081034908adecfa3ecf8cfee882942e824bbaf51da8a", + "chksum_sha256": "9ea0ae1f2bcab647085f83b8223d763abf123afe3996d0aeb0f304fc8d4fc7d3", "format": 1 }, { - "name": "plugins/modules/azure_rm_mysqlconfiguration_info.py", + "name": "plugins/modules/azure_rm_hostgroup.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "c619b88c383da85e76bfbbeabf16bcb06d2f0e9e0d392fa08a6ae508b3de9d4f", + "chksum_sha256": "7f3b26f577bb53702d0ed884da4c0c587dc6a186b7bdf9b87d3765c7dadcd89f", "format": 1 }, { - "name": "plugins/modules/azure_rm_virtualmachinescalesetinstance_info.py", + "name": "plugins/modules/azure_rm_datafactory.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "56db10cbaef59fc0c443d9bd86bf5372802072cf5732c8066c7d218214c971b2", + "chksum_sha256": "5e54eadbb395d175730960b6e089b78c76cefeebe08dca0ab1ae80e4d34e78fb", "format": 1 }, { - "name": "plugins/modules/azure_rm_monitordiagnosticsetting.py", + "name": "plugins/modules/azure_rm_virtualmachineextension_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "5bf14614ea9745167d68b040bc2dae3e39d7f3571c4ac8300ee84cbf85384a5e", + "chksum_sha256": "f845763404b68b32efe0187e0224cf30b7c71366531b4de508089df01f4849a3", "format": 1 }, { - "name": "plugins/modules/azure_rm_bastionhost.py", + "name": "plugins/modules/azure_rm_dnszone_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "1ec272790bd6b94d9dfbe0dc462248c0ecc0b79369624d15c03225f36dce8ee0", + "chksum_sha256": "15da62156897e9dc73a74650198e57b4d6dce5bb761b1e0b0c86d19be31f1cce", "format": 1 }, { - "name": "plugins/modules/azure_rm_aksagentpool_info.py", + "name": "plugins/modules/azure_rm_rediscache_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "29944645e694dc258752791bd4f12db6b342c03c349ab4fd02be4ecec3685024", + "chksum_sha256": "af3900d503ca2de80407fa58b2a09e2835a2087315d12a6ae70145f738a71120", "format": 1 }, { - "name": "plugins/modules/azure_rm_adgroup.py", + "name": "plugins/modules/azure_rm_iothub.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "bd86c61a597aebb1e178931d6aa1fe52d237033e958179e24c40bc8298612815", + "chksum_sha256": "aee9f30afbc1989ff7cfe64101c59d842dc635e59b34411d4045c428f1109b1d", "format": 1 }, { - "name": "plugins/modules/azure_rm_containerregistrywebhook_info.py", + "name": "plugins/modules/azure_rm_mysqlconfiguration_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "3d83d00c3da287e1ed154c87cc0f5781827c67b9406d16eeed8708730a12a176", + "chksum_sha256": "d9e284a3a0c4c2ec47a44ac4a7419358ab7d897488fa29de3ae616cfed56ec4d", "format": 1 }, { - "name": "plugins/modules/azure_rm_natgateway_info.py", + "name": "plugins/modules/azure_rm_devtestlabvirtualmachine.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "021ebecacb738ca5dee8232ea800dc00df78d927690a63f4e0aacc84318ece9c", + "chksum_sha256": "b851e89e72b71469d5eeefb555948de70ae6372728745fa25761ab952164ae08", "format": 1 }, { - "name": "plugins/modules/azure_rm_deployment.py", + "name": "plugins/modules/azure_rm_backuppolicy_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "2cf58936df2b1a3df183b6bd855272e83987692fb2cad8209b285a1ee4c4f426", + "chksum_sha256": "f16cb70c198028b5273e9d89ad554ed6a8e40217284a1fafb9658121c415b4b0", "format": 1 }, { - "name": "plugins/modules/azure_rm_appserviceplan.py", + "name": "plugins/modules/azure_rm_batchaccount.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "c505925c19a228a7d632cdbc5e63dc1bbb25e9bac1d960f7906b55756fa32a25", + "chksum_sha256": "1010400ee7ceae601c41e97f30336b2732cdab7edf899ab95edf706f1470f0da", "format": 1 }, { - "name": "plugins/modules/azure_rm_privateendpoint_info.py", + "name": "plugins/modules/azure_rm_cognitivesearch_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "5af5bd1029cb66bed1438a26af63abd3cd77b3ae8bab5618dac3b491dcc59d47", + "chksum_sha256": "8e5e926aea80ecc40b2a0c06745ed85287f4f6f83692af2ad78e7ea641c8d463", "format": 1 }, { - "name": "plugins/modules/azure_rm_webappvnetconnection_info.py", + "name": "plugins/modules/azure_rm_managementgroup_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "29e0729f1439028f37a3c8801228728f91f99ce08194832d3981b0a7fc2f5758", + "chksum_sha256": "728bb535e8dbf3211e4a79123dfa981434dc51423efb046e2bfa6cb35c5949f6", "format": 1 }, { - "name": "plugins/modules/azure_rm_privateendpointconnection.py", + "name": "plugins/modules/azure_rm_lock_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "9ecc4f6823fed8b227500c7714851dcc9f398424d5774bf89f8dafca9afcbef3", + "chksum_sha256": "a176ee61fc34ddb3afb0a07d267ce819f0b85f1e271ae4f52f51004869014d21", "format": 1 }, { - "name": "plugins/modules/azure_rm_dnszone_info.py", + "name": "plugins/modules/azure_rm_containerregistrytag.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "05c9187df1957f9d3d1d748ebea17dd270c50a741846964e94cffef1f6948882", + "chksum_sha256": "9b6a6b029d0bff63cc6fd9cbbbc92f44337fd23d460747b942a4caf32731ad05", "format": 1 }, { - "name": "plugins/modules/azure_rm_servicebusqueue.py", + "name": "plugins/modules/azure_rm_proximityplacementgroup_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "0424ba6eb6ef76217410a0d8378302b466fe5b8c37be6d9081fa6a60dca57919", + "chksum_sha256": "3e049bd091a4b88b2d68b6462d3cc15d740fcc65f5d3e310496513be40a83661", "format": 1 }, { - "name": "plugins/modules/azure_rm_aks.py", + "name": "plugins/modules/azure_rm_virtualmachinesize_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ea35fb2d395c703446cfe8386af7cdd580126028f89ee7d1900c6e97b3f90f3a", + "chksum_sha256": "24e4730a6256f17cd27877328ed90580bcd2ac93c1b3718b70e18d8c574769a5", "format": 1 }, { - "name": "plugins/modules/azure_rm_mariadbfirewallrule.py", + "name": "plugins/modules/azure_rm_vpnsite_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "002b28f29a420fc52cfa882aaf00aada340c67bca5951f33702899dfaba2bbb6", + "chksum_sha256": "63c87ba7508bb5c7e2f4968c4975b8e85e27260474dcb6f7d558295f9c56a946", "format": 1 }, { - "name": "plugins/modules/azure_rm_lock_info.py", + "name": "plugins/modules/azure_rm_keyvault_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "a21e077cc5c7a85b46359b6bd6a27f6ca81bc3f2b5c632559369c1ab784d998a", + "chksum_sha256": "42dc1992f6870d92fb0c00e196491d148037561a16f1a3980da71a450d8d1150", "format": 1 }, { - "name": "plugins/modules/azure_rm_dnsrecordset_info.py", + "name": "plugins/modules/azure_rm_virtualwan_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ce13d83217e276a01bc5763cdfbd131090b35c64607738dc052b7ef9d25a3068", + "chksum_sha256": "3e7d2fdf7181de1499b68196f176080a9563767764ee9bb27bf3e3411cb87a75", "format": 1 }, { - "name": "plugins/modules/azure_rm_mysqlfirewallrule.py", + "name": "plugins/modules/azure_rm_registrationassignment_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "0dfc21fcc71ef8a64894af0c62a50dcb6deb17582a7f35bddc79dde51fc8576f", + "chksum_sha256": "ebee000acc1f85898adb717c015209d78a231d7a4130d20293c103c1e01dc57f", "format": 1 }, { - "name": "plugins/modules/azure_rm_webapp.py", + "name": "plugins/modules/azure_rm_sqlelasticpool.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "cee92a7e39dcb163bec1db9966454602f7bbc0f1ea102480949ce7c4fddf2681", + "chksum_sha256": "a127cd3108b9eff43c793296f6239ee10df0810222dae4c44b380e45c01e36eb", "format": 1 }, { - "name": "plugins/modules/azure_rm_autoscale_info.py", + "name": "plugins/modules/azure_rm_routetable_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "3e14312a922f92c6ef0937f020aa7511ff9fd2759567c165796e257e65201b73", + "chksum_sha256": "1e849400c3b71a0bb6652ab1d40e919288b3dccb94314230273850f31259de8b", "format": 1 }, { - "name": "plugins/modules/azure_rm_cosmosdbaccount_info.py", + "name": "plugins/modules/azure_rm_diskencryptionset.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b19072e8ae6d606c0edab3e407d2a405d21ebb8f3d614ef93beee02422037089", + "chksum_sha256": "d4f85b7a7c7da95b7fbd3a084a15af87fd037134c527056a14f48ae1e58b9a9f", "format": 1 }, { - "name": "plugins/modules/azure_rm_devtestlabenvironment.py", + "name": "plugins/modules/azure_rm_storageshare.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "a0fb63c466f07c95c6f05e5ff2d66320e5b37e8f1e3fa316ffe36a8428d9d1f5", + "chksum_sha256": "d70dd044b1bf421773c6438c7c9020906810f7e1e74523e8855133a8fae9360d", "format": 1 }, { - "name": "plugins/modules/azure_rm_sqlelasticpool_info.py", + "name": "plugins/modules/azure_rm_mariadbconfiguration.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b7a80a678294c636c3dd4bc5dbf9b7955a4d1aaaa40757b2a24922072e71543b", + "chksum_sha256": "f54c337f3d115d08dcac88d6e4fe16ef1db3d9dec1833b033928f227d89ea11b", "format": 1 }, { - "name": "plugins/modules/azure_rm_cdnendpoint_info.py", + "name": "plugins/modules/azure_rm_eventhub.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "46e3f5c925eec47e7246827a356caa6c03547e647186bb3b6aeb7b37a5099ceb", + "chksum_sha256": "aeadcc0ec44f966ae318556be223ecbbe4198c412c9d34d1360d724aa919ce0e", "format": 1 }, { - "name": "plugins/modules/azure_rm_vmbackuppolicy.py", + "name": "plugins/modules/azure_rm_mariadbconfiguration_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "44f49f470f1364e294d105ada7d43fd907e0988415a42bc6fc778617ba752b5c", + "chksum_sha256": "783f344263d15fef8444cab2f98286515b584c64945f759d1c45ab3363ae1304", "format": 1 }, { - "name": "plugins/modules/azure_rm_devtestlabpolicy_info.py", + "name": "plugins/modules/azure_rm_subnet_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "42a4c839bc9edacc106ea98025e391bfb2be640ff453a23fa915bf5483c8ac1e", + "chksum_sha256": "781c564f40087d071942dab53c627fed093764c5a244744874e2226ec174bee8", "format": 1 }, { - "name": "plugins/modules/azure_rm_storageshare_info.py", + "name": "plugins/modules/azure_rm_functionapp_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "c30615415440ade0b39196ccd619a923cfce2162548c18c7edaec635f46e84e3", + "chksum_sha256": "1e0f3de0ed340f2e1a5cb2b5b4cb8b7cc9c6c8eafe4483cdb38b58878482b589", "format": 1 }, { - "name": "plugins/modules/azure_rm_hdinsightcluster.py", + "name": "plugins/modules/azure_rm_iothub_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "1f9b621f938b0570eb3e9515725997808d6f2309ade3bd61aec462f27d0b31de", + "chksum_sha256": "5ceef9d30aeb4826188b1c96a6d955955e99ae90a1e8b9ff437859f82a3cdd5a", "format": 1 }, { - "name": "plugins/modules/azure_rm_openshiftmanagedcluster_info.py", + "name": "plugins/modules/azure_rm_batchaccount_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "6ff2314a47bf072921a74773ad167ef9061dc5ad8ad29c54583f6e629ac285da", + "chksum_sha256": "b823cdf2a1c2c41c40d0db12e5bd637598f388db9beb0eb2e79e1c940aed39d6", "format": 1 }, { - "name": "plugins/modules/azure_rm_subnet_info.py", + "name": "plugins/modules/azure_rm_aks.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "696339e48df4d1c0f6ea50fb2036f43dba92ad6097e102889d85c0ad9b764652", + "chksum_sha256": "3da4a613aad9785a4d3b764ef386699d796167b12c9291019fb17a204fbd9db5", "format": 1 }, { - "name": "plugins/modules/azure_rm_iothub_info.py", + "name": "plugins/modules/azure_rm_networkinterface.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "cf4cfbd73db4d003a322d06112a652991e56643689faf5c4ceb3c621a41e4d96", + "chksum_sha256": "7216e23eac5fe34435ac3f8cb111b6c68cab283ec4dba61a4c9efc805221e8df", "format": 1 }, { - "name": "plugins/modules/azure_rm_resourcegroup_info.py", + "name": "plugins/modules/azure_rm_subnet.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "de3d87159dc3b1dfc118bddad95a4666bbb767b13ebd793b6dfce8016b19348b", + "chksum_sha256": "0b0cf9127582749f7d680b30cf94545c7ccf6b2a1d28903387ea3bae45e14ef7", "format": 1 }, { - "name": "plugins/modules/azure_rm_resource.py", + "name": "plugins/modules/azure_rm_cdnprofile.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "5e6a719d9c2c10e6b8099968b9cee9dc4a33d70610e7166fbe7d9b2900cc63bf", + "chksum_sha256": "8051fcf46e6ef1061831461ded14aa4fad1a59c7a5dfdfd3d90d6816db8df475", "format": 1 }, { - "name": "plugins/modules/azure_rm_mariadbconfiguration.py", + "name": "plugins/modules/azure_rm_azurefirewall_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "6d8d79de6e81076cad897a9b1b12a52462d4bf15505616fdf3d170c21dc2ab42", + "chksum_sha256": "6d62301f903c8d8e1075bb7d29412f91b65136344d0fb915eb5017f8936142d9", "format": 1 }, { - "name": "plugins/modules/azure_rm_vpnsite_info.py", + "name": "plugins/modules/azure_rm_roleassignment_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "78e052905dc10bcdba43971fba9600830c127b9255bd59c17d8b948e07385adc", + "chksum_sha256": "3287b7ad7063115ef66dc443b05f4ceb6bd22d46cd8fcec1350c6e9e64289b3f", "format": 1 }, { - "name": "plugins/modules/azure_rm_notificationhub.py", + "name": "plugins/modules/azure_rm_adserviceprincipal_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "542b060b5a8b5a434eb16d3258a235f58c1af7480557ef0269e98f5008d5d5ba", + "chksum_sha256": "6ec6a6ab5cd644af2cc67b32e41258e058a5e7cad8b9d45a25eb7865edceda0e", "format": 1 }, { - "name": "plugins/modules/azure_rm_apimanagementservice_info.py", + "name": "plugins/modules/azure_rm_webappvnetconnection.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "c77402fee55cfb0fe5e7b24475dbb16dd8933bbf98a9787077d166883bd6006d", + "chksum_sha256": "5f823a8fd9802af336c53b103f05d687a20989e92334d7bc122f7ccb62a6a410", "format": 1 }, { - "name": "plugins/modules/azure_rm_roledefinition_info.py", + "name": "plugins/modules/azure_rm_hdinsightcluster_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "40f784387f3973478e4eca1c3dc95d03b607684eec3a503d9539ff912bdb065a", + "chksum_sha256": "9531f6f0a60132fb1ab9b2e49ab271ba1a630f75682b44197f61632daacb1a0b", "format": 1 }, { - "name": "plugins/modules/azure_rm_mysqldatabase_info.py", + "name": "plugins/modules/azure_rm_securitygroup_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "f61d5d8e5ab4fe38d062a4be11e6da2e7ba8f9570cbd57da31f9b5d4f7c20035", + "chksum_sha256": "961d9d5ad4d46ff1acf101c19ebd88813d5251f89ec7e1f4ea809827cc3b5392", "format": 1 }, { - "name": "plugins/modules/azure_rm_route_info.py", + "name": "plugins/modules/azure_rm_servicebus_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "38e2e790759c8cd148397c1562b5c2d11d77e602c976706ca6ec47ad5ac82e7b", + "chksum_sha256": "56677b7274f63fe629975901c0c3f2239a58b3b44d6f42d5e8327e283c49cf22", "format": 1 }, { - "name": "plugins/modules/azure_rm_mariadbdatabase_info.py", + "name": "plugins/modules/azure_rm_natgateway_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e2beced9a1e5e206b51add106ec935f93d11a382fc1cfb02cde4653c8c0e8e28", + "chksum_sha256": "05d862d157fc493cab345fea70f17c3913624364407562a9a2d884377f69f586", "format": 1 }, { - "name": "plugins/modules/azure_rm_mysqlserver_info.py", + "name": "plugins/modules/azure_rm_deployment.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "9430b33e1b8689c451779a9e510c97f48e65a13e85d252b123a0fa367d2bf68c", + "chksum_sha256": "a51562a752c8d9f77ea8afa4ab966ece92c6d868f7eb939a9adcc28c800fbc2f", "format": 1 }, { - "name": "plugins/modules/azure_rm_resource_info.py", + "name": "plugins/modules/azure_rm_adgroup_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b95ecf5c88da9be4bb9b5de2a69a5c9e012e5fd7e78a8b7ed4683c098386fe94", + "chksum_sha256": "8e06b65183c867879b4f34b3b65c24e1d77d6fa1007b90c7f433e658b418d9cf", "format": 1 }, { - "name": "plugins/modules/azure_rm_sqlfirewallrule.py", + "name": "plugins/modules/azure_rm_virtualmachine_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "df437f8d158a6439ca3ce9f0bf9521abf56deda973797bc43519756d135854c5", + "chksum_sha256": "371f0c2e8c15271dcede607bb8cfc52469b506a12b2e3f74adcb7d8beabff4b9", "format": 1 }, { - "name": "plugins/modules/azure_rm_devtestlabartifactsource_info.py", + "name": "plugins/modules/azure_rm_privateendpointdnszonegroup.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "bb0421601c84d90ecc996ead0d3545e82167ea8f836abc75e2c2724763e64c08", + "chksum_sha256": "d516440379341b68c65581c8d9da78f6a204845502e408c48875851c58229241", "format": 1 }, { - "name": "plugins/modules/azure_rm_gallery_info.py", + "name": "plugins/modules/azure_rm_virtualmachineextension.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e358d5d80aba5329f4029f1e4fe71ac7265c6af33b18b5e3cc7f43acfda35f93", + "chksum_sha256": "09bd02e50c12aa9e602e8ac7b4312b2619be27b656114309625c9aa39fbcb97a", "format": 1 }, { - "name": "plugins/modules/azure_rm_virtualwan.py", + "name": "plugins/modules/azure_rm_roledefinition_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "649f6ca93b8c5c39177032a048eb69ea2861811c04b2f88fd26ecd6ff7f9a7f4", + "chksum_sha256": "20f17bd7a42d8ebe0d377d9c81754be478f94591e038c65850658c3be6b88422", "format": 1 }, { - "name": "plugins/modules/azure_rm_devtestlab.py", + "name": "plugins/modules/azure_rm_privatednsrecordset_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "f13d634939a9b6ede4232809a91a686954248c9358bffb9397bb1a46af9790a0", + "chksum_sha256": "ca64fe771c93ee29952634b1acd63d8ae35c0f36b4ef3a33f6ac1ef0994e2e42", "format": 1 }, { - "name": "plugins/modules/azure_rm_image_info.py", + "name": "plugins/modules/azure_rm_roledefinition.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "c6dfd163560a3389f0d12d364e61a5a6e6bb87f50b2fc08965b19285002b600d", + "chksum_sha256": "2916e92b6ed98170b35ff1c4bbd3a970ffa11323b2bbb01e37271110072ed33d", "format": 1 }, { - "name": "plugins/modules/azure_rm_automationaccount_info.py", + "name": "plugins/modules/azure_rm_proximityplacementgroup.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d58220fca342e7d1bc2facc36fe1350609a1bf36f53f0a517a6057909e18355e", + "chksum_sha256": "c39137e4926c1749a04adc516a027a08e7cf2ebe2b21e7a95675fd0a546777b9", "format": 1 }, { - "name": "plugins/modules/azure_rm_aksagentpoolversion_info.py", + "name": "plugins/modules/azure_rm_virtualhubconnection.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ea88bd02b62e542b456b46676784f196500e628d747102b3fe4738b2b972d992", + "chksum_sha256": "2b3ba5bbf31b9e64c4e0978fa92768ce9115fe39450f5dd8085c775fe4ed2716", "format": 1 }, { - "name": "plugins/modules/azure_rm_networkinterface_info.py", + "name": "plugins/modules/azure_rm_eventhub_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "3304875d8899cb9e33425372bf19d0e880979a4c703b4a8d1ca688896084d64d", + "chksum_sha256": "840c5f5441849b9ae7c489f04bb2fd065cc4192ca4a8143c1fc052c2845e002f", "format": 1 }, { - "name": "plugins/modules/azure_rm_virtualmachineextension_info.py", + "name": "plugins/modules/azure_rm_sqldatabase.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "4462ee68f8753800127b29f8cb26e4542425a39c5d9a4eeff9ca34c98a01d52b", + "chksum_sha256": "4ad23bc0505f7a62a03434a0c94c2eaf90ed06c4d5e4ccbf05f169de465fd693", "format": 1 }, { - "name": "plugins/modules/azure_rm_loganalyticsworkspace.py", + "name": "plugins/modules/azure_rm_webappvnetconnection_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "c3eaaf717a8dcfef31dafccea334e863980d7f5225f83a7f65499998c2aa7eef", + "chksum_sha256": "cbb81f50bdad8e9d738f6a8ff9566898df41fec03e92e3b03383228de5607fff", "format": 1 }, { - "name": "plugins/modules/azure_rm_privatednszonelink.py", + "name": "plugins/modules/azure_rm_servicebustopic.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "a206192aa45d1f30ad91a779cb0934c49fc0c01f7da18a07aebdecd0b4333949", + "chksum_sha256": "3061e6f04b67b71c3c7d09566a35916f130745ffc7dd1b472385d78587140da3", "format": 1 }, { - "name": "plugins/modules/azure_rm_ipgroup.py", + "name": "plugins/modules/azure_rm_resource.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "f2bf42d8b4c828a40e8ed0aacd42d2bce3a128e71d1d0a537081e204d761a8d0", + "chksum_sha256": "546c902f77832ea142cffe5b07b7babab61081094e713733857f4efaaf71aa63", "format": 1 }, { - "name": "plugins/modules/azure_rm_devtestlabvirtualnetwork_info.py", + "name": "plugins/modules/azure_rm_firewallpolicy_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "c5d5b78feb99ae118bef399a1f39c9689c293d1b9ef5a120c0f7d29bdad9c871", + "chksum_sha256": "1e1cebf4f29a286751549a9a5ccf06451bfb9648151d54ca813646f1289dc8b9", "format": 1 }, { - "name": "plugins/modules/azure_rm_apimanagement_info.py", + "name": "plugins/modules/azure_rm_containerinstance.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "92edd852dad3cdba63ed9ce78fb0891f509dccb1e1e21acd73547e681962f6e8", + "chksum_sha256": "b3c13189f840de2aa3047eeb145d3f1680c40a999a45b92325f70a92ff950296", "format": 1 }, { - "name": "plugins/modules/azure_rm_vpnsitelink_info.py", + "name": "plugins/modules/azure_rm_adpassword_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "c2fa6b67b6163684b312a9af9cfe1d92364ec7f2c3b240e249d54df344a08754", + "chksum_sha256": "6cc6cf20421203712d3890dbe04dcf4c96d7ba99f3eff6d700d03addabeb93fa", "format": 1 }, { - "name": "plugins/modules/azure_rm_adpassword_info.py", + "name": "plugins/modules/azure_rm_postgresqlconfiguration.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "cf9a32a1b8674d0bce0b22c0a3ca953195ac6b83bd6e6ae6096d83dbeea19f39", + "chksum_sha256": "c5a5c9f631bc9ef1eb1d64acd039457dc38a52c84e5246589b9f42df904aa37a", "format": 1 }, { - "name": "plugins/modules/azure_rm_diskencryptionset.py", + "name": "plugins/modules/azure_rm_mariadbdatabase_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ad75019b7e2c48efb740547e6b8664dc76dbc7f46b5ae4f1307dc4a1a633a87b", + "chksum_sha256": "abe1fd7778f01c877a7c8d74170c74a26e39de0d5295b3e856adcc39fc7367e8", "format": 1 }, { - "name": "plugins/modules/azure_rm_functionapp.py", + "name": "plugins/modules/azure_rm_backupazurevm_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "59b5ae364fd065ec8a59fd413934c477d21565748f11e588bc3ffb94431d6333", + "chksum_sha256": "4e25e335897973b2afb89187cbd96429e89fe688347be78a73dc4049c3dc3986", "format": 1 }, { - "name": "plugins/modules/azure_rm_storageblob.py", + "name": "plugins/modules/azure_rm_cdnprofile_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ade223098ab192a1b165695596036b1f9f0b3871845b99f77e2093eca24a76c9", + "chksum_sha256": "11acb43afaee020e3b3c252d5c1d3e9669ddcef8f3941635b1bce4d411b9c12e", "format": 1 }, { - "name": "plugins/modules/azure_rm_monitordiagnosticsetting_info.py", + "name": "plugins/modules/azure_rm_backupazurevm.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "7b04ea29c1795db69f2e12e716e8e09d8ff83fc05bf93a010926ef044cced8a9", + "chksum_sha256": "b1d8a252ccfac8973cf591771b6d7149c2bbf4f788366e1dc2b16fef8d52cc61", "format": 1 }, { - "name": "plugins/modules/azure_rm_servicebus_info.py", + "name": "plugins/modules/azure_rm_resourcegroup.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "2ddc707b76677db9631536f8d7e796e65cbc03347fb9b2206fffdf01733729fb", + "chksum_sha256": "20900d4b10ee5f7032fc409be2eaafc00521f8799c56559d8ac88fce00e4b2eb", "format": 1 }, { - "name": "plugins/modules/azure_rm_devtestlabvirtualmachine_info.py", + "name": "plugins/modules/azure_rm_datafactory_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "4746334e6c0767e153ded7c89b67fa2ad6b341d16d600b8451cdc0ec23ab3b47", + "chksum_sha256": "97332f814785d6c0aad03a37f0126454115c0f219379529fefa421bf9ea20b53", "format": 1 }, { - "name": "plugins/modules/azure_rm_azurefirewall.py", + "name": "plugins/modules/azure_rm_virtualmachine.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b237d06a26a381ece50abb9a390525e2ac8d41216e47db64c6515f2a7cf2191f", + "chksum_sha256": "a71e48a19a1f43d47a46951e936b6cf187ea87170d247326449f9a6fbdd1bc79", "format": 1 }, { - "name": "plugins/modules/azure_rm_virtualnetwork.py", + "name": "plugins/modules/azure_rm_gallery.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "154db13a7f90bcb954624802c8999a0f2b636c79b185656470fe441e3d050d74", + "chksum_sha256": "d75d837aeb5b9292babe25fd49f7b24e516c4ae3ac3707afeab09bf801cdc711", "format": 1 }, { - "name": "plugins/modules/azure_rm_managementgroup.py", + "name": "plugins/modules/azure_rm_devtestlabenvironment_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "9ac0238eb048983f35dea0b775c89623556249eedae511a6d4583c9d09c6ebf3", + "chksum_sha256": "a33bd3a6e60f1153b611e1f45fc4c99b01b9ff2342e92171e823bd8016b2be0c", "format": 1 }, { - "name": "plugins/modules/azure_rm_privatednsrecordset.py", + "name": "plugins/modules/azure_rm_devtestlabvirtualnetwork.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "c7e50777a183ab50fdeb35947617727032f293979436bc36c611f4138d576173", + "chksum_sha256": "4c52da65b8749ffc924d5206dc8a4f29406dd208cefd20ca78cd5f30c9184e77", "format": 1 }, { - "name": "plugins/modules/azure_rm_webappaccessrestriction.py", + "name": "plugins/modules/azure_rm_containerinstance_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "bdb472e0f09598e62af2730b39bd2684d141d38ae41837f132c27e8a39d626ae", + "chksum_sha256": "ab1aa37508addc2bf616e2c13664f2a1e5e0235af91db2bb84542449d01fc67b", "format": 1 }, { - "name": "plugins/modules/azure_rm_virtualmachinescalesetextension.py", + "name": "plugins/modules/azure_rm_cosmosdbaccount.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "68f54cfbc3dee06ba295677701af2e25a718fc258ae6d832c77de8ede0f6086f", + "chksum_sha256": "d6c644934b50c99c8839405f78cae5aea90c0f6b2a9ae4f74a9f761467ea7cd1", "format": 1 }, { - "name": "plugins/modules/azure_rm_devtestlabvirtualnetwork.py", + "name": "plugins/modules/azure_rm_mariadbfirewallrule_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "6fa7a70d833ea55daa428b6881a741c0deed4a0b82ae167a5d6802199f0eace6", + "chksum_sha256": "7a2b125c6e0ed19d1fe70703e24ed9e4257713c492e927785fe35cdf789afcc2", "format": 1 }, { - "name": "plugins/modules/azure_rm_sqlserver.py", + "name": "plugins/modules/azure_rm_devtestlabartifactsource.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "4121ca062182f651d89c0729f34a4724a39520549c32f63231c74ec7b66a4962", + "chksum_sha256": "1b3f24465ae9f40d6adc4e61d6e1f34d78345b5ee88c5c5958ed401b3146b79d", "format": 1 }, { - "name": "plugins/modules/azure_rm_virtualmachine_info.py", + "name": "plugins/modules/azure_rm_keyvaultkey_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "89ab6732833bf9bbbc639542612449946bd59db1385a79e368de8e47aa9371f0", + "chksum_sha256": "23eaf4510c03b121fc24ba8a116b26e35563af5ee9875d7210557caf2e6ce9b2", "format": 1 }, { - "name": "plugins/modules/azure_rm_proximityplacementgroup.py", + "name": "plugins/modules/azure_rm_trafficmanagerendpoint.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b509d24b53d7895f676c980e139dd5e463bcb43cb2f803b9c4259b397e6887a7", + "chksum_sha256": "48772694d9d17d8d0f6b0e6d44c4359dbb35861116c38fa933b0db93981f7a76", "format": 1 }, { - "name": "plugins/modules/azure_rm_galleryimage.py", + "name": "plugins/modules/azure_rm_mysqlserver.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "eb81199490da37abf78eaafb86dab3847c06d3cf636ec92264461ca6d36ec43f", + "chksum_sha256": "7f7cb3ce5875e72550cd314cc3df490cbbce0292265c927038897d026b573514", "format": 1 }, { - "name": "plugins/modules/azure_rm_apimanagement.py", + "name": "plugins/modules/azure_rm_mysqlserver_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "15b454fcf0d36fa5e33dd0c364288a8d4b775e0d033eb29c73c980c811cfe86b", + "chksum_sha256": "595b1221845b1ff1d61c133eabb34930f9e9d0b59cd2ee853cddc487b182c57b", "format": 1 }, { - "name": "plugins/modules/azure_rm_privateendpointdnszonegroup.py", + "name": "plugins/modules/azure_rm_cdnendpoint.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "5bce497ed8f0fe499466bbd20c1acc772dcd458828cca8fba6efda9db9ff8fcd", + "chksum_sha256": "7e105391561b1552efc4ea6e587d5a9dc60c61c6e7847ea036481b5923a10f26", "format": 1 }, { - "name": "plugins/modules/azure_rm_bastionhost_info.py", + "name": "plugins/modules/azure_rm_vpnsitelink_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "dcdf18934767abd5f6912ce0bb9cbbff6954c79fab3998fdf9ea3c75f5f9d604", + "chksum_sha256": "c12058e056680201ef2358025ed148b9338a50eebace5b8784cc9acdc525093f", "format": 1 }, { - "name": "plugins/modules/azure_rm_storageshare.py", + "name": "plugins/modules/azure_rm_multiplemanageddisks.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "82210aa73136b890cdd41a098e28368d64b17744e33d8220c3b240645ceeb461", + "chksum_sha256": "95a1386da7e22dc74338466668e3542f37584f4272481fc56b298ee95053d23e", "format": 1 }, { - "name": "plugins/modules/azure_rm_postgresqldatabase_info.py", + "name": "plugins/modules/azure_rm_iotdevicemodule.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "5f14bd4d988a83adb45c7efd192d78ace3049f8a114fb13887e04bd5d2810993", + "chksum_sha256": "b8bc59ae66ec54ff0773dfe858b91a946df973f93e06c12b571b20d16a2142e6", "format": 1 }, { - "name": "plugins/modules/azure_rm_virtualmachinescaleset.py", + "name": "plugins/modules/azure_rm_azurefirewall.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "317ae1eb91fb3d44053c307a8c48dee56f20f254801f496fe0e994a40dd5e9a4", + "chksum_sha256": "da90ad6d785772e86a709e378eca2143faf638bfe60f3d362d578ec54302a0ac", "format": 1 }, { - "name": "plugins/modules/azure_rm_publicipaddress.py", + "name": "plugins/modules/azure_rm_loadbalancer.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "a74b3d36674d81e191c97c89b7a62af410e11bffa6584324f5fcd09af93eff63", + "chksum_sha256": "40bcb2a088750276d350e5170a7993a5e92117948835d6bd30dcf5989db2cf11", "format": 1 }, { - "name": "plugins/modules/azure_rm_containerregistrywebhook.py", + "name": "plugins/modules/azure_rm_trafficmanager.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "2a51de04003a696a7787d1d50feab809d4dcaea7d949410fd7a714fc19323ebd", + "chksum_sha256": "9aba8d8ba13076c53f797b5c999af3dbc951849450ca138ce6572804eed67a22", "format": 1 }, { - "name": "plugins/modules/azure_rm_servicebustopic.py", + "name": "plugins/modules/azure_rm_registrationassignment.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "7384a10983b632462a263c9a1955a37a241df62d6ff99f5673ddf81bb4d597e8", + "chksum_sha256": "075669114ff7606dbf4aa144d0e7fc51441b7ec8230c36f2951884d40ea502b7", "format": 1 }, { - "name": "plugins/modules/azure_rm_networkinterface.py", + "name": "plugins/modules/azure_rm_galleryimageversion.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "f35a9acfd351c7634c475d7de186ad6347f1daa3e412937554ba1a21d5f5a395", + "chksum_sha256": "dfdc102dca75eaba97460f3f9a47a0ae0eb375714b030959a3781c9e12d675e2", "format": 1 }, { - "name": "plugins/modules/azure_rm_natgateway.py", + "name": "plugins/modules/azure_rm_devtestlab.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "4bf1206a802dca51ce3aebd308aa2d1be7d5c92ab7cc9c1627f24e7129c9a43a", + "chksum_sha256": "e45418f49d7b45ab7a6c29f17bc6f12cc0607a21179fce4a4f428d1419b1abc1", "format": 1 }, { - "name": "plugins/modules/azure_rm_backuppolicy.py", + "name": "plugins/modules/azure_rm_devtestlabcustomimage.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "450276cb63df1322157d6f7598a4008100b39db42e46284fec965ae6d889e5c0", + "chksum_sha256": "4398962a6b78efc7b3faabd07af0cf4c31eafe25ec2fc23430a7385fd3c2050a", "format": 1 }, { - "name": "plugins/modules/azure_rm_securitygroup_info.py", + "name": "plugins/modules/azure_rm_virtualnetworkpeering_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e86da6e0083e46c3ce35b5ad9cce5be81e674f58adb88ad34e25fc450ae5f0e6", + "chksum_sha256": "70b548cc3d9362d2c6a3c0ddedbded5ec61be98334bb43d0c59cad8a95065898", "format": 1 }, { - "name": "plugins/modules/azure_rm_postgresqlfirewallrule_info.py", + "name": "plugins/modules/azure_rm_hostgroup_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e65ac200019da53ae0420ca181f815b1bc4164382312907a8f3738b57e1113c8", + "chksum_sha256": "05d3069e290c810fe454923e22f4aae4932aa8924b12d872039904d87b779a07", "format": 1 }, { - "name": "plugins/modules/azure_rm_virtualmachinescalesetextension_info.py", + "name": "plugins/modules/azure_rm_openshiftmanagedcluster_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "2a3d909b1b73e9779524abaea50c0b7c0585e51449eb419e2b2655061d1d5e01", + "chksum_sha256": "061e20df32528b861d5ccdabd7b7e8bd5abdcf0ea2c3c973f561e656223ce0b4", "format": 1 }, { - "name": "plugins/modules/azure_rm_galleryimageversion_info.py", + "name": "plugins/modules/azure_rm_appgateway.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "a516518ebf35ff2ca1033e9b2e5ceb2b2280841a163a1f6914ab9bfe32238e15", + "chksum_sha256": "04b1dd5413cdc81f642e470db6cdd1ae1ffa77d2b9b42e845b4bbf111235b650", "format": 1 }, { - "name": "plugins/modules/azure_rm_postgresqlconfiguration.py", + "name": "plugins/modules/azure_rm_virtualmachinescaleset_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "88f2607f46f15e8da9955e0c887ac6d238dd1970f7e99ad48ff82679add2717a", + "chksum_sha256": "5925fb4d64f27c1460dc96e40aaa1eabda5612174aa598a717856b2861540662", "format": 1 }, { - "name": "plugins/modules/azure_rm_appgateway.py", + "name": "plugins/modules/azure_rm_galleryimage_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "81616d62785ad1b0c868a6cb8fc6135388e188b8032d9370cfae013f9d0245b5", + "chksum_sha256": "89a14ee3f36038d0da78d7f7b586361e5acab82f1cd66c1c8278d840e12e2023", "format": 1 }, { - "name": "plugins/modules/azure_rm_registrationassignment_info.py", + "name": "plugins/modules/azure_rm_cdnendpoint_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "7d9177184a680209b8e56af0dac845509316784cda76b7825c8a8f80c9e5556d", + "chksum_sha256": "6d355f726042e8bb6f9729fbfe486980b2a88813cff5a9f92017a0df75ab2f48", "format": 1 }, { - "name": "plugins/modules/azure_rm_virtualnetwork_info.py", + "name": "plugins/modules/azure_rm_route_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "487edc7987098e0c1f5d053a71f9ce405f5fb48721e39eca4c3078e948a8fcc5", + "chksum_sha256": "ec951f25bdc8b4944f43e054e44fc1887fbdb8cfaf892f5ce57174cf251b442e", "format": 1 }, { @@ -946,1249 +932,1221 @@ "format": 1 }, { - "name": "plugins/modules/azure_rm_loadbalancer_info.py", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "c3695020309683c704c9372d512e39f2bf9f831d31f4ca6ba49a8acc65037526", - "format": 1 - }, - { - "name": "plugins/modules/azure_rm_virtualmachinesize_info.py", + "name": "plugins/modules/azure_rm_keyvaultkey.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "58a1ba100e397ef2512a9de6cbcac15175fe5f5beba9a6a785e3f4485583bf18", + "chksum_sha256": "d9e0b37c1eb77dc2d8efe7a97a0715f2d381a59937cc6ff5ed8a7ce769ab558b", "format": 1 }, { - "name": "plugins/modules/azure_rm_webappaccessrestriction_info.py", + "name": "plugins/modules/azure_rm_virtualmachinescalesetextension.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "35ba519123a781331e81e7d80a138c74b2a201f1a8834cb0c02720eec69e5869", + "chksum_sha256": "a8ef46432cfcc51726f0e9d1ce8003a5e9820432a253d897b420c8423c178f74", "format": 1 }, { - "name": "plugins/modules/azure_rm_webappvnetconnection.py", + "name": "plugins/modules/azure_rm_mariadbserver.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "80a7052dc658e5ce741d56bc35239816efca9288d3d7a05ab432153cec23fe04", + "chksum_sha256": "6c671f81b7aff21b252b4844b16135a8fef889b340f66337e394d87e249e4a28", "format": 1 }, { - "name": "plugins/modules/azure_rm_recoveryservicesvault.py", + "name": "plugins/modules/azure_rm_firewallpolicy.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "0418507db2bfd0fdcf67872ee7dce7a760b512aaaacaec837db424f77fbc8d42", + "chksum_sha256": "58980ae98ef0f3eb07237bd685eaf312369a68a484aaebef40037697d83cdec1", "format": 1 }, { - "name": "plugins/modules/azure_rm_containerregistry.py", + "name": "plugins/modules/azure_rm_deployment_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "8cc2c27f4472a39809871236626b260bd63d83f25ad2252d6cdfcf198568cd59", + "chksum_sha256": "2b2f239c18ae7533a69c8a3e380840171bedc20dc4330ffb0b0f14c9cc5bda25", "format": 1 }, { - "name": "plugins/modules/azure_rm_adapplication_info.py", + "name": "plugins/modules/azure_rm_publicipaddress_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "2290d31890d77182a5299231bea9ea69420c330cd020361041ffb4b7825c9dbb", + "chksum_sha256": "7c60893a6d181b60254e2b8e2dca0aae0c83c1f98bf2e1a6f2ab6206a222112f", "format": 1 }, { - "name": "plugins/modules/azure_rm_adpassword.py", + "name": "plugins/modules/azure_rm_keyvault.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ae544ae7af099828e9a7b584903a61b10e4fe50c7222573db643f10c755e455d", + "chksum_sha256": "4689bcd312be6a35cf796ddbb8a5594232054f9a27c638b6e843c2adaa6b55ee", "format": 1 }, { - "name": "plugins/modules/azure_rm_autoscale.py", + "name": "plugins/modules/azure_rm_postgresqlserver_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "c8ebe2e04d994d192a13e01b6ca30ab1bd8f2fd071ff441290e5bc113aa86b96", + "chksum_sha256": "41eccd6933ff71ce9f0bbfe939057aeea30beaf4c6e475887a7bf21df6a48f67", "format": 1 }, { - "name": "plugins/modules/azure_rm_privateendpointdnszonegroup_info.py", + "name": "plugins/modules/azure_rm_devtestlabvirtualnetwork_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "70582f1fa2c40f77e166f00242bd6bff2e7c018368beaa2ac960328c341faa77", + "chksum_sha256": "2e8336f66de22809f5693b7c84af84f768d51992685a1daa3ef42f1416eff4ce", "format": 1 }, { - "name": "plugins/modules/azure_rm_aduser_info.py", + "name": "plugins/modules/azure_rm_manageddisk.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "38b7483a49e73fde79815078b47f00b7fc062eb5e91c660715141800aacbc227", + "chksum_sha256": "7fae72b490febd8d03292056a034e797aa68fb3fd52d9a849bebf3ac7b67d6d2", "format": 1 }, { - "name": "plugins/modules/azure_rm_vmbackuppolicy_info.py", + "name": "plugins/modules/azure_rm_trafficmanagerendpoint_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "2cf17b31cc74838e9ca66d203999d3254cfaf6c602dab7c22101952e15cede3f", + "chksum_sha256": "19fa3f18fc08a32e65b2dfb6c0b74a7a4827a2afcb36409214de9887899e754e", "format": 1 }, { - "name": "plugins/modules/azure_rm_adserviceprincipal_info.py", + "name": "plugins/modules/azure_rm_keyvaultsecret_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "60c7a8360cef3b04f1637660dbd49d92384896e8b8388d6e51e1b2cb9323f1f7", + "chksum_sha256": "82a8e53b9e615d6d82467cb28b4572b1dfcb128f9a4b19ccd98c613465504c48", "format": 1 }, { - "name": "plugins/modules/azure_rm_ddosprotectionplan_info.py", + "name": "plugins/modules/azure_rm_adapplication.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "8bf47ad3f075bd81eafd9a3b7f2a18e71c267d0dd34e971f64a38c3afc572cf5", + "chksum_sha256": "1169c9823bdf7024c552003dfbbdf1067eac2186883bf5cd7904be5d49b99352", "format": 1 }, { - "name": "plugins/modules/azure_rm_hostgroup_info.py", + "name": "plugins/modules/azure_rm_devtestlabschedule_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "05d3069e290c810fe454923e22f4aae4932aa8924b12d872039904d87b779a07", + "chksum_sha256": "775594a1c43e4e67957e6f1ef498b2fc8e04fd2d60d8215d1471084f19f9b0f6", "format": 1 }, { - "name": "plugins/modules/azure_rm_backuppolicy_info.py", + "name": "plugins/modules/azure_rm_applicationsecuritygroup_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "df3f35c4d1d82e9d036782bd83fb11b8f761a706356360a540e44a36b5d1ff5b", + "chksum_sha256": "805be7606a6145a9b4c942f63a9aa46ffc10366b8e3bf2af0c64b8009d0ac9eb", "format": 1 }, { - "name": "plugins/modules/azure_rm_storageaccount.py", + "name": "plugins/modules/azure_rm_webappslot.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "c194d6385c64558c4fc8c0ec572764df5bac7dbe60774a2ef60bd8b9a46063d1", + "chksum_sha256": "d7c28a3338c7a7ecfa0da50def079ab83286aa1750aa52d13944fbac4fbf2399", "format": 1 }, { - "name": "plugins/modules/azure_rm_expressroute_info.py", + "name": "plugins/modules/azure_rm_vmssnetworkinterface_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "3dc3b73518d56b39abe77177143426a27ed1605699ba751395655df469f3cf02", + "chksum_sha256": "968c1e5781fdca422d62eeea87dd9ac45132e5f03c7e3a91ca6b15d0683eb944", "format": 1 }, { - "name": "plugins/modules/azure_rm_virtualhubconnection_info.py", + "name": "plugins/modules/azure_rm_virtualhub.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "c73e7278360297a3f1f3a33404c20b2bc84d264dfe69e78a7dbefb94cb866c52", + "chksum_sha256": "be9396630b6c0d0cc7dae7688cd87421f4770dbba2ed92b2712761ff722ae8a5", "format": 1 }, { - "name": "plugins/modules/azure_rm_containerregistry_info.py", + "name": "plugins/modules/azure_rm_cognitivesearch.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "088eb49fc6d399e81acfd21ef6cedf92455caec49bf3273153ba0b6316da136d", + "chksum_sha256": "8665ce3ff083d18608c7ed9b5fb778d6248e9cfcc096b464535d041457d9af00", "format": 1 }, { - "name": "plugins/modules/azure_rm_monitorlogprofile.py", + "name": "plugins/modules/azure_rm_iotdevice.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "df245b70ab6d3d354e89cdf92d311e7d94f0b28a4bc0a9399712994f31b8ef68", + "chksum_sha256": "6d0f2a6f2f913e9d1f9547a9b601d42f5462c867480915f6ab2cc54674e6f2ec", "format": 1 }, { - "name": "plugins/modules/azure_rm_rediscachefirewallrule.py", + "name": "plugins/modules/azure_rm_virtualwan.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "47fb0d6e84f698478cbd319c6d058f7737b553be61896534818934ca9b3088a6", + "chksum_sha256": "4bf8e8dc2b63ad03eed2d1f50fc68f3026e00528651b132570b009e8d93232a5", "format": 1 }, { - "name": "plugins/modules/azure_rm_trafficmanagerprofile.py", + "name": "plugins/modules/azure_rm_openshiftmanagedcluster.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "65176590401d92a76ec626a551e4c464d09b01299bbd476abdf591424b8a0e68", + "chksum_sha256": "1af54e81954603964c195560b80f5ae452877b564f5a86443f65b3d0f70a9e24", "format": 1 }, { - "name": "plugins/modules/azure_rm_virtualhub.py", + "name": "plugins/modules/azure_rm_aksupgrade_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "7e49a0de4973e1c91d190383b5c37961937eedb22592a11362f699e0b4453151", + "chksum_sha256": "e40923a0ba91ba10ec91ccd2960c60501d5e60c0287ab2578c66d756b865409f", "format": 1 }, { - "name": "plugins/modules/azure_rm_managementgroup_info.py", + "name": "plugins/modules/azure_rm_privatelinkservice_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ba1f6df6a9e04361433214fd6117b34140c394af1e9e7a6888f91f8b762487a7", + "chksum_sha256": "02a72af00f3442e3cb5a19ba01bffc4cb2d47f646abf1a5ae0a125e80a8313ba", "format": 1 }, { - "name": "plugins/modules/azure_rm_galleryimageversion.py", + "name": "plugins/modules/azure_rm_adpassword.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b8e574bcc037636d6ba0f767831c661aeb8185b8bc6967e83f73c1aa3452187a", + "chksum_sha256": "0dca5c21f80f4d60aba58dadbfb2581c5488ce7e1c6a9c2b2bfcc03d33863689", "format": 1 }, { - "name": "plugins/modules/azure_rm_cdnprofile.py", + "name": "plugins/modules/azure_rm_vmbackuppolicy_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "8c49948c21437f22861fc3df155a4f60156800366ce1f5d39c58ba9125e08b68", + "chksum_sha256": "23626d1e4710adefaddcad8cfa9f427ad1e2a9bcaff28b61004dd35b50c72e72", "format": 1 }, { - "name": "plugins/modules/azure_rm_iotdevicemodule.py", + "name": "plugins/modules/azure_rm_natgateway.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "4a15152a01225166acf0aa2cdf8776c151fd3ac7d765da506cdd99bd9dd79d60", + "chksum_sha256": "fe420872335d019070072b7541d79579eba9887f0d80e96d195ed1aaa051aea5", "format": 1 }, { - "name": "plugins/modules/azure_rm_virtualnetworkgateway.py", + "name": "plugins/modules/azure_rm_automationrunbook_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "70fb310b8119486250298eb4b0583bd82dbb5d14a6a6c52208f68057777d93fe", + "chksum_sha256": "bf2d4439d7ef7f6b0f0ec04b345e5919fef980d15b6fb3fda111c2df53c18d16", "format": 1 }, { - "name": "plugins/modules/azure_rm_image.py", + "name": "plugins/modules/azure_rm_devtestlabschedule.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b7438a302d8de7f60006d5d0e79faaf574f630c9eba9f5126d6c9667d3cfa728", + "chksum_sha256": "183397504be9789656fe18261844a247d3ff49eb267693819ce1f265c8d6d6d6", "format": 1 }, { - "name": "plugins/modules/azure_rm_aksagentpool.py", + "name": "plugins/modules/azure_rm_securitygroup.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "46507ba41eea54bc1041cce2026c1c91e74bee0a1c03396be763cae6477983bf", + "chksum_sha256": "85ff31a12227b44cdb6c43ca52addfbfed8eeeb192f7d1747d2e66e828731c0c", "format": 1 }, { - "name": "plugins/modules/azure_rm_loganalyticsworkspace_info.py", + "name": "plugins/modules/azure_rm_devtestlab_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "2ff6f2ee119001765d22ed1f643f9d4a8604b7c746d82904608cd35e256a6fc3", + "chksum_sha256": "84e99ed4f611c9c6d9551c77b83f0d056b68b7eb188b269860eebad6230ff299", "format": 1 }, { - "name": "plugins/modules/azure_rm_privatednsrecordset_info.py", + "name": "plugins/modules/azure_rm_bastionhost.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ca64fe771c93ee29952634b1acd63d8ae35c0f36b4ef3a33f6ac1ef0994e2e42", + "chksum_sha256": "ade78abbea1c467a8bf4787d227a0a96979482b15d05e3dea2ede57f91ff6f7c", "format": 1 }, { - "name": "plugins/modules/azure_rm_datafactory_info.py", + "name": "plugins/modules/azure_rm_registrationdefinition_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "33600c4c03848c4e536ae6066cc029732a563d7810c61eb06366715f728b8140", + "chksum_sha256": "1c6615dbd5f7a904854e0dffad5b8ac364059a4fd93e86529a7257577423aaa6", "format": 1 }, { - "name": "plugins/modules/azure_rm_mariadbdatabase.py", + "name": "plugins/modules/azure_rm_containerregistrytag_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "68b40425e3e53edfd9c674dc3d3ecb6ce9acf6b38fd1ddcfc12f63d3f87e43e1", + "chksum_sha256": "99cde6ea4e4b3f5216131583a7f2ce0dc1777e836d93089733da276895c65b44", "format": 1 }, { - "name": "plugins/modules/azure_rm_loadbalancer.py", + "name": "plugins/modules/azure_rm_sqlelasticpool_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "498c78e74e6493af9b701f69cb56fa94ae3b64eddbbb507ca6e1ace8d6f56fb7", + "chksum_sha256": "05959ef86783c8274fe64c2c1cec19208c37b3d038e6556ffb3a20b51813375c", "format": 1 }, { - "name": "plugins/modules/azure_rm_mariadbserver.py", + "name": "plugins/modules/azure_rm_dnsrecordset_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "2f2f2bd865bfb2131db7541e5a9628d1b54c6e53e96cdbf1618f21697aba8377", + "chksum_sha256": "ce13d83217e276a01bc5763cdfbd131090b35c64607738dc052b7ef9d25a3068", "format": 1 }, { - "name": "plugins/modules/azure_rm_sqlmanagedinstance.py", + "name": "plugins/modules/azure_rm_backuppolicy.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "370f538327f02e8e9fd308de4d4489a883c54d3a8a4806867109fdd8dd9e6c2b", + "chksum_sha256": "37cfea022ca13c6ea40025ae4ec9d00f9e962fba506e1a5708bc00dcfcdc9116", "format": 1 }, { - "name": "plugins/modules/azure_rm_roleassignment.py", + "name": "plugins/modules/azure_rm_webappaccessrestriction_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "f2cecb9f769039249c55fd4f02deda468edc587d0e63d9a9f32f4c1817289416", + "chksum_sha256": "c72ded459dbd8c58642c77aba5cfab56a86782f4e19958ded25f9754a32c1591", "format": 1 }, { - "name": "plugins/modules/azure_rm_apimanagementservice.py", + "name": "plugins/modules/azure_rm_aksversion_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "89c9a6c332a40377c7657bef3e33fb90b87c8d88839fb6e2192cee39e2fb6a83", + "chksum_sha256": "1bba9dd6d78f0d87c751b71c9ff5a29ae856cf4a3326813d8b07d9607e3af2db", "format": 1 }, { - "name": "plugins/modules/azure_rm_virtualwan_info.py", + "name": "plugins/modules/azure_rm_mariadbfirewallrule.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "4542ee838ae409b161fee050aa55a071afa71a294f2c1128b615c5eeb1241941", + "chksum_sha256": "6c028f0fdd933b4a02b6c92f20432fc3617072d8828898f628e02554d25c31e3", "format": 1 }, { - "name": "plugins/modules/azure_rm_mysqlserver.py", + "name": "plugins/modules/azure_rm_roleassignment.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "bd3e6f09aa6ead8a155f1e6630a6bcf53e15c342a21b57803e7f12a15438db22", + "chksum_sha256": "981eea70440c35499110fa7a97cc7259e7cac1ed2f790ffcb1c247a51bfa6fe3", "format": 1 }, { - "name": "plugins/modules/azure_rm_automationrunbook.py", + "name": "plugins/modules/azure_rm_containerregistrywebhook_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e3cb4caef7658d8d7dab697bb4659e96ca52fd32ae8a20588d208d2d06bccccf", + "chksum_sha256": "18b7a6844956e67318fe818bdafd0c94d6631657ec33d529e721e6e21b18ed89", "format": 1 }, { - "name": "plugins/modules/azure_rm_iotdevice.py", + "name": "plugins/modules/azure_rm_adgroup.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "05dcd59d9fd81f9c45b7549b0c4e1c108dad9cf12ccafdb8df322a5f8c4ad716", + "chksum_sha256": "c1117a3b1c468a121dc8a76aea672cb7c839dcb094a2a7fa331f925029699666", "format": 1 }, { - "name": "plugins/modules/azure_rm_devtestlabartifact_info.py", + "name": "plugins/modules/azure_rm_keyvaultsecret.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "7f474b7c34cced12411188bf6b1621376c5ccc4c5b752cff100db6ac5ee1dd20", + "chksum_sha256": "ace3f948b102b233b72d82b67a5b9c74d9cf650b4c04d397e427ddc15f3d45e3", "format": 1 }, { - "name": "plugins/modules/azure_rm_postgresqldatabase.py", + "name": "plugins/modules/azure_rm_loganalyticsworkspace_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "83531748d065461c880b055df18853d233c48197d6e4d3dc0075878fab5f788b", + "chksum_sha256": "b2ea8f5bf029879cd6b7367c7c07d1f638453ff39e0c9f64c04db9afa3a57f8b", "format": 1 }, { - "name": "plugins/modules/azure_rm_firewallpolicy_info.py", + "name": "plugins/modules/azure_rm_mariadbserver_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "7640f87ea3490451f86cd6552187bf7d898ac14dabfd396c9d7a05c7e3927ff5", + "chksum_sha256": "3b836969fea8c255c6aeddca297111eef43141755a9b61677661dd581bb2f1a4", "format": 1 }, { - "name": "plugins/modules/azure_rm_webapp_info.py", + "name": "plugins/modules/azure_rm_sqlmanagedinstance.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "68a7809631f30219be67fb49904890dedf33bbf0abc1c543c0c358cde36e9e6d", + "chksum_sha256": "f022f6e315be9d163c042e9253682d15faea83c067917cba012202532f84f955", "format": 1 }, { - "name": "plugins/modules/azure_rm_webappslot.py", + "name": "plugins/modules/azure_rm_managementgroup.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b3f12d2434943e10d2eb06054014e166e5568d746c169c8fff4486aa043cf9b8", + "chksum_sha256": "d0c2f5410b682701b672207c321041af369dfc116f79b5531c8942f573882eb8", "format": 1 }, { - "name": "plugins/modules/azure_rm_cognitivesearch_info.py", + "name": "plugins/modules/azure_rm_galleryimageversion_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ff6241aced96abf6d228204778b98af2ca39d0d800b078a27d47164084c3c9f6", + "chksum_sha256": "04410811676cb31554c731e12e6803c9e24e238645d16332971573645d01d396", "format": 1 }, { - "name": "plugins/modules/azure_rm_sqldatabase_info.py", + "name": "plugins/modules/azure_rm_privatednszonelink_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "4f6afeeb88694de978ea2ed8b21a25077459c6753b9cbbfcd64a2aaf1ae2fb3a", + "chksum_sha256": "93d488b4238c4631765dff43c9a6978f3bef9d8ff35294dba4f34772a85a4284", "format": 1 }, { - "name": "plugins/modules/azure_rm_galleryimage_info.py", + "name": "plugins/modules/azure_rm_privatednsrecordset.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "de802be0f7bc024b6e899656e36314bab3ff8c45518fe700a9fe28b92e2ca12e", + "chksum_sha256": "2b2eceb8e654a1bc257a065f5ef324c69dd6f5b1e9b0126ffd49afa77ff51367", "format": 1 }, { - "name": "plugins/modules/azure_rm_diskencryptionset_info.py", + "name": "plugins/modules/azure_rm_containerregistryreplication.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "586109c40b10714b5280368db2802fca8d4fc87f797e2b0d5084bb5e7a4df3df", + "chksum_sha256": "94d2e1237ef94377586760a091785272818db4bddc6a54d24badee82d7697437", "format": 1 }, { - "name": "plugins/modules/azure_rm_aksupgrade_info.py", + "name": "plugins/modules/azure_rm_trafficmanagerprofile_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "db9ca4e8e6a327bc77383fef268e81a9d70bdf3b41c4d031bd5bd5bbb9a7d325", + "chksum_sha256": "b99d27f1679a3d1fafdec74448bfdf2977930e8cef05f0b6d720971b4f6b8c8d", "format": 1 }, { - "name": "plugins/modules/azure_rm_sqlserver_info.py", + "name": "plugins/modules/azure_rm_privateendpointconnection_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "297e7c9a749738d8faec1588f18ffe87113b808e50efd5216aa1f338f5360b0c", + "chksum_sha256": "a1c9260c99294e6c9f4579310504bf656d46b2ed16d22188859945cc53563fc0", "format": 1 }, { - "name": "plugins/modules/azure_rm_dnsrecordset.py", + "name": "plugins/modules/azure_rm_postgresqlfirewallrule_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "024875c538f604b6cd017696843d9680d15e9ad2940608542ba4632ed59cacee", + "chksum_sha256": "53187b006213c221bd5391b2b45734080afcd9e63280f4181f6355b5db7258dc", "format": 1 }, { - "name": "plugins/modules/azure_rm_backupazurevm.py", + "name": "plugins/modules/azure_rm_route.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b773c5bd5339e9b95f521bae7cee3eaa929e72b10fa71494bb33dee1f11196e6", + "chksum_sha256": "f290a0e704d3225c8689ac3a7a9523facc263adace73b8193906cb5ee94bffbd", "format": 1 }, { - "name": "plugins/modules/azure_rm_keyvault.py", + "name": "plugins/modules/azure_rm_apimanagement_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "f41b7403d3c04cad0a262ed370792c11ec3a75f155b08d5c357226e4ede0fe6d", + "chksum_sha256": "2c6da107654adcf08a5e6cf5f49473ea21b5dd86db46d4e2ff10868449108a02", "format": 1 }, { - "name": "plugins/modules/azure_rm_privatelinkservice.py", + "name": "plugins/modules/azure_rm_image_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "48c03bb5c957cf1e46d42843c7af662c781be6876007def2dc4cde7709385e89", + "chksum_sha256": "c6dfd163560a3389f0d12d364e61a5a6e6bb87f50b2fc08965b19285002b600d", "format": 1 }, { - "name": "plugins/modules/azure_rm_cosmosdbaccount.py", + "name": "plugins/modules/azure_rm_apimanagementservice.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ada84e6e50a2662bb66c041e69706aceba5bc0f237f308bdbaf4d5d53e6cb0fe", + "chksum_sha256": "ff029a940b4e0f844a8623115c7b6fdcda06b8f9e192e20216f4b42d5093550a", "format": 1 }, { - "name": "plugins/modules/azure_rm_proximityplacementgroup_info.py", + "name": "plugins/modules/azure_rm_ipgroup_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "3e049bd091a4b88b2d68b6462d3cc15d740fcc65f5d3e310496513be40a83661", + "chksum_sha256": "dcb8c2107767aeeae8dad3a39e68b5a1c475d9eb91e0a9c72b3276461fe0f4cd", "format": 1 }, { - "name": "plugins/modules/azure_rm_applicationsecuritygroup.py", + "name": "plugins/modules/azure_rm_servicebus.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b71a4b975ba9c59ecc4cf8199d3008f0bf7c73e27b3a7b6c9a43c59a41d28236", + "chksum_sha256": "f7379123759b383d1c9b39442ddff6beb7910e1bb6c68ba570a8d59eed2c6e95", "format": 1 }, { - "name": "plugins/modules/azure_rm_sqldatabase.py", + "name": "plugins/modules/azure_rm_privatelinkservice.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "86a0055ee5af7615250de7b9215e0e96e1c1f37d3900155f4cbd48b2a540f70a", + "chksum_sha256": "5c56fae085180b9c34424f1cb9fce62adaac67e7107f556702f1a8b9ae00025a", "format": 1 }, { - "name": "plugins/modules/azure_rm_hdinsightcluster_info.py", + "name": "plugins/modules/azure_rm_sqlserver.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "3397f10435940d52ec784f6f4c3b3d379e7eebd91e1179fb8509d73250bf8d0b", + "chksum_sha256": "9b0f2f7674cdb4641de9a2b8b50cb74e91e36ce0a07e0c3a13330592574bee71", "format": 1 }, { - "name": "plugins/modules/azure_rm_servicebussaspolicy.py", + "name": "plugins/modules/azure_rm_devtestlabcustomimage_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "3729f4dba8215497e263dbf466a1c3444469ced9acaeb80fbab328806306036b", + "chksum_sha256": "39b5c1b0361bdbb8e5782066ba0593c4e4fbcdc52243e1b2ac05e6fa8451920a", "format": 1 }, { - "name": "plugins/modules/azure_rm_virtualmachinescaleset_info.py", + "name": "plugins/modules/azure_rm_servicebusqueue.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b8327ec79e23b105eb3bfe8f627e8de5319e3e6641aa538f4eb9518592286b51", + "chksum_sha256": "5ba3c26da0e1437c64c3a7d945886563965b08c9fef67f099e97990ef5f50290", "format": 1 }, { - "name": "plugins/modules/azure_rm_privatednszone_info.py", + "name": "plugins/modules/azure_rm_appserviceplan.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ff7ef289202833ebfbe72ed58a26a8a2673d797bb47fd4c0a816557a7f58b769", + "chksum_sha256": "4230691a8fb4f96611ff509e19f598304daf58104bd7c4e01b0d3e90311a2a93", "format": 1 }, { - "name": "plugins/modules/azure_rm_cognitivesearch.py", + "name": "plugins/modules/azure_rm_privateendpoint_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "a9bd5c1af6a336f864f15757a9d66acbe033f3fbcb8a84e8c10e9b1ecfde60b7", + "chksum_sha256": "b34126d4fac558a5077869099cf1327fbecfeab36e6e34b30c4fe809d59b92de", "format": 1 }, { - "name": "plugins/modules/azure_rm_iothubconsumergroup.py", + "name": "plugins/modules/azure_rm_manageddisk_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "6165d86ce42742d545d0a93a693f476fe4f1354d37ada4626f4bc1f2c2341665", + "chksum_sha256": "3b7b7131b77965c67a34ae4c9ddb9def5c3d30a5a76498c51580486063693f71", "format": 1 }, { - "name": "plugins/modules/azure_rm_backupazurevm_info.py", + "name": "plugins/modules/azure_rm_mysqldatabase_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "1a9c7973369978cf2a1d7ea9f909f3bc24b486134d5efc67db3f3f2b6d258e49", + "chksum_sha256": "dad732afe34bb2972eb39f7fea721d46f644e46383da754563295ebe767e4c43", "format": 1 }, { - "name": "plugins/modules/azure_rm_privateendpoint.py", + "name": "plugins/modules/azure_rm_resource_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "9cf71bc67a11a058b6eac5f7c06c3a003ecce968f6fe09285f43dbd81f91fdf9", + "chksum_sha256": "f893b49f22424b9a2d18d9e27cf088eda9e6afa89606a337ad6771ae728be1b8", "format": 1 }, { - "name": "plugins/modules/azure_rm_privateendpointconnection_info.py", + "name": "plugins/modules/azure_rm_virtualmachineimage_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "a1c9260c99294e6c9f4579310504bf656d46b2ed16d22188859945cc53563fc0", + "chksum_sha256": "81e679d55f2d54420d960d51e6f0318cec3b781dd37a062df0b0ff9e1756797e", "format": 1 }, { - "name": "plugins/modules/azure_rm_aduser.py", + "name": "plugins/modules/azure_rm_autoscale_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "cbc3bc935e68d08396690815c7ae2902df26ba76b3dff86c46068dcb339af380", + "chksum_sha256": "7494564289cd93cb8e34bf724deff6fd4fb7ea335233703e1aa2a930860e1d40", "format": 1 }, { - "name": "plugins/modules/azure_rm_mysqlfirewallrule_info.py", + "name": "plugins/modules/azure_rm_privatednszonelink.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "3c208e21075ed318d02d1929647894adb0ea5e6a509e5c888ba21eb6fd9fbdc1", + "chksum_sha256": "4166cc9a7e671531be63455046c657896ef9ec1e35a84f7c9bf5bc39cd50bf11", "format": 1 }, { - "name": "plugins/modules/azure_rm_multiplemanageddisks.py", + "name": "plugins/modules/azure_rm_containerregistryreplication_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ab5536fb372cd70f6a76146dc91981735af9ae402734660b6ebd2b638320cd69", + "chksum_sha256": "b88adc68c275d1c2608313a8bca60f7805a473e33df0ff3b75b3ea0deb915195", "format": 1 }, { - "name": "plugins/modules/azure_rm_containerregistrytag.py", + "name": "plugins/modules/azure_rm_subscription_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "9b6a6b029d0bff63cc6fd9cbbbc92f44337fd23d460747b942a4caf32731ad05", + "chksum_sha256": "27171c677f1e2b5337edce509b64021d2bb2708d2b476137b3e4ac96df1631af", "format": 1 }, { - "name": "plugins/modules/azure_rm_keyvaultkey.py", + "name": "plugins/modules/azure_rm_virtualmachinescalesetinstance.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "0efee578ee17f9b39c27f82c1b12bbfe5b29326fb20f30cd9566ffc0a0d6fc3e", + "chksum_sha256": "dcc42ecdde859c43817703218fc0582a4e44750f21b9e8ff33131266c2422916", "format": 1 }, { - "name": "plugins/modules/azure_rm_devtestlabschedule_info.py", + "name": "plugins/modules/azure_rm_webappaccessrestriction.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "725084fb31a59725da35e985c4cb6b5a6a1c26e0a5b1e0469a9b1e195d25714e", + "chksum_sha256": "a31793686f398ccb3ea7c32aad8341b808e06449bfe5ed468303d74a5406cf2a", "format": 1 }, { - "name": "plugins/modules/azure_rm_postgresqlfirewallrule.py", + "name": "plugins/modules/azure_rm_hdinsightcluster.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e6c2c640d0f0df2b35c5d64b8a6ac089a5256d169e148cab7ec5f591c2501803", + "chksum_sha256": "3c7386b43f9f3278b17baf8b6e69bc3800389b1d84c34e49ca9e3f407d30a1eb", "format": 1 }, { - "name": "plugins/modules/azure_rm_containerregistrytag_info.py", + "name": "plugins/modules/azure_rm_sqlmanagedinstance_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "99cde6ea4e4b3f5216131583a7f2ce0dc1777e836d93089733da276895c65b44", + "chksum_sha256": "5b99b1ab21f96e28642c56ee1519c5a9189bc3c0b7c3beb40c11c471012dbe8d", "format": 1 }, { - "name": "plugins/modules/azure_rm_openshiftmanagedcluster.py", + "name": "plugins/modules/azure_rm_snapshot.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "4581968e7d86e0feefaebe6db9719b30ee724b3749d712a83fa74a388cdbff3e", + "chksum_sha256": "11c8c5143b3a5229dbf2615d75f3b121b4ee6f008945607d5b7656de2b0ac861", "format": 1 }, { - "name": "plugins/modules/azure_rm_storageaccount_info.py", + "name": "plugins/modules/azure_rm_virtualhub_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e9f50809d29dce63792c856534ea339a448945bc2557140e4285ce1d1eedbbd9", + "chksum_sha256": "3a9de2d79f400506887f8b86b4a8bbfffb0e0558eae4ce954d8410beff977af4", "format": 1 }, { - "name": "plugins/modules/azure_rm_vpnsite.py", + "name": "plugins/modules/azure_rm_storageblob.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "23ec84e9336fb715e9d733c1c7351f7692215baa5c974d4ea2d191da59ed593d", + "chksum_sha256": "4c7ef09d4dd98bf61d0036a34e1d4e9f0df45c91b3d94c030e17dffa7cd91644", "format": 1 }, { - "name": "plugins/modules/azure_rm_devtestlabvirtualmachine.py", + "name": "plugins/modules/azure_rm_sqlserver_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "fd4ea797fdb70f8f7524c53b112211229261b569cdf11e3d6ca86e6dad84ceb4", + "chksum_sha256": "31710e981ec3af5a7ab221d4679e06e7d7baad4e1cca7a1e9809536cf07c8899", "format": 1 }, { - "name": "plugins/modules/azure_rm_postgresqlconfiguration_info.py", + "name": "plugins/modules/azure_rm_virtualnetworkpeering.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "21ca71cd2afd400b71d7490ca240db6c936f8ff230b45d55cffe7374ab3dfa29", + "chksum_sha256": "f0ee463d7cbde4f3c704542e0ff6e8220b22f436b1014b15a355e8c832845ffd", "format": 1 }, { - "name": "plugins/modules/azure_rm_adserviceprincipal.py", + "name": "plugins/modules/azure_rm_sqlfirewallrule.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "7b6b3b609ecb52a78f5b50c825242781f62232e2022801a3bc40aadc3dc7501b", + "chksum_sha256": "bf215ff5460bd7561374c1013e93dd13406286bedf9bb34fe5c63a423d65b996", "format": 1 }, { - "name": "plugins/modules/azure_rm_publicipaddress_info.py", + "name": "plugins/modules/azure_rm_virtualnetwork.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "2d34ab141f819446533effde97d356adae01af9f17c77687981a41161606ee5f", + "chksum_sha256": "d1f54cd77a98a82bbc32959ec20f38af893dc0a41c442c995ed64d42c53ceedc", "format": 1 }, { - "name": "plugins/modules/azure_rm_manageddisk_info.py", + "name": "plugins/modules/azure_rm_privateendpointconnection.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "42d1fcd7fddb4c8d491dd0929ca0d4baa30380c575eef40ccd96858ead58a30e", + "chksum_sha256": "9ecc4f6823fed8b227500c7714851dcc9f398424d5774bf89f8dafca9afcbef3", "format": 1 }, { - "name": "plugins/modules/azure_rm_firewallpolicy.py", + "name": "plugins/modules/azure_rm_webapp_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "781d2da4df538c4d7af6ce544649bd0f706cdb59f65a91f4178a68d1f361cba5", + "chksum_sha256": "ea1c14d6f336c8e2a1fd62056450a013f912f7fa3a186921548ff7ff8fb59d29", "format": 1 }, { - "name": "plugins/modules/azure_rm_resourcegroup.py", + "name": "plugins/modules/azure_rm_image.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "a403c77e2ac4037370e7ec2591eb54412be483728ade4e9c4555509cc5d9cb79", + "chksum_sha256": "a4648f6095259498761c468442ee994954306f5a112c89ed427e4381dd1b9447", "format": 1 }, { - "name": "plugins/modules/azure_rm_rediscache_info.py", + "name": "plugins/modules/azure_rm_routetable.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "5c674ba80adc3248e6bca9f65fe8be32ddd8598815b7872d76223ab6d0c31347", + "chksum_sha256": "903a9d84fb9a4c7aac19a8c54c32e414e364570fe6d02b56427b8c9a8263e979", "format": 1 }, { - "name": "plugins/modules/azure_rm_automationrunbook_info.py", + "name": "plugins/modules/azure_rm_devtestlabenvironment.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ceb0f3fa7498a033ae3e518cb6ea458fe86021b254dfc79347296051215c2c6c", + "chksum_sha256": "d3900fff1e5d5b5bf9c80ac7261f044f6b0de361eb7e31f1f48d741bfab9b00a", "format": 1 }, { - "name": "plugins/modules/azure_rm_trafficmanager.py", + "name": "plugins/modules/azure_rm_recoveryservicesvault_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "415d86c6d0faa2177a8d620e0dda1d0e7638b37d9ebe081ee0ccdf171c0bae2a", + "chksum_sha256": "0f58e9dc7ce66f1695f5038e3e9bba321e93a1e5dfd98d9a37c8d8963587078e", "format": 1 }, { - "name": "plugins/modules/azure_rm_trafficmanagerendpoint.py", + "name": "plugins/modules/azure_rm_aduser_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "dad1b818859460f2f31fac35c20b6404b27e53c7ce8ca48b8eb7f0b4a1d35d63", + "chksum_sha256": "1d2353c2a497cc22bf6e3cd4fe2f8c52f60f4f556645ada99f014423005a0937", "format": 1 }, { - "name": "plugins/modules/azure_rm_routetable.py", + "name": "plugins/modules/azure_rm_account_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "146505731614ef21002261069557950a8ecdb59de26851815e80a8efe57ad36c", + "chksum_sha256": "ec36327053b86b179229d47231e614d5555b32d1c8bd6368f913743f07fa7f84", "format": 1 }, { - "name": "plugins/modules/azure_rm_aks_info.py", + "name": "plugins/modules/azure_rm_mysqldatabase.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "1c33473a8a593fdc663efae33798ba557973a9fdd7bd13f6f3d28018cd4e583b", + "chksum_sha256": "69e4485770b2c839f24749ec8c5aa3ee693f8afd7ff6bd01c62c0df79275c8d6", "format": 1 }, { - "name": "plugins/modules/azure_rm_azurefirewall_info.py", + "name": "plugins/modules/azure_rm_notificationhub_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "cd9f899b87d4263474f2e16873be3e7bb864aaf883592ffc766d1f825c9157ee", + "chksum_sha256": "07c91492398c62e54b267d583d55287c485fbe4ca5112305e0c0cb0883500e89", "format": 1 }, { - "name": "plugins/modules/azure_rm_datalakestore_info.py", + "name": "plugins/modules/azure_rm_adapplication_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "3a20c6cea4fc464dbfc27684921cad74f406cc623478cd6ca2ecd9037ed3d1cd", + "chksum_sha256": "6a61a1e98531303dc5b6a44bd86ee60bb9c45aee7569a9ce92ca34e5965724af", "format": 1 }, { "name": "plugins/modules/azure_rm_iotdevice_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "44ef66db0ee8e5c2241705d852f1da9a0de914890af18dd863dd1ffc1aeb9ea6", - "format": 1 - }, - { - "name": "plugins/modules/azure_rm_devtestlabarmtemplate_info.py", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "68f3bbf22df1b1932233c2d83aaaf48cb9bc8d6ae951b122098a74815d936f19", - "format": 1 - }, - { - "name": "plugins/modules/azure_rm_privatednszonelink_info.py", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "93d488b4238c4631765dff43c9a6978f3bef9d8ff35294dba4f34772a85a4284", + "chksum_sha256": "87e22ba60e4ab700ee3bfad366690b044125b0f66091c88bc346dcc88e722262", "format": 1 }, { - "name": "plugins/modules/azure_rm_virtualnetworkpeering_info.py", + "name": "plugins/modules/azure_rm_mariadbdatabase.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "262200fce2b7ed028d68c9d6aefb9961cd27b201a127e0a172d0d38f6cb2320a", + "chksum_sha256": "f8dc569f2de810f80a09d827c276f44fd85dc254766b82bed9769846f41008b6", "format": 1 }, { - "name": "plugins/modules/azure_rm_ipgroup_info.py", + "name": "plugins/modules/azure_rm_containerregistry_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "49b6efb5ffd80fc37d17c320869411ecdc589b2bc857d9584fd273b5ee2f818c", + "chksum_sha256": "b176c5d28ade7bb04fb50a82ea0c59987cc004136fcfc37a50cfa240d8c29cc3", "format": 1 }, { - "name": "plugins/modules/azure_rm_eventhub_info.py", + "name": "plugins/modules/azure_rm_postgresqlfirewallrule.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "4b233adc26c96f491ff1fca40bf7ed4b4348d7b7aee123b36e15f3be74e048b4", + "chksum_sha256": "6a0ef8e59ec7d273bd94d6e8e40f6ffe8e0a313f8e8d912b9ecb71c5db6ea662", "format": 1 }, { - "name": "plugins/modules/azure_rm_gallery.py", + "name": "plugins/modules/azure_rm_recoveryservicesvault.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "2f15cc6e7b24ad0093a915c0bc91a781adf80163b81739b3c81634812f065cf0", + "chksum_sha256": "6e465a4c809eda3d9360a644350366ab9fd430da1720a2aa9df9407dd8e49621", "format": 1 }, { - "name": "plugins/modules/azure_rm_servicebustopicsubscription.py", + "name": "plugins/modules/azure_rm_storageaccount.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "944ad33c591b909af10403f521bde04c898b571194ef607e18cf6834c13c1d3f", + "chksum_sha256": "ccc3bf0ae991b6d1312489d910c777727be7c266f2c9f0c69f114ac73be0bdae", "format": 1 }, { - "name": "plugins/modules/azure_rm_servicebus.py", + "name": "plugins/modules/azure_rm_postgresqldatabase_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e5ab60ebf5c75e9ad2ce94633126aec9e0cd514ba2f0906a92ab607645c96a25", + "chksum_sha256": "3c896791d9f215a0ab5c7cb5315bcc302392ba07eea4081b4c68cf392c7013c2", "format": 1 }, { - "name": "plugins/modules/azure_rm_subscription_info.py", + "name": "plugins/modules/azure_rm_applicationsecuritygroup.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "3c9554454fef7600e1befca0a7b88f202e142ab7fd7727ff327df3e4bb0829fe", + "chksum_sha256": "58f5338441960bf8824f1ed9eec52bd6c5c2ec9d8c6ab02e8a5872afd388ed39", "format": 1 }, { - "name": "plugins/modules/azure_rm_routetable_info.py", + "name": "plugins/modules/azure_rm_expressroute_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "da7f7d8eaa544f515c76fa513b984d641f362d8c66b8068939854e7825ec517c", + "chksum_sha256": "5e302a549f10b209ec9b8d61051f3ddf478eea0e4d99d8eb9af1db568975994f", "format": 1 }, { - "name": "plugins/modules/azure_rm_mysqlconfiguration.py", + "name": "plugins/modules/azure_rm_servicebustopicsubscription.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d692d9cc4732b17e1ef96257af505685ecd5389d1fe12abb5c70121e481260c5", + "chksum_sha256": "7ffbac3a815640add669c05c8c29d78ac433ccd8e9762540746eef25457f6829", "format": 1 }, { - "name": "plugins/modules/azure_rm_lock.py", + "name": "plugins/modules/azure_rm_availabilityset.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "858b4a4357dd80fbefb9c62265d91f31019794c9077526f6703c95b5d7c077a3", + "chksum_sha256": "685bb7c2dfeaac6f1042b164d014064dcad6b8865cbe764da3ea9ab5f23a9a76", "format": 1 }, { - "name": "plugins/modules/azure_rm_subnet.py", + "name": "plugins/modules/azure_rm_virtualhubconnection_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "a2fb831b234a530cf52f264eb7e98857ab06b96085cbc706a12d5b20366e0632", + "chksum_sha256": "948b85322d1c84b4eee3709f69f2de166232472a675dd26e125c099ce13517cc", "format": 1 }, { - "name": "plugins/modules/azure_rm_sqlmanagedinstance_info.py", + "name": "plugins/modules/azure_rm_automationrunbook.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b818ebcae8e63d025d9c53bb531a77fc656b13e14e6466cfd555811060668797", + "chksum_sha256": "c257d3afae0b00ae9b09d6d5f04373def1e678ea99cd8d5778c8425d64ea0058", "format": 1 }, { - "name": "plugins/modules/azure_rm_hostgroup.py", + "name": "plugins/modules/azure_rm_storageaccount_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d9b45a4241eeae89e588a7353afa1921b1b867ec547345212ee54033291cfbf8", + "chksum_sha256": "27c35c2191216b55c0af4ed133c20d78f95450cfb3d7bb3605268e7db1119ad0", "format": 1 }, { - "name": "plugins/modules/azure_rm_ddosprotectionplan.py", + "name": "plugins/modules/azure_rm_vmbackuppolicy.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "9792e817aee295bad9eb0c3a18830487a05083a13e214f638b2f15d8461a88b3", + "chksum_sha256": "3f0d9e125fb25e8e1fe6e575c4b4f2a51a6a16c601d52003802d6836c5215ba2", "format": 1 }, { - "name": "plugins/modules/azure_rm_expressroute.py", + "name": "plugins/modules/azure_rm_postgresqlconfiguration_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b59f1aef6819e805e56ec5ae5a56730b09b6fa2efd80391446e11edb7b73044a", + "chksum_sha256": "61b7807ec717db7657e825a2c1bbd815ede63112b9ce0bd4811e1c486ef01fd3", "format": 1 }, { - "name": "plugins/modules/azure_rm_functionapp_info.py", + "name": "plugins/modules/azure_rm_functionapp.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "06b0906d76d55b0eafb3b427a0b945cc869b010798f262dc16f7f91442da2baa", + "chksum_sha256": "b36955b4ade5a066cf353dc80387fb9e7419fabf07664db38510b29c6931282b", "format": 1 }, { - "name": "plugins/modules/azure_rm_trafficmanagerendpoint_info.py", + "name": "plugins/modules/azure_rm_postgresqlserver.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "487daa4470eab01a47f548aee589e40d31891767490a49a9c8b3b377beb96c06", + "chksum_sha256": "665e6153c4700277d41a5b0b83a65601d71b3088868f8e8f93229b91a3d660b1", "format": 1 }, { - "name": "plugins/modules/azure_rm_devtestlabcustomimage.py", + "name": "plugins/modules/azure_rm_sqldatabase_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "df3b7beddbd323f387134c8e22c190f9fd3fa452ac3739460e9c6808bac6cd37", + "chksum_sha256": "d97f650c2b9d89769f4089c17e2d64c1ee066e5295e757119f270be7be10b25a", "format": 1 }, { - "name": "plugins/modules/azure_rm_registrationdefinition.py", + "name": "plugins/modules/azure_rm_apimanagement.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "6497ac35a0079109f824bcaea8fa11681c9426efe8c9846007de2578c1230f75", + "chksum_sha256": "c56dab10921ea4cf7c3244ca5a1f0f24074b3927f0d5f42e0fd82dfd2b305fa9", "format": 1 }, { - "name": "plugins/modules/azure_rm_availabilityset.py", + "name": "plugins/modules/azure_rm_webapp.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "77f4a1006580fe15c6dcaaad9d45e1dafc0fb2c93832069fbdca274cc061bea9", + "chksum_sha256": "5d6121e5cc0c2e61329fcade74dc3092db8e6d47db080d6734b6f20e9384d50f", "format": 1 }, { - "name": "plugins/modules/azure_rm_vmssnetworkinterface_info.py", + "name": "plugins/modules/azure_rm_devtestlabartifact_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "a102b9949b97a9e7b8a2f1821dd96a9a3cd3bb3244e1fb41b60777b71aa4cdef", + "chksum_sha256": "d3e22ef863e1e999fce8e6dd95bda54e1f140e0c55de17fee5ebf40a51d35b53", "format": 1 }, { - "name": "plugins/modules/azure_rm_aksversion_info.py", + "name": "plugins/modules/azure_rm_registrationdefinition.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b45e717994e236e77ab4599a204eb61d193c7d176b67a34d3620e68aee5edb3e", + "chksum_sha256": "9f987c3e5b1b9ad19919ebe6b60ef05e8bb1d14980c25931d505994f07dcb4bb", "format": 1 }, { - "name": "plugins/modules/azure_rm_cdnprofile_info.py", + "name": "plugins/modules/azure_rm_publicipaddress.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "a3c9e4f83f134bc08327d3d3ab37cb5f8e09fa5fe48b309aee5bff655158bd13", + "chksum_sha256": "e2ddc75d7edca49904c6025a1e1418c0ada1ed45fd56963a8e315cf7b2074362", "format": 1 }, { - "name": "plugins/modules/azure_rm_adapplication.py", + "name": "plugins/modules/azure_rm_virtualmachinescalesetinstance_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "a01ea12d86aeee8ef91118aa965de56ca0d09e2290c56041380d8c27f561f0f7", + "chksum_sha256": "bb85cde7c504168c0013e50472526bf8170839212efce46c1ddb1a781fe1dc7c", "format": 1 }, { - "name": "plugins/modules/azure_rm_cdnendpoint.py", + "name": "plugins/modules/azure_rm_virtualmachinescalesetextension_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "9c1e82cf33936851f15e067862abb2b92994b4343ac3827f70c5a82b08808dbd", + "chksum_sha256": "0c32b71b14bbb8c0609f20d2c522792ad6f6e5bd3b8477dfadae9bb34ae61cc2", "format": 1 }, { - "name": "plugins/modules/azure_rm_datalakestore.py", + "name": "plugins/modules/azure_rm_aduser.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "3b4df0d580c0761dd3ade91498ed2f2e4529836b4c35b2483e41dde8d0abc262", + "chksum_sha256": "de250268540b1d1b14e772c77d8860a5d4942ddf58557f1858a2043be8958df2", "format": 1 }, { - "name": "plugins/modules/azure_rm_adgroup_info.py", + "name": "plugins/modules/azure_rm_aksagentpool.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "32c16ac3ebd1e2b3024525c9e261e62d30456ed332797c8b0acf3828a02433fe", + "chksum_sha256": "35eede66b4539d8ebfabaeba04dc70f75614d3bc94b2d19a721b527269e44404", "format": 1 }, { - "name": "plugins/modules/azure_rm_registrationdefinition_info.py", + "name": "plugins/modules/azure_rm_dnsrecordset.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ece5750e5eeccb32bc4c4eccc28d00cbf14f6d2d9216377ad026ae16d01032f8", + "chksum_sha256": "c542f52ae53544606bc2c9e1c75ad25ebd0c8ce2d00485a43024aaa39e803adf", "format": 1 }, { - "name": "plugins/modules/azure_rm_sqlelasticpool.py", + "name": "plugins/modules/azure_rm_devtestlabpolicy_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "a99a9a0336fd66f99a0d20307eaef6551556cfa50e3b24000e88c37fae5c756b", + "chksum_sha256": "f22d2afaf43d8b7a581c4f05f060829090d7294d19b6824ca59e86ccae69379d", "format": 1 }, { - "name": "plugins/modules/azure_rm_keyvaultsecret_info.py", + "name": "plugins/modules/azure_rm_aksagentpoolversion_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "722ecef7de830faf2bc757011605ad112a4185452706d99a741e88e5a2612285", + "chksum_sha256": "69fd5ecafb1b4dee2cbcb17f9b767f3fff6a9d717ca8548dec4f9735f3d213d6", "format": 1 }, { - "name": "plugins/modules/azure_rm_keyvault_info.py", + "name": "plugins/modules/azure_rm_expressroute.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "f404612876ef89c63e9163e38c3c2dc922a849ab3aac3cac42cc4a9b0b1c5cc3", + "chksum_sha256": "b7a0f0dd5862dbb3fc72329ed7c6790cc18a79e279a3e3f85896c075dda2ab1c", "format": 1 }, { - "name": "plugins/modules/azure_rm_notificationhub_info.py", + "name": "plugins/modules/azure_rm_resourcegroup_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "be0f91c3a0930f859ffdc567b6cf28746c41791ff2105790c96419aaba14e79f", + "chksum_sha256": "3336b070c7a607adde16279cdeaefe260b75c683a0ab0028b4ae6f262ebd32d8", "format": 1 }, { - "name": "plugins/modules/azure_rm_appgateway_info.py", + "name": "plugins/modules/azure_rm_devtestlabvirtualmachine_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "34b398f5ce06e7c0071035aa6d6e1d710240699738bcb3341ca418782e2b0465", + "chksum_sha256": "ae5aa0ceace675df82f2a76e4f852a222bc892f4e406d33745d97ce848b53a4a", "format": 1 }, { - "name": "plugins/modules/azure_rm_virtualmachineextension.py", + "name": "plugins/modules/azure_rm_cosmosdbaccount_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "09bd02e50c12aa9e602e8ac7b4312b2619be27b656114309625c9aa39fbcb97a", + "chksum_sha256": "80461bffd0ad681f97b3eaafe9db453a700658748c02114d3128b8f87f7b79f2", "format": 1 }, { - "name": "plugins/modules/azure_rm_virtualmachineimage_info.py", + "name": "plugins/modules/azure_rm_sqlfirewallrule_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "67c57e01af0dff1896e7a22a334388aca376193f0faf86168bd67c53dc635bc7", + "chksum_sha256": "71e6d450073de8c90623f4048d44bd6eabaa39c36031a9beba28171a53b302cd", "format": 1 }, { - "name": "plugins/modules/azure_rm_devtestlabschedule.py", + "name": "plugins/modules/azure_rm_availabilityset_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "4fe044b4199eae109e14370d764e8f52ef37d4244290a66d71409214c1efc5e4", + "chksum_sha256": "5210c3fbf5fd2f5b702cd82ba5cf7b44604231bebbe9f00a71ee71616a8e2e6b", "format": 1 }, { - "name": "plugins/modules/azure_rm_registrationassignment.py", + "name": "plugins/modules/azure_rm_monitordiagnosticsetting.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "a20f6c329c8d6c8cf53f32d506523f14e64fb05f855d959a5e787bdbe3042f74", + "chksum_sha256": "a87a1032899109683876d6a6ce5eba1ee931f2c64442c0910d69242a05560b26", "format": 1 }, { - "name": "plugins/modules/azure_rm_roleassignment_info.py", + "name": "plugins/modules/azure_rm_autoscale.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "78faee09138728e5731ddc316b5ee3bcd05289f37b2161331c0fcc76034c95a4", + "chksum_sha256": "d70f6911bb558f59f68dcc61f42155c1f108526ed47e7ad3bd8f653ade1a4f8f", "format": 1 }, { - "name": "plugins/modules/azure_rm_account_info.py", + "name": "plugins/modules/azure_rm_devtestlabarmtemplate_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d2430e9c6d0cb9fe31a461226dfad1afe0f102a83e702ad877b65935f865a8ef", + "chksum_sha256": "8f48a0242d1d4246afa2a6c856e43023daee49ffbae58db30591733304d4c9c1", "format": 1 }, { - "name": "plugins/modules/azure_rm_route.py", + "name": "plugins/modules/azure_rm_servicebussaspolicy.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "04a75e4a0fe7281c28779eb29c43a3353ffc3dc30aef98926cd651630086cd28", + "chksum_sha256": "10d85532d9875ac3da016f15add256df6cf2cbb8a88d4a57ad316bce7df7a45c", "format": 1 }, { - "name": "plugins/modules/azure_rm_applicationsecuritygroup_info.py", + "name": "plugins/modules/azure_rm_galleryimage.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "8d929c69fe1691d7658fcac7d1a2ac92115ce062efc6c866cf9dba8df2900064", + "chksum_sha256": "dff66513503b09036068848c5cc716f0047d15cafa59d063f833574948739db1", "format": 1 }, { - "name": "plugins/modules/azure_rm_virtualmachine.py", + "name": "plugins/modules/azure_rm_dnszone.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "3e50bdff05dbc06a630998c7f22245bd614a2cf5af31568464bd0b9ad1407a21", + "chksum_sha256": "a9974fc3f305a83840b041b02158be7162a6c87c8fb3a3b909a2ac6255390668", "format": 1 }, { - "name": "plugins/modules/azure_rm_privatednszone.py", + "name": "plugins/modules/azure_rm_datalakestore.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "3f9cd0311646895890ed0b353924c64b44699e70ca7bd2c1f330cc58d10ebe18", + "chksum_sha256": "41a04e1e6cfc80c11eedcb66b8dd36d84a7484cd698a9e8ddc8354ecaf3a6ce7", "format": 1 }, { - "name": "plugins/modules/azure_rm_postgresqlserver_info.py", + "name": "plugins/modules/azure_rm_ipgroup.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "df4291e5a31ae032f6e03646266d5220e921718fd59b4ce2dd38f17703681352", + "chksum_sha256": "2aaffe067e785adc4ccb4a78a2a2d665ee6e2bd5a28b79f75e2be4695a1ce115", "format": 1 }, { - "name": "plugins/modules/azure_rm_mariadbserver_info.py", + "name": "plugins/modules/azure_rm_containerregistrywebhook.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "5bfe8de591caf07cee5750f15786ce93743d726d8ae3f9951a3567a3d8bb946f", + "chksum_sha256": "b911199637d90fb213eaf63e586745cfb8ab889af2f199340d0d4df59138362a", "format": 1 }, { - "name": "plugins/modules/azure_rm_containerinstance_info.py", + "name": "plugins/modules/azure_rm_vpnsite.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b0bcc904bda5566b15648f6f311b3300bda6e8df43b46d8a298f7c233a7f11eb", + "chksum_sha256": "6d818f5250f12c9dee0a78f01f853640c25a583e022f8358355e78076c5b49b8", "format": 1 }, { - "name": "plugins/modules/azure_rm_privatelinkservice_info.py", + "name": "plugins/modules/azure_rm_privateendpoint.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "02a72af00f3442e3cb5a19ba01bffc4cb2d47f646abf1a5ae0a125e80a8313ba", + "chksum_sha256": "9cf71bc67a11a058b6eac5f7c06c3a003ecce968f6fe09285f43dbd81f91fdf9", "format": 1 }, { - "name": "plugins/modules/azure_rm_trafficmanagerprofile_info.py", + "name": "plugins/modules/azure_rm_virtualnetworkgateway.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "857597ed8719996965b0796e71c8223f05b789061f3caafc9a808b271858a2f6", + "chksum_sha256": "59e1d99084af0027d2c970a9e6ab6088546f4768d151a045b70615cff47b05c3", "format": 1 }, { - "name": "plugins/modules/azure_rm_roledefinition.py", + "name": "plugins/modules/azure_rm_postgresqldatabase.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "8ea734515f2f242298f189539766283d2de71d063864ec0c95efe0cb1739b9d4", + "chksum_sha256": "e1d1f0a296460cb6a411cc926cff5476be07b16ced01f7b9a95e64802dacf9e2", "format": 1 }, { - "name": "plugins/modules/azure_rm_keyvaultkey_info.py", + "name": "plugins/modules/azure_rm_iothubconsumergroup.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "fd68e08a8db49b8e7516600ae85b3616edfb578a163eb7f3e7a9c136aa93148f", + "chksum_sha256": "9d6fc8dba8ecd841d908a4b1226fa0a186c270a9eb3e8a5a054692e56c621876", "format": 1 }, { - "name": "plugins/modules/azure_rm_containerregistryreplication_info.py", + "name": "plugins/modules/azure_rm_mysqlfirewallrule.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b3d2ad0a238f9493c8e20fe7806d07389e0f29e4167d4328820082b15bbdee5c", + "chksum_sha256": "8d012c884bd3e4f7880fee699b3b6c8210a1cc00c98a2166c68c8b7e6a052bc2", "format": 1 }, { - "name": "plugins/modules/azure_rm_containerinstance.py", + "name": "plugins/modules/azure_rm_storageshare_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "02edee35985e15cb2583e3b5a9db8bcfb0f2cd1d5bff352961a6a49f38145ab9", + "chksum_sha256": "c30615415440ade0b39196ccd619a923cfce2162548c18c7edaec635f46e84e3", "format": 1 }, { - "name": "plugins/modules/azure_rm_virtualhub_info.py", + "name": "plugins/modules/azure_rm_datalakestore_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ebb16f82d8d56435ae9497852954c9f1b68cc7b7125a10fb29dbb8369f76a019", + "chksum_sha256": "97d431f9a54962aa76ee516a8d3f0e51215e832509dc605a6bca1ede20ec9cfb", "format": 1 }, { - "name": "plugins/modules/azure_rm_mysqldatabase.py", + "name": "plugins/modules/azure_rm_rediscachefirewallrule.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "8aff767afda022f2888a16c43ce6e5c3532414a1cc8bf5d41ec124b3d8ca16f3", + "chksum_sha256": "1dd3dd187f650d1083a42a7576b7f9a9ba1b8b5960804a0dc71e33470b2c2d73", "format": 1 }, { - "name": "plugins/modules/azure_rm_eventhub.py", + "name": "plugins/modules/azure_rm_containerregistry.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "37931bcc8ecf8b6774e140e52951b74cf86793a42b1b38811fe8dedbfcb907f2", + "chksum_sha256": "781782bcf6811e28b975d35abb3892b96dbf168421891a06e352d02ac4c00569", "format": 1 }, { - "name": "plugins/modules/azure_rm_devtestlab_info.py", + "name": "plugins/modules/azure_rm_mysqlfirewallrule_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "01f4aabc9e6a62314de3b6568a54d0b9ef1c0e98b651205d852609e7ad3f8f6b", + "chksum_sha256": "2c98b91e48ddf042f3fd0847c42b7d880fc00ed807437aa70d35ae1107ba1407", "format": 1 }, { - "name": "plugins/modules/azure_rm_sqlfirewallrule_info.py", + "name": "plugins/modules/azure_rm_trafficmanagerprofile.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "9351536c53ce290bea263dd9dc10ce02965d534f7c4edeed173aeb4c32138476", + "chksum_sha256": "4df5198ca3361e221f283b8d1cc1d26dbb3ea265422c76ebb8d6357ab6b4d4b6", "format": 1 }, { - "name": "plugins/modules/azure_rm_mariadbconfiguration_info.py", + "name": "plugins/modules/azure_rm_apimanagementservice_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "efc537a4c1ed138ba89879455f559f9f7f5bf9badf5c9ab8528c702bd8d18b78", + "chksum_sha256": "5447d18ab74149d3c2b05b5cc516392d367b11e71d059d29207f9a749a334f89", "format": 1 }, { - "name": "plugins/modules/azure_rm_securitygroup.py", + "name": "plugins/modules/azure_rm_aks_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "1526773fbfb42677ca222a4ff7eff989898662619e5239388e3a0b6392f6fa6d", + "chksum_sha256": "39e0afd38650dd8c802f4f405aa4f3469ddb0a741210b2c56ffe663fef2ce62c", "format": 1 }, { - "name": "plugins/modules/azure_rm_manageddisk.py", + "name": "plugins/modules/azure_rm_aksagentpool_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "13eb09ecf5eab164328b11f0a181233f7e07ab6d972f6c68b0cecc1070da9103", + "chksum_sha256": "92c6e3a0f537164ae87f3cf64dd071238a5c8349d7ca84a16826720fc5b82e44", "format": 1 }, { - "name": "plugins/modules/azure_rm_snapshot.py", + "name": "plugins/modules/azure_rm_notificationhub.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "2c1750e5df466813edb9b08b91d67089f56ed2a435c7b6396446de07b5aad243", + "chksum_sha256": "025163a4ad192ec7b4ec14e8faf49b01e29a8a8f38cd8231aaddec9726f460bb", "format": 1 }, { - "name": "plugins/modules/azure_rm_devtestlabartifactsource.py", + "name": "plugins/modules/azure_rm_ddosprotectionplan.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "416803d8fce98f31c25685f9233c29fe952b624a64b36b94a29ea0d282159d6e", + "chksum_sha256": "b5eb8ad5fe5b146e7b79f083f2f9747b1bc64432bc55660ac682e97e8235f023", "format": 1 }, { - "name": "plugins/modules/azure_rm_virtualmachinescalesetinstance.py", + "name": "plugins/modules/azure_rm_lock.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "2da99cb8865d4373b1b717cedf04da34ddc4dfd9002bdcec80554572de020696", + "chksum_sha256": "858b4a4357dd80fbefb9c62265d91f31019794c9077526f6703c95b5d7c077a3", "format": 1 }, { - "name": "plugins/modules/azure_rm_batchaccount.py", + "name": "plugins/modules/azure_rm_networkinterface_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "3442b86f15be3bef48e0e093a044c4018296dba33327befce549c3ed1d3eedff", + "chksum_sha256": "22a876dccd098bc68511e639f50b08e8a50ffd1dfa24704907beb9f0a96c3029", "format": 1 }, { - "name": "plugins/modules/azure_rm_iothub.py", + "name": "plugins/modules/azure_rm_adserviceprincipal.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "1053c8fad183072c97ced402c7e8ea6df316793f31437256c6b75cd2c00072c7", + "chksum_sha256": "e141818fea5c223278d4709af5c6ae47cf4841aa0e7e823d84be8949b085d1c3", "format": 1 }, { - "name": "plugins/modules/azure_rm_devtestlabpolicy.py", + "name": "plugins/modules/azure_rm_appserviceplan_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "3089c890ddf7d990b1bed1d12d65f2e8ae04ef114092711f9ecdeb1a95c7c7d0", - "format": 1 - }, - { - "name": "plugins/inventory", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, + "chksum_sha256": "2feccbb74790330b291a4ab0f8bcf3d4ba44f5bd2c18490aff02c92f3d043e09", "format": 1 }, { - "name": "plugins/inventory/azure_rm.py", + "name": "plugins/modules/azure_rm_appgateway_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "48dffa10112662e43b9d4aa255c10b6e43f9fa5db23317bf5c7fd8a631db29d9", + "chksum_sha256": "fbe1b90752ce94a33ab1c3e6771f90e4fe87d676e99819e15da631fe5fe2cea5", "format": 1 }, { - "name": "pr-pipelines.yml", + "name": "plugins/modules/azure_rm_bastionhost_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "5b97ed29cc9a054b1f40eca169d64956405773f082892dd8a9cde955628abee2", + "chksum_sha256": "dcdf18934767abd5f6912ce0bb9cbbff6954c79fab3998fdf9ea3c75f5f9d604", "format": 1 }, { - "name": "sanity-requirements-azure.txt", + "name": "plugins/modules/azure_rm_virtualmachinescaleset.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "f1e369249fb90b3fa4f3cb5aa912b0fbb6824b1d2267d11253df6bc65beb1b8a", + "chksum_sha256": "425563f892c11a2e14fe22276c308af85268b2ef1a3c2b94e779a9e18dfe7786", "format": 1 }, { - "name": "azure-pipelines.yml", + "name": "plugins/modules/azure_rm_loganalyticsworkspace.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "66d836d2a68eba8cc2df59ba88a2187e11b739cb72a86b45e944ea7010bd8f78", + "chksum_sha256": "5f5d8fa3f00c30d80ce2427ccb7c9d8a00e78c255ecfc67fb1de5f37256c3418", "format": 1 }, { - "name": "release-pipelines.yml", + "name": "plugins/modules/azure_rm_monitorlogprofile.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "1d7eb4d7e849e71924f0d55f676fc3780746900eafd3c0d48326f06b95c5b872", + "chksum_sha256": "0951e10121e28230e99e7a3143ce444c9bc4cbf8b7858033c6dd5d071e1ac579", "format": 1 }, { - "name": "CONTRIBUTING.md", + "name": "plugins/modules/azure_rm_privatednszone.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "290a3dfba9b53aecbf86badacfdcb7f320c9a924e02a8f0b4824785a551d0a39", + "chksum_sha256": "c4def272c347cc85f0e108b4392b69eabd6e9caf432cbb84b2acc902bd8a3f34", "format": 1 }, { - "name": "CHANGELOG.md", + "name": "plugins/modules/azure_rm_diskencryptionset_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "618cbde74ce9bfa81af5465c1f6ac5f488976247815529b1c2f39a9b53f3cb2d", + "chksum_sha256": "586109c40b10714b5280368db2802fca8d4fc87f797e2b0d5084bb5e7a4df3df", "format": 1 }, { - "name": "CredScanSuppressions.json", + "name": "plugins/modules/azure_rm_devtestlabpolicy.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "98c0ee6a0b7a115787cf109a8c0e2ea4a61df6751ecda37915b22ffb44a1128d", + "chksum_sha256": "0146075d793b46427030cb705c7db55a93b6402afe9401b04dfe56a1434dee26", "format": 1 }, { - "name": "ansible.cfg", + "name": "plugins/modules/azure_rm_monitordiagnosticsetting_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "2caa654e85c7e66be39d494d173f69f7565059c504b7201f2ee033173ab80df0", + "chksum_sha256": "3fa25b176b8c073c9435901c2c8455577e64a998c71b5c6a472ae1044f48bed9", "format": 1 }, { - "name": "LICENSE", + "name": "azure-pipelines.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "8b1ba204bb69a0ade2bfcf65ef294a920f6bb361b317dba43c7ef29d96332b9b", + "chksum_sha256": "1f55cf75a25502f8322df2fc8640e52f85fed4459b8c26fee3c75295f9c45552", "format": 1 }, { @@ -2216,7 +2174,7 @@ "name": "tests/utils/ado/ado.sh", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "147f8cf89d2b91ff642805964b49cb149b5f0f5ec5c2dc47b1efb567f6b54a73", + "chksum_sha256": "8d43591bdea6cbc13771abd458687415cadeb81242b5c706356e4554fb445e32", "format": 1 }, { @@ -2227,45 +2185,45 @@ "format": 1 }, { - "name": "tests/utils/shippable/sanity.sh", + "name": "tests/utils/shippable/timing.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "1cd365c5bad1facb7e98cad97a20e34231f49fca169653ccd7d34bd955bd88f6", + "chksum_sha256": "e4906097dcc02406930229bf0a026f667327fbe11ea6b9763bc76b4c3e98be29", "format": 1 }, { - "name": "tests/utils/shippable/check_matrix.py", + "name": "tests/utils/shippable/timing.sh", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "f4a38ad2db66b272075c37e9cca352fc7d5b69fe19e32adec0cdd74f91586fe6", + "chksum_sha256": "f3f3cc03a997cdba719b0542fe668fc612451841cbe840ab36865f30aa54a1bd", "format": 1 }, { - "name": "tests/utils/shippable/shippable.sh", + "name": "tests/utils/shippable/check_matrix.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "829380ef8b40f42a82696ada1168318856596f4e943bbb9a4f5cd6130bbce2af", + "chksum_sha256": "f4a38ad2db66b272075c37e9cca352fc7d5b69fe19e32adec0cdd74f91586fe6", "format": 1 }, { - "name": "tests/utils/shippable/cloud.sh", + "name": "tests/utils/shippable/sanity.sh", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "99db6946e47cf9e49ab2fccbe0aca8ffc9aaa0918fdc9e3ef543601c55a98713", + "chksum_sha256": "1cd365c5bad1facb7e98cad97a20e34231f49fca169653ccd7d34bd955bd88f6", "format": 1 }, { - "name": "tests/utils/shippable/timing.sh", + "name": "tests/utils/shippable/cloud.sh", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "f3f3cc03a997cdba719b0542fe668fc612451841cbe840ab36865f30aa54a1bd", + "chksum_sha256": "99db6946e47cf9e49ab2fccbe0aca8ffc9aaa0918fdc9e3ef543601c55a98713", "format": 1 }, { - "name": "tests/utils/shippable/timing.py", + "name": "tests/utils/shippable/shippable.sh", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e4906097dcc02406930229bf0a026f667327fbe11ea6b9763bc76b4c3e98be29", + "chksum_sha256": "829380ef8b40f42a82696ada1168318856596f4e943bbb9a4f5cd6130bbce2af", "format": 1 }, { @@ -2279,416 +2237,395 @@ "name": "tests/config.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "3e67c280ecbe32951edc9c5aacb7b514cc2a5bc70118cc43e79c52ca2b606138", + "chksum_sha256": "410698cc625c851ec21f2ef8ea020cf7a353590d10a995a3c57eb52d4d8065fb", "format": 1 }, { - "name": "tests/sanity", + "name": "tests/lint", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/sanity/ignore-2.13.txt", + "name": "tests/lint/ignore-lint.txt", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "1bebd2850c6d8fec526b000b7e82e9433a001060f60807379ed86e7ff9c1ac50", + "chksum_sha256": "bea1480e79bf52af44c7d7b2b112aead789a54696c6ef6469f2dcd710ad2a47f", "format": 1 }, { - "name": "tests/sanity/ignore-2.12.txt", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "8daa4d81f82078d505ab1c2a7bfe264bc39bf8cbf5c2b3bfca5d7179f351b148", + "name": "tests/integration", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, "format": 1 }, { - "name": "tests/sanity/ignore-2.11.txt", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "8daa4d81f82078d505ab1c2a7bfe264bc39bf8cbf5c2b3bfca5d7179f351b148", + "name": "tests/integration/targets", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, "format": 1 }, { - "name": "tests/sanity/ignore-2.9.txt", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "ffbea11daa9fd2fa17bf7aa84a16f321c9ff581b7a69e5f3741b3019f7cd2f8e", + "name": "tests/integration/targets/azure_rm_sqlserver", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, "format": 1 }, { - "name": "tests/sanity/ignore-2.14.txt", + "name": "tests/integration/targets/azure_rm_sqlserver/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_sqlserver/meta/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "da02cd547c88fa6e356d6867354b1b3db7a0f04d13fb562afaf5be1058957227", + "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/sanity/ignore-2.10.txt", + "name": "tests/integration/targets/azure_rm_sqlserver/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "8daa4d81f82078d505ab1c2a7bfe264bc39bf8cbf5c2b3bfca5d7179f351b148", + "chksum_sha256": "b497f92848d198221058a5f5aa42e37dc513f9d2a64f54b2ddc9029b80ab7219", "format": 1 }, { - "name": "tests/integration", + "name": "tests/integration/targets/azure_rm_sqlserver/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets", + "name": "tests/integration/targets/azure_rm_sqlserver/tasks/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4b9b3011d1cd399cf58fc8749d467300f6a19f2105a9455c6cc385c2468c1b02", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_image", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_adgroup", + "name": "tests/integration/targets/azure_rm_image/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_adgroup/aliases", + "name": "tests/integration/targets/azure_rm_image/meta/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "0e90b0bd13c40122b87176faa412a83730dcc85c0060dffa0d7b0450d559ed40", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_adgroup/tasks", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, + "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_adgroup/tasks/main.yml", + "name": "tests/integration/targets/azure_rm_image/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "164f83628dc35c78e707c2e1e2263108763f36f14b8dd6dd582d3b80668bb533", + "chksum_sha256": "fca45b39c1e6a21b8fb8e1b6c8f5954d8accf0bc6fa436361d75b014b36a8fd6", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_adgroup/meta", + "name": "tests/integration/targets/azure_rm_image/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_adgroup/meta/main.yml", + "name": "tests/integration/targets/azure_rm_image/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", + "chksum_sha256": "f15012224b91b0dcb340a2dfcd3d360a36bf2ed291b88a4206914ac5db295466", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_notificationhub", + "name": "tests/integration/targets/azure_rm_managementgroup", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_notificationhub/aliases", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "1be076424fbf717d678e202250426e9b368688f8d3029f0c5dc262b97df819af", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_notificationhub/tasks", + "name": "tests/integration/targets/azure_rm_managementgroup/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_notificationhub/tasks/main.yml", + "name": "tests/integration/targets/azure_rm_managementgroup/meta/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d9624fdf71acaf83f57f4e4756520640e656e90d281c05a9ed732eb7d5839e8a", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_notificationhub/meta", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, + "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_notificationhub/meta/main.yml", + "name": "tests/integration/targets/azure_rm_managementgroup/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "a66dc9e034ad04e167bd52df4f75f2bea4499b25349fc42b3c8de9e2fe806996", + "chksum_sha256": "e7fc1f0b30d75ba7b3a8f5a9a45a7703c06585edc0f3ce9231a9b2ca7a649864", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_datafactory", + "name": "tests/integration/targets/azure_rm_managementgroup/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_datafactory/aliases", + "name": "tests/integration/targets/azure_rm_managementgroup/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "a74040b53394bd68b1885c350f1f62603740e721ca38e01609660895693a3858", + "chksum_sha256": "52b6ea89da7341d8977b8f1ac1fb530b48eba4831b6c5224b2c136c9bfa91ad7", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_datafactory/tasks", + "name": "tests/integration/targets/azure_rm_privatednszonelink", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_datafactory/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "cf84ad6d9aa2237a467d38db0d56b0491c7d164a3929d2ad58a80ca634ed8611", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_datafactory/meta", + "name": "tests/integration/targets/azure_rm_privatednszonelink/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_datafactory/meta/main.yml", + "name": "tests/integration/targets/azure_rm_privatednszonelink/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_resourcegroup", + "name": "tests/integration/targets/azure_rm_privatednszonelink/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b09e7a20443d9fe8e820607cf9ae826988c41fe890af049d025cb7eba9e4dbb0", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_privatednszonelink/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_resourcegroup/aliases", + "name": "tests/integration/targets/azure_rm_privatednszonelink/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "cd30933c00554775a36ee6421935b7d8baf776db7cb35d5a103be9e18b7d2486", + "chksum_sha256": "fe73403f7245a8d8d762b068cc62624999c45eea47a08d7c370685370d73a216", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_resourcegroup/tasks", + "name": "tests/integration/targets/azure_rm_deployment", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_resourcegroup/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "d1e3d0679a5f91a33aba0faa65678c972d07f6cca59ad6ffa065bf31e6f5e59e", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_resourcegroup/meta", + "name": "tests/integration/targets/azure_rm_deployment/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_resourcegroup/meta/main.yml", + "name": "tests/integration/targets/azure_rm_deployment/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_backuppolicy", + "name": "tests/integration/targets/azure_rm_deployment/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "11d8df93f7c7fb0bd35df23550ce55cea64300cbd7b3a1282927d49c53f53951", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_deployment/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_backuppolicy/aliases", + "name": "tests/integration/targets/azure_rm_deployment/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "109bb8ece8ca54a061f03f7050aca3401610606b79a6e313d2556dcb04fda637", + "chksum_sha256": "7d55d04096bc98a7e4b9423ce7a67bd90ff057d8f2597489e018095d8c7747b0", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_backuppolicy/tasks", + "name": "tests/integration/targets/azure_rm_hostgroup", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_backuppolicy/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "75cbd5e96f3bf83cf30b8d6b09c698df02a860f480ae11270f4703d54cce0728", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_backuppolicy/meta", + "name": "tests/integration/targets/azure_rm_hostgroup/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_backuppolicy/meta/main.yml", + "name": "tests/integration/targets/azure_rm_hostgroup/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_monitordiagnosticsetting", + "name": "tests/integration/targets/azure_rm_hostgroup/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b09e7a20443d9fe8e820607cf9ae826988c41fe890af049d025cb7eba9e4dbb0", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_hostgroup/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_monitordiagnosticsetting/aliases", + "name": "tests/integration/targets/azure_rm_hostgroup/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "cc618d5714ddaae8f1482cf89dcf3327cf82fa378c16f6b5cf092339927261c3", + "chksum_sha256": "a11e09783bbddbc59c9ddb098a44d5e17aaac05fec0334ef225dd2d301651e17", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_monitordiagnosticsetting/tasks", + "name": "tests/integration/targets/azure_rm_adapplication", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_monitordiagnosticsetting/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "72fe8b33496a877069bc27654c879e619ca34b55982bbd4f92740a8c1b307260", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_monitordiagnosticsetting/meta", + "name": "tests/integration/targets/azure_rm_adapplication/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_monitordiagnosticsetting/meta/main.yml", + "name": "tests/integration/targets/azure_rm_adapplication/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_networkinterface", + "name": "tests/integration/targets/azure_rm_adapplication/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0e90b0bd13c40122b87176faa412a83730dcc85c0060dffa0d7b0450d559ed40", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_adapplication/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_networkinterface/aliases", + "name": "tests/integration/targets/azure_rm_adapplication/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "79cafc6b10612f907e2e4a97bac50c9948ac0a0dd5030875a9465204a6323b48", + "chksum_sha256": "b35d1ada403add1e0a23a265f11a6395959c863e48579a060b40ed7f4e2b8b66", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_networkinterface/tasks", + "name": "tests/integration/targets/azure_rm_monitorlogprofile", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_networkinterface/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "55b06254bf273e7af12bdbe3bbba3e0fcb1fbad6bdf12996096321c458a881b2", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_networkinterface/meta", + "name": "tests/integration/targets/azure_rm_monitorlogprofile/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_networkinterface/meta/main.yml", + "name": "tests/integration/targets/azure_rm_monitorlogprofile/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_securitygroup", + "name": "tests/integration/targets/azure_rm_monitorlogprofile/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cc618d5714ddaae8f1482cf89dcf3327cf82fa378c16f6b5cf092339927261c3", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_monitorlogprofile/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_securitygroup/aliases", + "name": "tests/integration/targets/azure_rm_monitorlogprofile/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "a390a5b729f05cbb0f6d91d7d663389c81a571a34bd2e931dc56fcdaee025754", + "chksum_sha256": "71fa19924e9ae73ca408e1fccec2a768f3b2fc113158c5718b7b870c081189f1", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_securitygroup/tasks", + "name": "tests/integration/targets/azure_rm_virtualmachineextension", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_securitygroup/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "c7d9797319b6a4e93b75674013e526aedd93f352b682319ec2fe65a05c8889db", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_securitygroup/meta", + "name": "tests/integration/targets/azure_rm_virtualmachineextension/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_securitygroup/meta/main.yml", + "name": "tests/integration/targets/azure_rm_virtualmachineextension/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachineextension", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, - "format": 1 - }, - { "name": "tests/integration/targets/azure_rm_virtualmachineextension/aliases", "ftype": "file", "chksum_type": "sha256", @@ -2706,686 +2643,714 @@ "name": "tests/integration/targets/azure_rm_virtualmachineextension/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "92002597ad6d4b7ff0e7f835194fe628ea09447982b20d05b93cd51ee0966b0a", + "chksum_sha256": "9e3cb1009bcddcf4db403356c71a3862d40d9978395362480795d87961229f8d", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachineextension/meta", + "name": "tests/integration/targets/azure_rm_virtualmachineextension/files", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachineextension/meta/main.yml", + "name": "tests/integration/targets/azure_rm_virtualmachineextension/files/test-public-settings.json", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", + "chksum_sha256": "1063a36dc41ca530af7839c69ec22f2b92447be4c3b41e90429c970b23d9116b", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachineextension/files", + "name": "tests/integration/targets/azure_rm_virtualmachineextension/files/test-protected-settings.json", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "436711afe43e0c31f515a016fa56e64c70f1df35502725327b8c703773d4823b", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_automationrunbook", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachineextension/files/test-protected-settings.json", + "name": "tests/integration/targets/azure_rm_automationrunbook/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_automationrunbook/meta/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "436711afe43e0c31f515a016fa56e64c70f1df35502725327b8c703773d4823b", + "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachineextension/files/test-public-settings.json", + "name": "tests/integration/targets/azure_rm_automationrunbook/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "1063a36dc41ca530af7839c69ec22f2b92447be4c3b41e90429c970b23d9116b", + "chksum_sha256": "522c2e1148926193596b31fa7cf086b9f57e17c7028abc638a2b6f5bb9269850", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_azurefirewall", + "name": "tests/integration/targets/azure_rm_automationrunbook/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_azurefirewall/aliases", + "name": "tests/integration/targets/azure_rm_automationrunbook/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "c00350cca0b02532fa9ae31b5fdf0d5b963615b521197b71ac4cc024aac9d037", + "chksum_sha256": "a1368da2abfb774ea5e3fd1a9238e9fbadbbc6fb1a93c00685bdc1d966e401b4", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_azurefirewall/tasks", + "name": "tests/integration/targets/azure_rm_iothub", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_azurefirewall/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "5b16a841fdb7190e7c70c2e94025735563442af45795ebb81cb4b028d9b317e9", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_azurefirewall/meta", + "name": "tests/integration/targets/azure_rm_iothub/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_azurefirewall/meta/main.yml", + "name": "tests/integration/targets/azure_rm_iothub/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_roleassignment", + "name": "tests/integration/targets/azure_rm_iothub/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8d4097a5a2543084f3eea11259e299ba87ade8dc8995e5745358931356bee79f", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_iothub/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_roleassignment/aliases", + "name": "tests/integration/targets/azure_rm_iothub/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "51bfa0d69b7c8b7e94b28aa9c60c921ace3971f50a385673a66791c31749678a", + "chksum_sha256": "1e5e67ce46e6ae0d5e38dbc0526e3140c3f1f3d978883736c4c84e0732042dbf", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_roleassignment/tasks", + "name": "tests/integration/targets/azure_rm_keyvaultkey", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_roleassignment/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "3f00c67e5c33a10bb37d546c8d96868716a354b63f69b7ebdd6601f2cb55cab8", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_roleassignment/meta", + "name": "tests/integration/targets/azure_rm_keyvaultkey/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_roleassignment/meta/main.yml", + "name": "tests/integration/targets/azure_rm_keyvaultkey/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_roledefinition", + "name": "tests/integration/targets/azure_rm_keyvaultkey/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "36614727374728e26b5686e9fac66641e5b9c268b6945f2dcd1b4a9c4d2232c3", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_keyvaultkey/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_roledefinition/aliases", + "name": "tests/integration/targets/azure_rm_keyvaultkey/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "cc618d5714ddaae8f1482cf89dcf3327cf82fa378c16f6b5cf092339927261c3", + "chksum_sha256": "9a2de112faff356ffd7328876a499692420544b0558695813205740517ddda32", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_roledefinition/tasks", + "name": "tests/integration/targets/azure_rm_keyvaultkey/lookup_plugins", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_roledefinition/tasks/main.yml", + "name": "tests/integration/targets/azure_rm_keyvaultkey/lookup_plugins/azure_service_principal_attribute.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "04393583f4695e833ec9c02daf81d7889cb14aacafa612bf41628ba775eb66a3", + "chksum_sha256": "ecf5403290d75ebf93dd07c1a0d1ec251482cde7952d5fc4c1f51ecde936e804", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_roledefinition/meta", + "name": "tests/integration/targets/azure_rm_dnszone", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_roledefinition/meta/main.yml", + "name": "tests/integration/targets/azure_rm_dnszone/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_dnszone/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_cognitivesearch", + "name": "tests/integration/targets/azure_rm_dnszone/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1af368a225674fcae08ea809c4dc605f03bc0334b44a9b17dfab0dfe49d93ac6", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_dnszone/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_cognitivesearch/aliases", + "name": "tests/integration/targets/azure_rm_dnszone/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b09e7a20443d9fe8e820607cf9ae826988c41fe890af049d025cb7eba9e4dbb0", + "chksum_sha256": "b03603dc5bddfda055b5dfa51d9c769881822cd95a0953dfe82ef9afd446926a", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_cognitivesearch/tasks", + "name": "tests/integration/targets/azure_rm_routetable", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_cognitivesearch/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "baa00bf3c1cd7f7a8ea685b173471ccdd925d75a520ee4d6ec8d96ea2c9d9239", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_cognitivesearch/meta", + "name": "tests/integration/targets/azure_rm_routetable/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_cognitivesearch/meta/main.yml", + "name": "tests/integration/targets/azure_rm_routetable/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachine", + "name": "tests/integration/targets/azure_rm_routetable/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "262ad6ab8a8087f2f21d4f26a2c2d02c347a7edf0fb1af8fdb931ab1c1087bbb", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_routetable/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachine/aliases", + "name": "tests/integration/targets/azure_rm_routetable/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "deefc8fe8e3699aa1e8852f316f52c0037219050b5b5d07919fa24d06ac14ed5", + "chksum_sha256": "fc81f5b6e7fae63d14a55e7c1c749a4a3d153b41a855118e814b3f2643904c14", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachine/tasks", + "name": "tests/integration/targets/azure_rm_roledefinition", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_no_nsg.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "21191e83b2ba1806e8f21eb88693cec6196c42f57bfe21732caa7743fe7ada1d", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_no_public_ip.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "220ce9a496dd09871db893cb671019cd529172f65ad99ebbc276c29d9a636b2f", + "name": "tests/integration/targets/azure_rm_roledefinition/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_image_specific.yml", + "name": "tests/integration/targets/azure_rm_roledefinition/meta/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "8bd990c699b676efd3c10984295efd6ecd4196d6731e0abb3e83e178be97881f", + "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_deallocate.yml", + "name": "tests/integration/targets/azure_rm_roledefinition/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "077fa2cdbbcdc6ebf667aeb177e25e4dd6228852a90ad47b64f3b561b0378449", + "chksum_sha256": "cc618d5714ddaae8f1482cf89dcf3327cf82fa378c16f6b5cf092339927261c3", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_ephemeral_os.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "47c62e68edbce76c046c9ee33c983775a500ed1bdf1a107398059552a3680942", + "name": "tests/integration/targets/azure_rm_roledefinition/tasks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/setup.yml", + "name": "tests/integration/targets/azure_rm_roledefinition/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "140b0bd768325fbe3148cfe81dd4a4002e07009fa651895c8647c36dc643838c", + "chksum_sha256": "821801ed627b59f6418e9073527531be7f66a7e6069cfd50df025e197af04485", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_minimal.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "5176d99917035c41c250d68271e54d236daa6c66e3dbc6e9608033144d822d07", + "name": "tests/integration/targets/azure_rm_virtualhubconnection", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_invalid.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "24eff79c0c7c5396967e5240f42f13f69dd00177d12bd52889beb323e738445a", + "name": "tests/integration/targets/azure_rm_virtualhubconnection/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_spot.yml", + "name": "tests/integration/targets/azure_rm_virtualhubconnection/meta/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "64879be6318be1cc70ca9af952868a4079485761ed64ec1266b1894fe876a632", + "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_minimal_manageddisk.yml", + "name": "tests/integration/targets/azure_rm_virtualhubconnection/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "de159eb438242efc5c51641147de79d61512f8617810472588830fc1f77abe5c", + "chksum_sha256": "b09e7a20443d9fe8e820607cf9ae826988c41fe890af049d025cb7eba9e4dbb0", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_image_latest.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "726f4a5feb22393286eb1d2b8ae72610b68dfe6e979473bd03bbee9c5eb55da9", + "name": "tests/integration/targets/azure_rm_virtualhubconnection/tasks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_public_ip.yml", + "name": "tests/integration/targets/azure_rm_virtualhubconnection/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "aa2de5de07ae296548865061238e55d4b15db2b6f9b4dcba1bf4dd9b4a36dfb9", + "chksum_sha256": "2d37e8ad199f86a0ff21d8af2a5eb5555b9cc8f8f2ecd7b6597b0c9645696050", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_dual_nic.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "64b8519ca7a160ae3ce6ccb1cca73a6c1038d7374ff6b4060aa6024b9cb0744c", + "name": "tests/integration/targets/azure_rm_azurefirewall", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachine/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "d765575a20e2788091b6cbade725e09e295a46aa42b6c9e7168daf3f507891c9", + "name": "tests/integration/targets/azure_rm_azurefirewall/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachine/inventory.yml", + "name": "tests/integration/targets/azure_rm_azurefirewall/meta/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "98a1bdc5892fa44ebbe6cd64550b850bf8fc61298de11c4d3bfd2f3d8621cd12", + "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachine/runme.sh", + "name": "tests/integration/targets/azure_rm_azurefirewall/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "8d9a70f8c75d9a856cd529ae8ccb6e589c0db9494da4bb08cead6963e98d9dd5", + "chksum_sha256": "c00350cca0b02532fa9ae31b5fdf0d5b963615b521197b71ac4cc024aac9d037", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_mariadbserver", + "name": "tests/integration/targets/azure_rm_azurefirewall/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_mariadbserver/aliases", + "name": "tests/integration/targets/azure_rm_azurefirewall/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "0f1123b3696957f55774d4316a4461182998975a0db1f960ef289b20b5e926c7", + "chksum_sha256": "99e09441ca9bb38a0844a3421ebdd6d6e496690d6aa853f111ec79d73108bef1", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_mariadbserver/tasks", + "name": "tests/integration/targets/azure_rm_webapp", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_mariadbserver/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "bf385689a7c4b6dbded1c113fe095815014e8a833c8f1f59aa2284df8caeee22", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_mariadbserver/meta", + "name": "tests/integration/targets/azure_rm_webapp/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_mariadbserver/meta/main.yml", + "name": "tests/integration/targets/azure_rm_webapp/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_devtestlab", + "name": "tests/integration/targets/azure_rm_webapp/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "75b6fa7694979e088e4b068016381f37a603045a395e3b8c660032f4008257d5", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_webapp/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_devtestlab/aliases", + "name": "tests/integration/targets/azure_rm_webapp/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "435162ac2df7aa373bc2d191a07d79c283d3891a1278b0277f85e6112b96fc03", + "chksum_sha256": "9c075ffff039ce42e02bf19ae7081bbfaa590fe56d36c10fe5552ade5e8d9964", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_devtestlab/tasks", + "name": "tests/integration/targets/azure_rm_aduser", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_devtestlab/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "7379179cad070c29d6055139c631d98000d6ea15dd271aeba5c997677de00985", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_devtestlab/meta", + "name": "tests/integration/targets/azure_rm_aduser/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_devtestlab/meta/main.yml", + "name": "tests/integration/targets/azure_rm_aduser/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_multiplemanageddisks", + "name": "tests/integration/targets/azure_rm_aduser/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1658975f0508387cde4cda499d7eb9524e31bc2f02cc49d6483d7e210d991234", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_aduser/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_multiplemanageddisks/aliases", + "name": "tests/integration/targets/azure_rm_aduser/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ea124e6a615561c87b4dd84d829b1eb1d2bd1658d1caf6211019eeda3ffc8136", + "chksum_sha256": "5d5d5fecd3bd106cc7e4ea4412f28e287297cbd7f7c5699f4ed5e27c60d25610", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_multiplemanageddisks/tasks", + "name": "tests/integration/targets/azure_rm_virtualnetworkpeering", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_multiplemanageddisks/tasks/test_async.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "734d43b960ffc7db235dde46ac78131614571043f2fccf7194fda91ef4158e80", + "name": "tests/integration/targets/azure_rm_virtualnetworkpeering/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_multiplemanageddisks/tasks/main.yml", + "name": "tests/integration/targets/azure_rm_virtualnetworkpeering/meta/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "be8b2a1ea6a137dff449749ad05389cc76d9507a31b1936354e4b6a5643fe871", + "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_multiplemanageddisks/tasks/test_shared.yml", + "name": "tests/integration/targets/azure_rm_virtualnetworkpeering/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "436fa42bc89d6926a91254d61ebc57a87df84cbe54519f546b9fccd86b0f38b8", + "chksum_sha256": "ee3b904aa8ab8d0a7e47983927157b420c195fe1d8606de015158339e7824a43", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_multiplemanageddisks/templates", + "name": "tests/integration/targets/azure_rm_virtualnetworkpeering/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_multiplemanageddisks/templates/disk_config.j2", + "name": "tests/integration/targets/azure_rm_virtualnetworkpeering/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d52e27205862487e08375c08ac7c8aa27c059db63c3fb83ebb8dd8eb0e7e11f6", + "chksum_sha256": "2fb7b589b1c4bd6ed3778e220fe5be14d351534db03c1473e45f03fd181cf0ac", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_multiplemanageddisks/meta", + "name": "tests/integration/targets/azure_rm_cosmosdbaccount", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_multiplemanageddisks/meta/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_multiplemanageddisks/defaults", + "name": "tests/integration/targets/azure_rm_cosmosdbaccount/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_multiplemanageddisks/defaults/main.yml", + "name": "tests/integration/targets/azure_rm_cosmosdbaccount/meta/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e74506a8cfbf91887befefae0b179455f0071b5d904b30c00b67897373123b23", + "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_account_info", + "name": "tests/integration/targets/azure_rm_cosmosdbaccount/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d9b370414fbcd599ba1e1fa7adb52887e0df75d2ffce2a609bd5af743b02f600", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_cosmosdbaccount/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_account_info/aliases", + "name": "tests/integration/targets/azure_rm_cosmosdbaccount/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "a58bdac3b7068e244f2cf71f0a1a0bf136bc8785d2a8947fecbafdd97313adb7", + "chksum_sha256": "e44d0c16980fee5a6cca7dc10c26e4bb487b761eb6aa87c5cee17e527c37453d", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_account_info/tasks", + "name": "tests/integration/targets/azure_rm_loadbalancer", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_account_info/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "11c0ebfdf8010257f9bfcbb31b1210ea509fe8f49d14436557fec6778617bb35", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_account_info/meta", + "name": "tests/integration/targets/azure_rm_loadbalancer/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_account_info/meta/main.yml", + "name": "tests/integration/targets/azure_rm_loadbalancer/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_webapp", + "name": "tests/integration/targets/azure_rm_loadbalancer/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "923b442d786cff06e0b7a3ea4232f7bfe10835e93fb73b8df6ee997380099420", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_loadbalancer/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_webapp/aliases", + "name": "tests/integration/targets/azure_rm_loadbalancer/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "75b6fa7694979e088e4b068016381f37a603045a395e3b8c660032f4008257d5", + "chksum_sha256": "6b6dc390a0291155225b4305560c255bf3a36be60542213e2ad2fcc6fb9daf94", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_webapp/tasks", + "name": "tests/integration/targets/azure_rm_multiplemanageddisks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_webapp/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "58917acf9278716057d2176e0b31da97cd7755ef63b71187bdea74c5fe093ada", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_webapp/meta", + "name": "tests/integration/targets/azure_rm_multiplemanageddisks/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_webapp/meta/main.yml", + "name": "tests/integration/targets/azure_rm_multiplemanageddisks/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_mysqlserver", + "name": "tests/integration/targets/azure_rm_multiplemanageddisks/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ea124e6a615561c87b4dd84d829b1eb1d2bd1658d1caf6211019eeda3ffc8136", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_multiplemanageddisks/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_mysqlserver/aliases", + "name": "tests/integration/targets/azure_rm_multiplemanageddisks/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "2c74420c4bc9cc5d8af14406a1d97ea762c6b8afa4de8728a4a833b2e742cf41", + "chksum_sha256": "8e23e36b5f9691d484992b8472b963aa9265f9e12c2b5eace4da7b532d66c3db", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_mysqlserver/tasks", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, + "name": "tests/integration/targets/azure_rm_multiplemanageddisks/tasks/test_async.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c7047ff5651f3faf6ac16b87e5434fd16dae5a620b45ed55723a208b27b9d4bc", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_mysqlserver/tasks/main.yml", + "name": "tests/integration/targets/azure_rm_multiplemanageddisks/tasks/test_shared.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "2803b32a2a95737e3838dfb137e4909b1a1268568c268920297cdbcc95773cd2", + "chksum_sha256": "347f0eb7c19d4e9cb7070d4eff76a456f649df4792a590d75b0258643d1c4282", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_mysqlserver/meta", + "name": "tests/integration/targets/azure_rm_multiplemanageddisks/defaults", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_mysqlserver/meta/main.yml", + "name": "tests/integration/targets/azure_rm_multiplemanageddisks/defaults/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", + "chksum_sha256": "e74506a8cfbf91887befefae0b179455f0071b5d904b30c00b67897373123b23", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_aks", + "name": "tests/integration/targets/azure_rm_multiplemanageddisks/templates", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_aks/aliases", + "name": "tests/integration/targets/azure_rm_multiplemanageddisks/templates/disk_config.j2", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "783d6dbd1b9cc4b0543d6e96d15206283018e0c291764a2a4106e860d41cb210", + "chksum_sha256": "d52e27205862487e08375c08ac7c8aa27c059db63c3fb83ebb8dd8eb0e7e11f6", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_aks/tasks", + "name": "tests/integration/targets/azure_rm_virtualwan", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_aks/tasks/minimal-cluster.yml", + "name": "tests/integration/targets/azure_rm_virtualwan/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_virtualwan/meta/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "25a42e35f5f43fb98379902f469b6da0cd3c2f49003815d54684bce5a4433745", + "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_aks/tasks/main.yml", + "name": "tests/integration/targets/azure_rm_virtualwan/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "6a870c4f3517f812f6ec72649e4fa0e030cd2e3f3d96a11e74e75afe64142b84", + "chksum_sha256": "b09e7a20443d9fe8e820607cf9ae826988c41fe890af049d025cb7eba9e4dbb0", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_aks/meta", + "name": "tests/integration/targets/azure_rm_virtualwan/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_aks/meta/main.yml", + "name": "tests/integration/targets/azure_rm_virtualwan/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", + "chksum_sha256": "9ab3ddca93908d5c847cccd627d21e6dd17c1d4c24cfe0f06331431717be8bfd", "format": 1 }, { @@ -3396,6 +3361,20 @@ "format": 1 }, { + "name": "tests/integration/targets/azure_rm_openshiftmanagedcluster/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_openshiftmanagedcluster/meta/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", + "format": 1 + }, + { "name": "tests/integration/targets/azure_rm_openshiftmanagedcluster/aliases", "ftype": "file", "chksum_type": "sha256", @@ -3413,339 +3392,311 @@ "name": "tests/integration/targets/azure_rm_openshiftmanagedcluster/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "601cccaad8ac15018cda761e360e04a19e31cffb2232c7705b605899f5aca414", + "chksum_sha256": "3265ddca3e6f3be968be4b2d516c453c1c305f010ef7f1ab4deb0d9d70bb03eb", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_openshiftmanagedcluster/meta", + "name": "tests/integration/targets/azure_rm_trafficmanagerprofile", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_openshiftmanagedcluster/meta/main.yml", + "name": "tests/integration/targets/azure_rm_trafficmanagerprofile/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_trafficmanagerprofile/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_servicebus", + "name": "tests/integration/targets/azure_rm_trafficmanagerprofile/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b34b028873420b7fdba3b5e4f0b3a1283d3879fcf1ee2d91dbe8a732651ca04a", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_trafficmanagerprofile/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_servicebus/aliases", + "name": "tests/integration/targets/azure_rm_trafficmanagerprofile/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "923b442d786cff06e0b7a3ea4232f7bfe10835e93fb73b8df6ee997380099420", + "chksum_sha256": "d48b39bfcd3c3f106af3c9eedcc4005c40eb6642ce232ae4f834c93875ee74e9", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_servicebus/tasks", + "name": "tests/integration/targets/azure_rm_natgateway", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_servicebus/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "b3ab66c8990eb64d0b1a23ba04db9b5a9cd34306079309d30b89bf2f1cbf6f2b", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_servicebus/meta", + "name": "tests/integration/targets/azure_rm_natgateway/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_servicebus/meta/main.yml", + "name": "tests/integration/targets/azure_rm_natgateway/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_workspace", + "name": "tests/integration/targets/azure_rm_natgateway/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "21442459796e3c03ab3c6461c8251810f5545ff2320c4c814cce8b8c520e615c", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_natgateway/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_workspace/aliases", + "name": "tests/integration/targets/azure_rm_natgateway/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "08cf46c06f61ba50ecd182f45dfcf2ad7529f1df439d0ca713a8ceba58e14c99", + "chksum_sha256": "b0c6592fbe22d552060e636b988771db2fe2e14e50462d4ab5589a8f3f4f8e9f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_workspace/tasks", + "name": "tests/integration/targets/azure_rm_appgateway", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_workspace/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "f2f2f5b5e5aed797d31f27f3ffe873d3885d1c84f3303e2f114091620e74110e", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_workspace/meta", + "name": "tests/integration/targets/azure_rm_appgateway/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_workspace/meta/main.yml", + "name": "tests/integration/targets/azure_rm_appgateway/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_ipgroup", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_ipgroup/aliases", + "name": "tests/integration/targets/azure_rm_appgateway/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b09e7a20443d9fe8e820607cf9ae826988c41fe890af049d025cb7eba9e4dbb0", + "chksum_sha256": "21442459796e3c03ab3c6461c8251810f5545ff2320c4c814cce8b8c520e615c", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_ipgroup/tasks", + "name": "tests/integration/targets/azure_rm_appgateway/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_ipgroup/tasks/main.yml", + "name": "tests/integration/targets/azure_rm_appgateway/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e540f16042dc4b7421f84f0b409a87c99bac21cabcedabf9a45c7dae3e93d38d", + "chksum_sha256": "7d8ffa4ec62e8b5bcf85c4c36004a71daf4b8bf455238a1b6a8a1749fd64bd4d", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_ipgroup/meta", + "name": "tests/integration/targets/azure_rm_appgateway/files", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_ipgroup/meta/main.yml", + "name": "tests/integration/targets/azure_rm_appgateway/files/cert3b64.txt", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", + "chksum_sha256": "1375dc6f493fb760c6087c4cdd62c4ea898887070ad17dc84196b3d6ed0545ec", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_storageblob", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, + "name": "tests/integration/targets/azure_rm_appgateway/files/cert1.txt", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7637ce7f36cca366294688f612f6456714088cca19583ae7e9475e572d85f4f5", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_storageblob/aliases", + "name": "tests/integration/targets/azure_rm_appgateway/files/cert2.txt", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "109bb8ece8ca54a061f03f7050aca3401610606b79a6e313d2556dcb04fda637", + "chksum_sha256": "e4dc34faa2e8e94cd385be73c33a849f452dd57d061a8aec118e6d391e46bbc0", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_storageblob/tasks", + "name": "tests/integration/targets/azure_rm_virtualmachinescaleset", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_storageblob/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "2edc512654e17a39d5fd83d0fd5a173f243bea75995ec29b7647fc0143dc4e19", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_storageblob/meta", + "name": "tests/integration/targets/azure_rm_virtualmachinescaleset/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_storageblob/meta/main.yml", + "name": "tests/integration/targets/azure_rm_virtualmachinescaleset/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_storageblob/files", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_storageblob/files/Ratings.png", + "name": "tests/integration/targets/azure_rm_virtualmachinescaleset/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "20cdf86ae984fb64eefdc57a0e03f34c83cb8b27834b33c84768cc2b62cf9d68", + "chksum_sha256": "5510a946bf7e1d1ad196eaa73474176b122ae491702a99f9160ad1d554fc08bf", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privateendpointdnszonegroup", + "name": "tests/integration/targets/azure_rm_virtualmachinescaleset/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privateendpointdnszonegroup/aliases", + "name": "tests/integration/targets/azure_rm_virtualmachinescaleset/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "11c35de489a3da87eb40a2ce00a80a9992fc89c3b3fdee710301ba9faacd332d", + "chksum_sha256": "088fc01b37760ce34fafbf49d9cad124a44df1c8390c23c58480447c275bb9a5", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privateendpointdnszonegroup/tasks", + "name": "tests/integration/targets/azure_rm_datalakestore", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privateendpointdnszonegroup/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "d496f16d0aa619a4e8961628d51c436b747c062e6dd7456d6ab19782ca1680d0", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_privateendpointdnszonegroup/meta", + "name": "tests/integration/targets/azure_rm_datalakestore/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privateendpointdnszonegroup/meta/main.yml", + "name": "tests/integration/targets/azure_rm_datalakestore/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_webappaccessrestriction", + "name": "tests/integration/targets/azure_rm_datalakestore/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b09e7a20443d9fe8e820607cf9ae826988c41fe890af049d025cb7eba9e4dbb0", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_datalakestore/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_webappaccessrestriction/aliases", + "name": "tests/integration/targets/azure_rm_datalakestore/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "262ad6ab8a8087f2f21d4f26a2c2d02c347a7edf0fb1af8fdb931ab1c1087bbb", + "chksum_sha256": "2d7c9df4757ded6e5d8fdb419854a55eb85d7782884e81548d299a795998daa6", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_webappaccessrestriction/tasks", + "name": "tests/integration/targets/azure_rm_functionapp", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_webappaccessrestriction/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "0e186aa6d7f0968de08490f3eb4a764f6723d2c5c686cc48ca2aaf8c3a582e45", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_webappaccessrestriction/meta", + "name": "tests/integration/targets/azure_rm_functionapp/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_webappaccessrestriction/meta/main.yml", + "name": "tests/integration/targets/azure_rm_functionapp/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachinesize_info", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_virtualmachinesize_info/aliases", + "name": "tests/integration/targets/azure_rm_functionapp/aliases", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "262ad6ab8a8087f2f21d4f26a2c2d02c347a7edf0fb1af8fdb931ab1c1087bbb", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachinesize_info/tasks", + "name": "tests/integration/targets/azure_rm_functionapp/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachinesize_info/tasks/main.yml", + "name": "tests/integration/targets/azure_rm_functionapp/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "f72cf8c42cd894dbfb720af369e9a548258c813fb6021ebbc42ab7daf7e17521", + "chksum_sha256": "a5d18ded0b871348c349b69152916bc7b243670fdc7ec9a2f8ab479ce589e390", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachinesize_info/meta", + "name": "tests/integration/targets/azure_rm_subnet", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachinesize_info/meta/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "86ade1ce7ec530fef84440672efaf3b60c253946bb82f5f0a134a9691bc6ffad", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_subnet", + "name": "tests/integration/targets/azure_rm_subnet/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { + "name": "tests/integration/targets/azure_rm_subnet/meta/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", + "format": 1 + }, + { "name": "tests/integration/targets/azure_rm_subnet/aliases", "ftype": "file", "chksum_type": "sha256", @@ -3763,409 +3714,381 @@ "name": "tests/integration/targets/azure_rm_subnet/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e6e7ac2b9d8dcdb484f8f6a6fd6d594aea99e0955f517714fd0a94abb4a2abba", + "chksum_sha256": "6da3c97478624fb4d675d4787caedba75a8b159228bc39d6fccdd3db6a333c78", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_subnet/meta", + "name": "tests/integration/targets/azure_rm_ipgroup", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_subnet/meta/main.yml", + "name": "tests/integration/targets/azure_rm_ipgroup/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_ipgroup/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_automationaccount", + "name": "tests/integration/targets/azure_rm_ipgroup/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b09e7a20443d9fe8e820607cf9ae826988c41fe890af049d025cb7eba9e4dbb0", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_ipgroup/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_automationaccount/aliases", + "name": "tests/integration/targets/azure_rm_ipgroup/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "87c7ae7077faea9533bb827344f49dadfecfdbc5ea179058d72f7bad3ae81388", + "chksum_sha256": "b2d66c35aafd2720cb487010156156302c28f3cd0e20fcfbed1a98d2ed42601f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_automationaccount/tasks", + "name": "tests/integration/targets/azure_rm_adserviceprincipal", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_automationaccount/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "1b024b67a5cacec07205761b9497728f87eea706335ae8807cbebe0d046a36e1", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_automationaccount/meta", + "name": "tests/integration/targets/azure_rm_adserviceprincipal/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_automationaccount/meta/main.yml", + "name": "tests/integration/targets/azure_rm_adserviceprincipal/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_iothub", + "name": "tests/integration/targets/azure_rm_adserviceprincipal/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "528893af1cac01f38ab277aec0138b83c74b2576464d96eb7f3da330784edaff", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_adserviceprincipal/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_iothub/aliases", + "name": "tests/integration/targets/azure_rm_adserviceprincipal/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "109bb8ece8ca54a061f03f7050aca3401610606b79a6e313d2556dcb04fda637", + "chksum_sha256": "4a0a40666b1bd4ba719d5da58b623587b330007a776cac80dcd1d55df48a34ad", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_iothub/tasks", + "name": "tests/integration/targets/azure_rm_privatelinkservice", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_iothub/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "3a4b7fbea53b2ac97764fa79a83a290cba2534d195f8c7b1e8e2ec8fcb233f69", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_iothub/meta", + "name": "tests/integration/targets/azure_rm_privatelinkservice/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_iothub/meta/main.yml", + "name": "tests/integration/targets/azure_rm_privatelinkservice/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_subscription", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_subscription/aliases", + "name": "tests/integration/targets/azure_rm_privatelinkservice/aliases", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "109bb8ece8ca54a061f03f7050aca3401610606b79a6e313d2556dcb04fda637", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_subscription/tasks", + "name": "tests/integration/targets/azure_rm_privatelinkservice/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_subscription/tasks/main.yml", + "name": "tests/integration/targets/azure_rm_privatelinkservice/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "2a7ba246fec2015e9ec84aad7e917f0b752d09d113666ce2ba9c1530671a9a22", + "chksum_sha256": "26d7dc158898d9dbc017b66108ef335ff0b4a5ba01d2566cecbec6ad767763be", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_subscription/meta", + "name": "tests/integration/targets/azure_rm_workspace", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_subscription/meta/main.yml", + "name": "tests/integration/targets/azure_rm_workspace/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_workspace/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_availabilityset", + "name": "tests/integration/targets/azure_rm_workspace/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "08cf46c06f61ba50ecd182f45dfcf2ad7529f1df439d0ca713a8ceba58e14c99", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_workspace/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_availabilityset/aliases", + "name": "tests/integration/targets/azure_rm_workspace/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "5647901b6198849a4dd58b7fb51aee85b889220f80acde88cea67bffff453d8d", + "chksum_sha256": "7ce589f76321d7c707ac86920720af5574f0d3e3685ef6c9aec9987393a09172", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_availabilityset/tasks", + "name": "tests/integration/targets/azure_rm_sqlmanagedinstance", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_availabilityset/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "c30b16aa5ebe6fdabe4fd9b9cdf0b6dbc4c2b446c8b0e99a19dea16ecc99d3f4", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_availabilityset/meta", + "name": "tests/integration/targets/azure_rm_sqlmanagedinstance/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_availabilityset/meta/main.yml", + "name": "tests/integration/targets/azure_rm_sqlmanagedinstance/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_functionapp", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_functionapp/aliases", + "name": "tests/integration/targets/azure_rm_sqlmanagedinstance/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "262ad6ab8a8087f2f21d4f26a2c2d02c347a7edf0fb1af8fdb931ab1c1087bbb", + "chksum_sha256": "d19280a8d5d5c2523536ea5aed2c5a14d1b19cc49f3f21974ca3e9a9921bb7cd", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_functionapp/tasks", + "name": "tests/integration/targets/azure_rm_sqlmanagedinstance/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_functionapp/tasks/main.yml", + "name": "tests/integration/targets/azure_rm_sqlmanagedinstance/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "08e8580923076560eb7f8dd2ab853c99b331bf840655f676a0185cb0e5550786", + "chksum_sha256": "561193b252168d2eca301ab2c0f673e1a99acc2c807b9f9e8679f1e3b7058d5e", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_functionapp/meta", + "name": "tests/integration/targets/inventory_azure", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_functionapp/meta/main.yml", + "name": "tests/integration/targets/inventory_azure/runme.sh", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", + "chksum_sha256": "203fe16581a305486f7d5a2feafad324ed5515a96c26b4f4d84ab34a1cdcb6a3", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_image", + "name": "tests/integration/targets/inventory_azure/playbooks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_image/aliases", + "name": "tests/integration/targets/inventory_azure/playbooks/create_inventory_config.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "fca45b39c1e6a21b8fb8e1b6c8f5954d8accf0bc6fa436361d75b014b36a8fd6", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_image/tasks", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, + "chksum_sha256": "96709396441733bc7e0001d045f1f825170489df8eae9cfdb677722f70e034be", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_image/tasks/main.yml", + "name": "tests/integration/targets/inventory_azure/playbooks/empty_inventory_config.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "2dd2291b8998e049919a4f19eb92b7b0165845c98230249250eb8cf71edbeb54", + "chksum_sha256": "86545d143dd65f74a63218943018bfad054837e6c813fd396442957c89e87a62", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_image/meta", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, + "name": "tests/integration/targets/inventory_azure/playbooks/teardown.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1f44c8ef223d0219855c453cd859b44b7cd4b2fa10fb1f8cacac75e020975fc8", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_image/meta/main.yml", + "name": "tests/integration/targets/inventory_azure/playbooks/setup.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", + "chksum_sha256": "e95740d1317dda6c7a610a482d33b29e2035293ff74e10a2bcc0f2997ba85430", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_managementgroup", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, + "name": "tests/integration/targets/inventory_azure/playbooks/vars.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "23fff20fb969471888915a24760b7a90723a30e3e0e6b7c7745864470c898027", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_managementgroup/aliases", + "name": "tests/integration/targets/inventory_azure/playbooks/test_inventory.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e7fc1f0b30d75ba7b3a8f5a9a45a7703c06585edc0f3ce9231a9b2ca7a649864", + "chksum_sha256": "40807db8218dfb3bc6b2f926c7c0ee573ddd6f6ac5b7eb3aa4cd8d013195639b", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_managementgroup/tasks", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, + "name": "tests/integration/targets/inventory_azure/test.azure_rm.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_managementgroup/tasks/main.yml", + "name": "tests/integration/targets/inventory_azure/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "9bbc4f4b4ca0601a10dca24bc664363538736a8c80f70553e1f4f80d1a66c56b", + "chksum_sha256": "e2e2f39006f1e6b83660c469a9c29e1dfb17b99cca9caa124626e14cd0658a0b", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_managementgroup/meta", + "name": "tests/integration/targets/inventory_azure/templates", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_managementgroup/meta/main.yml", + "name": "tests/integration/targets/inventory_azure/templates/basic.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_trafficmanagerprofile", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, + "chksum_sha256": "3f99d3d1c0b4f896b1f43477667fc744c2cd2d38471c5bbc9287773b57682628", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_trafficmanagerprofile/aliases", + "name": "tests/integration/targets/inventory_azure/templates/basic2.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b34b028873420b7fdba3b5e4f0b3a1283d3879fcf1ee2d91dbe8a732651ca04a", + "chksum_sha256": "758f6dfaa158a3601eb9cd986357f1a40a04071ad62f3ba613002ffde00d6018", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_trafficmanagerprofile/tasks", + "name": "tests/integration/targets/azure_rm_vmbackuppolicy", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_trafficmanagerprofile/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "1a654c2c02f89f415a85b255516d76fd5aec7096a256c20f1d2daa4b39209bb3", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_trafficmanagerprofile/meta", + "name": "tests/integration/targets/azure_rm_vmbackuppolicy/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_trafficmanagerprofile/meta/main.yml", + "name": "tests/integration/targets/azure_rm_vmbackuppolicy/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_bastionhost", + "name": "tests/integration/targets/azure_rm_vmbackuppolicy/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "923b442d786cff06e0b7a3ea4232f7bfe10835e93fb73b8df6ee997380099420", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_vmbackuppolicy/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_bastionhost/aliases", + "name": "tests/integration/targets/azure_rm_vmbackuppolicy/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d57abe6f8fb0cbfb8ac22431c09126cd48bb4d2836a6d151faf92fb6fbecc6aa", + "chksum_sha256": "e990393d47f344ab98b507415273d6ec89117b52b4feba04783ab07d792e7243", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_bastionhost/tasks", + "name": "tests/integration/targets/azure_rm_firewallpolicy", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_bastionhost/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "ef98e39895f3892d2e977cc4a79ca2aea6c6bd61fb6dbc8a31774a765d9940ed", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_bastionhost/meta", + "name": "tests/integration/targets/azure_rm_firewallpolicy/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_bastionhost/meta/main.yml", + "name": "tests/integration/targets/azure_rm_firewallpolicy/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_firewallpolicy", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, - "format": 1 - }, - { "name": "tests/integration/targets/azure_rm_firewallpolicy/aliases", "ftype": "file", "chksum_type": "sha256", @@ -4183,3031 +4106,3171 @@ "name": "tests/integration/targets/azure_rm_firewallpolicy/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b06b43e022f24167d8d145bbf99d8289974eeb358f61f554ba58df26a36eb1c1", + "chksum_sha256": "83fbfafaa9f1fc5fddcfa245b6911f0e659bbe7ec05431f59ed455b2b7b0298c", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_firewallpolicy/meta", + "name": "tests/integration/targets/azure_rm_resource", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_firewallpolicy/meta/main.yml", + "name": "tests/integration/targets/azure_rm_resource/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_resource/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_appserviceplan", + "name": "tests/integration/targets/azure_rm_resource/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b9685232ad3eab40ee59426a3dd04a8f71719dbfa1d6becb498bb416c8d1ff1c", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_resource/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_appserviceplan/aliases", + "name": "tests/integration/targets/azure_rm_resource/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "3d8b505b037b869206fe23e768d9d42e48dc8db7c83ac3023ec1be689261f907", + "chksum_sha256": "e51cbf401d0da7fb038fade492b102a3493b57c0c0e4f9ca927d726db890c4df", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_appserviceplan/tasks", + "name": "tests/integration/targets/azure_rm_adpassword", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_appserviceplan/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "a8bed0c09ce07686ed97137363a429a5449b364fecc25457c881d26e61e97634", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_appserviceplan/meta", + "name": "tests/integration/targets/azure_rm_adpassword/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_appserviceplan/meta/main.yml", + "name": "tests/integration/targets/azure_rm_adpassword/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualnetworkgateway", + "name": "tests/integration/targets/azure_rm_adpassword/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0e90b0bd13c40122b87176faa412a83730dcc85c0060dffa0d7b0450d559ed40", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_adpassword/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualnetworkgateway/aliases", + "name": "tests/integration/targets/azure_rm_adpassword/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "4f59a6f1fc64a79191d0110c2f203adee747fd1bb69ad631a279efa7d370eaec", + "chksum_sha256": "448a3e37f44ca7e199c6184fedaf40e24a648ed1b1b2763b40d5c34e2763adfc", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualnetworkgateway/tasks", + "name": "tests/integration/targets/azure_rm_diskencryptionset", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualnetworkgateway/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "e0006451e2b966266a67a1aebf9f2d648e016828447550f0f083a76ace66dfe5", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_virtualnetworkgateway/meta", + "name": "tests/integration/targets/azure_rm_diskencryptionset/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualnetworkgateway/meta/main.yml", + "name": "tests/integration/targets/azure_rm_diskencryptionset/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_publicipaddress", + "name": "tests/integration/targets/azure_rm_diskencryptionset/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b09e7a20443d9fe8e820607cf9ae826988c41fe890af049d025cb7eba9e4dbb0", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_diskencryptionset/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_publicipaddress/aliases", + "name": "tests/integration/targets/azure_rm_diskencryptionset/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ed3159c0b56e6e42548ed58456e5304d48aea0b4e3a0999591f863ae79b225ba", + "chksum_sha256": "7a0a7e26e52f22c56e37dcc3154036297160820fe9bfdc27f6b5fb5811e84e9b", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_publicipaddress/tasks", + "name": "tests/integration/targets/azure_rm_diskencryptionset/lookup_plugins", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_publicipaddress/tasks/main.yml", + "name": "tests/integration/targets/azure_rm_diskencryptionset/lookup_plugins/azure_service_principal_attribute.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "2c35780d3e24b7197e278387511cefb3fcacd33779a474978c79d556c9f5d214", + "chksum_sha256": "ecf5403290d75ebf93dd07c1a0d1ec251482cde7952d5fc4c1f51ecde936e804", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_publicipaddress/meta", + "name": "tests/integration/targets/azure_rm_mariadbserver", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_publicipaddress/meta/main.yml", + "name": "tests/integration/targets/azure_rm_mariadbserver/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_mariadbserver/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualhub", + "name": "tests/integration/targets/azure_rm_mariadbserver/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0f1123b3696957f55774d4316a4461182998975a0db1f960ef289b20b5e926c7", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_mariadbserver/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualhub/aliases", + "name": "tests/integration/targets/azure_rm_mariadbserver/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b09e7a20443d9fe8e820607cf9ae826988c41fe890af049d025cb7eba9e4dbb0", + "chksum_sha256": "b829d34d571be3c848284902c00755a940e2a629115fbbd3a78af1ce018a0ede", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualhub/tasks", + "name": "tests/integration/targets/azure_rm_batchaccount", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualhub/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "4a7c4f53ae8ca7dd799b96fc7a093376c5bd4180045c990eedbaadcd4314d30e", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_virtualhub/meta", + "name": "tests/integration/targets/azure_rm_batchaccount/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualhub/meta/main.yml", + "name": "tests/integration/targets/azure_rm_batchaccount/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_monitorlogprofile", + "name": "tests/integration/targets/azure_rm_batchaccount/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "049e0b8480c14a44ea8525b83848582417405cd5352a0afc5fc9bc3f1c0f3941", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_batchaccount/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_monitorlogprofile/aliases", + "name": "tests/integration/targets/azure_rm_batchaccount/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "cc618d5714ddaae8f1482cf89dcf3327cf82fa378c16f6b5cf092339927261c3", + "chksum_sha256": "f37479ad82f6ad6db65b64e25816f268071345bbfcd8f168ce2af930d0f99375", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_monitorlogprofile/tasks", + "name": "tests/integration/targets/azure_rm_autoscale", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_monitorlogprofile/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "bcb0cc259330b2575654edbc4c0451ee9a329e28fec78eab3c1d68bf9df418ca", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_monitorlogprofile/meta", + "name": "tests/integration/targets/azure_rm_autoscale/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_monitorlogprofile/meta/main.yml", + "name": "tests/integration/targets/azure_rm_autoscale/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_recoveryservicesvault", + "name": "tests/integration/targets/azure_rm_autoscale/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2019d6f29a1dbe1242200ff0a0485722bc57431db8265a741c5e501cd5a920dd", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_autoscale/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_recoveryservicesvault/aliases", + "name": "tests/integration/targets/azure_rm_autoscale/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "923b442d786cff06e0b7a3ea4232f7bfe10835e93fb73b8df6ee997380099420", + "chksum_sha256": "c5faa6f6e4e1a6f51493f745f616201b1ed3447db1ec85f60ae676b8ecd334a0", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_recoveryservicesvault/tasks", + "name": "tests/integration/targets/azure_rm_virtualmachineimage_info", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_recoveryservicesvault/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "be03a728e66a55b15c137fce7592331229fbffd37fccc0a54db98a58693c7143", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_recoveryservicesvault/meta", + "name": "tests/integration/targets/azure_rm_virtualmachineimage_info/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_recoveryservicesvault/meta/main.yml", + "name": "tests/integration/targets/azure_rm_virtualmachineimage_info/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_expressroute", + "name": "tests/integration/targets/azure_rm_virtualmachineimage_info/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8eb6da86566844e8278692f99177c27f5e17dfc808484e9168d842ce4ea822b2", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_virtualmachineimage_info/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_expressroute/aliases", + "name": "tests/integration/targets/azure_rm_virtualmachineimage_info/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b09e7a20443d9fe8e820607cf9ae826988c41fe890af049d025cb7eba9e4dbb0", + "chksum_sha256": "c1027dcaf3ce2f749a07c7b78ee56ff713901f0fa792e08ebfc2c31671426a1c", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_expressroute/tasks", + "name": "tests/integration/targets/azure_rm_rediscache", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_expressroute/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "bbcef6a2061617b1ff6d3d158d0c78a55ac7e993e4e7ab0d584817ead1a1d043", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_expressroute/meta", + "name": "tests/integration/targets/azure_rm_rediscache/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_expressroute/meta/main.yml", + "name": "tests/integration/targets/azure_rm_rediscache/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_apimanagementservice", + "name": "tests/integration/targets/azure_rm_rediscache/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5ba0bf8a7bf29813d54b53fd7c3e65698ee5f802eb2ccf76c1707680acc07f17", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_rediscache/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_apimanagementservice/aliases", + "name": "tests/integration/targets/azure_rm_rediscache/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "528893af1cac01f38ab277aec0138b83c74b2576464d96eb7f3da330784edaff", + "chksum_sha256": "60978e58b15da724fb1f16447071e7b33add290150dfbdd4173900c4edda9a91", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_apimanagementservice/tasks", + "name": "tests/integration/targets/azure_rm_appserviceplan", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_apimanagementservice/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "00beef6f868cdbf51ff2e042703c071e86bffbe6c3cc1beb22206bf3c14295a5", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_apimanagementservice/meta", + "name": "tests/integration/targets/azure_rm_appserviceplan/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_apimanagementservice/meta/main.yml", + "name": "tests/integration/targets/azure_rm_appserviceplan/meta/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "86ade1ce7ec530fef84440672efaf3b60c253946bb82f5f0a134a9691bc6ffad", + "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_gallery", + "name": "tests/integration/targets/azure_rm_appserviceplan/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3d8b505b037b869206fe23e768d9d42e48dc8db7c83ac3023ec1be689261f907", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_appserviceplan/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_gallery/aliases", + "name": "tests/integration/targets/azure_rm_appserviceplan/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e676d2331077a7a453c2694fef48b0b56195d00e5a1009e3f668a7e174abd16b", + "chksum_sha256": "f3fd1981d472300a8b2044ffbd73e928a089c2d81b3c09d7d5dff19c5d6cd544", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_gallery/tasks", + "name": "tests/integration/targets/azure_rm_virtualnetworkgateway", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_gallery/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "cf595e8d122e1ea83685f48709c3527c46c0b27ed42da07240dcf5292ca92671", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_gallery/meta", + "name": "tests/integration/targets/azure_rm_virtualnetworkgateway/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_gallery/meta/main.yml", + "name": "tests/integration/targets/azure_rm_virtualnetworkgateway/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_webappvnetconnection", + "name": "tests/integration/targets/azure_rm_virtualnetworkgateway/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4f59a6f1fc64a79191d0110c2f203adee747fd1bb69ad631a279efa7d370eaec", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_virtualnetworkgateway/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_webappvnetconnection/aliases", + "name": "tests/integration/targets/azure_rm_virtualnetworkgateway/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "262ad6ab8a8087f2f21d4f26a2c2d02c347a7edf0fb1af8fdb931ab1c1087bbb", + "chksum_sha256": "271094dd7a4e013c0da515000e4e6257bb716cf030c89dbe37af7ca74902841d", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_webappvnetconnection/tasks", + "name": "tests/integration/targets/azure_rm_webappaccessrestriction", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_webappvnetconnection/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "790f3c15bd2fa9ba2013a707b5ffb5996c1562bff7b9886e7c85c05fd327ab7f", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_webappvnetconnection/meta", + "name": "tests/integration/targets/azure_rm_webappaccessrestriction/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_webappvnetconnection/meta/main.yml", + "name": "tests/integration/targets/azure_rm_webappaccessrestriction/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privatednsrecordset", + "name": "tests/integration/targets/azure_rm_webappaccessrestriction/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "262ad6ab8a8087f2f21d4f26a2c2d02c347a7edf0fb1af8fdb931ab1c1087bbb", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_webappaccessrestriction/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privatednsrecordset/aliases", + "name": "tests/integration/targets/azure_rm_webappaccessrestriction/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "36614727374728e26b5686e9fac66641e5b9c268b6945f2dcd1b4a9c4d2232c3", + "chksum_sha256": "23178ef47e9dbb43a51984becf44d72972a399952958fd2a76d71d6338864252", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privatednsrecordset/tasks", + "name": "tests/integration/targets/azure_rm_ddosprotectionplan", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privatednsrecordset/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "e8c0c21655e769226d1dabcfc309afff1d8c8a90780ec48cd45bc5f5eb53e7c2", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_privatednsrecordset/meta", + "name": "tests/integration/targets/azure_rm_ddosprotectionplan/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privatednsrecordset/meta/main.yml", + "name": "tests/integration/targets/azure_rm_ddosprotectionplan/meta/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", + "chksum_sha256": "a66dc9e034ad04e167bd52df4f75f2bea4499b25349fc42b3c8de9e2fe806996", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_aduser", + "name": "tests/integration/targets/azure_rm_ddosprotectionplan/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1be076424fbf717d678e202250426e9b368688f8d3029f0c5dc262b97df819af", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_ddosprotectionplan/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_aduser/aliases", + "name": "tests/integration/targets/azure_rm_ddosprotectionplan/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "1658975f0508387cde4cda499d7eb9524e31bc2f02cc49d6483d7e210d991234", + "chksum_sha256": "cac8f7d2a8403213ad252934698c6c5eef6edc0ccd0eb6c5794990e6c30f05b0", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_aduser/tasks", + "name": "tests/integration/targets/azure_rm_recoveryservicesvault", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_aduser/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "540275f0a3abdbfd214f0379161cdaf147a166dd4678ce769b87796feaaed4a5", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_aduser/meta", + "name": "tests/integration/targets/azure_rm_recoveryservicesvault/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_aduser/meta/main.yml", + "name": "tests/integration/targets/azure_rm_recoveryservicesvault/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_cosmosdbaccount", + "name": "tests/integration/targets/azure_rm_recoveryservicesvault/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "923b442d786cff06e0b7a3ea4232f7bfe10835e93fb73b8df6ee997380099420", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_recoveryservicesvault/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_cosmosdbaccount/aliases", + "name": "tests/integration/targets/azure_rm_recoveryservicesvault/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d9b370414fbcd599ba1e1fa7adb52887e0df75d2ffce2a609bd5af743b02f600", + "chksum_sha256": "6e841ad32da809ed4a9782a8ce178f2c8399d98a56be2406142e898afffb65c0", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_cosmosdbaccount/tasks", + "name": "tests/integration/targets/azure_rm_privateendpoint", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_cosmosdbaccount/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "089a86d47541fecaa694afb80c727708a8b7ebb7d5d6e8dd403b8fecd24668a2", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_cosmosdbaccount/meta", + "name": "tests/integration/targets/azure_rm_privateendpoint/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_cosmosdbaccount/meta/main.yml", + "name": "tests/integration/targets/azure_rm_privateendpoint/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_routetable", + "name": "tests/integration/targets/azure_rm_privateendpoint/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "11c35de489a3da87eb40a2ce00a80a9992fc89c3b3fdee710301ba9faacd332d", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_privateendpoint/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_routetable/aliases", + "name": "tests/integration/targets/azure_rm_privateendpoint/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "262ad6ab8a8087f2f21d4f26a2c2d02c347a7edf0fb1af8fdb931ab1c1087bbb", + "chksum_sha256": "f5c8cc29641d123e237b894acc5d13e306e61d6cc553d15561730a42e63e55fc", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_routetable/tasks", + "name": "tests/integration/targets/azure_rm_backuppolicy", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_routetable/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "6e64f574f81b0cbeef18f1be2be5d0a56ffcf838a288617d9ea8862983beaef6", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_routetable/meta", + "name": "tests/integration/targets/azure_rm_backuppolicy/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_routetable/meta/main.yml", + "name": "tests/integration/targets/azure_rm_backuppolicy/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_loganalyticsworkspace", + "name": "tests/integration/targets/azure_rm_backuppolicy/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "109bb8ece8ca54a061f03f7050aca3401610606b79a6e313d2556dcb04fda637", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_backuppolicy/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_loganalyticsworkspace/aliases", + "name": "tests/integration/targets/azure_rm_backuppolicy/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "f6ab21fb1deaf7061dd270b8ca0bf7c6e585eac172153559349e997150abbcaf", + "chksum_sha256": "26b1ed48d843898e1dc63a09a119c74ee83613ed2f0066e2971f3056eda0ee88", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_loganalyticsworkspace/tasks", + "name": "tests/integration/targets/azure_rm_apimanagement", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_loganalyticsworkspace/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "7fc2d8a21d03401472a808094ab1cb8ce6c18d5a22cbc916a6bd672b0349271f", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_loganalyticsworkspace/meta", + "name": "tests/integration/targets/azure_rm_apimanagement/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_loganalyticsworkspace/meta/main.yml", + "name": "tests/integration/targets/azure_rm_apimanagement/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_manageddisk", + "name": "tests/integration/targets/azure_rm_apimanagement/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "592e63285615e1fe4768ff5027ae6a96e4dea5c875e1127e14c393cfacbc44fb", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_apimanagement/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_manageddisk/aliases", + "name": "tests/integration/targets/azure_rm_apimanagement/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b79d487ac5f66f90cfba1e03eb40daf31086e77447861b1cf4aeceee77d9745b", + "chksum_sha256": "7be6584e05920691ae83bc434ef61feb54cf098cb187c6457e10234840ee6ff9", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_manageddisk/tasks", + "name": "tests/integration/targets/azure_rm_cognitivesearch", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_manageddisk/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "f94f8141efef361c15c59980b3387edee7d4ddc5555fd7e0adab1484df9b8191", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_manageddisk/meta", + "name": "tests/integration/targets/azure_rm_cognitivesearch/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_manageddisk/meta/main.yml", + "name": "tests/integration/targets/azure_rm_cognitivesearch/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_diskencryptionset", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_diskencryptionset/aliases", + "name": "tests/integration/targets/azure_rm_cognitivesearch/aliases", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "b09e7a20443d9fe8e820607cf9ae826988c41fe890af049d025cb7eba9e4dbb0", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_diskencryptionset/tasks", + "name": "tests/integration/targets/azure_rm_cognitivesearch/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_diskencryptionset/tasks/main.yml", + "name": "tests/integration/targets/azure_rm_cognitivesearch/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "14e4d1ad9f066c25e177ef5e8e34a1388615fcef45ed5e62f061972f7ec3d5dc", + "chksum_sha256": "e3712847b582b6a3a3f461055963ce51034e160b1e174d06b8b8f6eeecd4bc19", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_diskencryptionset/meta", + "name": "tests/integration/targets/azure_rm_virtualmachinesize_info", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_diskencryptionset/meta/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_diskencryptionset/lookup_plugins", + "name": "tests/integration/targets/azure_rm_virtualmachinesize_info/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_diskencryptionset/lookup_plugins/azure_service_principal_attribute.py", + "name": "tests/integration/targets/azure_rm_virtualmachinesize_info/meta/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d08fa7846e9ec68c2a26501edf91ed777a7bfa60f219470df82cfb66fd7dd6e1", + "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privatelinkservice", + "name": "tests/integration/targets/azure_rm_virtualmachinesize_info/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "262ad6ab8a8087f2f21d4f26a2c2d02c347a7edf0fb1af8fdb931ab1c1087bbb", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_virtualmachinesize_info/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privatelinkservice/aliases", + "name": "tests/integration/targets/azure_rm_virtualmachinesize_info/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "109bb8ece8ca54a061f03f7050aca3401610606b79a6e313d2556dcb04fda637", + "chksum_sha256": "6684f96227d75c363a588e1be85cc7ce53025d7e13844638d100781003901db6", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privatelinkservice/tasks", + "name": "tests/integration/targets/azure_rm_apimanagementservice", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privatelinkservice/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "0a170e5d29f98d1744ce53291462d95aa0687cacd82ba80c2df89f6dc7c095a0", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_privatelinkservice/meta", + "name": "tests/integration/targets/azure_rm_apimanagementservice/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privatelinkservice/meta/main.yml", + "name": "tests/integration/targets/azure_rm_apimanagementservice/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_containerregistry", + "name": "tests/integration/targets/azure_rm_apimanagementservice/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "528893af1cac01f38ab277aec0138b83c74b2576464d96eb7f3da330784edaff", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_apimanagementservice/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_containerregistry/aliases", + "name": "tests/integration/targets/azure_rm_apimanagementservice/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ec1ff0ecb096def7880d4a1aab74cae1ee3e46dbdba9df7f476b7311ee64f2ab", + "chksum_sha256": "db17a45674ec599ab8fb1890903d3bc49b3ded000197dd55cc82c3017a962565", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_containerregistry/tasks", + "name": "tests/integration/targets/azure_rm_keyvaultsecret", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_containerregistry/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "268310390c136d6f4ef1873f15f59d85e23c7fa9971d10b9a1716069138a18cf", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_containerregistry/meta", + "name": "tests/integration/targets/azure_rm_keyvaultsecret/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_containerregistry/meta/main.yml", + "name": "tests/integration/targets/azure_rm_keyvaultsecret/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_adserviceprincipal", + "name": "tests/integration/targets/azure_rm_keyvaultsecret/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c7bb4c8aa02376e55002499e1a01763a649ddf80c253e1da4556ab7719ed05ac", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_keyvaultsecret/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_adserviceprincipal/aliases", + "name": "tests/integration/targets/azure_rm_keyvaultsecret/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "528893af1cac01f38ab277aec0138b83c74b2576464d96eb7f3da330784edaff", + "chksum_sha256": "5c0ffa5a2e80c5c71996a8f4fe46816621d764b46f0f7bc23560b55e2072d5e7", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_adserviceprincipal/tasks", + "name": "tests/integration/targets/azure_rm_keyvaultsecret/lookup_plugins", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_adserviceprincipal/tasks/main.yml", + "name": "tests/integration/targets/azure_rm_keyvaultsecret/lookup_plugins/azure_service_principal_attribute.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "bc547f3e3d85cbbddf317023aa640e9ba44003ec4f6282f8f6226ac24a53c1a4", + "chksum_sha256": "ecf5403290d75ebf93dd07c1a0d1ec251482cde7952d5fc4c1f51ecde936e804", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_adserviceprincipal/meta", + "name": "tests/integration/targets/azure_rm_eventhub", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_adserviceprincipal/meta/main.yml", + "name": "tests/integration/targets/azure_rm_eventhub/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_eventhub/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_sqlserver", + "name": "tests/integration/targets/azure_rm_eventhub/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1be076424fbf717d678e202250426e9b368688f8d3029f0c5dc262b97df819af", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_eventhub/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_sqlserver/aliases", + "name": "tests/integration/targets/azure_rm_eventhub/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b497f92848d198221058a5f5aa42e37dc513f9d2a64f54b2ddc9029b80ab7219", + "chksum_sha256": "c4ef2c774f92b1d1c61c070407cb15cec4492593f03dfc095031136a6fc315e4", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_sqlserver/tasks", + "name": "tests/integration/targets/azure_rm_postgresqlserver", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_sqlserver/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "4be907accf51f165748454fc1a5159c59b6997a28b8e1b2c4c22c249ec777f4f", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_sqlserver/meta", + "name": "tests/integration/targets/azure_rm_postgresqlserver/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_sqlserver/meta/main.yml", + "name": "tests/integration/targets/azure_rm_postgresqlserver/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_datalakestore", + "name": "tests/integration/targets/azure_rm_postgresqlserver/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "212c2162821130244834f49afd3460bb037d426eac902fc88de51afbe6bab522", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_postgresqlserver/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_datalakestore/aliases", + "name": "tests/integration/targets/azure_rm_postgresqlserver/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b09e7a20443d9fe8e820607cf9ae826988c41fe890af049d025cb7eba9e4dbb0", + "chksum_sha256": "957431198f2f2412d381532922a380b37d3a2941dce8f6fbcda89284fa7d3ca5", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_datalakestore/tasks", + "name": "tests/integration/targets/azure_rm_publicipaddress", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_datalakestore/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "91c36efb148a6e7e8816ff3f599ae2641ac57aaeb92d7d62a2736b7c07b6d5fc", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_datalakestore/meta", + "name": "tests/integration/targets/azure_rm_publicipaddress/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_datalakestore/meta/main.yml", + "name": "tests/integration/targets/azure_rm_publicipaddress/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_appgateway", + "name": "tests/integration/targets/azure_rm_publicipaddress/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ed3159c0b56e6e42548ed58456e5304d48aea0b4e3a0999591f863ae79b225ba", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_publicipaddress/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_appgateway/aliases", + "name": "tests/integration/targets/azure_rm_publicipaddress/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "21442459796e3c03ab3c6461c8251810f5545ff2320c4c814cce8b8c520e615c", + "chksum_sha256": "0240ae96de6dabce7cd47a7793fb7a263717ea1b2e28423f47ba0c75333ed8cd", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_appgateway/tasks", + "name": "tests/integration/targets/azure_rm_servicebus", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_appgateway/tasks/main.yml", + "name": "tests/integration/targets/azure_rm_servicebus/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_servicebus/meta/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "1918adad547000201f74726f4592154582274ef4debc12523d9458c7e7ed6571", + "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_appgateway/meta", + "name": "tests/integration/targets/azure_rm_servicebus/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "923b442d786cff06e0b7a3ea4232f7bfe10835e93fb73b8df6ee997380099420", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_servicebus/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_appgateway/meta/main.yml", + "name": "tests/integration/targets/azure_rm_servicebus/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", + "chksum_sha256": "a0528bf0af2a590fe46bced0ca843722543d5f10626604a887a7c278e97c38d2", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_appgateway/files", + "name": "tests/integration/targets/azure_rm_monitordiagnosticsetting", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_appgateway/files/cert1.txt", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "7637ce7f36cca366294688f612f6456714088cca19583ae7e9475e572d85f4f5", + "name": "tests/integration/targets/azure_rm_monitordiagnosticsetting/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_appgateway/files/cert3b64.txt", + "name": "tests/integration/targets/azure_rm_monitordiagnosticsetting/meta/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "1375dc6f493fb760c6087c4cdd62c4ea898887070ad17dc84196b3d6ed0545ec", + "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_appgateway/files/cert2.txt", + "name": "tests/integration/targets/azure_rm_monitordiagnosticsetting/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e4dc34faa2e8e94cd385be73c33a849f452dd57d061a8aec118e6d391e46bbc0", + "chksum_sha256": "cc618d5714ddaae8f1482cf89dcf3327cf82fa378c16f6b5cf092339927261c3", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_dnszone", + "name": "tests/integration/targets/azure_rm_monitordiagnosticsetting/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_dnszone/aliases", + "name": "tests/integration/targets/azure_rm_monitordiagnosticsetting/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "1af368a225674fcae08ea809c4dc605f03bc0334b44a9b17dfab0dfe49d93ac6", + "chksum_sha256": "4c185b22edc1017409894f57875fe5db2c986c6d741cbd86dc78aa01b36a9fc9", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_dnszone/tasks", + "name": "tests/integration/targets/azure_rm_aksagentpool", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_dnszone/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "3ee8d72a90072536d2cd063f43e5d907d629eaad1aad031c68547328bb25e934", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_dnszone/meta", + "name": "tests/integration/targets/azure_rm_aksagentpool/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_dnszone/meta/main.yml", + "name": "tests/integration/targets/azure_rm_aksagentpool/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachinescaleset", + "name": "tests/integration/targets/azure_rm_aksagentpool/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "783d6dbd1b9cc4b0543d6e96d15206283018e0c291764a2a4106e860d41cb210", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_aksagentpool/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachinescaleset/aliases", + "name": "tests/integration/targets/azure_rm_aksagentpool/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "5510a946bf7e1d1ad196eaa73474176b122ae491702a99f9160ad1d554fc08bf", + "chksum_sha256": "4bc2ac2faed9ceba28dfb24dffff6d996da42cf6aac09cb3a57c044a17bc046b", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachinescaleset/tasks", + "name": "tests/integration/targets/azure_rm_keyvault", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachinescaleset/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "e8a554bc94ee2b932713ecb72d3e19b09d5a61764b2b4b4d25b7a333b932aca2", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_virtualmachinescaleset/meta", + "name": "tests/integration/targets/azure_rm_keyvault/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachinescaleset/meta/main.yml", + "name": "tests/integration/targets/azure_rm_keyvault/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualnetwork", + "name": "tests/integration/targets/azure_rm_keyvault/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "726101a2dd7238a8ff7f94fec489e5fcfd8bb0db10ecd074fa0686b2eb9d6d24", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_keyvault/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualnetwork/aliases", + "name": "tests/integration/targets/azure_rm_keyvault/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "109bb8ece8ca54a061f03f7050aca3401610606b79a6e313d2556dcb04fda637", + "chksum_sha256": "85d1f060912261e42affe3f43fbe52750e62bc5d2fe7d9b55f604be778052033", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualnetwork/tasks", + "name": "tests/integration/targets/azure_rm_keyvault/lookup_plugins", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualnetwork/tasks/main.yml", + "name": "tests/integration/targets/azure_rm_keyvault/lookup_plugins/azure_service_principal_attribute.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "3a1898e5f4ad9974807f3688113c3c8ba5620c62767a773fc61e53fcc783a1e0", + "chksum_sha256": "ecf5403290d75ebf93dd07c1a0d1ec251482cde7952d5fc4c1f51ecde936e804", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualnetwork/meta", + "name": "tests/integration/targets/azure_rm_bastionhost", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualnetwork/meta/main.yml", + "name": "tests/integration/targets/azure_rm_bastionhost/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_bastionhost/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_dnsrecordset", + "name": "tests/integration/targets/azure_rm_bastionhost/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d57abe6f8fb0cbfb8ac22431c09126cd48bb4d2836a6d151faf92fb6fbecc6aa", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_bastionhost/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_dnsrecordset/aliases", + "name": "tests/integration/targets/azure_rm_bastionhost/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "36614727374728e26b5686e9fac66641e5b9c268b6945f2dcd1b4a9c4d2232c3", + "chksum_sha256": "b2adf15d8a7ef9e0b56dba6b3ebe750f09192d86ec56df6076088fd4edd444e3", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_dnsrecordset/tasks", + "name": "tests/integration/targets/azure_rm_containerinstance", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_dnsrecordset/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "6b9f536a2062adc87ce808e6090b3fbdca0a6cf5738c2240bd4e42631ad4b6d3", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_dnsrecordset/meta", + "name": "tests/integration/targets/azure_rm_containerinstance/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_dnsrecordset/meta/main.yml", + "name": "tests/integration/targets/azure_rm_containerinstance/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_deployment", + "name": "tests/integration/targets/azure_rm_containerinstance/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "059ec72ab54682d34b109880aa48f5b5b702d120042153371442c7293c011f31", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_containerinstance/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_deployment/aliases", + "name": "tests/integration/targets/azure_rm_containerinstance/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "11d8df93f7c7fb0bd35df23550ce55cea64300cbd7b3a1282927d49c53f53951", + "chksum_sha256": "d5d577eb39a4533fea27bd3240b4ffaa278f64b5f56b5c6375c0d1e73b7ba382", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_deployment/tasks", + "name": "tests/integration/targets/azure_rm_registrationassignment", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_deployment/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "40e1e28e9d4f20a6e94eea183148fd635ab49fe7fb2d22e3690ad2dacbc0dc5c", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_deployment/meta", + "name": "tests/integration/targets/azure_rm_registrationassignment/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_deployment/meta/main.yml", + "name": "tests/integration/targets/azure_rm_registrationassignment/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_adpassword", + "name": "tests/integration/targets/azure_rm_registrationassignment/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "262ad6ab8a8087f2f21d4f26a2c2d02c347a7edf0fb1af8fdb931ab1c1087bbb", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_registrationassignment/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_adpassword/aliases", + "name": "tests/integration/targets/azure_rm_registrationassignment/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "0e90b0bd13c40122b87176faa412a83730dcc85c0060dffa0d7b0450d559ed40", + "chksum_sha256": "86581a9afe3f4c3e4f7021f214e089c84267a3b909312cba226a9011c223bc9b", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_adpassword/tasks", + "name": "tests/integration/targets/azure_rm_adgroup", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_adpassword/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "03dd808fe4a8bac380c00d4d955647b943104ac15c4d48f8d56220694d8fc360", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_adpassword/meta", + "name": "tests/integration/targets/azure_rm_adgroup/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_adpassword/meta/main.yml", + "name": "tests/integration/targets/azure_rm_adgroup/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_keyvault", + "name": "tests/integration/targets/azure_rm_adgroup/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0e90b0bd13c40122b87176faa412a83730dcc85c0060dffa0d7b0450d559ed40", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_adgroup/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_keyvault/aliases", + "name": "tests/integration/targets/azure_rm_adgroup/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "726101a2dd7238a8ff7f94fec489e5fcfd8bb0db10ecd074fa0686b2eb9d6d24", + "chksum_sha256": "f4adb4bc8784bbb857a39fbe58f45a1a47853538f3207e987b8bd64b1704238b", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_keyvault/tasks", + "name": "tests/integration/targets/setup_azure", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_keyvault/tasks/main.yml", + "name": "tests/integration/targets/setup_azure/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "0a5a277a2c0ecfe553d34e9f9dbca06d962f8de2e2aae5c9b54be0d9f037afe9", + "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_keyvault/meta", + "name": "tests/integration/targets/azure_rm_aks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_keyvault/meta/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_keyvault/lookup_plugins", + "name": "tests/integration/targets/azure_rm_aks/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_keyvault/lookup_plugins/azure_service_principal_attribute.py", + "name": "tests/integration/targets/azure_rm_aks/meta/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d08fa7846e9ec68c2a26501edf91ed777a7bfa60f219470df82cfb66fd7dd6e1", + "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privatednszonelink", + "name": "tests/integration/targets/azure_rm_aks/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "783d6dbd1b9cc4b0543d6e96d15206283018e0c291764a2a4106e860d41cb210", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_aks/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privatednszonelink/aliases", + "name": "tests/integration/targets/azure_rm_aks/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b09e7a20443d9fe8e820607cf9ae826988c41fe890af049d025cb7eba9e4dbb0", + "chksum_sha256": "683619ec3541848983b2f513eae4d885c97d3040ac188d252aec7304c3440c0b", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privatednszonelink/tasks", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, + "name": "tests/integration/targets/azure_rm_aks/tasks/minimal-cluster.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2b2be2027bb762b22ccf731a32baf3fa8b2675369c08b76c1499b3ea10902add", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privatednszonelink/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "93d612e8b237141324401fcecd2c981476861705baf09030841246f5a951452e", + "name": "tests/integration/targets/azure_rm_containerregistrytag", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privatednszonelink/meta", + "name": "tests/integration/targets/azure_rm_containerregistrytag/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privatednszonelink/meta/main.yml", + "name": "tests/integration/targets/azure_rm_containerregistrytag/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_postgresqlserver", + "name": "tests/integration/targets/azure_rm_containerregistrytag/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "109bb8ece8ca54a061f03f7050aca3401610606b79a6e313d2556dcb04fda637", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_containerregistrytag/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_postgresqlserver/aliases", + "name": "tests/integration/targets/azure_rm_containerregistrytag/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "212c2162821130244834f49afd3460bb037d426eac902fc88de51afbe6bab522", + "chksum_sha256": "c3f1c91c39a8986e9aaaaf4e0f2bd84796f20ede51d7868e74a37a7839d1759d", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_postgresqlserver/tasks", + "name": "tests/integration/targets/azure_rm_privateendpointdnszonegroup", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_postgresqlserver/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "71f1647be9d4dee9a954cc2d07f05b7f7dcbb8bee5d04969b78a55c83972d4e9", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_postgresqlserver/meta", + "name": "tests/integration/targets/azure_rm_privateendpointdnszonegroup/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_postgresqlserver/meta/main.yml", + "name": "tests/integration/targets/azure_rm_privateendpointdnszonegroup/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_natgateway", + "name": "tests/integration/targets/azure_rm_privateendpointdnszonegroup/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "11c35de489a3da87eb40a2ce00a80a9992fc89c3b3fdee710301ba9faacd332d", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_privateendpointdnszonegroup/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_natgateway/aliases", + "name": "tests/integration/targets/azure_rm_privateendpointdnszonegroup/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "21442459796e3c03ab3c6461c8251810f5545ff2320c4c814cce8b8c520e615c", + "chksum_sha256": "408a60ac3331b6d89792e393613ca595886d842ab4ecc6825e6dc15bb02faf86", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_natgateway/tasks", + "name": "tests/integration/targets/azure_rm_virtualnetwork", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_natgateway/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "bb517955919b3994264ff27d39b427b342ce4e414807e327fcbc604de98de662", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_natgateway/meta", + "name": "tests/integration/targets/azure_rm_virtualnetwork/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_natgateway/meta/main.yml", + "name": "tests/integration/targets/azure_rm_virtualnetwork/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachineimage_info", + "name": "tests/integration/targets/azure_rm_virtualnetwork/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "109bb8ece8ca54a061f03f7050aca3401610606b79a6e313d2556dcb04fda637", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_virtualnetwork/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachineimage_info/aliases", + "name": "tests/integration/targets/azure_rm_virtualnetwork/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "8eb6da86566844e8278692f99177c27f5e17dfc808484e9168d842ce4ea822b2", + "chksum_sha256": "e46b1abb1ab82874622d1821b564cee555be16ced454a9723f3cff45dcb5948c", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachineimage_info/tasks", + "name": "tests/integration/targets/azure_rm_cdnprofile", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachineimage_info/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "f31e17c306b2a84fa24b67a1ff63e35d3156b1e7d2e313199331a7108e87deeb", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_virtualmachineimage_info/meta", + "name": "tests/integration/targets/azure_rm_cdnprofile/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualmachineimage_info/meta/main.yml", + "name": "tests/integration/targets/azure_rm_cdnprofile/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_apimanagement", + "name": "tests/integration/targets/azure_rm_cdnprofile/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d922663ea733e96e4da9178ebcd4baa17435a011302f3d609f7391e651d119f9", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_cdnprofile/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_apimanagement/aliases", + "name": "tests/integration/targets/azure_rm_cdnprofile/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "592e63285615e1fe4768ff5027ae6a96e4dea5c875e1127e14c393cfacbc44fb", + "chksum_sha256": "b292a101e30c2cf1ddb3541d9d1827483b29baea9a909cdfa57dfb9a24827741", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_apimanagement/tasks", + "name": "tests/integration/targets/azure_rm_subscription", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_apimanagement/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "43ae7f214db19a05f6fba586c9afef61c4c6345d7c75fd00b617293208cf693a", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_apimanagement/meta", + "name": "tests/integration/targets/azure_rm_subscription/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_apimanagement/meta/main.yml", + "name": "tests/integration/targets/azure_rm_subscription/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_registrationdefinition", + "name": "tests/integration/targets/azure_rm_subscription/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "109bb8ece8ca54a061f03f7050aca3401610606b79a6e313d2556dcb04fda637", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_subscription/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_registrationdefinition/aliases", + "name": "tests/integration/targets/azure_rm_subscription/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "262ad6ab8a8087f2f21d4f26a2c2d02c347a7edf0fb1af8fdb931ab1c1087bbb", + "chksum_sha256": "cb18a11b4b6b14912f9fcc0131c232c9d3525d14a8d43ee4b2606cc2d3f7249c", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_registrationdefinition/tasks", + "name": "tests/integration/targets/azure_rm_notificationhub", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_registrationdefinition/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "a583f5bc8add4b7e43a0d426bd822600192802c9bc15f8f3f48bbeecac5485f7", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_registrationdefinition/meta", + "name": "tests/integration/targets/azure_rm_notificationhub/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_registrationdefinition/meta/main.yml", + "name": "tests/integration/targets/azure_rm_notificationhub/meta/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", + "chksum_sha256": "a66dc9e034ad04e167bd52df4f75f2bea4499b25349fc42b3c8de9e2fe806996", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualhubconnection", + "name": "tests/integration/targets/azure_rm_notificationhub/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1be076424fbf717d678e202250426e9b368688f8d3029f0c5dc262b97df819af", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_notificationhub/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualhubconnection/aliases", + "name": "tests/integration/targets/azure_rm_notificationhub/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b09e7a20443d9fe8e820607cf9ae826988c41fe890af049d025cb7eba9e4dbb0", + "chksum_sha256": "7f519a0026da2e72a6633b7e82a4c2ae581c50b918a5291b3b4737360211276b", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualhubconnection/tasks", + "name": "tests/integration/targets/azure_rm_automationaccount", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualhubconnection/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "6e38f9c74c7efd203ae7c1760075b8452b0f36fd1348ab216351727444885a91", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_virtualhubconnection/meta", + "name": "tests/integration/targets/azure_rm_automationaccount/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualhubconnection/meta/main.yml", + "name": "tests/integration/targets/azure_rm_automationaccount/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_autoscale", + "name": "tests/integration/targets/azure_rm_automationaccount/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "87c7ae7077faea9533bb827344f49dadfecfdbc5ea179058d72f7bad3ae81388", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_automationaccount/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_autoscale/aliases", + "name": "tests/integration/targets/azure_rm_automationaccount/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "2019d6f29a1dbe1242200ff0a0485722bc57431db8265a741c5e501cd5a920dd", + "chksum_sha256": "c99286c45665b96d5deea95731688470a9a02c11d22f868cb0ba7a56b71c63c5", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_autoscale/tasks", + "name": "tests/integration/targets/azure_rm_account_info", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_autoscale/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "6f59879bb7f425656a8a514579d39e3f5cb83b8249b050fc7d44583b7037869a", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_autoscale/meta", + "name": "tests/integration/targets/azure_rm_account_info/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_autoscale/meta/main.yml", + "name": "tests/integration/targets/azure_rm_account_info/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_hostgroup", + "name": "tests/integration/targets/azure_rm_account_info/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a58bdac3b7068e244f2cf71f0a1a0bf136bc8785d2a8947fecbafdd97313adb7", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_account_info/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_hostgroup/aliases", + "name": "tests/integration/targets/azure_rm_account_info/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b09e7a20443d9fe8e820607cf9ae826988c41fe890af049d025cb7eba9e4dbb0", + "chksum_sha256": "4a18344a391206dc34d9e73134c7e2a2815ae3cdc36cf9b6791ac19e1bc07d6a", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_hostgroup/tasks", + "name": "tests/integration/targets/azure_rm_virtualmachine", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_hostgroup/tasks/main.yml", + "name": "tests/integration/targets/azure_rm_virtualmachine/runme.sh", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "8147fe03a7a144f1365298a436b37c14c92c2ad95a8debe63052b63017ee6774", + "chksum_sha256": "8d9a70f8c75d9a856cd529ae8ccb6e589c0db9494da4bb08cead6963e98d9dd5", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_hostgroup/meta", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, + "name": "tests/integration/targets/azure_rm_virtualmachine/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "49c03342521da6b25da0d4df975ee81e10e8b1e7ebd1bdabeba797463bceddbe", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_hostgroup/meta/main.yml", + "name": "tests/integration/targets/azure_rm_virtualmachine/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", + "chksum_sha256": "deefc8fe8e3699aa1e8852f316f52c0037219050b5b5d07919fa24d06ac14ed5", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualnetworkpeering", + "name": "tests/integration/targets/azure_rm_virtualmachine/inventory.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "979c1f5123e61d083ca0ddb9816bd3381e6c2f830ae2a96648f2d4dd720a0f8d", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_virtualmachine/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualnetworkpeering/aliases", + "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_dual_nic.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ee3b904aa8ab8d0a7e47983927157b420c195fe1d8606de015158339e7824a43", + "chksum_sha256": "ee1ca82e2f43899c6dc17f2bd4710229f33c31aec6beb8ad9093e436d2df5b1f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualnetworkpeering/tasks", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, + "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_spot.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "40cfa7a636a0741e3f17deb1c7b965fbc42074f3fb7a50503dc93b9c2515a2e4", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualnetworkpeering/tasks/main.yml", + "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_public_ip.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "38a6724132aab6bfc1da0eb2706ccbad284a4f40e952cff9a43817cbe499eba0", + "chksum_sha256": "5dbfe466ae3aa493f04b91016c88318774d3e974304b90d882ed60c7ae8e2a93", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualnetworkpeering/meta", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, + "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_vm_identity.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a7b73bb1af0583758961a25336d5faa2eb76fe6e84b3b9698b1bc5e53fbe4f9c", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualnetworkpeering/meta/main.yml", + "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_invalid.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", + "chksum_sha256": "055893c82ae8b817fbcd3287b7435ae35ba8d6825ad3cb9545048ac599f9dd56", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_eventhub", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, + "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_minimal.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6ec63fe982d7ce8d65dadd74eb7e5c3678fa88e008ddfeaa43b1d3b77e094583", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_eventhub/aliases", + "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_image_specific.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "1be076424fbf717d678e202250426e9b368688f8d3029f0c5dc262b97df819af", + "chksum_sha256": "41a71c6515836e0c1c764ae83a0c999403e1fb774a55c5ab7912bdf7f1e2fc89", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_eventhub/tasks", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, + "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/setup.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1af862edc4a550cf631bcaa7a082d23451a3e7eacd0a248e4688bcc8dc6ef604", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_eventhub/tasks/main.yml", + "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_ephemeral_os.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "9d770a67dd20f3735183550907fc2cb0bbb4a3b39032b36c0e03582dff92f742", + "chksum_sha256": "5f3d3633f808a35e23202cc9be4436f7ee590314694016377f7d40b357e4d00d", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_eventhub/meta", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, + "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_no_public_ip.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a7f201260799a21031f75d3ecbd6cc372007c3a2c5ef7a6c9d35053129b868cd", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_eventhub/meta/main.yml", + "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_image_latest.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", + "chksum_sha256": "1d3000da1ae66217ff40113749e77538bee7ebf49e1808ad36488ca33d89761f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_resource", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, + "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_deallocate.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fc53572c2732984518157aaff50942ab77426127a14f2e81faddfd45dd039e4c", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_resource/aliases", + "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_minimal_manageddisk.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b9685232ad3eab40ee59426a3dd04a8f71719dbfa1d6becb498bb416c8d1ff1c", + "chksum_sha256": "e10179f3c286b53a8347a1cd7d3672cc80e9184589dc7ea292489279fcc67ede", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_resource/tasks", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, + "name": "tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_no_nsg.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "97017436c84bdbc87de46cee90cfab5edd108685b439253083f141cd5fd52a78", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_resource/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "a95da8a8656a35415a3b437feed732f73ed55cebd52ec82b5fb1be4d10584f73", + "name": "tests/integration/targets/azure_rm_roleassignment", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_resource/meta", + "name": "tests/integration/targets/azure_rm_roleassignment/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_resource/meta/main.yml", + "name": "tests/integration/targets/azure_rm_roleassignment/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_vmbackuppolicy", + "name": "tests/integration/targets/azure_rm_roleassignment/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "51bfa0d69b7c8b7e94b28aa9c60c921ace3971f50a385673a66791c31749678a", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_roleassignment/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_vmbackuppolicy/aliases", + "name": "tests/integration/targets/azure_rm_roleassignment/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "923b442d786cff06e0b7a3ea4232f7bfe10835e93fb73b8df6ee997380099420", + "chksum_sha256": "77fcaa43c9c8308f544b5ffa24411dcdcd67f1957ff1c7ff2831d451eb5fb9b2", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_vmbackuppolicy/tasks", + "name": "tests/integration/targets/azure_rm_securitygroup", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_vmbackuppolicy/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "cccf65de4bf107159176c3acc0a67856a4bd0022ee22320a72e973fa2d954004", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_vmbackuppolicy/meta", + "name": "tests/integration/targets/azure_rm_securitygroup/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_vmbackuppolicy/meta/main.yml", + "name": "tests/integration/targets/azure_rm_securitygroup/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_proximityplacementgroup", + "name": "tests/integration/targets/azure_rm_securitygroup/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a390a5b729f05cbb0f6d91d7d663389c81a571a34bd2e931dc56fcdaee025754", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_securitygroup/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_proximityplacementgroup/aliases", + "name": "tests/integration/targets/azure_rm_securitygroup/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b09e7a20443d9fe8e820607cf9ae826988c41fe890af049d025cb7eba9e4dbb0", + "chksum_sha256": "436bac9c55273b36de74ec81c5c41e2c608843665dfec86ef85138d81a3c5b55", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_proximityplacementgroup/tasks", + "name": "tests/integration/targets/azure_rm_manageddisk", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_proximityplacementgroup/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "b82875cadb004d9a7c2de8130132298d55d142bf1a894bb9d60b826c1f248639", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_proximityplacementgroup/meta", + "name": "tests/integration/targets/azure_rm_manageddisk/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_proximityplacementgroup/meta/main.yml", + "name": "tests/integration/targets/azure_rm_manageddisk/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_sqlmanagedinstance", + "name": "tests/integration/targets/azure_rm_manageddisk/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b79d487ac5f66f90cfba1e03eb40daf31086e77447861b1cf4aeceee77d9745b", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_manageddisk/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_sqlmanagedinstance/aliases", + "name": "tests/integration/targets/azure_rm_manageddisk/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d19280a8d5d5c2523536ea5aed2c5a14d1b19cc49f3f21974ca3e9a9921bb7cd", + "chksum_sha256": "c8decdddddd8660e19da01320399ff9e5216c7733d9c755a9f812f81068f7ca5", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_sqlmanagedinstance/tasks", + "name": "tests/integration/targets/azure_rm_vpnsite", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_sqlmanagedinstance/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "d650dc72294a2dd10db5dfb8c90200c76e61b391db90daa2a6c0a5dc36d9d5ba", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_sqlmanagedinstance/meta", + "name": "tests/integration/targets/azure_rm_vpnsite/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_sqlmanagedinstance/meta/main.yml", + "name": "tests/integration/targets/azure_rm_vpnsite/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_hdinsightcluster", + "name": "tests/integration/targets/azure_rm_vpnsite/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "51bfa0d69b7c8b7e94b28aa9c60c921ace3971f50a385673a66791c31749678a", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_vpnsite/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_hdinsightcluster/aliases", + "name": "tests/integration/targets/azure_rm_vpnsite/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "dffdf5ca6061cf1a43744d6b7e0bb18a4020eed3f693702082b2314f982c65a6", + "chksum_sha256": "bcfd0915de197ad7e6d01dd27e5ffe2a8f62d93303f19d5e4c09373a82dc7334", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_hdinsightcluster/tasks", + "name": "tests/integration/targets/azure_rm_gallery", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_hdinsightcluster/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "c8f3a538060cabfd7081234dc8bdd50c2465dac3a07b5e64b527ec496f2d01b5", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_hdinsightcluster/meta", + "name": "tests/integration/targets/azure_rm_gallery/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_hdinsightcluster/meta/main.yml", + "name": "tests/integration/targets/azure_rm_gallery/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privateendpoint", + "name": "tests/integration/targets/azure_rm_gallery/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e676d2331077a7a453c2694fef48b0b56195d00e5a1009e3f668a7e174abd16b", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_gallery/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privateendpoint/aliases", + "name": "tests/integration/targets/azure_rm_gallery/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "11c35de489a3da87eb40a2ce00a80a9992fc89c3b3fdee710301ba9faacd332d", + "chksum_sha256": "22d0d3850e426784e4df1c303a1857ea5cbaf9735e5ed6df62442ac04aba5216", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privateendpoint/tasks", + "name": "tests/integration/targets/azure_rm_dnsrecordset", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privateendpoint/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "d9a95e51f0df82ac337e57b026a55ec070fefc15203a3dd6d0239e89a09c31de", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_privateendpoint/meta", + "name": "tests/integration/targets/azure_rm_dnsrecordset/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privateendpoint/meta/main.yml", + "name": "tests/integration/targets/azure_rm_dnsrecordset/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_rediscache", + "name": "tests/integration/targets/azure_rm_dnsrecordset/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "36614727374728e26b5686e9fac66641e5b9c268b6945f2dcd1b4a9c4d2232c3", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_dnsrecordset/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_rediscache/aliases", + "name": "tests/integration/targets/azure_rm_dnsrecordset/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "5ba0bf8a7bf29813d54b53fd7c3e65698ee5f802eb2ccf76c1707680acc07f17", + "chksum_sha256": "9d766be151f93042b7018bd39ac79b987e66389613ce426a70d5683952b5a841", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_rediscache/tasks", + "name": "tests/integration/targets/azure_rm_storageaccount", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_rediscache/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "17e2a11d7e099908c91ef4eb73392f860280b089afe97af692aa449c33f58b07", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_rediscache/meta", + "name": "tests/integration/targets/azure_rm_storageaccount/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_rediscache/meta/main.yml", + "name": "tests/integration/targets/azure_rm_storageaccount/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_registrationassignment", + "name": "tests/integration/targets/azure_rm_storageaccount/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "109bb8ece8ca54a061f03f7050aca3401610606b79a6e313d2556dcb04fda637", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_storageaccount/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_registrationassignment/aliases", + "name": "tests/integration/targets/azure_rm_storageaccount/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "262ad6ab8a8087f2f21d4f26a2c2d02c347a7edf0fb1af8fdb931ab1c1087bbb", + "chksum_sha256": "cddf19a5eb8e886612cfea1a81f43967228e1375327c04e984a143e6bf5d495f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_registrationassignment/tasks", + "name": "tests/integration/targets/azure_rm_mysqlserver", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_registrationassignment/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "feb8a64c4dcd8021030be7a894117093d24ec2abb4332b401db9a3195d20ae50", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_registrationassignment/meta", + "name": "tests/integration/targets/azure_rm_mysqlserver/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_registrationassignment/meta/main.yml", + "name": "tests/integration/targets/azure_rm_mysqlserver/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_batchaccount", + "name": "tests/integration/targets/azure_rm_mysqlserver/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2c74420c4bc9cc5d8af14406a1d97ea762c6b8afa4de8728a4a833b2e742cf41", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_mysqlserver/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_batchaccount/aliases", + "name": "tests/integration/targets/azure_rm_mysqlserver/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "049e0b8480c14a44ea8525b83848582417405cd5352a0afc5fc9bc3f1c0f3941", + "chksum_sha256": "743277ee9a1eda331e62acae9a94ba4820d4bef31de88a77008d62fdda27874c", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_batchaccount/tasks", + "name": "tests/integration/targets/azure_rm_expressroute", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_batchaccount/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "352bccf8fb5c893bf917097828d4fb16cda90c527f007892a9352ed2402aae47", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_batchaccount/meta", + "name": "tests/integration/targets/azure_rm_expressroute/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_batchaccount/meta/main.yml", + "name": "tests/integration/targets/azure_rm_expressroute/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_keyvaultkey", + "name": "tests/integration/targets/azure_rm_expressroute/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b09e7a20443d9fe8e820607cf9ae826988c41fe890af049d025cb7eba9e4dbb0", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_expressroute/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_keyvaultkey/aliases", + "name": "tests/integration/targets/azure_rm_expressroute/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "36614727374728e26b5686e9fac66641e5b9c268b6945f2dcd1b4a9c4d2232c3", + "chksum_sha256": "0fee3fb92d49fcebdc6564a4becd35f638cfa294e5d893fc5adf2fff21ac072b", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_keyvaultkey/tasks", + "name": "tests/integration/targets/azure_rm_devtestlab", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_keyvaultkey/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "7f3d7cfad90bfc2a0c18b401ad2b52413ad9b3f3c9b02526bbe8e741a9b62595", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_keyvaultkey/meta", + "name": "tests/integration/targets/azure_rm_devtestlab/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_keyvaultkey/meta/main.yml", + "name": "tests/integration/targets/azure_rm_devtestlab/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_keyvaultkey/lookup_plugins", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_keyvaultkey/lookup_plugins/azure_service_principal_attribute.py", + "name": "tests/integration/targets/azure_rm_devtestlab/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d08fa7846e9ec68c2a26501edf91ed777a7bfa60f219470df82cfb66fd7dd6e1", + "chksum_sha256": "435162ac2df7aa373bc2d191a07d79c283d3891a1278b0277f85e6112b96fc03", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_vpnsite", + "name": "tests/integration/targets/azure_rm_devtestlab/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_vpnsite/aliases", + "name": "tests/integration/targets/azure_rm_devtestlab/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "51bfa0d69b7c8b7e94b28aa9c60c921ace3971f50a385673a66791c31749678a", + "chksum_sha256": "17fd6c08f41838809e461f199a62e373c8bf28c5d90199bf09340ae9762dd252", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_vpnsite/tasks", + "name": "tests/integration/targets/azure_rm_storageshare", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_vpnsite/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "746c59c9882ae5210d22d6835db86037cfde1448e1faf7d75842fe8e18cd287e", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_vpnsite/meta", + "name": "tests/integration/targets/azure_rm_storageshare/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_vpnsite/meta/main.yml", + "name": "tests/integration/targets/azure_rm_storageshare/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_adapplication", + "name": "tests/integration/targets/azure_rm_storageshare/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "109bb8ece8ca54a061f03f7050aca3401610606b79a6e313d2556dcb04fda637", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_storageshare/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_adapplication/aliases", + "name": "tests/integration/targets/azure_rm_storageshare/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "0e90b0bd13c40122b87176faa412a83730dcc85c0060dffa0d7b0450d559ed40", + "chksum_sha256": "8428a40d80a569d0c5ac929641e4befc59b86cf7c7cc4da72add3b5eb4570202", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_adapplication/tasks", + "name": "tests/integration/targets/azure_rm_containerregistry", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_adapplication/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "d9ee994437da318ecf5a5fef8b899ea236db7d97cca8d027092930f5e181bf4f", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_adapplication/meta", + "name": "tests/integration/targets/azure_rm_containerregistry/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_adapplication/meta/main.yml", + "name": "tests/integration/targets/azure_rm_containerregistry/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/setup_azure", + "name": "tests/integration/targets/azure_rm_containerregistry/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ec1ff0ecb096def7880d4a1aab74cae1ee3e46dbdba9df7f476b7311ee64f2ab", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_containerregistry/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/setup_azure/aliases", + "name": "tests/integration/targets/azure_rm_containerregistry/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "chksum_sha256": "7eab7dde3b4ad416e882a673e1b671770c760c1d2ff97f9c21606a24bb3a7540", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_storageshare", + "name": "tests/integration/targets/azure_rm_acs", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_storageshare/aliases", + "name": "tests/integration/targets/azure_rm_acs/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_acs/meta/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "109bb8ece8ca54a061f03f7050aca3401610606b79a6e313d2556dcb04fda637", + "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_storageshare/tasks", + "name": "tests/integration/targets/azure_rm_acs/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2f7e954a810d0341b1aed1d34e5684bc502980bb6ebbe6a46fb03163ed0e11db", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_acs/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_storageshare/tasks/main.yml", + "name": "tests/integration/targets/azure_rm_acs/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "84ab49dce1912995caef94f302ff7ed98d6234e06fe54d6faa55cd29e802e7df", + "chksum_sha256": "ecad2cdce0986a34a8f64d2bcbcbd742d99a0083d4e2773cc6a5482a5d529b9c", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_storageshare/meta", + "name": "tests/integration/targets/azure_rm_storageblob", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_storageshare/meta/main.yml", + "name": "tests/integration/targets/azure_rm_storageblob/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_storageblob/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_keyvaultsecret", + "name": "tests/integration/targets/azure_rm_storageblob/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "109bb8ece8ca54a061f03f7050aca3401610606b79a6e313d2556dcb04fda637", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_storageblob/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_keyvaultsecret/aliases", + "name": "tests/integration/targets/azure_rm_storageblob/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "c7bb4c8aa02376e55002499e1a01763a649ddf80c253e1da4556ab7719ed05ac", + "chksum_sha256": "b93536f3d35eaa0d49a0bfb1ce75902b524b86c0db95f3e43122088dcfcac442", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_keyvaultsecret/tasks", + "name": "tests/integration/targets/azure_rm_storageblob/files", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_keyvaultsecret/tasks/main.yml", + "name": "tests/integration/targets/azure_rm_storageblob/files/Ratings.png", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e28a64d6bb6fa59065265ee662c3da858db8ba9d278007b84aa76b161ce5905c", + "chksum_sha256": "20cdf86ae984fb64eefdc57a0e03f34c83cb8b27834b33c84768cc2b62cf9d68", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_keyvaultsecret/meta", + "name": "tests/integration/targets/azure_rm_loganalyticsworkspace", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_keyvaultsecret/meta/main.yml", + "name": "tests/integration/targets/azure_rm_loganalyticsworkspace/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_loganalyticsworkspace/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_keyvaultsecret/lookup_plugins", + "name": "tests/integration/targets/azure_rm_loganalyticsworkspace/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f6ab21fb1deaf7061dd270b8ca0bf7c6e585eac172153559349e997150abbcaf", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_loganalyticsworkspace/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_keyvaultsecret/lookup_plugins/azure_service_principal_attribute.py", + "name": "tests/integration/targets/azure_rm_loganalyticsworkspace/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d08fa7846e9ec68c2a26501edf91ed777a7bfa60f219470df82cfb66fd7dd6e1", + "chksum_sha256": "529ae2dab2d63d3af2eab9ff5fe9b466a9c2bf3bf600d0a5221126ddec9be288", "format": 1 }, { - "name": "tests/integration/targets/inventory_azure", + "name": "tests/integration/targets/azure_rm_backupazurevm", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/inventory_azure/test.azure_rm.yml", + "name": "tests/integration/targets/azure_rm_backupazurevm/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_backupazurevm/meta/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/inventory_azure/aliases", + "name": "tests/integration/targets/azure_rm_backupazurevm/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e2e2f39006f1e6b83660c469a9c29e1dfb17b99cca9caa124626e14cd0658a0b", + "chksum_sha256": "91c612e6c7b96f80e7e1cede3dc0ef7431a2900356b7e85a7521e2679bfcfa49", "format": 1 }, { - "name": "tests/integration/targets/inventory_azure/templates", + "name": "tests/integration/targets/azure_rm_backupazurevm/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/inventory_azure/templates/basic2.yml", + "name": "tests/integration/targets/azure_rm_backupazurevm/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "758f6dfaa158a3601eb9cd986357f1a40a04071ad62f3ba613002ffde00d6018", + "chksum_sha256": "4ac0d2995ac62544c567223a1e45c1b1fc568b840b645d5b42a0b41fd4df1661", "format": 1 }, { - "name": "tests/integration/targets/inventory_azure/templates/basic.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "3f99d3d1c0b4f896b1f43477667fc744c2cd2d38471c5bbc9287773b57682628", + "name": "tests/integration/targets/azure_rm_registrationdefinition", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/inventory_azure/playbooks", + "name": "tests/integration/targets/azure_rm_registrationdefinition/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/inventory_azure/playbooks/empty_inventory_config.yml", + "name": "tests/integration/targets/azure_rm_registrationdefinition/meta/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "fb0ef55005c4532dc1ce027933a64bdd030fc524cf769ba04c7a55af74ad3825", + "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/inventory_azure/playbooks/setup.yml", + "name": "tests/integration/targets/azure_rm_registrationdefinition/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d3b5efa255e58e82d8f9b68d69ea0d18acbf391fc9c8c29429ce239a06191fe5", + "chksum_sha256": "262ad6ab8a8087f2f21d4f26a2c2d02c347a7edf0fb1af8fdb931ab1c1087bbb", "format": 1 }, { - "name": "tests/integration/targets/inventory_azure/playbooks/teardown.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "56f5867ac251afdf3029e70f5c6cc56202b02f5e4a2b7d581a778f0bee2f1d78", + "name": "tests/integration/targets/azure_rm_registrationdefinition/tasks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/inventory_azure/playbooks/test_inventory.yml", + "name": "tests/integration/targets/azure_rm_registrationdefinition/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "9d203152d9cf31363d91d57bc1c8d3f41819c65b5794c5e499e8b7f6f610da20", + "chksum_sha256": "b1e2343656426831e5aadf56883b897f520bfc13adee76347b787f396f037855", "format": 1 }, { - "name": "tests/integration/targets/inventory_azure/playbooks/vars.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "23fff20fb969471888915a24760b7a90723a30e3e0e6b7c7745864470c898027", + "name": "tests/integration/targets/azure_rm_availabilityset", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/inventory_azure/playbooks/create_inventory_config.yml", + "name": "tests/integration/targets/azure_rm_availabilityset/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_availabilityset/meta/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "4c8ad8ccbb06836f7fd7c8eb03902517c05d3d60669884e6dd993cb4a982d743", + "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/inventory_azure/runme.sh", + "name": "tests/integration/targets/azure_rm_availabilityset/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "203fe16581a305486f7d5a2feafad324ed5515a96c26b4f4d84ab34a1cdcb6a3", + "chksum_sha256": "5647901b6198849a4dd58b7fb51aee85b889220f80acde88cea67bffff453d8d", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_cdnprofile", + "name": "tests/integration/targets/azure_rm_availabilityset/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_cdnprofile/aliases", + "name": "tests/integration/targets/azure_rm_availabilityset/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d922663ea733e96e4da9178ebcd4baa17435a011302f3d609f7391e651d119f9", + "chksum_sha256": "0d096b5b5000fd2c1c259adae048dd6ac824c2441db10e6fe352282c8bb77b8a", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_cdnprofile/tasks", + "name": "tests/integration/targets/azure_rm_hdinsightcluster", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_cdnprofile/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "5c25b15cf50e7d835c76e61ee05dcdf8d788ca7bc70bc600ac1c01f9461743fa", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_cdnprofile/meta", + "name": "tests/integration/targets/azure_rm_hdinsightcluster/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_cdnprofile/meta/main.yml", + "name": "tests/integration/targets/azure_rm_hdinsightcluster/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_containerinstance", + "name": "tests/integration/targets/azure_rm_hdinsightcluster/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "dffdf5ca6061cf1a43744d6b7e0bb18a4020eed3f693702082b2314f982c65a6", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_hdinsightcluster/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_containerinstance/aliases", + "name": "tests/integration/targets/azure_rm_hdinsightcluster/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "059ec72ab54682d34b109880aa48f5b5b702d120042153371442c7293c011f31", + "chksum_sha256": "2a0464f133b840983fad3fa552279ac8aca4a07023877e84bd273e8bde440f65", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_containerinstance/tasks", + "name": "tests/integration/targets/azure_rm_webappvnetconnection", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_containerinstance/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "6ea4f42d32c3d5feb8a3764ae1e8c21b32dc5b7c7a3af6d6c1df622dfe7d1a2f", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_containerinstance/meta", + "name": "tests/integration/targets/azure_rm_webappvnetconnection/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_containerinstance/meta/main.yml", + "name": "tests/integration/targets/azure_rm_webappvnetconnection/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_containerregistrytag", + "name": "tests/integration/targets/azure_rm_webappvnetconnection/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "262ad6ab8a8087f2f21d4f26a2c2d02c347a7edf0fb1af8fdb931ab1c1087bbb", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_webappvnetconnection/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_containerregistrytag/aliases", + "name": "tests/integration/targets/azure_rm_webappvnetconnection/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "109bb8ece8ca54a061f03f7050aca3401610606b79a6e313d2556dcb04fda637", + "chksum_sha256": "fe11d34bfc4836a138318153cd0df0bb89f64d2d6d64f9dc7843704f1bd60760", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_containerregistrytag/tasks", + "name": "tests/integration/targets/azure_rm_networkinterface", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_containerregistrytag/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "b2dafa7a0578a14b8db994de7895c37b6d7548183e277af00ba2df8056bf9a32", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_containerregistrytag/meta", + "name": "tests/integration/targets/azure_rm_networkinterface/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_containerregistrytag/meta/main.yml", + "name": "tests/integration/targets/azure_rm_networkinterface/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_ddosprotectionplan", + "name": "tests/integration/targets/azure_rm_networkinterface/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "79cafc6b10612f907e2e4a97bac50c9948ac0a0dd5030875a9465204a6323b48", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_networkinterface/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_ddosprotectionplan/aliases", + "name": "tests/integration/targets/azure_rm_networkinterface/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "1be076424fbf717d678e202250426e9b368688f8d3029f0c5dc262b97df819af", + "chksum_sha256": "cd2b9fd7ff5b256d26839ba3646b9347fa95f8fd6b1104e7f2835e1d7b7b2624", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_ddosprotectionplan/tasks", + "name": "tests/integration/targets/azure_rm_privatednsrecordset", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_ddosprotectionplan/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "56e8c026b7bc7080ae83e08851e81a5e338154dc1c959c430a47a08a3fdf740d", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_ddosprotectionplan/meta", + "name": "tests/integration/targets/azure_rm_privatednsrecordset/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_ddosprotectionplan/meta/main.yml", + "name": "tests/integration/targets/azure_rm_privatednsrecordset/meta/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "dc52aeb87665e099cf3a8ea346ef11e82ee323aa360b983d540739839a852fd8", + "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_backupazurevm", + "name": "tests/integration/targets/azure_rm_privatednsrecordset/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "36614727374728e26b5686e9fac66641e5b9c268b6945f2dcd1b4a9c4d2232c3", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_privatednsrecordset/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_backupazurevm/aliases", + "name": "tests/integration/targets/azure_rm_privatednsrecordset/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "91c612e6c7b96f80e7e1cede3dc0ef7431a2900356b7e85a7521e2679bfcfa49", + "chksum_sha256": "1fc82f73aab3fbd25c62ca6e740a796a286df28c3de2cc6d084619cdb7fd12eb", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_backupazurevm/tasks", + "name": "tests/integration/targets/azure_rm_proximityplacementgroup", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_backupazurevm/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "7f36a9206aee456e050ad93d88f5949f5e2926caa03d5001e7f21faa58c286f1", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_backupazurevm/meta", + "name": "tests/integration/targets/azure_rm_proximityplacementgroup/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_backupazurevm/meta/main.yml", + "name": "tests/integration/targets/azure_rm_proximityplacementgroup/meta/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "86ade1ce7ec530fef84440672efaf3b60c253946bb82f5f0a134a9691bc6ffad", + "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_loadbalancer", + "name": "tests/integration/targets/azure_rm_proximityplacementgroup/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b09e7a20443d9fe8e820607cf9ae826988c41fe890af049d025cb7eba9e4dbb0", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_proximityplacementgroup/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_loadbalancer/aliases", + "name": "tests/integration/targets/azure_rm_proximityplacementgroup/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "923b442d786cff06e0b7a3ea4232f7bfe10835e93fb73b8df6ee997380099420", + "chksum_sha256": "c5c88276931feb2e7c2b7386c1ed4885d19888d5f70cf8c76dd4088fa33fa79d", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_loadbalancer/tasks", + "name": "tests/integration/targets/azure_rm_resourcegroup", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_loadbalancer/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "0fcedad3bc473d420c53ef5a9aef83d360b2b7490d1da7d486ceb97a89298e22", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_loadbalancer/meta", + "name": "tests/integration/targets/azure_rm_resourcegroup/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_loadbalancer/meta/main.yml", + "name": "tests/integration/targets/azure_rm_resourcegroup/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_aksagentpool", + "name": "tests/integration/targets/azure_rm_resourcegroup/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cd30933c00554775a36ee6421935b7d8baf776db7cb35d5a103be9e18b7d2486", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_resourcegroup/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_aksagentpool/aliases", + "name": "tests/integration/targets/azure_rm_resourcegroup/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "783d6dbd1b9cc4b0543d6e96d15206283018e0c291764a2a4106e860d41cb210", + "chksum_sha256": "ccf92a54443b6b7b1df4139247acd0d9496fb6266d6a99defb4035fb76cb61a3", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_aksagentpool/tasks", + "name": "tests/integration/targets/azure_rm_virtualhub", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_aksagentpool/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "0dcd646ff5f0878e03f906d116aeb76539de11af1ba1890a47d88fba0d83b4c3", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_aksagentpool/meta", + "name": "tests/integration/targets/azure_rm_virtualhub/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_aksagentpool/meta/main.yml", + "name": "tests/integration/targets/azure_rm_virtualhub/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_storageaccount", + "name": "tests/integration/targets/azure_rm_virtualhub/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b09e7a20443d9fe8e820607cf9ae826988c41fe890af049d025cb7eba9e4dbb0", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_virtualhub/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_storageaccount/aliases", + "name": "tests/integration/targets/azure_rm_virtualhub/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "109bb8ece8ca54a061f03f7050aca3401610606b79a6e313d2556dcb04fda637", + "chksum_sha256": "8810084bf5132a43f31c425b77e96134af6d5855dcb4d4ab94ed2b691d555614", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_storageaccount/tasks", + "name": "tests/integration/targets/azure_rm_privatednszone", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_storageaccount/tasks/main.yml", - "ftype": "file", - "chksum_type": "sha256", - "chksum_sha256": "a38da8b4c75427135c5af1f070ec2938f3028fae753241377d6fa644ef38ec6b", - "format": 1 - }, - { - "name": "tests/integration/targets/azure_rm_storageaccount/meta", + "name": "tests/integration/targets/azure_rm_privatednszone/meta", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_storageaccount/meta/main.yml", + "name": "tests/integration/targets/azure_rm_privatednszone/meta/main.yml", "ftype": "file", "chksum_type": "sha256", "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualwan", + "name": "tests/integration/targets/azure_rm_privatednszone/aliases", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e131092efb0e9d778baeb38471a15da9b4f8ab9e3425ec4f37aaece309220d47", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_privatednszone/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualwan/aliases", + "name": "tests/integration/targets/azure_rm_privatednszone/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b09e7a20443d9fe8e820607cf9ae826988c41fe890af049d025cb7eba9e4dbb0", + "chksum_sha256": "b2de5836a16a64f95f0494dd53d54cd82716c1133e7707c0c2680d9502dfef5c", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualwan/tasks", + "name": "tests/integration/targets/azure_rm_datafactory", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualwan/tasks/main.yml", + "name": "tests/integration/targets/azure_rm_datafactory/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_datafactory/meta/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", + "format": 1 + }, + { + "name": "tests/integration/targets/azure_rm_datafactory/aliases", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "626d27329e2174e36d407be9fc626156ac4ed0817e9ccb6a9f125f7c8fa25ca2", + "chksum_sha256": "a74040b53394bd68b1885c350f1f62603740e721ca38e01609660895693a3858", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualwan/meta", + "name": "tests/integration/targets/azure_rm_datafactory/tasks", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_virtualwan/meta/main.yml", + "name": "tests/integration/targets/azure_rm_datafactory/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", + "chksum_sha256": "eedba69010cd9dad1b57c7e0f7f18eacb0feb43359922cb53c3ba98479e8dfcc", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privatednszone", + "name": "tests/sanity", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privatednszone/aliases", + "name": "tests/sanity/ignore-2.13.txt", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e131092efb0e9d778baeb38471a15da9b4f8ab9e3425ec4f37aaece309220d47", + "chksum_sha256": "c88d45d86600e17b8da638521ccef69e6f48ce4a0e1486cb59e09ae1d0d65d57", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privatednszone/tasks", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, + "name": "tests/sanity/ignore-2.15.txt", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c88d45d86600e17b8da638521ccef69e6f48ce4a0e1486cb59e09ae1d0d65d57", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privatednszone/tasks/main.yml", + "name": "tests/sanity/ignore-2.14.txt", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "864bae11ad5b2e3e708668fd4d8b09b7b8ffa4d27b62ef98d0275a1da830c294", + "chksum_sha256": "c88d45d86600e17b8da638521ccef69e6f48ce4a0e1486cb59e09ae1d0d65d57", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privatednszone/meta", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, + "name": "LICENSE", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8b1ba204bb69a0ade2bfcf65ef294a920f6bb361b317dba43c7ef29d96332b9b", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_privatednszone/meta/main.yml", + "name": "sanity-requirements-azure.txt", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", + "chksum_sha256": "bd3de2a9921f5fcdfed1582123c18a91bd48b120d2e9c10d9879ef46d40e98f1", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_automationrunbook", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, + "name": "CHANGELOG.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7f464028041360717ad63fbeeb1a50c208c8d1c13792f1ac55f9aed2449af8da", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_automationrunbook/aliases", + "name": "release-pipelines.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "522c2e1148926193596b31fa7cf086b9f57e17c7028abc638a2b6f5bb9269850", + "chksum_sha256": "26a84e5d665443b05c84c798e9d901a7681cf891436e04b4a16c9f9cfbab1f8a", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_automationrunbook/tasks", + "name": "CONTRIBUTING.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "290a3dfba9b53aecbf86badacfdcb7f320c9a924e02a8f0b4824785a551d0a39", + "format": 1 + }, + { + "name": ".idea", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_automationrunbook/tasks/main.yml", + "name": ".idea/misc.xml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "45759293845fd4f0cde756813fe3887ec228533ff6cc5957d1a776798bc2327b", + "chksum_sha256": "e5df86803b5913746c8d40c348879d7f9442e4a6bfefbae93cc711a640fba506", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_automationrunbook/meta", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, + "name": ".idea/azcollection.iml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a9e614b7294d32d9dd7d25fd7116079ac7e3ac6bbe3043f672cb3db0f828eeeb", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_automationrunbook/meta/main.yml", + "name": ".idea/modules.xml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", + "chksum_sha256": "c8aa540922a578f85297bfb3bacf703eb49b573c6c229fc2323e6a90e33bdca6", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_acs", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, + "name": ".idea/workspace.xml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f87e05eb5e48aba1dff20dbea0fb919b6f3c848d2391064f56028ae939d7101d", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_acs/aliases", + "name": ".idea/vcs.xml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "2f7e954a810d0341b1aed1d34e5684bc502980bb6ebbe6a46fb03163ed0e11db", + "chksum_sha256": "62be7e0a7f84ab3c35b4d4bafb890a4951d061eadafde1a10aa3f5d0406db5df", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_acs/tasks", + "name": ".idea/inspectionProfiles", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, { - "name": "tests/integration/targets/azure_rm_acs/tasks/main.yml", + "name": ".idea/inspectionProfiles/profiles_settings.xml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "6c8990f11a0e4bac2c4cd8131f0494e05386a8a17e519e126910e941b5092c32", + "chksum_sha256": "6172c5997eeb3cd19c9ca2b5b97d6e2983cdd1fa60b2460d7bbb74055edcaa46", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_acs/meta", - "ftype": "dir", - "chksum_type": null, - "chksum_sha256": null, + "name": ".idea/.gitignore", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1bfdece3645ed8ed356030f22cc2004dc3f401ff060ac3d24de811c3bcd82e16", "format": 1 }, { - "name": "tests/integration/targets/azure_rm_acs/meta/main.yml", + "name": ".gitignore", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d00bd90476595ae7d97d3ca8f8aa7ff475ebc3dd87d7d12e862bf0527f7bd81f", + "chksum_sha256": "702d6332d579931561017161f2d96eb3b023a006c94ed262d789411d0f21bd26", "format": 1 } ], diff --git a/ansible_collections/azure/azcollection/MANIFEST.json b/ansible_collections/azure/azcollection/MANIFEST.json index c4e596627..4c8d77d4a 100644 --- a/ansible_collections/azure/azcollection/MANIFEST.json +++ b/ansible_collections/azure/azcollection/MANIFEST.json @@ -2,7 +2,7 @@ "collection_info": { "namespace": "azure", "name": "azcollection", - "version": "1.16.0", + "version": "1.19.0", "authors": [ "Microsoft <ansible@microsoft.com>" ], @@ -31,7 +31,7 @@ "name": "FILES.json", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e29f531bba6f16e3cfdddb6fa4011507294c1525d9f80f4e68803527f7478fe8", + "chksum_sha256": "3ed7ebc35c6b19227d62f58a00333d40e5ba30ca842d3c2c293465bae42f7b4a", "format": 1 }, "format": 1 diff --git a/ansible_collections/azure/azcollection/README.md b/ansible_collections/azure/azcollection/README.md index b05c76b1c..69d9e7c0b 100644 --- a/ansible_collections/azure/azcollection/README.md +++ b/ansible_collections/azure/azcollection/README.md @@ -1,5 +1,5 @@ # Ansible collection for Azure -[![Doc](https://img.shields.io/badge/docs-latest-brightgreen.svg)](https://docs.ansible.com/ansible/latest/modules/list_of_cloud_modules.html#azure) +[![Doc](https://img.shields.io/badge/docs-latest-brightgreen.svg)](https://docs.ansible.com/ansible/latest/collections/azure/azcollection/index.html) [![Code of conduct](https://img.shields.io/badge/code%20of%20conduct-Ansible-silver.svg)](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html) [![License](https://img.shields.io/badge/license-GPL%20v3.0-brightgreen.svg)](LICENSE) @@ -50,7 +50,7 @@ To use a module from Azure collection, please reference the full namespace, coll account_type: Standard_LRS ``` -Or you can add full namepsace and collection name in the `collections` element: +Or you can add full namespace and collection name in the `collections` element: ```yaml --- diff --git a/ansible_collections/azure/azcollection/ansible.cfg b/ansible_collections/azure/azcollection/ansible.cfg deleted file mode 100644 index fecf5b666..000000000 --- a/ansible_collections/azure/azcollection/ansible.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[defaults] -collections_paths = ./ diff --git a/ansible_collections/azure/azcollection/azure-pipelines.yml b/ansible_collections/azure/azcollection/azure-pipelines.yml index 406dc2575..1c9e13b86 100644 --- a/ansible_collections/azure/azcollection/azure-pipelines.yml +++ b/ansible_collections/azure/azcollection/azure-pipelines.yml @@ -2,44 +2,41 @@ trigger: batch: true branches: include: - - "*" + - "*" jobs: -- job: CG - pool: - name: pool-ubuntu-2004 + - job: CG + pool: + name: pool-ubuntu-2004 - steps: - - task: ComponentGovernanceComponentDetection@0 - inputs: - scanType: 'Register' - verbosity: 'Verbose' - alertWarningLevel: 'Medium' - failOnAlert: true - -- job: CredScan - pool: - vmImage: "windows-2019" - - steps: - - task: ea576cd4-c61f-48f8-97e7-a3cb07b90a6f@2 - inputs: - toolMajorVersion: 'V2' - suppressionsFile: 'CredScanSuppressions.json' - - - task: securedevelopmentteam.vss-secure-development-tools.build-task-postanalysis.PostAnalysis@1 - inputs: - AllTools: false - APIScan: false - BinSkim: false - CodesignValidation: false - CredScan: true - FortifySCA: false - FxCop: false - ModernCop: false - PoliCheck: false - RoslynAnalyzers: false - SDLNativeRules: false - Semmle: false - TSLint: false - ToolLogsNotFoundAction: 'Standard' + steps: + - task: ComponentGovernanceComponentDetection@0 + inputs: + scanType: 'Register' + verbosity: 'Verbose' + alertWarningLevel: 'Medium' + failOnAlert: true + - job: CredScan + pool: + vmImage: "windows-2019" + steps: + - task: ea576cd4-c61f-48f8-97e7-a3cb07b90a6f@2 + inputs: + toolMajorVersion: 'V2' + suppressionsFile: 'CredScanSuppressions.json' + - task: securedevelopmentteam.vss-secure-development-tools.build-task-postanalysis.PostAnalysis@1 + inputs: + AllTools: false + APIScan: false + BinSkim: false + CodesignValidation: false + CredScan: true + FortifySCA: false + FxCop: false + ModernCop: false + PoliCheck: false + RoslynAnalyzers: false + SDLNativeRules: false + Semmle: false + TSLint: false + ToolLogsNotFoundAction: 'Standard' diff --git a/ansible_collections/azure/azcollection/meta/runtime.yml b/ansible_collections/azure/azcollection/meta/runtime.yml index 0d9c5c166..ccff76341 100644 --- a/ansible_collections/azure/azcollection/meta/runtime.yml +++ b/ansible_collections/azure/azcollection/meta/runtime.yml @@ -1,282 +1,286 @@ --- -requires_ansible: '>=2.9.10' +requires_ansible: '>=2.13.0' action_groups: all: - - azure.azcollection.azure_rm_account_info - - azure.azcollection.azure_rm_adapplication - - azure.azcollection.azure_rm_adapplication_info - - azure.azcollection.azure_rm_adgroup - - azure.azcollection.azure_rm_adgroup_info - - azure.azcollection.azure_rm_adpassword - - azure.azcollection.azure_rm_adpassword_info - - azure.azcollection.azure_rm_adserviceprincipal - - azure.azcollection.azure_rm_adserviceprincipal_info - - azure.azcollection.azure_rm_aduser - - azure.azcollection.azure_rm_aduser_info - - azure.azcollection.azure_rm_aks - - azure.azcollection.azure_rm_aks_info - - azure.azcollection.azure_rm_aksagentpool - - azure.azcollection.azure_rm_aksagentpool_info - - azure.azcollection.azure_rm_aksagentpoolversion_info - - azure.azcollection.azure_rm_aksupgrade_info - - azure.azcollection.azure_rm_aksversion_info - - azure.azcollection.azure_rm_apimanagement - - azure.azcollection.azure_rm_apimanagement_info - - azure.azcollection.azure_rm_apimanagementservice - - azure.azcollection.azure_rm_apimanagementservice_info - - azure.azcollection.azure_rm_appgateway - - azure.azcollection.azure_rm_appgateway_info - - azure.azcollection.azure_rm_applicationsecuritygroup - - azure.azcollection.azure_rm_applicationsecuritygroup_info - - azure.azcollection.azure_rm_appserviceplan - - azure.azcollection.azure_rm_appserviceplan_info - - azure.azcollection.azure_rm_automationaccount - - azure.azcollection.azure_rm_automationaccount_info - - azure.azcollection.azure_rm_automationrunbook - - azure.azcollection.azure_rm_automationrunbook_info - - azure.azcollection.azure_rm_autoscale - - azure.azcollection.azure_rm_autoscale_info - - azure.azcollection.azure_rm_availabilityset - - azure.azcollection.azure_rm_availabilityset_info - - azure.azcollection.azure_rm_azurefirewall - - azure.azcollection.azure_rm_azurefirewall_info - - azure.azcollection.azure_rm_backupazurevm - - azure.azcollection.azure_rm_backupazurevm_info - - azure.azcollection.azure_rm_backuppolicy - - azure.azcollection.azure_rm_backuppolicy_info - - azure.azcollection.azure_rm_bastionhost - - azure.azcollection.azure_rm_bastionhost_info - - azure.azcollection.azure_rm_batchaccount - - azure.azcollection.azure_rm_cdnendpoint - - azure.azcollection.azure_rm_cdnendpoint_info - - azure.azcollection.azure_rm_cdnprofile - - azure.azcollection.azure_rm_cdnprofile_info - - azure.azcollection.azure_rm_cognitivesearch - - azure.azcollection.azure_rm_cognitivesearch_info - - azure.azcollection.azure_rm_containerinstance - - azure.azcollection.azure_rm_containerinstance_info - - azure.azcollection.azure_rm_containerregistry - - azure.azcollection.azure_rm_containerregistry_info - - azure.azcollection.azure_rm_containerregistryreplication - - azure.azcollection.azure_rm_containerregistryreplication_info - - azure.azcollection.azure_rm_containerregistrytag - - azure.azcollection.azure_rm_containerregistrytag_info - - azure.azcollection.azure_rm_containerregistrywebhook - - azure.azcollection.azure_rm_containerregistrywebhook_info - - azure.azcollection.azure_rm_cosmosdbaccount - - azure.azcollection.azure_rm_cosmosdbaccount_info - - azure.azcollection.azure_rm_datafactory - - azure.azcollection.azure_rm_datafactory_info - - azure.azcollection.azure_rm_datalakestore - - azure.azcollection.azure_rm_datalakestore_info - - azure.azcollection.azure_rm_ddosprotectionplan - - azure.azcollection.azure_rm_ddosprotectionplan_info - - azure.azcollection.azure_rm_deployment - - azure.azcollection.azure_rm_deployment_info - - azure.azcollection.azure_rm_devtestlab - - azure.azcollection.azure_rm_devtestlab_info - - azure.azcollection.azure_rm_devtestlabarmtemplate_info - - azure.azcollection.azure_rm_devtestlabartifact_info - - azure.azcollection.azure_rm_devtestlabartifactsource - - azure.azcollection.azure_rm_devtestlabartifactsource_info - - azure.azcollection.azure_rm_devtestlabcustomimage - - azure.azcollection.azure_rm_devtestlabcustomimage_info - - azure.azcollection.azure_rm_devtestlabenvironment - - azure.azcollection.azure_rm_devtestlabenvironment_info - - azure.azcollection.azure_rm_devtestlabpolicy - - azure.azcollection.azure_rm_devtestlabpolicy_info - - azure.azcollection.azure_rm_devtestlabschedule - - azure.azcollection.azure_rm_devtestlabschedule_info - - azure.azcollection.azure_rm_devtestlabvirtualmachine - - azure.azcollection.azure_rm_devtestlabvirtualmachine_info - - azure.azcollection.azure_rm_devtestlabvirtualnetwork - - azure.azcollection.azure_rm_devtestlabvirtualnetwork_info - - azure.azcollection.azure_rm_diskencryptionset - - azure.azcollection.azure_rm_diskencryptionset_info - - azure.azcollection.azure_rm_dnsrecordset - - azure.azcollection.azure_rm_dnsrecordset_info - - azure.azcollection.azure_rm_dnszone - - azure.azcollection.azure_rm_dnszone_info - - azure.azcollection.azure_rm_eventhub - - azure.azcollection.azure_rm_eventhub_info - - azure.azcollection.azure_rm_expressroute - - azure.azcollection.azure_rm_expressroute_info - - azure.azcollection.azure_rm_firewallpolicy - - azure.azcollection.azure_rm_firewallpolicy_info - - azure.azcollection.azure_rm_functionapp - - azure.azcollection.azure_rm_functionapp_info - - azure.azcollection.azure_rm_gallery - - azure.azcollection.azure_rm_gallery_info - - azure.azcollection.azure_rm_galleryimage - - azure.azcollection.azure_rm_galleryimage_info - - azure.azcollection.azure_rm_galleryimageversion - - azure.azcollection.azure_rm_galleryimageversion_info - - azure.azcollection.azure_rm_hdinsightcluster - - azure.azcollection.azure_rm_hdinsightcluster_info - - azure.azcollection.azure_rm_hostgroup - - azure.azcollection.azure_rm_hostgroup_info - - azure.azcollection.azure_rm_image - - azure.azcollection.azure_rm_image_info - - azure.azcollection.azure_rm_iotdevice - - azure.azcollection.azure_rm_iotdevice_info - - azure.azcollection.azure_rm_iotdevicemodule - - azure.azcollection.azure_rm_iothub - - azure.azcollection.azure_rm_iothub_info - - azure.azcollection.azure_rm_iothubconsumergroup - - azure.azcollection.azure_rm_ipgroup - - azure.azcollection.azure_rm_ipgroup_info - - azure.azcollection.azure_rm_keyvault - - azure.azcollection.azure_rm_keyvault_info - - azure.azcollection.azure_rm_keyvaultkey - - azure.azcollection.azure_rm_keyvaultkey_info - - azure.azcollection.azure_rm_keyvaultsecret - - azure.azcollection.azure_rm_keyvaultsecret_info - - azure.azcollection.azure_rm_loadbalancer - - azure.azcollection.azure_rm_loadbalancer_info - - azure.azcollection.azure_rm_lock - - azure.azcollection.azure_rm_lock_info - - azure.azcollection.azure_rm_loganalyticsworkspace - - azure.azcollection.azure_rm_loganalyticsworkspace_info - - azure.azcollection.azure_rm_manageddisk - - azure.azcollection.azure_rm_manageddisk_info - - azure.azcollection.azure_rm_managementgroup - - azure.azcollection.azure_rm_managementgroup_info - - azure.azcollection.azure_rm_mariadbconfiguration - - azure.azcollection.azure_rm_mariadbconfiguration_info - - azure.azcollection.azure_rm_mariadbdatabase - - azure.azcollection.azure_rm_mariadbdatabase_info - - azure.azcollection.azure_rm_mariadbfirewallrule - - azure.azcollection.azure_rm_mariadbfirewallrule_info - - azure.azcollection.azure_rm_mariadbserver - - azure.azcollection.azure_rm_mariadbserver_info - - azure.azcollection.azure_rm_monitordiagnosticsetting - - azure.azcollection.azure_rm_monitordiagnosticsetting_info - - azure.azcollection.azure_rm_monitorlogprofile - - azure.azcollection.azure_rm_mysqlconfiguration - - azure.azcollection.azure_rm_mysqlconfiguration_info - - azure.azcollection.azure_rm_mysqldatabase - - azure.azcollection.azure_rm_mysqldatabase_info - - azure.azcollection.azure_rm_mysqlfirewallrule - - azure.azcollection.azure_rm_mysqlfirewallrule_info - - azure.azcollection.azure_rm_mysqlserver - - azure.azcollection.azure_rm_mysqlserver_info - - azure.azcollection.azure_rm_natgateway - - azure.azcollection.azure_rm_natgateway_info - - azure.azcollection.azure_rm_networkinterface - - azure.azcollection.azure_rm_networkinterface_info - - azure.azcollection.azure_rm_notificationhub - - azure.azcollection.azure_rm_notificationhub_info - - azure.azcollection.azure_rm_openshiftmanagedcluster - - azure.azcollection.azure_rm_openshiftmanagedcluster_info - - azure.azcollection.azure_rm_postgresqlconfiguration - - azure.azcollection.azure_rm_postgresqlconfiguration_info - - azure.azcollection.azure_rm_postgresqldatabase - - azure.azcollection.azure_rm_postgresqldatabase_info - - azure.azcollection.azure_rm_postgresqlfirewallrule - - azure.azcollection.azure_rm_postgresqlfirewallrule_info - - azure.azcollection.azure_rm_postgresqlserver - - azure.azcollection.azure_rm_postgresqlserver_info - - azure.azcollection.azure_rm_privatednsrecordset - - azure.azcollection.azure_rm_privatednsrecordset_info - - azure.azcollection.azure_rm_privatednszone - - azure.azcollection.azure_rm_privatednszone_info - - azure.azcollection.azure_rm_privatednszonelink - - azure.azcollection.azure_rm_privatednszonelink_info - - azure.azcollection.azure_rm_privateendpoint - - azure.azcollection.azure_rm_privateendpoint_info - - azure.azcollection.azure_rm_privateendpointconnection - - azure.azcollection.azure_rm_privateendpointconnection_info - - azure.azcollection.azure_rm_privateendpointdnszonegroup - - azure.azcollection.azure_rm_privateendpointdnszonegroup_info - - azure.azcollection.azure_rm_privatelinkservice - - azure.azcollection.azure_rm_privatelinkservice_info - - azure.azcollection.azure_rm_proximityplacementgroup - - azure.azcollection.azure_rm_proximityplacementgroup_info - - azure.azcollection.azure_rm_publicipaddress - - azure.azcollection.azure_rm_publicipaddress_info - - azure.azcollection.azure_rm_recoveryservicesvault - - azure.azcollection.azure_rm_recoveryservicesvault_info - - azure.azcollection.azure_rm_rediscache - - azure.azcollection.azure_rm_rediscache_info - - azure.azcollection.azure_rm_rediscachefirewallrule - - azure.azcollection.azure_rm_registrationassignment - - azure.azcollection.azure_rm_registrationassignment_info - - azure.azcollection.azure_rm_registrationdefinition - - azure.azcollection.azure_rm_registrationdefinition_info - - azure.azcollection.azure_rm_resource - - azure.azcollection.azure_rm_resource_info - - azure.azcollection.azure_rm_resourcegroup - - azure.azcollection.azure_rm_resourcegroup_info - - azure.azcollection.azure_rm_roleassignment - - azure.azcollection.azure_rm_roleassignment_info - - azure.azcollection.azure_rm_roledefinition - - azure.azcollection.azure_rm_roledefinition_info - - azure.azcollection.azure_rm_route - - azure.azcollection.azure_rm_route_info - - azure.azcollection.azure_rm_routetable - - azure.azcollection.azure_rm_routetable_info - - azure.azcollection.azure_rm_securitygroup - - azure.azcollection.azure_rm_securitygroup_info - - azure.azcollection.azure_rm_servicebus - - azure.azcollection.azure_rm_servicebus_info - - azure.azcollection.azure_rm_servicebusqueue - - azure.azcollection.azure_rm_servicebussaspolicy - - azure.azcollection.azure_rm_servicebustopic - - azure.azcollection.azure_rm_servicebustopicsubscription - - azure.azcollection.azure_rm_snapshot - - azure.azcollection.azure_rm_sqldatabase - - azure.azcollection.azure_rm_sqldatabase_info - - azure.azcollection.azure_rm_sqlfirewallrule - - azure.azcollection.azure_rm_sqlfirewallrule_info - - azure.azcollection.azure_rm_sqlserver - - azure.azcollection.azure_rm_sqlserver_info - - azure.azcollection.azure_rm_sqlmanagedinstance - - azure.azcollection.azure_rm_sqlmanagedinstance_info - - azure.azcollection.azure_rm_storageaccount - - azure.azcollection.azure_rm_storageaccount_info - - azure.azcollection.azure_rm_storageblob - - azure.azcollection.azure_rm_storageshare - - azure.azcollection.azure_rm_storageshare_info - - azure.azcollection.azure_rm_subnet - - azure.azcollection.azure_rm_subnet_info - - azure.azcollection.azure_rm_subscription_info - - azure.azcollection.azure_rm_trafficmanager - - azure.azcollection.azure_rm_trafficmanagerendpoint - - azure.azcollection.azure_rm_trafficmanagerendpoint_info - - azure.azcollection.azure_rm_trafficmanagerprofile - - azure.azcollection.azure_rm_trafficmanagerprofile_info - - azure.azcollection.azure_rm_virtualhub - - azure.azcollection.azure_rm_virtualhub_info - - azure.azcollection.azure_rm_virtualhubconnection - - azure.azcollection.azure_rm_virtualhubconnection_info - - azure.azcollection.azure_rm_virtualmachine - - azure.azcollection.azure_rm_virtualmachine_info - - azure.azcollection.azure_rm_virtualmachineextension - - azure.azcollection.azure_rm_virtualmachineextension_info - - azure.azcollection.azure_rm_virtualmachineimage_info - - azure.azcollection.azure_rm_virtualmachinescaleset - - azure.azcollection.azure_rm_virtualmachinescaleset_info - - azure.azcollection.azure_rm_virtualmachinescalesetextension - - azure.azcollection.azure_rm_virtualmachinescalesetextension_info - - azure.azcollection.azure_rm_virtualmachinescalesetinstance - - azure.azcollection.azure_rm_virtualmachinescalesetinstance_info - - azure.azcollection.azure_rm_virtualmachinesize_info - - azure.azcollection.azure_rm_virtualnetwork - - azure.azcollection.azure_rm_virtualnetwork_info - - azure.azcollection.azure_rm_virtualnetworkgateway - - azure.azcollection.azure_rm_virtualnetworkpeering - - azure.azcollection.azure_rm_virtualnetworkpeering_info - - azure.azcollection.azure_rm_virtualwan - - azure.azcollection.azure_rm_virtualwan_info - - azure.azcollection.azure_rm_vmbackuppolicy - - azure.azcollection.azure_rm_vmbackuppolicy_info - - azure.azcollection.azure_rm_vpnsite - - azure.azcollection.azure_rm_vpnsite_info - - azure.azcollection.azure_rm_vpnsitelink_info - - azure.azcollection.azure_rm_webapp - - azure.azcollection.azure_rm_webapp_info - - azure.azcollection.azure_rm_webappaccessrestriction - - azure.azcollection.azure_rm_webappaccessrestriction_info - - azure.azcollection.azure_rm_webappslot - - azure.azcollection.azure_rm_webappvnetconnection - - azure.azcollection.azure_rm_webappvnetconnection_info + - azure.azcollection.azure_rm_account_info + - azure.azcollection.azure_rm_adapplication + - azure.azcollection.azure_rm_adapplication_info + - azure.azcollection.azure_rm_adgroup + - azure.azcollection.azure_rm_adgroup_info + - azure.azcollection.azure_rm_adpassword + - azure.azcollection.azure_rm_adpassword_info + - azure.azcollection.azure_rm_adserviceprincipal + - azure.azcollection.azure_rm_adserviceprincipal_info + - azure.azcollection.azure_rm_aduser + - azure.azcollection.azure_rm_aduser_info + - azure.azcollection.azure_rm_aks + - azure.azcollection.azure_rm_aks_info + - azure.azcollection.azure_rm_aksagentpool + - azure.azcollection.azure_rm_aksagentpool_info + - azure.azcollection.azure_rm_aksagentpoolversion_info + - azure.azcollection.azure_rm_aksupgrade_info + - azure.azcollection.azure_rm_aksversion_info + - azure.azcollection.azure_rm_apimanagement + - azure.azcollection.azure_rm_apimanagement_info + - azure.azcollection.azure_rm_apimanagementservice + - azure.azcollection.azure_rm_apimanagementservice_info + - azure.azcollection.azure_rm_appgateway + - azure.azcollection.azure_rm_appgateway_info + - azure.azcollection.azure_rm_applicationsecuritygroup + - azure.azcollection.azure_rm_applicationsecuritygroup_info + - azure.azcollection.azure_rm_appserviceplan + - azure.azcollection.azure_rm_appserviceplan_info + - azure.azcollection.azure_rm_automationaccount + - azure.azcollection.azure_rm_automationaccount_info + - azure.azcollection.azure_rm_automationrunbook + - azure.azcollection.azure_rm_automationrunbook_info + - azure.azcollection.azure_rm_autoscale + - azure.azcollection.azure_rm_autoscale_info + - azure.azcollection.azure_rm_availabilityset + - azure.azcollection.azure_rm_availabilityset_info + - azure.azcollection.azure_rm_azurefirewall + - azure.azcollection.azure_rm_azurefirewall_info + - azure.azcollection.azure_rm_backupazurevm + - azure.azcollection.azure_rm_backupazurevm_info + - azure.azcollection.azure_rm_backuppolicy + - azure.azcollection.azure_rm_backuppolicy_info + - azure.azcollection.azure_rm_bastionhost + - azure.azcollection.azure_rm_bastionhost_info + - azure.azcollection.azure_rm_batchaccount + - azure.azcollection.azure_rm_cdnendpoint + - azure.azcollection.azure_rm_cdnendpoint_info + - azure.azcollection.azure_rm_cdnprofile + - azure.azcollection.azure_rm_cdnprofile_info + - azure.azcollection.azure_rm_cognitivesearch + - azure.azcollection.azure_rm_cognitivesearch_info + - azure.azcollection.azure_rm_containerinstance + - azure.azcollection.azure_rm_containerinstance_info + - azure.azcollection.azure_rm_containerregistry + - azure.azcollection.azure_rm_containerregistry_info + - azure.azcollection.azure_rm_containerregistryreplication + - azure.azcollection.azure_rm_containerregistryreplication_info + - azure.azcollection.azure_rm_containerregistrytag + - azure.azcollection.azure_rm_containerregistrytag_info + - azure.azcollection.azure_rm_containerregistrywebhook + - azure.azcollection.azure_rm_containerregistrywebhook_info + - azure.azcollection.azure_rm_cosmosdbaccount + - azure.azcollection.azure_rm_cosmosdbaccount_info + - azure.azcollection.azure_rm_datafactory + - azure.azcollection.azure_rm_datafactory_info + - azure.azcollection.azure_rm_datalakestore + - azure.azcollection.azure_rm_datalakestore_info + - azure.azcollection.azure_rm_ddosprotectionplan + - azure.azcollection.azure_rm_ddosprotectionplan_info + - azure.azcollection.azure_rm_deployment + - azure.azcollection.azure_rm_deployment_info + - azure.azcollection.azure_rm_devtestlab + - azure.azcollection.azure_rm_devtestlab_info + - azure.azcollection.azure_rm_devtestlabarmtemplate_info + - azure.azcollection.azure_rm_devtestlabartifact_info + - azure.azcollection.azure_rm_devtestlabartifactsource + - azure.azcollection.azure_rm_devtestlabartifactsource_info + - azure.azcollection.azure_rm_devtestlabcustomimage + - azure.azcollection.azure_rm_devtestlabcustomimage_info + - azure.azcollection.azure_rm_devtestlabenvironment + - azure.azcollection.azure_rm_devtestlabenvironment_info + - azure.azcollection.azure_rm_devtestlabpolicy + - azure.azcollection.azure_rm_devtestlabpolicy_info + - azure.azcollection.azure_rm_devtestlabschedule + - azure.azcollection.azure_rm_devtestlabschedule_info + - azure.azcollection.azure_rm_devtestlabvirtualmachine + - azure.azcollection.azure_rm_devtestlabvirtualmachine_info + - azure.azcollection.azure_rm_devtestlabvirtualnetwork + - azure.azcollection.azure_rm_devtestlabvirtualnetwork_info + - azure.azcollection.azure_rm_diskencryptionset + - azure.azcollection.azure_rm_diskencryptionset_info + - azure.azcollection.azure_rm_dnsrecordset + - azure.azcollection.azure_rm_dnsrecordset_info + - azure.azcollection.azure_rm_dnszone + - azure.azcollection.azure_rm_dnszone_info + - azure.azcollection.azure_rm_eventhub + - azure.azcollection.azure_rm_eventhub_info + - azure.azcollection.azure_rm_expressroute + - azure.azcollection.azure_rm_expressroute_info + - azure.azcollection.azure_rm_firewallpolicy + - azure.azcollection.azure_rm_firewallpolicy_info + - azure.azcollection.azure_rm_functionapp + - azure.azcollection.azure_rm_functionapp_info + - azure.azcollection.azure_rm_gallery + - azure.azcollection.azure_rm_gallery_info + - azure.azcollection.azure_rm_galleryimage + - azure.azcollection.azure_rm_galleryimage_info + - azure.azcollection.azure_rm_galleryimageversion + - azure.azcollection.azure_rm_galleryimageversion_info + - azure.azcollection.azure_rm_hdinsightcluster + - azure.azcollection.azure_rm_hdinsightcluster_info + - azure.azcollection.azure_rm_hostgroup + - azure.azcollection.azure_rm_hostgroup_info + - azure.azcollection.azure_rm_image + - azure.azcollection.azure_rm_image_info + - azure.azcollection.azure_rm_iotdevice + - azure.azcollection.azure_rm_iotdevice_info + - azure.azcollection.azure_rm_iotdevicemodule + - azure.azcollection.azure_rm_iothub + - azure.azcollection.azure_rm_iothub_info + - azure.azcollection.azure_rm_iothubconsumergroup + - azure.azcollection.azure_rm_ipgroup + - azure.azcollection.azure_rm_ipgroup_info + - azure.azcollection.azure_rm_keyvault + - azure.azcollection.azure_rm_keyvault_info + - azure.azcollection.azure_rm_keyvaultkey + - azure.azcollection.azure_rm_keyvaultkey_info + - azure.azcollection.azure_rm_keyvaultsecret + - azure.azcollection.azure_rm_keyvaultsecret_info + - azure.azcollection.azure_rm_loadbalancer + - azure.azcollection.azure_rm_loadbalancer_info + - azure.azcollection.azure_rm_lock + - azure.azcollection.azure_rm_lock_info + - azure.azcollection.azure_rm_loganalyticsworkspace + - azure.azcollection.azure_rm_loganalyticsworkspace_info + - azure.azcollection.azure_rm_manageddisk + - azure.azcollection.azure_rm_manageddisk_info + - azure.azcollection.azure_rm_managementgroup + - azure.azcollection.azure_rm_managementgroup_info + - azure.azcollection.azure_rm_mariadbconfiguration + - azure.azcollection.azure_rm_mariadbconfiguration_info + - azure.azcollection.azure_rm_mariadbdatabase + - azure.azcollection.azure_rm_mariadbdatabase_info + - azure.azcollection.azure_rm_mariadbfirewallrule + - azure.azcollection.azure_rm_mariadbfirewallrule_info + - azure.azcollection.azure_rm_mariadbserver + - azure.azcollection.azure_rm_mariadbserver_info + - azure.azcollection.azure_rm_monitordiagnosticsetting + - azure.azcollection.azure_rm_monitordiagnosticsetting_info + - azure.azcollection.azure_rm_monitorlogprofile + - azure.azcollection.azure_rm_multiplemanageddisks + - azure.azcollection.azure_rm_mysqlconfiguration + - azure.azcollection.azure_rm_mysqlconfiguration_info + - azure.azcollection.azure_rm_mysqldatabase + - azure.azcollection.azure_rm_mysqldatabase_info + - azure.azcollection.azure_rm_mysqlfirewallrule + - azure.azcollection.azure_rm_mysqlfirewallrule_info + - azure.azcollection.azure_rm_mysqlserver + - azure.azcollection.azure_rm_mysqlserver_info + - azure.azcollection.azure_rm_natgateway + - azure.azcollection.azure_rm_natgateway_info + - azure.azcollection.azure_rm_networkinterface + - azure.azcollection.azure_rm_networkinterface_info + - azure.azcollection.azure_rm_notificationhub + - azure.azcollection.azure_rm_notificationhub_info + - azure.azcollection.azure_rm_openshiftmanagedcluster + - azure.azcollection.azure_rm_openshiftmanagedcluster_info + - azure.azcollection.azure_rm_postgresqlconfiguration + - azure.azcollection.azure_rm_postgresqlconfiguration_info + - azure.azcollection.azure_rm_postgresqldatabase + - azure.azcollection.azure_rm_postgresqldatabase_info + - azure.azcollection.azure_rm_postgresqlfirewallrule + - azure.azcollection.azure_rm_postgresqlfirewallrule_info + - azure.azcollection.azure_rm_postgresqlserver + - azure.azcollection.azure_rm_postgresqlserver_info + - azure.azcollection.azure_rm_privatednsrecordset + - azure.azcollection.azure_rm_privatednsrecordset_info + - azure.azcollection.azure_rm_privatednszone + - azure.azcollection.azure_rm_privatednszone_info + - azure.azcollection.azure_rm_privatednszonelink + - azure.azcollection.azure_rm_privatednszonelink_info + - azure.azcollection.azure_rm_privateendpoint + - azure.azcollection.azure_rm_privateendpoint_info + - azure.azcollection.azure_rm_privateendpointconnection + - azure.azcollection.azure_rm_privateendpointconnection_info + - azure.azcollection.azure_rm_privateendpointdnszonegroup + - azure.azcollection.azure_rm_privateendpointdnszonegroup_info + - azure.azcollection.azure_rm_privatelinkservice + - azure.azcollection.azure_rm_privatelinkservice_info + - azure.azcollection.azure_rm_proximityplacementgroup + - azure.azcollection.azure_rm_proximityplacementgroup_info + - azure.azcollection.azure_rm_publicipaddress + - azure.azcollection.azure_rm_publicipaddress_info + - azure.azcollection.azure_rm_recoveryservicesvault + - azure.azcollection.azure_rm_recoveryservicesvault_info + - azure.azcollection.azure_rm_rediscache + - azure.azcollection.azure_rm_rediscache_info + - azure.azcollection.azure_rm_rediscachefirewallrule + - azure.azcollection.azure_rm_registrationassignment + - azure.azcollection.azure_rm_registrationassignment_info + - azure.azcollection.azure_rm_registrationdefinition + - azure.azcollection.azure_rm_registrationdefinition_info + - azure.azcollection.azure_rm_resource + - azure.azcollection.azure_rm_resource_info + - azure.azcollection.azure_rm_resourcegroup + - azure.azcollection.azure_rm_resourcegroup_info + - azure.azcollection.azure_rm_roleassignment + - azure.azcollection.azure_rm_roleassignment_info + - azure.azcollection.azure_rm_roledefinition + - azure.azcollection.azure_rm_roledefinition_info + - azure.azcollection.azure_rm_route + - azure.azcollection.azure_rm_route_info + - azure.azcollection.azure_rm_routetable + - azure.azcollection.azure_rm_routetable_info + - azure.azcollection.azure_rm_securitygroup + - azure.azcollection.azure_rm_securitygroup_info + - azure.azcollection.azure_rm_servicebus + - azure.azcollection.azure_rm_servicebus_info + - azure.azcollection.azure_rm_servicebusqueue + - azure.azcollection.azure_rm_servicebussaspolicy + - azure.azcollection.azure_rm_servicebustopic + - azure.azcollection.azure_rm_servicebustopicsubscription + - azure.azcollection.azure_rm_snapshot + - azure.azcollection.azure_rm_sqldatabase + - azure.azcollection.azure_rm_sqldatabase_info + - azure.azcollection.azure_rm_sqlelasticpool + - azure.azcollection.azure_rm_sqlelasticpool_info + - azure.azcollection.azure_rm_sqlfirewallrule + - azure.azcollection.azure_rm_sqlfirewallrule_info + - azure.azcollection.azure_rm_sqlserver + - azure.azcollection.azure_rm_sqlserver_info + - azure.azcollection.azure_rm_sqlmanagedinstance + - azure.azcollection.azure_rm_sqlmanagedinstance_info + - azure.azcollection.azure_rm_storageaccount + - azure.azcollection.azure_rm_storageaccount_info + - azure.azcollection.azure_rm_storageblob + - azure.azcollection.azure_rm_storageshare + - azure.azcollection.azure_rm_storageshare_info + - azure.azcollection.azure_rm_subnet + - azure.azcollection.azure_rm_subnet_info + - azure.azcollection.azure_rm_subscription_info + - azure.azcollection.azure_rm_trafficmanager + - azure.azcollection.azure_rm_trafficmanagerendpoint + - azure.azcollection.azure_rm_trafficmanagerendpoint_info + - azure.azcollection.azure_rm_trafficmanagerprofile + - azure.azcollection.azure_rm_trafficmanagerprofile_info + - azure.azcollection.azure_rm_virtualhub + - azure.azcollection.azure_rm_virtualhub_info + - azure.azcollection.azure_rm_virtualhubconnection + - azure.azcollection.azure_rm_virtualhubconnection_info + - azure.azcollection.azure_rm_virtualmachine + - azure.azcollection.azure_rm_virtualmachine_info + - azure.azcollection.azure_rm_virtualmachineextension + - azure.azcollection.azure_rm_virtualmachineextension_info + - azure.azcollection.azure_rm_virtualmachineimage_info + - azure.azcollection.azure_rm_virtualmachinescaleset + - azure.azcollection.azure_rm_virtualmachinescaleset_info + - azure.azcollection.azure_rm_virtualmachinescalesetextension + - azure.azcollection.azure_rm_virtualmachinescalesetextension_info + - azure.azcollection.azure_rm_virtualmachinescalesetinstance + - azure.azcollection.azure_rm_virtualmachinescalesetinstance_info + - azure.azcollection.azure_rm_virtualmachinesize_info + - azure.azcollection.azure_rm_virtualnetwork + - azure.azcollection.azure_rm_virtualnetwork_info + - azure.azcollection.azure_rm_virtualnetworkgateway + - azure.azcollection.azure_rm_virtualnetworkpeering + - azure.azcollection.azure_rm_virtualnetworkpeering_info + - azure.azcollection.azure_rm_virtualwan + - azure.azcollection.azure_rm_virtualwan_info + - azure.azcollection.azure_rm_vmbackuppolicy + - azure.azcollection.azure_rm_vmbackuppolicy_info + - azure.azcollection.azure_rm_vmssnetworkinterface_info + - azure.azcollection.azure_rm_vpnsite + - azure.azcollection.azure_rm_vpnsite_info + - azure.azcollection.azure_rm_vpnsitelink_info + - azure.azcollection.azure_rm_webapp + - azure.azcollection.azure_rm_webapp_info + - azure.azcollection.azure_rm_webappaccessrestriction + - azure.azcollection.azure_rm_webappaccessrestriction_info + - azure.azcollection.azure_rm_webappslot + - azure.azcollection.azure_rm_webappvnetconnection + - azure.azcollection.azure_rm_webappvnetconnection_info diff --git a/ansible_collections/azure/azcollection/plugins/inventory/azure_rm.py b/ansible_collections/azure/azcollection/plugins/inventory/azure_rm.py index e570b59a9..3442aa124 100644 --- a/ansible_collections/azure/azcollection/plugins/inventory/azure_rm.py +++ b/ansible_collections/azure/azcollection/plugins/inventory/azure_rm.py @@ -35,6 +35,7 @@ EXAMPLES = ''' # vmid: the VM's internal SMBIOS ID, eg: '36bca69d-c365-4584-8c06-a62f4a1dc5d2' # vmss: if the VM is a member of a scaleset (vmss), a dictionary including the id and name of the parent scaleset # availability_zone: availability zone in which VM is deployed, eg '1','2','3' +# creation_time: datetime object of when the VM was created, eg '2023-07-21T09:30:30.4710164+00:00' # # The following host variables are sometimes availble: # computer_name: the Operating System's hostname. Will not be available if azure agent is not available and picking it up. @@ -51,58 +52,59 @@ auth_source: cli # fetches VMs from an explicit list of resource groups instead of default all (- '*') include_vm_resource_groups: -- myrg1 -- myrg2 + - myrg1 + - myrg2 # fetches VMs from VMSSs in all resource groups (defaults to no VMSS fetch) include_vmss_resource_groups: -- '*' + - '*' # places a host in the named group if the associated condition evaluates to true conditional_groups: - # since this will be true for every host, every host sourced from this inventory plugin config will be in the - # group 'all_the_hosts' - all_the_hosts: true - # if the VM's "name" variable contains "dbserver", it will be placed in the 'db_hosts' group - db_hosts: "'dbserver' in name" + # since this will be true for every host, every host sourced from this inventory plugin config will be in the + # group 'all_the_hosts' + all_the_hosts: true + # if the VM's "name" variable contains "dbserver", it will be placed in the 'db_hosts' group + db_hosts: "'dbserver' in name" # adds variables to each host found by this inventory plugin, whose values are the result of the associated expression hostvar_expressions: - my_host_var: - # A statically-valued expression has to be both single and double-quoted, or use escaped quotes, since the outer - # layer of quotes will be consumed by YAML. Without the second set of quotes, it interprets 'staticvalue' as a - # variable instead of a string literal. - some_statically_valued_var: "'staticvalue'" - # overrides the default ansible_host value with a custom Jinja2 expression, in this case, the first DNS hostname, or - # if none are found, the first public IP address. - ansible_host: (public_dns_hostnames + public_ipv4_addresses) | first + my_host_var: + # A statically-valued expression has to be both single and double-quoted, or use escaped quotes, since the outer + # layer of quotes will be consumed by YAML. Without the second set of quotes, it interprets 'staticvalue' as a + # variable instead of a string literal. + some_statically_valued_var: "'staticvalue'" + # overrides the default ansible_host value with a custom Jinja2 expression, in this case, the first DNS hostname, or + # if none are found, the first public IP address. + ansible_host: (public_dns_hostnames + public_ipv4_addresses) | first # change how inventory_hostname is generated. Each item is a jinja2 expression similar to hostvar_expressions. hostnames: - - tags.vm_name - - default # special var that uses the default hashed name + - tags.vm_name + - default_inventory_hostname + ".domain.tld" # Transfer to fqdn if you use shortnames for VMs + - default # special var that uses the default hashed name # places hosts in dynamically-created groups based on a variable value. keyed_groups: # places each host in a group named 'tag_(tag name)_(tag value)' for each tag on a VM. -- prefix: tag - key: tags + - prefix: tag + key: tags # places each host in a group named 'azure_loc_(location name)', depending on the VM's location -- prefix: azure_loc - key: location + - prefix: azure_loc + key: location # places host in a group named 'some_tag_X' using the value of the 'sometag' tag on a VM as X, and defaulting to the # value 'none' (eg, the group 'some_tag_none') if the 'sometag' tag is not defined for a VM. -- prefix: some_tag - key: tags.sometag | default('none') + - prefix: some_tag + key: tags.sometag | default('none') # excludes a host from the inventory when any of these expressions is true, can refer to any vars defined on the host exclude_host_filters: -# excludes hosts in the eastus region -- location in ['eastus'] -- tags['tagkey'] is defined and tags['tagkey'] == 'tagkey' -- tags['tagkey2'] is defined and tags['tagkey2'] == 'tagkey2' -# excludes hosts that are powered off -- powerstate != 'running' + # excludes hosts in the eastus region + - location in ['eastus'] + - tags['tagkey'] is defined and tags['tagkey'] == 'tagkey' + - tags['tagkey2'] is defined and tags['tagkey2'] == 'tagkey2' + # excludes hosts that are powered off + - powerstate != 'running' ''' # FUTURE: do we need a set of sane default filters, separate from the user-defineable ones? @@ -121,7 +123,6 @@ except ImportError: from Queue import Queue, Empty from collections import namedtuple -from ansible import release from ansible.plugins.inventory import BaseInventoryPlugin, Constructable from ansible.module_utils.six import iteritems from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMAuth @@ -131,21 +132,19 @@ from ansible.module_utils._text import to_native, to_bytes, to_text from itertools import chain try: - from msrest import ServiceClient, Serializer, Deserializer - from msrestazure import AzureConfiguration - from msrestazure.polling.arm_polling import ARMPolling - from msrestazure.tools import parse_resource_id + from azure.core._pipeline_client import PipelineClient + from azure.core.pipeline.policies import BearerTokenCredentialPolicy + from azure.core.configuration import Configuration + from azure.mgmt.core.tools import parse_resource_id except ImportError: - AzureConfiguration = object - ARMPolling = object + Configuration = object parse_resource_id = object - ServiceClient = object - Serializer = object - Deserializer = object + PipelineClient = object + BearerTokenCredentialPolicy = object pass -class AzureRMRestConfiguration(AzureConfiguration): +class AzureRMRestConfiguration(Configuration): def __init__(self, credentials, subscription_id, base_url=None): if credentials is None: @@ -155,10 +154,11 @@ class AzureRMRestConfiguration(AzureConfiguration): if not base_url: base_url = 'https://management.azure.com' - super(AzureRMRestConfiguration, self).__init__(base_url) + credential_scopes = base_url + '/.default' - self.add_user_agent('ansible-dynamic-inventory/{0}'.format(release.__version__)) + super(AzureRMRestConfiguration, self).__init__() + self.authentication_policy = BearerTokenCredentialPolicy(credentials, credential_scopes) self.credentials = credentials self.subscription_id = subscription_id @@ -174,13 +174,11 @@ class InventoryModule(BaseInventoryPlugin, Constructable): def __init__(self): super(InventoryModule, self).__init__() - self._serializer = Serializer() - self._deserializer = Deserializer() self._hosts = [] self._filters = None # FUTURE: use API profiles with defaults - self._compute_api_version = '2017-03-30' + self._compute_api_version = '2021-11-01' self._network_api_version = '2015-06-15' self._default_header_parameters = {'Content-Type': 'application/json; charset=utf-8'} @@ -236,14 +234,16 @@ class InventoryModule(BaseInventoryPlugin, Constructable): cloud_environment=self.get_option('cloud_environment'), cert_validation_mode=self.get_option('cert_validation_mode'), api_profile=self.get_option('api_profile'), + track1_cred=True, adfs_authority_url=self.get_option('adfs_authority_url') ) self.azure_auth = AzureRMAuth(**auth_options) - self._clientconfig = AzureRMRestConfiguration(self.azure_auth.azure_credentials, self.azure_auth.subscription_id, + self._clientconfig = AzureRMRestConfiguration(self.azure_auth.azure_credential_track2, self.azure_auth.subscription_id, self.azure_auth._cloud_environment.endpoints.resource_manager) - self._client = ServiceClient(self._clientconfig.credentials, self._clientconfig) + + self.new_client = PipelineClient(self.azure_auth._cloud_environment.endpoints.resource_manager, config=self._clientconfig) def _enqueue_get(self, url, api_version, handler, handler_args=None): if not handler_args: @@ -399,7 +399,9 @@ class InventoryModule(BaseInventoryPlugin, Constructable): name = str(uuid.uuid4()) query_parameters = {'api-version': item.api_version} - req = self._client.get(item.url, query_parameters) + header_parameters = {'x-ms-client-request-id': str(uuid.uuid4()), 'Content-Type': 'application/json; charset=utf-8'} + body = {} + req = self.new_client.get(item.url, query_parameters, header_parameters, body) batch_requests.append(dict(httpMethod="GET", url=req.url, name=name)) batch_response_handlers[name] = item batch_item_index += 1 @@ -431,36 +433,25 @@ class InventoryModule(BaseInventoryPlugin, Constructable): def _send_batch(self, batched_requests): url = '/batch' query_parameters = {'api-version': '2015-11-01'} - - body_obj = dict(requests=batched_requests) - - body_content = self._serializer.body(body_obj, 'object') + header_parameters = {'x-ms-client-request-id': str(uuid.uuid4()), 'Content-Type': 'application/json; charset=utf-8'} + body_content = dict(requests=batched_requests) header = {'x-ms-client-request-id': str(uuid.uuid4())} header.update(self._default_header_parameters) - request = self._client.post(url, query_parameters) - initial_response = self._client.send(request, header, body_content) + request_new = self.new_client.post(url, query_parameters, header_parameters, body_content) + response = self.new_client.send_request(request_new) - # FUTURE: configurable timeout? - poller = ARMPolling(timeout=2) - poller.initialize(client=self._client, - initial_response=initial_response, - deserialization_callback=lambda r: self._deserializer('object', r)) - - poller.run() - - return poller.resource() + return json.loads(response.body()) def send_request(self, url, api_version): query_parameters = {'api-version': api_version} - req = self._client.get(url, query_parameters) - resp = self._client.send(req, self._default_header_parameters, stream=False) - - resp.raise_for_status() - content = resp.content + header_parameters = {'x-ms-client-request-id': str(uuid.uuid4()), 'Content-Type': 'application/json; charset=utf-8'} + body = {} + request_new = self.new_client.get(url, query_parameters, header_parameters) + response = self.new_client.send_request(request_new) - return json.loads(content) + return json.loads(response.body()) @staticmethod def _legacy_script_compatible_group_sanitization(name): @@ -558,6 +549,7 @@ class AzureHost(object): plan=self._vm_model['properties']['plan']['name'] if self._vm_model['properties'].get('plan') else None, resource_group=parse_resource_id(self._vm_model['id']).get('resource_group').lower(), default_inventory_hostname=self.default_inventory_hostname, + creation_time=self._vm_model['properties']['timeCreated'], ) # set nic-related values from the primary NIC first diff --git a/ansible_collections/azure/azcollection/plugins/lookup/azure_keyvault_secret.py b/ansible_collections/azure/azcollection/plugins/lookup/azure_keyvault_secret.py index a3c809fd6..ea2183a5a 100644 --- a/ansible_collections/azure/azcollection/plugins/lookup/azure_keyvault_secret.py +++ b/ansible_collections/azure/azcollection/plugins/lookup/azure_keyvault_secret.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Hai Cao, <t-haicao@microsoft.com> +# Copyright (c) 2022 Hai Cao, <t-haicao@microsoft.com>, Marcin Slowikowski (@msl0) # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) @@ -10,11 +10,11 @@ DOCUMENTATION = """ name: azure_keyvault_secret author: - Hai Cao (@tk5eq) <t-haicao@microsoft.com> + - Marcin Slowikowski (@msl0) version_added: '1.12.0' requirements: - requests - azure - - msrest short_description: Read secret from Azure Key Vault. description: - This lookup returns the content of secret saved in Azure Key Vault. @@ -32,21 +32,23 @@ options: description: Secret of the service principal. tenant_id: description: Tenant id of service principal. - subscription_id: - description: Your Azure subscription Id. notes: - If version is not provided, this plugin will return the latest version of the secret. - If ansible is running on Azure Virtual Machine with MSI enabled, client_id, secret and tenant isn't required. - For enabling MSI on Azure VM, please refer to this doc https://docs.microsoft.com/en-us/azure/active-directory/managed-service-identity/ - After enabling MSI on Azure VM, remember to grant access of the Key Vault to the VM by adding a new Acess Policy in Azure Portal. - If MSI is not enabled on ansible host, it's required to provide a valid service principal which has access to the key vault. + - To authenticate via service principal, pass client_id, secret and tenant_id or set environment variables + AZURE_CLIENT_ID, AZURE_CLIENT_SECRET and AZURE_TENANT_ID. + - Authentication via C(az login) is also supported. - To use a plugin from a collection, please reference the full namespace, collection name, and lookup plugin name that you want to use. """ EXAMPLE = """ - name: Look up secret when azure cli login debug: - msg: msg: "{{ lookup('azure.azcollection.azure_keyvault_secret', 'testsecret', vault_url=key_vault_uri, subscription_id=subscription_id)}}" + msg: msg: "{{ lookup('azure.azcollection.azure_keyvault_secret', 'testsecret', vault_url=key_vault_uri)}}" + - name: Look up secret when ansible host is MSI enabled Azure VM debug: msg: "the value of this secret is {{ @@ -98,9 +100,9 @@ EXAMPLE = """ key_data: "{{ ssh_key }}" network_interfaces: "{{ vm_name }}" image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal publisher: Canonical - sku: 16.04-LTS + sku: 20_04-lts version: latest """ @@ -109,17 +111,16 @@ RETURN = """ description: secret content string """ -from ansible.errors import AnsibleError, AnsibleParserError +from ansible.errors import AnsibleError from ansible.plugins.lookup import LookupBase from ansible.utils.display import Display try: - import requests import logging - import os - from azure.common.credentials import ServicePrincipalCredentials, get_cli_profile - from azure.keyvault import KeyVaultClient - from msrest.exceptions import AuthenticationError, ClientRequestError - from azure.keyvault.models.key_vault_error import KeyVaultErrorException + import requests + from azure.keyvault.secrets import SecretClient + from azure.identity import DefaultAzureCredential, ClientSecretCredential + from azure.keyvault.secrets import SecretClient + except ImportError: pass @@ -127,6 +128,8 @@ display = Display() TOKEN_ACQUIRED = False +logger = logging.getLogger("azure.identity").setLevel(logging.ERROR) + token_params = { 'api-version': '2018-02-01', 'resource': 'https://vault.azure.net' @@ -154,37 +157,27 @@ except Exception: def lookup_secret_non_msi(terms, vault_url, kwargs): - logging.getLogger('msrestazure.azure_active_directory').addHandler(logging.NullHandler()) - logging.getLogger('msrest.service_client').addHandler(logging.NullHandler()) - - client_id = kwargs['client_id'] if kwargs.get('client_id') else os.environ.get('AZURE_CLIENT_ID') - secret = kwargs['secret'] if kwargs.get('secret') else os.environ.get('AZURE_SECRET') - tenant_id = kwargs['tenant_id'] if kwargs.get('tenant_id') else os.environ.get('AZURE_TENANT') - subscription_id = kwargs['subscription_id'] if kwargs.get('subscription_id') else os.environ.get('AZURE_SUBSCRIPTION_ID') - - try: - if client_id is not None and secret is not None and tenant_id is not None: - credentials = ServicePrincipalCredentials( - client_id=client_id, - secret=secret, - tenant=tenant_id - ) - elif subscription_id is not None: - profile = get_cli_profile() - credentials, subscription_id, tenant = profile.get_login_credentials( - subscription_id=subscription_id, resource="https://vault.azure.net") - client = KeyVaultClient(credentials) - except AuthenticationError: - raise AnsibleError('Invalid credentials provided.') + + client_id = kwargs['client_id'] if kwargs.get('client_id') else None + secret = kwargs['secret'] if kwargs.get('secret') else None + tenant_id = kwargs['tenant_id'] if kwargs.get('tenant_id') else None + + if all(v is not None for v in [client_id, secret, tenant_id]): + credential = ClientSecretCredential( + tenant_id=tenant_id, + client_id=client_id, + client_secret=secret, + ) + else: + credential = DefaultAzureCredential() + client = SecretClient(vault_url, credential) ret = [] for term in terms: try: - secret_val = client.get_secret(vault_url, term, '').value + secret_val = client.get_secret(term).value ret.append(secret_val) - except ClientRequestError: - raise AnsibleError('Error occurred in request') - except KeyVaultErrorException: + except Exception: raise AnsibleError('Failed to fetch secret ' + term + '.') return ret diff --git a/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py b/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py index 42026fac1..9c0e6e839 100644 --- a/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py +++ b/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py @@ -202,9 +202,6 @@ HAS_AZURE_EXC = None HAS_AZURE_CLI_CORE = True HAS_AZURE_CLI_CORE_EXC = None -HAS_MSRESTAZURE = True -HAS_MSRESTAZURE_EXC = None - try: import importlib except ImportError: @@ -221,21 +218,12 @@ except ImportError: HAS_PACKAGING_VERSION = False HAS_PACKAGING_VERSION_EXC = traceback.format_exc() -# NB: packaging issue sometimes cause msrestazure not to be installed, check it separately -try: - from msrest.serialization import Serializer -except ImportError: - HAS_MSRESTAZURE_EXC = traceback.format_exc() - HAS_MSRESTAZURE = False - try: from enum import Enum from msrestazure.azure_active_directory import AADTokenCredentials - from msrestazure.azure_exceptions import CloudError from msrestazure.azure_active_directory import MSIAuthentication - from azure.cli.core.auth.adal_authentication import MSIAuthenticationWrapper - from msrestazure.tools import parse_resource_id, resource_id, is_valid_resource_id - from msrestazure import azure_cloud + from azure.mgmt.core.tools import parse_resource_id, resource_id, is_valid_resource_id + from azure.cli.core import cloud as azure_cloud from azure.common.credentials import ServicePrincipalCredentials, UserPassCredentials from azure.mgmt.network import NetworkManagementClient from azure.mgmt.resource.resources import ResourceManagementClient @@ -252,11 +240,10 @@ try: from azure.mgmt.marketplaceordering import MarketplaceOrderingAgreements from azure.mgmt.trafficmanager import TrafficManagerManagementClient from azure.storage.blob import BlobServiceClient - from adal.authentication_context import AuthenticationContext + from msal.application import ClientApplication, ConfidentialClientApplication from azure.mgmt.authorization import AuthorizationManagementClient from azure.mgmt.sql import SqlManagementClient from azure.mgmt.servicebus import ServiceBusManagementClient - import azure.mgmt.servicebus.models as ServicebusModel from azure.mgmt.rdbms.postgresql import PostgreSQLManagementClient from azure.mgmt.rdbms.mysql import MySQLManagementClient from azure.mgmt.rdbms.mariadb import MariaDBManagementClient @@ -268,9 +255,6 @@ try: import azure.mgmt.automation.models as AutomationModel from azure.mgmt.iothub import IotHubClient from azure.mgmt.iothub import models as IoTHubModels - from msrest.service_client import ServiceClient - from msrestazure import AzureConfiguration - from msrest.authentication import Authentication from azure.mgmt.resource.locks import ManagementLockClient from azure.mgmt.recoveryservicesbackup import RecoveryServicesBackupClient import azure.mgmt.recoveryservicesbackup.models as RecoveryServicesBackupModels @@ -281,7 +265,7 @@ try: from azure.mgmt.eventhub import EventHubManagementClient from azure.mgmt.datafactory import DataFactoryManagementClient import azure.mgmt.datafactory.models as DataFactoryModel - from azure.identity._credentials import client_secret, user_password, certificate + from azure.identity._credentials import client_secret, user_password, certificate, managed_identity except ImportError as exc: Authentication = object @@ -411,10 +395,6 @@ class AzureRMModuleBase(object): self.fail(msg=missing_required_lib('packaging'), exception=HAS_PACKAGING_VERSION_EXC) - if not HAS_MSRESTAZURE: - self.fail(msg=missing_required_lib('msrestazure'), - exception=HAS_MSRESTAZURE_EXC) - if not HAS_AZURE: self.fail(msg=missing_required_lib('ansible[azure] (azure >= {0})'.format(AZURE_MIN_RELEASE)), exception=HAS_AZURE_EXC) @@ -594,8 +574,6 @@ class AzureRMModuleBase(object): ''' try: return self.rm_client.resource_groups.get(resource_group) - except CloudError as cloud_error: - self.fail("Error retrieving resource group {0} - {1}".format(resource_group, cloud_error.message)) except Exception as exc: self.fail("Error retrieving resource group {0} - {1}".format(resource_group, str(exc))) @@ -619,18 +597,7 @@ class AzureRMModuleBase(object): :param enum_modules: List of module names to build enum dependencies from. :return: serialized result ''' - enum_modules = [] if enum_modules is None else enum_modules - - dependencies = dict() - if enum_modules: - for module_name in enum_modules: - mod = importlib.import_module(module_name) - for mod_class_name, mod_class_obj in inspect.getmembers(mod, predicate=inspect.isclass): - dependencies[mod_class_name] = mod_class_obj - self.log("dependencies: ") - self.log(str(dependencies)) - serializer = Serializer(classes=dependencies) - return serializer.body(obj, class_name, keep_readonly=True) + return obj.as_dict() def get_poller_result(self, poller, wait=5): ''' @@ -998,13 +965,6 @@ class AzureRMModuleBase(object): result['skn'] = policy return 'SharedAccessSignature ' + urlencode(result) - def get_data_svc_client(self, **kwags): - url = kwags.get('base_url', None) - config = AzureConfiguration(base_url='https://{0}'.format(url)) - config.credentials = AzureSASAuthentication(token=self.generate_sas_token(**kwags)) - config = self.add_user_agent(config) - return ServiceClient(creds=config.credentials, config=config) - def get_subnet_detail(self, subnet_id): vnet_detail = subnet_id.split('/Microsoft.Network/virtualNetworks/')[1].split('/subnets/') return dict( @@ -1454,22 +1414,6 @@ class AzureRMModuleBase(object): return DataFactoryModel -class AzureSASAuthentication(Authentication): - """Simple SAS Authentication. - An implementation of Authentication in - https://github.com/Azure/msrest-for-python/blob/0732bc90bdb290e5f58c675ffdd7dbfa9acefc93/msrest/authentication.py - - :param str token: SAS token - """ - def __init__(self, token): - self.token = token - - def signed_session(self): - session = super(AzureSASAuthentication, self).signed_session() - session.headers['Authorization'] = self.token - return session - - class AzureRMAuthException(Exception): pass @@ -1481,7 +1425,7 @@ class AzureRMAuth(object): def __init__(self, auth_source=None, profile=None, subscription_id=None, client_id=None, secret=None, tenant=None, ad_user=None, password=None, cloud_environment='AzureCloud', cert_validation_mode='validate', api_profile='latest', adfs_authority_url=None, fail_impl=None, is_ad_resource=False, - x509_certificate_path=None, thumbprint=None, **kwargs): + x509_certificate_path=None, thumbprint=None, track1_cred=False, **kwargs): if fail_impl: self._fail_impl = fail_impl @@ -1560,11 +1504,13 @@ class AzureRMAuth(object): if self.credentials.get('auth_source') == 'msi': # MSI Credentials - self.azure_credentials = self.credentials['credentials'] + if is_ad_resource or track1_cred: + self.azure_credentials = self.credentials['credentials'] self.azure_credential_track2 = self.credentials['credential'] elif self.credentials.get('credentials') is not None: # AzureCLI credentials - self.azure_credentials = self.credentials['credentials'] + if is_ad_resource or track1_cred: + self.azure_credentials = self.credentials['credentials'] self.azure_credential_track2 = self.credentials['credentials'] elif self.credentials.get('client_id') is not None and \ self.credentials.get('secret') is not None and \ @@ -1572,63 +1518,70 @@ class AzureRMAuth(object): graph_resource = self._cloud_environment.endpoints.active_directory_graph_resource_id rm_resource = self._cloud_environment.endpoints.resource_manager - self.azure_credentials = ServicePrincipalCredentials(client_id=self.credentials['client_id'], - secret=self.credentials['secret'], - tenant=self.credentials['tenant'], - cloud_environment=self._cloud_environment, - resource=graph_resource if self.is_ad_resource else rm_resource, - verify=self._cert_validation_mode == 'validate') + if is_ad_resource or track1_cred: + self.azure_credentials = ServicePrincipalCredentials(client_id=self.credentials['client_id'], + secret=self.credentials['secret'], + tenant=self.credentials['tenant'], + cloud_environment=self._cloud_environment, + resource=graph_resource if self.is_ad_resource else rm_resource, + verify=self._cert_validation_mode == 'validate') self.azure_credential_track2 = client_secret.ClientSecretCredential(client_id=self.credentials['client_id'], client_secret=self.credentials['secret'], - tenant_id=self.credentials['tenant']) + tenant_id=self.credentials['tenant'], + authority=self._adfs_authority_url) elif self.credentials.get('client_id') is not None and \ self.credentials.get('tenant') is not None and \ self.credentials.get('thumbprint') is not None and \ self.credentials.get('x509_certificate_path') is not None: - - self.azure_credentials = self.acquire_token_with_client_certificate( - self._adfs_authority_url, - self._cloud_environment.endpoints.active_directory_resource_id, - self.credentials['x509_certificate_path'], - self.credentials['thumbprint'], - self.credentials['client_id'], - self.credentials['tenant']) + if is_ad_resource or track1_cred: + self.azure_credentials = self.acquire_token_with_client_certificate( + self._adfs_authority_url, + self.credentials['x509_certificate_path'], + self.credentials['thumbprint'], + self.credentials['client_id'], + self.credentials['tenant']) self.azure_credential_track2 = certificate.CertificateCredential(tenant_id=self.credentials['tenant'], client_id=self.credentials['client_id'], - certificate_path=self.credentials['x509_certificate_path']) + certificate_path=self.credentials['x509_certificate_path'], + authority=self._adfs_authority_url) + + elif self.credentials.get('ad_user') is not None and \ + self.credentials.get('password') is not None and \ + self.credentials.get('client_id') is not None and \ + self.credentials.get('tenant') is not None: + if is_ad_resource or track1_cred: + self.azure_credentials = self.acquire_token_with_username_password( + self._adfs_authority_url, + self.credentials['ad_user'], + self.credentials['password'], + self.credentials['client_id'], + self.credentials['tenant']) + self.azure_credential_track2 = user_password.UsernamePasswordCredential(username=self.credentials['ad_user'], + password=self.credentials['password'], + tenant_id=self.credentials.get('tenant'), + client_id=self.credentials.get('client_id'), + authority=self._adfs_authority_url) elif self.credentials.get('ad_user') is not None and self.credentials.get('password') is not None: tenant = self.credentials.get('tenant') if not tenant: tenant = 'common' # SDK default - self.azure_credentials = UserPassCredentials(self.credentials['ad_user'], - self.credentials['password'], - tenant=tenant, - cloud_environment=self._cloud_environment, - verify=self._cert_validation_mode == 'validate') + if is_ad_resource or track1_cred: + self.azure_credentials = UserPassCredentials(self.credentials['ad_user'], + self.credentials['password'], + tenant=tenant, + cloud_environment=self._cloud_environment, + verify=self._cert_validation_mode == 'validate') client_id = self.credentials.get('client_id', '04b07795-8ddb-461a-bbee-02f9e1bf7b46') - self.azure_credential_track2 = user_password.UsernamePasswordCredential(username=self.credentials['ad_user'], password=self.credentials['password'], tenant_id=self.credentials.get('tenant', 'organizations'), - client_id=client_id) - - elif self.credentials.get('ad_user') is not None and \ - self.credentials.get('password') is not None and \ - self.credentials.get('client_id') is not None and \ - self.credentials.get('tenant') is not None: - - self.azure_credentials = self.acquire_token_with_username_password( - self._adfs_authority_url, - self._cloud_environment.endpoints.active_directory_resource_id, - self.credentials['ad_user'], - self.credentials['password'], - self.credentials['client_id'], - self.credentials['tenant']) + client_id=client_id, + authority=self._adfs_authority_url) else: self.fail("Failed to authenticate with provided credentials. Some attributes were missing. " @@ -1688,12 +1641,12 @@ class AzureRMAuth(object): self.fail("cloud_environment {0} could not be resolved: {1}".format(_cloud_environment, str(exc)), exception=traceback.format_exc()) credentials = MSIAuthentication(client_id=client_id, cloud_environment=cloud_environment) - credential = MSIAuthenticationWrapper(client_id=client_id, cloud_environment=cloud_environment) + credential = managed_identity.ManagedIdentityCredential(client_id=client_id, cloud_environment=cloud_environment) subscription_id = subscription_id or self._get_env('subscription_id') if not subscription_id: try: # use the first subscription of the MSI - subscription_client = SubscriptionClient(credentials) + subscription_client = SubscriptionClient(credential) subscription = next(subscription_client.subscriptions.list()) subscription_id = str(subscription.subscription_id) except Exception as exc: @@ -1809,28 +1762,39 @@ class AzureRMAuth(object): return None - def acquire_token_with_username_password(self, authority, resource, username, password, client_id, tenant): + def acquire_token_with_username_password(self, authority, username, password, client_id, tenant): authority_uri = authority if tenant is not None: authority_uri = authority + '/' + tenant - context = AuthenticationContext(authority_uri) - token_response = context.acquire_token_with_username_password(resource, username, password, client_id) + context = ClientApplication(client_id=client_id, authority=authority_uri) + base_url = self._cloud_environment.endpoints.resource_manager + if not base_url.endswith("/"): + base_url += "/" + scopes = [base_url + ".default"] + token_response = context.acquire_token_by_username_password(username, password, scopes) return AADTokenCredentials(token_response) - def acquire_token_with_client_certificate(self, authority, resource, x509_certificate_path, thumbprint, client_id, tenant): + def acquire_token_with_client_certificate(self, authority, x509_private_key_path, thumbprint, client_id, tenant): authority_uri = authority if tenant is not None: authority_uri = authority + '/' + tenant - context = AuthenticationContext(authority_uri) - x509_certificate = None - with open(x509_certificate_path, 'rb') as pem_file: - x509_certificate = pem_file.read() - token_response = context.acquire_token_with_client_certificate(resource, client_id, x509_certificate, thumbprint) + x509_private_key = None + with open(x509_private_key_path, 'r') as pem_file: + x509_private_key = pem_file.read() + + base_url = self._cloud_environment.endpoints.resource_manager + if not base_url.endswith("/"): + base_url += "/" + scopes = [base_url + ".default"] + client_credential = {"thumbprint": thumbprint, "private_key": x509_private_key} + context = ConfidentialClientApplication(client_id=client_id, authority=authority_uri, client_credential=client_credential) + + token_response = context.acquire_token_for_client(scopes=scopes) return AADTokenCredentials(token_response) diff --git a/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common_ext.py b/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common_ext.py index df477c89b..0229e1027 100644 --- a/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common_ext.py +++ b/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common_ext.py @@ -7,8 +7,7 @@ __metaclass__ = type from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase -import re -from ansible.module_utils.common.dict_transformations import _camel_to_snake, _snake_to_camel +from ansible.module_utils.common.dict_transformations import _snake_to_camel from ansible.module_utils.six import string_types diff --git a/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common_rest.py b/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common_rest.py index 30908be53..6acb1e7b9 100644 --- a/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common_rest.py +++ b/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common_rest.py @@ -12,45 +12,45 @@ except Exception: ANSIBLE_VERSION = 'unknown' try: - from msrestazure.azure_exceptions import CloudError - from msrestazure.azure_configuration import AzureConfiguration - from msrest.service_client import ServiceClient - from msrest.pipeline import ClientRawResponse - from msrest.polling import LROPoller - from msrestazure.polling.arm_polling import ARMPolling + from azure.core._pipeline_client import PipelineClient + from azure.core.polling import LROPoller + from azure.core.pipeline import PipelineResponse + from azure.core.pipeline.policies import BearerTokenCredentialPolicy + from azure.mgmt.core.polling.arm_polling import ARMPolling import uuid - import json + from azure.core.configuration import Configuration except ImportError: # This is handled in azure_rm_common - AzureConfiguration = object + Configuration = object ANSIBLE_USER_AGENT = 'Ansible/{0}'.format(ANSIBLE_VERSION) -class GenericRestClientConfiguration(AzureConfiguration): +class GenericRestClientConfiguration(Configuration): - def __init__(self, credentials, subscription_id, base_url=None): + def __init__(self, credential, subscription_id, credential_scopes=None, base_url=None): - if credentials is None: + if credential is None: raise ValueError("Parameter 'credentials' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") if not base_url: base_url = 'https://management.azure.com' + if not credential_scopes: + credential_scopes = 'https://management.azure.com/.default' - super(GenericRestClientConfiguration, self).__init__(base_url) + super(GenericRestClientConfiguration, self).__init__() - self.add_user_agent(ANSIBLE_USER_AGENT) - - self.credentials = credentials + self.credentials = credential self.subscription_id = subscription_id + self.authentication_policy = BearerTokenCredentialPolicy(credential, credential_scopes) class GenericRestClient(object): - def __init__(self, credentials, subscription_id, base_url=None): - self.config = GenericRestClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + def __init__(self, credential, subscription_id, base_url=None, credential_scopes=None): + self.config = GenericRestClientConfiguration(credential, subscription_id, credential_scopes[0]) + self._client = PipelineClient(base_url, config=self.config) self.models = None def query(self, url, method, query_parameters, header_parameters, body, expected_status_codes, polling_timeout, polling_interval): @@ -65,31 +65,30 @@ class GenericRestClient(object): header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if method == 'GET': - request = self._client.get(url, query_parameters) + request = self._client.get(url, query_parameters, header_parameters, body) elif method == 'PUT': - request = self._client.put(url, query_parameters) + request = self._client.put(url, query_parameters, header_parameters, body) elif method == 'POST': - request = self._client.post(url, query_parameters) + request = self._client.post(url, query_parameters, header_parameters, body) elif method == 'HEAD': - request = self._client.head(url, query_parameters) + request = self._client.head(url, query_parameters, header_parameters, body) elif method == 'PATCH': - request = self._client.patch(url, query_parameters) + request = self._client.patch(url, query_parameters, header_parameters, body) elif method == 'DELETE': - request = self._client.delete(url, query_parameters) + request = self._client.delete(url, query_parameters, header_parameters, body) elif method == 'MERGE': - request = self._client.merge(url, query_parameters) + request = self._client.merge(url, query_parameters, header_parameters, body) - response = self._client.send(request, header_parameters, body, **operation_config) + response = self._client.send_request(request, **operation_config) if response.status_code not in expected_status_codes: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') + exp = SendRequestException(response, response.status_code) raise exp elif response.status_code == 202 and polling_timeout > 0: def get_long_running_output(response): return response poller = LROPoller(self._client, - ClientRawResponse(None, response), + PipelineResponse(None, response, None), get_long_running_output, ARMPolling(polling_interval, **operation_config)) response = self.get_poller_result(poller, polling_timeout) @@ -102,3 +101,9 @@ class GenericRestClient(object): return poller.result() except Exception as exc: raise + + +class SendRequestException(Exception): + def __init__(self, response, status_code): + self.response = response + self.status_code = status_code diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_account_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_account_info.py index 90e2799fe..5061604e2 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_account_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_account_info.py @@ -102,7 +102,6 @@ account_info: try: - from msrestazure.azure_exceptions import CloudError from azure.graphrbac import GraphRbacManagementClient from azure.graphrbac.models import GraphErrorException except ImportError: @@ -170,7 +169,7 @@ class AzureRMAccountInfo(AzureRMModuleBase): try: subscription_list_response = list(self.subscription_client.subscriptions.list()) - except CloudError as exc: + except Exception as exc: self.fail("Failed to list all subscriptions - {0}".format(str(exc))) results['id'] = subscription_list_response[0].subscription_id diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adapplication.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adapplication.py index f65f8b191..9f21728fc 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adapplication.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adapplication.py @@ -234,26 +234,26 @@ author: ''' EXAMPLES = ''' - - name: Create ad application - azure_rm_adapplication: - tenant: "{{ tenant_id }}" - display_name: "{{ display_name }}" - - - name: Create application with more parameter - azure_rm_adapplication: - tenant: "{{ tenant_id }}" - display_name: "{{ display_name }}" - available_to_other_tenants: False - credential_description: "for test" - end_date: 2021-10-01 - start_date: 2021-05-18 - identifier_uris: fredtest02.com - - - name: delete ad application - azure_rm_adapplication: - tenant: "{{ tenant_id }}" - app_id: "{{ app_id }}" - state: absent +- name: Create ad application + azure_rm_adapplication: + tenant: "{{ tenant_id }}" + display_name: "{{ display_name }}" + +- name: Create application with more parameter + azure_rm_adapplication: + tenant: "{{ tenant_id }}" + display_name: "{{ display_name }}" + available_to_other_tenants: false + credential_description: "for test" + end_date: 2021-10-01 + start_date: 2021-05-18 + identifier_uris: fredtest02.com + +- name: delete ad application + azure_rm_adapplication: + tenant: "{{ tenant_id }}" + app_id: "{{ app_id }}" + state: absent ''' RETURN = ''' @@ -322,7 +322,6 @@ output: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBaseExt try: - from msrestazure.azure_exceptions import CloudError from azure.graphrbac.models import GraphErrorException import datetime from dateutil.relativedelta import relativedelta diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adapplication_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adapplication_info.py index becfdd0b3..939058815 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adapplication_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adapplication_info.py @@ -48,21 +48,20 @@ author: ''' EXAMPLES = ''' - - name: get ad app info by App ID - azure_rm_adapplication_info: - app_id: "{{ app_id }}" - tenant: "{{ tenant_id }}" - - - name: get ad app info ---- by object ID - azure_rm_adapplication_info: - object_id: "{{ object_id }}" - tenant: "{{ tenant_id }}" - - - name: get ad app info ---- by identifier uri - azure_rm_adapplication_info: - identifier_uri: "{{ identifier_uri }}" - tenant: "{{ tenant_id }}" - +- name: get ad app info by App ID + azure_rm_adapplication_info: + app_id: "{{ app_id }}" + tenant: "{{ tenant_id }}" + +- name: get ad app info ---- by object ID + azure_rm_adapplication_info: + object_id: "{{ object_id }}" + tenant: "{{ tenant_id }}" + +- name: get ad app info ---- by identifier uri + azure_rm_adapplication_info: + identifier_uri: "{{ identifier_uri }}" + tenant: "{{ tenant_id }}" ''' RETURN = ''' @@ -101,7 +100,6 @@ applications: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBase try: - from msrestazure.azure_exceptions import CloudError from azure.graphrbac.models import GraphErrorException except ImportError: # This is handled in azure_rm_common diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adgroup.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adgroup.py index 092ed8c78..812b6953c 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adgroup.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adgroup.py @@ -74,100 +74,99 @@ author: ''' EXAMPLES = ''' - - name: Create Group - azure_rm_adgroup: - tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - display_name: "Group-Name" - mail_nickname: "Group-Mail-Nickname" - state: 'present' - - - name: Delete Group using display_name and mail_nickname - azure_rm_adgroup: - tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - display_name: "Group-Name" - mail_nickname: "Group-Mail-Nickname" - state: 'absent' - - - name: Delete Group using object_id - azure_rm_adgroup: - tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - state: 'absent' - - - name: Ensure Users are Members of a Group using display_name and mail_nickname - azure_rm_adgroup: - tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - display_name: "Group-Name" - mail_nickname: "Group-Mail-Nickname" - state: 'present' - present_members: - - "https://graph.windows.net/{{ tenant_id }}/directoryObjects/{{ ad_object_1_object_id }}" - - "https://graph.windows.net/{{ tenant_id }}/directoryObjects/{{ ad_object_2_object_id }}" - - - name: Ensure Users are Members of a Group using object_id - azure_rm_adgroup: - tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - state: 'present' - present_members: - - "https://graph.windows.net/{{ ad_object_1_tenant_id }}/directoryObjects/{{ ad_object_1_object_id }}" - - "https://graph.windows.net/{{ ad_object_2_tenant_id }}/directoryObjects/{{ ad_object_2_object_id }}" - - - name: Ensure Users are not Members of a Group using display_name and mail_nickname - azure_rm_adgroup: - tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - display_name: "Group-Name" - mail_nickname: "Group-Mail-Nickname" - state: 'present' - absent_members: - - "{{ ad_object_1_object_id }}" - - - name: Ensure Users are Members of a Group using object_id - azure_rm_adgroup: - tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - state: 'present' - absent_members: - - "{{ ad_object_1_object_id }}" - - - name: Ensure Users are Owners of a Group using display_name and mail_nickname - azure_rm_adgroup: - tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - display_name: "Group-Name" - mail_nickname: "Group-Mail-Nickname" - state: 'present' - present_owners: - - "https://graph.windows.net/{{ tenant_id }}/directoryObjects/{{ ad_object_1_object_id }}" - - "https://graph.windows.net/{{ tenant_id }}/directoryObjects/{{ ad_object_2_object_id }}" - - - name: Ensure Users are Owners of a Group using object_id - azure_rm_adgroup: - tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - state: 'present' - present_owners: - - "https://graph.windows.net/{{ ad_object_1_tenant_id }}/directoryObjects/{{ ad_object_1_object_id }}" - - "https://graph.windows.net/{{ ad_object_2_tenant_id }}/directoryObjects/{{ ad_object_2_object_id }}" - - - name: Ensure Users are not Owners of a Group using display_name and mail_nickname - azure_rm_adgroup: - tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - display_name: "Group-Name" - mail_nickname: "Group-Mail-Nickname" - state: 'present' - absent_owners: - - "{{ ad_object_1_object_id }}" - - "{{ ad_object_2_object_id }}" - - - name: Ensure Users are Owners of a Group using object_id - azure_rm_adgroup: - tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - state: 'present' - absent_owners: - - "{{ ad_object_1_object_id }}" - - "{{ ad_object_2_object_id }}" +- name: Create Group + azure_rm_adgroup: + tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + display_name: "Group-Name" + mail_nickname: "Group-Mail-Nickname" + state: 'present' + +- name: Delete Group using display_name and mail_nickname + azure_rm_adgroup: + tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + display_name: "Group-Name" + mail_nickname: "Group-Mail-Nickname" + state: 'absent' + +- name: Delete Group using object_id + azure_rm_adgroup: + tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + state: 'absent' + +- name: Ensure Users are Members of a Group using display_name and mail_nickname + azure_rm_adgroup: + tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + display_name: "Group-Name" + mail_nickname: "Group-Mail-Nickname" + state: 'present' + present_members: + - "https://graph.windows.net/{{ tenant_id }}/directoryObjects/{{ ad_object_1_object_id }}" + - "https://graph.windows.net/{{ tenant_id }}/directoryObjects/{{ ad_object_2_object_id }}" + +- name: Ensure Users are Members of a Group using object_id + azure_rm_adgroup: + tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + state: 'present' + present_members: + - "https://graph.windows.net/{{ ad_object_1_tenant_id }}/directoryObjects/{{ ad_object_1_object_id }}" + - "https://graph.windows.net/{{ ad_object_2_tenant_id }}/directoryObjects/{{ ad_object_2_object_id }}" + +- name: Ensure Users are not Members of a Group using display_name and mail_nickname + azure_rm_adgroup: + tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + display_name: "Group-Name" + mail_nickname: "Group-Mail-Nickname" + state: 'present' + absent_members: + - "{{ ad_object_1_object_id }}" +- name: Ensure Users are Members of a Group using object_id + azure_rm_adgroup: + tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + state: 'present' + absent_members: + - "{{ ad_object_1_object_id }}" + +- name: Ensure Users are Owners of a Group using display_name and mail_nickname + azure_rm_adgroup: + tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + display_name: "Group-Name" + mail_nickname: "Group-Mail-Nickname" + state: 'present' + present_owners: + - "https://graph.windows.net/{{ tenant_id }}/directoryObjects/{{ ad_object_1_object_id }}" + - "https://graph.windows.net/{{ tenant_id }}/directoryObjects/{{ ad_object_2_object_id }}" + +- name: Ensure Users are Owners of a Group using object_id + azure_rm_adgroup: + tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + state: 'present' + present_owners: + - "https://graph.windows.net/{{ ad_object_1_tenant_id }}/directoryObjects/{{ ad_object_1_object_id }}" + - "https://graph.windows.net/{{ ad_object_2_tenant_id }}/directoryObjects/{{ ad_object_2_object_id }}" + +- name: Ensure Users are not Owners of a Group using display_name and mail_nickname + azure_rm_adgroup: + tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + display_name: "Group-Name" + mail_nickname: "Group-Mail-Nickname" + state: 'present' + absent_owners: + - "{{ ad_object_1_object_id }}" + - "{{ ad_object_2_object_id }}" + +- name: Ensure Users are Owners of a Group using object_id + azure_rm_adgroup: + tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + state: 'present' + absent_owners: + - "{{ ad_object_1_object_id }}" + - "{{ ad_object_2_object_id }}" ''' RETURN = ''' @@ -222,7 +221,6 @@ group_members: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBase try: - from msrestazure.azure_exceptions import CloudError from azure.graphrbac.models import GraphErrorException from azure.graphrbac.models import GroupCreateParameters except ImportError: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adgroup_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adgroup_info.py index 9e8c5e456..37bc1febb 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adgroup_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adgroup_info.py @@ -73,52 +73,51 @@ author: ''' EXAMPLES = ''' - - name: Return a specific group using object_id - azure_rm_adgroup_info: - object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - - - name: Return a specific group using object_id and return the owners of the group - azure_rm_adgroup_info: - object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - return_owners: True - tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - - - name: Return a specific group using object_id and return the owners and members of the group - azure_rm_adgroup_info: - object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - return_owners: True - return_group_members: True - tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - - - name: Return a specific group using object_id and return the groups the group is a member of - azure_rm_adgroup_info: - object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - return_member_groups: True - tenant: "{{ tenant_id }}" - - - name: Return a specific group using object_id and check an ID for membership - azure_rm_adgroup_info: - object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - check_membership: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - - - name: Return a specific group using displayName for attribute_name - azure_rm_adgroup_info: - attribute_name: "displayName" - attribute_value: "Display-Name-Of-AD-Group" - tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - - - name: Return groups matching odata_filter - azure_rm_adgroup_info: - odata_filter: "mailNickname eq 'Mail-Nickname-Of-AD-Group'" - tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - - - name: Return all groups - azure_rm_adgroup_info: - tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - all: True - +- name: Return a specific group using object_id + azure_rm_adgroup_info: + object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + +- name: Return a specific group using object_id and return the owners of the group + azure_rm_adgroup_info: + object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + return_owners: true + tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + +- name: Return a specific group using object_id and return the owners and members of the group + azure_rm_adgroup_info: + object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + return_owners: true + return_group_members: true + tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + +- name: Return a specific group using object_id and return the groups the group is a member of + azure_rm_adgroup_info: + object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + return_member_groups: true + tenant: "{{ tenant_id }}" + +- name: Return a specific group using object_id and check an ID for membership + azure_rm_adgroup_info: + object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + check_membership: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + +- name: Return a specific group using displayName for attribute_name + azure_rm_adgroup_info: + attribute_name: "displayName" + attribute_value: "Display-Name-Of-AD-Group" + tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + +- name: Return groups matching odata_filter + azure_rm_adgroup_info: + odata_filter: "mailNickname eq 'Mail-Nickname-Of-AD-Group'" + tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + +- name: Return all groups + azure_rm_adgroup_info: + tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + all: true ''' RETURN = ''' @@ -173,7 +172,6 @@ group_members: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBase try: - from msrestazure.azure_exceptions import CloudError from azure.graphrbac.models import GraphErrorException from azure.graphrbac.models import CheckGroupMembershipParameters except ImportError: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adpassword.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adpassword.py index d56791864..587d842b5 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adpassword.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adpassword.py @@ -5,7 +5,6 @@ # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function -import datetime __metaclass__ = type @@ -66,7 +65,6 @@ options: extends_documentation_fragment: - azure.azcollection.azure - - azure.azcollection.azure_tags author: haiyuan_zhang (@haiyuazhang) @@ -75,12 +73,12 @@ author: ''' EXAMPLES = ''' - - name: create ad password - azure_rm_adpassword: - app_id: "{{ app_id }}" - state: present - value: "$abc12345678" - tenant: "{{ tenant_id }}" +- name: create ad password + azure_rm_adpassword: + app_id: "{{ app_id }}" + state: present + value: "$abc12345678" + tenant: "{{ tenant_id }}" ''' RETURN = ''' @@ -90,7 +88,7 @@ end_date: - Default value is one year after current time. type: str returned: always - sample: 2021-06-28T06:00:32.637070+00:00 + sample: "2021-06-28T06:00:32.637070+00:00" key_id: description: - The password key ID @@ -103,15 +101,15 @@ start_date: - Default value is current time. type: str returned: always - sample: 2020-06-28T06:00:32.637070+00:00 + sample: "2020-06-28T06:00:32.637070+00:00" ''' from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase import uuid +import datetime try: - from msrestazure.azure_exceptions import CloudError from azure.graphrbac.models import GraphErrorException from azure.graphrbac.models import PasswordCredential from azure.graphrbac.models import ApplicationUpdateParameters diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adpassword_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adpassword_info.py index 8fc99cb7e..7c82b7b9f 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adpassword_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adpassword_info.py @@ -5,7 +5,6 @@ # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function -import datetime __metaclass__ = type @@ -62,11 +61,11 @@ author: ''' EXAMPLES = ''' - - name: get ad password info - azure_rm_adpassword_info: - app_id: "{{ app_id }}" - tenant: "{{ tenant_id }}" - key_id: "{{ key_id }}" +- name: get ad password info + azure_rm_adpassword_info: + app_id: "{{ app_id }}" + tenant: "{{ tenant_id }}" + key_id: "{{ key_id }}" ''' RETURN = ''' @@ -86,9 +85,9 @@ passwords: description: - Date or datemtime after which credentials expire. - Default value is one year after current time. - type: datetime + type: str returned: always - sample: 2021-06-18T06:51:25.508304+00:00 + sample: "2021-06-18T06:51:25.508304+00:00" key_id: description: - The password key ID. @@ -99,19 +98,16 @@ passwords: description: - Date or datetime at which credentials become valid. - Default value is current time - type: datetime + type: str returned: always - sample: 2020-06-18T06:51:25.508304+00:00 + sample: "2020-06-18T06:51:25.508304+00:00" ''' from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase try: - from msrestazure.azure_exceptions import CloudError from azure.graphrbac.models import GraphErrorException - from azure.graphrbac.models import PasswordCredential - from azure.graphrbac.models import ApplicationUpdateParameters except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adserviceprincipal.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adserviceprincipal.py index ca5586e48..a7d3b39fd 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adserviceprincipal.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adserviceprincipal.py @@ -46,7 +46,6 @@ options: extends_documentation_fragment: - azure.azcollection.azure - - azure.azcollection.azure_tags author: haiyuan_zhang (@haiyuazhang) @@ -54,11 +53,11 @@ author: ''' EXAMPLES = ''' - - name: create ad sp - azure_rm_adserviceprincipal: - app_id: "{{ app_id }}" - state: present - tenant: "{{ tenant_id }}" +- name: create ad sp + azure_rm_adserviceprincipal: + app_id: "{{ app_id }}" + state: present + tenant: "{{ tenant_id }}" ''' RETURN = ''' @@ -92,12 +91,10 @@ object_id: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBaseExt try: from azure.graphrbac.models import ServicePrincipalCreateParameters - from azure.graphrbac.models import ServicePrincipalUpdateParameters except Exception: pass try: - from msrestazure.azure_exceptions import CloudError from azure.graphrbac.models import GraphErrorException except ImportError: # This is handled in azure_rm_common diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adserviceprincipal_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adserviceprincipal_info.py index 80e30b47f..db27ccae8 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adserviceprincipal_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_adserviceprincipal_info.py @@ -42,11 +42,10 @@ author: ''' EXAMPLES = ''' - - name: get ad sp info - azure_rm_adserviceprincipal_info: - app_id: "{{ app_id }}" - tenant: "{{ tenant_id }}" - +- name: get ad sp info + azure_rm_adserviceprincipal_info: + app_id: "{{ app_id }}" + tenant: "{{ tenant_id }}" ''' RETURN = ''' @@ -81,7 +80,6 @@ object_id: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBase try: - from msrestazure.azure_exceptions import CloudError from azure.graphrbac.models import GraphErrorException except ImportError: # This is handled in azure_rm_common diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aduser.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aduser.py index 2bfa04aac..b41c5ae7e 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aduser.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aduser.py @@ -151,7 +151,6 @@ EXAMPLES = ''' user_principal_name: "{{ user_id }}" tenant: "{{ tenant_id }}" state: "absent" - ''' RETURN = ''' @@ -202,7 +201,6 @@ user_type: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBase try: - from msrestazure.azure_exceptions import CloudError from azure.graphrbac.models import UserUpdateParameters from azure.graphrbac.models import UserCreateParameters from azure.graphrbac.models import PasswordProfile diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aduser_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aduser_info.py index 36d27d547..85460e741 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aduser_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aduser_info.py @@ -71,37 +71,37 @@ author: ''' EXAMPLES = ''' - - name: Using user_principal_name - azure.azcollection.azure_rm_aduser_info: - user_principal_name: user@contoso.com - tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - - - name: Using object_id - azure.azcollection.azure_rm_aduser_info: - object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - - - name: Using attribute mailNickname - not a collection - azure.azcollection.azure_rm_aduser_info: - attribute_name: mailNickname - attribute_value: users_mailNickname - tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - - - name: Using attribute proxyAddresses - a collection - azure.azcollection.azure_rm_aduser_info: - attribute_name: proxyAddresses - attribute_value: SMTP:user@contoso.com - tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - - - name: Using Filter mailNickname - azure.azcollection.azure_rm_aduser_info: - odata_filter: mailNickname eq 'user@contoso.com' - tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - - - name: Using Filter proxyAddresses - azure.azcollection.azure_rm_aduser_info: - odata_filter: proxyAddresses/any(c:c eq 'SMTP:user@contoso.com') - tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx +- name: Using user_principal_name + azure.azcollection.azure_rm_aduser_info: + user_principal_name: user@contoso.com + tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + +- name: Using object_id + azure.azcollection.azure_rm_aduser_info: + object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + +- name: Using attribute mailNickname - not a collection + azure.azcollection.azure_rm_aduser_info: + attribute_name: mailNickname + attribute_value: users_mailNickname + tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + +- name: Using attribute proxyAddresses - a collection + azure.azcollection.azure_rm_aduser_info: + attribute_name: proxyAddresses + attribute_value: SMTP:user@contoso.com + tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + +- name: Using Filter mailNickname + azure.azcollection.azure_rm_aduser_info: + odata_filter: mailNickname eq 'user@contoso.com' + tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + +- name: Using Filter proxyAddresses + azure.azcollection.azure_rm_aduser_info: + odata_filter: proxyAddresses/any(c:c eq 'SMTP:user@contoso.com') + tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx ''' RETURN = ''' @@ -152,7 +152,6 @@ user_type: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBase try: - from msrestazure.azure_exceptions import CloudError from azure.graphrbac.models import GraphErrorException except ImportError: # This is handled in azure_rm_common diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aks.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aks.py index 56e4fae2d..bb034b48b 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aks.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aks.py @@ -21,59 +21,74 @@ options: description: - Name of a resource group where the managed Azure Container Services (AKS) exists or will be created. required: true + type: str name: description: - Name of the managed Azure Container Services (AKS) instance. required: true + type: str state: description: - Assert the state of the AKS. Use C(present) to create or update an AKS and C(absent) to delete it. default: present + type: str choices: - absent - present location: description: - Valid azure location. Defaults to location of the resource group. + type: str dns_prefix: description: - DNS prefix specified when creating the managed cluster. + type: str kubernetes_version: description: - Version of Kubernetes specified when creating the managed cluster. + type: str linux_profile: description: - The Linux profile suboptions. - Optional, provide if you need an ssh access to the cluster nodes. + type: dict suboptions: admin_username: description: - The Admin Username for the cluster. required: true + type: str ssh_key: description: - The Public SSH Key used to access the cluster. required: true + type: str agent_pool_profiles: description: - The agent pool profile suboptions. + type: list + elements: dict suboptions: name: description: - Unique name of the agent pool profile in the context of the subscription and resource group. required: true + type: str count: description: - Number of agents (VMs) to host docker containers. - Allowed values must be in the range of C(1) to C(100) (inclusive). required: true + type: int vm_size: description: - The VM Size of each of the Agent Pool VM's (e.g. C(Standard_F1) / C(Standard_D2v2)). required: true + type: str os_disk_size_gb: description: - Size of the OS disk. + type: int enable_auto_scaling: description: - To enable auto-scaling. @@ -130,17 +145,43 @@ options: - 1 - 2 - 3 + os_type: + description: + - The operating system type. + type: str + choices: + - Linux + - Windows + storage_profiles: + description: + - Storage profile specifies what kind of storage used. + type: str + choices: + - StorageAccount + - ManagedDisks + ports: + description: + - List of the agent pool's port. + type: list + elements: int + dns_prefix: + description: + - DNS prefix specified when creating the managed cluster. + type: str service_principal: description: - The service principal suboptions. If not provided - use system-assigned managed identity. + type: dict suboptions: client_id: description: - The ID for the Service Principal. + type: str required: true client_secret: description: - The secret password associated with the service principal. + type: str enable_rbac: description: - Enable RBAC. @@ -150,6 +191,7 @@ options: network_profile: description: - Profile of network configuration. + type: dict suboptions: network_plugin: description: @@ -158,12 +200,13 @@ options: - With C(kubenet), nodes get an IP address from the Azure virtual network subnet. - AKS features such as Virtual Nodes or network policies aren't supported with C(kubenet). - C(azure) enables Azure Container Networking Interface(CNI), every pod gets an IP address from the subnet and can be accessed directly. - default: kubenet + type: str choices: - azure - kubenet network_policy: description: Network policy used for building Kubernetes network. + type: str choices: - azure - calico @@ -172,26 +215,27 @@ options: - A CIDR notation IP range from which to assign pod IPs when I(network_plugin=kubenet) is used. - It should be a large address space that isn't in use elsewhere in your network environment. - This address range must be large enough to accommodate the number of nodes that you expect to scale up to. - default: "10.244.0.0/16" + type: str service_cidr: description: - A CIDR notation IP range from which to assign service cluster IPs. - It must not overlap with any Subnet IP ranges. - It should be the *.10 address of your service IP address range. - default: "10.0.0.0/16" + type: str dns_service_ip: description: - An IP address assigned to the Kubernetes DNS service. - It must be within the Kubernetes service address range specified in serviceCidr. - default: "10.0.0.10" + type: str docker_bridge_cidr: description: - A CIDR notation IP range assigned to the Docker bridge network. - It must not overlap with any Subnet IP ranges or the Kubernetes service address range. - default: "172.17.0.1/16" + type: str load_balancer_sku: description: - The load balancer sku for the managed cluster. + type: str choices: - standard - basic @@ -199,12 +243,14 @@ options: description: - How outbound traffic will be configured for a cluster. type: str + default: loadBalancer choices: - loadBalancer - userDefinedRouting api_server_access_profile: description: - Profile of API Access configuration. + type: dict suboptions: authorized_ip_ranges: description: @@ -220,17 +266,22 @@ options: aad_profile: description: - Profile of Azure Active Directory configuration. + type: dict suboptions: client_app_id: description: The client AAD application ID. + type: str server_app_id: description: The server AAD application ID. + type: str server_app_secret: description: The server AAD application secret. + type: str tenant_id: description: - The AAD tenant ID to use for authentication. - If not specified, will use the tenant of the deployment subscription. + type: str managed: description: - Whether to enable manged AAD. @@ -252,39 +303,54 @@ options: description: - The HTTP application routing solution makes it easy to access applications that are deployed to your cluster. type: dict + aliases: + - httpApplicationRouting suboptions: enabled: description: - Whether the solution enabled. type: bool + default: true monitoring: description: - It gives you performance visibility by collecting memory and processor metrics from controllers, nodes, and containers that are available in Kubernetes through the Metrics API. type: dict + aliases: + - omsagent suboptions: enabled: description: - Whether the solution enabled. type: bool + default: true log_analytics_workspace_resource_id: description: - Where to store the container metrics. + type: str required: true + aliases: + - logAnalyticsWorkspaceResourceID virtual_node: description: - With virtual nodes, you have quick provisioning of pods, and only pay per second for their execution time. - You don't need to wait for Kubernetes cluster autoscaler to deploy VM compute nodes to run the additional pods. type: dict + aliases: + - aciConnector suboptions: enabled: description: - Whether the solution enabled. type: bool + default: true subnet_resource_id: description: - Subnet associated to the cluster. + type: str required: true + aliases: + - SubnetName node_resource_group: description: - Name of the resource group containing agent pool nodes. @@ -302,106 +368,106 @@ author: ''' EXAMPLES = ''' - - name: Create an AKS instance With A System Node Pool & A User Node Pool - azure_rm_aks: - name: myAKS - resource_group: myResourceGroup - location: eastus - dns_prefix: akstest - kubernetes_version: 1.14.6 - linux_profile: - admin_username: azureuser - ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAA... - service_principal: - client_id: "cf72ca99-f6b9-4004-b0e0-bee10c521948" - client_secret: "Password1234!" - agent_pool_profiles: - - name: default - count: 1 - vm_size: Standard_B2s - enable_auto_scaling: True - type: VirtualMachineScaleSets - mode: System - max_count: 3 - min_count: 1 - enable_rbac: yes - - name: user - count: 1 - vm_size: Standard_D2_v2 - enable_auto_scaling: True - type: VirtualMachineScaleSets - mode: User - max_count: 3 - min_count: 1 - enable_rbac: yes - - - name: Create a managed Azure Container Services (AKS) instance - azure_rm_aks: - name: myAKS - location: eastus - resource_group: myResourceGroup - dns_prefix: akstest - kubernetes_version: 1.14.6 - linux_profile: - admin_username: azureuser - ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAA... - service_principal: - client_id: "cf72ca99-f6b9-4004-b0e0-bee10c521948" - client_secret: "Password123!" - agent_pool_profiles: - - name: default - count: 5 - mode: System - vm_size: Standard_B2s - tags: - Environment: Production - - - name: Use minimal parameters and system-assigned identity - azure_rm_aks: - name: myMinimalCluster - location: eastus - resource_group: myExistingResourceGroup - dns_prefix: akstest - agent_pool_profiles: - - name: default - count: 1 - vm_size: Standard_D2_v2 - - - name: Create AKS with userDefinedRouting "Link:https://docs.microsoft.com/en-us/azure/aks/limit-egress-traffic#add-a-dnat-rule-to-azure-firewall" - azure_rm_aks: - name: "minimal{{ rpfx }}" - location: eastus - resource_group: "{{ resource_group }}" - kubernetes_version: "{{ versions.azure_aks_versions[0] }}" - dns_prefix: "aks{{ rpfx }}" - service_principal: - client_id: "{{ client_id }}" - client_secret: "{{ client_secret }}" - network_profile: - network_plugin: azure - load_balancer_sku: standard - outbound_type: userDefinedRouting - service_cidr: "10.41.0.0/16" - dns_service_ip: "10.41.0.10" - docker_bridge_cidr: "172.17.0.1/16" - api_server_access_profile: - authorized_ip_ranges: - - "20.106.246.252/32" - enable_private_cluster: no - agent_pool_profiles: - - name: default - count: 1 - vm_size: Standard_B2s - mode: System - vnet_subnet_id: "{{ output.subnets[0].id }}" - type: VirtualMachineScaleSets - enable_auto_scaling: false - - - name: Remove a managed Azure Container Services (AKS) instance - azure_rm_aks: - name: myAKS - resource_group: myResourceGroup - state: absent +- name: Create an AKS instance With A System Node Pool & A User Node Pool + azure_rm_aks: + name: myAKS + resource_group: myResourceGroup + location: eastus + dns_prefix: akstest + kubernetes_version: 1.14.6 + linux_profile: + admin_username: azureuser + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAA... + service_principal: + client_id: "cf72ca99-f6b9-4004-b0e0-bee10c521948" + client_secret: "Password1234!" + agent_pool_profiles: + - name: default + count: 1 + vm_size: Standard_B2s + enable_auto_scaling: true + type: VirtualMachineScaleSets + mode: System + max_count: 3 + min_count: 1 + enable_rbac: true + - name: user + count: 1 + vm_size: Standard_D2_v2 + enable_auto_scaling: true + type: VirtualMachineScaleSets + mode: User + max_count: 3 + min_count: 1 + enable_rbac: true + +- name: Create a managed Azure Container Services (AKS) instance + azure_rm_aks: + name: myAKS + location: eastus + resource_group: myResourceGroup + dns_prefix: akstest + kubernetes_version: 1.14.6 + linux_profile: + admin_username: azureuser + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAA... + service_principal: + client_id: "cf72ca99-f6b9-4004-b0e0-bee10c521948" + client_secret: "Password123!" + agent_pool_profiles: + - name: default + count: 5 + mode: System + vm_size: Standard_B2s + tags: + Environment: Production + +- name: Use minimal parameters and system-assigned identity + azure_rm_aks: + name: myMinimalCluster + location: eastus + resource_group: myExistingResourceGroup + dns_prefix: akstest + agent_pool_profiles: + - name: default + count: 1 + vm_size: Standard_D2_v2 + +- name: Create AKS with userDefinedRouting "Link:https://docs.microsoft.com/en-us/azure/aks/limit-egress-traffic#add-a-dnat-rule-to-azure-firewall" + azure_rm_aks: + name: "minimal{{ rpfx }}" + location: eastus + resource_group: "{{ resource_group }}" + kubernetes_version: "{{ versions.azure_aks_versions[0] }}" + dns_prefix: "aks{{ rpfx }}" + service_principal: + client_id: "{{ client_id }}" + client_secret: "{{ client_secret }}" + network_profile: + network_plugin: azure + load_balancer_sku: standard + outbound_type: userDefinedRouting + service_cidr: "10.41.0.0/16" + dns_service_ip: "10.41.0.10" + docker_bridge_cidr: "172.17.0.1/16" + api_server_access_profile: + authorized_ip_ranges: + - "20.106.246.252/32" + enable_private_cluster: false + agent_pool_profiles: + - name: default + count: 1 + vm_size: Standard_B2s + mode: System + vnet_subnet_id: "{{ output.subnets[0].id }}" + type: VirtualMachineScaleSets + enable_auto_scaling: false + +- name: Remove a managed Azure Container Services (AKS) instance + azure_rm_aks: + name: myAKS + resource_group: myResourceGroup + state: absent ''' RETURN = ''' state: @@ -611,8 +677,8 @@ agent_pool_profile_spec = dict( availability_zones=dict(type='list', elements='int', choices=[1, 2, 3]), os_type=dict(type='str', choices=['Linux', 'Windows']), orchestrator_version=dict(type='str', required=False), - type=dict(type='str', choice=['VirtualMachineScaleSets', 'AvailabilitySet']), - mode=dict(type='str', choice=['System', 'User']), + type=dict(type='str', choices=['VirtualMachineScaleSets', 'AvailabilitySet']), + mode=dict(type='str', choices=['System', 'User']), enable_auto_scaling=dict(type='bool'), max_count=dict(type='int'), node_labels=dict(type='dict'), @@ -623,12 +689,12 @@ agent_pool_profile_spec = dict( network_profile_spec = dict( network_plugin=dict(type='str', choices=['azure', 'kubenet']), - network_policy=dict(type='str'), + network_policy=dict(type='str', choices=['azure', 'calico']), pod_cidr=dict(type='str'), service_cidr=dict(type='str'), dns_service_ip=dict(type='str'), docker_bridge_cidr=dict(type='str'), - load_balancer_sku=dict(type='str'), + load_balancer_sku=dict(type='str', choices=['standard', 'basic']), outbound_type=dict(type='str', default='loadBalancer', choices=['userDefinedRouting', 'loadBalancer']) ) diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aks_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aks_info.py index 19e802833..c97bd893e 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aks_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aks_info.py @@ -23,9 +23,11 @@ options: name: description: - Limit results to a specific resource group. + type: str resource_group: description: - The resource group to search for the desired Azure Kubernetes Service + type: str tags: description: - Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. @@ -35,6 +37,7 @@ options: description: - Show kubeconfig of the AKS cluster. - Note the operation will cost more network overhead, not recommended when listing AKS. + type: str choices: - user - admin @@ -47,18 +50,18 @@ author: ''' EXAMPLES = ''' - - name: Get facts for one Azure Kubernetes Service - azure_rm_aks_info: - name: Testing - resource_group: myResourceGroup - - - name: Get facts for all Azure Kubernetes Services - azure_rm_aks_info: - - - name: Get facts by tags - azure_rm_aks_info: - tags: - - testing +- name: Get facts for one Azure Kubernetes Service + azure_rm_aks_info: + name: Testing + resource_group: myResourceGroup + +- name: Get facts for all Azure Kubernetes Services + azure_rm_aks_info: + +- name: Get facts by tags + azure_rm_aks_info: + tags: + - testing ''' RETURN = ''' @@ -118,10 +121,12 @@ class AzureRMManagedClusterInfo(AzureRMModuleBase): for key in self.module_args: setattr(self, key, kwargs[key]) - self.results['aks'] = ( - self.get_item() if self.name - else self.list_items() - ) + if self.name is not None and self.resource_group is not None: + self.results['aks'] = self.get_item() + elif self.resource_group is not None: + self.results['aks'] = self.list_by_resourcegroup() + else: + self.results['aks'] = self.list_items() return self.results @@ -145,13 +150,33 @@ class AzureRMManagedClusterInfo(AzureRMModuleBase): return result + def list_by_resourcegroup(self): + """Get all Azure Kubernetes Services""" + + self.log('List all Azure Kubernetes Services under resource group') + + try: + response = self.managedcluster_client.managed_clusters.list_by_resource_group(self.resource_group) + except Exception as exc: + self.fail('Failed to list all items - {0}'.format(str(exc))) + + results = [] + for item in response: + if self.has_tags(item.tags, self.tags): + item_dict = self.serialize_obj(item, AZURE_OBJECT_CLASS) + if self.show_kubeconfig: + item_dict['kube_config'] = self.get_aks_kubeconfig(self.resource_group, item.name) + results.append(item_dict) + + return results + def list_items(self): """Get all Azure Kubernetes Services""" self.log('List all Azure Kubernetes Services') try: - response = self.managedcluster_client.managed_clusters.list(self.resource_group) + response = self.managedcluster_client.managed_clusters.list() except Exception as exc: self.fail('Failed to list all items - {0}'.format(str(exc))) @@ -160,7 +185,7 @@ class AzureRMManagedClusterInfo(AzureRMModuleBase): if self.has_tags(item.tags, self.tags): item_dict = self.serialize_obj(item, AZURE_OBJECT_CLASS) if self.show_kubeconfig: - item_dict['kube_config'] = self.get_aks_kubeconfig(self.resource_group, item.name) + item_dict['kube_config'] = self.get_aks_kubeconfig(item.resource_group, item.name) results.append(item_dict) return results diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aksagentpool.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aksagentpool.py index b578826f6..f84362e95 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aksagentpool.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aksagentpool.py @@ -500,7 +500,7 @@ class AzureRMAksAgentPool(AzureRMModuleBase): mode=agent_pool.mode, orchestrator_version=agent_pool.orchestrator_version, node_image_version=agent_pool.node_image_version, - upgrade_settings=agent_pool.upgrade_settings, + upgrade_settings=dict(), provisioning_state=agent_pool.provisioning_state, availability_zones=[], enable_node_public_ip=agent_pool.enable_node_public_ip, @@ -511,6 +511,9 @@ class AzureRMAksAgentPool(AzureRMModuleBase): node_taints=agent_pool.node_taints, ) + if agent_pool.upgrade_settings is not None: + agent_pool_dict['upgrade_settings']['max_surge'] = agent_pool.upgrade_settings.max_surge + if agent_pool.availability_zones is not None: for key in agent_pool.availability_zones: agent_pool_dict['availability_zones'].append(int(key)) diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aksagentpool_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aksagentpool_info.py index 977261da8..59f3b696d 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aksagentpool_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aksagentpool_info.py @@ -41,17 +41,16 @@ author: ''' EXAMPLES = ''' - - name: Get node agent pool by cluster name - azure_rm_aksagentpool_info: - resource_group: myRG - cluster_name: testcluster - - - name: Get node agent pool by name - azure_rm_aksagentpool_info: - resource_group: myRG - cluster_name: testcluster - name: default +- name: Get node agent pool by cluster name + azure_rm_aksagentpool_info: + resource_group: myRG + cluster_name: testcluster +- name: Get node agent pool by name + azure_rm_aksagentpool_info: + resource_group: myRG + cluster_name: testcluster + name: default ''' RETURN = ''' @@ -310,7 +309,7 @@ class AzureRMAgentPoolInfo(AzureRMModuleBase): availability_zones=[], orchestrator_version=agent_pool.orchestrator_version, node_image_version=agent_pool.node_image_version, - upgrade_settings=agent_pool.upgrade_settings, + upgrade_settings=dict(), provisioning_state=agent_pool.provisioning_state, enable_node_public_ip=agent_pool.enable_node_public_ip, scale_set_priority=agent_pool.scale_set_priority, @@ -320,6 +319,9 @@ class AzureRMAgentPoolInfo(AzureRMModuleBase): node_taints=agent_pool.node_taints, ) + if agent_pool.upgrade_settings is not None: + agent_pool_dict['upgrade_settings']['max_surge'] = agent_pool.upgrade_settings.max_surge + if agent_pool.availability_zones is not None: for key in agent_pool.availability_zones: agent_pool_dict['availability_zones'].append(int(key)) diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aksagentpoolversion_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aksagentpoolversion_info.py index 33cf24317..790e8d278 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aksagentpoolversion_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aksagentpoolversion_info.py @@ -40,10 +40,10 @@ author: ''' EXAMPLES = ''' - - name: Get available versions an AKS can be upgrade to - azure_rm_aksagentpoolversion_info: - resource_group: myResourceGroup - cluster_name: myAKSName +- name: Get available versions an AKS can be upgrade to + azure_rm_aksagentpoolversion_info: + resource_group: myResourceGroup + cluster_name: myAKSName ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aksupgrade_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aksupgrade_info.py index ae17906a2..b4a40f86a 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aksupgrade_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aksupgrade_info.py @@ -39,11 +39,11 @@ author: ''' EXAMPLES = ''' - - name: Get available upgrade versions for AKS instance - azure_rm_aksupgrade_info: - name: myAKS - resource_group: myResourceGroup - register: myAKSupgrades +- name: Get available upgrade versions for AKS instance + azure_rm_aksupgrade_info: + name: myAKS + resource_group: myResourceGroup + register: myAKSupgrades ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aksversion_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aksversion_info.py index 4306fcce8..9e5af42ce 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aksversion_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_aksversion_info.py @@ -24,9 +24,11 @@ options: description: - Get the versions available for creating a managed Kubernetes cluster. required: true + type: str version: description: - Get the upgrade versions available for a managed Kubernetes cluster version. + type: str extends_documentation_fragment: - azure.azcollection.azure @@ -36,13 +38,13 @@ author: ''' EXAMPLES = ''' - - name: Get available versions for AKS in location eastus - azure_rm_aksversion_info: - location: eastus - - name: Get available versions an AKS can be upgrade to - azure_rm_aksversion_info: - location: eastis - version: 1.11.6 +- name: Get available versions for AKS in location eastus + azure_rm_aksversion_info: + location: eastus +- name: Get available versions an AKS can be upgrade to + azure_rm_aksversion_info: + location: eastis + version: 1.11.6 ''' RETURN = ''' @@ -54,13 +56,6 @@ azure_aks_versions: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase -try: - from msrestazure.azure_exceptions import CloudError - from azure.common import AzureHttpError -except Exception: - # handled in azure_rm_common - pass - class AzureRMAKSVersion(AzureRMModuleBase): diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_apimanagement.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_apimanagement.py index 221bd44b9..97a7868d1 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_apimanagement.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_apimanagement.py @@ -243,33 +243,33 @@ author: ''' EXAMPLES = ''' - - name: Create a new API instance - azure_rm_apimanagement: - resource_group: 'myResourceGroup' - service_name: myService - api_id: testApi - description: testDescription - display_name: TestAPI - service_url: 'http://testapi.example.net/api' - path: myapiPath - protocols: - - https - - name: Update an existing API instance. - azure_rm_apimanagement: - resource_group: myResourceGroup - service_name: myService - api_id: testApi - display_name: newTestAPI - service_url: 'http://testapi.example.net/api' - path: myapiPath - protocols: - - https - - name: ApiManagementDeleteApi - azure_rm_apimanagement: - resource_group: myResourceGroup - service_name: myService - api_id: testApi - state: absent +- name: Create a new API instance + azure_rm_apimanagement: + resource_group: 'myResourceGroup' + service_name: myService + api_id: testApi + description: testDescription + display_name: TestAPI + service_url: 'http://testapi.example.net/api' + path: myapiPath + protocols: + - https +- name: Update an existing API instance. + azure_rm_apimanagement: + resource_group: myResourceGroup + service_name: myService + api_id: testApi + display_name: newTestAPI + service_url: 'http://testapi.example.net/api' + path: myapiPath + protocols: + - https +- name: ApiManagementDeleteApi + azure_rm_apimanagement: + resource_group: myResourceGroup + service_name: myService + api_id: testApi + state: absent ''' RETURN = \ @@ -284,15 +284,7 @@ id: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_rest import GenericRestClient from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBaseExt -from copy import deepcopy -import time import json -import re -try: - from msrestazure.azure_exceptions import CloudError -except ImportError: - # This is handled in azure_rm_common - pass class Actions: @@ -544,6 +536,7 @@ class AzureApiManagement(AzureRMModuleBaseExt): response = None self.mgmt_client = self.get_mgmt_svc_client(GenericRestClient, + is_track2=True, base_url=self._cloud_environment.endpoints.resource_manager) old_response = self.get_resource() @@ -609,13 +602,13 @@ class AzureApiManagement(AzureRMModuleBaseExt): 600, 30, ) - except CloudError as exc: + except Exception as exc: self.log('Error while creating/updating the Api instance.') self.fail('Error creating the Api instance: {0}'.format(str(exc))) try: - response = json.loads(response.text) + response = json.loads(response.body()) except Exception: - response = {'text': response.text} + response = {'text': response.context['deserialized_data']} return response @@ -633,7 +626,7 @@ class AzureApiManagement(AzureRMModuleBaseExt): 30, ) isDeleted = True - except CloudError as e: + except Exception as e: self.log('Error attempting to delete the Api instance.') self.fail('Error deleting the Api instance: {0}'.format(str(e))) @@ -653,9 +646,9 @@ class AzureApiManagement(AzureRMModuleBaseExt): 30, ) isFound = True - response = json.loads(response.text) + response = json.loads(response.body()) self.log("Response : {0}".format(response)) - except CloudError as e: + except Exception as e: self.log('Could not find the Api instance from the given parameters.') if isFound is True: return response diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_apimanagement_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_apimanagement_info.py index d223ede2e..30120b5e5 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_apimanagement_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_apimanagement_info.py @@ -48,15 +48,15 @@ author: ''' EXAMPLES = ''' - - name: Get the information of api - azure_rm_apimanagement_info: - resource_group: myResourceGroup - service_name: myService - - name: Get the information of api - azure_rm_apimanagement_info: - resource_group: myResourceGroup - service_name: myService - api_id: testApi +- name: Get the information of api + azure_rm_apimanagement_info: + resource_group: myResourceGroup + service_name: myService +- name: Get the information of api + azure_rm_apimanagement_info: + resource_group: myResourceGroup + service_name: myService + api_id: testApi ''' RETURN = ''' @@ -100,15 +100,7 @@ api: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_rest import GenericRestClient from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBaseExt -from copy import deepcopy -import time import json -import re -try: - from msrestazure.azure_exceptions import CloudError -except ImportError: - # This is handled in azure_rm_common - pass class AzureApiManagementInfo(AzureRMModuleBaseExt): @@ -163,6 +155,7 @@ class AzureApiManagementInfo(AzureRMModuleBaseExt): self.body[key] = kwargs[key] self.mgmt_client = self.get_mgmt_svc_client(GenericRestClient, + is_track2=True, base_url=self._cloud_environment.endpoints.resource_manager) if (self.resource_group is not None and @@ -210,10 +203,10 @@ class AzureApiManagementInfo(AzureRMModuleBaseExt): 600, 30, ) - except CloudError as e: + except Exception as e: self.log('Could not get the information.{0}'.format(e)) try: - response = json.loads(response.text) + response = json.loads(response.body()) except Exception: return None @@ -233,10 +226,10 @@ class AzureApiManagementInfo(AzureRMModuleBaseExt): 600, 30, ) - except CloudError as e: + except Exception as e: self.log('Could not get info for the given api tags {0}'.format(e)) try: - response = json.loads(response.text) + response = json.loads(response.body()) except Exception: return None @@ -256,8 +249,8 @@ class AzureApiManagementInfo(AzureRMModuleBaseExt): 600, 30, ) - response = json.loads(response.text) - except CloudError as e: + response = json.loads(response.body()) + except Exception as e: self.log('Could not get info for a given services.{0}'.format(e)) try: response = json.loads(response.text) diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_apimanagementservice.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_apimanagementservice.py index 0c2860191..8c694bec4 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_apimanagementservice.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_apimanagementservice.py @@ -100,15 +100,8 @@ id: import time import json -import re from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_rest import GenericRestClient from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBaseExt -from copy import deepcopy -try: - from msrestazure.azure_exceptions import CloudError -except ImportError: - # This is handled in azure_rm_common - pass class Actions: @@ -197,6 +190,7 @@ class AzureRMApiManagementService(AzureRMModuleBaseExt): response = None self.mgmt_client = self.get_mgmt_svc_client(GenericRestClient, + is_track2=True, base_url=self._cloud_environment.endpoints.resource_manager) resource_group = self.get_resource_group(self.resource_group) @@ -286,14 +280,14 @@ class AzureRMApiManagementService(AzureRMModuleBaseExt): self.status_code, 600, 30) - except CloudError as exc: + except Exception as exc: self.log('Error attempting to create the ApiManagementService instance.') self.fail('Error creating the ApiManagementService instance: {0}'.format(str(exc))) try: - response = json.loads(response.text) + response = json.loads(response.body()) except Exception: - response = {'text': response.text} + response = {'text': response.context['deserialized_data']} pass return response @@ -309,7 +303,7 @@ class AzureRMApiManagementService(AzureRMModuleBaseExt): self.status_code, 600, 30) - except CloudError as e: + except Exception as e: self.log('Error attempting to delete the ApiManagementService instance.') self.fail('Error deleting the ApiManagementService instance: {0}'.format(str(e))) @@ -329,10 +323,10 @@ class AzureRMApiManagementService(AzureRMModuleBaseExt): 30) found = True self.log("Response : {0}".format(response)) - except CloudError as e: + except Exception as e: self.log('Did not find the ApiManagementService instance.') if found is True: - return json.loads(response.text) + return json.loads(response.body()) return False diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_apimanagementservice_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_apimanagementservice_info.py index 72891fe14..663e87e78 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_apimanagementservice_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_apimanagementservice_info.py @@ -117,16 +117,9 @@ api_management_service: sample: null ''' -import time import json from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_rest import GenericRestClient from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBaseExt -from copy import deepcopy -try: - from msrestazure.azure_exceptions import CloudError -except ImportError: - # This is handled in azure_rm_common - pass class AzureRMApiManagementServiceInfo(AzureRMModuleBaseExt): @@ -163,6 +156,7 @@ class AzureRMApiManagementServiceInfo(AzureRMModuleBaseExt): setattr(self, key, kwargs[key]) self.mgmt_client = self.get_mgmt_svc_client(GenericRestClient, + is_track2=True, base_url=self._cloud_environment.endpoints.resource_manager) if (self.resource_group is not None and self.name is not None): @@ -197,8 +191,8 @@ class AzureRMApiManagementServiceInfo(AzureRMModuleBaseExt): self.status_code, 600, 30) - results = json.loads(response.text) - except CloudError as e: + results = json.loads(response.body()) + except Exception as e: self.log('Could not get info for @(Model.ModuleOperationNameUpper).') return self.format_item(results) @@ -226,8 +220,8 @@ class AzureRMApiManagementServiceInfo(AzureRMModuleBaseExt): self.status_code, 600, 30) - results = json.loads(response.text) - except CloudError as e: + results = json.loads(response.body()) + except Exception as e: self.log('Could not get info for @(Model.ModuleOperationNameUpper).') return [self.format_item(x) for x in results['value']] if results['value'] else [] @@ -252,8 +246,8 @@ class AzureRMApiManagementServiceInfo(AzureRMModuleBaseExt): self.status_code, 600, 30) - results = json.loads(response.text) - except CloudError as e: + results = json.loads(response.body()) + except Exception as e: self.log('Could not get info for @(Model.ModuleOperationNameUpper).') return [self.format_item(x) for x in results['value']] if results['value'] else [] diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_appgateway.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_appgateway.py index 01f3b2eb5..f95766fa9 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_appgateway.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_appgateway.py @@ -21,13 +21,16 @@ options: description: - The name of the resource group. required: True + type: str name: description: - The name of the application gateway. required: True + type: str location: description: - Resource location. If not set, location from the resource group will be used as default. + type: str sku: description: - SKU of the application gateway resource. @@ -36,6 +39,7 @@ options: name: description: - Name of an application gateway SKU. + type: str choices: - 'standard_small' - 'standard_medium' @@ -47,6 +51,7 @@ options: tier: description: - Tier of an application gateway. + type: str choices: - 'standard' - 'standard_v2' @@ -55,6 +60,7 @@ options: capacity: description: - Capacity (instance count) of an application gateway. + type: int ssl_policy: description: - SSL policy of the application gateway resource. @@ -72,12 +78,14 @@ options: policy_type: description: - Type of SSL Policy. + type: str choices: - 'predefined' - 'custom' policy_name: description: - Name of Ssl C(predefined) policy. + type: str choices: - 'ssl_policy20150501' - 'ssl_policy20170401' @@ -119,6 +127,7 @@ options: min_protocol_version: description: - Minimum version of SSL protocol to be supported on application gateway. + type: str choices: - 'tls_v1_0' - 'tls_v1_1' @@ -137,15 +146,19 @@ options: id: description: - Full ID of the subnet resource. Required if I(name) and I(virtual_network_name) are not provided. + type: str name: description: - Name of the subnet. Only used if I(virtual_network_name) is also provided. + type: str virtual_network_name: description: - Name of the virtual network. Only used if I(name) is also provided. + type: str name: description: - Name of the resource that is unique within a resource group. This name can be used to access the resource. + type: str authentication_certificates: description: - Authentication certificates of the application gateway resource. @@ -155,9 +168,11 @@ options: data: description: - Certificate public data - base64 encoded pfx. + type: str name: description: - Name of the resource that is unique within a resource group. This name can be used to access the resource. + type: str redirect_configurations: description: - Redirect configurations of the application gateway resource. @@ -167,6 +182,7 @@ options: redirect_type: description: - Redirection type. + type: str choices: - 'permanent' - 'found' @@ -175,13 +191,18 @@ options: target_listener: description: - Reference to a listener to redirect the request to. + type: str request_routing_rules: description: - List of c(basic) request routing rule names within the application gateway to which the redirect is bound. version_added: "1.10.0" + type: list + elements: str url_path_maps: description: - List of URL path map names (c(path_based_routing) rules) within the application gateway to which the redirect is bound. + type: list + elements: str version_added: "1.10.0" path_rules: description: @@ -192,19 +213,24 @@ options: name: description: - Name of the URL rule. + type: str path_map_name: description: - Name of URL path map. + type: str version_added: "1.10.0" include_path: description: - Include path in the redirected url. + type: bool include_query_string: description: - Include query string in the redirected url. + type: bool name: description: - Name of the resource that is unique within a resource group. + type: str rewrite_rule_sets: description: - List of rewrite configurations for the application gateway resource. @@ -215,6 +241,7 @@ options: name: description: - Name of the rewrite rule set. + type: str required: True rewrite_rules: description: @@ -227,23 +254,28 @@ options: description: - Name of the rewrite rule. required: True + type: str rule_sequence: description: - Sequence of the rule that determines the order of execution within the set. required: True + type: int conditions: description: - Conditions based on which the action set execution will be evaluated. type: list elements: dict + default: [] suboptions: variable: description: - The parameter for the condition. + type: str required: True pattern: description: - The pattern, either fixed string or regular expression, that evaluates the truthfulness of the condition. + type: str required: True ignore_case: description: @@ -266,29 +298,37 @@ options: - List of actions to be taken on request headers. type: list elements: dict + default: [] suboptions: header_name: description: - Name of the header. + type: str required: True header_value: description: - Value of the header. - Leave the parameter unset to remove the header. + type: str + default: '' response_header_configurations: description: - List of actions to be taken on response headers. type: list elements: dict + default: [] suboptions: header_name: description: - Name of the header. + type: str required: True header_value: description: - Value of the header. - Leave the parameter unset to remove the header. + type: str + default: '' url_configuration: description: - Action to be taken on the URL. @@ -298,10 +338,12 @@ options: description: - Value to which the URL path will be rewriten. - Leave parameter unset to keep the original URL path. + type: str modified_query_string: description: - Value to which the URL query string will be rewriten. - Leave parameter unset to keep the original URL query string. + type: str reroute: description: - If set to true, will re-evaluate the path map provided in path-based request routing rules using modified path. @@ -317,13 +359,16 @@ options: description: - Base-64 encoded pfx certificate. - Only applicable in PUT Request. + type: str password: description: - Password for the pfx file specified in I(data). - Only applicable in PUT request. + type: str name: description: - Name of the resource that is unique within a resource group. This name can be used to access the resource. + type: str trusted_root_certificates: version_added: "1.15.0" description: @@ -342,6 +387,7 @@ options: key_vault_secret_id: description: - Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. + default: '' type: str frontend_ip_configurations: description: @@ -352,9 +398,11 @@ options: private_ip_address: description: - PrivateIPAddress of the network interface IP Configuration. + type: str private_ip_allocation_method: description: - PrivateIP allocation method. + type: str choices: - 'static' - 'dynamic' @@ -366,18 +414,23 @@ options: id: description: - Full ID of the subnet resource. Required if I(name) and I(virtual_network_name) are not provided. + type: str name: description: - Name of the subnet. Only used if I(virtual_network_name) is also provided. + type: str virtual_network_name: description: - Name of the virtual network. Only used if I(name) is also provided. + type: str public_ip_address: description: - Reference of the PublicIP resource. + type: raw name: description: - Name of the resource that is unique within a resource group. This name can be used to access the resource. + type: str frontend_ports: description: - List of frontend ports of the application gateway resource. @@ -387,9 +440,11 @@ options: port: description: - Frontend port. + type: str name: description: - Name of the resource that is unique within a resource group. This name can be used to access the resource. + type: str backend_address_pools: description: - List of backend address pool of the application gateway resource. @@ -405,12 +460,15 @@ options: fqdn: description: - Fully qualified domain name (FQDN). + type: str ip_address: description: - IP address. + type: str name: description: - Resource that is unique within a resource group. This name can be used to access the resource. + type: str probes: description: - Probes available to the application gateway resource. @@ -420,35 +478,42 @@ options: name: description: - Name of the I(probe) that is unique within an Application Gateway. + type: str protocol: description: - The protocol used for the I(probe). + type: str choices: - 'http' - 'https' host: description: - Host name to send the I(probe) to. + type: str path: description: - Relative path of I(probe). - Valid path starts from '/'. - Probe is sent to <Protocol>://<host>:<port><path>. + type: str timeout: description: - The probe timeout in seconds. - Probe marked as failed if valid response is not received with this timeout period. - Acceptable values are from 1 second to 86400 seconds. + type: int interval: description: - The probing interval in seconds. - This is the time interval between two consecutive probes. - Acceptable values are from 1 second to 86400 seconds. + type: int unhealthy_threshold: description: - The I(probe) retry count. - Backend server is marked down after consecutive probe failure count reaches UnhealthyThreshold. - Acceptable values are from 1 second to 20. + type: int pick_host_name_from_backend_http_settings: description: - Whether host header should be picked from the host name of the backend HTTP settings. Default value is false. @@ -463,18 +528,22 @@ options: probe: description: - Probe resource of an application gateway. + type: raw port: description: - The destination port on the backend. + type: int protocol: description: - The protocol used to communicate with the backend. + type: str choices: - 'http' - 'https' cookie_based_affinity: description: - Cookie based affinity. + type: str choices: - 'enabled' - 'disabled' @@ -497,6 +566,7 @@ options: - Request timeout in seconds. - Application Gateway will fail the request if response is not received within RequestTimeout. - Acceptable values are from 1 second to 86400 seconds. + type: int authentication_certificates: description: - List of references to application gateway authentication certificates. @@ -507,29 +577,35 @@ options: id: description: - Resource ID. + type: str trusted_root_certificates: version_added: "1.15.0" description: - Array of references to application gateway trusted root certificates. - Can be the name of the trusted root certificate or full resource ID. type: list - elements: str + elements: raw host_name: description: - Host header to be sent to the backend servers. + type: str pick_host_name_from_backend_address: description: - Whether host header should be picked from the host name of the backend server. Default value is false. + type: bool affinity_cookie_name: description: - Cookie name to use for the affinity cookie. + type: str path: description: - Path which should be used as a prefix for all C(http) requests. - Null means no path will be prefixed. Default value is null. + type: str name: description: - Name of the resource that is unique within a resource group. This name can be used to access the resource. + type: str http_listeners: description: - List of HTTP listeners of the application gateway resource. @@ -539,27 +615,34 @@ options: frontend_ip_configuration: description: - Frontend IP configuration resource of an application gateway. + type: raw frontend_port: description: - Frontend port resource of an application gateway. + type: raw protocol: description: - Protocol of the C(http) listener. + type: str choices: - 'http' - 'https' host_name: description: - Host name of C(http) listener. + type: str ssl_certificate: description: - SSL certificate resource of an application gateway. + type: raw require_server_name_indication: description: - Applicable only if I(protocol) is C(https). Enables SNI for multi-hosting. + type: bool name: description: - Name of the resource that is unique within a resource group. This name can be used to access the resource. + type: str url_path_maps: description: - List of URL path maps of the application gateway resource. @@ -569,18 +652,22 @@ options: name: description: - Name of the resource that is unique within the application gateway. This name can be used to access the resource. + type: str default_backend_address_pool: description: - Backend address pool resource of the application gateway which will be used if no path matches occur. - Mutually exclusive with I(default_redirect_configuration). + type: str default_backend_http_settings: description: - Backend http settings resource of the application gateway; used with I(default_backend_address_pool). + type: str default_rewrite_rule_set: description: - Default rewrite rule set for the path map. - Can be the name of the rewrite rule set or full resource ID. version_added: "1.11.0" + type: str path_rules: description: - List of URL path rules. @@ -590,22 +677,27 @@ options: name: description: - Name of the resource that is unique within the path map. + type: str backend_address_pool: description: - Backend address pool resource of the application gateway which will be used if the path is matched. - Mutually exclusive with I(redirect_configuration). + type: str backend_http_settings: description: - Backend http settings resource of the application gateway; used for the path's I(backend_address_pool). + type: str rewrite_rule_set: description: - Rewrite rule set for the path map. - Can be the name of the rewrite rule set or full resource ID. + type: str version_added: "1.11.0" redirect_configuration: description: - Name of redirect configuration resource of the application gateway which will be used if the path is matched. - Mutually exclusive with I(backend_address_pool). + type: str version_added: "1.10.0" paths: description: @@ -616,6 +708,7 @@ options: description: - Name of redirect configuration resource of the application gateway which will be used if no path matches occur. - Mutually exclusive with I(default_backend_address_pool). + type: str version_added: "1.10.0" request_routing_rules: description: @@ -626,31 +719,39 @@ options: rule_type: description: - Rule type. + type: str choices: - 'basic' - 'path_based_routing' backend_address_pool: description: - Backend address pool resource of the application gateway. Not used if I(rule_type) is C(path_based_routing). + type: raw backend_http_settings: description: - Backend C(http) settings resource of the application gateway. + type: raw http_listener: description: - Http listener resource of the application gateway. + type: raw name: description: - Name of the resource that is unique within a resource group. This name can be used to access the resource. + type: str redirect_configuration: description: - Redirect configuration resource of the application gateway. + type: raw url_path_map: description: - URL path map resource of the application gateway. Required if I(rule_type) is C(path_based_routing). + type: raw rewrite_rule_set: description: - Rewrite rule set for the path map. - Can be the name of the rewrite rule set or full resource ID. + type: raw version_added: "1.11.0" autoscale_configuration: version_added: "1.15.0" @@ -683,6 +784,7 @@ options: - The disabled rule groups. type: list elements: dict + default: [] suboptions: rule_group_name: description: @@ -693,6 +795,7 @@ options: - The list of rules that will be disabled. If null, all rules of the rule group will be disabled. type: list elements: int + default: [] enabled: description: - Whether the web application firewall is enabled or not. @@ -702,6 +805,7 @@ options: - The exclusion list. type: list elements: dict + default: [] suboptions: match_variable: description: @@ -761,6 +865,7 @@ options: description: - Assert the state of the application gateway. Use C(present) to create or update and C(absent) to delete. default: present + type: str choices: - absent - present @@ -803,15 +908,15 @@ EXAMPLES = ''' protocol: http cookie_based_affinity: enabled connection_draining: - drain_timeout_in_sec: 60 - enabled: true + drain_timeout_in_sec: 60 + enabled: true name: sample_appgateway_http_settings http_listeners: - frontend_ip_configuration: sample_gateway_frontend_ip_config frontend_port: ag_frontend_port name: sample_http_listener request_routing_rules: - - rule_type: Basic + - rule_type: basic backend_address_pool: test_backend_address_pool backend_http_settings: sample_appgateway_http_settings http_listener: sample_http_listener @@ -848,8 +953,8 @@ EXAMPLES = ''' protocol: http cookie_based_affinity: enabled connection_draining: - drain_timeout_in_sec: 60 - enabled: true + drain_timeout_in_sec: 60 + enabled: true name: sample_appgateway_http_settings trusted_root_certificates: - "root_cert" @@ -858,7 +963,7 @@ EXAMPLES = ''' frontend_port: ag_frontend_port name: sample_http_listener request_routing_rules: - - rule_type: Basic + - rule_type: basic backend_address_pool: test_backend_address_pool backend_http_settings: sample_appgateway_http_settings http_listener: sample_http_listener @@ -899,7 +1004,7 @@ EXAMPLES = ''' frontend_port: ag_frontend_port name: sample_http_listener request_routing_rules: - - rule_type: Basic + - rule_type: basic backend_address_pool: test_backend_address_pool backend_http_settings: sample_appgateway_http_settings http_listener: sample_http_listener @@ -1196,20 +1301,20 @@ EXAMPLES = ''' - header_name: "Foo" header_value: "Bar" probes: - - name: "http-probe1" - interval: 30 - path: "/abc" - protocol: "https" - pick_host_name_from_backend_http_settings: true - timeout: 30 - unhealthy_threshold: 2 - - name: "http-probe2" - interval: 30 - path: "/xyz" - protocol: "http" - pick_host_name_from_backend_http_settings: true - timeout: 30 - unhealthy_threshold: 2 + - name: "http-probe1" + interval: 30 + path: "/abc" + protocol: "https" + pick_host_name_from_backend_http_settings: true + timeout: 30 + unhealthy_threshold: 2 + - name: "http-probe2" + interval: 30 + path: "/xyz" + protocol: "http" + pick_host_name_from_backend_http_settings: true + timeout: 30 + unhealthy_threshold: 2 redirect_configurations: - name: "redirect-http" redirect_type: "permanent" @@ -1261,7 +1366,7 @@ EXAMPLES = ''' frontend_port: ag_frontend_port name: sample_http_listener request_routing_rules: - - rule_type: Basic + - rule_type: basic backend_address_pool: test_backend_address_pool backend_http_settings: sample_appgateway_http_settings http_listener: sample_http_listener @@ -1300,7 +1405,7 @@ EXAMPLES = ''' frontend_port: ag_frontend_port name: sample_http_listener request_routing_rules: - - rule_type: Basic + - rule_type: basic backend_address_pool: test_backend_address_pool backend_http_settings: sample_appgateway_http_settings http_listener: sample_http_listener @@ -1376,7 +1481,7 @@ from ansible.module_utils.common.dict_transformations import ( try: from azure.core.exceptions import ResourceNotFoundError from azure.core.polling import LROPoller - from msrestazure.tools import parse_resource_id, is_valid_resource_id + from azure.mgmt.core.tools import parse_resource_id, is_valid_resource_id except ImportError: # This is handled in azure_rm_common pass @@ -1394,11 +1499,21 @@ sku_spec = dict( ssl_policy_spec = dict( - disabled_ssl_protocols=dict(type='list'), + disabled_ssl_protocols=dict(type='list', elements='str', choices=['tls_v1_0', 'tls_v1_1', 'tls_v1_2']), policy_type=dict(type='str', choices=['predefined', 'custom']), policy_name=dict(type='str', choices=['ssl_policy20150501', 'ssl_policy20170401', 'ssl_policy20170401_s']), - cipher_suites=dict(type='list'), - min_protocol_version=dict(type='str', choices=['tls_v1_0', 'tls_v1_1', 'tls_v1_2']) + min_protocol_version=dict(type='str', choices=['tls_v1_0', 'tls_v1_1', 'tls_v1_2']), + cipher_suites=dict(type='list', elements='str', + choices=['tls_ecdhe_rsa_with_aes_256_gcm_sha384', 'tls_ecdhe_rsa_with_aes_128_gcm_sha256', 'tls_ecdhe_rsa_with_aes_256_cbc_sha384', + 'tls_ecdhe_rsa_with_aes_128_cbc_sha256', 'tls_ecdhe_rsa_with_aes_256_cbc_sha', 'tls_ecdhe_rsa_with_aes_128_cbc_sha', + 'tls_dhe_rsa_with_aes_256_gcm_sha384', 'tls_dhe_rsa_with_aes_128_gcm_sha256', 'tls_dhe_rsa_with_aes_256_cbc_sha', + 'tls_dhe_rsa_with_aes_128_cbc_sha', 'tls_rsa_with_aes_256_gcm_sha384', 'tls_rsa_with_aes_128_gcm_sha256', + 'tls_rsa_with_aes_256_cbc_sha256', 'tls_rsa_with_aes_128_cbc_sha256', 'tls_rsa_with_aes_256_cbc_sha', + 'tls_rsa_with_aes_128_cbc_sha', 'tls_ecdhe_ecdsa_with_aes_256_gcm_sha384', 'tls_ecdhe_ecdsa_with_aes_128_gcm_sha256', + 'tls_ecdhe_ecdsa_with_aes_256_cbc_sha384', 'tls_ecdhe_ecdsa_with_aes_128_cbc_sha256', + 'tls_ecdhe_ecdsa_with_aes_256_cbc_sha', 'tls_ecdhe_ecdsa_with_aes_128_cbc_sha', 'tls_dhe_dss_with_aes_256_cbc_sha256', + 'tls_dhe_dss_with_aes_128_cbc_sha256', 'tls_dhe_dss_with_aes_256_cbc_sha', 'tls_dhe_dss_with_aes_128_cbc_sha', + 'tls_rsa_with_3des_ede_cbc_sha', 'tls_dhe_dss_with_3des_ede_cbc_sha']), ) @@ -1561,13 +1676,36 @@ class AzureRMApplicationGateways(AzureRMModuleBase): options=ssl_policy_spec ), gateway_ip_configurations=dict( - type='list' + type='list', + elements='dict', + options=dict( + name=dict(type='str'), + subnet=dict( + type='dict', + options=dict( + id=dict(type='str'), + name=dict(type='str'), + virtual_network_name=dict(type='str') + ) + ) + ) ), authentication_certificates=dict( - type='list' + type='list', + elements='dict', + options=dict( + name=dict(type='str'), + data=dict(type='str') + ), ), ssl_certificates=dict( - type='list' + type='list', + elements='dict', + options=dict( + data=dict(type='str'), + password=dict(type='str', no_log=True), + name=dict(type='str') + ) ), trusted_root_certificates=dict( type='list', @@ -1585,16 +1723,76 @@ class AzureRMApplicationGateways(AzureRMModuleBase): options=rewrite_rule_set_spec ), frontend_ip_configurations=dict( - type='list' + type='list', + elements='dict', + options=dict( + private_ip_address=dict(type='str'), + private_ip_allocation_method=dict(type='str', choices=['static', 'dynamic']), + public_ip_address=dict(type='raw'), + name=dict(type='str'), + subnet=dict( + type='dict', + options=dict( + id=dict(type='str'), + name=dict(type='str'), + virtual_network_name=dict(type='str') + ) + ) + ) ), frontend_ports=dict( - type='list' + type='list', + elements='dict', + options=dict( + port=dict(type='str'), + name=dict(type='str') + ) ), backend_address_pools=dict( - type='list' + type='list', + elements='dict', + options=dict( + name=dict(type='str'), + backend_addresses=dict( + type='list', + elements='dict', + options=dict( + fqdn=dict(type='str'), + ip_address=dict(type='str') + ) + ) + ) ), backend_http_settings_collection=dict( - type='list' + type='list', + elements='dict', + options=dict( + probe=dict(type='raw'), + port=dict(type='int'), + protocol=dict(type='str', choices=['http', 'https']), + cookie_based_affinity=dict(type='str', choices=['enabled', 'disabled']), + connection_draining=dict( + type='dict', + options=dict( + drain_timeout_in_sec=dict(type='int'), + enabled=dict(type='bool') + ) + ), + request_timeout=dict(type='int'), + authentication_certificates=dict( + type='list', + elements='dict', + options=dict( + id=dict(type='str') + ) + ), + trusted_root_certificates=dict(type='list', elements='raw'), + host_name=dict(type='str'), + pick_host_name_from_backend_address=dict(type='bool'), + affinity_cookie_name=dict(type='str'), + path=dict(type='str'), + name=dict(type='str') + ) ), probes=dict( type='list', @@ -1602,7 +1800,17 @@ class AzureRMApplicationGateways(AzureRMModuleBase): options=probe_spec ), http_listeners=dict( - type='list' + type='list', + elements='dict', + options=dict( + frontend_ip_configuration=dict(type='raw'), + frontend_port=dict(type='raw'), + protocol=dict(type='str', choices=['http', 'https']), + host_name=dict(type='str'), + ssl_certificate=dict(type='raw'), + require_server_name_indication=dict(type='bool'), + name=dict(type='str'), + ) ), url_path_maps=dict( type='list', @@ -1613,7 +1821,18 @@ class AzureRMApplicationGateways(AzureRMModuleBase): required_together=[('default_backend_address_pool', 'default_backend_http_settings')], ), request_routing_rules=dict( - type='list' + type='list', + elements='dict', + options=dict( + rule_type=dict(type='str', choices=['basic', 'path_based_routing']), + backend_address_pool=dict(type='raw'), + backend_http_settings=dict(type='raw'), + http_listener=dict(type='raw'), + name=dict(type='str'), + redirect_configuration=dict(type='raw'), + rewrite_rule_set=dict(type='raw'), + url_path_map=dict(type='raw'), + ) ), autoscale_configuration=dict( type='dict', @@ -1730,7 +1949,8 @@ class AzureRMApplicationGateways(AzureRMModuleBase): ev = kwargs[key] for i in range(len(ev)): item = ev[i] - if 'subnet' in item and 'name' in item['subnet'] and 'virtual_network_name' in item['subnet']: + if 'subnet' in item and item['subnet'] is not None and 'name' in item['subnet'] and item['subnet']['name'] is not None and \ + 'virtual_network_name' in item['subnet'] and item['subnet']['virtual_network_name'] is not None: id = subnet_id(self.subscription_id, kwargs['resource_group'], item['subnet']['virtual_network_name'], @@ -1806,14 +2026,15 @@ class AzureRMApplicationGateways(AzureRMModuleBase): ev = kwargs[key] for i in range(len(ev)): item = ev[i] - if 'private_ip_allocation_method' in item: + if 'private_ip_allocation_method' in item and item['private_ip_allocation_method'] is not None: item['private_ip_allocation_method'] = _snake_to_camel(item['private_ip_allocation_method'], True) - if 'public_ip_address' in item: + if 'public_ip_address' in item and item['public_ip_address'] is not None: id = public_ip_id(self.subscription_id, kwargs['resource_group'], item['public_ip_address']) item['public_ip_address'] = {'id': id} - if 'subnet' in item and 'name' in item['subnet'] and 'virtual_network_name' in item['subnet']: + if 'subnet' in item and item['subnet'] is not None and 'name' in item['subnet'] and item['subnet']['name'] is not None and \ + 'virtual_network_name' in item['subnet'] and item['subnet']['virtual_network_name'] is not None: id = subnet_id(self.subscription_id, kwargs['resource_group'], item['subnet']['virtual_network_name'], @@ -1828,7 +2049,7 @@ class AzureRMApplicationGateways(AzureRMModuleBase): ev = kwargs[key] for i in range(len(ev)): item = ev[i] - if 'protocol' in item: + if 'protocol' in item and item['protocol'] is not None: item['protocol'] = _snake_to_camel(item['protocol'], True) if 'pick_host_name_from_backend_http_settings' in item and item['pick_host_name_from_backend_http_settings'] and 'host' in item: del item['host'] @@ -1837,17 +2058,17 @@ class AzureRMApplicationGateways(AzureRMModuleBase): ev = kwargs[key] for i in range(len(ev)): item = ev[i] - if 'protocol' in item: + if 'protocol' in item and item['protocol'] is not None: item['protocol'] = _snake_to_camel(item['protocol'], True) - if 'cookie_based_affinity' in item: + if 'cookie_based_affinity' in item and item['cookie_based_affinity'] is not None: item['cookie_based_affinity'] = _snake_to_camel(item['cookie_based_affinity'], True) - if 'probe' in item: + if 'probe' in item and item['probe'] is not None: id = probe_id(self.subscription_id, kwargs['resource_group'], kwargs['name'], item['probe']) item['probe'] = {'id': id} - if 'trusted_root_certificates' in item: + if 'trusted_root_certificates' in item and item['trusted_root_certificates'] is not None: for j in range(len(item['trusted_root_certificates'])): id = item['trusted_root_certificates'][j] id = id if is_valid_resource_id(id) else trusted_root_certificate_id(self.subscription_id, @@ -1860,26 +2081,26 @@ class AzureRMApplicationGateways(AzureRMModuleBase): ev = kwargs[key] for i in range(len(ev)): item = ev[i] - if 'frontend_ip_configuration' in item: + if 'frontend_ip_configuration' in item and item['frontend_ip_configuration'] is not None: id = frontend_ip_configuration_id(self.subscription_id, kwargs['resource_group'], kwargs['name'], item['frontend_ip_configuration']) item['frontend_ip_configuration'] = {'id': id} - if 'frontend_port' in item: + if 'frontend_port' in item and item['frontend_port'] is not None: id = frontend_port_id(self.subscription_id, kwargs['resource_group'], kwargs['name'], item['frontend_port']) item['frontend_port'] = {'id': id} - if 'ssl_certificate' in item: + if 'ssl_certificate' in item and item['ssl_certificate'] is not None: id = ssl_certificate_id(self.subscription_id, kwargs['resource_group'], kwargs['name'], item['ssl_certificate']) item['ssl_certificate'] = {'id': id} - if 'protocol' in item: + if 'protocol' in item and item['protocol'] is not None: item['protocol'] = _snake_to_camel(item['protocol'], True) ev[i] = item self.parameters["http_listeners"] = ev @@ -1887,7 +2108,7 @@ class AzureRMApplicationGateways(AzureRMModuleBase): ev = kwargs[key] for i in range(len(ev)): item = ev[i] - if item['default_backend_address_pool']: + if item['default_backend_address_pool'] and item['default_backend_address_pool'] is not None: id = backend_address_pool_id(self.subscription_id, kwargs['resource_group'], kwargs['name'], @@ -1895,7 +2116,7 @@ class AzureRMApplicationGateways(AzureRMModuleBase): item['default_backend_address_pool'] = {'id': id} else: del item['default_backend_address_pool'] - if item['default_backend_http_settings']: + if item['default_backend_http_settings'] and item['default_backend_http_settings'] is not None: id = backend_http_settings_id(self.subscription_id, kwargs['resource_group'], kwargs['name'], @@ -1907,7 +2128,7 @@ class AzureRMApplicationGateways(AzureRMModuleBase): ev2 = item['path_rules'] for j in range(len(ev2)): item2 = ev2[j] - if item2['backend_address_pool']: + if item2['backend_address_pool'] and item2['backend_address_pool'] is not None: id = backend_address_pool_id(self.subscription_id, kwargs['resource_group'], kwargs['name'], @@ -1915,7 +2136,7 @@ class AzureRMApplicationGateways(AzureRMModuleBase): item2['backend_address_pool'] = {'id': id} else: del item2['backend_address_pool'] - if item2['backend_http_settings']: + if item2['backend_http_settings'] and item2['backend_http_settings'] is not None: id = backend_http_settings_id(self.subscription_id, kwargs['resource_group'], kwargs['name'], @@ -1923,7 +2144,7 @@ class AzureRMApplicationGateways(AzureRMModuleBase): item2['backend_http_settings'] = {'id': id} else: del item2['backend_http_settings'] - if item2['redirect_configuration']: + if item2['redirect_configuration'] and item2['redirect_configuration'] is not None: id = redirect_configuration_id(self.subscription_id, kwargs['resource_group'], kwargs['name'], @@ -1964,37 +2185,38 @@ class AzureRMApplicationGateways(AzureRMModuleBase): ev = kwargs[key] for i in range(len(ev)): item = ev[i] - if 'rule_type' in item and item['rule_type'] == 'path_based_routing' and 'backend_address_pool' in item: + if 'rule_type' in item and item['rule_type'] is not None and item['rule_type'] == 'path_based_routing' and \ + 'backend_address_pool' in item and item['backend_address_pool'] is not None: del item['backend_address_pool'] - if 'backend_address_pool' in item: + if 'backend_address_pool' in item and item['backend_address_pool'] is not None: id = backend_address_pool_id(self.subscription_id, kwargs['resource_group'], kwargs['name'], item['backend_address_pool']) item['backend_address_pool'] = {'id': id} - if 'backend_http_settings' in item: + if 'backend_http_settings' in item and item['backend_http_settings'] is not None: id = backend_http_settings_id(self.subscription_id, kwargs['resource_group'], kwargs['name'], item['backend_http_settings']) item['backend_http_settings'] = {'id': id} - if 'http_listener' in item: + if 'http_listener' in item and item['http_listener'] is not None: id = http_listener_id(self.subscription_id, kwargs['resource_group'], kwargs['name'], item['http_listener']) item['http_listener'] = {'id': id} - if 'protocol' in item: + if 'protocol' in item and item['protocol'] is not None: item['protocol'] = _snake_to_camel(item['protocol'], True) - if 'rule_type' in item: + if 'rule_type' in item and item['rule_type'] is not None: item['rule_type'] = _snake_to_camel(item['rule_type'], True) - if 'redirect_configuration' in item: + if 'redirect_configuration' in item and item['redirect_configuration'] is not None: id = redirect_configuration_id(self.subscription_id, kwargs['resource_group'], kwargs['name'], item['redirect_configuration']) item['redirect_configuration'] = {'id': id} - if 'url_path_map' in item: + if 'url_path_map' in item and item['url_path_map'] is not None: id = url_path_map_id(self.subscription_id, kwargs['resource_group'], kwargs['name'], diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_appgateway_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_appgateway_info.py index da5c5ecd2..f6ede2a71 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_appgateway_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_appgateway_info.py @@ -33,17 +33,17 @@ author: ''' EXAMPLES = ''' - - name: Get facts for application gateway by name. - azure_rm_appgateway_info: - name: MyAppgw - resource_group: MyResourceGroup +- name: Get facts for application gateway by name. + azure_rm_appgateway_info: + name: MyAppgw + resource_group: MyResourceGroup - - name: Get facts for application gateways in resource group. - azure_rm_appgateway_info: - resource_group: MyResourceGroup +- name: Get facts for application gateways in resource group. + azure_rm_appgateway_info: + resource_group: MyResourceGroup - - name: Get facts for all application gateways. - azure_rm_appgateway_info: +- name: Get facts for all application gateways. + azure_rm_appgateway_info: ''' RETURN = ''' @@ -116,7 +116,7 @@ from ansible.module_utils.common.dict_transformations import _camel_to_snake try: from azure.core.exceptions import ResourceNotFoundError - from msrestazure.tools import parse_resource_id + from azure.mgmt.core.tools import parse_resource_id except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_applicationsecuritygroup.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_applicationsecuritygroup.py index d135ca193..630142785 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_applicationsecuritygroup.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_applicationsecuritygroup.py @@ -21,21 +21,25 @@ options: description: - The name of the resource group. required: True + type: str name: description: - The name of the application security group. required: True + type: str location: description: - Resource location. If not set, location from the resource group will be used as default. + type: str state: - description: - - Assert the state of the Application Security Group. - - Use C(present) to create or update an Application Security Group and C(absent) to delete it. - default: present - choices: - - absent - - present + description: + - Assert the state of the Application Security Group. + - Use C(present) to create or update an Application Security Group and C(absent) to delete it. + type: str + default: present + choices: + - absent + - present extends_documentation_fragment: - azure.azcollection.azure @@ -47,13 +51,13 @@ author: ''' EXAMPLES = ''' - - name: Create application security group - azure_rm_applicationsecuritygroup: - resource_group: myResourceGroup - name: mySecurityGroup - location: eastus - tags: - foo: bar +- name: Create application security group + azure_rm_applicationsecuritygroup: + resource_group: myResourceGroup + name: mySecurityGroup + location: eastus + tags: + foo: bar ''' RETURN = ''' @@ -71,7 +75,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError from azure.core.polling import LROPoller - from msrestazure.azure_operation import AzureOperationPoller except ImportError: # This is handled in azure_rm_common pass @@ -193,7 +196,7 @@ class AzureRMApplicationSecurityGroup(AzureRMModuleBase): response = self.network_client.application_security_groups.begin_create_or_update(resource_group_name=self.resource_group, application_security_group_name=self.name, parameters=param) - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) except Exception as exc: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_applicationsecuritygroup_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_applicationsecuritygroup_info.py index 738404b4e..9e758c6ed 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_applicationsecuritygroup_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_applicationsecuritygroup_info.py @@ -20,9 +20,11 @@ options: resource_group: description: - The name of the resource group. + type: str name: description: - The name of the application security group. + type: str tags: description: - Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. @@ -38,19 +40,19 @@ author: ''' EXAMPLES = ''' - - name: List application security groups in specific resource group - azure_rm_applicationsecuritygroup_info: - resource_group: myResourceGroup - - - name: List application security groups in specific subscription - azure_rm_applicationsecuritygroup_info: - - - name: Get application security group by name - azure_rm_applicationsecuritygroup_info: - resource_group: myResourceGroup - name: myApplicationSecurityGroup - tags: - - foo +- name: List application security groups in specific resource group + azure_rm_applicationsecuritygroup_info: + resource_group: myResourceGroup + +- name: List application security groups in specific subscription + azure_rm_applicationsecuritygroup_info: + +- name: Get application security group by name + azure_rm_applicationsecuritygroup_info: + resource_group: myResourceGroup + name: myApplicationSecurityGroup + tags: + - foo ''' RETURN = ''' @@ -90,7 +92,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError - from msrestazure.azure_operation import AzureOperationPoller except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_appserviceplan.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_appserviceplan.py index 2c0e883bf..1ca293f8a 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_appserviceplan.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_appserviceplan.py @@ -21,21 +21,24 @@ options: description: - Name of the resource group to which the resource belongs. required: True + type: str name: description: - Unique name of the app service plan to create or update. required: True + type: str location: description: - Resource location. If not set, location from the resource group will be used as default. - + type: str sku: description: - The pricing tiers, e.g., C(F1), C(D1), C(B1), C(B2), C(B3), C(S1), C(P1), C(P1V2) etc. - Please see U(https://azure.microsoft.com/en-us/pricing/details/app-service/plans/) for more detail. - For Linux app service plan, please see U(https://azure.microsoft.com/en-us/pricing/details/app-service/linux/) for more detail. + type: str is_linux: description: - Describe whether to host webapp on Linux worker. @@ -45,15 +48,17 @@ options: number_of_workers: description: - Describe number of workers to be allocated. + type: str state: - description: - - Assert the state of the app service plan. - - Use C(present) to create or update an app service plan and C(absent) to delete it. - default: present - choices: - - absent - - present + description: + - Assert the state of the app service plan. + - Use C(present) to create or update an app service plan and C(absent) to delete it. + default: present + type: str + choices: + - absent + - present extends_documentation_fragment: - azure.azcollection.azure @@ -65,28 +70,28 @@ author: ''' EXAMPLES = ''' - - name: Create a windows app service plan - azure_rm_appserviceplan: - resource_group: myResourceGroup - name: myAppPlan - location: eastus - sku: S1 - - - name: Create a linux app service plan - azure_rm_appserviceplan: - resource_group: myResourceGroup - name: myAppPlan - location: eastus - sku: S1 - is_linux: true - number_of_workers: 1 - - - name: update sku of existing windows app service plan - azure_rm_appserviceplan: - resource_group: myResourceGroup - name: myAppPlan - location: eastus - sku: S2 +- name: Create a windows app service plan + azure_rm_appserviceplan: + resource_group: myResourceGroup + name: myAppPlan + location: eastus + sku: S1 + +- name: Create a linux app service plan + azure_rm_appserviceplan: + resource_group: myResourceGroup + name: myAppPlan + location: eastus + sku: S1 + is_linux: true + number_of_workers: 1 + +- name: update sku of existing windows app service plan + azure_rm_appserviceplan: + resource_group: myResourceGroup + name: myAppPlan + location: eastus + sku: S2 ''' RETURN = ''' @@ -99,13 +104,11 @@ azure_appserviceplan: } ''' -import time from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase try: from azure.core.exceptions import ResourceNotFoundError from azure.core.polling import LROPoller - from msrestazure.azure_operation import AzureOperationPoller from azure.mgmt.web.models import AppServicePlan, SkuDescription except ImportError: # This is handled in azure_rm_common @@ -337,7 +340,7 @@ class AzureRMAppServicePlans(AzureRMModuleBase): name=self.name, app_service_plan=plan_def) - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) self.log("Response : {0}".format(response)) diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_appserviceplan_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_appserviceplan_info.py index 826ecc175..c57570976 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_appserviceplan_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_appserviceplan_info.py @@ -23,9 +23,11 @@ options: name: description: - Only show results for a specific app service plan. + type: str resource_group: description: - Limit results by resource group. + type: str tags: description: - Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. @@ -40,20 +42,20 @@ author: ''' EXAMPLES = ''' - - name: Get facts for app service plan by name - azure_rm_appserviceplan_info: - resource_group: myResourceGroup - name: myAppServicePlan - - - name: Get azure_rm_appserviceplan_facts for app service plan in resource group - azure_rm_appserviceplan_info: - resource_group: myResourceGroup - - - name: Get facts for app service plan with tags - azure_rm_appserviceplan_info: - tags: - - testtag - - foo:bar +- name: Get facts for app service plan by name + azure_rm_appserviceplan_info: + resource_group: myResourceGroup + name: myAppServicePlan + +- name: Get azure_rm_appserviceplan_facts for app service plan in resource group + azure_rm_appserviceplan_info: + resource_group: myResourceGroup + +- name: Get facts for app service plan with tags + azure_rm_appserviceplan_info: + tags: + - testtag + - foo:bar ''' RETURN = ''' @@ -217,14 +219,14 @@ class AzureRMAppServicePlanInfo(AzureRMModuleBase): curated_output = dict() curated_output['id'] = plan_facts['id'] curated_output['name'] = plan_facts['name'] - curated_output['resource_group'] = plan_facts['properties']['resourceGroup'] + curated_output['resource_group'] = plan_facts['resource_group'] curated_output['location'] = plan_facts['location'] curated_output['tags'] = plan_facts.get('tags', None) curated_output['is_linux'] = False curated_output['kind'] = plan_facts['kind'] curated_output['sku'] = plan_facts['sku'] - if plan_facts['properties'].get('reserved', None): + if plan_facts.get('reserved', None): curated_output['is_linux'] = True return curated_output diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_automationaccount_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_automationaccount_info.py index defbb7f2a..dd02169d9 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_automationaccount_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_automationaccount_info.py @@ -58,18 +58,18 @@ author: EXAMPLES = ''' - name: Get details of an automation account azure_rm_automationaccount_info: - name: Testing - resource_group: myResourceGroup - list_statistics: yes - list_usages: yes - list_keys: yes - tags: - - key - - key:value + name: Testing + resource_group: myResourceGroup + list_statistics: true + list_usages: true + list_keys: true + tags: + - key + - key:value - name: List automation account in a resource group azure_rm_automationaccount_info: - resource_group: myResourceGroup + resource_group: myResourceGroup - name: List automation account in a resource group azure_rm_automationaccount_info: @@ -240,7 +240,7 @@ automation_accounts: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase try: - from msrestazure.tools import parse_resource_id + from azure.mgmt.core.tools import parse_resource_id from azure.core.exceptions import ResourceNotFoundError except ImportError: pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_automationrunbook.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_automationrunbook.py index 5f4cc10b1..e983db439 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_automationrunbook.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_automationrunbook.py @@ -102,8 +102,8 @@ EXAMPLES = ''' runbook_type: "Script" description: "Fred test" log_activity_trace: 3 - log_progress: True - log_verbose: False + log_progress: true + log_verbose: false tags: key1: value1 @@ -112,7 +112,7 @@ EXAMPLES = ''' resource_group: "{{ resource_group }}" automation_account_name: "{{ account-name }}" name: "{{ runbook-name }}" - publish: True + publish: true - name: Delete automation runbook azure_rm_automationrunbook: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_automationrunbook_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_automationrunbook_info.py index 7f3385362..341edc3d9 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_automationrunbook_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_automationrunbook_info.py @@ -66,8 +66,7 @@ EXAMPLES = ''' resource_group: "{{ resource_group }}" automation_account_name: "{{ account-name }}" name: "{{ runbook-name }}" - show_content: True - + show_content: true ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_autoscale.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_autoscale.py index adcb6dfb9..f21505f81 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_autoscale.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_autoscale.py @@ -21,10 +21,12 @@ options: - The identifier of the resource to apply autoscale setting. - It could be the resource id string. - It also could be a dict contains the C(name), C(subscription_id), C(namespace), C(types), C(resource_group) of the resource. + type: raw resource_group: required: true description: - Resource group of the resource. + type: str enabled: type: bool description: @@ -34,29 +36,36 @@ options: description: - The collection of automatic scaling profiles that specify different scaling parameters for different time periods. - A maximum of 20 profiles can be specified. + type: list + elements: dict suboptions: name: required: true description: - The name of the profile. + type: str count: required: true description: - The number of instances that will be set if metrics are not available for evaluation. - The default is only used if the current instance count is lower than the default. + type: str min_count: description: - The minimum number of instances for the resource. + type: str max_count: description: - The maximum number of instances for the resource. - The actual maximum number of instances is limited by the cores that are available in the subscription. + type: str recurrence_frequency: default: None description: - How often the schedule profile should take effect. - If this value is C(Week), meaning each week will have the same set of profiles. - This element is not used if the FixedDate element is used. + type: str choices: - None - Second @@ -70,39 +79,52 @@ options: description: - The timezone of repeating times at which this profile begins. - This element is not used if the FixedDate element is used. + type: str recurrence_days: description: - The days of repeating times at which this profile begins. - This element is not used if the FixedDate element is used. + type: list + elements: str recurrence_hours: description: - The hours of repeating times at which this profile begins. - This element is not used if the FixedDate element is used. + type: list + elements: str recurrence_mins: description: - The mins of repeating times at which this profile begins. - This element is not used if the FixedDate element is used. + type: list + elements: str fixed_date_timezone: description: - The specific date-time timezone for the profile. - This element is not used if the Recurrence element is used. + type: str fixed_date_start: description: - The specific date-time start for the profile. - This element is not used if the Recurrence element is used. + type: str fixed_date_end: description: - The specific date-time end for the profile. - This element is not used if the Recurrence element is used. + type: str rules: description: - The collection of rules that provide the triggers and parameters for the scaling action. - A maximum of 10 rules can be specified. + type: list + elements: dict suboptions: time_aggregation: default: Average description: - How the data that is collected should be combined over time. + type: str choices: - Average - Minimum @@ -115,9 +137,11 @@ options: - The range of time(minutes) in which instance data is collected. - This value must be greater than the delay in metric collection, which can vary from resource-to-resource. - Must be between 5 ~ 720. + type: float direction: description: - Whether the scaling action increases or decreases the number of instances. + type: str choices: - Increase - Decrease @@ -125,17 +149,21 @@ options: required: true description: - The name of the metric that defines what the rule monitors. + type: str metric_resource_uri: description: - The resource identifier of the resource the rule monitors. + type: str value: description: - The number of instances that are involved in the scaling action. - This value must be 1 or greater. + type: str operator: default: GreaterThan description: - The operator that is used to compare the metric data and the threshold. + type: str choices: - Equals - NotEquals @@ -147,16 +175,19 @@ options: description: - The amount of time (minutes) to wait since the last scaling action before this action occurs. - It must be between 1 ~ 10080. + type: float time_grain: required: true description: - The granularity(minutes) of metrics the rule monitors. - Must be one of the predefined values returned from metric definitions for the metric. - Must be between 1 ~ 720. + type: float statistic: default: Average description: - How the metrics from multiple instances are combined. + type: str choices: - Average - Min @@ -166,9 +197,11 @@ options: default: 70 description: - The threshold of the metric that triggers the scale action. + type: float type: description: - The type of action that should occur when the scale rule fires. + type: str choices: - PercentChangeCount - ExactCount @@ -176,37 +209,50 @@ options: notifications: description: - The collection of notifications. + type: list + elements: dict suboptions: custom_emails: description: - The custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. + type: list + elements: str send_to_subscription_administrator: type: bool default: False description: - A value indicating whether to send email to subscription administrator. + aliases: + - email_admin webhooks: description: - The list of webhook notifications service uri. + type: list + elements: str send_to_subscription_co_administrators: type: bool default: False description: - A value indicating whether to send email to subscription co-administrators. + aliases: + - email_co_admin state: default: present description: - Assert the state of the virtual network. Use C(present) to create or update and C(absent) to delete. + type: str choices: - present - absent location: description: - location of the resource. + type: str name: required: true description: - name of the resource. + type: str extends_documentation_fragment: @@ -221,63 +267,63 @@ author: EXAMPLES = ''' - name: Create an auto scale azure_rm_autoscale: - target: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" - enabled: true - profiles: + target: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myVmss" + enabled: true + profiles: - count: '1' recurrence_days: - - Monday + - Monday name: Auto created scale condition recurrence_timezone: China Standard Time recurrence_mins: - - '0' + - '0' min_count: '1' max_count: '1' recurrence_frequency: Week recurrence_hours: - - '18' - name: scale - resource_group: myResourceGroup + - '18' + name: scale + resource_group: myResourceGroup - name: Create an auto scale with complicated profile azure_rm_autoscale: - target: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets + target: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets /myVmss" - enabled: true - profiles: + enabled: true + profiles: - count: '1' recurrence_days: - - Monday + - Monday name: Auto created scale condition 0 rules: - - time_aggregation: Average - time_window: 10 - direction: Increase - metric_name: Percentage CPU - metric_resource_uri: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtua + - time_aggregation: Average + time_window: 10 + direction: Increase + metric_name: Percentage CPU + metric_resource_uri: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtua lMachineScaleSets/vmss" - value: '1' - threshold: 70 - cooldown: 5 - time_grain: 1 - statistic: Average - operator: GreaterThan - type: ChangeCount + value: '1' + threshold: 70 + cooldown: 5 + time_grain: 1 + statistic: Average + operator: GreaterThan + type: ChangeCount max_count: '1' recurrence_mins: - - '0' + - '0' min_count: '1' recurrence_timezone: China Standard Time recurrence_frequency: Week recurrence_hours: - - '6' - notifications: - - email_admin: True - email_co_admin: False + - '6' + notifications: + - email_admin: true + email_co_admin: false custom_emails: - - yuwzho@microsoft.com - name: scale - resource_group: myResourceGroup + - yuwzho@microsoft.com + name: scale + resource_group: myResourceGroup - name: Delete an Azure Auto Scale Setting azure_rm_autoscale: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_autoscale_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_autoscale_info.py index 49411ad48..db5ebfea3 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_autoscale_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_autoscale_info.py @@ -21,9 +21,11 @@ options: description: - The name of the resource group. required: True + type: str name: description: - The name of the Auto Scale Setting. + type: str tags: description: - Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. @@ -39,17 +41,17 @@ author: ''' EXAMPLES = ''' - - name: Get instance of Auto Scale Setting - azure_rm_autoscale_info: - resource_group: myResourceGroup - name: auto_scale_name - - - name: List instances of Auto Scale Setting - azure_rm_autoscale_info: - resource_group: myResourceGroup - tags: - - key - - key:value +- name: Get instance of Auto Scale Setting + azure_rm_autoscale_info: + resource_group: myResourceGroup + name: auto_scale_name + +- name: List instances of Auto Scale Setting + azure_rm_autoscale_info: + resource_group: myResourceGroup + tags: + - key + - key:value ''' RETURN = ''' @@ -117,12 +119,6 @@ autoscales: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from ansible.module_utils._text import to_native -try: - from msrest.serialization import Model -except ImportError: - # This is handled in azure_rm_common - pass - # duplicated in azure_rm_autoscale def timedelta_to_minutes(time): diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_availabilityset.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_availabilityset.py index 1188a07c5..1ba334eba 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_availabilityset.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_availabilityset.py @@ -25,21 +25,25 @@ options: description: - Name of a resource group where the availability set exists or will be created. required: true + type: str name: description: - Name of the availability set. + type: str required: true state: description: - Assert the state of the availability set. - Use C(present) to create or update a availability set and C(absent) to delete a availability set. default: present + type: str choices: - absent - present location: description: - Valid Azure location. Defaults to location of the resource group. + type: str platform_update_domain_count: description: - Update domains indicate groups of virtual machines and underlying physical hardware that can be rebooted at the same time. @@ -59,6 +63,7 @@ options: description: - Define if the availability set supports managed disks. default: Classic + type: str choices: - Classic - Aligned @@ -71,28 +76,28 @@ author: ''' EXAMPLES = ''' - - name: Create an availability set with default options - azure_rm_availabilityset: - name: myAvailabilitySet - location: eastus - resource_group: myResourceGroup - - - name: Create an availability set with advanced options - azure_rm_availabilityset: - name: myAvailabilitySet - location: eastus - resource_group: myResourceGroup - platform_update_domain_count: 5 - platform_fault_domain_count: 3 - proximity_placement_group: myProximityPlacementGroup - sku: Aligned - - - name: Delete an availability set - azure_rm_availabilityset: - name: myAvailabilitySet - location: eastus - resource_group: myResourceGroup - state: absent +- name: Create an availability set with default options + azure_rm_availabilityset: + name: myAvailabilitySet + location: eastus + resource_group: myResourceGroup + +- name: Create an availability set with advanced options + azure_rm_availabilityset: + name: myAvailabilitySet + location: eastus + resource_group: myResourceGroup + platform_update_domain_count: 5 + platform_fault_domain_count: 3 + proximity_placement_group: myProximityPlacementGroup + sku: Aligned + +- name: Delete an availability set + azure_rm_availabilityset: + name: myAvailabilitySet + location: eastus + resource_group: myResourceGroup + state: absent ''' RETURN = ''' @@ -152,7 +157,7 @@ changed: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase try: - from msrestazure.tools import parse_resource_id + from azure.mgmt.core.tools import parse_resource_id from azure.core.exceptions import ResourceNotFoundError except ImportError: # This is handled in azure_rm_common diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_availabilityset_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_availabilityset_info.py index 16122f67a..95050263b 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_availabilityset_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_availabilityset_info.py @@ -41,18 +41,17 @@ author: ''' EXAMPLES = ''' - - name: Get facts for one availability set - azure_rm_availabilityset_info: - name: Testing - resource_group: myResourceGroup - - - name: Get facts for all availability sets in a specific resource group - azure_rm_availabilityset_info: - resource_group: myResourceGroup - tags: - - key - - key:value - +- name: Get facts for one availability set + azure_rm_availabilityset_info: + name: Testing + resource_group: myResourceGroup + +- name: Get facts for all availability sets in a specific resource group + azure_rm_availabilityset_info: + resource_group: myResourceGroup + tags: + - key + - key:value ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_azurefirewall.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_azurefirewall.py index 099fb57fc..f960f024d 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_azurefirewall.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_azurefirewall.py @@ -34,6 +34,7 @@ options: description: - Collection of application rule collections used by Azure Firewall. type: list + elements: dict suboptions: priority: description: @@ -50,6 +51,7 @@ options: description: - Collection of rules used by a application rule collection. type: list + elements: raw suboptions: name: description: @@ -63,18 +65,31 @@ options: description: - List of source IP addresses for this rule. type: list + elements: str protocols: description: - Array of ApplicationRuleProtocols. + elements: dict type: list + suboptions: + type: + description: + - The type of the protocols. + type: str + port: + description: + - The ports of the protocols. + type: str target_fqdns: description: - List of FQDNs for this rule. type: list + elements: raw fqdn_tags: description: - List of FQDN Tags for this rule. type: list + elements: raw name: description: - Gets name of the resource that is unique within a resource group. @@ -84,6 +99,7 @@ options: description: - Collection of NAT rule collections used by Azure Firewall. type: list + elements: dict suboptions: priority: description: @@ -100,6 +116,7 @@ options: description: - Collection of rules used by a NAT rule collection. type: list + elements: dict suboptions: name: description: @@ -113,18 +130,22 @@ options: description: - List of source IP addresses for this rule. type: list + elements: str destination_addresses: description: - List of destination IP addresses for this rule. type: list + elements: str destination_ports: description: - List of destination ports. type: list + elements: str protocols: description: - Array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. type: list + elements: raw translated_address: description: - The translated address for this NAT rule. @@ -142,6 +163,7 @@ options: description: - Collection of network rule collections used by Azure Firewall. type: list + elements: dict suboptions: priority: description: @@ -158,6 +180,7 @@ options: description: - Collection of rules used by a network rule collection. type: list + elements: dict suboptions: name: description: @@ -171,18 +194,22 @@ options: description: - Array of AzureFirewallNetworkRuleProtocols. type: list + elements: raw source_addresses: description: - List of source IP addresses for this rule. type: list + elements: str destination_addresses: description: - List of destination IP addresses. type: list + elements: str destination_ports: description: - List of destination ports. type: list + elements: str name: description: - Gets name of the resource that is unique within a resource group. @@ -192,6 +219,7 @@ options: description: - IP configuration of the Azure Firewall resource. type: list + elements: dict suboptions: subnet: description: @@ -300,7 +328,6 @@ EXAMPLES = ''' resource_group: myResourceGroup name: myAzureFirewall state: absent - ''' RETURN = ''' @@ -314,15 +341,8 @@ id: import time import json -import re from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBaseExt from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_rest import GenericRestClient -from copy import deepcopy -try: - from msrestazure.azure_exceptions import CloudError -except ImportError: - # This is handled in azure_rm_common - pass class Actions: @@ -350,6 +370,7 @@ class AzureRMAzureFirewalls(AzureRMModuleBaseExt): ), application_rule_collections=dict( type='list', + elements='dict', disposition='/properties/applicationRuleCollections', options=dict( priority=dict( @@ -365,6 +386,7 @@ class AzureRMAzureFirewalls(AzureRMModuleBaseExt): ), rules=dict( type='list', + elements='raw', disposition='properties/*', options=dict( name=dict( @@ -375,10 +397,12 @@ class AzureRMAzureFirewalls(AzureRMModuleBaseExt): ), source_addresses=dict( type='list', + elements='str', disposition='sourceAddresses' ), protocols=dict( type='list', + elements='dict', options=dict( type=dict( type='str', @@ -391,10 +415,12 @@ class AzureRMAzureFirewalls(AzureRMModuleBaseExt): ), target_fqdns=dict( type='list', + elements='raw', disposition='targetFqdns' ), fqdn_tags=dict( type='list', + elements='raw', disposition='fqdnTags' ) ) @@ -406,6 +432,7 @@ class AzureRMAzureFirewalls(AzureRMModuleBaseExt): ), nat_rule_collections=dict( type='list', + elements='dict', disposition='/properties/natRuleCollections', options=dict( priority=dict( @@ -421,6 +448,7 @@ class AzureRMAzureFirewalls(AzureRMModuleBaseExt): ), rules=dict( type='list', + elements='dict', disposition='properties/*', options=dict( name=dict( @@ -431,18 +459,22 @@ class AzureRMAzureFirewalls(AzureRMModuleBaseExt): ), source_addresses=dict( type='list', + elements='str', disposition='sourceAddresses' ), destination_addresses=dict( type='list', + elements='str', disposition='destinationAddresses' ), destination_ports=dict( type='list', + elements='str', disposition='destinationPorts' ), protocols=dict( - type='list' + type='list', + elements='raw' ), translated_address=dict( type='str', @@ -461,6 +493,7 @@ class AzureRMAzureFirewalls(AzureRMModuleBaseExt): ), network_rule_collections=dict( type='list', + elements='dict', disposition='/properties/networkRuleCollections', options=dict( priority=dict( @@ -476,6 +509,7 @@ class AzureRMAzureFirewalls(AzureRMModuleBaseExt): ), rules=dict( type='list', + elements='dict', disposition='properties/*', options=dict( name=dict( @@ -485,18 +519,22 @@ class AzureRMAzureFirewalls(AzureRMModuleBaseExt): type='str' ), protocols=dict( - type='list' + type='list', + elements='raw' ), source_addresses=dict( type='list', + elements='str', disposition='sourceAddresses' ), destination_addresses=dict( type='list', + elements='str', disposition='destinationAddresses' ), destination_ports=dict( type='list', + elements='str', disposition='destinationPorts' ) ) @@ -508,6 +546,7 @@ class AzureRMAzureFirewalls(AzureRMModuleBaseExt): ), ip_configurations=dict( type='list', + elements='dict', disposition='/properties/ipConfigurations', options=dict( subnet=dict( @@ -571,6 +610,7 @@ class AzureRMAzureFirewalls(AzureRMModuleBaseExt): response = None self.mgmt_client = self.get_mgmt_svc_client(GenericRestClient, + is_track2=True, base_url=self._cloud_environment.endpoints.resource_manager) resource_group = self.get_resource_group(self.resource_group) @@ -661,14 +701,14 @@ class AzureRMAzureFirewalls(AzureRMModuleBaseExt): self.status_code, 600, 30) - except CloudError as exc: + except Exception as exc: self.log('Error attempting to create the AzureFirewall instance.') self.fail('Error creating the AzureFirewall instance: {0}'.format(str(exc))) try: - response = json.loads(response.text) + response = json.loads(response.body()) except Exception: - response = {'text': response.text} + response = {'text': response.context['deserialized_data']} return response @@ -683,7 +723,7 @@ class AzureRMAzureFirewalls(AzureRMModuleBaseExt): self.status_code, 600, 30) - except CloudError as e: + except Exception as e: self.log('Error attempting to delete the AzureFirewall instance.') self.fail('Error deleting the AzureFirewall instance: {0}'.format(str(e))) @@ -701,11 +741,11 @@ class AzureRMAzureFirewalls(AzureRMModuleBaseExt): self.status_code, 600, 30) - response = json.loads(response.text) + response = json.loads(response.body()) found = True self.log("Response : {0}".format(response)) # self.log("AzureFirewall instance : {0} found".format(response.name)) - except CloudError as e: + except Exception as e: self.log('Did not find the AzureFirewall instance.') if found is True: return response diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_azurefirewall_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_azurefirewall_info.py index be6b08a36..d86932693 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_azurefirewall_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_azurefirewall_info.py @@ -41,7 +41,6 @@ EXAMPLES = ''' azure_rm_azurefirewall_info: resource_group: myResourceGroup name: myAzureFirewall - ''' RETURN = ''' @@ -102,16 +101,9 @@ firewalls: ''' -import time import json from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_rest import GenericRestClient -from copy import deepcopy -try: - from msrestazure.azure_exceptions import CloudError -except Exception: - # handled in azure_rm_common - pass class AzureRMAzureFirewallsInfo(AzureRMModuleBase): @@ -148,6 +140,7 @@ class AzureRMAzureFirewallsInfo(AzureRMModuleBase): setattr(self, key, kwargs[key]) self.mgmt_client = self.get_mgmt_svc_client(GenericRestClient, + is_track2=True, base_url=self._cloud_environment.endpoints.resource_manager) if (self.resource_group is not None and self.name is not None): @@ -183,9 +176,9 @@ class AzureRMAzureFirewallsInfo(AzureRMModuleBase): self.status_code, 600, 30) - results = json.loads(response.text) + results = json.loads(response.body()) # self.log('Response : {0}'.format(response)) - except CloudError as e: + except Exception as e: self.log('Could not get info for @(Model.ModuleOperationNameUpper).') return self.format_item(results) @@ -213,9 +206,9 @@ class AzureRMAzureFirewallsInfo(AzureRMModuleBase): self.status_code, 600, 30) - results = json.loads(response.text) + results = json.loads(response.body()) # self.log('Response : {0}'.format(response)) - except CloudError as e: + except Exception as e: self.log('Could not get info for @(Model.ModuleOperationNameUpper).') return [self.format_item(x) for x in results['value']] if results['value'] else [] @@ -240,25 +233,31 @@ class AzureRMAzureFirewallsInfo(AzureRMModuleBase): self.status_code, 600, 30) - results = json.loads(response.text) + results = json.loads(response.body()) # self.log('Response : {0}'.format(response)) - except CloudError as e: + except Exception as e: self.log('Could not get info for @(Model.ModuleOperationNameUpper).') return [self.format_item(x) for x in results['value']] if results['value'] else [] def format_item(self, item): + if item is None or item == {}: + return {} d = { - 'id': item['id'], - 'name': item['name'], - 'location': item['location'], - 'etag': item['etag'], + 'id': item.get('id'), + 'name': item.get('name'), + 'location': item.get('location'), + 'etag': item.get('etag'), 'tags': item.get('tags'), - 'nat_rule_collections': item['properties']['natRuleCollections'], - 'network_rule_collections': item['properties']['networkRuleCollections'], - 'ip_configurations': item['properties']['ipConfigurations'], - 'provisioning_state': item['properties']['provisioningState'] + 'nat_rule_collections': dict(), + 'network_rule_collections': dict(), + 'ip_configurations': dict(), } + if isinstance(item.get('properties'), dict): + d['nat_rule_collections'] = item.get('properties').get('natRuleCollections') + d['network_rule_collections'] = item.get('properties').get('networkRuleCollections') + d['ip_configurations'] = item.get('properties').get('ipConfigurations') + d['provisioning_state'] = item.get('properties').get('provisioningState') return d diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_backupazurevm.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_backupazurevm.py index 25e9870d9..77d6d92ed 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_backupazurevm.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_backupazurevm.py @@ -74,40 +74,40 @@ author: EXAMPLES = \ ''' - - name: Enabling/Updating protection for the Azure VM - azure_rm_backupazurevm: - resource_group: 'myResourceGroup' - recovery_vault_name: 'testVault' - resource_id: '/subscriptions/00000000-0000-0000-0000-000000000000/ \ - resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/testVM' - backup_policy_id: '/subscriptions/00000000-0000-0000-0000-000000000000/ \ - resourceGroups/myResourceGroup/providers/microsoft.recoveryservices/vaults/testVault/backupPolicies/ProdPolicy' - state: 'create' - - name: Stop protection but retain existing data - azure_rm_backupazurevm: - resource_group: 'myResourceGroup' - recovery_vault_name: 'testVault' - resource_id: '/subscriptions/00000000-0000-0000-0000-000000000000/ \ - resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/testVM' - state: 'stop' - - name: Stop protection and delete data - azure_rm_backupazurevm: - resource_group: 'myResourceGroup' - recovery_vault_name: 'testVault' - resource_id: '/subscriptions/00000000-0000-0000-0000-000000000000/ \ - resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/testVM' - state: 'delete' - - name: Trigger an on-demand backup for a protected Azure VM - azure_rm_backupazurevm: - resource_group: 'myResourceGroup' - recovery_vault_name: 'testVault' - resource_id: '/subscriptions/00000000-0000-0000-0000-000000000000/ \ - resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/testVM' - backup_policy_id: '/subscriptions/00000000-0000-0000-0000-000000000000/ \ - resourceGroups/myResourceGroup/providers/microsoft.recoveryservices/vaults/testVault/backupPolicies/ProdPolicy' - recovery_point_expiry_time: '2023-02-09T06:00:00Z' - state: 'backup' - ''' +- name: Enabling/Updating protection for the Azure VM + azure_rm_backupazurevm: + resource_group: 'myResourceGroup' + recovery_vault_name: 'testVault' + resource_id: '/subscriptions/00000000-0000-0000-0000-000000000000/ \ + resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/testVM' + backup_policy_id: '/subscriptions/00000000-0000-0000-0000-000000000000/ \ + resourceGroups/myResourceGroup/providers/microsoft.recoveryservices/vaults/testVault/backupPolicies/ProdPolicy' + state: 'create' +- name: Stop protection but retain existing data + azure_rm_backupazurevm: + resource_group: 'myResourceGroup' + recovery_vault_name: 'testVault' + resource_id: '/subscriptions/00000000-0000-0000-0000-000000000000/ \ + resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/testVM' + state: 'stop' +- name: Stop protection and delete data + azure_rm_backupazurevm: + resource_group: 'myResourceGroup' + recovery_vault_name: 'testVault' + resource_id: '/subscriptions/00000000-0000-0000-0000-000000000000/ \ + resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/testVM' + state: 'delete' +- name: Trigger an on-demand backup for a protected Azure VM + azure_rm_backupazurevm: + resource_group: 'myResourceGroup' + recovery_vault_name: 'testVault' + resource_id: '/subscriptions/00000000-0000-0000-0000-000000000000/ \ + resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/testVM' + backup_policy_id: '/subscriptions/00000000-0000-0000-0000-000000000000/ \ + resourceGroups/myResourceGroup/providers/microsoft.recoveryservices/vaults/testVault/backupPolicies/ProdPolicy' + recovery_point_expiry_time: '2023-02-09T06:00:00Z' + state: 'backup' +''' RETURN = \ ''' @@ -121,9 +121,7 @@ id: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_rest import GenericRestClient from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBaseExt -import re import json -import time class Actions: @@ -186,8 +184,11 @@ class BackupAzureVM(AzureRMModuleBaseExt): return '2019-05-13' if self.state == 'create' or self.state == 'update' or self.state == 'delete' or self.state == 'stop' else '2016-12-01' def get_url(self): + sub_id = self.subscription_id + if self.module.params.get('subscription_id'): + sub_id = self.module.params.get('subscription_id') if self.state == 'create' or self.state == 'update' or self.state == 'delete' or self.state == 'stop': - return '/subscriptions' + '/' + self.subscription_id \ + return '/subscriptions' + '/' + sub_id \ + '/resourceGroups' + '/' + self.resource_group + '/providers' \ + '/Microsoft.RecoveryServices' + '/vaults' + '/' \ + self.recovery_vault_name \ @@ -197,7 +198,7 @@ class BackupAzureVM(AzureRMModuleBaseExt): + 'vm;iaasvmcontainerv2;' + self.parse_resource_to_dict(self.resource_id)['resource_group'] + ';' \ + self.parse_resource_to_dict(self.resource_id)['name'] if self.state == 'backup': - return '/subscriptions' + '/' + self.subscription_id \ + return '/subscriptions' + '/' + sub_id \ + '/resourceGroups' + '/' + self.resource_group + '/providers' \ + '/Microsoft.RecoveryServices' + '/vaults' + '/' \ + self.recovery_vault_name \ @@ -254,6 +255,7 @@ class BackupAzureVM(AzureRMModuleBaseExt): response = None self.mgmt_client = self.get_mgmt_svc_client(GenericRestClient, + is_track2=True, base_url=self._cloud_environment.endpoints.resource_manager) changed = False @@ -295,9 +297,9 @@ class BackupAzureVM(AzureRMModuleBaseExt): 'Error in creating/updating protection for Azure VM {0}'.format(str(e))) try: - response = json.loads(response.text) + response = json.loads(response.body()) except Exception: - response = {'text': response.text} + response = {'text': response.context['deserialized_data']} return response @@ -321,9 +323,9 @@ class BackupAzureVM(AzureRMModuleBaseExt): self.fail('Error in disabling the protection: {0}'.format(str(e))) try: - response = json.loads(response.text) + response = json.loads(response.body()) except Exception: - response = {'text': response.text} + response = {'text': response.context['deserialized_data']} return response @@ -347,9 +349,9 @@ class BackupAzureVM(AzureRMModuleBaseExt): self.fail('Error deleting the azure backup: {0}'.format(str(e))) try: - response = json.loads(response.text) + response = json.loads(response.body()) except Exception: - response = {'text': response.text} + response = {'text': response.context['deserialized_data']} return response @@ -374,9 +376,9 @@ class BackupAzureVM(AzureRMModuleBaseExt): 'Error while taking on-demand backup: {0}'.format(str(e))) try: - response = json.loads(response.text) + response = json.loads(response.body()) except Exception: - response = {'text': response.text} + response = {'text': response.context['deserialized_data']} return response diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_backupazurevm_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_backupazurevm_info.py index b8ad0cc8a..b4ba22fc1 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_backupazurevm_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_backupazurevm_info.py @@ -42,13 +42,13 @@ author: EXAMPLES = \ ''' - - name: Get Recovery Point Details - azure_rm_backupazurevm_info: - resource_group: 'myResourceGroup' - recovery_vault_name: 'testVault' - resource_id: '/subscriptions/00000000-0000-0000-0000-000000000000/ \ - resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/testVM' - ''' +- name: Get Recovery Point Details + azure_rm_backupazurevm_info: + resource_group: 'myResourceGroup' + recovery_vault_name: 'testVault' + resource_id: '/subscriptions/00000000-0000-0000-0000-000000000000/ \ + resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/testVM' +''' RETURN = \ ''' @@ -62,9 +62,7 @@ id: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_rest import GenericRestClient from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBaseExt -import re import json -import time class Actions: @@ -132,6 +130,7 @@ class BackupAzureVMInfo(AzureRMModuleBaseExt): response = None self.mgmt_client = self.get_mgmt_svc_client(GenericRestClient, + is_track2=True, base_url=self._cloud_environment.endpoints.resource_manager) response = self.get_recovery_point_info() @@ -158,9 +157,9 @@ class BackupAzureVMInfo(AzureRMModuleBaseExt): self.fail('Error in fetching recovery point {0}'.format(str(e))) try: - response = json.loads(response.text) + response = json.loads(response.body()) except Exception: - response = {'text': response.text} + response = {'text': response.context['deserialized_data']} return response diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_backuppolicy.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_backuppolicy.py index 7ec699566..4c1f6cca9 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_backuppolicy.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_backuppolicy.py @@ -103,43 +103,42 @@ author: ''' EXAMPLES = ''' - - name: Delete a backup policy - azure_rm_backuppolicy: - vault_name: Vault_Name - name: Policy_Name - resource_group: Resource_Group_Name - state: absent - - - name: Create a daily VM backup policy - azure_rm_backuppolicy: - vault_name: Vault_Name - name: Policy_Name - resource_group: Resource_Group_Name - state: present - backup_management_type: "AzureIaasVM" - schedule_run_frequency: "Daily" - instant_recovery_snapshot_retention: 2 - daily_retention_count: 12 - time_zone: "Pacific Standard Time" - schedule_run_time: 14 - - - name: Create a weekly VM backup policy - azure.azcollection.azure_rm_backuppolicy: - vault_name: Vault_Name - name: Policy_Name - resource_group: Resource_Group_Name - state: present - backup_management_type: "AzureIaasVM" - schedule_run_frequency: "Weekly" - instant_recovery_snapshot_retention: 5 - weekly_retention_count: 4 - schedule_days: - - "Monday" - - "Wednesday" - - "Friday" - time_zone: "Pacific Standard Time" - schedule_run_time: 8 - +- name: Delete a backup policy + azure_rm_backuppolicy: + vault_name: Vault_Name + name: Policy_Name + resource_group: Resource_Group_Name + state: absent + +- name: Create a daily VM backup policy + azure_rm_backuppolicy: + vault_name: Vault_Name + name: Policy_Name + resource_group: Resource_Group_Name + state: present + backup_management_type: "AzureIaasVM" + schedule_run_frequency: "Daily" + instant_recovery_snapshot_retention: 2 + daily_retention_count: 12 + time_zone: "Pacific Standard Time" + schedule_run_time: 14 + +- name: Create a weekly VM backup policy + azure.azcollection.azure_rm_backuppolicy: + vault_name: Vault_Name + name: Policy_Name + resource_group: Resource_Group_Name + state: present + backup_management_type: "AzureIaasVM" + schedule_run_frequency: "Weekly" + instant_recovery_snapshot_retention: 5 + weekly_retention_count: 4 + schedule_days: + - "Monday" + - "Wednesday" + - "Friday" + time_zone: "Pacific Standard Time" + schedule_run_time: 8 ''' RETURN = ''' @@ -169,7 +168,6 @@ type: sample: Microsoft.RecoveryServices/vaults/backupPolicies ''' -import uuid from datetime import datetime from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_backuppolicy_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_backuppolicy_info.py index d4a086766..ddebb2862 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_backuppolicy_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_backuppolicy_info.py @@ -45,12 +45,12 @@ author: ''' EXAMPLES = ''' - - name: Get backup policy information - azure_rm_backuppolicy_info: - vault_name: Vault_Name - name: Policy_Name - resource_group: Resource_Group_Name - register: backup_policy +- name: Get backup policy information + azure_rm_backuppolicy_info: + vault_name: Vault_Name + name: Policy_Name + resource_group: Resource_Group_Name + register: backup_policy ''' RETURN = ''' @@ -80,8 +80,6 @@ type: sample: Microsoft.RecoveryServices/vaults/backupPolicies ''' -import uuid -from datetime import datetime from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase try: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_bastionhost.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_bastionhost.py index c6b8e0d4d..29369a463 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_bastionhost.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_bastionhost.py @@ -139,12 +139,12 @@ EXAMPLES = ''' private_ip_allocation_method: Dynamic sku: name: Standard - enable_tunneling: False - enable_shareable_link: False - enable_ip_connect: False - enable_file_copy: False + enable_tunneling: false + enable_shareable_link: false + enable_ip_connect: false + enable_file_copy: false scale_units: 6 - disable_copy_paste: False + disable_copy_paste: false tags: key1: value1 @@ -153,7 +153,6 @@ EXAMPLES = ''' name: bastion-name resource_group: myResourceGroup state: absent - ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_batchaccount.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_batchaccount.py index afb4d3d51..ac237294c 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_batchaccount.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_batchaccount.py @@ -49,6 +49,7 @@ options: - It can be the storage account ID. Fox example "/subscriptions/{subscription_id}/resourceGroups/ {resource_group}/providers/Microsoft.Storage/storageAccounts/{name}". - It can be a dict which contains I(name) and I(resource_group) of the storage account. + type: raw key_vault: description: - Existing key vault with which to associate the Batch Account. @@ -56,6 +57,7 @@ options: - It can be the key vault ID. For example "/subscriptions/{subscription_id}/resourceGroups/ {resource_group}/providers/Microsoft.KeyVault/vaults/{name}". - It can be a dict which contains I(name) and I(resource_group) of the key vault. + type: raw pool_allocation_mode: description: - The pool acclocation mode of the Batch Account. @@ -83,14 +85,14 @@ author: ''' EXAMPLES = ''' - - name: Create Batch Account - azure_rm_batchaccount: - resource_group: MyResGroup - name: mybatchaccount - location: eastus - auto_storage_account: - name: mystorageaccountname - pool_allocation_mode: batch_service +- name: Create Batch Account + azure_rm_batchaccount: + resource_group: MyResGroup + name: mybatchaccount + location: eastus + auto_storage_account: + name: mystorageaccountname + pool_allocation_mode: batch_service ''' RETURN = ''' @@ -108,17 +110,13 @@ account_endpoint: sample: sampleacct.westus.batch.azure.com ''' -import time -from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import normalize_location_name from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBaseExt from ansible.module_utils.common.dict_transformations import _snake_to_camel try: - from msrestazure.azure_exceptions import CloudError - from msrest.polling import LROPoller - from msrestazure.azure_operation import AzureOperationPoller - from msrest.serialization import Model + from azure.core.polling import LROPoller from azure.mgmt.batch import BatchManagementClient + from azure.core.exceptions import ResourceNotFoundError except ImportError: # This is handled in azure_rm_common pass @@ -172,7 +170,6 @@ class AzureRMBatchAccount(AzureRMModuleBaseExt): self.resource_group = None self.name = None self.batch_account = dict() - self.tags = None self.results = dict(changed=False) self.mgmt_client = None @@ -215,7 +212,8 @@ class AzureRMBatchAccount(AzureRMModuleBaseExt): response = None self.mgmt_client = self.get_mgmt_svc_client(BatchManagementClient, - base_url=self._cloud_environment.endpoints.resource_manager) + base_url=self._cloud_environment.endpoints.resource_manager, + is_track2=True) old_response = self.get_batchaccount() @@ -232,7 +230,13 @@ class AzureRMBatchAccount(AzureRMModuleBaseExt): elif self.state == 'present': self.results['old'] = old_response self.results['new'] = self.batch_account - if not self.idempotency_check(old_response, self.batch_account): + + update_tags, self.tags = self.update_tags(old_response['tags']) + + if self.batch_account.get('auto_storage_account') is not None: + if old_response['auto_storage']['storage_account_id'] != self.batch_account['auto_storage']['storage_account_id']: + self.to_do = Actions.Update + if update_tags: self.to_do = Actions.Update if (self.to_do == Actions.Create) or (self.to_do == Actions.Update): @@ -275,17 +279,17 @@ class AzureRMBatchAccount(AzureRMModuleBaseExt): try: if self.to_do == Actions.Create: - response = self.mgmt_client.batch_account.create(resource_group_name=self.resource_group, - account_name=self.name, - parameters=self.batch_account) + response = self.mgmt_client.batch_account.begin_create(resource_group_name=self.resource_group, + account_name=self.name, + parameters=self.batch_account) else: response = self.mgmt_client.batch_account.update(resource_group_name=self.resource_group, account_name=self.name, - tags=self.tags, - auto_storage=self.batch_account.get('auto_storage')) - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + parameters=dict(tags=self.tags, + auto_storage=self.batch_account.get('self.batch_account'))) + if isinstance(response, LROPoller): response = self.get_poller_result(response) - except CloudError as exc: + except Exception as exc: self.log('Error attempting to create the Batch Account instance.') self.fail("Error creating the Batch Account instance: {0}".format(str(exc))) return response.as_dict() @@ -298,13 +302,13 @@ class AzureRMBatchAccount(AzureRMModuleBaseExt): ''' self.log("Deleting the Batch Account instance {0}".format(self.name)) try: - response = self.mgmt_client.batch_account.delete(resource_group_name=self.resource_group, - account_name=self.name) - except CloudError as e: + response = self.mgmt_client.batch_account.begin_delete(resource_group_name=self.resource_group, + account_name=self.name) + except Exception as e: self.log('Error attempting to delete the Batch Account instance.') self.fail("Error deleting the Batch Account instance: {0}".format(str(e))) - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) return True @@ -321,12 +325,30 @@ class AzureRMBatchAccount(AzureRMModuleBaseExt): found = True self.log("Response : {0}".format(response)) self.log("Batch Account instance : {0} found".format(response.name)) - except CloudError as e: - self.log('Did not find the Batch Account instance.') + except ResourceNotFoundError as e: + self.log('Did not find the Batch Account instance. Exception as {0}'.format(e)) if found is True: - return response.as_dict() + return self.format_item(response.as_dict()) return False + def format_item(self, item): + result = { + 'id': item['id'], + 'name': item['name'], + 'type': item['type'], + 'location': item['location'], + 'account_endpoint': item['account_endpoint'], + 'provisioning_state': item['provisioning_state'], + 'pool_allocation_mode': item['pool_allocation_mode'], + 'auto_storage': item['auto_storage'], + 'dedicated_core_quota': item['dedicated_core_quota'], + 'low_priority_core_quota': item['low_priority_core_quota'], + 'pool_quota': item['pool_quota'], + 'active_job_and_job_schedule_quota': item['active_job_and_job_schedule_quota'], + 'tags': item.get('tags') + } + return result + def main(): """Main execution""" diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_batchaccount_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_batchaccount_info.py new file mode 100644 index 000000000..fb61248e4 --- /dev/null +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_batchaccount_info.py @@ -0,0 +1,196 @@ +#!/usr/bin/python +# +# Copyright (c) 2023 xuzhang3 (@xuzhang3), Fred-sun (@Fred-sun) +# +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import absolute_import, division, print_function +__metaclass__ = type + +DOCUMENTATION = ''' +--- +module: azure_rm_batchaccount_info +version_added: "0.1.2" +short_description: Get the Batch Account on Azure facts +description: + - Get the Batch Account on Azure facts. + +options: + resource_group: + description: + - The name of the resource group in which to create the Batch Account. + type: str + name: + description: + - The name of the Batch Account. + type: str + tags: + description: + - Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. + type: list + elements: str + +extends_documentation_fragment: + - azure.azcollection.azure + +author: + - xuzhang3 (@xuzhang3) + - Fred Sun (@Fred-sun) +''' + +EXAMPLES = ''' +- name: Get the Batch Account by name + azure_rm_batchaccount_info: + resource_group: MyResGroup + name: mybatchaccount + +- name: List the Batch Account by subscription + azure_rm_batchaccount_info: + tags: + - key1 +''' + +RETURN = ''' +id: + description: + - The ID of the Batch account. + returned: always + type: str + sample: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Batch/batchAccounts/sampleacct" +account_endpoint: + description: + - The account endpoint used to interact with the Batch service. + returned: always + type: str + sample: sampleacct.westus.batch.azure.com +''' + +from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBaseExt + +try: + from azure.core.exceptions import ResourceNotFoundError + from azure.mgmt.batch import BatchManagementClient +except ImportError: + # This is handled in azure_rm_common + pass + + +class AzureRMBatchAccountInfo(AzureRMModuleBaseExt): + """Configuration class for an Azure RM Batch Account resource""" + + def __init__(self): + self.module_arg_spec = dict( + resource_group=dict( + type='str', + ), + name=dict( + type='str', + ), + tags=dict( + type='list', + elements='str' + ) + ) + + self.resource_group = None + self.name = None + self.tags = None + + self.results = dict(changed=False) + self.mgmt_client = None + + super(AzureRMBatchAccountInfo, self).__init__(derived_arg_spec=self.module_arg_spec, + supports_check_mode=True, + supports_tags=False) + + def exec_module(self, **kwargs): + """Main module execution method""" + + for key in list(self.module_arg_spec.keys()) + ['tags']: + setattr(self, key, kwargs[key]) + + response = [] + + self.mgmt_client = self.get_mgmt_svc_client(BatchManagementClient, + base_url=self._cloud_environment.endpoints.resource_manager, + is_track2=True) + + if self.resource_group is not None and self.name is not None: + response = [self.get_batchaccount()] + elif self.resource_group is not None: + response = self.list_by_resourcegroup() + else: + response = self.list_all() + + self.results['batch_account'] = [self.format_item(item) for item in response if item and self.has_tags(item.get('tags'), self.tags)] + + return self.results + + def list_by_resourcegroup(self): + self.log("List all Batch Account in the rsource group {0}".format(self.resource_group)) + result = [] + response = [] + try: + response = self.mgmt_client.batch_account.list_by_resource_group(resource_group_name=self.resource_group) + self.log("Response : {0}".format(response)) + except Exception as e: + self.log('Did not find the Batch Account instance. Exception as {0}'.format(e)) + for item in response: + result.append(item.as_dict()) + return result + + def list_all(self): + self.log("List all Batch Account in the same subscritpion") + result = [] + response = [] + try: + response = self.mgmt_client.batch_account.list() + self.log("Response : {0}".format(response)) + except Exception as e: + self.log('Did not find the Batch Account instance.') + for item in response: + result.append(item.as_dict()) + return result + + def get_batchaccount(self): + ''' + Gets the properties of the specified Batch Account + :return: deserialized Batch Account instance state dictionary + ''' + self.log("Checking if the Batch Account instance {0} is present".format(self.name)) + try: + response = self.mgmt_client.batch_account.get(resource_group_name=self.resource_group, + account_name=self.name) + self.log("Response : {0}".format(response)) + self.log("Batch Account instance : {0} found".format(response.name)) + except ResourceNotFoundError as e: + self.log('Did not find the Batch Account instance.') + return + return response.as_dict() + + def format_item(self, item): + result = { + 'id': item['id'], + 'name': item['name'], + 'type': item['type'], + 'location': item['location'], + 'account_endpoint': item['account_endpoint'], + 'provisioning_state': item['provisioning_state'], + 'pool_allocation_mode': item['pool_allocation_mode'], + 'auto_storage': item['auto_storage'], + 'dedicated_core_quota': item['dedicated_core_quota'], + 'low_priority_core_quota': item['low_priority_core_quota'], + 'pool_quota': item['pool_quota'], + 'active_job_and_job_schedule_quota': item['active_job_and_job_schedule_quota'], + 'tags': item.get('tags') + } + return result + + +def main(): + """Main execution""" + AzureRMBatchAccountInfo() + + +if __name__ == '__main__': + main() diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cdnendpoint.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cdnendpoint.py index c289ad0fe..2f3a3d76f 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cdnendpoint.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cdnendpoint.py @@ -20,13 +20,16 @@ options: description: - Name of a resource group where the Azure CDN endpoint exists or will be created. required: true + type: str name: description: - Name of the Azure CDN endpoint. required: true + type: str location: description: - Valid azure location. Defaults to location of the resource group. + type: str started: description: - Use with I(state=present) to start the endpoint. @@ -45,19 +48,25 @@ options: description: - Name of the CDN profile where the endpoint attached to. required: true + type: str origins: description: - Set of source of the content being delivered via CDN. + - Required when creating. + elements: dict + type: list suboptions: name: description: - Origin name. required: true + type: str host_name: description: - The address of the origin. - It can be a domain name, IPv4 address, or IPv6 address. required: true + type: str http_port: description: - The value of the HTTP port. Must be between C(1) and C(65535). @@ -66,7 +75,6 @@ options: description: - The value of the HTTPS port. Must be between C(1) and C(65535). type: int - required: true origin_host_header: description: - The host header value sent to the origin with each request. @@ -111,6 +119,7 @@ options: description: - Assert the state of the Azure CDN endpoint. Use C(present) to create or update a Azure CDN endpoint and C(absent) to delete it. default: present + type: str choices: - absent - present @@ -124,24 +133,24 @@ author: ''' EXAMPLES = ''' - - name: Create a Azure CDN endpoint - azure_rm_cdnendpoint: - resource_group: myResourceGroup - profile_name: myProfile - name: myEndpoint - origins: - - name: TestOrig - host_name: "www.example.com" - tags: - testing: testing - delete: on-exit - foo: bar - - name: Delete a Azure CDN endpoint - azure_rm_cdnendpoint: - resource_group: myResourceGroup - profile_name: myProfile - name: myEndpoint - state: absent +- name: Create a Azure CDN endpoint + azure_rm_cdnendpoint: + resource_group: myResourceGroup + profile_name: myProfile + name: myEndpoint + origins: + - name: TestOrig + host_name: "www.example.com" + tags: + testing: testing + delete: on-exit + foo: bar +- name: Delete a Azure CDN endpoint + azure_rm_cdnendpoint: + resource_group: myResourceGroup + profile_name: myProfile + name: myEndpoint + state: absent ''' RETURN = ''' state: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cdnendpoint_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cdnendpoint_info.py index 897071eb9..9f89408d0 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cdnendpoint_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cdnendpoint_info.py @@ -24,13 +24,16 @@ options: description: - Name of resource group where this CDN profile belongs to. required: true + type: str profile_name: description: - Name of CDN profile. required: true + type: str name: description: - Limit results to a specific Azure CDN endpoint. + type: str tags: description: - Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. @@ -46,19 +49,19 @@ author: ''' EXAMPLES = ''' - - name: Get facts for all endpoints in CDN profile - azure_rm_cdnendpoint_info: - resource_group: myResourceGroup - profile_name: myCDNProfile - tags: - - key - - key:value - - - name: Get facts of specific CDN endpoint - azure_rm_cdnendpoint_info: - resource_group: myResourceGroup - profile_name: myCDNProfile - name: myEndpoint1 +- name: Get facts for all endpoints in CDN profile + azure_rm_cdnendpoint_info: + resource_group: myResourceGroup + profile_name: myCDNProfile + tags: + - key + - key:value + +- name: Get facts of specific CDN endpoint + azure_rm_cdnendpoint_info: + resource_group: myResourceGroup + profile_name: myCDNProfile + name: myEndpoint1 ''' RETURN = ''' @@ -149,6 +152,7 @@ cdnendpoints: "https_port": null, "name": "xxxxxxxx-blob-core-windows-net" } + type: dict origin_host_header: description: - The host header value sent to the origin with each request. @@ -170,8 +174,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.mgmt.cdn import CdnManagementClient - from azure.mgmt.cdn.models import ErrorResponseException - from azure.common import AzureHttpError except ImportError: # handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cdnprofile.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cdnprofile.py index 012a9cba8..96761228f 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cdnprofile.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cdnprofile.py @@ -20,17 +20,21 @@ options: description: - Name of a resource group where the CDN profile exists or will be created. required: true + type: str name: description: - Name of the CDN profile. required: true + type: str location: description: - Valid Azure location. Defaults to location of the resource group. + type: str sku: description: - The pricing tier, defines a CDN provider, feature list and rate of the CDN profile. - Detailed pricing can be find at U(https://azure.microsoft.com/en-us/pricing/details/cdn/). + type: str choices: - standard_verizon - premium_verizon @@ -42,6 +46,7 @@ options: description: - Assert the state of the CDN profile. Use C(present) to create or update a CDN profile and C(absent) to delete it. default: present + type: str choices: - absent - present @@ -56,19 +61,19 @@ author: ''' EXAMPLES = ''' - - name: Create a CDN profile - azure_rm_cdnprofile: - resource_group: myResourceGroup - name: myCDN - sku: standard_akamai - tags: - testing: testing - - - name: Delete the CDN profile - azure_rm_cdnprofile: - resource_group: myResourceGroup - name: myCDN - state: absent +- name: Create a CDN profile + azure_rm_cdnprofile: + resource_group: myResourceGroup + name: myCDN + sku: standard_akamai + tags: + testing: testing + +- name: Delete the CDN profile + azure_rm_cdnprofile: + resource_group: myResourceGroup + name: myCDN + state: absent ''' RETURN = ''' id: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cdnprofile_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cdnprofile_info.py index 0a0e7c9c9..92b9b7957 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cdnprofile_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cdnprofile_info.py @@ -23,9 +23,11 @@ options: name: description: - Limit results to a specific CDN profile. + type: str resource_group: description: - The resource group to search for the desired CDN profile. + type: str tags: description: - Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. @@ -41,18 +43,18 @@ author: ''' EXAMPLES = ''' - - name: Get facts for one CDN profile - azure_rm_cdnprofile_info: - name: Testing - resource_group: myResourceGroup +- name: Get facts for one CDN profile + azure_rm_cdnprofile_info: + name: Testing + resource_group: myResourceGroup - - name: Get facts for all CDN profiles - azure_rm_cdnprofile_info: +- name: Get facts for all CDN profiles + azure_rm_cdnprofile_info: - - name: Get facts by tags - azure_rm_cdnprofile_info: - tags: - - Environment:Test +- name: Get facts by tags + azure_rm_cdnprofile_info: + tags: + - Environment:Test ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cognitivesearch.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cognitivesearch.py index 037cee7f1..a8852c583 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cognitivesearch.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cognitivesearch.py @@ -116,10 +116,10 @@ author: ''' EXAMPLES = ''' - - name: Create Azure Cognitive Search - azure_rm_cognitivesearch: - resource_group: myResourceGroup - name: myAzureSearch +- name: Create Azure Cognitive Search + azure_rm_cognitivesearch: + resource_group: myResourceGroup + name: myAzureSearch ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cognitivesearch_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cognitivesearch_info.py index 4ae5cf819..261712dce 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cognitivesearch_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cognitivesearch_info.py @@ -38,17 +38,17 @@ author: ''' EXAMPLES = ''' - - name: Get Azure Cognitive Search info from resource group 'myResourceGroup' and name 'myAzureSearch' - azure_rm_cognitivesearch_info: - resource_group: myResourceGroup - name: myAzureSearch +- name: Get Azure Cognitive Search info from resource group 'myResourceGroup' and name 'myAzureSearch' + azure_rm_cognitivesearch_info: + resource_group: myResourceGroup + name: myAzureSearch - - name: Get Azure Cognitive Search info from resource group 'myResourceGroup' - azure_rm_cognitivesearch_info: - resource_group: myResourceGroup +- name: Get Azure Cognitive Search info from resource group 'myResourceGroup' + azure_rm_cognitivesearch_info: + resource_group: myResourceGroup - - name: Get all Azure Cognitive Search info - azure_rm_cognitivesearch_info: +- name: Get all Azure Cognitive Search info + azure_rm_cognitivesearch_info: ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerinstance.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerinstance.py index 2b0bffbc5..05df1ee8b 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerinstance.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerinstance.py @@ -63,6 +63,7 @@ options: - This option is deprecated, using I(ports) under I(containers)". type: list elements: int + default: [] location: description: - Valid azure location. Defaults to location of the resource group. @@ -249,82 +250,82 @@ author: ''' EXAMPLES = ''' - - name: Create sample container group - azure_rm_containerinstance: - resource_group: myResourceGroup - name: myContainerInstanceGroup - os_type: linux - ip_address: public - containers: - - name: myContainer1 - image: httpd - memory: 1.5 - ports: - - 80 - - 81 - - - name: Create sample container group with azure file share volume - azure_rm_containerinstance: - resource_group: myResourceGroup - name: myContainerInstanceGroupz - os_type: linux - ip_address: public - containers: - - name: mycontainer1 - image: httpd - memory: 1 - volume_mounts: - - name: filesharevolume - mount_path: "/data/files" - ports: - - 80 - - 81 - volumes: - - name: filesharevolume - azure_file: - storage_account_name: mystorageaccount - share_name: acishare - storage_account_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - - - name: Create sample container group with git repo volume - azure_rm_containerinstance: - resource_group: myResourceGroup - name: myContainerInstanceGroup - os_type: linux - ip_address: public - containers: - - name: mycontainer1 - image: httpd - memory: 1 - volume_mounts: - - name: myvolume1 - mount_path: "/mnt/test" - ports: - - 80 - - 81 - volumes: - - name: myvolume1 - git_repo: - repository: "https://github.com/Azure-Samples/aci-helloworld.git" - - - name: Create sample container instance with subnet - azure_rm_containerinstance: - resource_group: myResourceGroup - name: myContainerInstanceGroup - os_type: linux - ip_address: private - location: eastus - subnet_ids: - - "{{ subnet_id }}" - ports: - - 80 - containers: - - name: mycontainer1 - image: httpd - memory: 1.5 - ports: - - 80 - - 81 +- name: Create sample container group + azure_rm_containerinstance: + resource_group: myResourceGroup + name: myContainerInstanceGroup + os_type: linux + ip_address: public + containers: + - name: myContainer1 + image: httpd + memory: 1.5 + ports: + - 80 + - 81 + +- name: Create sample container group with azure file share volume + azure_rm_containerinstance: + resource_group: myResourceGroup + name: myContainerInstanceGroupz + os_type: linux + ip_address: public + containers: + - name: mycontainer1 + image: httpd + memory: 1 + volume_mounts: + - name: filesharevolume + mount_path: "/data/files" + ports: + - 80 + - 81 + volumes: + - name: filesharevolume + azure_file: + storage_account_name: mystorageaccount + share_name: acishare + storage_account_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + +- name: Create sample container group with git repo volume + azure_rm_containerinstance: + resource_group: myResourceGroup + name: myContainerInstanceGroup + os_type: linux + ip_address: public + containers: + - name: mycontainer1 + image: httpd + memory: 1 + volume_mounts: + - name: myvolume1 + mount_path: "/mnt/test" + ports: + - 80 + - 81 + volumes: + - name: myvolume1 + git_repo: + repository: "https://github.com/Azure-Samples/aci-helloworld.git" + +- name: Create sample container instance with subnet + azure_rm_containerinstance: + resource_group: myResourceGroup + name: myContainerInstanceGroup + os_type: linux + ip_address: private + location: eastus + subnet_ids: + - "{{ subnet_id }}" + ports: + - 80 + containers: + - name: mycontainer1 + image: httpd + memory: 1.5 + ports: + - 80 + - 81 ''' RETURN = ''' id: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerinstance_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerinstance_info.py index 3ad3b9722..9ef9b254c 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerinstance_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerinstance_info.py @@ -41,17 +41,17 @@ author: ''' EXAMPLES = ''' - - name: Get specific Container Instance facts - azure_rm_containerinstance_info: - resource_group: myResourceGroup - name: myContainer - - - name: List Container Instances in a specified resource group name - azure_rm_containerinstance_info: - resource_group: myResourceGroup - tags: - - key - - key:value +- name: Get specific Container Instance facts + azure_rm_containerinstance_info: + resource_group: myResourceGroup + name: myContainer + +- name: List Container Instances in a specified resource group name + azure_rm_containerinstance_info: + resource_group: myResourceGroup + tags: + - key + - key:value ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerregistry.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerregistry.py index cf974f378..ff94c537c 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerregistry.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerregistry.py @@ -63,22 +63,22 @@ author: ''' EXAMPLES = ''' - - name: Create an azure container registry - azure_rm_containerregistry: - name: myRegistry - location: eastus - resource_group: myResourceGroup - admin_user_enabled: true - sku: Premium - tags: - Release: beta1 - Environment: Production - - - name: Remove an azure container registry - azure_rm_containerregistry: - name: myRegistry - resource_group: myResourceGroup - state: absent +- name: Create an azure container registry + azure_rm_containerregistry: + name: myRegistry + location: eastus + resource_group: myResourceGroup + admin_user_enabled: true + sku: Premium + tags: + Release: beta1 + Environment: Production + +- name: Remove an azure container registry + azure_rm_containerregistry: + name: myRegistry + resource_group: myResourceGroup + state: absent ''' RETURN = ''' id: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerregistry_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerregistry_info.py index 8148674fa..8be247d37 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerregistry_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerregistry_info.py @@ -46,17 +46,17 @@ author: ''' EXAMPLES = ''' - - name: Get instance of Registry - azure_rm_containerregistry_info: - resource_group: myResourceGroup - name: myRegistry - - - name: List instances of Registry - azure_rm_containerregistry_info: - resource_group: myResourceGroup - tags: - - key - - key:value +- name: Get instance of Registry + azure_rm_containerregistry_info: + resource_group: myResourceGroup + name: myRegistry + +- name: List instances of Registry + azure_rm_containerregistry_info: + resource_group: myResourceGroup + tags: + - key + - key:value ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerregistryreplication.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerregistryreplication.py index 115d55c29..040214f03 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerregistryreplication.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerregistryreplication.py @@ -21,20 +21,34 @@ options: description: - The name of the resource group to which the container registry belongs. required: True + type: str registry_name: description: - The name of the container registry. required: True + type: str replication_name: description: - The name of the I(replication). required: True + type: str replication: description: - The parameters for creating a replication. + type: dict location: description: - Resource location. If not set, location from the resource group will be used as default. + type: str + state: + description: + - Assert the state of the Container registery replication. + - Use C(present) to create or update Container registery replication and C(absent) to delete it. + default: present + type: str + choices: + - absent + - present extends_documentation_fragment: - azure.azcollection.azure @@ -45,13 +59,13 @@ author: ''' EXAMPLES = ''' - - name: Create (or update) Replication - azure_rm_containerregistryreplication: - resource_group: myResourceGroup - registry_name: myRegistry - replication_name: myReplication - replication: replication - location: eastus +- name: Create (or update) Replication + azure_rm_containerregistryreplication: + resource_group: myResourceGroup + registry_name: myRegistry + replication_name: myReplication + replication: replication + location: eastus ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerregistryreplication_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerregistryreplication_info.py index 123a83288..769910577 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerregistryreplication_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerregistryreplication_info.py @@ -21,14 +21,17 @@ options: description: - The name of the resource group to which the container registry belongs. required: True + type: str registry_name: description: - The name of the container registry. required: True + type: str replication_name: description: - The name of the replication. required: True + type: str extends_documentation_fragment: - azure.azcollection.azure @@ -39,11 +42,11 @@ author: ''' EXAMPLES = ''' - - name: Get instance of Replication - azure_rm_containerregistryreplication_info: - resource_group: resource_group_name - registry_name: registry_name - replication_name: replication_name +- name: Get instance of Replication + azure_rm_containerregistryreplication_info: + resource_group: resource_group_name + registry_name: registry_name + replication_name: replication_name ''' RETURN = ''' @@ -86,7 +89,6 @@ replications: - The status of the replication at the time the operation was called. returned: always type: complex - sample: status contains: message: description: @@ -98,7 +100,7 @@ replications: description: - The timestamp when the status was changed to the current value. returned: always - type: datetime + type: str sample: "2017-03-01T23:15:37.0707808Z" ''' @@ -106,7 +108,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError - from azure.core.polling import LROPoller except ImportError: # This is handled in azure_rm_common pass @@ -137,7 +138,7 @@ class AzureRMReplicationsFacts(AzureRMModuleBase): self.resource_group = None self.registry_name = None self.replication_name = None - super(AzureRMReplicationsFacts, self).__init__(self.module_arg_spec, supports_check_mode=True) + super(AzureRMReplicationsFacts, self).__init__(self.module_arg_spec, supports_tags=False, supports_check_mode=True) def exec_module(self, **kwargs): for key in self.module_arg_spec: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerregistrywebhook.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerregistrywebhook.py index 0175af3e6..cdc77d20c 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerregistrywebhook.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerregistrywebhook.py @@ -21,26 +21,33 @@ options: description: - The name of the resource group to which the container registry belongs. required: True + type: str registry_name: description: - The name of the container registry. required: True + type: str webhook_name: description: - The name of the webhook. required: True + type: str location: description: - Resource location. If not set, location from the resource group will be used as default. + type: str service_uri: description: - The service URI for the webhook to post notifications. + type: str custom_headers: description: - Custom headers that will be added to the webhook notifications. + type: dict status: description: - The status of the webhook at the time the operation was called. + type: str choices: - 'enabled' - 'disabled' @@ -48,10 +55,21 @@ options: description: - "The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' m eans events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events." + type: str actions: description: - The list of actions that trigger the webhook to post notifications. type: list + elements: str + state: + description: + - Assert the state of the Container registery replication. + - Use C(present) to create or update Container registery replication and C(absent) to delete it. + default: present + type: str + choices: + - absent + - present extends_documentation_fragment: - azure.azcollection.azure @@ -62,12 +80,12 @@ author: ''' EXAMPLES = ''' - - name: Create (or update) Webhook - azure_rm_containerregistrywebhook: - resource_group: myResourceGroup - registry_name: myRegistry - webhook_name: myWebhook - location: eastus +- name: Create (or update) Webhook + azure_rm_containerregistrywebhook: + resource_group: myResourceGroup + registry_name: myRegistry + webhook_name: myWebhook + location: eastus ''' RETURN = ''' @@ -150,7 +168,8 @@ class AzureRMWebhooks(AzureRMModuleBase): type='str' ), actions=dict( - type='list' + type='list', + elements='str' ), state=dict( type='str', diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerregistrywebhook_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerregistrywebhook_info.py index c15ed3ef3..379e072e0 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerregistrywebhook_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_containerregistrywebhook_info.py @@ -21,14 +21,17 @@ options: description: - The name of the resource group to which the container registry belongs. required: True + type: str registry_name: description: - The name of the container registry. required: True + type: str webhook_name: description: - The name of the webhook. required: True + type: str extends_documentation_fragment: - azure.azcollection.azure @@ -39,11 +42,11 @@ author: ''' EXAMPLES = ''' - - name: Get instance of Webhook - azure_rm_containerregistrywebhook_info: - resource_group: resource_group_name - registry_name: registry_name - webhook_name: webhook_name +- name: Get instance of Webhook + azure_rm_containerregistrywebhook_info: + resource_group: resource_group_name + registry_name: registry_name + webhook_name: webhook_name ''' RETURN = ''' @@ -136,7 +139,7 @@ class AzureRMWebhooksFacts(AzureRMModuleBase): self.resource_group = None self.registry_name = None self.webhook_name = None - super(AzureRMWebhooksFacts, self).__init__(self.module_arg_spec, supports_check_mode=True) + super(AzureRMWebhooksFacts, self).__init__(self.module_arg_spec, supports_tags=False, supports_check_mode=True) def exec_module(self, **kwargs): for key in self.module_arg_spec: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cosmosdbaccount.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cosmosdbaccount.py index b3066126d..d1f3dd987 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cosmosdbaccount.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cosmosdbaccount.py @@ -21,17 +21,21 @@ options: description: - Name of an Azure resource group. required: True + type: str name: description: - Cosmos DB database account name. required: True + type: str location: description: - The location of the resource group to which the resource belongs. - Required when I(state=present). + type: str kind: description: - Indicates the type of database account. This can only be set at database account creation. + type: str choices: - 'global_document_db' - 'mongo_db' @@ -39,11 +43,13 @@ options: consistency_policy: description: - The consistency policy for the Cosmos DB account. + type: dict suboptions: default_consistency_level: description: - The default consistency level and configuration settings of the Cosmos DB account. - Required when I(state=present). + type: str choices: - 'eventual' - 'session' @@ -65,20 +71,25 @@ options: - An array that contains the georeplication locations enabled for the Cosmos DB account. - Required when I(state=present). type: list + elements: dict suboptions: name: description: - The name of the region. + type: str + required: true failover_priority: description: - The failover priority of the region. A failover priority of 0 indicates a write region. - The maximum value for a failover priority = (total number of regions - 1). - Failover priority values must be unique for each of the regions in which the database account exists. type: int + required: true database_account_offer_type: description: - Database account offer type, for example I(Standard) - Required when I(state=present). + type: str enable_free_tier: description: - If enabled the account is free-tier. @@ -91,6 +102,7 @@ options: - In CIDR form to be included as the allowed list of client IPs for a given database account. - IP addresses/ranges must be comma separated and must not contain any spaces. - This value has been deprecated, and will be removed in a later version. Use I(ip_rules) instead. + type: str ip_rules: description: - The IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs. @@ -137,11 +149,14 @@ options: description: - List of Virtual Network ACL rules configured for the Cosmos DB account. type: list + elements: dict suboptions: subnet: description: - It can be a string containing resource id of a subnet. - It can be a dictionary containing 'resource_group', 'virtual_network_name' and 'subnet_name' + type: raw + required: true ignore_missing_v_net_service_endpoint: description: - Create Cosmos DB account without existing virtual network service endpoint. @@ -151,13 +166,14 @@ options: - Enables the account to write in multiple locations type: bool state: - description: - - Assert the state of the Database Account. - - Use C(present) to create or update an Database Account and C(absent) to delete it. - default: present - choices: - - absent - - present + description: + - Assert the state of the Database Account. + - Use C(present) to create or update an Database Account and C(absent) to delete it. + default: present + type: str + choices: + - absent + - present extends_documentation_fragment: - azure.azcollection.azure @@ -169,36 +185,36 @@ author: ''' EXAMPLES = ''' - - name: Create Cosmos DB Account - min - azure_rm_cosmosdbaccount: - resource_group: myResourceGroup - name: myDatabaseAccount - location: westus - geo_rep_locations: - - name: southcentralus - failover_priority: 0 - database_account_offer_type: Standard - - - name: Create Cosmos DB Account - max - azure_rm_cosmosdbaccount: - resource_group: myResourceGroup - name: myDatabaseAccount - location: westus - kind: mongo_db - geo_rep_locations: - - name: southcentralus - failover_priority: 0 - database_account_offer_type: Standard - ip_rules: - - 10.10.10.10 - enable_multiple_write_locations: yes - virtual_network_rules: - - subnet: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVi - rtualNetwork/subnets/mySubnet" - consistency_policy: - default_consistency_level: bounded_staleness - max_staleness_prefix: 10 - max_interval_in_seconds: 1000 +- name: Create Cosmos DB Account - min + azure_rm_cosmosdbaccount: + resource_group: myResourceGroup + name: myDatabaseAccount + location: westus + geo_rep_locations: + - name: southcentralus + failover_priority: 0 + database_account_offer_type: Standard + +- name: Create Cosmos DB Account - max + azure_rm_cosmosdbaccount: + resource_group: myResourceGroup + name: myDatabaseAccount + location: westus + kind: mongo_db + geo_rep_locations: + - name: southcentralus + failover_priority: 0 + database_account_offer_type: Standard + ip_rules: + - 10.10.10.10 + enable_multiple_write_locations: true + virtual_network_rules: + - subnet: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVi + rtualNetwork/subnets/mySubnet" + consistency_policy: + default_consistency_level: bounded_staleness + max_staleness_prefix: 10 + max_interval_in_seconds: 1000 ''' RETURN = ''' @@ -217,7 +233,6 @@ from ansible.module_utils.common.dict_transformations import _snake_to_camel try: from azure.core.polling import LROPoller from azure.core.exceptions import ResourceNotFoundError - from msrestazure.azure_operation import AzureOperationPoller from azure.mgmt.cosmosdb import CosmosDBManagementClient from ansible.module_utils.six import string_types except ImportError: @@ -272,6 +287,7 @@ class AzureRMCosmosDBAccount(AzureRMModuleBase): ), geo_rep_locations=dict( type='list', + elements='dict', options=dict( name=dict( type='str', @@ -322,9 +338,10 @@ class AzureRMCosmosDBAccount(AzureRMModuleBase): ), virtual_network_rules=dict( type='list', + elements='dict', options=dict( - id=dict( - type='str', + subnet=dict( + type='raw', required=True ), ignore_missing_v_net_service_endpoint=dict( @@ -474,7 +491,7 @@ class AzureRMCosmosDBAccount(AzureRMModuleBase): response = self.mgmt_client.database_accounts.begin_create_or_update(resource_group_name=self.resource_group, account_name=self.name, create_update_parameters=self.parameters) - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) except Exception as exc: @@ -493,7 +510,7 @@ class AzureRMCosmosDBAccount(AzureRMModuleBase): response = self.mgmt_client.database_accounts.begin_delete(resource_group_name=self.resource_group, account_name=self.name) - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) except Exception as e: self.log('Error attempting to delete the Database Account instance.') diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cosmosdbaccount_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cosmosdbaccount_info.py index c97b59ea7..61414272a 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cosmosdbaccount_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cosmosdbaccount_info.py @@ -20,9 +20,11 @@ options: resource_group: description: - Name of an Azure resource group. + type: str name: description: - Cosmos DB database account name. + type: str tags: description: - Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. @@ -49,17 +51,17 @@ author: ''' EXAMPLES = ''' - - name: Get instance of Database Account - azure_rm_cosmosdbaccount_info: - resource_group: myResourceGroup - name: testaccount - - - name: List instances of Database Account - azure_rm_cosmosdbaccount_info: - resource_group: myResourceGroup - tags: - - key - - key:value +- name: Get instance of Database Account + azure_rm_cosmosdbaccount_info: + resource_group: myResourceGroup + name: testaccount + +- name: List instances of Database Account + azure_rm_cosmosdbaccount_info: + resource_group: myResourceGroup + tags: + - key + - key:value ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_datafactory.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_datafactory.py index 66e75f0c8..eabe176de 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_datafactory.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_datafactory.py @@ -114,7 +114,6 @@ EXAMPLES = ''' collaboration_branch: testbranch root_folder: "./" repository_name: vault - ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_datafactory_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_datafactory_info.py index cdd63d717..825afb67f 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_datafactory_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_datafactory_info.py @@ -46,19 +46,19 @@ author: ''' EXAMPLES = ''' - - name: Get data factory by name - azure_rm_datafactory_info: - resource_group: "{{ resource_group }}" - name: "{{ name }}" +- name: Get data factory by name + azure_rm_datafactory_info: + resource_group: "{{ resource_group }}" + name: "{{ name }}" - - name: Get data factory by resource group - azure_rm_datafactory_info: - resource_group: "{{ resource_group }}" +- name: Get data factory by resource group + azure_rm_datafactory_info: + resource_group: "{{ resource_group }}" - - name: Get data factory in relate subscription - azure_rm_datafactory_info: - tags: - - key1 +- name: Get data factory in relate subscription + azure_rm_datafactory_info: + tags: + - key1 ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_datalakestore.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_datalakestore.py index edce24665..eaecb9df5 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_datalakestore.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_datalakestore.py @@ -167,10 +167,10 @@ author: ''' EXAMPLES = ''' - - name: Create Azure Data Lake Store - azure_rm_datalakestore: - resource_group: myResourceGroup - name: myDataLakeStore +- name: Create Azure Data Lake Store + azure_rm_datalakestore: + resource_group: myResourceGroup + name: myDataLakeStore ''' RETURN = ''' @@ -417,7 +417,6 @@ state: ''' from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase -import datetime try: from azure.core.exceptions import ResourceNotFoundError @@ -472,7 +471,6 @@ class AzureRMDatalakeStore(AzureRMModuleBase): 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB']), resource_group=dict(type='str', required=True, aliases=['resource_group_name']), state=dict(type='str', default='present', choices=['present', 'absent']), - tags=dict(type='dict'), virtual_network_rules=dict( type='list', elements='dict', @@ -484,7 +482,6 @@ class AzureRMDatalakeStore(AzureRMModuleBase): self.name = None self.resource_group = None self.location = None - self.tags = None self.new_tier = None self.default_group = None self.encryption_config = dict() @@ -504,7 +501,7 @@ class AzureRMDatalakeStore(AzureRMModuleBase): super(AzureRMDatalakeStore, self).__init__(derived_arg_spec=self.module_arg_spec, supports_check_mode=False, - supports_tags=False) + supports_tags=True) def exec_module(self, **kwargs): for key in list(self.module_arg_spec.keys()) + ['tags']: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_datalakestore_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_datalakestore_info.py index 842330cc0..2417ff74a 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_datalakestore_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_datalakestore_info.py @@ -37,17 +37,17 @@ author: ''' EXAMPLES = ''' - - name: Get Azure Data Lake Store info from resource group 'myResourceGroup' and name 'myDataLakeStore' - azure_rm_datalakestore_info: - resource_group: myResourceGroup - name: myDataLakeStore +- name: Get Azure Data Lake Store info from resource group 'myResourceGroup' and name 'myDataLakeStore' + azure_rm_datalakestore_info: + resource_group: myResourceGroup + name: myDataLakeStore - - name: Get Azure Data Lake Store info from resource group 'myResourceGroup' - azure_rm_datalakestore_info: - resource_group: myResourceGroup +- name: Get Azure Data Lake Store info from resource group 'myResourceGroup' + azure_rm_datalakestore_info: + resource_group: myResourceGroup - - name: Get Azure Data Lake Store info - azure_rm_datalakestore_info: +- name: Get Azure Data Lake Store info + azure_rm_datalakestore_info: ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_ddosprotectionplan.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_ddosprotectionplan.py index 0ae5e82f8..642248d29 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_ddosprotectionplan.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_ddosprotectionplan.py @@ -28,14 +28,14 @@ options: - Resource location. If not set, location from the resource group will be used as default. type: str state: - description: - - Assert the state of the DDoS protection plan. - - Use C(present) to create or update an DDoS protection plan and C(absent) to delete it. - type: str - default: present - choices: - - absent - - present + description: + - Assert the state of the DDoS protection plan. + - Use C(present) to create or update an DDoS protection plan and C(absent) to delete it. + type: str + default: present + choices: + - absent + - present log_path: description: - parent argument. @@ -87,7 +87,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError - from azure.mgmt.network import NetworkManagementClient except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_ddosprotectionplan_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_ddosprotectionplan_info.py index 70b37ac73..74eb190a3 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_ddosprotectionplan_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_ddosprotectionplan_info.py @@ -34,10 +34,10 @@ author: EXAMPLES = ''' - - name: Get facts of specific DDoS protection plan - azure_rm_ddosprotectionplan_info: - resource_group: myResourceGroup - name: myDDoSProtectionPlan +- name: Get facts of specific DDoS protection plan + azure_rm_ddosprotectionplan_info: + resource_group: myResourceGroup + name: myDDoSProtectionPlan ''' RETURN = ''' @@ -47,7 +47,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_deployment.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_deployment.py index 2b6a23a52..07cf93d8e 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_deployment.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_deployment.py @@ -21,67 +21,75 @@ description: - For more information on Azure Resource Manager templates see U(https://azure.microsoft.com/en-us/documentation/articles/resource-group-template-deploy/). options: - resource_group: - description: - - The resource group name to use or create to host the deployed template. - required: true - aliases: - - resource_group_name - name: - description: - - The name of the deployment to be tracked in the resource group deployment history. - - Re-using a deployment name will overwrite the previous value in the resource group's deployment history. - default: ansible-arm - aliases: - - deployment_name - location: - description: - - The geo-locations in which the resource group will be located. - default: westus - deployment_mode: - description: - - In incremental mode, resources are deployed without deleting existing resources that are not included in the template. - - In complete mode resources are deployed and existing resources in the resource group not included in the template are deleted. - default: incremental - choices: - - complete - - incremental - template: - description: - - A hash containing the templates inline. This parameter is mutually exclusive with I(template_link). - - Either I(template) or I(template_link) is required if I(state=present). - type: dict - template_link: - description: - - Uri of file containing the template body. This parameter is mutually exclusive with I(template). - - Either I(template) or I(template_link) is required if I(state=present). - parameters: - description: - - A hash of all the required template variables for the deployment template. This parameter is mutually exclusive with I(parameters_link). - - Either I(parameters_link) or I(parameters) is required if I(state=present). - type: dict - parameters_link: - description: - - Uri of file containing the parameters body. This parameter is mutually exclusive with I(parameters). - - Either I(parameters_link) or I(parameters) is required if I(state=present). - wait_for_deployment_completion: - description: - - Whether or not to block until the deployment has completed. - type: bool - default: 'yes' - wait_for_deployment_polling_period: - description: - - Time (in seconds) to wait between polls when waiting for deployment completion. - default: 10 - state: - description: - - If I(state=present), template will be created. - - If I(state=present) and deployment exists, it will be updated. - - If I(state=absent), the resource group will be removed. - default: present - choices: - - present - - absent + resource_group: + description: + - The resource group name to use or create to host the deployed template. + required: true + type: str + aliases: + - resource_group_name + name: + description: + - The name of the deployment to be tracked in the resource group deployment history. + - Re-using a deployment name will overwrite the previous value in the resource group's deployment history. + default: ansible-arm + type: str + aliases: + - deployment_name + location: + description: + - The geo-locations in which the resource group will be located. + default: westus + type: str + deployment_mode: + description: + - In incremental mode, resources are deployed without deleting existing resources that are not included in the template. + - In complete mode resources are deployed and existing resources in the resource group not included in the template are deleted. + default: incremental + type: str + choices: + - complete + - incremental + template: + description: + - A hash containing the templates inline. This parameter is mutually exclusive with I(template_link). + - Either I(template) or I(template_link) is required if I(state=present). + type: dict + template_link: + description: + - Uri of file containing the template body. This parameter is mutually exclusive with I(template). + - Either I(template) or I(template_link) is required if I(state=present). + type: str + parameters: + description: + - A hash of all the required template variables for the deployment template. This parameter is mutually exclusive with I(parameters_link). + - Either I(parameters_link) or I(parameters) is required if I(state=present). + type: dict + parameters_link: + description: + - Uri of file containing the parameters body. This parameter is mutually exclusive with I(parameters). + - Either I(parameters_link) or I(parameters) is required if I(state=present). + type: str + wait_for_deployment_completion: + description: + - Whether or not to block until the deployment has completed. + type: bool + default: true + wait_for_deployment_polling_period: + description: + - Time (in seconds) to wait between polls when waiting for deployment completion. + default: 10 + type: int + state: + description: + - If I(state=present), template will be created. + - If I(state=present) and deployment exists, it will be updated. + - If I(state=absent), the resource group will be removed. + default: present + type: str + choices: + - present + - absent extends_documentation_fragment: - azure.azcollection.azure @@ -394,7 +402,7 @@ deployment: outputs: description: - Dictionary of outputs received from the deployment. - type: complex + type: dict returned: always sample: { "hostname": { "type": "String", "value": "myvirtualmachine.eastus2.cloudapp.azure.com" } } ''' @@ -402,17 +410,12 @@ deployment: import time try: - from azure.common.credentials import ServicePrincipalCredentials import time - import yaml except ImportError as exc: IMPORT_ERROR = "Error importing module prerequisites: %s" % exc try: - from itertools import chain from azure.core.exceptions import ResourceNotFoundError - from azure.mgmt.resource.resources import ResourceManagementClient - from azure.mgmt.network import NetworkManagementClient except ImportError: # This is handled in azure_rm_common diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_deployment_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_deployment_info.py index 95dd56195..6fcaa1265 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_deployment_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_deployment_info.py @@ -21,9 +21,11 @@ options: description: - The name of the resource group. required: True + type: str name: description: - The name of the deployment. + type: str extends_documentation_fragment: - azure.azcollection.azure @@ -34,10 +36,10 @@ author: ''' EXAMPLES = ''' - - name: Get instance of Deployment - azure_rm_deployment_info: - resource_group: myResourceGroup - name: myDeployment +- name: Get instance of Deployment + azure_rm_deployment_info: + resource_group: myResourceGroup + name: myDeployment ''' RETURN = ''' @@ -58,31 +60,36 @@ deployments: - Resource group name. returned: always sample: myResourceGroup + type: str name: description: - Deployment name. returned: always + type: str sample: myDeployment provisioning_state: description: - Provisioning state of the deployment. returned: always + type: str sample: Succeeded template_link: description: - Link to the template. returned: always + type: str sample: "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/d01a5c06f4f1bc03a049ca17bbbd6e06d62657b3/101-vm-simple-linux/ azuredeploy.json" parameters: description: - Dictionary containing deployment parameters. returned: always - type: complex + type: dict outputs: description: - Dictionary containing deployment outputs. returned: always + type: dict output_resources: description: - List of resources. @@ -122,8 +129,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError - from azure.mgmt.devtestlabs import DevTestLabsClient - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlab.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlab.py index 531cbf55a..1424be8c9 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlab.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlab.py @@ -21,16 +21,20 @@ options: description: - The name of the resource group. required: True + type: str name: description: - The name of the lab. required: True + type: str location: description: - The location of the resource. + type: str storage_type: description: - Type of storage used by the lab. It can be either C(premium) or C(standard). + type: str choices: - 'standard' - 'premium' @@ -39,13 +43,14 @@ options: - Allow creation of premium data disks. type: bool state: - description: - - Assert the state of the DevTest Lab. - - Use C(present) to create or update an DevTest Lab and C(absent) to delete it. - default: present - choices: - - absent - - present + description: + - Assert the state of the DevTest Lab. + - Use C(present) to create or update an DevTest Lab and C(absent) to delete it. + default: present + type: str + choices: + - absent + - present extends_documentation_fragment: - azure.azcollection.azure @@ -57,11 +62,11 @@ author: ''' EXAMPLES = ''' - - name: Create (or update) DevTest Lab - azure_rm_devtestlab: - resource_group: myResourceGroup - name: mylab - storage_type: standard +- name: Create (or update) DevTest Lab + azure_rm_devtestlab: + resource_group: myResourceGroup + name: mylab + storage_type: standard ''' RETURN = ''' @@ -73,16 +78,13 @@ id: sample: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/myResourceGroup/providers/microsoft.devtestlab/labs/mylab ''' -import time from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from ansible.module_utils.common.dict_transformations import _snake_to_camel try: from azure.core.polling import LROPoller from azure.core.exceptions import ResourceNotFoundError - from msrestazure.azure_operation import AzureOperationPoller from azure.mgmt.devtestlabs import DevTestLabsClient - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass @@ -200,7 +202,7 @@ class AzureRMDevTestLab(AzureRMModuleBase): self.delete_devtestlab() # This currently doesnt' work as there is a bug in SDK / Service - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) else: self.log("DevTest Lab instance unchanged") @@ -225,7 +227,7 @@ class AzureRMDevTestLab(AzureRMModuleBase): response = self.mgmt_client.labs.begin_create_or_update(resource_group_name=self.resource_group, name=self.name, lab=self.lab) - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) except Exception as exc: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlab_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlab_info.py index 63abdd357..6add55e59 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlab_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlab_info.py @@ -39,19 +39,19 @@ author: ''' EXAMPLES = ''' - - name: List instances of DevTest Lab by resource group - azure_rm_devtestlab_info: - resource_group: testrg - tags: - - key:value +- name: List instances of DevTest Lab by resource group + azure_rm_devtestlab_info: + resource_group: testrg + tags: + - key:value - - name: List instances of DevTest Lab in subscription - azure_rm_devtestlab_info: +- name: List instances of DevTest Lab in subscription + azure_rm_devtestlab_info: - - name: Get instance of DevTest Lab - azure_rm_devtestlab_info: - resource_group: testrg - name: testlab +- name: Get instance of DevTest Lab + azure_rm_devtestlab_info: + resource_group: testrg + name: testlab ''' RETURN = ''' @@ -137,7 +137,7 @@ labs: description: - The tags of the resource. returned: always - type: complex + type: dict sample: "{ 'MyTag': 'MyValue' }" ''' @@ -145,7 +145,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.mgmt.devtestlabs import DevTestLabsClient - from msrest.serialization import Model from azure.core.exceptions import ResourceNotFoundError except ImportError: # This is handled in azure_rm_common diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabarmtemplate_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabarmtemplate_info.py index 42556856c..783a272dd 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabarmtemplate_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabarmtemplate_info.py @@ -46,12 +46,12 @@ author: ''' EXAMPLES = ''' - - name: Get information on DevTest Lab ARM Template - azure_rm_devtestlabarmtemplate_info: - resource_group: myResourceGroup - lab_name: myLab - artifact_source_name: public environment repo - name: WebApp +- name: Get information on DevTest Lab ARM Template + azure_rm_devtestlabarmtemplate_info: + resource_group: myResourceGroup + lab_name: myLab + artifact_source_name: public environment repo + name: WebApp ''' RETURN = ''' @@ -72,36 +72,43 @@ arm_templates: description: - Resource group name. returned: always + type: str sample: myResourceGroup lab_name: description: - DevTest Lab name. returned: always + type: str sample: myLab artifact_source_name: description: - Artifact source name. returned: always + type: str sample: public environment repo name: description: - ARM Template name. returned: always + type: str sample: WebApp display_name: description: - The tags of the resource. returned: always + type: str sample: Web App description: description: - The tags of the resource. returned: always + type: str sample: This template creates an Azure Web App without a data store. publisher: description: - The tags of the resource. returned: always + type: str sample: Microsoft ''' @@ -110,7 +117,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError from azure.mgmt.devtestlabs import DevTestLabsClient - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabartifact_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabartifact_info.py index 7100ad122..9ec729257 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabartifact_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabartifact_info.py @@ -46,12 +46,12 @@ author: ''' EXAMPLES = ''' - - name: Get instance of DevTest Lab Artifact - azure_rm_devtestlabartifact_info: - resource_group: myResourceGroup - lab_name: myLab - artifact_source_name: myArtifactSource - name: myArtifact +- name: Get instance of DevTest Lab Artifact + azure_rm_devtestlabartifact_info: + resource_group: myResourceGroup + lab_name: myLab + artifact_source_name: myArtifactSource + name: myArtifact ''' RETURN = ''' @@ -126,7 +126,7 @@ artifacts: description: - A dictionary containing parameters definition of the artifact. returned: always - type: complex + type: dict sample: {} ''' @@ -135,7 +135,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError from azure.mgmt.devtestlabs import DevTestLabsClient - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabartifactsource.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabartifactsource.py index 5ca4a5772..87f19bbd9 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabartifactsource.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabartifactsource.py @@ -20,51 +20,62 @@ options: resource_group: description: - The name of the resource group. + type: str required: True lab_name: description: - The name of the lab. + type: str required: True name: description: - The name of the artifact source. + type: str required: True display_name: description: - The artifact source's display name. + type: str uri: description: - The artifact source's URI. + type: str source_type: description: - The artifact source's type. + type: str choices: - 'vso' - 'github' folder_path: description: - The folder containing artifacts. + type: str arm_template_folder_path: description: - The folder containing Azure Resource Manager templates. + type: str branch_ref: description: - The artifact source's branch reference. + type: str security_token: description: - The security token to authenticate to the artifact source. + type: str is_enabled: description: - Indicates whether the artifact source is enabled. type: bool state: - description: - - Assert the state of the DevTest Labs Artifacts Source. - - Use C(present) to create or update an DevTest Labs Artifacts Source and C(absent) to delete it. - default: present - choices: - - absent - - present + description: + - Assert the state of the DevTest Labs Artifacts Source. + - Use C(present) to create or update an DevTest Labs Artifacts Source and C(absent) to delete it. + default: present + type: str + choices: + - absent + - present extends_documentation_fragment: - azure.azcollection.azure @@ -76,15 +87,15 @@ author: ''' EXAMPLES = ''' - - name: Create (or update) DevTest Labs Artifacts Source - azure_rm_devtestlabartifactsource: - resource_group: myrg - lab_name: mylab - name: myartifacts - uri: https://github.com/myself/myrepo.git - source_type: github - folder_path: / - security_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +- name: Create (or update) DevTest Labs Artifacts Source + azure_rm_devtestlabartifactsource: + resource_group: myrg + lab_name: mylab + name: myartifacts + uri: https://github.com/myself/myrepo.git + source_type: github + folder_path: / + security_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ''' RETURN = ''' @@ -102,16 +113,12 @@ is_enabled: sample: true ''' -import time from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase -from ansible.module_utils.common.dict_transformations import _snake_to_camel try: from azure.core.polling import LROPoller from azure.core.exceptions import ResourceNotFoundError - from msrestazure.azure_operation import AzureOperationPoller from azure.mgmt.devtestlabs import DevTestLabsClient - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass @@ -305,7 +312,7 @@ class AzureRMDevTestLabArtifactsSource(AzureRMModuleBase): lab_name=self.lab_name, name=self.name, artifact_source=self.artifact_source) - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) except Exception as exc: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabartifactsource_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabartifactsource_info.py index 96bdde553..036a3da45 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabartifactsource_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabartifactsource_info.py @@ -46,11 +46,11 @@ author: ''' EXAMPLES = ''' - - name: Get instance of DevTest Lab Artifact Source - azure_rm_devtestlabartifactsource_info: - resource_group: myResourceGroup - lab_name: myLab - name: myArtifactSource +- name: Get instance of DevTest Lab Artifact Source + azure_rm_devtestlabartifactsource_info: + resource_group: myResourceGroup + lab_name: myLab + name: myArtifactSource ''' RETURN = ''' @@ -131,7 +131,7 @@ artifactsources: description: - The tags of the resource. returned: always - type: complex + type: dict sample: "{ 'MyTag': 'MyValue' }" ''' @@ -140,7 +140,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError from azure.mgmt.devtestlabs import DevTestLabsClient - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabcustomimage.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabcustomimage.py index 7b611706b..f24c6f7e5 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabcustomimage.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabcustomimage.py @@ -21,20 +21,25 @@ options: description: - The name of the resource group. required: True + type: str lab_name: description: - The name of the lab. required: True + type: str name: description: - The name of the custom image. required: True + type: str source_vm: description: - Source DevTest Lab virtual machine name. + type: str windows_os_state: description: - The state of the Windows OS. + type: str choices: - 'non_sysprepped' - 'sysprep_requested' @@ -42,6 +47,7 @@ options: linux_os_state: description: - The state of the Linux OS. + type: str choices: - 'non_deprovisioned' - 'deprovision_requested' @@ -49,17 +55,20 @@ options: description: description: - The description of the custom image. + type: str author: description: - The author of the custom image. + type: str state: - description: - - Assert the state of the Custom Image. - - Use C(present) to create or update an Custom Image and C(absent) to delete it. - default: present - choices: - - absent - - present + description: + - Assert the state of the Custom Image. + - Use C(present) to create or update an Custom Image and C(absent) to delete it. + default: present + type: str + choices: + - absent + - present extends_documentation_fragment: - azure.azcollection.azure @@ -89,16 +98,13 @@ id: sample: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/myResourceGroup/providers/microsoft.devtestlab/labs/myLab/images/myImage" ''' -import time from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from ansible.module_utils.common.dict_transformations import _snake_to_camel try: from azure.core.polling import LROPoller from azure.core.exceptions import ResourceNotFoundError - from msrestazure.azure_operation import AzureOperationPoller from azure.mgmt.devtestlabs import DevTestLabsClient - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass @@ -238,7 +244,7 @@ class AzureRMDtlCustomImage(AzureRMModuleBase): self.delete_customimage() # This currently doesnt' work as there is a bug in SDK / Service - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) else: self.log("Custom Image instance unchanged") @@ -264,7 +270,7 @@ class AzureRMDtlCustomImage(AzureRMModuleBase): lab_name=self.lab_name, name=self.name, custom_image=self.custom_image) - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) except Exception as exc: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabcustomimage_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabcustomimage_info.py index 46ba637df..2c6d559aa 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabcustomimage_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabcustomimage_info.py @@ -46,17 +46,17 @@ author: ''' EXAMPLES = ''' - - name: Get instance of Custom Image - azure_rm_devtestlabcustomimage_info: - resource_group: myResourceGroup - lab_name: myLab - name: myImage - - - name: List instances of Custom Image in the lab - azure_rm_devtestlabcustomimage_info: - resource_group: myResourceGroup - lab_name: myLab - name: myImage +- name: Get instance of Custom Image + azure_rm_devtestlabcustomimage_info: + resource_group: myResourceGroup + lab_name: myLab + name: myImage + +- name: List instances of Custom Image in the lab + azure_rm_devtestlabcustomimage_info: + resource_group: myResourceGroup + lab_name: myLab + name: myImage ''' RETURN = ''' @@ -108,7 +108,7 @@ custom_images: description: - The tags of the resource. returned: always - type: complex + type: dict sample: "{ 'MyTag':'MyValue' }" ''' @@ -117,7 +117,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError from azure.mgmt.devtestlabs import DevTestLabsClient - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass @@ -137,7 +136,6 @@ class AzureRMDtlCustomImageInfo(AzureRMModuleBase): ), name=dict( type='str', - required=True ), tags=dict( type='list', diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabenvironment.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabenvironment.py index cd3735ce0..214ddbbe1 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabenvironment.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabenvironment.py @@ -49,6 +49,7 @@ options: description: - The parameters of the Azure Resource Manager template. type: list + elements: dict suboptions: name: description: @@ -101,16 +102,12 @@ id: ''' -import time from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase -from ansible.module_utils.common.dict_transformations import _snake_to_camel try: from azure.core.polling import LROPoller from azure.core.exceptions import ResourceNotFoundError - from msrestazure.azure_operation import AzureOperationPoller from azure.mgmt.devtestlabs import DevTestLabsClient - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass @@ -149,6 +146,7 @@ class AzureRMDtlEnvironment(AzureRMModuleBase): ), deployment_parameters=dict( type='list', + elements='dict', options=dict( name=dict( type='str' @@ -248,7 +246,7 @@ class AzureRMDtlEnvironment(AzureRMModuleBase): self.delete_environment() # This currently doesn't work as there is a bug in SDK / Service - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) else: self.log("Environment instance unchanged") @@ -282,7 +280,7 @@ class AzureRMDtlEnvironment(AzureRMModuleBase): user_name=self.user_name, name=self.name, dtl_environment=self.dtl_environment) - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) except Exception as exc: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabenvironment_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabenvironment_info.py index 675f6e848..4648ed1b7 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabenvironment_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabenvironment_info.py @@ -51,14 +51,14 @@ author: ''' EXAMPLES = ''' - - name: Get instance of Environment - azure_rm_devtestlabenvironment_info: - resource_group: myResourceGroup - lab_name: myLab - user_name: myUser - name: myEnvironment - tags: - - key:value +- name: Get instance of Environment + azure_rm_devtestlabenvironment_info: + resource_group: myResourceGroup + lab_name: myLab + user_name: myUser + name: myEnvironment + tags: + - key:value ''' RETURN = ''' @@ -116,7 +116,7 @@ environments: description: - The tags of the resource. returned: always - type: complex + type: dict sample: "{ 'MyTag': 'MyValue' }" ''' @@ -125,7 +125,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError from azure.mgmt.devtestlabs import DevTestLabsClient - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabpolicy.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabpolicy.py index f7aece825..2a3f2f953 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabpolicy.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabpolicy.py @@ -21,24 +21,30 @@ options: description: - The name of the resource group. required: True + type: str lab_name: description: - The name of the lab. required: True + type: str policy_set_name: description: - The name of the policy set. required: True + type: str name: description: - The name of the policy. required: True + type: str description: description: - The description of the policy. + type: str fact_name: description: - The fact name of the policy (e.g. C(lab_vm_count), C(lab_vm_size)), MaxVmsAllowedPerLab, etc. + type: str choices: - 'user_owned_lab_vm_count' - 'user_owned_lab_premium_vm_count' @@ -53,13 +59,14 @@ options: - The threshold of the policy (it could be either a maximum value or a list of allowed values). type: raw state: - description: - - Assert the state of the Policy. - - Use C(present) to create or update an Policy and C(absent) to delete it. - default: present - choices: - - absent - - present + description: + - Assert the state of the Policy. + - Use C(present) to create or update an Policy and C(absent) to delete it. + default: present + type: str + choices: + - absent + - present extends_documentation_fragment: - azure.azcollection.azure @@ -92,16 +99,13 @@ id: ''' -import time from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from ansible.module_utils.common.dict_transformations import _snake_to_camel try: from azure.core.polling import LROPoller from azure.core.exceptions import ResourceNotFoundError - from msrestazure.azure_operation import AzureOperationPoller from azure.mgmt.devtestlabs import DevTestLabsClient - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass @@ -237,7 +241,7 @@ class AzureRMDtlPolicy(AzureRMModuleBase): self.delete_policy() # This currently doesnt' work as there is a bug in SDK / Service - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) else: self.log("Policy instance unchanged") @@ -265,7 +269,7 @@ class AzureRMDtlPolicy(AzureRMModuleBase): policy_set_name=self.policy_set_name, name=self.name, policy=self.policy) - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) except Exception as exc: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabpolicy_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabpolicy_info.py index d6d452871..a8f3b104a 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabpolicy_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabpolicy_info.py @@ -51,14 +51,14 @@ author: ''' EXAMPLES = ''' - - name: Get instance of Policy - azure_rm_devtestlabpolicy_info: - resource_group: myResourceGroup - lab_name: myLab - policy_set_name: myPolicySet - name: myPolicy - tags: - - key:value +- name: Get instance of Policy + azure_rm_devtestlabpolicy_info: + resource_group: myResourceGroup + lab_name: myLab + policy_set_name: myPolicySet + name: myPolicy + tags: + - key:value ''' RETURN = ''' @@ -115,7 +115,7 @@ policies: description: - The tags of the resource. returned: always - type: complex + type: dict sample: "{ 'MyTag': 'MyValue' }" ''' @@ -124,7 +124,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError from azure.mgmt.devtestlabs import DevTestLabsClient - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabschedule.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabschedule.py index c672cb274..060b3baa0 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabschedule.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabschedule.py @@ -21,31 +21,37 @@ options: description: - The name of the resource group. required: True + type: str lab_name: description: - The name of the lab. required: True + type: str name: description: - The name of the schedule. required: True + type: str choices: - lab_vms_startup - lab_vms_shutdown time: description: - The time of day the schedule will occur. + type: str time_zone_id: description: - The time zone ID. + type: str state: - description: - - Assert the state of the Schedule. - - Use C(present) to create or update an Schedule and C(absent) to delete it. - default: present - choices: - - absent - - present + description: + - Assert the state of the Schedule. + - Use C(present) to create or update an Schedule and C(absent) to delete it. + default: present + type: str + choices: + - absent + - present extends_documentation_fragment: - azure.azcollection.azure @@ -57,13 +63,13 @@ author: ''' EXAMPLES = ''' - - name: Create (or update) DevTest Lab Schedule - azure_rm_devtestlabschedule: - resource_group: myResourceGroup - lab_name: myLab - name: lab_vms_shutdown - time: "1030" - time_zone_id: "UTC+12" +- name: Create (or update) DevTest Lab Schedule + azure_rm_devtestlabschedule: + resource_group: myResourceGroup + lab_name: myLab + name: lab_vms_shutdown + time: "1030" + time_zone_id: "UTC+12" ''' RETURN = ''' @@ -76,16 +82,12 @@ id: abVmsShutdown" ''' -import time from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase -from ansible.module_utils.common.dict_transformations import _snake_to_camel try: from azure.core.polling import LROPoller from azure.core.exceptions import ResourceNotFoundError - from msrestazure.azure_operation import AzureOperationPoller from azure.mgmt.devtestlabs import DevTestLabsClient - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass @@ -211,7 +213,7 @@ class AzureRMSchedule(AzureRMModuleBase): self.delete_schedule() # This currently doesn't work as there is a bug in SDK / Service - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) else: self.log("Schedule instance unchanged") @@ -237,7 +239,7 @@ class AzureRMSchedule(AzureRMModuleBase): lab_name=self.lab_name, name=self.name, schedule=self.schedule) - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) except Exception as exc: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabschedule_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabschedule_info.py index dae349d2d..e366e0f99 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabschedule_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabschedule_info.py @@ -46,13 +46,13 @@ author: ''' EXAMPLES = ''' - - name: Get instance of Schedule - azure_rm_devtestlabschedule_info: - resource_group: myResourceGroup - lab_name: myLab - name: mySchedule - tags: - - key:value +- name: Get instance of Schedule + azure_rm_devtestlabschedule_info: + resource_group: myResourceGroup + lab_name: myLab + name: mySchedule + tags: + - key:value ''' RETURN = ''' @@ -103,7 +103,7 @@ schedules: description: - The tags of the resource. returned: always - type: complex + type: dict sample: "{ 'MyTag': 'MyValue' }" ''' @@ -113,7 +113,6 @@ from ansible.module_utils.common.dict_transformations import _camel_to_snake, _s try: from azure.core.exceptions import ResourceNotFoundError from azure.mgmt.devtestlabs import DevTestLabsClient - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabvirtualmachine.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabvirtualmachine.py index f1edde75b..62e7db77a 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabvirtualmachine.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabvirtualmachine.py @@ -21,20 +21,25 @@ options: description: - The name of the resource group. required: True + type: str lab_name: description: - The name of the lab. required: True + type: str name: description: - The name of the virtual machine. required: True + type: str notes: description: - The notes of the virtual machine. + type: str os_type: description: - Base type of operating system. + type: str choices: - windows - linux @@ -44,84 +49,106 @@ options: - The list of choices varies depending on the subscription and location. Check your subscription for available choices. - Available values can be found on this website, link U(https://docs.microsoft.com/en-us/azure/virtual-machines/windows/sizes-general). - Required when I(state=present). + type: str user_name: description: - The user name of the virtual machine. + type: str password: description: - The password of the virtual machine administrator. + type: str ssh_key: description: - The SSH key of the virtual machine administrator. + type: str lab_subnet: description: - An existing subnet within lab's virtual network. - It can be the subnet's resource id. - It can be a dict which contains C(virtual_network_name) and C(name). + type: raw disallow_public_ip_address: description: - Indicates whether the virtual machine is to be created without a public IP address. + type: str artifacts: description: - The artifacts to be installed on the virtual machine. type: list + elements: dict suboptions: source_name: description: - The artifact's source name. + type: str source_path: description: - The artifact's path in the source repository. + type: str parameters: description: - The parameters of the artifact. type: list + elements: dict suboptions: name: description: - The name of the artifact parameter. + type: str value: description: - The value of the artifact parameter. + type: str image: description: - The Microsoft Azure Marketplace image reference of the virtual machine. + type: dict suboptions: offer: description: - The offer of the gallery image. + type: str publisher: description: - The publisher of the gallery image. + type: str sku: description: - The SKU of the gallery image. + type: str os_type: description: - The OS type of the gallery image. + type: str version: description: - The version of the gallery image. + type: str expiration_date: description: - The expiration date for VM. + type: str allow_claim: description: - Indicates whether another user can take ownership of the virtual machine. + type: str storage_type: description: - Storage type to use for virtual machine. + type: str choices: - standard - premium state: - description: - - Assert the state of the Virtual Machine. - - Use C(present) to create or update an Virtual Machine and C(absent) to delete it. - default: present - choices: - - absent - - present + description: + - Assert the state of the Virtual Machine. + - Use C(present) to create or update an Virtual Machine and C(absent) to delete it. + type: str + default: present + choices: + - absent + - present extends_documentation_fragment: - azure.azcollection.azure @@ -133,31 +160,31 @@ author: ''' EXAMPLES = ''' - - name: Create (or update) Virtual Machine - azure_rm_devtestlabvirtualmachine: - resource_group: myrg - lab_name: mylab - name: myvm - notes: Virtual machine notes.... - os_type: linux - vm_size: Standard_A2_v2 - user_name: vmadmin - password: ZSuppas$$21! - lab_subnet: - name: myvnSubnet - virtual_network_name: myvn - disallow_public_ip_address: no - image: - offer: UbuntuServer - publisher: Canonical - sku: 16.04-LTS - os_type: Linux - version: latest - artifacts: - - source_name: myartifact - source_path: "/Artifacts/linux-install-mongodb" - allow_claim: no - expiration_date: "2019-02-22T01:49:12.117974Z" +- name: Create (or update) Virtual Machine + azure_rm_devtestlabvirtualmachine: + resource_group: myrg + lab_name: mylab + name: myvm + notes: Virtual machine notes.... + os_type: linux + vm_size: Standard_A2_v2 + user_name: vmadmin + password: ZSuppas$$21! + lab_subnet: + name: myvnSubnet + virtual_network_name: myvn + disallow_public_ip_address: false + image: + offer: 0001-com-ubuntu-server-focal + publisher: Canonical + sku: 20_04-lts + os_type: Linux + version: latest + artifacts: + - source_name: myartifact + source_path: "/Artifacts/linux-install-mongodb" + allow_claim: false + expiration_date: "2019-02-22T01:49:12.117974Z" ''' RETURN = ''' @@ -181,16 +208,13 @@ fqdn: sample: myvm.eastus.cloudapp.azure.com ''' -import time from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from ansible.module_utils.common.dict_transformations import _snake_to_camel try: from azure.core.polling import LROPoller from azure.core.exceptions import ResourceNotFoundError - from msrestazure.azure_operation import AzureOperationPoller from azure.mgmt.devtestlabs import DevTestLabsClient - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass @@ -246,12 +270,17 @@ class AzureRMVirtualMachine(AzureRMModuleBase): ), artifacts=dict( type='list', + elements='dict', options=dict( - artifact_id=dict( + source_name=dict( + type='str', + ), + source_path=dict( type='str' ), parameters=dict( type='list', + elements='dict', options=dict( name=dict( type='str' @@ -463,7 +492,7 @@ class AzureRMVirtualMachine(AzureRMModuleBase): lab_name=self.lab_name, name=self.name, lab_virtual_machine=self.lab_virtual_machine) - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) except Exception as exc: @@ -486,7 +515,7 @@ class AzureRMVirtualMachine(AzureRMModuleBase): self.log('Error attempting to delete the Virtual Machine instance.') self.fail("Error deleting the Virtual Machine instance: {0}".format(str(e))) - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) return True diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabvirtualmachine_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabvirtualmachine_info.py index f33f2b976..24398136e 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabvirtualmachine_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabvirtualmachine_info.py @@ -46,13 +46,13 @@ author: ''' EXAMPLES = ''' - - name: Get instance of DTL Virtual Machine - azure_rm_devtestlabvirtualmachine_info: - resource_group: myResourceGroup - lab_name: myLab - name: myVm - tags: - - key:value +- name: Get instance of DTL Virtual Machine + azure_rm_devtestlabvirtualmachine_info: + resource_group: myResourceGroup + lab_name: myLab + name: myVm + tags: + - key:value ''' RETURN = ''' @@ -128,7 +128,7 @@ virtualmachines: - The SKU of the gallery image. returned: when created from gallery image type: str - sample: 16.04-LTS + sample: 20_04-lts publisher: description: - The publisher of the gallery image. @@ -199,7 +199,7 @@ virtualmachines: description: - The tags of the resource. returned: always - type: complex + type: dict sample: "{ 'foo': 'bar' }" ''' @@ -208,7 +208,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError from azure.mgmt.devtestlabs import DevTestLabsClient - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabvirtualnetwork.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabvirtualnetwork.py index 0ecd93098..a47a8c8f9 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabvirtualnetwork.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabvirtualnetwork.py @@ -21,28 +21,34 @@ options: description: - The name of the resource group. required: True + type: str lab_name: description: - The name of the lab. required: True + type: str name: description: - The name of the virtual network. required: True + type: str location: description: - The location of the resource. + type: str description: description: - The description of the virtual network. + type: str state: - description: - - Assert the state of the Virtual Network. - - Use C(present) to create or update an Virtual Network and C(absent) to delete it. - default: present - choices: - - absent - - present + description: + - Assert the state of the Virtual Network. + - Use C(present) to create or update an Virtual Network and C(absent) to delete it. + type: str + default: present + choices: + - absent + - present extends_documentation_fragment: - azure.azcollection.azure @@ -54,12 +60,12 @@ author: ''' EXAMPLES = ''' - - name: Create (or update) Virtual Network - azure_rm_devtestlabvirtualnetwork: - resource_group: myResourceGroup - lab_name: mylab - name: myvn - description: My Lab Virtual Network +- name: Create (or update) Virtual Network + azure_rm_devtestlabvirtualnetwork: + resource_group: myResourceGroup + lab_name: mylab + name: myvn + description: My Lab Virtual Network ''' RETURN = ''' @@ -79,16 +85,12 @@ external_provider_resource_id: rtualNetworks/myvn" ''' -import time from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase -from ansible.module_utils.common.dict_transformations import _snake_to_camel try: from azure.core.polling import LROPoller from azure.core.exceptions import ResourceNotFoundError - from msrestazure.azure_operation import AzureOperationPoller from azure.mgmt.devtestlabs import DevTestLabsClient - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass @@ -205,7 +207,7 @@ class AzureRMDevTestLabVirtualNetwork(AzureRMModuleBase): return self.results self.delete_virtualnetwork() # This currently doesn't work as there is a bug in SDK / Service - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) else: self.log("Virtual Network instance unchanged") @@ -232,7 +234,7 @@ class AzureRMDevTestLabVirtualNetwork(AzureRMModuleBase): lab_name=self.lab_name, name=self.name, virtual_network=self.virtual_network) - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) except Exception as exc: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabvirtualnetwork_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabvirtualnetwork_info.py index b66b2f45b..23392468b 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabvirtualnetwork_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_devtestlabvirtualnetwork_info.py @@ -41,17 +41,17 @@ author: ''' EXAMPLES = ''' - - name: Get instance of DevTest Lab Virtual Network - azure_rm_devtestlabvirtualnetwork_info: - resource_group: myResourceGroup - lab_name: myLab - name: myVirtualNetwork - - - name: List all Virtual Networks in DevTest Lab - azure_rm_devtestlabvirtualnetwork_info: - resource_group: myResourceGroup - lab_name: myLab - name: myVirtualNetwork +- name: Get instance of DevTest Lab Virtual Network + azure_rm_devtestlabvirtualnetwork_info: + resource_group: myResourceGroup + lab_name: myLab + name: myVirtualNetwork + +- name: List all Virtual Networks in DevTest Lab + azure_rm_devtestlabvirtualnetwork_info: + resource_group: myResourceGroup + lab_name: myLab + name: myVirtualNetwork ''' RETURN = ''' @@ -112,7 +112,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError from azure.mgmt.devtestlabs import DevTestLabsClient - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_diskencryptionset.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_diskencryptionset.py index 93bd8ab47..f76f784eb 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_diskencryptionset.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_diskencryptionset.py @@ -153,7 +153,7 @@ state: ''' from ansible.module_utils.basic import _load_params -from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, HAS_AZURE, \ +from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, \ format_resource_id, normalize_location_name try: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_dnsrecordset.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_dnsrecordset.py index 55b682be6..32448964a 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_dnsrecordset.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_dnsrecordset.py @@ -151,9 +151,9 @@ EXAMPLES = ''' record_type: "{{ item.type }}" records: "{{ item.records }}" with_items: - - { name: 'servera', type: 'A', records: [ { entry: '10.10.10.20' }, { entry: '10.10.10.21' }] } - - { name: 'serverb', type: 'A', records: [ { entry: '10.10.10.30' }, { entry: '10.10.10.41' }] } - - { name: 'serverc', type: 'A', records: [ { entry: '10.10.10.40' }, { entry: '10.10.10.41' }] } + - {name: 'servera', type: 'A', records: [{entry: '10.10.10.20'}, {entry: '10.10.10.21'}]} + - {name: 'serverb', type: 'A', records: [{entry: '10.10.10.30'}, {entry: '10.10.10.41'}]} + - {name: 'serverc', type: 'A', records: [{entry: '10.10.10.40'}, {entry: '10.10.10.41'}]} - name: create SRV records in a new record set azure_rm_dnsrecordset: @@ -163,11 +163,11 @@ EXAMPLES = ''' time_to_live: 7200 record_type: SRV records: - - entry: sip.testing.com - preference: 10 - priority: 20 - weight: 10 - port: 5060 + - entry: sip.testing.com + preference: 10 + priority: 20 + weight: 10 + port: 5060 - name: create PTR record in a new record set azure_rm_dnsrecordset: @@ -176,7 +176,7 @@ EXAMPLES = ''' zone_name: testing.com record_type: PTR records: - - entry: servera.testing.com + - entry: servera.testing.com - name: create TXT record in a new record set azure_rm_dnsrecordset: @@ -185,7 +185,7 @@ EXAMPLES = ''' zone_name: testing.com record_type: TXT records: - - entry: 'v=spf1 a -all' + - entry: 'v=spf1 a -all' - name: Update SOA record azure_rm_dnsrecordset: @@ -201,7 +201,6 @@ EXAMPLES = ''' retry_time: 399 expire_time: 2419299 minimum_ttl: 399 - ''' RETURN = ''' @@ -277,12 +276,9 @@ state: ] ''' -import inspect -import sys import copy from ansible.module_utils.basic import _load_params -from ansible.module_utils.six import iteritems from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, HAS_AZURE try: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_dnszone.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_dnszone.py index f5033be38..3d95d33a7 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_dnszone.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_dnszone.py @@ -37,20 +37,24 @@ options: description: - name of resource group. required: true + type: str name: description: - Name of the DNS zone. required: true + type: str state: description: - Assert the state of the zone. Use C(present) to create or update and C(absent) to delete. default: present + type: str choices: - absent - present type: description: - The type of this DNS zone (C(public) or C(private)). + type: str choices: - public - private @@ -89,7 +93,6 @@ EXAMPLES = ''' resource_group: myResourceGroup name: example.com state: absent - ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_dnszone_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_dnszone_info.py index 8a37a131d..75a228e6b 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_dnszone_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_dnszone_info.py @@ -23,9 +23,11 @@ options: resource_group: description: - Limit results by resource group. Required when filtering by name. + type: str name: description: - Only show results for a specific zone. + type: str tags: description: - Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. @@ -81,14 +83,17 @@ dnszones: description: - id of the DNS Zone. sample: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/dnszones/azure.com" + type: str name: description: - name of the DNS zone. sample: azure.com + type: str type: description: - The type of this DNS zone (C(public) or C(private)). sample: private + type: str registration_virtual_networks: description: - A list of references to virtual networks that register hostnames in this DNS zone. diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_eventhub.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_eventhub.py index ecc8bc424..5da748a17 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_eventhub.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_eventhub.py @@ -99,7 +99,7 @@ EXAMPLES = ''' namespace_name: myNamespace name: myhub tags: - - a: b + - a: b sku: free - name: Delete Event Hub @@ -122,7 +122,6 @@ EXAMPLES = ''' resource_group: testgroupans namespace_name: myNamespace state: absent - ''' RETURN = ''' @@ -157,7 +156,6 @@ state: ''' try: - from azure.core.exceptions import ResourceNotFoundError from azure.mgmt.eventhub.models import Eventhub, EHNamespace from azure.mgmt.eventhub.models import Sku except ImportError: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_eventhub_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_eventhub_info.py index 9e0084ca6..c62ef3a7b 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_eventhub_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_eventhub_info.py @@ -38,10 +38,10 @@ author: EXAMPLES = ''' - - name: Get facts of specific Event hub - community.azure.azure_rm_eventhub_info: - resource_group: myResourceGroup - name: myEventHub +- name: Get facts of specific Event hub + community.azure.azure_rm_eventhub_info: + resource_group: myResourceGroup + name: myEventHub ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_expressroute.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_expressroute.py index 93b53dc70..fa585f90d 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_expressroute.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_expressroute.py @@ -113,9 +113,9 @@ EXAMPLES = ''' allow_classic_operations: true global_reach_enabled: false tags: - - a: b + - a: b authorizations: - - name: authorization_test + - name: authorization_test service_provider_properties: service_provider_name: Aryaka Networks peering_location: Seattle @@ -129,7 +129,6 @@ EXAMPLES = ''' resource_group: rg name: exp state: absent - ''' RETURN = ''' @@ -179,7 +178,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError - from azure.mgmt.network import NetworkManagementClient except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_expressroute_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_expressroute_info.py index fead26069..b23ef3dde 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_expressroute_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_expressroute_info.py @@ -42,13 +42,12 @@ author: EXAMPLES = ''' - - name: Get facts of specific expressroute - community.azure.azure_rm_expressroute_info: - resource_group: myResourceGroup - name: myExpressRoute - tags: - - key:value - +- name: Get facts of specific expressroute + community.azure.azure_rm_expressroute_info: + resource_group: myResourceGroup + name: myExpressRoute + tags: + - key:value ''' RETURN = ''' @@ -98,8 +97,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError - from azure.mgmt.network import NetworkManagementClient - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_firewallpolicy.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_firewallpolicy.py index e7dfdafe2..dab7f5403 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_firewallpolicy.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_firewallpolicy.py @@ -246,7 +246,7 @@ state: ''' from ansible.module_utils.basic import _load_params -from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, HAS_AZURE, \ +from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, \ format_resource_id, normalize_location_name import copy diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_firewallpolicy_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_firewallpolicy_info.py index 2c5c6c5dc..4dc7c7053 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_firewallpolicy_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_firewallpolicy_info.py @@ -104,7 +104,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError - from azure.common import AzureMissingResourceHttpError, AzureHttpError except Exception: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_functionapp.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_functionapp.py index cf0bc00b0..a76a94ef9 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_functionapp.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_functionapp.py @@ -22,13 +22,16 @@ options: required: true aliases: - resource_group_name + type: str name: description: - Name of the Azure Function App. required: true + type: str location: description: - Valid Azure location. Defaults to location of the resource group. + type: str plan: description: - App service plan. @@ -38,35 +41,46 @@ options: - It can be a dict which contains C(name), C(resource_group). - C(name). Name of app service plan. - C(resource_group). Resource group name of app service plan. + type: raw container_settings: - description: Web app container settings. + description: + - Web app container settings. + type: dict suboptions: name: description: - Name of container. For example "imagename:tag". + required: True + type: str registry_server_url: description: - Container registry server url. For example C(mydockerregistry.io). + type: str registry_server_user: description: - The container registry server user name. + type: str registry_server_password: description: - The container registry server password. + type: str storage_account: description: - Name of the storage account to use. - required: true + - Required when creating. + type: str aliases: - storage - storage_account_name app_settings: description: - Dictionary containing application settings. + type: dict state: description: - Assert the state of the Function App. Use C(present) to create or update a Function App and C(absent) to delete. default: present + type: str choices: - absent - present diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_functionapp_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_functionapp_info.py index 3b4904e35..4a33fb684 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_functionapp_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_functionapp_info.py @@ -19,11 +19,13 @@ options: name: description: - Only show results for a specific Function App. + type: str resource_group: description: - Limit results to a resource group. Required when filtering by name. aliases: - resource_group_name + type: str tags: description: - Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. @@ -38,19 +40,19 @@ author: ''' EXAMPLES = ''' - - name: Get facts for one Function App - azure_rm_functionapp_info: - resource_group: myResourceGroup - name: myfunctionapp +- name: Get facts for one Function App + azure_rm_functionapp_info: + resource_group: myResourceGroup + name: myfunctionapp - - name: Get facts for all Function Apps in a resource group - azure_rm_functionapp_info: - resource_group: myResourceGroup +- name: Get facts for all Function Apps in a resource group + azure_rm_functionapp_info: + resource_group: myResourceGroup - - name: Get facts for all Function Apps by tags - azure_rm_functionapp_info: - tags: - - testing +- name: Get facts for all Function Apps by tags + azure_rm_functionapp_info: + tags: + - testing ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_gallery.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_gallery.py index 3b5e14408..cb902ace7 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_gallery.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_gallery.py @@ -72,15 +72,8 @@ id: import time import json -import re from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBaseExt from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_rest import GenericRestClient -from copy import deepcopy -try: - from msrestazure.azure_exceptions import CloudError -except ImportError: - # This is handled in azure_rm_common - pass class Actions: @@ -152,6 +145,7 @@ class AzureRMGalleries(AzureRMModuleBaseExt): response = None self.mgmt_client = self.get_mgmt_svc_client(GenericRestClient, + is_track2=True, base_url=self._cloud_environment.endpoints.resource_manager) resource_group = self.get_resource_group(self.resource_group) @@ -243,14 +237,14 @@ class AzureRMGalleries(AzureRMModuleBaseExt): self.status_code, 600, 30) - except CloudError as exc: + except Exception as exc: self.log('Error attempting to create the Gallery instance.') self.fail('Error creating the Gallery instance: {0}'.format(str(exc))) try: - response = json.loads(response.text) + response = json.loads(response.body()) except Exception: - response = {'text': response.text} + response = {'text': response.context['deserialized_data']} return response @@ -265,7 +259,7 @@ class AzureRMGalleries(AzureRMModuleBaseExt): self.status_code, 600, 30) - except CloudError as e: + except Exception as e: self.log('Error attempting to delete the Gallery instance.') self.fail('Error deleting the Gallery instance: {0}'.format(str(e))) @@ -283,11 +277,11 @@ class AzureRMGalleries(AzureRMModuleBaseExt): self.status_code, 600, 30) - response = json.loads(response.text) + response = json.loads(response.body()) found = True self.log("Response : {0}".format(response)) # self.log("AzureFirewall instance : {0} found".format(response.name)) - except CloudError as e: + except Exception as e: self.log('Did not find the AzureFirewall instance.') if found is True: return response diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_gallery_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_gallery_info.py index 58cb29dd5..cd02bec28 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_gallery_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_gallery_info.py @@ -41,7 +41,6 @@ EXAMPLES = ''' azure_rm_gallery_info: resource_group: myResourceGroup name: myGallery - ''' RETURN = ''' @@ -90,16 +89,9 @@ galleries: ''' -import time import json from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_rest import GenericRestClient -from copy import deepcopy -try: - from msrestazure.azure_exceptions import CloudError -except Exception: - # handled in azure_rm_common - pass class AzureRMGalleriesInfo(AzureRMModuleBase): @@ -136,6 +128,7 @@ class AzureRMGalleriesInfo(AzureRMModuleBase): setattr(self, key, kwargs[key]) self.mgmt_client = self.get_mgmt_svc_client(GenericRestClient, + is_track2=True, base_url=self._cloud_environment.endpoints.resource_manager) if (self.resource_group is not None and self.name is not None): @@ -174,9 +167,9 @@ class AzureRMGalleriesInfo(AzureRMModuleBase): self.status_code, 600, 30) - results = json.loads(response.text) + results = json.loads(response.body()) # self.log('Response : {0}'.format(response)) - except CloudError as e: + except Exception as e: self.log('Could not get info for @(Model.ModuleOperationNameUpper).') return self.format_item(results) @@ -204,9 +197,9 @@ class AzureRMGalleriesInfo(AzureRMModuleBase): self.status_code, 600, 30) - results = json.loads(response.text) + results = json.loads(response.body()) # self.log('Response : {0}'.format(response)) - except CloudError as e: + except Exception as e: self.log('Could not get info for @(Model.ModuleOperationNameUpper).') return [self.format_item(x) for x in results['value']] if results['value'] else [] @@ -231,9 +224,9 @@ class AzureRMGalleriesInfo(AzureRMModuleBase): self.status_code, 600, 30) - results = json.loads(response.text) + results = json.loads(response.body()) # self.log('Response : {0}'.format(response)) - except CloudError as e: + except Exception as e: self.log('Could not get info for @(Model.ModuleOperationNameUpper).') return [self.format_item(x) for x in results['value']] if results['value'] else [] diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_galleryimage.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_galleryimage.py index a0335fa01..c14aedd4a 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_galleryimage.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_galleryimage.py @@ -56,18 +56,18 @@ options: os_type: description: - This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image. + - Required when creating. choices: - windows - linux - required: true type: str os_state: description: - The allowed values for OS State are C(generalized). + - Required when creating. choices: - generalized - specialized - required: true type: str hypervgeneration: description: @@ -86,7 +86,7 @@ options: identifier: description: - Image identifier. - required: true + - Required when creating. type: dict suboptions: publisher: @@ -144,6 +144,7 @@ options: description: - A list of disallowed disk types. type: list + elements: str purchase_plan: description: - Purchase plan. @@ -205,15 +206,8 @@ id: import time import json -import re from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBaseExt from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_rest import GenericRestClient -from copy import deepcopy -try: - from msrestazure.azure_exceptions import CloudError -except ImportError: - # This is handled in azure_rm_common - pass class Actions: @@ -338,6 +332,7 @@ class AzureRMGalleryImages(AzureRMModuleBaseExt): options=dict( disk_types=dict( type='list', + elements='str', disposition='diskTypes' ) ) @@ -399,6 +394,7 @@ class AzureRMGalleryImages(AzureRMModuleBaseExt): response = None self.mgmt_client = self.get_mgmt_svc_client(GenericRestClient, + is_track2=True, base_url=self._cloud_environment.endpoints.resource_manager) resource_group = self.get_resource_group(self.resource_group) @@ -492,14 +488,14 @@ class AzureRMGalleryImages(AzureRMModuleBaseExt): self.status_code, 600, 30) - except CloudError as exc: + except Exception as exc: self.log('Error attempting to create the GalleryImage instance.') self.fail('Error creating the GalleryImage instance: {0}'.format(str(exc))) try: - response = json.loads(response.text) + response = json.loads(response.body()) except Exception: - response = {'text': response.text} + response = {'text': response.context['deserialized_data']} return response @@ -514,7 +510,7 @@ class AzureRMGalleryImages(AzureRMModuleBaseExt): self.status_code, 600, 30) - except CloudError as e: + except Exception as e: self.log('Error attempting to delete the GalleryImage instance.') self.fail('Error deleting the GalleryImage instance: {0}'.format(str(e))) @@ -532,11 +528,11 @@ class AzureRMGalleryImages(AzureRMModuleBaseExt): self.status_code, 600, 30) - response = json.loads(response.text) + response = json.loads(response.body()) found = True self.log("Response : {0}".format(response)) # self.log("AzureFirewall instance : {0} found".format(response.name)) - except CloudError as e: + except Exception as e: self.log('Did not find the AzureFirewall instance.') if found is True: return response diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_galleryimage_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_galleryimage_info.py index 90bcbe244..0f1c5020f 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_galleryimage_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_galleryimage_info.py @@ -47,7 +47,6 @@ EXAMPLES = ''' resource_group: myResourceGroup gallery_name: myGallery name: myImage - ''' RETURN = ''' @@ -85,12 +84,12 @@ images: os_state: description: - The allowed values for OS State are C(generalized). - type: OperatingSystemStateTypes + type: str sample: "Generalized" os_type: description: - This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image. - type: OperatingSystemTypes + type: str sample: "linux/windows" identifier: description: @@ -115,16 +114,9 @@ images: ''' -import time import json from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_rest import GenericRestClient -from copy import deepcopy -try: - from msrestazure.azure_exceptions import CloudError -except Exception: - # handled in azure_rm_common - pass class AzureRMGalleryImagesInfo(AzureRMModuleBase): @@ -167,6 +159,7 @@ class AzureRMGalleryImagesInfo(AzureRMModuleBase): setattr(self, key, kwargs[key]) self.mgmt_client = self.get_mgmt_svc_client(GenericRestClient, + is_track2=True, base_url=self._cloud_environment.endpoints.resource_manager) if (self.resource_group is not None and @@ -208,9 +201,9 @@ class AzureRMGalleryImagesInfo(AzureRMModuleBase): self.status_code, 600, 30) - results = json.loads(response.text) + results = json.loads(response.body()) # self.log('Response : {0}'.format(response)) - except CloudError as e: + except Exception as e: self.log('Could not get info for @(Model.ModuleOperationNameUpper).') return self.format_item(results) @@ -241,9 +234,9 @@ class AzureRMGalleryImagesInfo(AzureRMModuleBase): self.status_code, 600, 30) - results = json.loads(response.text) + results = json.loads(response.body()) # self.log('Response : {0}'.format(response)) - except CloudError as e: + except Exception as e: self.log('Could not get info for @(Model.ModuleOperationNameUpper).') return [self.format_item(x) for x in results['value']] if results['value'] else [] diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_galleryimageversion.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_galleryimageversion.py index c539e3d4a..9d61bf874 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_galleryimageversion.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_galleryimageversion.py @@ -45,7 +45,7 @@ options: storage_profile: description: - Storage profile - required: true + - Required when creating. type: dict suboptions: source_image: @@ -59,12 +59,12 @@ options: description: - os disk snapshot - Mutual exclusive with source_image - type: raw + type: dict suboptions: source: description: - Reference to os disk snapshot. Could be resource ID or dictionary containing I(resource_group) and I(name) - type: str + type: raw host_caching: description: - host disk caching @@ -79,11 +79,12 @@ options: - list of data disk snapshot - Mutual exclusive with source_image type: list + elements: raw suboptions: source: description: - Reference to data disk snapshot. Could be resource ID or dictionary containing I(resource_group) and I(name) - type: str + type: raw lun: description: - lun of the data disk @@ -100,7 +101,6 @@ options: publishing_profile: description: - Publishing profile. - required: true type: dict suboptions: target_regions: @@ -108,17 +108,19 @@ options: - The target regions where the Image Version is going to be replicated to. - This property is updatable. type: list + elements: raw suboptions: name: description: - Region name. type: str + required: true regional_replica_count: description: - The number of replicas of the Image Version to be created per region. - This property would take effect for a region when regionalReplicaCount is not specified. - This property is updatable. - type: str + type: int storage_account_type: description: - Storage account type. @@ -127,10 +129,12 @@ options: description: - Managed image reference, could be resource ID, or dictionary containing I(resource_group) and I(name) - Obsolete since 2.10, use storage_profile instead + type: raw snapshot: description: - Source snapshot to be used. - Obsolete since 2.10, use storage_profile instead + type: raw replica_count: description: - The number of replicas of the Image Version to be created per region. @@ -152,6 +156,9 @@ options: - Specifies the storage account type to be used to store the image. - This property is not updatable. type: str + choices: + - Standard_LRS + - Standard_ZRS state: description: - Assert the state of the GalleryImageVersion. @@ -179,7 +186,7 @@ EXAMPLES = ''' location: East US publishing_profile: end_of_life_date: "2020-10-01t00:00:00+00:00" - exclude_from_latest: yes + exclude_from_latest: true replica_count: 4 storage_account_type: Standard_LRS target_regions: @@ -189,7 +196,7 @@ EXAMPLES = ''' regional_replica_count: 3 storage_account_type: Standard_LRS storage_profile: - source_image: /subscriptions/sub123/resourceGroups/group123/providers/Microsoft.Compute/images/myOsImage + source_image: /subscriptions/sub123/resourceGroups/group123/providers/Microsoft.Compute/images/myOsImage - name: Create a gallery image version from another gallery image version azure_rm_galleryimageversion: @@ -200,7 +207,7 @@ EXAMPLES = ''' location: East US publishing_profile: end_of_life_date: "2020-10-01t00:00:00+00:00" - exclude_from_latest: yes + exclude_from_latest: true replica_count: 4 storage_account_type: Standard_LRS target_regions: @@ -210,10 +217,10 @@ EXAMPLES = ''' regional_replica_count: 3 storage_account_type: Standard_LRS storage_profile: - source_image: - version: 1.1.0 - gallery_name: myGallery2 - gallery_image_name: myGalleryImage2 + source_image: + version: 1.1.0 + gallery_name: myGallery2 + gallery_image_name: myGalleryImage2 - name: Create gallery image by using one os dist snapshot and zero or many data disk snapshots azure_rm_galleryimageversion: @@ -224,7 +231,7 @@ EXAMPLES = ''' location: East US publishing_profile: end_of_life_date: "2020-10-01t00:00:00+00:00" - exclude_from_latest: yes + exclude_from_latest: true replica_count: 1 storage_account_type: Standard_LRS target_regions: @@ -233,13 +240,13 @@ EXAMPLES = ''' storage_account_type: Standard_LRS storage_profile: os_disk: - source: "/subscriptions/mySub/resourceGroups/myGroup/providers/Microsoft.Compute/snapshots/os_snapshot_vma" + source: "/subscriptions/mySub/resourceGroups/myGroup/providers/Microsoft.Compute/snapshots/os_snapshot_vma" data_disks: - - lun: 0 - source: - name: data_snapshot_vma - - lun: 1 - source: "/subscriptions/mySub/resourceGroups/myGroup/providers/Microsoft.Compute/snapshots/data_snapshot_vmb" + - lun: 0 + source: + name: data_snapshot_vma + - lun: 1 + source: "/subscriptions/mySub/resourceGroups/myGroup/providers/Microsoft.Compute/snapshots/data_snapshot_vmb" ''' RETURN = ''' @@ -256,11 +263,6 @@ import time import json from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBaseExt from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_rest import GenericRestClient -try: - from msrestazure.azure_exceptions import CloudError -except ImportError: - # This is handled in azure_rm_common - pass class Actions: @@ -347,6 +349,7 @@ class AzureRMGalleryImageVersions(AzureRMModuleBaseExt): ), data_disks=dict( type='list', + elements='raw', disposition='dataDiskImages', purgeIfNone=True, options=dict( @@ -376,6 +379,7 @@ class AzureRMGalleryImageVersions(AzureRMModuleBaseExt): options=dict( target_regions=dict( type='list', + elements='raw', disposition='targetRegions', options=dict( name=dict( @@ -481,6 +485,7 @@ class AzureRMGalleryImageVersions(AzureRMModuleBaseExt): response = None self.mgmt_client = self.get_mgmt_svc_client(GenericRestClient, + is_track2=True, base_url=self._cloud_environment.endpoints.resource_manager) resource_group = self.get_resource_group(self.resource_group) @@ -574,14 +579,14 @@ class AzureRMGalleryImageVersions(AzureRMModuleBaseExt): self.status_code, 600, 30) - except CloudError as exc: + except Exception as exc: self.log('Error attempting to create the GalleryImageVersion instance.') self.fail('Error creating the GalleryImageVersion instance: {0}'.format(str(exc))) try: - response = json.loads(response.text) + response = json.loads(response.body()) except Exception: - response = {'text': response.text} + response = {'text': response.context['deserialized_data']} while response['properties']['provisioningState'] == 'Creating': time.sleep(60) @@ -600,7 +605,7 @@ class AzureRMGalleryImageVersions(AzureRMModuleBaseExt): self.status_code, 600, 30) - except CloudError as e: + except Exception as e: self.log('Error attempting to delete the GalleryImageVersion instance.') self.fail('Error deleting the GalleryImageVersion instance: {0}'.format(str(e))) return True @@ -617,11 +622,11 @@ class AzureRMGalleryImageVersions(AzureRMModuleBaseExt): self.status_code, 600, 30) - response = json.loads(response.text) + response = json.loads(response.body()) found = True self.log("Response : {0}".format(response)) # self.log("AzureFirewall instance : {0} found".format(response.name)) - except CloudError as e: + except Exception as e: self.log('Did not find the AzureFirewall instance.') if found is True: return response diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_galleryimageversion_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_galleryimageversion_info.py index 1d448ca12..b4c7e89a2 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_galleryimageversion_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_galleryimageversion_info.py @@ -54,7 +54,6 @@ EXAMPLES = ''' gallery_name: myGallery gallery_image_name: myImage name: myVersion - ''' RETURN = ''' @@ -101,16 +100,9 @@ versions: ''' -import time import json from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_rest import GenericRestClient -from copy import deepcopy -try: - from msrestazure.azure_exceptions import CloudError -except Exception: - # handled in azure_rm_common - pass class AzureRMGalleryImageVersionsInfo(AzureRMModuleBase): @@ -158,6 +150,7 @@ class AzureRMGalleryImageVersionsInfo(AzureRMModuleBase): setattr(self, key, kwargs[key]) self.mgmt_client = self.get_mgmt_svc_client(GenericRestClient, + is_track2=True, base_url=self._cloud_environment.endpoints.resource_manager) if (self.resource_group is not None and @@ -202,9 +195,9 @@ class AzureRMGalleryImageVersionsInfo(AzureRMModuleBase): self.status_code, 600, 30) - results = json.loads(response.text) + results = json.loads(response.body()) # self.log('Response : {0}'.format(response)) - except CloudError as e: + except Exception as e: self.log('Could not get info for @(Model.ModuleOperationNameUpper).') return self.format_item(results) @@ -247,7 +240,7 @@ class AzureRMGalleryImageVersionsInfo(AzureRMModuleBase): 0, 0) try: - response = json.loads(response.text) + response = json.loads(response.body()) if isinstance(response, dict): if response.get('value'): results['response'] = results['response'] + response['value'] @@ -259,7 +252,7 @@ class AzureRMGalleryImageVersionsInfo(AzureRMModuleBase): if not skiptoken: break # self.log('Response : {0}'.format(response)) - except CloudError as e: + except Exception as e: self.log('Could not get info for @(Model.ModuleOperationNameUpper).') return [self.format_item(x) for x in results['response']] if results['response'] else [] diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_hdinsightcluster.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_hdinsightcluster.py index ce498df22..2ce7e16f3 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_hdinsightcluster.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_hdinsightcluster.py @@ -21,34 +21,42 @@ options: description: - The name of the resource group. required: True + type: str name: description: - The name of the cluster. required: True + type: str location: description: - Resource location. If not set, location from the resource group will be used as default. + type: str cluster_version: description: - The version of the cluster. For example C(3.6). + type: str os_type: description: - The type of operating system. + type: str choices: - 'linux' tier: description: - The cluster tier. + type: str choices: - 'standard' - 'premium' cluster_definition: description: - The cluster definition. + type: dict suboptions: kind: description: - The type of cluster. + type: str choices: - hadoop - spark @@ -57,17 +65,21 @@ options: gateway_rest_username: description: - Gateway REST user name. + type: str gateway_rest_password: description: - Gateway REST password. + type: str compute_profile_roles: description: - The list of roles in the cluster. type: list + elements: dict suboptions: name: description: - The name of the role. + type: str choices: - 'headnode' - 'workernode' @@ -75,47 +87,59 @@ options: min_instance_count: description: - The minimum instance count of the cluster. + type: int target_instance_count: description: - The instance count of the cluster. + type: int vm_size: description: - The size of the VM. + type: str linux_profile: description: - The Linux OS profile. + type: dict suboptions: username: description: - SSH user name. + type: str password: description: - SSH password. + type: str storage_accounts: description: - The list of storage accounts in the cluster. type: list + elements: dict suboptions: name: description: - Blob storage endpoint. For example storage_account_name.blob.core.windows.net. + type: str is_default: description: - Whether or not the storage account is the default storage account. + type: bool container: description: - The container in the storage account. + type: str key: description: - The storage account access key. + type: str state: - description: - - Assert the state of the cluster. - - Use C(present) to create or update a cluster and C(absent) to delete it. - default: present - choices: - - absent - - present + description: + - Assert the state of the cluster. + - Use C(present) to create or update a cluster and C(absent) to delete it. + default: present + type: str + choices: + - absent + - present extends_documentation_fragment: - azure.azcollection.azure @@ -141,14 +165,13 @@ EXAMPLES = ''' gateway_rest_password: MuABCPassword!!@123 storage_accounts: - name: myStorageAccount.blob.core.windows.net - is_default: yes + is_default: true container: myContainer key: GExmaxH4lDNdHA9nwAsCt8t4AOQas2y9vXQP1kKALTram7Q3/5xLVIab3+nYG1x63Xyak9/VXxQyNBHA9pDWw== compute_profile_roles: - name: headnode target_instance_count: 2 - hardware_profile: - vm_size: Standard_D3 + vm_size: Standard_D3 linux_profile: username: sshuser password: MuABCPassword!!@123 @@ -169,15 +192,12 @@ id: sample: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.HDInsight/clusters/myCluster ''' -import time from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase try: from azure.core.polling import LROPoller from azure.core.exceptions import ResourceNotFoundError - from msrestazure.azure_operation import AzureOperationPoller from azure.mgmt.hdinsight import HDInsightManagementClient - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass @@ -219,10 +239,31 @@ class AzureRMClusters(AzureRMModuleBase): type='dict' ), compute_profile_roles=dict( - type='list' + type='list', + elements='dict', + options=dict( + name=dict(type='str', choices=['headnode', 'workernode', 'zookepernode']), + min_instance_count=dict(type='int'), + target_instance_count=dict(type='int'), + vm_size=dict(type='str'), + linux_profile=dict( + type='dict', + options=dict( + username=dict(type='str'), + password=dict(type='str', no_log=True) + ) + ), + ) ), storage_accounts=dict( - type='list' + type='list', + elements='dict', + options=dict( + name=dict(type='str'), + is_default=dict(type='bool'), + container=dict(type='str'), + key=dict(type='str', no_log=True) + ) ), state=dict( type='str', @@ -360,21 +401,21 @@ class AzureRMClusters(AzureRMModuleBase): response = self.mgmt_client.clusters.begin_create(resource_group_name=self.resource_group, cluster_name=self.name, parameters=self.parameters) - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) else: if self.tags_changed: response = self.mgmt_client.clusters.update(resource_group_name=self.resource_group, cluster_name=self.name, parameters={'tags': self.parameters.get('tags')}) - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) if self.new_instance_count: response = self.mgmt_client.clusters.begin_resize(resource_group_name=self.resource_group, cluster_name=self.name, role_name='workernode', parameters={'target_instance_count': self.new_instance_count}) - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) except Exception as exc: self.fail("Error creating or updating Cluster instance: {0}".format(str(exc))) diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_hdinsightcluster_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_hdinsightcluster_info.py index 09dce3ee3..afb3211ea 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_hdinsightcluster_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_hdinsightcluster_info.py @@ -20,9 +20,11 @@ options: resource_group: description: - Name of an Azure resource group. + type: str name: description: - HDInsight cluster name. + type: str tags: description: - Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. @@ -38,16 +40,16 @@ author: ''' EXAMPLES = ''' - - name: Get instance of HDInsight Cluster - azure_rm_hdinsightcluster_info: - resource_group: myResourceGroup - name: myCluster - - - name: List instances of HDInsight Cluster - azure_rm_hdinsightcluster_info: - resource_group: myResourceGroup - tags: - - key:value +- name: Get instance of HDInsight Cluster + azure_rm_hdinsightcluster_info: + resource_group: myResourceGroup + name: myCluster + +- name: List instances of HDInsight Cluster + azure_rm_hdinsightcluster_info: + resource_group: myResourceGroup + tags: + - key:value ''' RETURN = ''' @@ -102,6 +104,7 @@ clusters: cluster_definition: description: - The cluster definition. + type: complex contains: kind: description: @@ -112,7 +115,7 @@ clusters: compute_profile_roles: description: - The list of roles in the cluster. - type: list + type: complex contains: name: description: @@ -135,6 +138,7 @@ clusters: linux_profile: description: - The Linux OS profile. + type: dict contains: username: description: @@ -145,7 +149,7 @@ clusters: connectivity_endpoints: description: - Cluster's connectivity endpoints. - type: list + type: complex contains: location: description: @@ -175,17 +179,15 @@ clusters: description: - The tags of the resource. returned: always - type: complex + type: dict sample: {} ''' from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase -from ansible.module_utils.common.dict_transformations import _camel_to_snake try: from azure.core.exceptions import ResourceNotFoundError from azure.mgmt.hdinsight import HDInsightManagementClient - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_hostgroup.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_hostgroup.py index d7e80bf14..235728b64 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_hostgroup.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_hostgroup.py @@ -143,7 +143,7 @@ state: ''' from ansible.module_utils.basic import _load_params -from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, HAS_AZURE, \ +from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, \ normalize_location_name try: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_image.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_image.py index 8c4fb4475..5efd76074 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_image.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_image.py @@ -39,6 +39,7 @@ options: - List of data disk sources, including unmanaged blob URI, managed disk id or name, or snapshot id or name. type: list elements: str + default: [] location: description: - Location of the image. Derived from I(resource_group) if not specified. @@ -87,8 +88,8 @@ EXAMPLES = ''' name: myImage source: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Compute/disks/disk001 data_disk_sources: - - datadisk001 - - datadisk002 + - datadisk001 + - datadisk002 os_type: Linux - name: Create an image from os disk via dict @@ -96,12 +97,12 @@ EXAMPLES = ''' resource_group: myResourceGroup name: myImage source: - type: disks - resource_group: myResourceGroup - name: disk001 + type: disks + resource_group: myResourceGroup + name: disk001 data_disk_sources: - - datadisk001 - - datadisk002 + - datadisk001 + - datadisk002 os_type: Linux - name: Delete an image @@ -124,7 +125,7 @@ id: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, format_resource_id try: - from msrestazure.tools import parse_resource_id + from azure.mgmt.core.tools import parse_resource_id from azure.core.exceptions import ResourceNotFoundError except ImportError: # This is handled in azure_rm_common diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_iotdevice.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_iotdevice.py index f05198506..be007b8d8 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_iotdevice.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_iotdevice.py @@ -108,6 +108,8 @@ EXAMPLES = ''' name: Testing hub_policy_name: iothubowner hub_policy_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" + primary_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" + secondary_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" - name: Create Azure IoT Edge device azure_rm_iotdevice: @@ -115,7 +117,9 @@ EXAMPLES = ''' name: Testing hub_policy_name: iothubowner hub_policy_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" - edge_enabled: yes + primary_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" + secondary_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" + edge_enabled: true - name: Create Azure IoT Hub device with device twin properties and tag azure_rm_iotdevice: @@ -123,13 +127,15 @@ EXAMPLES = ''' name: Testing hub_policy_name: iothubowner hub_policy_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" + primary_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" + secondary_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" twin_tags: - location: - country: US - city: Redmond - sensor: humidity + location: + country: US + city: Redmond + sensor: humidity desired: - period: 100 + period: 100 ''' RETURN = ''' @@ -219,16 +225,12 @@ device: } ''' # NOQA -import json -import copy import re -from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, format_resource_id -from ansible.module_utils.common.dict_transformations import _snake_to_camel +from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase try: - from msrestazure.tools import parse_resource_id - from msrestazure.azure_exceptions import CloudError + from azure.iot.hub import IoTHubRegistryManager except ImportError: # This is handled in azure_rm_common pass @@ -272,14 +274,7 @@ class AzureRMIoTDevice(AzureRMModuleBase): self.secondary_key = None self._base_url = None - self._mgmt_client = None - self.query_parameters = { - 'api-version': '2018-06-30' - } - self.header_parameters = { - 'Content-Type': 'application/json; charset=utf-8', - 'accept-language': 'en-US' - } + self.mgmt_client = None super(AzureRMIoTDevice, self).__init__(self.module_arg_spec, supports_check_mode=True) def exec_module(self, **kwargs): @@ -288,38 +283,23 @@ class AzureRMIoTDevice(AzureRMModuleBase): setattr(self, key, kwargs[key]) self._base_url = '{0}.azure-devices.net'.format(self.hub) - config = { - 'base_url': self._base_url, - 'key': self.hub_policy_key, - 'policy': self.hub_policy_name - } - self._mgmt_client = self.get_data_svc_client(**config) + + connect_str = "HostName={0};SharedAccessKeyName={1};SharedAccessKey={2}".format(self._base_url, self.hub_policy_name, self.hub_policy_key) + self.mgmt_client = IoTHubRegistryManager.from_connection_string(connect_str) changed = False + update_changed = False device = self.get_device() + + if self.status is not None and not self.status: + device['status'] = 'disabled' + if self.state == 'present': if not device: changed = True - auth = {'type': _snake_to_camel(self.auth_method)} - if self.auth_method == 'self_signed': - auth['x509Thumbprint'] = { - 'primaryThumbprint': self.primary_key, - 'secondaryThumbprint': self.secondary_key - } - elif self.auth_method == 'sas': - auth['symmetricKey'] = { - 'primaryKey': self.primary_key, - 'secondaryKey': self.secondary_key - } - device = { - 'deviceId': self.name, - 'capabilities': {'iotEdge': self.edge_enabled or False}, - 'authentication': auth - } - if self.status is not None and not self.status: - device['status'] = 'disabled' else: + update_changed = True if self.edge_enabled is not None and self.edge_enabled != device['capabilities']['iotEdge']: changed = True device['capabilities']['iotEdge'] = self.edge_enabled @@ -328,9 +308,14 @@ class AzureRMIoTDevice(AzureRMModuleBase): if status != device['status']: changed = True device['status'] = status - if changed and not self.check_mode: - device = self.create_or_update_device(device) + if not self.check_mode: + if changed and update_changed: + device = self.update_device(device) + elif changed: + device = self.create_device() + twin = self.get_twin() + if twin: if not twin.get('tags'): twin['tags'] = dict() @@ -340,18 +325,26 @@ class AzureRMIoTDevice(AzureRMModuleBase): if self.desired and not self.is_equal(self.desired, twin['properties']['desired']): twin_change = True if twin_change and not self.check_mode: - self.update_twin(twin) + twin_dict = dict() + twin_dict['tags'] = self.twin_tags + twin_dict['properties'] = dict() + twin_dict['properties']['desired'] = self.desired + + twin = self.update_twin(twin_dict) + changed = changed or twin_change device['tags'] = twin.get('tags') or dict() - device['properties'] = twin['properties'] + device['properties'] = twin.get('properties') or dict() device['modules'] = self.list_device_modules() elif self.twin_tags or self.desired: self.fail("Device twin is not supported in IoT Hub with basic tier.") - elif device: + else: if not self.check_mode: - self.delete_device(device['etag']) - changed = True - device = None + if device: + changed = True + self.delete_device(device['etag']) + else: + changed = True self.results = device or dict() self.results['changed'] = changed return self.results @@ -376,83 +369,140 @@ class AzureRMIoTDevice(AzureRMModuleBase): original[key] = updated_value return not changed - def create_or_update_device(self, device): + def update_device(self, device): + response = None try: - url = '/devices/{0}'.format(self.name) - headers = copy.copy(self.header_parameters) - if device.get('etag'): - headers['If-Match'] = '"{0}"'.format(device['etag']) - request = self._mgmt_client.put(url, self.query_parameters) - response = self._mgmt_client.send(request=request, headers=headers, content=device) - if response.status_code not in [200, 201, 202]: - raise CloudError(response) - return json.loads(response.text) + if self.auth_method == 'sas': + response = self.mgmt_client.update_device_with_sas(self.name, device['etag'], + self.primary_key, self.secondary_key, self.status, iot_edge=self.edge_enabled) + elif self.auth_method == 'self_signed': + response = self.mgmt_client.update_device_with_certificate_authority(self.name, self.status, iot_edge=self.edge_enabled) + elif self.auth_method == 'certificate_authority': + response = self.mgmt_client.update_device_with_x509(self.name, device['etag'], self.primary_thumbprint, + self.secondary_thumbprint, self.status, iot_edge=self.edge_enabled) + + return self.format_item(response) except Exception as exc: - if exc.status_code in [403] and self.edge_enabled: - self.fail('Edge device is not supported in IoT Hub with Basic tier.') - else: - self.fail('Error when creating or updating IoT Hub device {0}: {1}'.format(self.name, exc.message or str(exc))) + self.fail('Error when creating or updating IoT Hub device {0}: {1}'.format(self.name, exc.message or str(exc))) + + def create_device(self): + response = None + try: + if self.auth_method == 'sas': + response = self.mgmt_client.create_device_with_sas(self.name, self.primary_key, self.secondary_key, self.status, iot_edge=self.edge_enabled) + elif self.auth_method == 'self_signed': + response = self.mgmt_client.create_device_with_certificate_authority(self.name, self.status, iot_edge=self.edge_enabled) + elif self.auth_method == 'certificate_authority': + response = self.mgmt_client.create_device_with_x509(self.name, + self.primary_thumbprint, self.secondary_thumbprint, self.status, iot_edge=self.edge_enabled) + + return self.format_item(response) + except Exception as exc: + self.fail('Error when creating or updating IoT Hub device {0}: {1}'.format(self.name, exc.message or str(exc))) def delete_device(self, etag): try: - url = '/devices/{0}'.format(self.name) - headers = copy.copy(self.header_parameters) - headers['If-Match'] = '"{0}"'.format(etag) - request = self._mgmt_client.delete(url, self.query_parameters) - response = self._mgmt_client.send(request=request, headers=headers) - if response.status_code not in [204]: - raise CloudError(response) + response = self.mgmt_client.delete_device(self.name, etag=etag) + return response + except Exception as exc: self.fail('Error when deleting IoT Hub device {0}: {1}'.format(self.name, exc.message or str(exc))) def get_device(self): try: - url = '/devices/{0}'.format(self.name) - device = self._https_get(url, self.query_parameters, self.header_parameters) - return device + response = self.mgmt_client.get_device(self.name) + + response = self.format_item(response) + return response except Exception as exc: - if exc.status_code in [404]: - return None - else: - self.fail('Error when getting IoT Hub device {0}: {1}'.format(self.name, exc.message or str(exc))) + self.log('Error when getting IoT Hub device {0}: {1}'.format(self.name, exc)) def get_twin(self): try: - url = '/twins/{0}'.format(self.name) - return self._https_get(url, self.query_parameters, self.header_parameters) + response = self.mgmt_client.get_twin(self.name) + return self.format_twin(response) except Exception as exc: - if exc.status_code in [403]: - # The Basic sku has nothing to to with twin - return None - else: - self.fail('Error when getting IoT Hub device {0} twin: {1}'.format(self.name, exc.message or str(exc))) + self.fail('Error when getting IoT Hub device {0} twin: {1}'.format(self.name, exc.message or str(exc))) def update_twin(self, twin): try: - url = '/twins/{0}'.format(self.name) - headers = copy.copy(self.header_parameters) - headers['If-Match'] = '"{0}"'.format(twin['etag']) - request = self._mgmt_client.patch(url, self.query_parameters) - response = self._mgmt_client.send(request=request, headers=headers, content=twin) - if response.status_code not in [200]: - raise CloudError(response) - return json.loads(response.text) + response = self.mgmt_client.update_twin(self.name, twin) + + return self.format_twin(response) except Exception as exc: self.fail('Error when creating or updating IoT Hub device twin {0}: {1}'.format(self.name, exc.message or str(exc))) def list_device_modules(self): try: - url = '/devices/{0}/modules'.format(self.name) - return self._https_get(url, self.query_parameters, self.header_parameters) + response = None + response = self.mgmt_client.get_modules(self.name) + + response = [self.format_item(item) for item in response] + return response + except Exception as exc: - self.fail('Error when listing IoT Hub device {0} modules: {1}'.format(self.name, exc.message or str(exc))) - - def _https_get(self, url, query_parameters, header_parameters): - request = self._mgmt_client.get(url, query_parameters) - response = self._mgmt_client.send(request=request, headers=header_parameters, content=None) - if response.status_code not in [200]: - raise CloudError(response) - return json.loads(response.text) + if hasattr(exc, 'message'): + pass + else: + self.fail('Error when listing IoT Hub devices in {0}: {1}'.format(self.hub, exc)) + + def format_twin(self, item): + if not item: + return None + format_twin = dict( + device_id=item.device_id, + module_id=item.module_id, + tags=item.tags, + properties=dict(), + etag=item.etag, + version=item.version, + device_etag=item.device_etag, + status=item.status, + cloud_to_device_message_count=item.cloud_to_device_message_count, + authentication_type=item.authentication_type, + ) + if item.properties is not None: + format_twin['properties']['desired'] = item.properties.desired + format_twin['properties']['reported'] = item.properties.reported + + return format_twin + + def format_item(self, item): + if not item: + return None + format_item = dict( + authentication=dict(), + capabilities=dict(), + cloudToDeviceMessageCount=item.cloud_to_device_message_count, + connectionState=item.connection_state, + connectionStateUpdatedTime=item.connection_state_updated_time, + deviceId=item.device_id, + etag=item.etag, + generationId=item.generation_id, + lastActivityTime=item.last_activity_time + ) + if hasattr(item, 'status_updated_time'): + format_item['statusUpdatedTime'] = item.status_updated_time + if hasattr(item, 'status_reason'): + format_item['status_reason'] = item.status_reason + if hasattr(item, 'status'): + format_item['status'] = item.status + if hasattr(item, 'modules'): + format_item['modules'] = item.modules + if item.authentication: + format_item['authentication']['symmetricKey'] = dict() + format_item['authentication']['symmetricKey']['primaryKey'] = item.authentication.symmetric_key.primary_key + format_item['authentication']['symmetricKey']['secondaryKey'] = item.authentication.symmetric_key.secondary_key + + format_item['authentication']['type'] = item.authentication.type + format_item['authentication']["x509Thumbprint"] = dict() + format_item['authentication']["x509Thumbprint"]["primaryThumbprint"] = item.authentication.x509_thumbprint.primary_thumbprint + format_item['authentication']["x509Thumbprint"]['secondaryThumbprint'] = item.authentication.x509_thumbprint.secondary_thumbprint + format_item['capabilities'] = dict() + if hasattr(item, 'capabilities') and item.capabilities is not None: + format_item['capabilities']["iotEdge"] = item.capabilities.iot_edge + + return format_item def main(): diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_iotdevice_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_iotdevice_info.py index ef82bdc17..359192f47 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_iotdevice_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_iotdevice_info.py @@ -69,9 +69,15 @@ EXAMPLES = ''' hub_policy_name: registryRead hub_policy_key: XXXXXXXXXXXXXXXXXXXX +- name: Query devices + azure_rm_iotdevice_info: + hub: "hub{{ rpfx }}" + query: "SELECT * FROM devices" + hub_policy_name: "{{ registry_write_name }}" + hub_policy_key: "{{ registry_write_key }}" + - name: Query all device modules in an IoT Hub azure_rm_iotdevice_info: - query: "SELECT * FROM devices.modules" hub: MyIoTHub hub_policy_name: registryRead hub_policy_key: XXXXXXXXXXXXXXXXXXXX @@ -170,14 +176,10 @@ iot_devices: } ''' # NOQA -import json - -from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, format_resource_id -from ansible.module_utils.common.dict_transformations import _snake_to_camel, _camel_to_snake +from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase try: - from msrestazure.tools import parse_resource_id - from msrestazure.azure_exceptions import CloudError + from azure.iot.hub import IoTHubRegistryManager except ImportError: # This is handled in azure_rm_common pass @@ -208,16 +210,11 @@ class AzureRMIoTDeviceFacts(AzureRMModuleBase): self.hub_policy_name = None self.hub_policy_key = None self.top = None + self.query = None - self._mgmt_client = None + self.mgmt_client = None self._base_url = None - self.query_parameters = { - 'api-version': '2018-06-30' - } - self.header_parameters = { - 'Content-Type': 'application/json; charset=utf-8', - 'accept-language': 'en-US' - } + super(AzureRMIoTDeviceFacts, self).__init__(self.module_arg_spec, supports_check_mode=True) def exec_module(self, **kwargs): @@ -226,21 +223,16 @@ class AzureRMIoTDeviceFacts(AzureRMModuleBase): setattr(self, key, kwargs[key]) self._base_url = '{0}.azure-devices.net'.format(self.hub) - config = { - 'base_url': self._base_url, - 'key': self.hub_policy_key, - 'policy': self.hub_policy_name - } - if self.top: - self.query_parameters['top'] = self.top - self._mgmt_client = self.get_data_svc_client(**config) + + connect_str = "HostName={0};SharedAccessKeyName={1};SharedAccessKey={2}".format(self._base_url, self.hub_policy_name, self.hub_policy_key) + self.mgmt_client = IoTHubRegistryManager.from_connection_string(connect_str) response = [] if self.module_id: response = [self.get_device_module()] elif self.name: response = [self.get_device()] - elif self.query: + elif self.query is not None: response = self.hub_query() else: response = self.list_devices() @@ -248,56 +240,140 @@ class AzureRMIoTDeviceFacts(AzureRMModuleBase): self.results['iot_devices'] = response return self.results - def hub_query(self): - try: - url = '/devices/query' - request = self._mgmt_client.post(url, self.query_parameters) - query = { - 'query': self.query - } - response = self._mgmt_client.send(request=request, headers=self.header_parameters, content=query) - if response.status_code not in [200]: - raise CloudError(response) - return json.loads(response.text) - except Exception as exc: - self.fail('Error when running query "{0}" in IoT Hub {1}: {2}'.format(self.query, self.hub, exc.message or str(exc))) - def get_device(self): try: - url = '/devices/{0}'.format(self.name) - device = self._https_get(url, self.query_parameters, self.header_parameters) - device['modules'] = self.list_device_modules() - return device + response = self.mgmt_client.get_device(self.name) + + response = self.format_item(response) + return response except Exception as exc: - self.fail('Error when getting IoT Hub device {0}: {1}'.format(self.name, exc.message or str(exc))) + self.fail('Error when getting IoT Hub device {0}: {1}'.format(self.name, exc)) def get_device_module(self): try: - url = '/devices/{0}/modules/{1}'.format(self.name, self.module_id) - return self._https_get(url, self.query_parameters, self.header_parameters) + response = self.mgmt_client.get_module(self.name, self.module_id) + return self.format_module(response) except Exception as exc: - self.fail('Error when getting IoT Hub device {0}: {1}'.format(self.name, exc.message or str(exc))) + self.fail('Error when getting IoT Hub device {0}: {1}'.format(self.name, exc)) def list_device_modules(self): try: - url = '/devices/{0}/modules'.format(self.name) - return self._https_get(url, self.query_parameters, self.header_parameters) + response = self.mgmt_client.get_modules(self.name) + + return [self.format_module(item) for item in response] except Exception as exc: - self.fail('Error when getting IoT Hub device {0}: {1}'.format(self.name, exc.message or str(exc))) + self.fail('Error when getting IoT Hub device {0}: {1}'.format(self.name, exc)) def list_devices(self): try: - url = '/devices' - return self._https_get(url, self.query_parameters, self.header_parameters) + response = None + response = self.mgmt_client.get_devices(max_number_of_devices=1000) + + response = [self.format_item(item) for item in response] + if self.top is not None: + return response[self.top - 1] + else: + return response + except Exception as exc: + if hasattr(exc, 'message'): + pass + else: + self.fail('Error when listing IoT Hub devices in {0}: {1}'.format(self.hub, exc)) + + def hub_query(self): + try: + response = None + response = self.mgmt_client.query_iot_hub(dict(query=self.query)) + + return [self.format_twin(item) for item in response.items] + except Exception as exc: - self.fail('Error when listing IoT Hub devices in {0}: {1}'.format(self.hub, exc.message or str(exc))) - - def _https_get(self, url, query_parameters, header_parameters): - request = self._mgmt_client.get(url, query_parameters) - response = self._mgmt_client.send(request=request, headers=header_parameters, content=None) - if response.status_code not in [200]: - raise CloudError(response) - return json.loads(response.text) + if hasattr(exc, 'message'): + pass + else: + self.fail('Error when listing IoT Hub devices in {0}: {1}'.format(self.hub, exc)) + + def format_module(self, item): + if not item: + return None + format_item = dict( + authentication=dict(), + cloudToDeviceMessageCount=item.cloud_to_device_message_count, + connectionState=item.connection_state, + connectionStateUpdatedTime=item.connection_state_updated_time, + deviceId=item.device_id, + etag=item.etag, + generationId=item.generation_id, + lastActivityTime=item.last_activity_time, + managedBy=item.managed_by, + moduleId=item.module_id + ) + if item.authentication: + format_item['authentication']['symmetricKey'] = dict() + format_item['authentication']['symmetricKey']['primaryKey'] = item.authentication.symmetric_key.primary_key + format_item['authentication']['symmetricKey']['secondaryKey'] = item.authentication.symmetric_key.secondary_key + + format_item['authentication']['type'] = item.authentication.type + format_item['authentication']["x509Thumbprint"] = dict() + format_item['authentication']["x509Thumbprint"]["primaryThumbprint"] = item.authentication.x509_thumbprint.primary_thumbprint + format_item['authentication']["x509Thumbprint"]['secondaryThumbprint'] = item.authentication.x509_thumbprint.secondary_thumbprint + + return format_item + + def format_item(self, item): + if not item: + return None + format_item = dict( + authentication=dict(), + capabilities=dict(), + cloudToDeviceMessageCount=item.cloud_to_device_message_count, + connectionState=item.connection_state, + connectionStateUpdatedTime=item.connection_state_updated_time, + deviceId=item.device_id, + etag=item.etag, + generationId=item.generation_id, + lastActivityTime=item.last_activity_time, + status=item.status, + statusReason=item.status_reason + ) + if hasattr(item, 'status_updated_time'): + format_item['statusUpdatedTime'] = item.status_updated_time + if hasattr(item, 'modules'): + format_item['modules'] = item.modules + if item.authentication: + format_item['authentication']['symmetricKey'] = dict() + format_item['authentication']['symmetricKey']['primaryKey'] = item.authentication.symmetric_key.primary_key + format_item['authentication']['symmetricKey']['secondaryKey'] = item.authentication.symmetric_key.secondary_key + + format_item['authentication']['type'] = item.authentication.type + format_item['authentication']["x509Thumbprint"] = dict() + format_item['authentication']["x509Thumbprint"]["primaryThumbprint"] = item.authentication.x509_thumbprint.primary_thumbprint + format_item['authentication']["x509Thumbprint"]['secondaryThumbprint'] = item.authentication.x509_thumbprint.secondary_thumbprint + if item.capabilities: + format_item['capabilities']["iotEdge"] = item.capabilities.iot_edge + + return format_item + + def format_twin(self, item): + if not item: + return None + format_twin = dict( + device_id=item.device_id, + module_id=item.module_id, + tags=item.tags, + properties=dict(), + etag=item.etag, + version=item.version, + device_etag=item.device_etag, + status=item.status, + cloud_to_device_message_count=item.cloud_to_device_message_count, + authentication_type=item.authentication_type, + ) + if item.properties is not None: + format_twin['properties']['desired'] = item.properties.desired + format_twin['properties']['reported'] = item.properties.reported + + return format_twin def main(): diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_iotdevicemodule.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_iotdevicemodule.py index d23435130..2f2ad679d 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_iotdevicemodule.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_iotdevicemodule.py @@ -103,6 +103,8 @@ EXAMPLES = ''' device: mydevice hub_policy_name: iothubowner hub_policy_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" + primary_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" + secondary_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" - name: Create Azure IoT Edge device module azure_rm_iotdevice: @@ -111,7 +113,9 @@ EXAMPLES = ''' name: Testing hub_policy_name: iothubowner hub_policy_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" - edge_enabled: yes + primary_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" + secondary_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" + edge_enabled: true - name: Create Azure IoT Hub device module with module twin properties and tag azure_rm_iotdevice: @@ -120,13 +124,15 @@ EXAMPLES = ''' device: mydevice hub_policy_name: iothubowner hub_policy_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" + primary_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" + secondary_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" twin_tags: - location: - country: US - city: Redmond - sensor: humidity + location: + country: US + city: Redmond + sensor: humidity desired: - period: 100 + period: 100 ''' RETURN = ''' @@ -159,16 +165,12 @@ module: } ''' # NOQA -import json -import copy import re -from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, format_resource_id -from ansible.module_utils.common.dict_transformations import _snake_to_camel +from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase try: - from msrestazure.tools import parse_resource_id - from msrestazure.azure_exceptions import CloudError + from azure.iot.hub import IoTHubRegistryManager except ImportError: # This is handled in azure_rm_common pass @@ -208,16 +210,11 @@ class AzureRMIoTDeviceModule(AzureRMModuleBase): self.auth_method = None self.primary_key = None self.secondary_key = None + self.managed_by = None + self.etag = None self._base_url = None - self._mgmt_client = None - self.query_parameters = { - 'api-version': '2018-06-30' - } - self.header_parameters = { - 'Content-Type': 'application/json; charset=utf-8', - 'accept-language': 'en-US' - } + self.mgmt_client = None super(AzureRMIoTDeviceModule, self).__init__(self.module_arg_spec, supports_check_mode=True) def exec_module(self, **kwargs): @@ -226,12 +223,9 @@ class AzureRMIoTDeviceModule(AzureRMModuleBase): setattr(self, key, kwargs[key]) self._base_url = '{0}.azure-devices.net'.format(self.hub) - config = { - 'base_url': self._base_url, - 'key': self.hub_policy_key, - 'policy': self.hub_policy_name - } - self._mgmt_client = self.get_data_svc_client(**config) + connect_str = "HostName={0};SharedAccessKeyName={1};SharedAccessKey={2}".format(self._base_url, self.hub_policy_name, self.hub_policy_key) + + self.mgmt_client = IoTHubRegistryManager.from_connection_string(connect_str) changed = False @@ -239,24 +233,11 @@ class AzureRMIoTDeviceModule(AzureRMModuleBase): if self.state == 'present': if not module: changed = True - auth = {'type': _snake_to_camel(self.auth_method)} - if self.auth_method == 'self_signed': - auth['x509Thumbprint'] = { - 'primaryThumbprint': self.primary_key, - 'secondaryThumbprint': self.secondary_key - } - elif self.auth_method == 'sas': - auth['symmetricKey'] = { - 'primaryKey': self.primary_key, - 'secondaryKey': self.secondary_key - } - module = { - 'deviceId': self.device, - 'moduleId': self.name, - 'authentication': auth - } - if changed and not self.check_mode: - module = self.create_or_update_module(module) + if not self.check_mode: + module = self.create_module() + else: + self.etag = module.get('etag') + twin = self.get_twin() if not twin.get('tags'): twin['tags'] = dict() @@ -267,15 +248,20 @@ class AzureRMIoTDeviceModule(AzureRMModuleBase): self.module.warn('desired') twin_change = True if twin_change and not self.check_mode: - twin = self.update_twin(twin) + twin_dict = dict() + twin_dict['tags'] = self.twin_tags + twin_dict['properties'] = dict() + twin_dict['properties']['desired'] = self.desired + twin = self.update_twin(twin_dict) + changed = changed or twin_change module['tags'] = twin.get('tags') or dict() - module['properties'] = twin['properties'] - elif module: - if not self.check_mode: - self.delete_module(module['etag']) - changed = True - module = None + module['properties'] = twin.get('properties') or dict() + else: + if module and not self.check_mode: + self.delete_module() + changed = True + self.results = module or dict() self.results['changed'] = changed return self.results @@ -300,65 +286,114 @@ class AzureRMIoTDeviceModule(AzureRMModuleBase): original[key] = updated_value return not changed - def create_or_update_module(self, module): + def update_module(self): + response = None + try: + if self.auth_method == 'sas': + response = self.mgmt_client.update_module_with_sas(self.device, self.name, self.managed_by, self.etag, self.primary_key, self.secondary_key) + elif self.auth_method == 'self_signed': + response = self.mgmt_client.update_module_with_certificate_authority(self.device, self.name, self.managed_by, self.etag) + elif self.auth_method == 'certificate_authority': + response = self.mgmt_client.update_module_with_x509(self.device, + self.name, self.managed_by, self.etag, self.primary_thumbprint, self.secondary_thumbprint) + + return self.format_module(response) + except Exception as exc: + if exc.status_code in [403] and self.edge_enabled: + self.fail('Edge device is not supported in IoT Hub with Basic tier.') + else: + self.fail('Error when creating or updating IoT Hub device {0}: {1}'.format(self.name, exc.message or str(exc))) + + def create_module(self): + response = None try: - url = '/devices/{0}/modules/{1}'.format(self.device, self.name) - headers = copy.copy(self.header_parameters) - if module.get('etag'): - headers['If-Match'] = '"{0}"'.format(module['etag']) - request = self._mgmt_client.put(url, self.query_parameters) - response = self._mgmt_client.send(request=request, headers=headers, content=module) - if response.status_code not in [200, 201]: - raise CloudError(response) - return json.loads(response.text) + if self.auth_method == 'sas': + response = self.mgmt_client.create_module_with_sas(self.device, self.name, self.managed_by, self.primary_key, self.secondary_key) + elif self.auth_method == 'self_signed': + response = self.mgmt_client.create_module_with_certificate_authority(self.device, self.name, self.managed_by) + elif self.auth_method == 'certificate_authority': + response = self.mgmt_client.create_module_with_x509(self.device_id, + self.name, self.managed_by, self.primary_thumbprint, self.secondary_thumbprint) + + return self.format_module(response) except Exception as exc: self.fail('Error when creating or updating IoT Hub device {0}: {1}'.format(self.name, exc.message or str(exc))) def delete_module(self, etag): try: - url = '/devices/{0}/modules/{1}'.format(self.device, self.name) - headers = copy.copy(self.header_parameters) - headers['If-Match'] = '"{0}"'.format(etag) - request = self._mgmt_client.delete(url, self.query_parameters) - response = self._mgmt_client.send(request=request, headers=headers) - if response.status_code not in [204]: - raise CloudError(response) + response = self.mgmt_client.delete_module(self.device, self.name) + return response except Exception as exc: self.fail('Error when deleting IoT Hub device {0}: {1}'.format(self.name, exc.message or str(exc))) def get_module(self): try: - url = '/devices/{0}/modules/{1}'.format(self.device, self.name) - return self._https_get(url, self.query_parameters, self.header_parameters) + response = self.mgmt_client.get_module(self.device, self.name) + return self.format_module(response) except Exception: return None def get_twin(self): try: - url = '/twins/{0}/modules/{1}'.format(self.device, self.name) - return self._https_get(url, self.query_parameters, self.header_parameters) + response = self.mgmt_client.get_twin(self.device) + return self.format_twin(response) except Exception as exc: self.fail('Error when getting IoT Hub device {0} module twin {1}: {2}'.format(self.device, self.name, exc.message or str(exc))) def update_twin(self, twin): try: - url = '/twins/{0}/modules/{1}'.format(self.device, self.name) - headers = copy.copy(self.header_parameters) - headers['If-Match'] = twin['etag'] - request = self._mgmt_client.patch(url, self.query_parameters) - response = self._mgmt_client.send(request=request, headers=headers, content=twin) - if response.status_code not in [200]: - raise CloudError(response) - return json.loads(response.text) + response = self.mgmt_client.update_twin(self.device, twin) + return self.format_twin(response) except Exception as exc: self.fail('Error when creating or updating IoT Hub device {0} module twin {1}: {2}'.format(self.device, self.name, exc.message or str(exc))) - def _https_get(self, url, query_parameters, header_parameters): - request = self._mgmt_client.get(url, query_parameters) - response = self._mgmt_client.send(request=request, headers=header_parameters, content=None) - if response.status_code not in [200]: - raise CloudError(response) - return json.loads(response.text) + def format_module(self, item): + if not item: + return None + format_item = dict( + authentication=dict(), + cloudToDeviceMessageCount=item.cloud_to_device_message_count, + connectionState=item.connection_state, + connectionStateUpdatedTime=item.connection_state_updated_time, + deviceId=item.device_id, + etag=item.etag, + generationId=item.generation_id, + lastActivityTime=item.last_activity_time, + managedBy=item.managed_by, + moduleId=item.module_id + ) + if item.authentication: + format_item['authentication']['symmetricKey'] = dict() + format_item['authentication']['symmetricKey']['primaryKey'] = item.authentication.symmetric_key.primary_key + format_item['authentication']['symmetricKey']['secondaryKey'] = item.authentication.symmetric_key.secondary_key + + format_item['authentication']['type'] = item.authentication.type + format_item['authentication']["x509Thumbprint"] = dict() + format_item['authentication']["x509Thumbprint"]["primaryThumbprint"] = item.authentication.x509_thumbprint.primary_thumbprint + format_item['authentication']["x509Thumbprint"]['secondaryThumbprint'] = item.authentication.x509_thumbprint.secondary_thumbprint + + return format_item + + def format_twin(self, item): + if not item: + return None + format_twin = dict( + device_id=item.device_id, + module_id=item.module_id, + tags=item.tags, + properties=dict(), + etag=item.etag, + version=item.version, + device_etag=item.device_etag, + status=item.status, + cloud_to_device_message_count=item.cloud_to_device_message_count, + authentication_type=item.authentication_type, + ) + if item.properties is not None: + format_twin['properties']['desired'] = item.properties.desired + format_twin['properties']['reported'] = item.properties.reported + + return format_twin def main(): diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_iothub.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_iothub.py index daf59783a..931cede97 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_iothub.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_iothub.py @@ -204,15 +204,15 @@ EXAMPLES = ''' resource_group: myResourceGroup name: Testing routing_endpoints: - - connection_string: "Endpoint=sb://qux.servicebus.windows.net/;SharedAccessKeyName=quux;SharedAccessKey=****;EntityPath=myQueue" - name: foo - resource_type: queue - resource_group: myResourceGroup1 + - connection_string: "Endpoint=sb://qux.servicebus.windows.net/;SharedAccessKeyName=quux;SharedAccessKey=****;EntityPath=myQueue" + name: foo + resource_type: queue + resource_group: myResourceGroup1 routes: - - name: bar - source: device_messages - endpoint_name: foo - enabled: yes + - name: bar + source: device_messages + endpoint_name: foo + enabled: true ''' RETURN = ''' @@ -507,16 +507,10 @@ routes: sample: "true" ''' # NOQA -from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, format_resource_id +from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from ansible.module_utils.common.dict_transformations import _snake_to_camel, _camel_to_snake import re -try: - from msrestazure.tools import parse_resource_id -except ImportError: - # This is handled in azure_rm_common - pass - ip_filter_spec = dict( name=dict(type='str', required=True), diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_iothub_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_iothub_info.py index 22b2335f4..64706a71d 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_iothub_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_iothub_info.py @@ -70,22 +70,22 @@ author: ''' EXAMPLES = ''' - - name: Get facts for one IoT Hub - azure_rm_iothub_info: - name: Testing - resource_group: myResourceGroup +- name: Get facts for one IoT Hub + azure_rm_iothub_info: + name: Testing + resource_group: myResourceGroup - - name: Get facts for all IoT Hubs - azure_rm_iothub_info: +- name: Get facts for all IoT Hubs + azure_rm_iothub_info: - - name: Get facts for all IoT Hubs in a specific resource group - azure_rm_iothub_info: - resource_group: myResourceGroup +- name: Get facts for all IoT Hubs in a specific resource group + azure_rm_iothub_info: + resource_group: myResourceGroup - - name: Get facts by tags - azure_rm_iothub_info: - tags: - - testing +- name: Get facts by tags + azure_rm_iothub_info: + tags: + - testing ''' RETURN = ''' @@ -396,7 +396,7 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common from ansible.module_utils.common.dict_transformations import _camel_to_snake try: - from msrestazure.tools import parse_resource_id + from azure.mgmt.core.tools import parse_resource_id except Exception: # handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_iothubconsumergroup.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_iothubconsumergroup.py index 21dde7fbb..fca748d0b 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_iothubconsumergroup.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_iothubconsumergroup.py @@ -43,6 +43,7 @@ options: description: - Name of the consumer group. type: str + required: True extends_documentation_fragment: - azure.azcollection.azure - azure.azcollection.azure_tags @@ -76,15 +77,7 @@ name: type: str ''' # NOQA -from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, format_resource_id -from ansible.module_utils.common.dict_transformations import _snake_to_camel, _camel_to_snake -import re - -try: - from msrestazure.tools import parse_resource_id -except ImportError: - # This is handled in azure_rm_common - pass +from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase class AzureRMIoTHubConsumerGroup(AzureRMModuleBase): diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_ipgroup.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_ipgroup.py index 717923770..1e464ced2 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_ipgroup.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_ipgroup.py @@ -162,8 +162,7 @@ state: ''' from ansible.module_utils.basic import _load_params -from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, HAS_AZURE, \ - format_resource_id, normalize_location_name +from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, normalize_location_name try: from azure.core.exceptions import ResourceNotFoundError diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_ipgroup_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_ipgroup_info.py index 3ed6423a6..21a922c3b 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_ipgroup_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_ipgroup_info.py @@ -84,7 +84,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError - from azure.common import AzureMissingResourceHttpError, AzureHttpError except Exception: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_keyvault.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_keyvault.py index f117b380c..efeddaacc 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_keyvault.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_keyvault.py @@ -21,28 +21,35 @@ options: description: - The name of the Resource Group to which the server belongs. required: True + type: str vault_name: description: - Name of the vault. required: True + type: str location: description: - Resource location. If not set, location from the resource group will be used as default. + type: str vault_tenant: description: - The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. + type: str sku: description: - SKU details. + type: dict suboptions: family: description: - SKU family name. + type: str required: True name: description: - SKU name to specify whether the key vault is a standard vault or a premium vault. required: True + type: str choices: - 'standard' - 'premium' @@ -50,23 +57,30 @@ options: description: - An array of 0 to 16 identities that have access to the key vault. - All identities in the array must use the same tenant ID as the key vault's tenant ID. + type: list + elements: dict suboptions: tenant_id: description: - The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. - Current keyvault C(tenant_id) value will be used if not specified. + type: str object_id: description: - The object ID of a user, service principal or security group in the Azure Active Directory tenant for the vault. - The object ID must be unique for the list of access policies. - Please note this is not application id. Object id can be obtained by running "az ad sp show --id <application id>". + type: str required: True application_id: description: - Application ID of the client making request on behalf of a principal. + type: str keys: description: - List of permissions to keys. + type: list + elements: str choices: - 'encrypt' - 'decrypt' @@ -87,6 +101,8 @@ options: secrets: description: - List of permissions to secrets. + type: list + elements: str choices: - 'get' - 'list' @@ -99,6 +115,8 @@ options: certificates: description: - List of permissions to certificates. + type: list + elements: str choices: - 'get' - 'list' @@ -114,9 +132,13 @@ options: - 'manageissuers' - 'recover' - 'purge' + - 'backup' + - 'restore' storage: description: - List of permissions to storage accounts. + type: list + elements: str enabled_for_deployment: description: - Property to specify whether Azure Virtual Machines are permitted to retrieve certificates stored as secrets from the key vault. @@ -151,6 +173,7 @@ options: description: - Assert the state of the KeyVault. Use C(present) to create or update an KeyVault and C(absent) to delete it. default: present + type: str choices: - absent - present @@ -165,21 +188,21 @@ author: ''' EXAMPLES = ''' - - name: Create instance of Key Vault - azure_rm_keyvault: - resource_group: myResourceGroup - vault_name: samplekeyvault - enabled_for_deployment: yes - vault_tenant: 72f98888-8666-4144-9199-2d7cd0111111 - sku: - name: standard - family: A - access_policies: - - tenant_id: 72f98888-8666-4144-9199-2d7cd0111111 - object_id: 99998888-8666-4144-9199-2d7cd0111111 - keys: - - get - - list +- name: Create instance of Key Vault + azure_rm_keyvault: + resource_group: myResourceGroup + vault_name: samplekeyvault + enabled_for_deployment: true + vault_tenant: 72f98888-8666-4144-9199-2d7cd0111111 + sku: + name: standard + family: A + access_policies: + - tenant_id: 72f98888-8666-4144-9199-2d7cd0111111 + object_id: 99998888-8666-4144-9199-2d7cd0111111 + keys: + - get + - list ''' RETURN = ''' @@ -191,7 +214,6 @@ id: sample: id ''' -import collections import time from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase @@ -199,7 +221,6 @@ try: from azure.core.polling import LROPoller from azure.core.exceptions import ResourceNotFoundError from azure.mgmt.keyvault import KeyVaultManagementClient - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass @@ -239,10 +260,26 @@ class AzureRMVaults(AzureRMModuleBase): object_id=dict(type='str', required=True), application_id=dict(type='str'), # FUTURE: add `choices` support once choices supports lists of values - keys=dict(type='list', no_log=True), - secrets=dict(type='list', no_log=True), - certificates=dict(type='list'), - storage=dict(type='list') + keys=dict( + type='list', + elements='str', + no_log=True, + choices=['encrypt', 'decrypt', 'wrapkey', 'unwrapkey', 'sign', 'verify', 'get', + 'list', 'create', 'update', 'import', 'delete', 'backup', 'restore', 'recover', 'purge'] + ), + secrets=dict( + type='list', + elements='str', + no_log=True, + choices=['get', 'list', 'set', 'delete', 'backup', 'restore', 'recover', 'purge'] + ), + certificates=dict( + type='list', + elements='str', + choices=['get', 'list', 'delete', 'create', 'import', 'update', 'managecontacts', + 'getissuers', 'listissuers', 'setissuers', 'deleteissuers', 'manageissuers', 'recover', 'purge', 'backup', 'restore'] + ), + storage=dict(type='list', elements='str') ) ), enabled_for_deployment=dict( diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_keyvault_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_keyvault_info.py index a56a2c378..d7b54515f 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_keyvault_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_keyvault_info.py @@ -40,17 +40,17 @@ author: ''' EXAMPLES = ''' - - name: Get Key Vault by name - azure_rm_keyvault_info: - resource_group: myResourceGroup - name: myVault +- name: Get Key Vault by name + azure_rm_keyvault_info: + resource_group: myResourceGroup + name: myVault - - name: List Key Vaults in specific resource group - azure_rm_keyvault_info: - resource_group: myResourceGroup +- name: List Key Vaults in specific resource group + azure_rm_keyvault_info: + resource_group: myResourceGroup - - name: List Key Vaults in current subscription - azure_rm_keyvault_info: +- name: List Key Vaults in current subscription + azure_rm_keyvault_info: ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_keyvaultkey.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_keyvaultkey.py index 985775b9a..54cc6eff6 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_keyvaultkey.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_keyvaultkey.py @@ -17,48 +17,62 @@ description: - Such as authentication keys, storage account keys, data encryption keys, .PFX files, and passwords. options: keyvault_uri: - description: - - URI of the keyvault endpoint. - required: true + description: + - URI of the keyvault endpoint. + required: true + type: str key_name: description: - Name of the keyvault key. required: true + type: str key_type: description: - The type of key to create. For valid values, see JsonWebKeyType. Possible values include EC, EC-HSM, RSA, RSA-HSM, oct default: 'RSA' + type: str key_size: description: - The key size in bits. For example 2048, 3072, or 4096 for RSA. + type: int key_attributes: description: - The attributes of a key managed by the key vault service. + type: dict suboptions: enabled: - description: bool + description: + - Whether the key is enabled. + type: bool not_before: description: - not valid before date in UTC ISO format without the Z at the end + type: str expires: description: - not valid after date in UTC ISO format without the Z at the end + type: str curve: description: - Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include P-256, P-384, P-521, P-256K. + type: str byok_file: description: - BYOK file. + type: str pem_file: description: - PEM file. + type: str pem_password: description: - PEM password. + type: str state: description: - Assert the state of the key. Use C(present) to create a key and C(absent) to delete a key. default: present + type: str choices: - absent - present @@ -73,16 +87,16 @@ author: ''' EXAMPLES = ''' - - name: Create a key - azure_rm_keyvaultkey: - key_name: MyKey - keyvault_uri: https://contoso.vault.azure.net/ - - - name: Delete a key - azure_rm_keyvaultkey: - key_name: MyKey - keyvault_uri: https://contoso.vault.azure.net/ - state: absent +- name: Create a key + azure_rm_keyvaultkey: + key_name: MyKey + keyvault_uri: https://contoso.vault.azure.net/ + +- name: Delete a key + azure_rm_keyvaultkey: + key_name: MyKey + keyvault_uri: https://contoso.vault.azure.net/ + state: absent ''' RETURN = ''' @@ -102,14 +116,8 @@ state: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase try: - import re - import codecs - from azure.keyvault import KeyVaultClient, KeyVaultId, KeyVaultAuthentication - from azure.keyvault.models import KeyAttributes, JsonWebKey - from azure.common.credentials import ServicePrincipalCredentials, get_cli_profile + from azure.keyvault.keys import KeyClient from datetime import datetime - from msrestazure.azure_active_directory import MSIAuthentication - from OpenSSL import crypto except ImportError: # This is handled in azure_rm_common pass @@ -195,8 +203,7 @@ class AzureRMKeyVaultKey(AzureRMModuleBase): # Create key if self.state == 'present' and changed: - results['key_id'] = self.create_key(self.key_name, self.key_type, self.key_size, self.key_attributes, - self.curve, self.tags) + results['key_id'] = self.create_key(self.key_name) self.results['state'] = results self.results['state']['status'] = 'Created' # Delete key @@ -213,153 +220,47 @@ class AzureRMKeyVaultKey(AzureRMModuleBase): return self.results def get_keyvault_client(self): - kv_url = self.azure_auth._cloud_environment.suffixes.keyvault_dns.split('.', 1).pop() - # Don't use MSI credentials if the auth_source isn't set to MSI. The below will Always result in credentials when running on an Azure VM. - if self.module.params['auth_source'] == 'msi': - try: - self.log("Get KeyVaultClient from MSI") - credentials = MSIAuthentication(resource="https://{0}".format(kv_url)) - return KeyVaultClient(credentials) - except Exception: - self.log("Get KeyVaultClient from service principal") - elif (self.module.params['auth_source'] == 'cli' - or (self.module.params['auth_source'] == 'auto' - and self.credentials['client_id'] is None - and self.credentials['secret'] is None)): - try: - profile = get_cli_profile() - credentials, subscription_id, tenant = profile.get_login_credentials( - subscription_id=self.credentials['subscription_id'], resource="https://{0}".format(kv_url)) - return KeyVaultClient(credentials) - except Exception as exc: - self.log("Get KeyVaultClient from service principal") - # self.fail("Failed to load CLI profile {0}.".format(str(exc))) - - # Create KeyVault Client using KeyVault auth class and auth_callback - def auth_callback(server, resource, scope): - if self.credentials['client_id'] is None or self.credentials['secret'] is None: - self.fail('Please specify client_id, secret and tenant to access azure Key Vault.') - - tenant = self.credentials.get('tenant') - if not self.credentials['tenant']: - tenant = "common" - - authcredential = ServicePrincipalCredentials( - client_id=self.credentials['client_id'], - secret=self.credentials['secret'], - tenant=tenant, - cloud_environment=self._cloud_environment, - resource="https://{0}".format(kv_url)) - - token = authcredential.token - return token['token_type'], token['access_token'] - - return KeyVaultClient(KeyVaultAuthentication(auth_callback)) + + return KeyClient(vault_url=self.keyvault_uri, credential=self.azure_auth.azure_credential_track2) def get_key(self, name, version=''): ''' Gets an existing key ''' - key_bundle = self.client.get_key(self.keyvault_uri, name, version) + key_bundle = self.client.get_key(name, version) + if key_bundle: - key_id = KeyVaultId.parse_key_id(key_bundle.key.kid) - return key_id.id + return key_bundle.id - def create_key(self, name, key_type, key_size, key_attributes, curve, tags): + def create_key(self, name): ''' Creates a key ''' - if key_attributes is not None: - k_enabled = key_attributes.get('enabled', True) - k_not_before = key_attributes.get('not_before', None) - k_expires = key_attributes.get('expires', None) + if self.key_attributes is not None: + k_enabled = self.key_attributes.get('enabled', True) + k_not_before = self.key_attributes.get('not_before', None) + k_expires = self.key_attributes.get('expires', None) if k_not_before: k_not_before = datetime.fromisoformat(k_not_before.replace('Z', '+00:00')) if k_expires: k_expires = datetime.fromisoformat(k_expires.replace('Z', '+00:00')) - - key_attributes = KeyAttributes(enabled=k_enabled, not_before=k_not_before, expires=k_expires) - - key_bundle = self.client.create_key(vault_base_url=self.keyvault_uri, key_name=name, kty=key_type, key_size=key_size, - key_attributes=key_attributes, curve=curve, tags=tags) - key_id = KeyVaultId.parse_key_id(key_bundle.key.kid) - return key_id.id + else: + k_enabled = True + k_not_before = None + k_expires = None + + key_bundle = self.client.create_key(name=name, + key_type=self.key_type, + size=self.key_size, + curve=self.curve, + tags=self.tags, + enabled=k_enabled, + not_before=k_not_before, + expires_on=k_expires) + return key_bundle._properties._id def delete_key(self, name): ''' Deletes a key ''' - deleted_key = self.client.delete_key(self.keyvault_uri, name) - key_id = KeyVaultId.parse_key_id(deleted_key.key.kid) - return key_id.id - - def import_key(self, key_name, destination=None, key_ops=None, disabled=False, expires=None, - not_before=None, tags=None, pem_file=None, pem_password=None, byok_file=None): - """ Import a private key. Supports importing base64 encoded private keys from PEM files. - Supports importing BYOK keys into HSM for premium KeyVaults. """ - - def _to_bytes(hex_string): - # zero pads and decodes a hex string - if len(hex_string) % 2: - hex_string = '{0}'.format(hex_string) - return codecs.decode(hex_string, 'hex_codec') - - def _set_rsa_parameters(dest, src): - # map OpenSSL parameter names to JsonWebKey property names - conversion_dict = { - 'modulus': 'n', - 'publicExponent': 'e', - 'privateExponent': 'd', - 'prime1': 'p', - 'prime2': 'q', - 'exponent1': 'dp', - 'exponent2': 'dq', - 'coefficient': 'qi' - } - # regex: looks for matches that fit the following patterns: - # integerPattern: 65537 (0x10001) - # hexPattern: - # 00:a0:91:4d:00:23:4a:c6:83:b2:1b:4c:15:d5:be: - # d8:87:bd:c9:59:c2:e5:7a:f5:4a:e7:34:e8:f0:07: - # The desired match should always be the first component of the match - regex = re.compile(r'([^:\s]*(:[^\:)]+\))|([^:\s]*(:\s*[0-9A-Fa-f]{2})+))') - # regex2: extracts the hex string from a format like: 65537 (0x10001) - regex2 = re.compile(r'(?<=\(0x{1})([0-9A-Fa-f]*)(?=\))') - - key_params = crypto.dump_privatekey(crypto.FILETYPE_TEXT, src).decode('utf-8') - for match in regex.findall(key_params): - comps = match[0].split(':', 1) - name = conversion_dict.get(comps[0], None) - if name: - value = comps[1].replace(' ', '').replace('\n', '').replace(':', '') - try: - value = _to_bytes(value) - except Exception: # pylint:disable=broad-except - # if decoding fails it is because of an integer pattern. Extract the hex - # string and retry - value = _to_bytes(regex2.findall(value)[0]) - setattr(dest, name, value) - - key_attrs = KeyAttributes(not disabled, not_before, expires) - key_obj = JsonWebKey(key_ops=key_ops) - if pem_file: - key_obj.kty = 'RSA' - with open(pem_file, 'r') as f: - pem_data = f.read() - # load private key and prompt for password if encrypted - try: - pem_password = str(pem_password).encode() if pem_password else None - # despite documentation saying password should be a string, it needs to actually - # be UTF-8 encoded bytes - pkey = crypto.load_privatekey(crypto.FILETYPE_PEM, pem_data, pem_password) - except crypto.Error: - pass # wrong password - except TypeError: - pass # no pass provided - _set_rsa_parameters(key_obj, pkey) - elif byok_file: - with open(byok_file, 'rb') as f: - byok_data = f.read() - key_obj.kty = 'RSA-HSM' - key_obj.t = byok_data - - return self.client.import_key( - self.keyvault_uri, key_name, key_obj, destination == 'hsm', key_attrs, tags) + deleted_key = self.client.begin_delete_key(name) + result = self.get_poller_result(deleted_key) + return result.properties._id def main(): diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_keyvaultkey_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_keyvaultkey_info.py index 7247ec4eb..b59f89b33 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_keyvaultkey_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_keyvaultkey_info.py @@ -54,31 +54,31 @@ author: ''' EXAMPLES = ''' - - name: Get latest version of specific key - azure_rm_keyvaultkey_info: - vault_uri: "https://myVault.vault.azure.net" - name: myKey - - - name: List all versions of specific key - azure_rm_keyvaultkey_info: - vault_uri: "https://myVault.vault.azure.net" - name: myKey - version: all - - - name: List specific version of specific key - azure_rm_keyvaultkey_info: - vault_uri: "https://myVault.vault.azure.net" - name: myKey - version: fd2682392a504455b79c90dd04a1bf46 - - - name: List all keys in specific key vault - azure_rm_keyvaultkey_info: - vault_uri: "https://myVault.vault.azure.net" - - - name: List deleted keys in specific key vault - azure_rm_keyvaultkey_info: - vault_uri: "https://myVault.vault.azure.net" - show_deleted_key: True +- name: Get latest version of specific key + azure_rm_keyvaultkey_info: + vault_uri: "https://myVault.vault.azure.net" + name: myKey + +- name: List all versions of specific key + azure_rm_keyvaultkey_info: + vault_uri: "https://myVault.vault.azure.net" + name: myKey + version: all + +- name: List specific version of specific key + azure_rm_keyvaultkey_info: + vault_uri: "https://myVault.vault.azure.net" + name: myKey + version: fd2682392a504455b79c90dd04a1bf46 + +- name: List all keys in specific key vault + azure_rm_keyvaultkey_info: + vault_uri: "https://myVault.vault.azure.net" + +- name: List deleted keys in specific key vault + azure_rm_keyvaultkey_info: + vault_uri: "https://myVault.vault.azure.net" + show_deleted_key: true ''' RETURN = ''' @@ -115,6 +115,7 @@ keyvaults: key: description: - public part of a key. + type: dict contains: n: description: @@ -150,6 +151,7 @@ keyvaults: attributes: description: - Key attributes. + type: dict contains: created: description: @@ -193,10 +195,7 @@ keyvaults: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase try: - from azure.keyvault import KeyVaultClient, KeyVaultId, KeyVaultAuthentication, KeyId - from azure.keyvault.models import KeyAttributes, JsonWebKey - from azure.common.credentials import ServicePrincipalCredentials, get_cli_profile - from msrestazure.azure_active_directory import MSIAuthentication + from azure.keyvault.keys import KeyClient except ImportError: # This is handled in azure_rm_common pass @@ -204,20 +203,20 @@ except ImportError: def keybundle_to_dict(bundle): return dict( - tags=bundle.tags, - managed=bundle.managed, + tags=bundle.properties.tags, + managed=bundle.properties.managed, attributes=dict( - enabled=bundle.attributes.enabled, - not_before=bundle.attributes.not_before, - expires=bundle.attributes.expires, - created=bundle.attributes.created, - updated=bundle.attributes.updated, - recovery_level=bundle.attributes.recovery_level + enabled=bundle.properties.enabled, + not_before=bundle.properties.not_before, + expires=bundle.properties.expires_on, + created=bundle.properties.created_on, + updated=bundle.properties.updated_on, + recovery_level=bundle.properties.recovery_level ), - kid=bundle.key.kid, - version=KeyVaultId.parse_key_id(bundle.key.kid).version, - type=bundle.key.kty, - permitted_operations=bundle.key.key_ops, + kid=bundle.id, + version=bundle.properties.version, + type=bundle.key_type, + permitted_operations=bundle.key_operations, key=dict( n=bundle.key.n if hasattr(bundle.key, 'n') else None, e=bundle.key.e if hasattr(bundle.key, 'e') else None, @@ -228,35 +227,96 @@ def keybundle_to_dict(bundle): ) +def delete_keybundle_to_dict(bundle): + return dict( + tags=bundle._tags, + managed=bundle._managed, + attributes=dict( + enabled=bundle.enabled, + not_before=bundle.not_before, + expires=bundle.expires_on, + created=bundle.created_on, + updated=bundle.updated_on, + recovery_level=bundle.recovery_level + ), + kid=bundle._id, + version=bundle.version, + ) + + +def delete_properties_to_dict(bundle): + return dict( + tags=bundle.tags, + managed=bundle.managed, + attributes=dict( + enabled=bundle.enabled, + not_before=bundle.not_before, + expires=bundle.expires_on, + created=bundle.created_on, + updated=bundle.updated_on, + recovery_level=bundle.recovery_level + ), + kid=bundle.id, + version=bundle.version, + ) + + def deletedkeybundle_to_dict(bundle): - keybundle = keybundle_to_dict(bundle) - keybundle['recovery_id'] = bundle.recovery_id, - keybundle['scheduled_purge_date'] = bundle.scheduled_purge_date, + keybundle = delete_properties_to_dict(bundle.properties) + keybundle['type'] = bundle.key_type + keybundle['permitted_operations'] = bundle.key_operations + keybundle['recovery_id'] = bundle.recovery_id + keybundle['scheduled_purge_date'] = bundle.scheduled_purge_date keybundle['deleted_date'] = bundle.deleted_date + keybundle['key'] = dict(n=bundle.key.n if hasattr(bundle.key, 'n') else None, + e=bundle.key.e if hasattr(bundle.key, 'e') else None, + crv=bundle.key.crv if hasattr(bundle.key, 'crv') else None, + x=bundle.key.x if hasattr(bundle.key, 'x') else None, + y=bundle.key.y if hasattr(bundle.key, 'y') else None) + keybundle['id'] = bundle.id return keybundle def keyitem_to_dict(keyitem): return dict( - kid=keyitem.kid, - version=KeyVaultId.parse_key_id(keyitem.kid).version, - tags=keyitem.tags, - manged=keyitem.managed, + kid=keyitem._id, + version=keyitem.version, + tags=keyitem._tags, + manged=keyitem._managed, attributes=dict( - enabled=keyitem.attributes.enabled, - not_before=keyitem.attributes.not_before, - expires=keyitem.attributes.expires, - created=keyitem.attributes.created, - updated=keyitem.attributes.updated, - recovery_level=keyitem.attributes.recovery_level + enabled=keyitem.enabled, + not_before=keyitem.not_before, + expires=keyitem.expires_on, + created=keyitem.created_on, + updated=keyitem.updated_on, + recovery_level=keyitem.recovery_level + ) + ) + + +def delete_item_to_dict(bundle): + return dict( + tags=bundle.properties._tags, + kid=bundle.properties.id, + version=bundle.properties.version, + managed=bundle.properties.managed, + attributes=dict( + enabled=bundle.properties.enabled, + not_before=bundle.properties.not_before, + expires=bundle.properties.expires_on, + created=bundle.properties.created_on, + updated=bundle.properties.updated_on, + recovery_level=bundle.properties.recovery_level + + ) ) def deletedkeyitem_to_dict(keyitem): - item = keyitem_to_dict(keyitem) - item['recovery_id'] = keyitem.recovery_id, - item['scheduled_purge_date'] = keyitem.scheduled_purge_date, + item = delete_item_to_dict(keyitem) + item['recovery_id'] = keyitem.recovery_id + item['scheduled_purge_date'] = keyitem.scheduled_purge_date item['deleted_date'] = keyitem.deleted_date return item @@ -312,48 +372,8 @@ class AzureRMKeyVaultKeyInfo(AzureRMModuleBase): return self.results def get_keyvault_client(self): - kv_url = self.azure_auth._cloud_environment.suffixes.keyvault_dns.split('.', 1).pop() - # Don't use MSI credentials if the auth_source isn't set to MSI. The below will Always result in credentials when running on an Azure VM. - if self.module.params['auth_source'] == 'msi': - try: - self.log("Get KeyVaultClient from MSI") - credentials = MSIAuthentication(resource="https://{0}".format(kv_url)) - return KeyVaultClient(credentials) - except Exception: - self.log("Get KeyVaultClient from service principal") - elif (self.module.params['auth_source'] == 'cli' - or (self.module.params['auth_source'] == 'auto' - and self.credentials['client_id'] is None - and self.credentials['secret'] is None)): - try: - profile = get_cli_profile() - credentials, subscription_id, tenant = profile.get_login_credentials( - subscription_id=self.credentials['subscription_id'], resource="https://{0}".format(kv_url)) - return KeyVaultClient(credentials) - except Exception as exc: - self.log("Get KeyVaultClient from service principal") - # self.fail("Failed to load CLI profile {0}.".format(str(exc))) - - # Create KeyVault Client using KeyVault auth class and auth_callback - def auth_callback(server, resource, scope): - if self.credentials['client_id'] is None or self.credentials['secret'] is None: - self.fail('Please specify client_id, secret and tenant to access azure Key Vault.') - - tenant = self.credentials.get('tenant') - if not self.credentials['tenant']: - tenant = "common" - - authcredential = ServicePrincipalCredentials( - client_id=self.credentials['client_id'], - secret=self.credentials['secret'], - tenant=tenant, - cloud_environment=self._cloud_environment, - resource="https://{0}".format(kv_url)) - - token = authcredential.token - return token['token_type'], token['access_token'] - - return KeyVaultClient(KeyVaultAuthentication(auth_callback)) + + return KeyClient(vault_url=self.vault_uri, credential=self.azure_auth.azure_credential_track2) def get_key(self): ''' @@ -366,19 +386,20 @@ class AzureRMKeyVaultKeyInfo(AzureRMModuleBase): results = [] try: if self.version == 'current': - response = self._client.get_key(vault_base_url=self.vault_uri, - key_name=self.name, - key_version='') + response = self._client.get_key(name=self.name, + version=None) else: - response = self._client.get_key(vault_base_url=self.vault_uri, - key_name=self.name, - key_version=self.version) + response = self._client.get_key(name=self.name, + version=self.version) - if response and self.has_tags(response.tags, self.tags): - self.log("Response : {0}".format(response)) - results.append(keybundle_to_dict(response)) + if response: + response = keybundle_to_dict(response) + if self.has_tags(response['tags'], self.tags): + self.log("Response : {0}".format(response)) + results.append(response) except Exception as e: + self.fail(e) self.log("Did not find the key vault key {0}: {1}".format(self.name, str(e))) return results @@ -392,14 +413,14 @@ class AzureRMKeyVaultKeyInfo(AzureRMModuleBase): results = [] try: - response = self._client.get_key_versions(vault_base_url=self.vault_uri, - key_name=self.name) + response = self._client.list_properties_of_key_versions(name=self.name) self.log("Response : {0}".format(response)) if response: for item in response: - if self.has_tags(item.tags, self.tags): - results.append(keyitem_to_dict(item)) + item = keyitem_to_dict(item) + if self.has_tags(item['tags'], self.tags): + results.append(item) except Exception as e: self.log("Did not find key versions {0} : {1}.".format(self.name, str(e))) return results @@ -414,13 +435,14 @@ class AzureRMKeyVaultKeyInfo(AzureRMModuleBase): results = [] try: - response = self._client.get_keys(vault_base_url=self.vault_uri) + response = self._client.list_properties_of_keys() self.log("Response : {0}".format(response)) if response: for item in response: - if self.has_tags(item.tags, self.tags): - results.append(keyitem_to_dict(item)) + item = keyitem_to_dict(item) + if self.has_tags(item['tags'], self.tags): + results.append(item) except Exception as e: self.log("Did not find key vault in current subscription {0}.".format(str(e))) return results @@ -435,12 +457,13 @@ class AzureRMKeyVaultKeyInfo(AzureRMModuleBase): results = [] try: - response = self._client.get_deleted_key(vault_base_url=self.vault_uri, - key_name=self.name) + response = self._client.get_deleted_key(name=self.name) - if response and self.has_tags(response.tags, self.tags): - self.log("Response : {0}".format(response)) - results.append(deletedkeybundle_to_dict(response)) + if response: + response = deletedkeybundle_to_dict(response) + if self.has_tags(response['tags'], self.tags): + self.log("Response : {0}".format(response)) + results.append(response) except Exception as e: self.log("Did not find the key vault key {0}: {1}".format(self.name, str(e))) @@ -456,13 +479,14 @@ class AzureRMKeyVaultKeyInfo(AzureRMModuleBase): results = [] try: - response = self._client.get_deleted_keys(vault_base_url=self.vault_uri) + response = self._client.list_deleted_keys() self.log("Response : {0}".format(response)) if response: for item in response: - if self.has_tags(item.tags, self.tags): - results.append(deletedkeyitem_to_dict(item)) + item = deletedkeyitem_to_dict(item) + if self.has_tags(item['tags'], self.tags): + results.append(item) except Exception as e: self.log("Did not find key vault in current subscription {0}.".format(str(e))) return results diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_keyvaultsecret.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_keyvaultsecret.py index 0a5288abb..98a5e0e78 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_keyvaultsecret.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_keyvaultsecret.py @@ -18,9 +18,10 @@ description: - Such as authentication keys, storage account keys, data encryption keys, .PFX files, and passwords. options: keyvault_uri: - description: - - URI of the keyvault endpoint. - required: true + description: + - URI of the keyvault endpoint. + required: true + type: str content_type: description: - Type of the secret value such as a password. @@ -29,9 +30,11 @@ options: description: - Name of the keyvault secret. required: true + type: str secret_value: description: - Secret to be secured by keyvault. + type: str secret_expiry: description: - Optional expiry datetime for secret @@ -43,6 +46,7 @@ options: state: description: - Assert the state of the subnet. Use C(present) to create or update a secret and C(absent) to delete a secret . + type: str default: present choices: - absent @@ -58,20 +62,20 @@ author: ''' EXAMPLES = ''' - - name: Create a secret - azure_rm_keyvaultsecret: - secret_name: MySecret - secret_value: My_Pass_Sec - keyvault_uri: https://contoso.vault.azure.net/ - tags: - testing: testing - delete: never - - - name: Delete a secret - azure_rm_keyvaultsecret: - secret_name: MySecret - keyvault_uri: https://contoso.vault.azure.net/ - state: absent +- name: Create a secret + azure_rm_keyvaultsecret: + secret_name: MySecret + secret_value: My_Pass_Sec + keyvault_uri: https://contoso.vault.azure.net/ + tags: + testing: testing + delete: never + +- name: Delete a secret + azure_rm_keyvaultsecret: + secret_name: MySecret + keyvault_uri: https://contoso.vault.azure.net/ + state: absent ''' RETURN = ''' @@ -91,12 +95,8 @@ state: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase try: - from azure.keyvault import KeyVaultClient, KeyVaultAuthentication, KeyVaultId - from azure.common.credentials import ServicePrincipalCredentials, get_cli_profile - from msrestazure.azure_active_directory import MSIAuthentication + from azure.keyvault.secrets import SecretClient import dateutil.parser - from azure.keyvault.models import SecretAttributes - # from azure.keyvault.models.secret_attributes import SecretAttributes except ImportError: # This is handled in azure_rm_common pass @@ -162,7 +162,7 @@ class AzureRMKeyVaultSecret(AzureRMModuleBase): elif self.secret_value and results['secret_value'] != self.secret_value: changed = True - except Exception: + except Exception as ec: # Secret doesn't exist if self.state == 'present': changed = True @@ -198,69 +198,32 @@ class AzureRMKeyVaultSecret(AzureRMModuleBase): return self.results def get_keyvault_client(self): - kv_url = self.azure_auth._cloud_environment.suffixes.keyvault_dns.split('.', 1).pop() - # Don't use MSI credentials if the auth_source isn't set to MSI. The below will Always result in credentials when running on an Azure VM. - if self.module.params['auth_source'] == 'msi': - try: - self.log("Get KeyVaultClient from MSI") - credentials = MSIAuthentication(resource="https://{0}".format(kv_url)) - return KeyVaultClient(credentials) - except Exception: - self.log("Get KeyVaultClient from service principal") - elif (self.module.params['auth_source'] == 'cli' - or (self.module.params['auth_source'] == 'auto' - and self.credentials['client_id'] is None - and self.credentials['secret'] is None)): - try: - profile = get_cli_profile() - credentials, subscription_id, tenant = profile.get_login_credentials( - subscription_id=self.credentials['subscription_id'], resource="https://{0}".format(kv_url)) - return KeyVaultClient(credentials) - except Exception as exc: - self.log("Get KeyVaultClient from service principal") - # self.fail("Failed to load CLI profile {0}.".format(str(exc))) - - # Create KeyVault Client using KeyVault auth class and auth_callback - def auth_callback(server, resource, scope): - if self.credentials['client_id'] is None or self.credentials['secret'] is None: - self.fail('Please specify client_id, secret and tenant to access azure Key Vault.') - - tenant = self.credentials.get('tenant') - if not self.credentials['tenant']: - tenant = "common" - - authcredential = ServicePrincipalCredentials( - client_id=self.credentials['client_id'], - secret=self.credentials['secret'], - tenant=tenant, - cloud_environment=self._cloud_environment, - resource="https://{0}".format(kv_url)) - - token = authcredential.token - return token['token_type'], token['access_token'] - - return KeyVaultClient(KeyVaultAuthentication(auth_callback)) + + return SecretClient(vault_url=self.keyvault_uri, credential=self.azure_auth.azure_credential_track2) def get_secret(self, name, version=''): ''' Gets an existing secret ''' - secret_bundle = self.client.get_secret(self.keyvault_uri, name, version) + secret_bundle = self.client.get_secret(name=name, version=version) + if secret_bundle: - secret_id = KeyVaultId.parse_secret_id(secret_bundle.id) - return dict(secret_id=secret_id.id, secret_value=secret_bundle.value) + return dict(secret_id=secret_bundle.id, secret_value=secret_bundle.value) return None def create_update_secret(self, name, secret, tags, content_type, valid_from, expiry): ''' Creates/Updates a secret ''' - secret_attributes = SecretAttributes(expires=expiry, not_before=valid_from) - secret_bundle = self.client.set_secret(self.keyvault_uri, name, secret, tags=tags, content_type=content_type, secret_attributes=secret_attributes) - secret_id = KeyVaultId.parse_secret_id(secret_bundle.id) - return secret_id.id + secret_bundle = self.client.set_secret(name=name, + value=secret, + tags=tags, + content_type=content_type, + expires_on=expiry, + not_before=valid_from) + return secret_bundle._properties._id def delete_secret(self, name): ''' Deletes a secret ''' - deleted_secret = self.client.delete_secret(self.keyvault_uri, name) - secret_id = KeyVaultId.parse_secret_id(deleted_secret.id) - return secret_id.id + deleted_secret = self.client.begin_delete_secret(name) + result = self.get_poller_result(deleted_secret) + return result.properties._id def main(): diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_keyvaultsecret_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_keyvaultsecret_info.py index a785b8ce7..b612dce36 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_keyvaultsecret_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_keyvaultsecret_info.py @@ -53,31 +53,31 @@ author: ''' EXAMPLES = ''' - - name: Get latest version of specific secret - azure_rm_keyvaultsecret_info: - vault_uri: "https://myVault.vault.azure.net" - name: mySecret - - - name: List all versions of specific secret - azure_rm_keyvaultsecret_info: - vault_uri: "https://myVault.vault.azure.net" - name: mySecret - version: all - - - name: List specific version of specific secret - azure_rm_keyvaultsecret_info: - vault_uri: "https://myVault.vault.azure.net" - name: mySecret - version: fd2682392a504455b79c90dd04a1bf46 - - - name: List all secrets in specific key vault - azure_rm_keyvaultsecret_info: - vault_uri: "https://myVault.vault.azure.net" - - - name: List deleted secrets in specific key vault - azure_rm_keyvaultsecret_info: - vault_uri: "https://myVault.vault.azure.net" - show_deleted_secret: True +- name: Get latest version of specific secret + azure_rm_keyvaultsecret_info: + vault_uri: "https://myVault.vault.azure.net" + name: mySecret + +- name: List all versions of specific secret + azure_rm_keyvaultsecret_info: + vault_uri: "https://myVault.vault.azure.net" + name: mySecret + version: all + +- name: List specific version of specific secret + azure_rm_keyvaultsecret_info: + vault_uri: "https://myVault.vault.azure.net" + name: mySecret + version: fd2682392a504455b79c90dd04a1bf46 + +- name: List all secrets in specific key vault + azure_rm_keyvaultsecret_info: + vault_uri: "https://myVault.vault.azure.net" + +- name: List deleted secrets in specific key vault + azure_rm_keyvaultsecret_info: + vault_uri: "https://myVault.vault.azure.net" + show_deleted_secret: true ''' RETURN = ''' @@ -162,55 +162,68 @@ secrets: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase try: - from azure.keyvault import KeyVaultClient, KeyVaultId, KeyVaultAuthentication - from azure.common.credentials import ServicePrincipalCredentials, get_cli_profile - from msrestazure.azure_active_directory import MSIAuthentication + from azure.keyvault.secrets import SecretClient except ImportError: # This is handled in azure_rm_common pass def secretbundle_to_dict(bundle): + return dict(tags=bundle._properties._tags, + attributes=dict( + enabled=bundle._properties._attributes.enabled, + not_before=bundle._properties._attributes.not_before, + expires=bundle._properties._attributes.expires, + created=bundle._properties._attributes.created, + updated=bundle._properties._attributes.updated, + recovery_level=bundle._properties._attributes.recovery_level), + sid=bundle._properties._id, + version=bundle._properties.version, + content_type=bundle._properties._content_type, + secret=bundle._value) + + +def deleted_bundle_to_dict(bundle): return dict(tags=bundle.tags, attributes=dict( - enabled=bundle.attributes.enabled, - not_before=bundle.attributes.not_before, - expires=bundle.attributes.expires, - created=bundle.attributes.created, - updated=bundle.attributes.updated, - recovery_level=bundle.attributes.recovery_level), + enabled=bundle.enabled, + not_before=bundle.not_before, + expires=bundle.expires_on, + created=bundle.created_on, + updated=bundle.updated_on, + recovery_level=bundle.recovery_level), sid=bundle.id, - version=KeyVaultId.parse_secret_id(bundle.id).version, + version=bundle.key_id, content_type=bundle.content_type, - secret=bundle.value) + secret=bundle.version) def deletedsecretbundle_to_dict(bundle): - secretbundle = secretbundle_to_dict(bundle) - secretbundle['recovery_id'] = bundle.recovery_id, - secretbundle['scheduled_purge_date'] = bundle.scheduled_purge_date, - secretbundle['deleted_date'] = bundle.deleted_date + secretbundle = deleted_bundle_to_dict(bundle.properties) + secretbundle['recovery_id'] = bundle._recovery_id + secretbundle['scheduled_purge_date'] = bundle._scheduled_purge_date + secretbundle['deleted_date'] = bundle._deleted_date return secretbundle def secretitem_to_dict(secretitem): - return dict(sid=secretitem.id, - version=KeyVaultId.parse_secret_id(secretitem.id).version, - tags=secretitem.tags, + return dict(sid=secretitem._id, + version=secretitem.version, + tags=secretitem._tags, attributes=dict( - enabled=secretitem.attributes.enabled, - not_before=secretitem.attributes.not_before, - expires=secretitem.attributes.expires, - created=secretitem.attributes.created, - updated=secretitem.attributes.updated, - recovery_level=secretitem.attributes.recovery_level)) + enabled=secretitem._attributes.enabled, + not_before=secretitem._attributes.not_before, + expires=secretitem._attributes.expires, + created=secretitem._attributes.created, + updated=secretitem._attributes.updated, + recovery_level=secretitem._attributes.recovery_level)) def deletedsecretitem_to_dict(secretitem): - item = secretitem_to_dict(secretitem) - item['recovery_id'] = secretitem.recovery_id, - item['scheduled_purge_date'] = secretitem.scheduled_purge_date, - item['deleted_date'] = secretitem.deleted_date + item = secretitem_to_dict(secretitem.properties) + item['recovery_id'] = secretitem._recovery_id + item['scheduled_purge_date'] = secretitem._scheduled_purge_date + item['deleted_date'] = secretitem._deleted_date return item @@ -265,52 +278,8 @@ class AzureRMKeyVaultSecretInfo(AzureRMModuleBase): return self.results def get_keyvault_client(self): - kv_url = self.azure_auth._cloud_environment.suffixes.keyvault_dns.split('.', 1).pop() - # Don't use MSI credentials if the auth_source isn't set to MSI. The below will Always result in credentials when running on an Azure VM. - if self.module.params['auth_source'] == 'msi': - try: - self.log("Get KeyVaultClient from MSI") - resource = self.azure_auth._cloud_environment.suffixes.keyvault_dns.split('.', 1).pop() - credentials = MSIAuthentication(resource="https://{0}".format(resource)) - return KeyVaultClient(credentials) - except Exception: - self.log("Get KeyVaultClient from service principal") - elif (self.module.params['auth_source'] == 'cli' - or (self.module.params['auth_source'] == 'auto' - and self.credentials['client_id'] is None - and self.credentials['secret'] is None)): - try: - profile = get_cli_profile() - credentials, subscription_id, tenant = profile.get_login_credentials( - subscription_id=self.credentials['subscription_id'], resource="https://{0}".format(kv_url)) - return KeyVaultClient(credentials) - except Exception as exc: - self.log("Get KeyVaultClient from service principal") - # self.fail("Failed to load CLI profile {0}.".format(str(exc))) - - # Create KeyVault Client using KeyVault auth class and auth_callback - def auth_callback(server, resource, scope): - if self.credentials['client_id'] is None or self.credentials[ - 'secret'] is None: - self.fail( - 'Please specify client_id, secret and tenant to access azure Key Vault.' - ) - - tenant = self.credentials.get('tenant') - if not self.credentials['tenant']: - tenant = "common" - - authcredential = ServicePrincipalCredentials( - client_id=self.credentials['client_id'], - secret=self.credentials['secret'], - tenant=tenant, - cloud_environment=self._cloud_environment, - resource="https://{0}".format(kv_url)) - - token = authcredential.token - return token['token_type'], token['access_token'] - - return KeyVaultClient(KeyVaultAuthentication(auth_callback)) + + return SecretClient(vault_url=self.vault_uri, credential=self.azure_auth.azure_credential_track2) def get_secret(self): ''' @@ -323,19 +292,15 @@ class AzureRMKeyVaultSecretInfo(AzureRMModuleBase): results = [] try: if self.version == 'current': - response = self._client.get_secret( - vault_base_url=self.vault_uri, - secret_name=self.name, - secret_version='') + response = self._client.get_secret(name=self.name, version='') else: - response = self._client.get_secret( - vault_base_url=self.vault_uri, - secret_name=self.name, - secret_version=self.version) + response = self._client.get_secret(name=self.name, version=self.version) - if response and self.has_tags(response.tags, self.tags): - self.log("Response : {0}".format(response)) - results.append(secretbundle_to_dict(response)) + if response: + response = secretbundle_to_dict(response) + if self.has_tags(response['tags'], self.tags): + self.log("Response : {0}".format(response)) + results.append(response) except Exception as e: self.log("Did not find the key vault secret {0}: {1}".format( @@ -352,14 +317,14 @@ class AzureRMKeyVaultSecretInfo(AzureRMModuleBase): results = [] try: - response = self._client.get_secret_versions( - vault_base_url=self.vault_uri, secret_name=self.name) + response = self._client.list_properties_of_secret_versions(name=self.name) self.log("Response : {0}".format(response)) if response: for item in response: - if self.has_tags(item.tags, self.tags): - results.append(secretitem_to_dict(item)) + item = secretitem_to_dict(item) + if self.has_tags(item['tags'], self.tags): + results.append(item) except Exception as e: self.log("Did not find secret versions {0} : {1}.".format( self.name, str(e))) @@ -375,13 +340,14 @@ class AzureRMKeyVaultSecretInfo(AzureRMModuleBase): results = [] try: - response = self._client.get_secrets(vault_base_url=self.vault_uri) + response = self._client.list_properties_of_secrets() self.log("Response : {0}".format(response)) if response: for item in response: - if self.has_tags(item.tags, self.tags): - results.append(secretitem_to_dict(item)) + item = secretitem_to_dict(item) + if self.has_tags(item['tags'], self.tags): + results.append(item) except Exception as e: self.log( "Did not find key vault in current subscription {0}.".format( @@ -398,12 +364,13 @@ class AzureRMKeyVaultSecretInfo(AzureRMModuleBase): results = [] try: - response = self._client.get_deleted_secret( - vault_base_url=self.vault_uri, secret_name=self.name) + response = self._client.get_deleted_secret(name=self.name) - if response and self.has_tags(response.tags, self.tags): - self.log("Response : {0}".format(response)) - results.append(deletedsecretbundle_to_dict(response)) + if response: + response = deletedsecretbundle_to_dict(response) + if self.has_tags(response['tags'], self.tags): + self.log("Response : {0}".format(response)) + results.append(response) except Exception as e: self.log("Did not find the key vault secret {0}: {1}".format( @@ -420,14 +387,14 @@ class AzureRMKeyVaultSecretInfo(AzureRMModuleBase): results = [] try: - response = self._client.get_deleted_secrets( - vault_base_url=self.vault_uri) + response = self._client.list_deleted_secrets() self.log("Response : {0}".format(response)) if response: for item in response: - if self.has_tags(item.tags, self.tags): - results.append(deletedsecretitem_to_dict(item)) + item = deletedsecretitem_to_dict(item) + if self.has_tags(item['tags'], self.tags): + results.append(item) except Exception as e: self.log( "Did not find key vault in current subscription {0}.".format( diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_loadbalancer.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_loadbalancer.py index 86c4335f8..2c473778c 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_loadbalancer.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_loadbalancer.py @@ -24,43 +24,54 @@ options: description: - Name of a resource group where the load balancer exists or will be created. required: true + type: str name: description: - Name of the load balancer. required: true + type: str state: description: - Assert the state of the load balancer. Use C(present) to create/update a load balancer, or C(absent) to delete one. default: present + type: str choices: - absent - present location: description: - Valid Azure location. Defaults to location of the resource group. + type: str sku: description: - The load balancer SKU. + type: str choices: - Basic - Standard frontend_ip_configurations: description: - List of frontend IPs to be used. + type: list + elements: dict suboptions: name: description: - Name of the frontend ip configuration. + type: str required: True public_ip_address: description: - Name of an existing public IP address object in the current resource group to associate with the security group. + type: str private_ip_address: description: - The reference of the Public IP resource. + type: str private_ip_allocation_method: description: - The Private IP allocation method. + type: str choices: - Static - Dynamic @@ -68,6 +79,7 @@ options: description: - The reference of the subnet resource. - Should be an existing subnet's resource id. + type: str zones: description: - list of availability zones denoting the IP allocated for the resource needs to come from. @@ -77,28 +89,36 @@ options: backend_address_pools: description: - List of backend address pools. + type: list + elements: dict suboptions: name: description: - Name of the backend address pool. required: True + type: str probes: description: - List of probe definitions used to check endpoint health. + type: list + elements: dict suboptions: name: description: - Name of the probe. + type: str required: True port: description: - Probe port for communicating the probe. Possible values range from 1 to 65535, inclusive. + type: int required: True protocol: description: - The protocol of the end point to be probed. - If C(Tcp) is specified, a received ACK is required for the probe to be successful. - If C(Http) or C(Https) is specified, a 200 OK response from the specified URL is required for the probe to be successful. + type: str choices: - Tcp - Http @@ -108,18 +128,21 @@ options: - The interval, in seconds, for how frequently to probe the endpoint for health status. - Slightly less than half the allocated timeout period, which allows two full probes before taking the instance out of rotation. - The default value is C(15), the minimum value is C(5). + type: int default: 15 fail_count: description: - The number of probes where if no response, will result in stopping further traffic from being delivered to the endpoint. - This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure. default: 3 + type: int aliases: - number_of_probes request_path: description: - The URI used for requesting health status from the VM. - Path is required if I(protocol=Http) or I(protocol=Https). Otherwise, it is not allowed. + type: str inbound_nat_pools: description: - Defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. @@ -128,18 +151,23 @@ options: - Inbound NAT pools are referenced from virtual machine scale sets. - NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. - They have to reference individual inbound NAT rules. + type: list + elements: dict suboptions: name: description: - Name of the inbound NAT pool. + type: str required: True frontend_ip_configuration_name: description: - A reference to frontend IP addresses. required: True + type: str protocol: description: - IP protocol for the NAT pool. + type: str choices: - Tcp - Udp @@ -148,39 +176,50 @@ options: description: - The first port in the range of external ports that will be used to provide inbound NAT to NICs associated with the load balancer. - Acceptable values range between 1 and 65534. + type: int required: True frontend_port_range_end: description: - The last port in the range of external ports that will be used to provide inbound NAT to NICs associated with the load balancer. - Acceptable values range between 1 and 65535. + type: int required: True backend_port: description: - The port used for internal connections on the endpoint. - Acceptable values are between 1 and 65535. + type: int + required: true load_balancing_rules: description: - Object collection representing the load balancing rules Gets the provisioning. + type: list + elements: dict suboptions: name: description: - Name of the load balancing rule. + type: str required: True frontend_ip_configuration: description: - A reference to frontend IP addresses. + type: str required: True backend_address_pool: description: - A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. required: True + type: str probe: description: - The name of the load balancer probe this rule should use for health checks. required: True + type: str protocol: description: - IP protocol for the load balancing rule. + type: str choices: - Tcp - Udp @@ -188,6 +227,7 @@ options: load_distribution: description: - The session persistence policy for this rule; C(Default) is no persistence. + type: str choices: - Default - SourceIP @@ -199,26 +239,34 @@ options: - Frontend port numbers must be unique across all rules within the load balancer. - Acceptable values are between 0 and 65534. - Note that value 0 enables "Any Port". + type: int + required: true backend_port: description: - The port used for internal connections on the endpoint. - Acceptable values are between 0 and 65535. - Note that value 0 enables "Any Port". + type: int idle_timeout: description: - The timeout for the TCP idle connection. - The value can be set between 4 and 30 minutes. - The default value is C(4) minutes. - This element is only used when the protocol is set to TCP. + type: int + default: 4 enable_floating_ip: description: - Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. + type: bool disable_outbound_snat: description: - Configure outbound source network address translation (SNAT). - The default behavior when omitted is equivalent to I(disable_outbound_snat=True). - True is equivalent to "(Recommended) Use outbound rules to provide backend pool members access to the internet" in portal. - False is equivalent to "Use default outbound access" in portal. + type: bool + default: False inbound_nat_rules: description: - Collection of inbound NAT Rules used by a load balancer. @@ -226,18 +274,23 @@ options: - Inbound NAT pools are referenced from virtual machine scale sets. - NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. - They have to reference individual inbound NAT rules. + type: list + elements: dict suboptions: name: description: - name of the inbound nat rule. + type: str required: True frontend_ip_configuration: description: - A reference to frontend IP addresses. + type: str required: True protocol: description: - IP protocol for the inbound nat rule. + type: str choices: - Tcp - Udp @@ -248,30 +301,38 @@ options: - Frontend port numbers must be unique across all rules within the load balancer. - Acceptable values are between 0 and 65534. - Note that value 0 enables "Any Port". + type: int + required: True backend_port: description: - The port used for internal connections on the endpoint. - Acceptable values are between 0 and 65535. - Note that value 0 enables "Any Port". + type: int + required: true idle_timeout: description: - The timeout for the TCP idle connection. - The value can be set between 4 and 30 minutes. - The default value is C(4) minutes. - This element is only used when I(protocol=Tcp). + type: int enable_floating_ip: description: - Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. - This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. - This setting can't be changed after you create the endpoint. + type: bool enable_tcp_reset: description: - Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. - This element is only used when I(protocol=Tcp). + type: bool public_ip_address_name: description: - (deprecated) Name of an existing public IP address object to associate with the security group. - This option has been deprecated, and will be removed in 2.9. Use I(frontend_ip_configurations) instead. + type: str aliases: - public_ip_address - public_ip_name @@ -280,10 +341,12 @@ options: description: - (deprecated) The port that the health probe will use. - This option has been deprecated, and will be removed in 2.9. Use I(probes) instead. + type: int probe_protocol: description: - (deprecated) The protocol to use for the health probe. - This option has been deprecated, and will be removed in 2.9. Use I(probes) instead. + type: str choices: - Tcp - Http @@ -292,20 +355,24 @@ options: description: - (deprecated) Time (in seconds) between endpoint health probes. - This option has been deprecated, and will be removed in 2.9. Use I(probes) instead. + type: int default: 15 probe_fail_count: description: - (deprecated) The amount of probe failures for the load balancer to make a health determination. - This option has been deprecated, and will be removed in 2.9. Use I(probes) instead. default: 3 + type: int probe_request_path: description: - (deprecated) The URL that an HTTP probe or HTTPS probe will use (only relevant if I(probe_protocol=Http) or I(probe_protocol=Https)). - This option has been deprecated, and will be removed in 2.9. Use I(probes) instead. + type: str protocol: description: - (deprecated) The protocol (TCP or UDP) that the load balancer will use. - This option has been deprecated, and will be removed in 2.9. Use I(load_balancing_rules) instead. + type: str choices: - Tcp - Udp @@ -313,6 +380,7 @@ options: description: - (deprecated) The type of load distribution that the load balancer will employ. - This option has been deprecated, and will be removed in 2.9. Use I(load_balancing_rules) instead. + type: str choices: - Default - SourceIP @@ -321,31 +389,38 @@ options: description: - (deprecated) Frontend port that will be exposed for the load balancer. - This option has been deprecated, and will be removed in 2.9. Use I(load_balancing_rules) instead. + type: int backend_port: description: - (deprecated) Backend port that will be exposed for the load balancer. - This option has been deprecated, and will be removed in 2.9. Use I(load_balancing_rules) instead. + type: int idle_timeout: description: - (deprecated) Timeout for TCP idle connection in minutes. - This option has been deprecated, and will be removed in 2.9. Use I(load_balancing_rules) instead. + type: int default: 4 natpool_frontend_port_start: description: - (deprecated) Start of the port range for a NAT pool. - This option has been deprecated, and will be removed in 2.9. Use I(inbound_nat_pools) instead. + type: int natpool_frontend_port_end: description: - (deprecated) End of the port range for a NAT pool. - This option has been deprecated, and will be removed in 2.9. Use I(inbound_nat_pools) instead. + type: int natpool_backend_port: description: - (deprecated) Backend port used by the NAT pool. - This option has been deprecated, and will be removed in 2.9. Use I(inbound_nat_pools) instead. + type: int natpool_protocol: description: - (deprecated) The protocol for the NAT pool. - This option has been deprecated, and will be removed in 2.9. Use I(inbound_nat_pools) instead. + type: str extends_documentation_fragment: - azure.azcollection.azure - azure.azcollection.azure_tags @@ -403,12 +478,9 @@ changed: type: bool ''' -import random from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, format_resource_id from ansible.module_utils._text import to_native try: - from msrestazure.tools import parse_resource_id - from msrestazure.azure_exceptions import CloudError from azure.core.exceptions import ResourceNotFoundError except ImportError: # This is handled in azure_rm_common @@ -427,7 +499,8 @@ frontend_ip_configuration_spec = dict( type='str' ), private_ip_allocation_method=dict( - type='str' + type='str', + choices=['Static', 'Dynamic'] ), subnet=dict( type='str' @@ -578,7 +651,7 @@ load_balancing_rule_spec = dict( ), disable_outbound_snat=dict( type='bool', - default=None + default=False ), ) diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_loadbalancer_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_loadbalancer_info.py index 130e12d5c..45f7df094 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_loadbalancer_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_loadbalancer_info.py @@ -43,22 +43,22 @@ author: ''' EXAMPLES = ''' - - name: Get facts for one load balancer - azure_rm_loadbalancer_info: - name: Testing - resource_group: myResourceGroup - - - name: Get facts for all load balancers - azure_rm_loadbalancer_info: - - - name: Get facts for all load balancers in a specific resource group - azure_rm_loadbalancer_info: - resource_group: myResourceGroup - - - name: Get facts by tags - azure_rm_loadbalancer_info: - tags: - - testing +- name: Get facts for one load balancer + azure_rm_loadbalancer_info: + name: Testing + resource_group: myResourceGroup + +- name: Get facts for all load balancers + azure_rm_loadbalancer_info: + +- name: Get facts for all load balancers in a specific resource group + azure_rm_loadbalancer_info: + resource_group: myResourceGroup + +- name: Get facts by tags + azure_rm_loadbalancer_info: + tags: + - testing ''' RETURN = ''' @@ -116,7 +116,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError - from azure.common import AzureHttpError except Exception: # handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_lock_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_lock_info.py index ef9f3e303..39abbf3b7 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_lock_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_lock_info.py @@ -20,7 +20,6 @@ options: description: - Name of the lock. type: str - required: true managed_resource_id: description: - ID of the resource where need to manage the lock. @@ -115,7 +114,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase - from msrestazure.azure_exceptions import CloudError except ImportError: # This is handled in azure_rm_common pass @@ -160,7 +158,7 @@ class AzureRMLockInfo(AzureRMModuleBase): for key in self.module_arg_spec.keys(): setattr(self, key, kwargs[key]) - self._mgmt_client = self.get_mgmt_svc_client(GenericRestClient, base_url=self._cloud_environment.endpoints.resource_manager) + self._mgmt_client = self.get_mgmt_svc_client(GenericRestClient, is_track2=True, base_url=self._cloud_environment.endpoints.resource_manager) changed = False # construct scope id scope = self.get_scope() @@ -195,8 +193,8 @@ class AzureRMLockInfo(AzureRMModuleBase): expected_status_codes=[200], polling_timeout=None, polling_interval=None) - return json.loads(resp.text) - except CloudError as exc: + return json.loads(resp.body()) + except Exception as exc: self.fail('Error when finding locks {0}: {1}'.format(url, exc.message)) def get_scope(self): diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_loganalyticsworkspace.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_loganalyticsworkspace.py index 7e8acf260..b323d9292 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_loganalyticsworkspace.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_loganalyticsworkspace.py @@ -20,23 +20,28 @@ options: description: - Name of resource group. required: true + type: str name: description: - Name of the workspace. required: true + type: str state: description: - Assert the state of the image. Use C(present) to create or update a image and C(absent) to delete an image. default: present + type: str choices: - absent - present location: description: - Resource location. + type: str sku: description: - The SKU of the workspace. + type: str choices: - free - standard @@ -51,6 +56,7 @@ options: - The workspace data retention in days. - -1 means Unlimited retention for I(sku=unlimited). - 730 days is the maximum allowed for all other SKUs. + type: int intelligence_packs: description: - Manage intelligence packs possible for this workspace. @@ -77,7 +83,7 @@ EXAMPLES = ''' resource_group: myResourceGroup name: myLogAnalyticsWorkspace intelligence_pack: - Backup: true + Backup: true ''' RETURN = ''' @@ -154,8 +160,7 @@ usages: from ansible.module_utils.common.dict_transformations import _snake_to_camel, _camel_to_snake try: - from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, format_resource_id - from msrestazure.tools import parse_resource_id + from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from azure.core.exceptions import ResourceNotFoundError except ImportError: # This is handled in azure_rm_common diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_loganalyticsworkspace_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_loganalyticsworkspace_info.py index 4861954da..03a55bedc 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_loganalyticsworkspace_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_loganalyticsworkspace_info.py @@ -20,9 +20,11 @@ options: description: - Name of resource group. required: True + type: str name: description: - Name of the workspace. + type: str tags: description: - Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. @@ -32,18 +34,22 @@ options: description: - Show the intelligence packs for a workspace. - Note this will cost one more network overhead for each workspace, expected slow response. + type: bool show_management_groups: description: - Show the management groups for a workspace. - Note this will cost one more network overhead for each workspace, expected slow response. + type: bool show_shared_keys: description: - Show the shared keys for a workspace. - Note this will cost one more network overhead for each workspace, expected slow response. + type: bool show_usages: description: - Show the list of usages for a workspace. - Note this will cost one more network overhead for each workspace, expected slow response. + type: bool extends_documentation_fragment: - azure.azcollection.azure @@ -134,11 +140,10 @@ usages: } ''' # NOQA -from ansible.module_utils.common.dict_transformations import _snake_to_camel, _camel_to_snake +from ansible.module_utils.common.dict_transformations import _camel_to_snake try: - from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, format_resource_id - from msrestazure.tools import parse_resource_id + from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from azure.core.exceptions import ResourceNotFoundError except ImportError: # This is handled in azure_rm_common diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_manageddisk.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_manageddisk.py index e11965381..2b27fbbff 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_manageddisk.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_manageddisk.py @@ -27,20 +27,24 @@ options: description: - Name of a resource group where the managed disk exists or will be created. required: true + type: str name: description: - Name of the managed disk. required: true + type: str state: description: - Assert the state of the managed disk. Use C(present) to create or update a managed disk and C(absent) to delete a managed disk. default: present + type: str choices: - absent - present location: description: - Valid Azure location. Defaults to location of the resource group. + type: str storage_account_type: description: - Type of storage for the managed disk. @@ -52,6 +56,7 @@ options: - C(Premium_ZRS) is for Premium SSD Zone-redundant. - C(UltraSSD_LRS) (added in 2.8) is for Ultra SSD, which is only available on select instance types. - See U(https://docs.microsoft.com/en-us/azure/virtual-machines/windows/disks-types) for more information about disk types. + type: str choices: - Standard_LRS - StandardSSD_LRS @@ -62,6 +67,7 @@ options: create_option: description: - C(import) from a VHD file in I(source_uri) and C(copy) from previous managed disk I(source_uri). + type: str choices: - empty - import @@ -74,6 +80,7 @@ options: source_uri: description: - URI to a valid VHD file to be used or the resource ID of the managed disk to copy. + type: str aliases: - source_resource_uri os_type: @@ -83,6 +90,7 @@ options: - If omitted during creation, no value is set. - If omitted during an update, no change is made. - Once set, this value cannot be cleared. + type: str choices: - linux - windows @@ -90,11 +98,13 @@ options: description: - Size in GB of the managed disk to be created. - If I(create_option=copy) then the value must be greater than or equal to the source's size. + type: int managed_by: description: - Name of an existing virtual machine with which the disk is or will be associated, this VM should be in the same resource group. - To detach a disk from a vm, explicitly set to ''. - If this option is unset, the value will not be changed. + type: str managed_by_extended: description: - List of name and resource group of the VMs that have the disk attached. @@ -119,6 +129,7 @@ options: description: - Disk caching policy controlled by VM. Will be used when attached to the VM defined by C(managed_by). - If this option is different from the current caching policy, the managed disk will be deattached and attached with current caching option again. + type: str choices: - '' - read_only @@ -127,6 +138,7 @@ options: description: - The Azure managed disk's zone. - Allowed values are C(1), C(2), C(3) and C(''). + type: str choices: - '1' - '2' @@ -146,61 +158,61 @@ author: ''' EXAMPLES = ''' - - name: Create managed disk - azure_rm_manageddisk: - name: mymanageddisk - location: eastus - resource_group: myResourceGroup - disk_size_gb: 4 - - - name: Create managed operating system disk from page blob - azure_rm_manageddisk: - name: mymanageddisk - location: eastus2 - resource_group: myResourceGroup - create_option: import - source_uri: https://storageaccountname.blob.core.windows.net/containername/blob-name.vhd - storage_account_id: /subscriptions/<uuid>/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/storageaccountname - os_type: windows - storage_account_type: Premium_LRS - - - name: Mount the managed disk to VM - azure_rm_manageddisk: - name: mymanageddisk - location: eastus - resource_group: myResourceGroup - disk_size_gb: 4 - managed_by: testvm001 - attach_caching: read_only - - - name: Mount the managed disk to multiple VMs - azure_rm_manageddisk: - resource_group: myResourceGroup - name: freddisk04 - max_shares: 4 - disk_size_gb: 1024 - storage_account_type: Premium_LRS - managed_by_extended: - - resource_group: myResourceGroup01 - name: testVM01 - - resource_group: myResourceGroup02 - name: testVM02 - zone: 1 - - - name: Unmount the managed disk to VM - azure_rm_manageddisk: - name: mymanageddisk - location: eastus - resource_group: myResourceGroup - managed_by: '' - disk_size_gb: 4 - - - name: Delete managed disk - azure_rm_manageddisk: - name: mymanageddisk - location: eastus - resource_group: myResourceGroup - state: absent +- name: Create managed disk + azure_rm_manageddisk: + name: mymanageddisk + location: eastus + resource_group: myResourceGroup + disk_size_gb: 4 + +- name: Create managed operating system disk from page blob + azure_rm_manageddisk: + name: mymanageddisk + location: eastus2 + resource_group: myResourceGroup + create_option: import + source_uri: https://storageaccountname.blob.core.windows.net/containername/blob-name.vhd + storage_account_id: /subscriptions/<uuid>/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/storageaccountname + os_type: windows + storage_account_type: Premium_LRS + +- name: Mount the managed disk to VM + azure_rm_manageddisk: + name: mymanageddisk + location: eastus + resource_group: myResourceGroup + disk_size_gb: 4 + managed_by: testvm001 + attach_caching: read_only + +- name: Mount the managed disk to multiple VMs + azure_rm_manageddisk: + resource_group: myResourceGroup + name: freddisk04 + max_shares: 4 + disk_size_gb: 1024 + storage_account_type: Premium_LRS + managed_by_extended: + - resource_group: myResourceGroup01 + name: testVM01 + - resource_group: myResourceGroup02 + name: testVM02 + zone: 1 + +- name: Unmount the managed disk to VM + azure_rm_manageddisk: + name: mymanageddisk + location: eastus + resource_group: myResourceGroup + managed_by: '' + disk_size_gb: 4 + +- name: Delete managed disk + azure_rm_manageddisk: + name: mymanageddisk + location: eastus + resource_group: myResourceGroup + state: absent ''' RETURN = ''' @@ -278,14 +290,12 @@ changed: type: bool ''' -import re - from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase try: from concurrent.futures import ThreadPoolExecutor import multiprocessing - from msrestazure.tools import parse_resource_id + from azure.mgmt.core.tools import parse_resource_id from azure.core.exceptions import ResourceNotFoundError except ImportError: # This is handled in azure_rm_common @@ -569,7 +579,7 @@ class AzureRMManagedDisk(AzureRMModuleBase): if self.create_option == 'import': creation_data['create_option'] = self.compute_models.DiskCreateOption.import_enum creation_data['source_uri'] = self.source_uri - creation_data['source_account_id'] = self.storage_account_id + creation_data['storage_account_id'] = self.storage_account_id elif self.create_option == 'copy': creation_data['create_option'] = self.compute_models.DiskCreateOption.copy creation_data['source_resource_id'] = self.source_uri diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_manageddisk_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_manageddisk_info.py index 01656929c..be00c149e 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_manageddisk_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_manageddisk_info.py @@ -68,7 +68,7 @@ EXAMPLES = r''' - name: Get facts by tags azure_rm_manageddisk_info: tags: - - testing + - testing ''' RETURN = r''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_managementgroup.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_managementgroup.py index d9bee84fd..35235ccbe 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_managementgroup.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_managementgroup.py @@ -92,7 +92,6 @@ EXAMPLES = ''' azure_rm_managementgroup: group_id: ChildGroup state: absent - ''' RETURN = ''' @@ -270,6 +269,7 @@ class AzureRMManagementGroups(AzureRMModuleBaseExt): response = None self.mgmt_client = self.get_mgmt_svc_client(GenericRestClient, + is_track2=True, base_url=self._cloud_environment.endpoints.resource_manager) self.url = ('/providers' + @@ -359,9 +359,9 @@ class AzureRMManagementGroups(AzureRMModuleBaseExt): self.fail('Error creating the ManagementGroup instance: {0}'.format(str(exc))) try: - response = json.loads(response.text) + response = json.loads(response.body()) except Exception: - response = {'text': response.text} + response = {'text': response.context['deserialized_data']} pass return response @@ -396,7 +396,7 @@ class AzureRMManagementGroups(AzureRMModuleBaseExt): 600, 30) found = True - response = json.loads(response.text) + response = json.loads(response.body()) self.log("Response : {0}".format(response)) # self.log("ManagementGroup instance : {0} found".format(response.name)) except Exception as e: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_managementgroup_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_managementgroup_info.py index c95d10165..962d01831 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_managementgroup_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_managementgroup_info.py @@ -80,14 +80,14 @@ EXAMPLES = ''' - name: Get facts for one management group by id with direct children azure_rm_managementgroup_info: id: /providers/Microsoft.Management/managementGroups/contoso-group - children: True + children: true - name: Get facts for one management group by name with all children, flattened into top list azure_rm_managementgroup_info: name: "contoso-group" - children: True - recurse: True - flatten: True + children: true + recurse: true + flatten: true ''' RETURN = ''' @@ -257,7 +257,7 @@ class AzureRMManagementGroupInfo(AzureRMModuleBase): def to_dict(self, azure_object): if not azure_object: return [] - if azure_object.type == '/providers/Microsoft.Management/managementGroups': + if azure_object.type == 'Microsoft.Management/managementGroups': return_dict = dict( display_name=azure_object.display_name, id=azure_object.id, diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbconfiguration.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbconfiguration.py index 69d6d509a..f00085600 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbconfiguration.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbconfiguration.py @@ -55,12 +55,12 @@ author: ''' EXAMPLES = ''' - - name: Update SQL Server setting - azure_rm_mariadbconfiguration: - resource_group: myResourceGroup - server_name: myServer - name: event_scheduler - value: "ON" +- name: Update SQL Server setting + azure_rm_mariadbconfiguration: + resource_group: myResourceGroup + server_name: myServer + name: event_scheduler + value: "ON" ''' RETURN = ''' @@ -73,13 +73,11 @@ id: gurations/event_scheduler" ''' -import time from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase try: from azure.core.exceptions import ResourceNotFoundError from azure.core.polling import LROPoller - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbconfiguration_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbconfiguration_info.py index a1165d3f7..854d4854e 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbconfiguration_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbconfiguration_info.py @@ -43,16 +43,16 @@ author: ''' EXAMPLES = ''' - - name: Get specific setting of MariaDB Server - azure_rm_mariadbconfiguration_info: - resource_group: myResourceGroup - server_name: testserver - name: deadlock_timeout - - - name: Get all settings of MariaDB Server - azure_rm_mariadbconfiguration_info: - resource_group: myResourceGroup - server_name: server_name +- name: Get specific setting of MariaDB Server + azure_rm_mariadbconfiguration_info: + resource_group: myResourceGroup + server_name: testserver + name: deadlock_timeout + +- name: Get all settings of MariaDB Server + azure_rm_mariadbconfiguration_info: + resource_group: myResourceGroup + server_name: server_name ''' RETURN = ''' @@ -97,9 +97,7 @@ settings: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase try: - from msrestazure.azure_operation import AzureOperationPoller from azure.core.exceptions import ResourceNotFoundError - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbdatabase.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbdatabase.py index d97e1a2dd..60a5fccd4 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbdatabase.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbdatabase.py @@ -22,32 +22,38 @@ options: description: - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. required: True + type: str server_name: description: - The name of the server. required: True + type: str name: description: - The name of the database. required: True + type: str charset: description: - The charset of the database. Check MariaDB documentation for possible values. - This is only set on creation, use I(force_update) to recreate a database if the values don't match. + type: str collation: description: - The collation of the database. Check MariaDB documentation for possible values. - This is only set on creation, use I(force_update) to recreate a database if the values don't match. + type: str force_update: - description: - - When set to C(true), will delete and recreate the existing MariaDB database if any of the properties don't match what is set. - - When set to C(false), no change will occur to the database even if any of the properties do not match. - type: bool - default: 'no' + description: + - When set to C(true), will delete and recreate the existing MariaDB database if any of the properties don't match what is set. + - When set to C(false), no change will occur to the database even if any of the properties do not match. + type: bool + default: 'no' state: description: - Assert the state of the MariaDB Database. Use C(present) to create or update a database and C(absent) to delete it. default: present + type: str choices: - absent - present @@ -62,11 +68,11 @@ author: ''' EXAMPLES = ''' - - name: Create (or update) MariaDB Database - azure_rm_mariadbdatabase: - resource_group: myResourceGroup - server_name: testserver - name: db1 +- name: Create (or update) MariaDB Database + azure_rm_mariadbdatabase: + resource_group: myResourceGroup + server_name: testserver + name: db1 ''' RETURN = ''' @@ -90,7 +96,6 @@ try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from azure.core.exceptions import ResourceNotFoundError from azure.core.polling import LROPoller - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbdatabase_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbdatabase_info.py index 02e005119..4551122bb 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbdatabase_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbdatabase_info.py @@ -43,16 +43,16 @@ author: ''' EXAMPLES = ''' - - name: Get instance of MariaDB Database - azure_rm_mariadbdatabase_info: - resource_group: myResourceGroup - server_name: server_name - name: database_name - - - name: List instances of MariaDB Database - azure_rm_mariadbdatabase_info: - resource_group: myResourceGroup - server_name: server_name +- name: Get instance of MariaDB Database + azure_rm_mariadbdatabase_info: + resource_group: myResourceGroup + server_name: server_name + name: database_name + +- name: List instances of MariaDB Database + azure_rm_mariadbdatabase_info: + resource_group: myResourceGroup + server_name: server_name ''' RETURN = ''' @@ -104,7 +104,6 @@ databases: try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from azure.core.exceptions import ResourceNotFoundError - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbfirewallrule.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbfirewallrule.py index 0424db9f7..f634ab386 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbfirewallrule.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbfirewallrule.py @@ -22,24 +22,30 @@ options: description: - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. required: True + type: str server_name: description: - The name of the server. required: True + type: str name: description: - The name of the MariaDB firewall rule. required: True + type: str start_ip_address: description: - The start IP address of the MariaDB firewall rule. Must be IPv4 format. + type: str end_ip_address: description: - The end IP address of the MariaDB firewall rule. Must be IPv4 format. + type: str state: description: - Assert the state of the MariaDB firewall rule. Use C(present) to create or update a rule and C(absent) to ensure it is not present. default: present + type: str choices: - absent - present @@ -54,13 +60,13 @@ author: ''' EXAMPLES = ''' - - name: Create (or update) MariaDB firewall rule - azure_rm_mariadbfirewallrule: - resource_group: myResourceGroup - server_name: testserver - name: rule1 - start_ip_address: 10.0.0.17 - end_ip_address: 10.0.0.20 +- name: Create (or update) MariaDB firewall rule + azure_rm_mariadbfirewallrule: + resource_group: myResourceGroup + server_name: testserver + name: rule1 + start_ip_address: 10.0.0.17 + end_ip_address: 10.0.0.20 ''' RETURN = ''' @@ -79,7 +85,6 @@ try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from azure.core.exceptions import ResourceNotFoundError from azure.core.polling import LROPoller - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbfirewallrule_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbfirewallrule_info.py index ad7f979c5..5444c2557 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbfirewallrule_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbfirewallrule_info.py @@ -43,16 +43,16 @@ author: ''' EXAMPLES = ''' - - name: Get instance of MariaDB Firewall Rule - azure_rm_mariadbfirewallrule_info: - resource_group: myResourceGroup - server_name: server_name - name: firewall_rule_name - - - name: List instances of MariaDB Firewall Rule - azure_rm_mariadbfirewallrule_info: - resource_group: myResourceGroup - server_name: server_name +- name: Get instance of MariaDB Firewall Rule + azure_rm_mariadbfirewallrule_info: + resource_group: myResourceGroup + server_name: server_name + name: firewall_rule_name + +- name: List instances of MariaDB Firewall Rule + azure_rm_mariadbfirewallrule_info: + resource_group: myResourceGroup + server_name: server_name ''' RETURN = ''' @@ -97,9 +97,7 @@ rules: try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase - from msrestazure.azure_operation import AzureOperationPoller from azure.core.exceptions import ResourceNotFoundError - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbserver.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbserver.py index 3e1b838cc..ed6b423ff 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbserver.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbserver.py @@ -22,20 +22,25 @@ options: description: - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. required: True + type: str name: description: - The name of the server. required: True + type: str sku: description: - The SKU (pricing tier) of the server. + type: dict suboptions: name: description: - The name of the SKU, typically, tier + family + cores, for example C(B_Gen4_1), C(GP_Gen5_8). + type: str tier: description: - The tier of the particular SKU, for example C(Basic). + type: str choices: - basic - standard @@ -49,6 +54,7 @@ options: location: description: - Resource location. If not set, location from the resource group will be used as default. + type: str storage_mb: description: - The maximum storage allowed for a server. @@ -56,9 +62,10 @@ options: version: description: - Server version. + type: str choices: - - 10.2 - - 10.3 + - '10.2' + - '10.3' enforce_ssl: description: - Enable SSL enforcement. @@ -67,17 +74,21 @@ options: admin_username: description: - The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). + type: str admin_password: description: - The password of the administrator login. + type: str create_mode: description: - Create mode of SQL Server. + type: str default: Default state: description: - Assert the state of the MariaDB Server. Use C(present) to create or update a server and C(absent) to delete it. default: present + type: str choices: - absent - present @@ -93,19 +104,19 @@ author: ''' EXAMPLES = ''' - - name: Create (or update) MariaDB Server - azure_rm_mariadbserver: - resource_group: myResourceGroup - name: testserver - sku: - name: B_Gen5_1 - tier: Basic - location: eastus - storage_mb: 1024 - enforce_ssl: True - version: 10.2 - admin_username: cloudsa - admin_password: password +- name: Create (or update) MariaDB Server + azure_rm_mariadbserver: + resource_group: myResourceGroup + name: testserver + sku: + name: B_Gen5_1 + tier: Basic + location: eastus + storage_mb: 1024 + enforce_ssl: true + version: 10.2 + admin_username: cloudsa + admin_password: password ''' RETURN = ''' @@ -141,7 +152,6 @@ try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from azure.core.exceptions import ResourceNotFoundError from azure.core.polling import LROPoller - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbserver_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbserver_info.py index e5aa0c88f..57c80b2b8 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbserver_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mariadbserver_info.py @@ -43,16 +43,16 @@ author: ''' EXAMPLES = ''' - - name: Get instance of MariaDB Server - azure_rm_mariadbserver_info: - resource_group: myResourceGroup - name: server_name +- name: Get instance of MariaDB Server + azure_rm_mariadbserver_info: + resource_group: myResourceGroup + name: server_name - - name: List instances of MariaDB Server - azure_rm_mariadbserver_info: - resource_group: myResourceGroup - tags: - - key:value +- name: List instances of MariaDB Server + azure_rm_mariadbserver_info: + resource_group: myResourceGroup + tags: + - key:value ''' RETURN = ''' @@ -156,7 +156,6 @@ servers: try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from azure.core.exceptions import ResourceNotFoundError - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_monitordiagnosticsetting.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_monitordiagnosticsetting.py index 0f08eff9a..534b41bc5 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_monitordiagnosticsetting.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_monitordiagnosticsetting.py @@ -354,7 +354,7 @@ state: ''' try: - from msrestazure.tools import (parse_resource_id, resource_id) + from azure.mgmt.core.tools import (parse_resource_id, resource_id) from azure.core.polling import LROPoller except ImportError: # This is handled in azure_rm_common diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_monitordiagnosticsetting_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_monitordiagnosticsetting_info.py index f7081ce79..53a971654 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_monitordiagnosticsetting_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_monitordiagnosticsetting_info.py @@ -212,7 +212,7 @@ settings: ''' try: - from msrestazure.tools import (parse_resource_id, resource_id) + from azure.mgmt.core.tools import (parse_resource_id, resource_id) except Exception: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_monitorlogprofile.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_monitorlogprofile.py index a224c1fba..349ec52f5 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_monitorlogprofile.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_monitorlogprofile.py @@ -80,28 +80,28 @@ author: ''' EXAMPLES = ''' - - name: Create a log profile - azure_rm_monitorlogprofile: - name: myProfile - location: eastus - locations: - - eastus - - westus - categories: - - Write - - Action - retention_policy: - enabled: False - days: 1 - storage_account: - resource_group: myResourceGroup - name: myStorageAccount - register: output - - - name: Delete a log profile - azure_rm_monitorlogprofile: - name: myProfile - state: absent +- name: Create a log profile + azure_rm_monitorlogprofile: + name: myProfile + location: eastus + locations: + - eastus + - westus + categories: + - Write + - Action + retention_policy: + enabled: false + days: 1 + storage_account: + resource_group: myResourceGroup + name: myStorageAccount + register: output + +- name: Delete a log profile + azure_rm_monitorlogprofile: + name: myProfile + state: absent ''' RETURN = ''' @@ -114,13 +114,12 @@ id: ''' -import time try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, format_resource_id from azure.core.exceptions import HttpResponseError from azure.core.polling import LROPoller - from msrestazure.tools import is_valid_resource_id + from azure.mgmt.core.tools import is_valid_resource_id from azure.mgmt.monitor.models import (RetentionPolicy, LogProfileResource) except ImportError: # This is handled in azure_rm_common diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_multiplemanageddisks.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_multiplemanageddisks.py index 76a57a659..519a3e38a 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_multiplemanageddisks.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_multiplemanageddisks.py @@ -165,77 +165,77 @@ author: ''' EXAMPLES = ''' - - name: Create managed operating system disks from page blob and attach them to a list of VMs - azure_rm_multiplemanageddisks: - managed_disks: - - name: mymanageddisk1 - location: eastus2 - resource_group: myResourceGroup - create_option: import - source_uri: https://storageaccountname.blob.core.windows.net/containername/blob-name.vhd - storage_account_id: /subscriptions/<uuid>/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/storageaccountname - os_type: windows - storage_account_type: Premium_LRS - - name: mymanageddisk2 - location: eastus2 - resource_group: myResourceGroup - create_option: import - source_uri: https://storageaccountname.blob.core.windows.net/containername/blob-name.vhd - storage_account_id: /subscriptions/<uuid>/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/storageaccountname - os_type: windows - storage_account_type: Premium_LRS - managed_by_extended: - - resource_group: myResourceGroupTest - name: TestVM - - - name: Detach disks from the VMs specified in the list - azure_rm_multiplemanageddisks: - state: absent - managed_disks: - - name: mymanageddisk1 - location: eastus2 - resource_group: myResourceGroup - create_option: import - source_uri: https://storageaccountname.blob.core.windows.net/containername/blob-name.vhd - storage_account_id: /subscriptions/<uuid>/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/storageaccountname - os_type: windows - storage_account_type: Premium_LRS - - name: mymanageddisk2 - location: eastus2 - resource_group: myResourceGroup - create_option: import - source_uri: https://storageaccountname.blob.core.windows.net/containername/blob-name.vhd - storage_account_id: /subscriptions/<uuid>/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/storageaccountname - os_type: windows - storage_account_type: Premium_LRS - managed_by_extended: - - resource_group: myResourceGroupTest - name: TestVM1 - - resource_group: myResourceGroupTest - name: TestVM2 - - - name: Detach managed disks from all VMs without deletion - azure_rm_multiplemanageddisks: - state: present - managed_disks: - - name: mymanageddisk1 - location: eastus2 - resource_group: myResourceGroup - - name: mymanageddisk2 - location: eastus2 - resource_group: myResourceGroup - managed_by_extended: [] - - - name: Detach managed disks from all VMs and delete them - azure_rm_multiplemanageddisks: - state: absent - managed_disks: - - name: mymanageddisk1 - location: eastus2 - resource_group: myResourceGroup - - name: mymanageddisk2 - location: eastus2 - resource_group: myResourceGroup +- name: Create managed operating system disks from page blob and attach them to a list of VMs + azure_rm_multiplemanageddisks: + managed_disks: + - name: mymanageddisk1 + location: eastus2 + resource_group: myResourceGroup + create_option: import + source_uri: https://storageaccountname.blob.core.windows.net/containername/blob-name.vhd + storage_account_id: /subscriptions/<uuid>/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/storageaccountname + os_type: windows + storage_account_type: Premium_LRS + - name: mymanageddisk2 + location: eastus2 + resource_group: myResourceGroup + create_option: import + source_uri: https://storageaccountname.blob.core.windows.net/containername/blob-name.vhd + storage_account_id: /subscriptions/<uuid>/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/storageaccountname + os_type: windows + storage_account_type: Premium_LRS + managed_by_extended: + - resource_group: myResourceGroupTest + name: TestVM + +- name: Detach disks from the VMs specified in the list + azure_rm_multiplemanageddisks: + state: absent + managed_disks: + - name: mymanageddisk1 + location: eastus2 + resource_group: myResourceGroup + create_option: import + source_uri: https://storageaccountname.blob.core.windows.net/containername/blob-name.vhd + storage_account_id: /subscriptions/<uuid>/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/storageaccountname + os_type: windows + storage_account_type: Premium_LRS + - name: mymanageddisk2 + location: eastus2 + resource_group: myResourceGroup + create_option: import + source_uri: https://storageaccountname.blob.core.windows.net/containername/blob-name.vhd + storage_account_id: /subscriptions/<uuid>/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/storageaccountname + os_type: windows + storage_account_type: Premium_LRS + managed_by_extended: + - resource_group: myResourceGroupTest + name: TestVM1 + - resource_group: myResourceGroupTest + name: TestVM2 + +- name: Detach managed disks from all VMs without deletion + azure_rm_multiplemanageddisks: + state: present + managed_disks: + - name: mymanageddisk1 + location: eastus2 + resource_group: myResourceGroup + - name: mymanageddisk2 + location: eastus2 + resource_group: myResourceGroup + managed_by_extended: [] + +- name: Detach managed disks from all VMs and delete them + azure_rm_multiplemanageddisks: + state: absent + managed_disks: + - name: mymanageddisk1 + location: eastus2 + resource_group: myResourceGroup + - name: mymanageddisk2 + location: eastus2 + resource_group: myResourceGroup ''' RETURN = ''' @@ -312,7 +312,7 @@ state: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase try: from azure.core.exceptions import ResourceNotFoundError, AzureError - from msrestazure.tools import parse_resource_id + from azure.mgmt.core.tools import parse_resource_id import time except ImportError: # This is handled in azure_rm_common @@ -456,7 +456,7 @@ class AzureRMMultipleManagedDisk(AzureRMModuleBase): if create_option == 'import': creation_data['create_option'] = self.compute_models.DiskCreateOption.import_enum creation_data['source_uri'] = source_uri - creation_data['source_account_id'] = storage_account_id + creation_data['storage_account_id'] = storage_account_id elif create_option == 'copy': creation_data['create_option'] = self.compute_models.DiskCreateOption.copy creation_data['source_resource_id'] = source_uri diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqlconfiguration.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqlconfiguration.py index 6f4f477ab..9137f591b 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqlconfiguration.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqlconfiguration.py @@ -21,21 +21,26 @@ options: description: - The name of the resource group that contains the resource. required: True + type: str server_name: description: - The name of the server. required: True + type: str name: description: - The name of the server configuration. required: True + type: str value: description: - Value of the configuration. + type: str state: description: - Assert the state of the MySQL configuration. Use C(present) to update setting, or C(absent) to reset to default value. default: present + type: str choices: - absent - present @@ -49,12 +54,12 @@ author: ''' EXAMPLES = ''' - - name: Update SQL Server setting - azure_rm_mysqlconfiguration: - resource_group: myResourceGroup - server_name: myServer - name: event_scheduler - value: "ON" +- name: Update SQL Server setting + azure_rm_mysqlconfiguration: + resource_group: myResourceGroup + server_name: myServer + name: event_scheduler + value: "ON" ''' RETURN = ''' @@ -67,13 +72,10 @@ id: gurations/event_scheduler" ''' -import time - try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from azure.core.exceptions import ResourceNotFoundError from azure.core.polling import LROPoller - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqlconfiguration_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqlconfiguration_info.py index 48fa416a4..f6cd01ea9 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqlconfiguration_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqlconfiguration_info.py @@ -41,16 +41,16 @@ author: ''' EXAMPLES = ''' - - name: Get specific setting of MySQL Server - azure_rm_mysqlconfiguration_info: - resource_group: myResourceGroup - server_name: testmysqlserver - name: deadlock_timeout - - - name: Get all settings of MySQL Server - azure_rm_mysqlconfiguration_info: - resource_group: myResourceGroup - server_name: server_name +- name: Get specific setting of MySQL Server + azure_rm_mysqlconfiguration_info: + resource_group: myResourceGroup + server_name: testmysqlserver + name: deadlock_timeout + +- name: Get all settings of MySQL Server + azure_rm_mysqlconfiguration_info: + resource_group: myResourceGroup + server_name: server_name ''' RETURN = ''' @@ -95,9 +95,7 @@ settings: try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase - from msrestazure.azure_operation import AzureOperationPoller from azure.core.exceptions import ResourceNotFoundError - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqldatabase.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqldatabase.py index 09f28fc02..a8caa1745 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqldatabase.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqldatabase.py @@ -21,22 +21,27 @@ options: description: - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. required: True + type: str server_name: description: - The name of the server. required: True + type: str name: description: - The name of the database. required: True + type: str charset: description: - The charset of the database. Check MySQL documentation for possible values. - This is only set on creation, use I(force_update) to recreate a database if the values don't match. + type: str collation: description: - The collation of the database. Check MySQL documentation for possible values. - This is only set on creation, use I(force_update) to recreate a database if the values don't match. + type: str force_update: description: - When set to C(true), will delete and recreate the existing MySQL database if any of the properties don't match what is set. @@ -47,6 +52,7 @@ options: description: - Assert the state of the MySQL Database. Use C(present) to create or update a database and C(absent) to delete it. default: present + type: str choices: - absent - present @@ -60,11 +66,11 @@ author: ''' EXAMPLES = ''' - - name: Create (or update) MySQL Database - azure_rm_mysqldatabase: - resource_group: myResourceGroup - server_name: testserver - name: db1 +- name: Create (or update) MySQL Database + azure_rm_mysqldatabase: + resource_group: myResourceGroup + server_name: testserver + name: db1 ''' RETURN = ''' @@ -88,7 +94,6 @@ try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from azure.core.exceptions import ResourceNotFoundError from azure.core.polling import LROPoller - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqldatabase_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqldatabase_info.py index 9c53a686a..db2cb8cdf 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqldatabase_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqldatabase_info.py @@ -41,16 +41,16 @@ author: ''' EXAMPLES = ''' - - name: Get instance of MySQL Database - azure_rm_mysqldatabase_info: - resource_group: myResourceGroup - server_name: server_name - name: database_name - - - name: List instances of MySQL Database - azure_rm_mysqldatabase_info: - resource_group: myResourceGroup - server_name: server_name +- name: Get instance of MySQL Database + azure_rm_mysqldatabase_info: + resource_group: myResourceGroup + server_name: server_name + name: database_name + +- name: List instances of MySQL Database + azure_rm_mysqldatabase_info: + resource_group: myResourceGroup + server_name: server_name ''' RETURN = ''' @@ -102,8 +102,6 @@ databases: try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from azure.core.exceptions import ResourceNotFoundError - from azure.core.polling import LROPoller - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqlfirewallrule.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqlfirewallrule.py index ef5765718..a17e8cc1f 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqlfirewallrule.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqlfirewallrule.py @@ -21,26 +21,32 @@ options: description: - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. required: True + type: str server_name: description: - The name of the server. required: True + type: str name: description: - The name of the MySQL firewall rule. required: True + type: str start_ip_address: description: - The start IP address of the MySQL firewall rule. Must be IPv4 format. - required: True + - Required when creating. + type: str end_ip_address: description: - The end IP address of the MySQL firewall rule. Must be IPv4 format. - required: True + - Required when creating. + type: str state: description: - Assert the state of the MySQL firewall rule. Use C(present) to create or update a rule and C(absent) to ensure it is not present. default: present + type: str choices: - absent - present @@ -54,13 +60,13 @@ author: ''' EXAMPLES = ''' - - name: Create (or update) MySQL firewall rule - azure_rm_mysqlfirewallrule: - resource_group: myResourceGroup - server_name: testserver - name: rule1 - start_ip_address: 10.0.0.17 - end_ip_address: 10.0.0.20 +- name: Create (or update) MySQL firewall rule + azure_rm_mysqlfirewallrule: + resource_group: myResourceGroup + server_name: testserver + name: rule1 + start_ip_address: 10.0.0.17 + end_ip_address: 10.0.0.20 ''' RETURN = ''' @@ -79,7 +85,6 @@ try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from azure.core.exceptions import ResourceNotFoundError from azure.core.polling import LROPoller - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass @@ -125,6 +130,7 @@ class AzureRMMySqlFirewallRule(AzureRMModuleBase): self.start_ip_address = None self.end_ip_address = None + required_if = [('state', 'present', ['start_ip_address', 'end_ip_address'])] self.results = dict(changed=False) self.state = None self.parameters = dict() @@ -132,6 +138,7 @@ class AzureRMMySqlFirewallRule(AzureRMModuleBase): super(AzureRMMySqlFirewallRule, self).__init__(derived_arg_spec=self.module_arg_spec, supports_check_mode=True, + required_if=required_if, supports_tags=False) def exec_module(self, **kwargs): diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqlfirewallrule_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqlfirewallrule_info.py index 5bc8c1aff..9ee597780 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqlfirewallrule_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqlfirewallrule_info.py @@ -41,16 +41,16 @@ author: ''' EXAMPLES = ''' - - name: Get instance of MySQL Firewall Rule - azure_rm_mysqlfirewallrule_info: - resource_group: myResourceGroup - server_name: server_name - name: firewall_rule_name - - - name: List instances of MySQL Firewall Rule - azure_rm_mysqlfirewallrule_info: - resource_group: myResourceGroup - server_name: server_name +- name: Get instance of MySQL Firewall Rule + azure_rm_mysqlfirewallrule_info: + resource_group: myResourceGroup + server_name: server_name + name: firewall_rule_name + +- name: List instances of MySQL Firewall Rule + azure_rm_mysqlfirewallrule_info: + resource_group: myResourceGroup + server_name: server_name ''' RETURN = ''' @@ -95,9 +95,7 @@ rules: try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase - from msrestazure.azure_operation import AzureOperationPoller from azure.core.exceptions import ResourceNotFoundError - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqlserver.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqlserver.py index 49bfee6a6..f972f29a8 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqlserver.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqlserver.py @@ -132,23 +132,23 @@ author: ''' EXAMPLES = ''' - - name: Create (or update) MySQL Server - azure_rm_mysqlserver: - resource_group: myResourceGroup - name: testserver - sku: - name: B_Gen5_1 - tier: Basic - location: eastus - storage_profile: - storage_mb: 51200 - backup_retention_days: 7 - geo_redundant_backup: Disabled - storage_autogrow: Disabled - enforce_ssl: True - version: 5.7 - admin_username: cloudsa - admin_password: password +- name: Create (or update) MySQL Server + azure_rm_mysqlserver: + resource_group: myResourceGroup + name: testserver + sku: + name: B_Gen5_1 + tier: Basic + location: eastus + storage_profile: + storage_mb: 51200 + backup_retention_days: 7 + geo_redundant_backup: Disabled + storage_autogrow: Disabled + enforce_ssl: true + version: 5.7 + admin_username: cloudsa + admin_password: password ''' RETURN = ''' @@ -184,7 +184,6 @@ try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from azure.core.exceptions import ResourceNotFoundError from azure.core.polling import LROPoller - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqlserver_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqlserver_info.py index 503219cb8..4a0b91c00 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqlserver_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_mysqlserver_info.py @@ -41,16 +41,16 @@ author: ''' EXAMPLES = ''' - - name: Get instance of MySQL Server - azure_rm_mysqlserver_info: - resource_group: myResourceGroup - name: server_name - tags: - - key +- name: Get instance of MySQL Server + azure_rm_mysqlserver_info: + resource_group: myResourceGroup + name: server_name + tags: + - key - - name: List instances of MySQL Server - azure_rm_mysqlserver_info: - resource_group: myResourceGroup +- name: List instances of MySQL Server + azure_rm_mysqlserver_info: + resource_group: myResourceGroup ''' RETURN = ''' @@ -178,7 +178,6 @@ servers: try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from azure.core.exceptions import ResourceNotFoundError - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_natgateway.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_natgateway.py index e4dd46ade..e53f4fddf 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_natgateway.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_natgateway.py @@ -94,7 +94,7 @@ EXAMPLES = """ name: myNATGateway idle_timeout_in_minutes: 10 location: eastus - zones: [ 1 ] + zones: [1] sku: name: standard """ @@ -132,7 +132,7 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError from azure.core.polling import LROPoller - from msrestazure.tools import parse_resource_id, is_valid_resource_id + from azure.mgmt.core.tools import parse_resource_id, is_valid_resource_id except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_natgateway_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_natgateway_info.py index 262dd2d99..27271303a 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_natgateway_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_natgateway_info.py @@ -33,17 +33,17 @@ author: ''' EXAMPLES = ''' - - name: Get facts for NAT gateway by name. - azure_rm_natgateway_info: - name: Mynatgw - resource_group: MyResourceGroup +- name: Get facts for NAT gateway by name. + azure_rm_natgateway_info: + name: Mynatgw + resource_group: MyResourceGroup - - name: Get facts for all NAT gateways in resource group. - azure_rm_natgateway_info: - resource_group: MyResourceGroup +- name: Get facts for all NAT gateways in resource group. + azure_rm_natgateway_info: + resource_group: MyResourceGroup - - name: Get facts for all NAT gateways. - azure_rm_natgateway_info: +- name: Get facts for all NAT gateways. + azure_rm_natgateway_info: ''' RETURN = ''' @@ -114,7 +114,7 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError - from msrestazure.tools import parse_resource_id + from azure.mgmt.core.tools import parse_resource_id except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_networkinterface.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_networkinterface.py index bd988f06a..bb17132d4 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_networkinterface.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_networkinterface.py @@ -30,21 +30,25 @@ options: description: - Name of a resource group where the network interface exists or will be created. required: true + type: str name: description: - Name of the network interface. required: true + type: str state: description: - Assert the state of the network interface. Use C(present) to create or update an interface and C(absent) to delete an interface. default: present + type: str choices: - absent - present location: description: - Valid Azure location. Defaults to location of the resource group. + type: str virtual_network: description: - An existing virtual network with which the network interface will be associated. Required when creating a network interface. @@ -52,22 +56,25 @@ options: - Make sure your virtual network is in the same resource group as NIC when you give only the name. - It can be the virtual network's resource id. - It can be a dict which contains I(name) and I(resource_group) of the virtual network. + - Required when creating. + type: raw aliases: - virtual_network_name - required: true subnet_name: description: - Name of an existing subnet within the specified virtual network. Required when creating a network interface. - Use the C(virtual_network)'s resource group. + - Required when creating. aliases: - subnet - required: true + type: str os_type: description: - Determines any rules to be added to a default security group. - When creating a network interface, if no security group name is provided, a default security group will be created. - If the I(os_type=Windows), a rule allowing RDP access will be added. - If the I(os_type=Linux), a rule allowing SSH access will be added. + type: str choices: - Windows - Linux @@ -76,6 +83,7 @@ options: description: - (Deprecate) Valid IPv4 address that falls within the specified subnet. - This option will be deprecated in 2.9, use I(ip_configurations) instead. + type: str private_ip_allocation_method: description: - (Deprecate) Whether or not the assigned IP address is permanent. @@ -83,6 +91,7 @@ options: - You can update the allocation method to C(Static) after a dynamic private IP address has been assigned. - This option will be deprecated in 2.9, use I(ip_configurations) instead. default: Dynamic + type: str choices: - Dynamic - Static @@ -97,6 +106,7 @@ options: description: - (Deprecate) Name of an existing public IP address object to associate with the security group. - This option will be deprecated in 2.9, use I(ip_configurations) instead. + type: str aliases: - public_ip_address - public_ip_name @@ -105,6 +115,7 @@ options: - (Deprecate) If a I(public_ip_address_name) is not provided, a default public IP address will be created. - The allocation method determines whether or not the public IP address assigned to the network interface is permanent. - This option will be deprecated in 2.9, use I(ip_configurations) instead. + type: str choices: - Dynamic - Static @@ -113,17 +124,23 @@ options: description: - List of IP configurations. Each configuration object should include field I(private_ip_address), I(private_ip_allocation_method), I(public_ip_address_name), I(public_ip), I(public_ip_allocation_method), I(name). + type: list + elements: dict + default: [] suboptions: name: description: - Name of the IP configuration. required: true + type: str private_ip_address: description: - Private IP address for the IP configuration. + type: str private_ip_address_version: description: - The version of the IP configuration. + type: str choices: - IPv4 - IPv6 @@ -131,6 +148,7 @@ options: private_ip_allocation_method: description: - Private IP allocation method. + type: str choices: - Dynamic - Static @@ -138,12 +156,14 @@ options: public_ip_address_name: description: - Name of the public IP address. None for disable IP address. + type: str aliases: - public_ip_address - public_ip_name public_ip_allocation_method: description: - Public IP allocation method. + type: str choices: - Dynamic - Static @@ -153,11 +173,15 @@ options: - List of existing load-balancer backend address pools to associate with the network interface. - Can be written as a resource ID. - Also can be a dict of I(name) and I(load_balancer). + type: list + elements: raw application_gateway_backend_address_pools: description: - List of existing application gateway backend address pools to associate with the network interface. - Can be written as a resource ID. - Also can be a dict of I(name) and I(application_gateway). + type: list + elements: raw version_added: "1.10.0" primary: description: @@ -169,6 +193,8 @@ options: description: - List of application security groups in which the IP configuration is included. - Element of the list could be a resource id of application security group, or dict of I(resource_group) and I(name). + type: list + elements: raw enable_accelerated_networking: description: - Whether the network interface should be created with the accelerated networking feature or not. @@ -190,11 +216,14 @@ options: - It can be a dict contains security_group's I(name) and I(resource_group). aliases: - security_group_name + type: raw open_ports: description: - When a default security group is created for a Linux host a rule will be added allowing inbound TCP connections to the default SSH port C(22), and for a Windows host rules will be added allowing inbound access to RDP ports C(3389) and C(5986). Override the default ports by providing a list of open ports. + type: list + elements: str enable_ip_forwarding: description: - Whether to enable IP forwarding. @@ -207,6 +236,7 @@ options: - Which DNS servers should the NIC lookup. - List of IP addresses. type: list + elements: str extends_documentation_fragment: - azure.azcollection.azure - azure.azcollection.azure_tags @@ -218,123 +248,123 @@ author: ''' EXAMPLES = ''' - - name: Create a network interface with minimal parameters - azure_rm_networkinterface: - name: nic001 - resource_group: myResourceGroup - virtual_network: vnet001 - subnet_name: subnet001 - ip_configurations: - - name: ipconfig1 - public_ip_address_name: publicip001 - primary: True - - - name: Create a network interface with private IP address only (no Public IP) - azure_rm_networkinterface: - name: nic001 - resource_group: myResourceGroup - virtual_network: vnet001 - subnet_name: subnet001 - create_with_security_group: False - ip_configurations: - - name: ipconfig1 - primary: True - - - name: Create a network interface for use in a Windows host (opens RDP port) with custom RDP port - azure_rm_networkinterface: - name: nic002 - resource_group: myResourceGroup - virtual_network: vnet001 - subnet_name: subnet001 - os_type: Windows - rdp_port: 3399 - security_group: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurit - yGroups/nsg001" - ip_configurations: - - name: ipconfig1 - public_ip_address_name: publicip001 - primary: True - - - name: Create a network interface using existing security group and public IP - azure_rm_networkinterface: - name: nic003 - resource_group: myResourceGroup - virtual_network: vnet001 - subnet_name: subnet001 - security_group: secgroup001 - ip_configurations: - - name: ipconfig1 - public_ip_address_name: publicip001 - primary: True - - - name: Create a network with multiple ip configurations - azure_rm_networkinterface: - name: nic004 - resource_group: myResourceGroup - subnet_name: subnet001 - virtual_network: vnet001 - security_group: - name: testnic002 - resource_group: Testing1 - ip_configurations: - - name: ipconfig1 - public_ip_address_name: publicip001 - primary: True - - name: ipconfig2 - load_balancer_backend_address_pools: - - "{{ loadbalancer001.state.backend_address_pools[0].id }}" - - name: backendaddrpool1 - load_balancer: loadbalancer001 - - - name: Create network interface attached to application gateway backend address pool - azure_rm_networkinterface: - name: nic-appgw - resource_group: myResourceGroup - virtual_network: vnet001 - subnet_name: subnet001 - create_with_security_group: false - public_ip: false - ip_configurations: - - name: default - primary: true - application_gateway_backend_address_pools: - - name: myApplicationGatewayBackendAddressPool - application_gateway: myApplicationGateway - - - name: Create a network interface in accelerated networking mode - azure_rm_networkinterface: - name: nic005 - resource_group: myResourceGroup - virtual_network_name: vnet001 - subnet_name: subnet001 - enable_accelerated_networking: True - - - name: Create a network interface with IP forwarding - azure_rm_networkinterface: - name: nic001 - resource_group: myResourceGroup - virtual_network: vnet001 - subnet_name: subnet001 - ip_forwarding: True - ip_configurations: - - name: ipconfig1 - public_ip_address_name: publicip001 - primary: True - - - name: Create a network interface with dns servers - azure_rm_networkinterface: - name: nic009 - resource_group: myResourceGroup - virtual_network: vnet001 - subnet_name: subnet001 - dns_servers: - - 8.8.8.8 - - - name: Delete network interface - azure_rm_networkinterface: - resource_group: myResourceGroup - name: nic003 - state: absent +- name: Create a network interface with minimal parameters + azure_rm_networkinterface: + name: nic001 + resource_group: myResourceGroup + virtual_network: vnet001 + subnet_name: subnet001 + ip_configurations: + - name: ipconfig1 + public_ip_address_name: publicip001 + primary: true + +- name: Create a network interface with private IP address only (no Public IP) + azure_rm_networkinterface: + name: nic001 + resource_group: myResourceGroup + virtual_network: vnet001 + subnet_name: subnet001 + create_with_security_group: false + ip_configurations: + - name: ipconfig1 + primary: true + +- name: Create a network interface for use in a Windows host (opens RDP port) with custom RDP port + azure_rm_networkinterface: + name: nic002 + resource_group: myResourceGroup + virtual_network: vnet001 + subnet_name: subnet001 + os_type: Windows + rdp_port: 3399 + security_group: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurit + yGroups/nsg001" + ip_configurations: + - name: ipconfig1 + public_ip_address_name: publicip001 + primary: true + +- name: Create a network interface using existing security group and public IP + azure_rm_networkinterface: + name: nic003 + resource_group: myResourceGroup + virtual_network: vnet001 + subnet_name: subnet001 + security_group: secgroup001 + ip_configurations: + - name: ipconfig1 + public_ip_address_name: publicip001 + primary: true + +- name: Create a network with multiple ip configurations + azure_rm_networkinterface: + name: nic004 + resource_group: myResourceGroup + subnet_name: subnet001 + virtual_network: vnet001 + security_group: + name: testnic002 + resource_group: Testing1 + ip_configurations: + - name: ipconfig1 + public_ip_address_name: publicip001 + primary: true + - name: ipconfig2 + load_balancer_backend_address_pools: + - "{{ loadbalancer001.state.backend_address_pools[0].id }}" + - name: backendaddrpool1 + load_balancer: loadbalancer001 + +- name: Create network interface attached to application gateway backend address pool + azure_rm_networkinterface: + name: nic-appgw + resource_group: myResourceGroup + virtual_network: vnet001 + subnet_name: subnet001 + create_with_security_group: false + public_ip: false + ip_configurations: + - name: default + primary: true + application_gateway_backend_address_pools: + - name: myApplicationGatewayBackendAddressPool + application_gateway: myApplicationGateway + +- name: Create a network interface in accelerated networking mode + azure_rm_networkinterface: + name: nic005 + resource_group: myResourceGroup + virtual_network_name: vnet001 + subnet_name: subnet001 + enable_accelerated_networking: true + +- name: Create a network interface with IP forwarding + azure_rm_networkinterface: + name: nic001 + resource_group: myResourceGroup + virtual_network: vnet001 + subnet_name: subnet001 + ip_forwarding: true + ip_configurations: + - name: ipconfig1 + public_ip_address_name: publicip001 + primary: true + +- name: Create a network interface with dns servers + azure_rm_networkinterface: + name: nic009 + resource_group: myResourceGroup + virtual_network: vnet001 + subnet_name: subnet001 + dns_servers: + - 8.8.8.8 + +- name: Delete network interface + azure_rm_networkinterface: + resource_group: myResourceGroup + name: nic003 + state: absent ''' RETURN = ''' @@ -485,7 +515,7 @@ state: ''' try: - from msrestazure.tools import parse_resource_id, resource_id, is_valid_resource_id + from azure.mgmt.core.tools import resource_id, is_valid_resource_id from azure.core.exceptions import ResourceNotFoundError except ImportError: # This is handled in azure_rm_common @@ -565,8 +595,8 @@ ip_configuration_spec = dict( private_ip_allocation_method=dict(type='str', choices=['Dynamic', 'Static'], default='Dynamic'), public_ip_address_name=dict(type='str', aliases=['public_ip_address', 'public_ip_name']), public_ip_allocation_method=dict(type='str', choices=['Dynamic', 'Static'], default='Dynamic'), - load_balancer_backend_address_pools=dict(type='list'), - application_gateway_backend_address_pools=dict(type='list'), + load_balancer_backend_address_pools=dict(type='list', elements='raw'), + application_gateway_backend_address_pools=dict(type='list', elements='raw'), primary=dict(type='bool', default=False), application_security_groups=dict(type='list', elements='raw') ) @@ -591,11 +621,11 @@ class AzureRMNetworkInterface(AzureRMModuleBase): subnet_name=dict(type='str', aliases=['subnet']), virtual_network=dict(type='raw', aliases=['virtual_network_name']), public_ip_allocation_method=dict(type='str', choices=['Dynamic', 'Static'], default='Dynamic'), - ip_configurations=dict(type='list', default=None, elements='dict', options=ip_configuration_spec), + ip_configurations=dict(type='list', default=[], elements='dict', options=ip_configuration_spec), os_type=dict(type='str', choices=['Windows', 'Linux'], default='Linux'), - open_ports=dict(type='list'), + open_ports=dict(type='list', elements='str'), enable_ip_forwarding=dict(type='bool', aliases=['ip_forwarding'], default=False), - dns_servers=dict(type='list'), + dns_servers=dict(type='list', elements='str'), ) required_if = [ diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_networkinterface_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_networkinterface_info.py index 10b55c6fc..deeb2c8c6 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_networkinterface_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_networkinterface_info.py @@ -24,9 +24,11 @@ options: name: description: - Only show results for a specific network interface. + type: str resource_group: description: - Name of the resource group containing the network interface(s). Required when searching by name. + type: str tags: description: - Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. @@ -43,21 +45,21 @@ author: ''' EXAMPLES = ''' - - name: Get facts for one network interface - azure_rm_networkinterface_info: - resource_group: myResourceGroup - name: nic001 - - - name: Get network interfaces within a resource group - azure_rm_networkinterface_info: - resource_group: myResourceGroup - - - name: Get network interfaces by tag - azure_rm_networkinterface_info: - resource_group: myResourceGroup - tags: - - testing - - foo:bar +- name: Get facts for one network interface + azure_rm_networkinterface_info: + resource_group: myResourceGroup + name: nic001 + +- name: Get network interfaces within a resource group + azure_rm_networkinterface_info: + resource_group: myResourceGroup + +- name: Get network interfaces by tag + azure_rm_networkinterface_info: + resource_group: myResourceGroup + tags: + - testing + - foo:bar ''' RETURN = ''' @@ -111,61 +113,79 @@ networkinterfaces: id: description: - Id of the network interface. + type: str resource_group: description: - Name of a resource group where the network interface exists. + type: str name: description: - Name of the network interface. + type: str location: description: - Azure location. + type: str virtual_network: description: - An existing virtual network with which the network interface will be associated. - It is a dict which contains I(name) and I(resource_group) of the virtual network. + type: raw subnet: description: - Name of an existing subnet within the specified virtual network. + type: str tags: description: - Tags of the network interface. + type: dict ip_configurations: description: - List of IP configurations, if contains multiple configurations. + type: complex contains: name: description: - Name of the IP configuration. + type: str private_ip_address: description: - Private IP address for the IP configuration. + type: list private_ip_allocation_method: description: - Private IP allocation method. + type: str public_ip_address: description: - Name of the public IP address. None for disable IP address. + type: str public_ip_allocation_method: description: - Public IP allocation method. + type: str load_balancer_backend_address_pools: description: - List of existing load-balancer backend address pools associated with the network interface. + type: list application_gateway_backend_address_pools: description: - List of existing application gateway backend address pools associated with the network interface. version_added: "1.10.0" + type: list primary: description: - Whether the IP configuration is the primary one in the list. + type: bool application_security_groups: description: - List of Application security groups. - sample: /subscriptions/<subsid>/resourceGroups/<rg>/providers/Microsoft.Network/applicationSecurityGroups/myASG + type: list + sample: ['/subscriptions/<subsid>/resourceGroups/<rg>/providers/Microsoft.Network/applicationSecurityGroups/myASG'] enable_accelerated_networking: description: - Specifies whether the network interface should be created with the accelerated networking feature or not. + type: bool create_with_security_group: description: - Specifies whether a default security group should be be created with the NIC. Only applies when creating a new NIC. @@ -173,40 +193,49 @@ networkinterfaces: security_group: description: - A security group resource ID with which to associate the network interface. + type: str enable_ip_forwarding: description: - Whether to enable IP forwarding + type: bool dns_servers: description: - Which DNS servers should the NIC lookup. - List of IP addresses. + type: list mac_address: description: - The MAC address of the network interface. + type: str provisioning_state: description: - The provisioning state of the network interface. + type: str dns_settings: description: - The DNS settings in network interface. + type: complex contains: dns_servers: description: - List of DNS servers IP addresses. + type: list applied_dns_servers: description: - If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs. + type: list internal_dns_name_label: description: - Relative DNS name for this NIC used for internal communications between VMs in the same virtual network. + type: str internal_fqdn: description: - Fully qualified DNS name supporting internal communications between VMs in the same virtual network. + type: str ''' # NOQA try: from azure.core.exceptions import ResourceNotFoundError - from azure.common import AzureMissingResourceHttpError, AzureHttpError except Exception: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_notificationhub.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_notificationhub.py index 53c07cc81..dca1f0dfa 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_notificationhub.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_notificationhub.py @@ -68,7 +68,7 @@ EXAMPLES = ''' namespace_name: myNamespace name: myhub tags: - - a: b + - a: b sku: free - name: Delete Notification Hub @@ -83,7 +83,7 @@ EXAMPLES = ''' location: eastus namespace_name: myNamespace tags: - - a: b + - a: b sku: free - name: Delete Notification Hub Namespace @@ -91,7 +91,6 @@ EXAMPLES = ''' resource_group: testgroupans namespace_name: myNamespace state: absent - ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_notificationhub_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_notificationhub_info.py index 5ab211c6d..b3635768d 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_notificationhub_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_notificationhub_info.py @@ -41,11 +41,10 @@ author: EXAMPLES = ''' - - name: Get facts of specific notification hub - community.azure.azure_rm_notificationhub_info: - resource_group: myResourceGroup - name: myNotificationHub - +- name: Get facts of specific notification hub + community.azure.azure_rm_notificationhub_info: + resource_group: myResourceGroup + name: myNotificationHub ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_openshiftmanagedcluster.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_openshiftmanagedcluster.py index cffee5ceb..cc579c998 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_openshiftmanagedcluster.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_openshiftmanagedcluster.py @@ -41,7 +41,6 @@ options: description: - Pull secret for the cluster (immutable). type: str - default: "" domain: description: - The domain for the cluster (immutable). @@ -105,6 +104,7 @@ options: description: - Configuration for OpenShift worker Vms. type: list + elements: dict suboptions: name: description: name of the worker profile (immutable). @@ -157,6 +157,7 @@ options: description: - Ingress profiles configuration. only one profile is supported at the current API version. type: list + elements: dict suboptions: visibility: description: @@ -198,34 +199,34 @@ author: ''' EXAMPLES = ''' - - name: Create openshift cluster - azure_rm_openshiftmanagedcluster: - resource_group: "myResourceGroup" - name: "myCluster" - location: "eastus" - cluster_profile: - cluster_resource_group_id: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/clusterResourceGroup" - domain: "mydomain" - service_principal_profile: - client_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" - client_secret: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - network_profile: - pod_cidr: "10.128.0.0/14" - service_cidr: "172.30.0.0/16" - worker_profiles: - - vm_size : "Standard_D4s_v3" - subnet_id : "/subscriptions/xx-xx-xx-xx-xx/resourceGroups/myResourceGroup/Microsoft.Network/virtualNetworks/myVnet/subnets/worker" - disk_size : 128 - count : 3 - master_profile: - vm_size : "Standard_D8s_v3" - subnet_id: "/subscriptions/xx-xx-xx-xx-xx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/master" - - name: Delete OpenShift Managed Cluster - azure_rm_openshiftmanagedcluster: - resource_group: myResourceGroup - name: myCluster - location: eastus - state: absent +- name: Create openshift cluster + azure_rm_openshiftmanagedcluster: + resource_group: "myResourceGroup" + name: "myCluster" + location: "eastus" + cluster_profile: + cluster_resource_group_id: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/clusterResourceGroup" + domain: "mydomain" + service_principal_profile: + client_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + client_secret: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + network_profile: + pod_cidr: "10.128.0.0/14" + service_cidr: "172.30.0.0/16" + worker_profiles: + - vm_size: "Standard_D4s_v3" + subnet_id: "/subscriptions/xx-xx-xx-xx-xx/resourceGroups/myResourceGroup/Microsoft.Network/virtualNetworks/myVnet/subnets/worker" + disk_size: 128 + count: 3 + master_profile: + vm_size: "Standard_D8s_v3" + subnet_id: "/subscriptions/xx-xx-xx-xx-xx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/master" +- name: Delete OpenShift Managed Cluster + azure_rm_openshiftmanagedcluster: + resource_group: myResourceGroup + name: myCluster + location: eastus + state: absent ''' RETURN = ''' @@ -400,11 +401,6 @@ import json import random from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBaseExt from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_rest import GenericRestClient -try: - from msrestazure.azure_exceptions import CloudError -except ImportError: - # this is handled in azure_rm_common - pass class Actions: @@ -526,6 +522,7 @@ class AzureRMOpenShiftManagedClusters(AzureRMModuleBaseExt): ), worker_profiles=dict( type='list', + elements='dict', disposition='/properties/workerProfiles', options=dict( name=dict( @@ -587,6 +584,7 @@ class AzureRMOpenShiftManagedClusters(AzureRMModuleBaseExt): ), ingress_profiles=dict( type='list', + elements='dict', disposition='/properties/ingressProfiles', options=dict( name=dict( @@ -653,6 +651,7 @@ class AzureRMOpenShiftManagedClusters(AzureRMModuleBaseExt): response = None self.mgmt_client = self.get_mgmt_svc_client(GenericRestClient, + is_track2=True, base_url=self._cloud_environment.endpoints.resource_manager) self.url = ('/subscriptions' + @@ -753,14 +752,14 @@ class AzureRMOpenShiftManagedClusters(AzureRMModuleBaseExt): self.status_code, 600, 30) - except CloudError as exc: + except Exception as exc: self.log('Error attempting to create the OpenShiftManagedCluster instance.') self.fail('Error creating the OpenShiftManagedCluster instance: {0}' '\n{1}'.format(str(self.body), str(exc))) try: - response = json.loads(response.text) + response = json.loads(response.body()) except Exception: - response = {'text': response.text} + response = {'text': response.context['deserialized_data']} pass return response @@ -776,7 +775,7 @@ class AzureRMOpenShiftManagedClusters(AzureRMModuleBaseExt): self.status_code, 600, 30) - except CloudError as e: + except Exception as e: self.log('Error attempting to delete the OpenShiftManagedCluster instance.') self.fail('Error deleting the OpenShiftManagedCluster instance: {0}'.format(str(e))) @@ -795,11 +794,11 @@ class AzureRMOpenShiftManagedClusters(AzureRMModuleBaseExt): 600, 30) found = True - response = json.loads(response.text) + response = json.loads(response.body()) found = True self.log("Response : {0}".format(response)) # self.log("OpenShiftManagedCluster instance : {0} found".format(response.name)) - except CloudError as e: + except Exception as e: self.log('Did not find the OpenShiftManagedCluster instance.') if found is True: return response diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_openshiftmanagedcluster_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_openshiftmanagedcluster_info.py index 0070bd0d3..ed359c641 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_openshiftmanagedcluster_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_openshiftmanagedcluster_info.py @@ -211,16 +211,9 @@ properties: sample: Public ''' -import time import json -import random from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBaseExt from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_rest import GenericRestClient -try: - from msrestazure.azure_exceptions import CloudError -except ImportError: - # this is handled in azure_rm_common - pass class Actions: @@ -261,6 +254,7 @@ class AzureRMOpenShiftManagedClustersInfo(AzureRMModuleBaseExt): setattr(self, key, kwargs[key]) self.mgmt_client = self.get_mgmt_svc_client(GenericRestClient, + is_track2=True, base_url=self._cloud_environment.endpoints.resource_manager) if (self.resource_group is not None and self.name is not None): @@ -296,9 +290,9 @@ class AzureRMOpenShiftManagedClustersInfo(AzureRMModuleBaseExt): self.status_code, 600, 30) - results = json.loads(response.text) + results = json.loads(response.body()) # self.log('Response : {0}'.format(response)) - except CloudError as e: + except Exception as e: self.log('Could not get info for @(Model.ModuleOperationNameUpper).') return {} @@ -327,9 +321,9 @@ class AzureRMOpenShiftManagedClustersInfo(AzureRMModuleBaseExt): self.status_code, 600, 30) - results = json.loads(response.text) + results = json.loads(response.body()) # self.log('Response : {0}'.format(response)) - except CloudError as e: + except Exception as e: self.log('Could not get info for @(Model.ModuleOperationNameUpper).') return [self.format_item(x) for x in results['value']] if results['value'] else [] @@ -354,9 +348,9 @@ class AzureRMOpenShiftManagedClustersInfo(AzureRMModuleBaseExt): self.status_code, 600, 30) - results = json.loads(response.text) + results = json.loads(response.body()) # self.log('Response : {0}'.format(response)) - except CloudError as e: + except Exception as e: self.log('Could not get info for @(Model.ModuleOperationNameUpper).') return results # return [self.format_item(x) for x in results['value']] if results['value'] else [] diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqlconfiguration.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqlconfiguration.py index 4d95b5b71..65d3bf060 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqlconfiguration.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqlconfiguration.py @@ -21,21 +21,26 @@ options: description: - The name of the resource group that contains the resource. required: True + type: str server_name: description: - The name of the server. required: True + type: str name: description: - Setting name. required: True + type: str value: description: - Setting value. + type: str state: description: - Assert the state of the PostgreSQL setting. Use C(present) to update setting, or C(absent) to reset to default value. default: present + type: str choices: - absent - present @@ -49,12 +54,12 @@ author: ''' EXAMPLES = ''' - - name: Update PostgreSQL Server setting - azure_rm_postgresqlconfiguration: - resource_group: myResourceGroup - server_name: myServer - name: deadlock_timeout - value: 2000 +- name: Update PostgreSQL Server setting + azure_rm_postgresqlconfiguration: + resource_group: myResourceGroup + server_name: myServer + name: deadlock_timeout + value: 2000 ''' RETURN = ''' @@ -67,11 +72,8 @@ id: gurations/event_scheduler" ''' -import time - try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase - from msrest.serialization import Model from azure.core.exceptions import ResourceNotFoundError from azure.core.polling import LROPoller except ImportError: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqlconfiguration_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqlconfiguration_info.py index 38a97cccb..38f3a9f42 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqlconfiguration_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqlconfiguration_info.py @@ -41,16 +41,16 @@ author: ''' EXAMPLES = ''' - - name: Get specific setting of PostgreSQL configuration - azure_rm_postgresqlconfiguration_info: - resource_group: myResourceGroup - server_name: testpostgresqlserver - name: deadlock_timeout - - - name: Get all settings of PostgreSQL Configuration - azure_rm_postgresqlconfiguration_info: - resource_group: myResourceGroup - server_name: testpostgresqlserver +- name: Get specific setting of PostgreSQL configuration + azure_rm_postgresqlconfiguration_info: + resource_group: myResourceGroup + server_name: testpostgresqlserver + name: deadlock_timeout + +- name: Get all settings of PostgreSQL Configuration + azure_rm_postgresqlconfiguration_info: + resource_group: myResourceGroup + server_name: testpostgresqlserver ''' RETURN = ''' @@ -96,8 +96,6 @@ settings: try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from azure.core.exceptions import ResourceNotFoundError - from msrestazure.azure_operation import AzureOperationPoller - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqldatabase.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqldatabase.py index 4c54e6db7..78520e94a 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqldatabase.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqldatabase.py @@ -21,22 +21,27 @@ options: description: - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. required: True + type: str server_name: description: - The name of the server. required: True + type: str name: description: - The name of the database. required: True + type: str charset: description: - The charset of the database. Check PostgreSQL documentation for possible values. - This is only set on creation, use I(force_update) to recreate a database if the values don't match. + type: str collation: description: - The collation of the database. Check PostgreSQL documentation for possible values. - This is only set on creation, use I(force_update) to recreate a database if the values don't match. + type: str force_update: description: - When set to C(true), will delete and recreate the existing PostgreSQL database if any of the properties don't match what is set. @@ -47,6 +52,7 @@ options: description: - Assert the state of the PostgreSQL database. Use C(present) to create or update a database and C(absent) to delete it. default: present + type: str choices: - absent - present @@ -60,11 +66,11 @@ author: ''' EXAMPLES = ''' - - name: Create (or update) PostgreSQL Database - azure_rm_postgresqldatabase: - resource_group: myResourceGroup - server_name: testserver - name: db1 +- name: Create (or update) PostgreSQL Database + azure_rm_postgresqldatabase: + resource_group: myResourceGroup + server_name: testserver + name: db1 ''' RETURN = ''' @@ -87,10 +93,8 @@ import time try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase - from azure.mgmt.rdbms.postgresql import PostgreSQLManagementClient from azure.core.exceptions import ResourceNotFoundError from azure.core.polling import LROPoller - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqldatabase_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqldatabase_info.py index d70fbd54b..471344e64 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqldatabase_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqldatabase_info.py @@ -41,16 +41,16 @@ author: ''' EXAMPLES = ''' - - name: Get instance of PostgreSQL Database - azure_rm_postgresqldatabase_info: - resource_group: myResourceGroup - server_name: server_name - name: database_name - - - name: List instances of PostgreSQL Database - azure_rm_postgresqldatabase_info: - resource_group: myResourceGroup - server_name: server_name +- name: Get instance of PostgreSQL Database + azure_rm_postgresqldatabase_info: + resource_group: myResourceGroup + server_name: server_name + name: database_name + +- name: List instances of PostgreSQL Database + azure_rm_postgresqldatabase_info: + resource_group: myResourceGroup + server_name: server_name ''' RETURN = ''' @@ -102,7 +102,6 @@ databases: try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from azure.core.exceptions import ResourceNotFoundError - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqlfirewallrule.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqlfirewallrule.py index 4eb702e19..54de3ce6b 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqlfirewallrule.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqlfirewallrule.py @@ -21,23 +21,29 @@ options: description: - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. required: True + type: str server_name: description: - The name of the server. required: True + type: str name: description: - The name of the PostgreSQL firewall rule. required: True + type: str start_ip_address: description: - The start IP address of the PostgreSQL firewall rule. Must be IPv4 format. + type: str end_ip_address: description: - The end IP address of the PostgreSQL firewall rule. Must be IPv4 format. + type: str state: description: - Assert the state of the PostgreSQL firewall rule. Use C(present) to create or update a PostgreSQL firewall rule and C(absent) to delete it. + type: str default: present choices: - absent @@ -52,13 +58,13 @@ author: ''' EXAMPLES = ''' - - name: Create (or update) PostgreSQL firewall rule - azure_rm_postgresqlfirewallrule: - resource_group: myResourceGroup - server_name: testserver - name: rule1 - start_ip_address: 10.0.0.16 - end_ip_address: 10.0.0.18 +- name: Create (or update) PostgreSQL firewall rule + azure_rm_postgresqlfirewallrule: + resource_group: myResourceGroup + server_name: testserver + name: rule1 + start_ip_address: 10.0.0.16 + end_ip_address: 10.0.0.18 ''' RETURN = ''' @@ -77,7 +83,6 @@ try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from azure.core.exceptions import ResourceNotFoundError from azure.core.polling import LROPoller - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqlfirewallrule_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqlfirewallrule_info.py index 578fe6576..e2dc889df 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqlfirewallrule_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqlfirewallrule_info.py @@ -41,16 +41,16 @@ author: ''' EXAMPLES = ''' - - name: Get instance of PostgreSQL Firewall Rule - azure_rm_postgresqlfirewallrule_info: - resource_group: myResourceGroup - server_name: server_name - name: firewall_rule_name - - - name: List instances of PostgreSQL Firewall Rule - azure_rm_postgresqlfirewallrule_info: - resource_group: myResourceGroup - server_name: server_name +- name: Get instance of PostgreSQL Firewall Rule + azure_rm_postgresqlfirewallrule_info: + resource_group: myResourceGroup + server_name: server_name + name: firewall_rule_name + +- name: List instances of PostgreSQL Firewall Rule + azure_rm_postgresqlfirewallrule_info: + resource_group: myResourceGroup + server_name: server_name ''' RETURN = ''' @@ -96,7 +96,6 @@ rules: try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from azure.core.exceptions import ResourceNotFoundError - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqlserver.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqlserver.py index 524050565..ab9022905 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqlserver.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqlserver.py @@ -128,19 +128,19 @@ author: ''' EXAMPLES = ''' - - name: Create (or update) PostgreSQL Server - azure_rm_postgresqlserver: - resource_group: myResourceGroup - name: testserver - sku: - name: B_Gen5_1 - tier: Basic - location: eastus - storage_mb: 1024 - enforce_ssl: True - storage_autogrow: True - admin_username: cloudsa - admin_password: password +- name: Create (or update) PostgreSQL Server + azure_rm_postgresqlserver: + resource_group: myResourceGroup + name: testserver + sku: + name: B_Gen5_1 + tier: Basic + location: eastus + storage_mb: 1024 + enforce_ssl: true + storage_autogrow: true + admin_username: cloudsa + admin_password: password ''' RETURN = ''' @@ -176,7 +176,6 @@ try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from azure.core.exceptions import ResourceNotFoundError from azure.core.polling import LROPoller - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqlserver_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqlserver_info.py index 159148e34..04f5edf82 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqlserver_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_postgresqlserver_info.py @@ -41,16 +41,16 @@ author: ''' EXAMPLES = ''' - - name: Get instance of PostgreSQL Server - azure_rm_postgresqlserver_info: - resource_group: myResourceGroup - name: server_name +- name: Get instance of PostgreSQL Server + azure_rm_postgresqlserver_info: + resource_group: myResourceGroup + name: server_name - - name: List instances of PostgreSQL Server - azure_rm_postgresqlserver_info: - resource_group: myResourceGroup - tags: - - key +- name: List instances of PostgreSQL Server + azure_rm_postgresqlserver_info: + resource_group: myResourceGroup + tags: + - key ''' RETURN = ''' @@ -168,7 +168,6 @@ servers: try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from azure.core.exceptions import ResourceNotFoundError - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privatednsrecordset.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privatednsrecordset.py index ca998d1ff..3560139e7 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privatednsrecordset.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privatednsrecordset.py @@ -133,9 +133,9 @@ EXAMPLES = ''' record_type: "{{ item.type }}" records: "{{ item.records }}" with_items: - - { name: 'servera', type: 'A', records: [ { entry: '10.10.10.20' }, { entry: '10.10.10.21' }] } - - { name: 'serverb', type: 'A', records: [ { entry: '10.10.10.30' }, { entry: '10.10.10.41' }] } - - { name: 'serverc', type: 'A', records: [ { entry: '10.10.10.40' }, { entry: '10.10.10.41' }] } + - {name: 'servera', type: 'A', records: [{ entry: '10.10.10.20'}, {entry: '10.10.10.21'}]} + - {name: 'serverb', type: 'A', records: [{ entry: '10.10.10.30'}, {entry: '10.10.10.41'}]} + - {name: 'serverc', type: 'A', records: [{ entry: '10.10.10.40'}, {entry: '10.10.10.41'}]} - name: create SRV records in a new record set azure_rm_privatednsrecordset: @@ -145,10 +145,10 @@ EXAMPLES = ''' time_to_live: 7200 record_type: SRV records: - - entry: sip.testing.com - priority: 20 - weight: 10 - port: 5060 + - entry: sip.testing.com + priority: 20 + weight: 10 + port: 5060 - name: create PTR record in a new record set azure_rm_privatednsrecordset: @@ -157,7 +157,7 @@ EXAMPLES = ''' zone_name: testing.com record_type: PTR records: - - entry: servera.testing.com + - entry: servera.testing.com - name: create TXT record in a new record set azure_rm_privatednsrecordset: @@ -166,7 +166,7 @@ EXAMPLES = ''' zone_name: testing.com record_type: TXT records: - - entry: 'v=spf1 a -all' + - entry: 'v=spf1 a -all' - name: Update SOA record azure_rm_privatednsrecordset: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privatednszone.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privatednszone.py index 4a84cdbce..0dfa133e9 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privatednszone.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privatednszone.py @@ -61,7 +61,6 @@ EXAMPLES = ''' resource_group: myResourceGroup name: example.com state: absent - ''' RETURN = ''' @@ -81,8 +80,7 @@ state: ''' -from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, format_resource_id -from ansible.module_utils._text import to_native +from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase try: from azure.core.exceptions import ResourceNotFoundError diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privatednszone_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privatednszone_info.py index 5a5730e4c..3b5cbbca0 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privatednszone_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privatednszone_info.py @@ -111,7 +111,6 @@ privatednszones: ''' from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase -from ansible.module_utils._text import to_native try: from azure.core.exceptions import ResourceNotFoundError diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privatednszonelink.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privatednszonelink.py index b87b54a6b..65168ea6b 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privatednszonelink.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privatednszonelink.py @@ -156,7 +156,7 @@ state: ''' from ansible.module_utils.basic import _load_params -from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, HAS_AZURE, \ +from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, \ format_resource_id try: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privateendpoint_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privateendpoint_info.py index dbf39e969..bddf2a098 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privateendpoint_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privateendpoint_info.py @@ -42,19 +42,19 @@ author: ''' EXAMPLES = ''' - - name: Get facts for one private endpoint - azure_rm_privateendpoint_info: - resource_group: myResourceGroup - name: testprivateendpoint +- name: Get facts for one private endpoint + azure_rm_privateendpoint_info: + resource_group: myResourceGroup + name: testprivateendpoint - - name: Get all private endpoint under the resource group - azure_rm_privateendpoint_info: - resource_group: myResourceGroup +- name: Get all private endpoint under the resource group + azure_rm_privateendpoint_info: + resource_group: myResourceGroup - - name: Get all private endpoint under subscription - azure_rm_virtualnetwork_info: - tags: - - key1:value1 +- name: Get all private endpoint under subscription + azure_rm_virtualnetwork_info: + tags: + - key1:value1 ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privateendpointdnszonegroup.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privateendpointdnszonegroup.py index 1d5480de3..7c2af8402 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privateendpointdnszonegroup.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privateendpointdnszonegroup.py @@ -182,7 +182,7 @@ state: ''' try: - from msrestazure.tools import resource_id + from azure.mgmt.core.tools import resource_id from azure.core.exceptions import ResourceNotFoundError from azure.core.polling import LROPoller except ImportError: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privatelinkservice.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privatelinkservice.py index 611adb161..a87302b1c 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privatelinkservice.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_privatelinkservice.py @@ -141,7 +141,7 @@ EXAMPLES = ''' azure_rm_privatelinkservice: name: linkservice-name resource_group: myResourceGroup - enable_proxy_protocol: True + enable_proxy_protocol: true fqdns: - 'dns01.com' - 'dns02.com' @@ -154,18 +154,18 @@ EXAMPLES = ''' - xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - yyyyyy-yyyyy-yyyy-yyyy-yyyyyyyyyyy load_balancer_frontend_ip_configurations: - - id: load_balancer_frontend_ip_configurations_id + - id: load_balancer_frontend_ip_configurations_id ip_configurations: - name: testSubnet properties: - primary: False + primary: false private_ip_allocation_method: 'Dynamic' private_ip_address_version: 'IPv4' subnet: id: subnet_id - name: subnetfredprivate-1 properties: - primary: True + primary: true private_ip_allocation_method: 'Static' private_ip_address_version: 'IPv4' subnet: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_proximityplacementgroup.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_proximityplacementgroup.py index da68e776e..7852c1dcf 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_proximityplacementgroup.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_proximityplacementgroup.py @@ -121,8 +121,7 @@ state: ''' from ansible.module_utils.basic import _load_params -from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, HAS_AZURE, \ - format_resource_id, normalize_location_name +from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, normalize_location_name try: from azure.core.exceptions import ResourceNotFoundError diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_publicipaddress.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_publicipaddress.py index 45fc9c807..4d6cf341c 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_publicipaddress.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_publicipaddress.py @@ -27,10 +27,12 @@ options: description: - Name of resource group with which the Public IP is associated. required: true + type: str allocation_method: description: - Control whether the assigned Public IP remains permanently assigned to the object. - If not set to C(Static), the IP address may changed anytime an associated virtual machine is power cycled. + type: str choices: - dynamic - static @@ -41,27 +43,32 @@ options: description: - The customizable portion of the FQDN assigned to public IP address. This is an explicit setting. - If no value is provided, any existing value will be removed on an existing public IP. + type: str aliases: - domain_name_label name: description: - Name of the Public IP. + type: str required: true state: description: - Assert the state of the Public IP. Use C(present) to create or update a and C(absent) to delete. default: present + type: str choices: - absent - present location: description: - Valid Azure location. Defaults to location of the resource group. + type: str sku: description: - The public IP address SKU. - When I(version=ipv6), if I(sku=standard) then set I(allocation_method=static). - When I(version=ipv4), if I(sku=standard) then set I(allocation_method=static). + type: str choices: - basic - standard @@ -71,13 +78,19 @@ options: description: - List of IpTag associated with the public IP address. - Each element should contain type:value pair. + type: list + elements: dict suboptions: type: description: - Sets the ip_tags type. + type: str + required: true value: description: - Sets the ip_tags value. + type: str + required: true idle_timeout: description: - Idle timeout in minutes. @@ -85,6 +98,7 @@ options: version: description: - The public IP address version. + type: str choices: - ipv4 - ipv6 @@ -109,18 +123,18 @@ author: ''' EXAMPLES = ''' - - name: Create a public ip address - azure_rm_publicipaddress: - resource_group: myResourceGroup - name: my_public_ip - allocation_method: static - domain_name: foobar - - - name: Delete public ip - azure_rm_publicipaddress: - resource_group: myResourceGroup - name: my_public_ip - state: absent +- name: Create a public ip address + azure_rm_publicipaddress: + resource_group: myResourceGroup + name: my_public_ip + allocation_method: static + domain_name: foobar + +- name: Delete public ip + azure_rm_publicipaddress: + resource_group: myResourceGroup + name: my_public_ip + state: absent ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_publicipaddress_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_publicipaddress_info.py index 63c670529..0c2798c7b 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_publicipaddress_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_publicipaddress_info.py @@ -24,9 +24,11 @@ options: name: description: - Only show results for a specific Public IP. + type: str resource_group: description: - Limit results by resource group. Required when using name parameter. + type: str tags: description: - Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. @@ -42,16 +44,16 @@ author: ''' EXAMPLES = ''' - - name: Get facts for one Public IP - azure_rm_publicipaddress_info: - resource_group: myResourceGroup - name: publicip001 - - - name: Get facts for all Public IPs within a resource groups - azure_rm_publicipaddress_info: - resource_group: myResourceGroup - tags: - - key:value +- name: Get facts for one Public IP + azure_rm_publicipaddress_info: + resource_group: myResourceGroup + name: publicip001 + +- name: Get facts for all Public IPs within a resource groups + azure_rm_publicipaddress_info: + resource_group: myResourceGroup + tags: + - key:value ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_recoveryservicesvault.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_recoveryservicesvault.py index d793e75bd..b2c45b2d5 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_recoveryservicesvault.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_recoveryservicesvault.py @@ -49,18 +49,18 @@ author: ''' EXAMPLES = ''' - - name: Create/Update Azure Recovery Service vault - azure_rm_recoveryservicesvault: - resource_group: 'myResourceGroup' - name: 'testVault' - location: 'westeurope' - state: 'present' - - name: Delete Recovery Service Vault - azure_rm_recoveryservicesvault: - resource_group: 'myResourceGroup' - name: 'testVault' - location: 'westeurope' - state: 'absent' +- name: Create/Update Azure Recovery Service vault + azure_rm_recoveryservicesvault: + resource_group: 'myResourceGroup' + name: 'testVault' + location: 'westeurope' + state: 'present' +- name: Delete Recovery Service Vault + azure_rm_recoveryservicesvault: + resource_group: 'myResourceGroup' + name: 'testVault' + location: 'westeurope' + state: 'absent' ''' RETURN = ''' @@ -121,9 +121,7 @@ response: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_rest import GenericRestClient from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBaseExt -import re import json -import time class AzureRMRecoveryServicesVault(AzureRMModuleBaseExt): @@ -210,6 +208,7 @@ class AzureRMRecoveryServicesVault(AzureRMModuleBaseExt): response = None self.mgmt_client = self.get_mgmt_svc_client(GenericRestClient, + is_track2=True, base_url=self._cloud_environment.endpoints.resource_manager) old_response = self.get_resource() @@ -249,9 +248,9 @@ class AzureRMRecoveryServicesVault(AzureRMModuleBaseExt): self.fail('Error in creating Azure Recovery Service Vault {0}'.format(str(e))) try: - response = json.loads(response.text) + response = json.loads(response.body()) except Exception: - response = {'text': response.text} + response = {'text': response.context['deserialized_data']} return response @@ -272,12 +271,6 @@ class AzureRMRecoveryServicesVault(AzureRMModuleBaseExt): self.log('Error attempting to delete Azure Recovery Service Vault.') self.fail('Error while deleting Azure Recovery Service Vault: {0}'.format(str(e))) - try: - response = json.loads(response.text) - except Exception: - response = {'text': response.text} - return response - def get_resource(self): # self.log('Get Recovery Service Vault Name {0}'.format(self.)) found = False @@ -296,7 +289,7 @@ class AzureRMRecoveryServicesVault(AzureRMModuleBaseExt): except Exception as e: self.log('Recovery Service Vault Does not exist.') if found is True: - response = json.loads(response.text) + response = json.loads(response.body()) return response else: return False diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_recoveryservicesvault_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_recoveryservicesvault_info.py index e7f2a6192..6b2dee776 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_recoveryservicesvault_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_recoveryservicesvault_info.py @@ -34,10 +34,10 @@ author: ''' EXAMPLES = ''' - - name: Get Azure Recovery Services Vault Details. - azure_rm_recoveryservicesvault_info: - resource_group: 'myResourceGroup' - name: 'testVault' +- name: Get Azure Recovery Services Vault Details. + azure_rm_recoveryservicesvault_info: + resource_group: 'myResourceGroup' + name: 'testVault' ''' RETURN = ''' @@ -98,9 +98,7 @@ response: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_rest import GenericRestClient from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBaseExt -import re import json -import time class AzureRMRecoveryServicesVaultInfo(AzureRMModuleBaseExt): @@ -162,6 +160,7 @@ class AzureRMRecoveryServicesVaultInfo(AzureRMModuleBaseExt): response = None self.mgmt_client = self.get_mgmt_svc_client(GenericRestClient, + is_track2=True, base_url=self._cloud_environment.endpoints.resource_manager) changed = True @@ -190,9 +189,9 @@ class AzureRMRecoveryServicesVaultInfo(AzureRMModuleBaseExt): self.fail('Error in fetching Azure Recovery Service Vault Details {0}'.format(str(e))) try: - response = json.loads(response.text) + response = json.loads(response.body()) except Exception: - response = {'text': response.text} + response = {'text': response.context['deserialized_data']} return response diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_rediscache.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_rediscache.py index e004eb056..b93a52992 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_rediscache.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_rediscache.py @@ -21,31 +21,39 @@ options: description: - Name of the resource group to which the resource belongs. required: True + type: str name: description: - Unique name of the Azure Cache for Redis to create or update. required: True + type: str location: description: - Resource location. If not set, location from the resource group will be used as default. + type: str sku: description: - SKU info of Azure Cache for Redis. + type: dict + required: true suboptions: name: description: - Type of Azure Cache for Redis to deploy. + type: str + required: true choices: - basic - standard - premium - required: True size: description: - Size of Azure Cache for Redis to deploy. - When I(sku=basic) or I(sku=standard), allowed values are C(C0), C(C1), C(C2), C(C3), C(C4), C(C5), C(C6). - When I(sku=premium), allowed values are C(P1), C(P2), C(P3), C(P4). - Please see U(https://docs.microsoft.com/en-us/rest/api/redis/redis/create#sku) for allowed values. + type: str + required: true choices: - C0 - C1 @@ -58,7 +66,6 @@ options: - P2 - P3 - P4 - required: True enable_non_ssl_port: description: - When set I(enable_non_ssl_port=true), the non-ssl Redis server port 6379 will be enabled. @@ -68,14 +75,17 @@ options: description: - Configures the amount of memory in MB that is reserved to accommodate for memory fragmentation. - Please see U(https://docs.microsoft.com/en-us/azure/redis-cache/cache-configure#advanced-settings) for more detail. + type: int maxmemory_reserved: description: - Configures the amount of memory in MB that is reserved for non-cache operations. - Please see U(https://docs.microsoft.com/en-us/azure/redis-cache/cache-configure#advanced-settings) for more detail. + type: int maxmemory_policy: description: - Configures the eviction policy of the cache. - Please see U(https://docs.microsoft.com/en-us/azure/redis-cache/cache-configure#advanced-settings) for more detail. + type: str choices: - volatile_lru - allkeys_lru @@ -122,6 +132,7 @@ options: static_ip: description: - Static IP address. Required when deploying an Azure Cache for Redis inside an existing Azure virtual network. + type: str subnet: description: - Subnet in a virtual network to deploy the Azure Cache for Redis in. @@ -131,6 +142,7 @@ options: - I(name). Name of the subnet. - I(resource_group). Resource group name of the subnet. - I(virtual_network_name). Name of virtual network to which this subnet belongs. + type: raw tenant_settings: description: - Dict of tenant settings. @@ -138,26 +150,29 @@ options: reboot: description: - Reboot specified Redis node(s). There can be potential data loss. + type: dict suboptions: shard_id: description: - If clustering is enabled, the id of the shard to be rebooted. - type: int + type: str reboot_type: description: - Which Redis node(s) to reboot. + type: str choices: - primary - secondary - all - default: all regenerate_key: description: - Regenerate Redis cache's access keys. + type: dict suboptions: key_type: description: - The Redis key to regenerate. + type: str choices: - primary - secondary @@ -170,13 +185,14 @@ options: type: bool default: True state: - description: - - Assert the state of the Azure Cache for Redis. - - Use C(present) to create or update an Azure Cache for Redis and C(absent) to delete it. - default: present - choices: - - absent - - present + description: + - Assert the state of the Azure Cache for Redis. + - Use C(present) to create or update an Azure Cache for Redis and C(absent) to delete it. + default: present + type: str + choices: + - absent + - present extends_documentation_fragment: - azure.azcollection.azure @@ -193,8 +209,8 @@ EXAMPLES = ''' resource_group: myResourceGroup name: myRedis sku: - name: basic - size: C1 + name: basic + size: C1 - name: Scale up the Azure Cache for Redis azure_rm_rediscache: @@ -251,7 +267,6 @@ import time try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from azure.core.exceptions import ResourceNotFoundError - from msrestazure.azure_operation import AzureOperationPoller from azure.core.polling import LROPoller from azure.mgmt.redis import RedisManagementClient from azure.mgmt.redis.models import ( @@ -265,9 +280,11 @@ except ImportError: sku_spec = dict( name=dict( type='str', + required=True, choices=['basic', 'standard', 'premium']), size=dict( type='str', + required=True, choices=['C0', 'C1', 'C2', 'C3', 'C4', 'C5', 'C6', 'P1', 'P2', 'P3', 'P4'] ) ) @@ -362,6 +379,7 @@ class AzureRMRedisCaches(AzureRMModuleBase): ), sku=dict( type='dict', + required=True, options=sku_spec ), enable_non_ssl_port=dict( @@ -651,7 +669,7 @@ class AzureRMRedisCaches(AzureRMModuleBase): name=self.name, parameters=params) - if isinstance(response, AzureOperationPoller) or isinstance(response, LROPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) if self.wait_for_provisioning: @@ -692,7 +710,7 @@ class AzureRMRedisCaches(AzureRMModuleBase): response = self._client.redis.update(resource_group_name=self.resource_group, name=self.name, parameters=params) - if isinstance(response, AzureOperationPoller) or isinstance(response, LROPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) if self.wait_for_provisioning: @@ -758,7 +776,7 @@ class AzureRMRedisCaches(AzureRMModuleBase): response = self._client.redis.force_reboot(resource_group_name=self.resource_group, name=self.name, parameters=params) - if isinstance(response, AzureOperationPoller) or isinstance(response, LROPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) if self.wait_for_provisioning: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_rediscache_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_rediscache_info.py index fec05cd77..44e47f4d5 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_rediscache_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_rediscache_info.py @@ -24,9 +24,11 @@ options: description: - The resource group to search for the desired Azure Cache for Redis. required: True + type: str name: description: - Limit results to a specific Azure Cache for Redis. + type: str return_access_keys: description: - Indicate weather to return access keys of the Azure Cache for Redis. @@ -46,20 +48,20 @@ author: ''' EXAMPLES = ''' - - name: Get Azure Cache for Redis by name - azure_rm_rediscache_info: - resource_group: myResourceGroup - name: myRedis - - - name: Get Azure Cache for Redis with access keys by name - azure_rm_rediscache_info: - resource_group: myResourceGroup - name: myRedis - return_access_keys: true - - - name: Get Azure Cache for Redis in specific resource group - azure_rm_rediscache_info: - resource_group: myResourceGroup +- name: Get Azure Cache for Redis by name + azure_rm_rediscache_info: + resource_group: myResourceGroup + name: myRedis + +- name: Get Azure Cache for Redis with access keys by name + azure_rm_rediscache_info: + resource_group: myResourceGroup + name: myRedis + return_access_keys: true + +- name: Get Azure Cache for Redis in specific resource group + azure_rm_rediscache_info: + resource_group: myResourceGroup ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_rediscachefirewallrule.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_rediscachefirewallrule.py index 921f982a6..67b2c90b6 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_rediscachefirewallrule.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_rediscachefirewallrule.py @@ -21,30 +21,36 @@ options: description: - Name of the resource group to which the resource belongs. required: True + type: str cache_name: description: - Name of the Azure Cache for Redis. required: True + type: str name: description: - Name of the Firewall rule. required: True + type: str start_ip_address: description: - The start IP address of the Azure Cache for Redis Firewall rule. Must be IPv4 format. - Required when creating Firewall rule. + type: str end_ip_address: description: - The end IP address of the Azure Cache for Redis Firewall rule. Must be IPv4 format. - Required when creating Firewall rule. + type: str state: - description: - - Assert the state of the Firewall rule of Azure Cache for Redis. - - Use C(present) to create or update Firewall rule of Azure Cache for Redis and C(absent) to delete it. - default: present - choices: - - absent - - present + description: + - Assert the state of the Firewall rule of Azure Cache for Redis. + - Use C(present) to create or update Firewall rule of Azure Cache for Redis and C(absent) to delete it. + default: present + type: str + choices: + - absent + - present extends_documentation_fragment: - azure.azcollection.azure @@ -55,20 +61,20 @@ author: ''' EXAMPLES = ''' - - name: Create a Firewall rule for Azure Cache for Redis - azure_rm_rediscachefirewallrule: - resource_group: myResourceGroup - cache_name: myRedisCache - name: myRule - start_ip_address: 192.168.1.1 - end_ip_address: 192.168.1.4 - - - name: Update a Firewall rule for Azure Cache for Redis - azure_rm_rediscachefirewallrule: - resource_group: myResourceGroup - cache_name: myRedisCache - name: myRule - end_ip_address: 192.168.1.5 +- name: Create a Firewall rule for Azure Cache for Redis + azure_rm_rediscachefirewallrule: + resource_group: myResourceGroup + cache_name: myRedisCache + name: myRule + start_ip_address: 192.168.1.1 + end_ip_address: 192.168.1.4 + +- name: Update a Firewall rule for Azure Cache for Redis + azure_rm_rediscachefirewallrule: + resource_group: myResourceGroup + cache_name: myRedisCache + name: myRule + end_ip_address: 192.168.1.5 ''' RETURN = ''' @@ -80,12 +86,9 @@ id: sample: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Cache/redis/myRedis/firewallRules/myRule" ''' -import time - try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from azure.core.polling import LROPoller - from msrestazure.azure_operation import AzureOperationPoller from azure.core.exceptions import ResourceNotFoundError from azure.mgmt.redis import RedisManagementClient from azure.mgmt.redis.models import ( @@ -261,7 +264,7 @@ class AzureRMRedisCacheFirewallRule(AzureRMModuleBase): cache_name=self.cache_name, rule_name=self.name, parameters=params) - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) except Exception as exc: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_registrationassignment.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_registrationassignment.py index b895d8883..a70542f80 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_registrationassignment.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_registrationassignment.py @@ -54,27 +54,26 @@ author: ''' EXAMPLES = ''' - - name: Delete Registration Assignment - azure_rm_registrationassignment: - scope: subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - registration_assignment_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - state: absent +- name: Delete Registration Assignment + azure_rm_registrationassignment: + scope: subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + registration_assignment_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + state: absent - - name: Create Registration Assignment in subscription level - azure_rm_registrationassignment: - scope: subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - registration_assignment_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - properties: - registration_definition_id: /subscriptions/xxx-xxx/providers/Microsoft.ManagedServices/registrationDefinitions/xxx-xxx +- name: Create Registration Assignment in subscription level + azure_rm_registrationassignment: + scope: subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + registration_assignment_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + properties: + registration_definition_id: /subscriptions/xxx-xxx/providers/Microsoft.ManagedServices/registrationDefinitions/xxx-xxx - - name: Create Registration Assignment in resourcegroup level with randomly generating registration_assignment_id - azure_rm_registrationassignment: - scope: subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup - properties: - registration_definition_id: /subscriptions/xxx-xxx/providers/Microsoft.ManagedServices/registrationDefinitions/xxx-xxx - +- name: Create Registration Assignment in resourcegroup level with randomly generating registration_assignment_id + azure_rm_registrationassignment: + scope: subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup + properties: + registration_definition_id: /subscriptions/xxx-xxx/providers/Microsoft.ManagedServices/registrationDefinitions/xxx-xxx ''' RETURN = ''' @@ -120,7 +119,6 @@ import uuid from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBaseExt try: from azure.mgmt.managedservices import ManagedServicesClient - from msrestazure.azure_operation import AzureOperationPoller from azure.core.polling import LROPoller except ImportError: # This is handled in azure_rm_common @@ -238,7 +236,7 @@ class AzureRMRegistrationAssignment(AzureRMModuleBaseExt): response = self.mgmt_client.registration_assignments.begin_create_or_update(scope=self.scope, registration_assignment_id=self.registration_assignment_id, request_body=self.body) - if isinstance(response, AzureOperationPoller) or isinstance(response, LROPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) except Exception as exc: self.log('Error attempting to create the RegistrationAssignment instance.') diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_registrationassignment_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_registrationassignment_info.py index 60003a192..ef8875f7c 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_registrationassignment_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_registrationassignment_info.py @@ -34,17 +34,15 @@ author: ''' EXAMPLES = ''' - - name: Get Registration Assignment - azure_rm_registrationassignment_info: - registration_assignment_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - scope: subscription/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup - - - - name: Get All Registration Assignments in scope(subscription) - azure_rm_registrationassignment_info: - scope: subscription/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx +- name: Get Registration Assignment + azure_rm_registrationassignment_info: + registration_assignment_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + scope: subscription/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup +- name: Get All Registration Assignments in scope(subscription) + azure_rm_registrationassignment_info: + scope: subscription/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx ''' RETURN = ''' @@ -89,10 +87,7 @@ registration_assignments: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBase try: - from msrestazure.azure_exceptions import CloudError from azure.mgmt.managedservices import ManagedServicesClient - from msrestazure.azure_operation import AzureOperationPoller - from msrest.polling import LROPoller except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_registrationdefinition.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_registrationdefinition.py index 9daaf9980..0d89da3a9 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_registrationdefinition.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_registrationdefinition.py @@ -106,34 +106,33 @@ author: ''' EXAMPLES = ''' - - name: Create Registration Definition without scope - azure_rm_registrationdefinition: - registration_definition_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - properties: - description: test - authorizations: - - principal_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - role_definition_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - managed_by_tenant_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - registration_definition_name: def4 - - - name: Create Registration Definition with scope - azure_rm_registrationdefinition: - scope: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - registration_definition_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - properties: - description: test - authorizations: - - principal_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - role_definition_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - managed_by_tenant_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - registration_definition_name: def5 - - - name: Delete Registration Definition - azure_rm_registrationdefinition: - registration_definition_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - state: absent - +- name: Create Registration Definition without scope + azure_rm_registrationdefinition: + registration_definition_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + properties: + description: test + authorizations: + - principal_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + role_definition_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + managed_by_tenant_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + registration_definition_name: def4 + +- name: Create Registration Definition with scope + azure_rm_registrationdefinition: + scope: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + registration_definition_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + properties: + description: test + authorizations: + - principal_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + role_definition_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + managed_by_tenant_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + registration_definition_name: def5 + +- name: Delete Registration Definition + azure_rm_registrationdefinition: + registration_definition_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + state: absent ''' RETURN = ''' @@ -241,7 +240,6 @@ import uuid from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBaseExt try: from azure.mgmt.managedservices import ManagedServicesClient - from msrestazure.azure_operation import AzureOperationPoller from azure.core.polling import LROPoller except ImportError: # This is handled in azure_rm_common @@ -411,7 +409,7 @@ class AzureRMRegistrationDefinition(AzureRMModuleBaseExt): scope=self.scope, request_body=self.body) - if isinstance(response, AzureOperationPoller) or isinstance(response, LROPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) except Exception as exc: self.log('Error attempting to create the RegistrationDefinition instance.') diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_registrationdefinition_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_registrationdefinition_info.py index 3c8fabe95..1c095420c 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_registrationdefinition_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_registrationdefinition_info.py @@ -33,17 +33,16 @@ author: ''' EXAMPLES = ''' - - name: Get Registration Definition - azure_rm_registrationdefinition_info: - registration_definition_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx +- name: Get Registration Definition + azure_rm_registrationdefinition_info: + registration_definition_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - - name: Get All Registration Definitions from AzureRMAuth's subscription - azure_rm_registrationdefinition_info: - - - name: Get All Registration Definitions in the subscription levle - azure_rm_registrationdefinition_info: - scope: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx +- name: Get All Registration Definitions from AzureRMAuth's subscription + azure_rm_registrationdefinition_info: +- name: Get All Registration Definitions in the subscription levle + azure_rm_registrationdefinition_info: + scope: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx ''' RETURN = ''' @@ -149,10 +148,7 @@ registration_definitions: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBase try: - from msrestazure.azure_exceptions import CloudError from azure.mgmt.managedservices import ManagedServicesClient - from msrestazure.azure_operation import AzureOperationPoller - from msrest.polling import LROPoller except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_resource.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_resource.py index 0927128cd..a3a0544e2 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_resource.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_resource.py @@ -22,44 +22,58 @@ options: url: description: - Azure RM Resource URL. + type: str api_version: description: - Specific API version to be used. + type: str provider: description: - Provider type. - Required if URL is not specified. + type: str resource_group: description: - Resource group to be used. - Required if URL is not specified. + type: str resource_type: description: - Resource type. - Required if URL is not specified. + type: str resource_name: description: - Resource name. - Required if URL Is not specified. + type: str subresource: description: - List of subresources. + default: [] + type: list + elements: dict suboptions: namespace: description: - Subresource namespace. + type: str type: description: - Subresource type. + type: str name: description: - Subresource name. + type: str body: description: - The body of the HTTP request/response to the web service. + type: raw method: description: - The HTTP method of the request or response. It must be uppercase. + type: str choices: - GET - PUT @@ -73,11 +87,12 @@ options: description: - A valid, numeric, HTTP status code that signifies success of the request. Can also be comma separated list of status codes. type: list + elements: int default: [ 200, 201, 202 ] idempotency: description: - If enabled, idempotency check will be done by using I(method=GET) first and then comparing with I(body). - default: no + default: false type: bool polling_timeout: description: @@ -93,6 +108,7 @@ options: description: - Assert the state of the resource. Use C(present) to create or update resource or C(absent) to delete resource. default: present + type: str choices: - absent - present @@ -106,14 +122,14 @@ author: ''' EXAMPLES = ''' - - name: Update scaleset info using azure_rm_resource - azure_rm_resource: - resource_group: myResourceGroup - provider: compute - resource_type: virtualmachinescalesets - resource_name: myVmss - api_version: "2017-12-01" - body: { body } +- name: Update scaleset info using azure_rm_resource + azure_rm_resource: + resource_group: myResourceGroup + provider: compute + resource_type: virtualmachinescalesets + resource_name: myVmss + api_version: "2017-12-01" + body: { body } ''' RETURN = ''' @@ -215,9 +231,7 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common from ansible.module_utils.common.dict_transformations import dict_merge try: - from msrestazure.azure_exceptions import CloudError - from msrest.service_client import ServiceClient - from msrestazure.tools import resource_id, is_valid_resource_id + from azure.mgmt.core.tools import resource_id import json except ImportError: @@ -246,6 +260,7 @@ class AzureRMResource(AzureRMModuleBase): ), subresource=dict( type='list', + elements='dict', default=[] ), api_version=dict( @@ -261,6 +276,7 @@ class AzureRMResource(AzureRMModuleBase): ), status_code=dict( type='list', + elements='int', default=[200, 201, 202] ), idempotency=dict( @@ -309,6 +325,7 @@ class AzureRMResource(AzureRMModuleBase): for key in self.module_arg_spec: setattr(self, key, kwargs[key]) self.mgmt_client = self.get_mgmt_svc_client(GenericRestClient, + is_track2=True, base_url=self._cloud_environment.endpoints.resource_manager) if self.state == 'absent': @@ -354,7 +371,7 @@ class AzureRMResource(AzureRMModuleBase): provider = self.url.split("/providers/")[1].split("/")[0] resourceType = self.url.split(provider + "/")[1].split("/")[0] url = "/subscriptions/" + self.subscription_id + "/providers/" + provider - api_versions = json.loads(self.mgmt_client.query(url, "GET", {'api-version': '2015-01-01'}, None, None, [200], 0, 0).text) + api_versions = json.loads(self.mgmt_client.query(url, "GET", {'api-version': '2015-01-01'}, None, None, [200], 0, 0).body()) for rt in api_versions['resourceTypes']: if rt['resourceType'].lower() == resourceType.lower(): self.api_version = rt['apiVersions'][0] @@ -384,7 +401,7 @@ class AzureRMResource(AzureRMModuleBase): needs_update = False else: try: - response = json.loads(original.text) + response = json.loads(original.body()) needs_update = (dict_merge(response, self.body) != response) except Exception: pass @@ -398,11 +415,11 @@ class AzureRMResource(AzureRMModuleBase): self.status_code, self.polling_timeout, self.polling_interval) - if self.state == 'present': + if self.state == 'present' and self.method != 'DELETE': try: - response = json.loads(response.text) + response = json.loads(response.body()) except Exception: - response = response.text + response = response.context['deserialized_data'] else: response = None diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_resource_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_resource_info.py index d1af99ca2..eb5cd93e4 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_resource_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_resource_info.py @@ -22,25 +22,32 @@ options: url: description: - Azure RM Resource URL. + type: str api_version: description: - Specific API version to be used. + type: str provider: description: - Provider type, should be specified in no URL is given. + type: str resource_group: description: - Resource group to be used. - Required if URL is not specified. + type: str resource_type: description: - Resource type. + type: str resource_name: description: - Resource name. + type: str method: description: - The HTTP method of the request or response. It must be uppercase. + type: str choices: - GET - PUT @@ -53,16 +60,22 @@ options: subresource: description: - List of subresources. + type: list + elements: dict + default: [] suboptions: namespace: description: - Subresource namespace. + type: str type: description: - Subresource type. + type: str name: description: - Subresource name. + type: str extends_documentation_fragment: - azure.azcollection.azure @@ -73,18 +86,18 @@ author: ''' EXAMPLES = ''' - - name: Get scaleset info - azure_rm_resource_info: - resource_group: myResourceGroup - provider: compute - resource_type: virtualmachinescalesets - resource_name: myVmss - api_version: "2017-12-01" +- name: Get scaleset info + azure_rm_resource_info: + resource_group: myResourceGroup + provider: compute + resource_type: virtualmachinescalesets + resource_name: myVmss + api_version: "2017-12-01" - - name: Query all the resources in the resource group - azure_rm_resource_info: - resource_group: "{{ resource_group }}" - resource_type: resources +- name: Query all the resources in the resource group + azure_rm_resource_info: + resource_group: "{{ resource_group }}" + resource_type: resources ''' RETURN = ''' @@ -258,7 +271,7 @@ response: sample: { "offer": "UbuntuServer", "publisher": "Canonical", - "sku": "18.04-LTS", + "sku": "20_04-lts", "version": "latest" } osDisk: @@ -289,9 +302,7 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_rest import GenericRestClient try: - from msrestazure.azure_exceptions import CloudError - from msrest.service_client import ServiceClient - from msrestazure.tools import resource_id, is_valid_resource_id + from azure.mgmt.core.tools import resource_id import json except ImportError: @@ -320,7 +331,13 @@ class AzureRMResourceInfo(AzureRMModuleBase): ), subresource=dict( type='list', - default=[] + elements='dict', + default=[], + options=dict( + namespace=dict(type='str'), + type=dict(type='str'), + name=dict(type='str') + ) ), method=dict( type='str', @@ -353,6 +370,7 @@ class AzureRMResourceInfo(AzureRMModuleBase): for key in self.module_arg_spec: setattr(self, key, kwargs[key]) self.mgmt_client = self.get_mgmt_svc_client(GenericRestClient, + is_track2=True, base_url=self._cloud_environment.endpoints.resource_manager) if self.url is None: @@ -394,7 +412,7 @@ class AzureRMResourceInfo(AzureRMModuleBase): provider = self.url.split("/providers/")[1].split("/")[0] resourceType = self.url.split(provider + "/")[1].split("/")[0] url = "/subscriptions/" + self.subscription_id + "/providers/" + provider - api_versions = json.loads(self.mgmt_client.query(url, self.method, {'api-version': '2015-01-01'}, None, None, [200], 0, 0).text) + api_versions = json.loads(self.mgmt_client.query(url, self.method, {'api-version': '2015-01-01'}, None, None, [200], 0, 0).body()) for rt in api_versions['resourceTypes']: if rt['resourceType'].lower() == resourceType.lower(): self.api_version = rt['apiVersions'][0] @@ -421,7 +439,7 @@ class AzureRMResourceInfo(AzureRMModuleBase): query_parameters['skiptoken'] = skiptoken response = self.mgmt_client.query(self.url, self.method, query_parameters, header_parameters, None, [200, 404], 0, 0) try: - response = json.loads(response.text) + response = json.loads(response.body()) if isinstance(response, dict): if response.get('value'): self.results['response'] = self.results['response'] + response['value'] diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_resourcegroup.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_resourcegroup.py index 553330ab1..2fa448fa8 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_resourcegroup.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_resourcegroup.py @@ -29,15 +29,18 @@ options: description: - Azure location for the resource group. Required when creating a new resource group. - Cannot be changed once resource group is created. + type: str name: description: - Name of the resource group. required: true + type: str state: description: - Assert the state of the resource group. Use C(present) to create or update and C(absent) to delete. - When C(absent) a resource group containing resources will not be removed unless the I(force) option is used. default: present + type: str choices: - absent - present @@ -52,24 +55,24 @@ author: ''' EXAMPLES = ''' - - name: Create a resource group - azure_rm_resourcegroup: - name: myResourceGroup - location: westus - tags: - testing: testing - delete: never - - - name: Delete a resource group - azure_rm_resourcegroup: - name: myResourceGroup - state: absent - - - name: Delete a resource group including resources it contains - azure_rm_resourcegroup: - name: myResourceGroup - force_delete_nonempty: yes - state: absent +- name: Create a resource group + azure_rm_resourcegroup: + name: myResourceGroup + location: westus + tags: + testing: testing + delete: never + +- name: Delete a resource group + azure_rm_resourcegroup: + name: myResourceGroup + state: absent + +- name: Delete a resource group including resources it contains + azure_rm_resourcegroup: + name: myResourceGroup + force_delete_nonempty: true + state: absent ''' RETURN = ''' contains_resources: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_resourcegroup_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_resourcegroup_info.py index 969143a17..d6cc6d27c 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_resourcegroup_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_resourcegroup_info.py @@ -24,6 +24,7 @@ options: name: description: - Limit results to a specific resource group. + type: str tags: description: - Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. @@ -33,6 +34,8 @@ options: description: - List all resources under the resource group. - Note this will cost network overhead for each resource group. Suggest use this when I(name) set. + type: bool + extends_documentation_fragment: - azure.azcollection.azure @@ -44,23 +47,23 @@ author: ''' EXAMPLES = ''' - - name: Get facts for one resource group - azure_rm_resourcegroup_info: - name: myResourceGroup +- name: Get facts for one resource group + azure_rm_resourcegroup_info: + name: myResourceGroup - - name: Get facts for all resource groups - azure_rm_resourcegroup_info: +- name: Get facts for all resource groups + azure_rm_resourcegroup_info: - - name: Get facts by tags - azure_rm_resourcegroup_info: - tags: - - testing - - foo:bar +- name: Get facts by tags + azure_rm_resourcegroup_info: + tags: + - testing + - foo:bar - - name: Get facts for one resource group including resources it contains - azure_rm_resourcegroup_info: - name: myResourceGroup - list_resources: yes +- name: Get facts for one resource group including resources it contains + azure_rm_resourcegroup_info: + name: myResourceGroup + list_resources: true ''' RETURN = ''' resourcegroups: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_roleassignment.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_roleassignment.py index 6a930cc4b..f989146a6 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_roleassignment.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_roleassignment.py @@ -23,21 +23,25 @@ options: - The object id of assignee. This maps to the ID inside the Active Directory. - It can point to a user, service principal or security group. - Required when creating role assignment. + type: str aliases: - assignee id: description: - Fully qualified id of assignment to delete or create. - Mutually Exclusive with I(scope) and I(name) + type: str name: description: - Unique name of role assignment. - The role assignment name must be a GUID, sample as "3ce0cbb0-58c4-4e6d-a16d-99d86a78b3ca". - Mutually Exclusive with I(id) + type: str role_definition_id: description: - The role definition id used in the role assignment. - Required when creating role assignment. + type: str scope: description: - The scope of the role assignment to create. @@ -45,12 +49,14 @@ options: - /subscriptions/{subscription-id}/resourceGroups/{resource-group-name} for resource group. - /subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name} for resource. - Mutually Exclusive with I(id) + type: str state: description: - Assert the state of the role assignment. - Use C(present) to create or update a role assignment and C(absent) to delete it. - If C(present), then I(role_definition_id) and I(assignee_object_id) are both required default: present + type: str choices: - absent - present @@ -65,39 +71,39 @@ author: ''' EXAMPLES = ''' - - name: Create a role assignment - azure_rm_roleassignment: - scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - assignee_object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - role_definition_id: - "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Authorization/roleDefinitions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" - - - name: Create a role assignment - azure_rm_roleassignment: - name: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - assignee_object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - role_definition_id: - "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Authorization/roleDefinitions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" - - - name: Delete a role assignment - azure_rm_roleassignment: - name: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - state: absent - - - name: Delete a role assignment - azure_rm_roleassignment: - id: /subscriptions/xxx-sub-guid-xxx/resourceGroups/rgname/providers/Microsoft.Authorization/roleAssignments/xxx-assign-guid-xxx" - state: absent - - - name: Delete a role assignment - azure_rm_roleassignment: - scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - assignee_object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - role_definition_id: - "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Authorization/roleDefinitions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" - state: absent +- name: Create a role assignment + azure_rm_roleassignment: + scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + assignee_object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + role_definition_id: + "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Authorization/roleDefinitions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + +- name: Create a role assignment + azure_rm_roleassignment: + name: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + assignee_object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + role_definition_id: + "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Authorization/roleDefinitions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + +- name: Delete a role assignment + azure_rm_roleassignment: + name: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + state: absent + +- name: Delete a role assignment + azure_rm_roleassignment: + id: /subscriptions/xxx-sub-guid-xxx/resourceGroups/rgname/providers/Microsoft.Authorization/roleAssignments/xxx-assign-guid-xxx" + state: absent + +- name: Delete a role assignment + azure_rm_roleassignment: + scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + assignee_object_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + role_definition_id: + "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Authorization/roleDefinitions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + state: absent ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_roleassignment_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_roleassignment_info.py index 4fa338a81..b77335a38 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_roleassignment_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_roleassignment_info.py @@ -22,6 +22,7 @@ options: description: - Object id of a user, group or service principal. - Mutually exclusive with I(name) and I(id). + type: str aliases: - assignee_object_id id: @@ -29,14 +30,17 @@ options: - Fqid of role assignment to look up. - If set, I(role_definition_id) and I(scope) will be silently ignored. - Mutually exclusive with I(assignee) and I(name). + type: str name: description: - Name of role assignment. - Requires that I(scope) also be set. - Mutual exclusive with I(assignee) and I(id). + type: str role_definition_id: description: - Resource id of role definition. + type: str scope: description: - The scope to query for role assignments. @@ -44,6 +48,7 @@ options: - /subscriptions/{subscription-id}/resourceGroups/{resourcegroup-name} for a resource group. - /subscriptions/{subscription-id}/resourceGroups/{resourcegroup-name}/providers/{resource-provider}/{resource-type}/{resource-name} for a resource. - By default will return all inhereted assignments from parent scopes, see I(strict_scope_match). + type: str strict_scope_match: description: - If strict_scope_match is True, role assignments will only be returned for the exact scope defined. @@ -62,28 +67,28 @@ author: ''' EXAMPLES = ''' - - name: Get role assignments for specific service principal - azure_rm_roleassignment_info: - assignee: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - - - name: Get role assignments for specific scope that matches specific role definition - azure_rm_roleassignment_info: - scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - role_definition_id: /subscriptions/xxx-sub-guid-xxx/providers/Microsoft.Authorization/roleDefinitions/xxx-role-guid-xxxx - - - name: Get role assignments for specific scope with no inherited assignments - azure_rm_roleassignment_info: - scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - strict_scope_match: True - - - name: Get role assignments by name - azure_rm_roleassignment_info: - scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - name: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - - - name: Get role assignments by id - azure_rm_roleassignment_info: - id: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Authorization/roleAssignments/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx +- name: Get role assignments for specific service principal + azure_rm_roleassignment_info: + assignee: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + +- name: Get role assignments for specific scope that matches specific role definition + azure_rm_roleassignment_info: + scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + role_definition_id: /subscriptions/xxx-sub-guid-xxx/providers/Microsoft.Authorization/roleDefinitions/xxx-role-guid-xxxx + +- name: Get role assignments for specific scope with no inherited assignments + azure_rm_roleassignment_info: + scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + strict_scope_match: true + +- name: Get role assignments by name + azure_rm_roleassignment_info: + scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + name: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + +- name: Get role assignments by id + azure_rm_roleassignment_info: + id: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Authorization/roleAssignments/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_roledefinition.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_roledefinition.py index d1cc4c2a5..8683142d8 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_roledefinition.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_roledefinition.py @@ -81,17 +81,17 @@ author: ''' EXAMPLES = ''' - - name: Create a role definition - azure_rm_roledefinition: - name: myTestRole - scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myresourceGroup - permissions: - - actions: - - "Microsoft.Compute/virtualMachines/read" - data_actions: - - "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write" - assignable_scopes: - - "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" +- name: Create a role definition + azure_rm_roledefinition: + name: myTestRole + scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myresourceGroup + permissions: + - actions: + - "Microsoft.Compute/virtualMachines/read" + data_actions: + - "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write" + assignable_scopes: + - "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" ''' RETURN = ''' @@ -108,11 +108,8 @@ from ansible.module_utils._text import to_native try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase - from msrestazure.azure_operation import AzureOperationPoller from azure.core.polling import LROPoller - from msrest.serialization import Model from azure.mgmt.authorization import AuthorizationManagementClient - from azure.mgmt.authorization.model import (RoleDefinition, Permission) except ImportError: # This is handled in azure_rm_common @@ -341,7 +338,7 @@ class AzureRMRoleDefinition(AzureRMModuleBase): response = self._client.role_definitions.create_or_update(role_definition_id=self.role['name'] if self.role else str(uuid.uuid4()), scope=self.scope, role_definition=role_definition) - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) except Exception as exc: @@ -360,7 +357,7 @@ class AzureRMRoleDefinition(AzureRMModuleBase): try: response = self._client.role_definitions.delete(scope=scope, role_definition_id=role_definition_id) - if isinstance(response, LROPoller) or isinstance(response, AzureOperationPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) except Exception as e: self.log('Error attempting to delete the role definition.') diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_roledefinition_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_roledefinition_info.py index 3899ce404..ce8ee238e 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_roledefinition_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_roledefinition_info.py @@ -47,14 +47,14 @@ author: ''' EXAMPLES = ''' - - name: List Role Definitions in scope - azure_rm_roledefinition_info: - scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup - - - name: Get Role Definition by name - azure_rm_roledefinition_info: - scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup - role_name: myRoleDefinition +- name: List Role Definitions in scope + azure_rm_roledefinition_info: + scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup + +- name: Get Role Definition by name + azure_rm_roledefinition_info: + scope: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup + role_name: myRoleDefinition ''' RETURN = ''' @@ -120,11 +120,8 @@ roledefinitions: sample: [ 'Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write' ] ''' -from ansible.module_utils._text import to_native - try: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase - from msrest.serialization import Model from azure.mgmt.authorization import AuthorizationManagementClient except ImportError: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_route.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_route.py index dc1e79260..556c5395e 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_route.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_route.py @@ -20,23 +20,28 @@ options: description: - Name of resource group. required: true + type: str name: description: - Name of the route. required: true + type: str state: description: - Assert the state of the route. Use C(present) to create or update and C(absent) to delete. default: present + type: str choices: - absent - present address_prefix: description: - The destination CIDR to which the route applies. + type: str next_hop_type: description: - The type of Azure hop the packet should be sent to. + type: str choices: - virtual_network_gateway - vnet_local @@ -48,10 +53,12 @@ options: description: - The IP address packets should be forwarded to. - Next hop values are only allowed in routes where the next hop type is VirtualAppliance. + type: str route_table_name: description: - The name of the route table. required: true + type: str extends_documentation_fragment: @@ -64,20 +71,20 @@ author: ''' EXAMPLES = ''' - - name: Create a route - azure_rm_route: - resource_group: myResourceGroup - name: myRoute - address_prefix: 10.1.0.0/16 - next_hop_type: virtual_network_gateway - route_table_name: table - - - name: Delete a route - azure_rm_route: - resource_group: myResourceGroup - name: myRoute - route_table_name: table - state: absent +- name: Create a route + azure_rm_route: + resource_group: myResourceGroup + name: myRoute + address_prefix: 10.1.0.0/16 + next_hop_type: virtual_network_gateway + route_table_name: table + +- name: Delete a route + azure_rm_route: + resource_group: myResourceGroup + name: myRoute + route_table_name: table + state: absent ''' RETURN = ''' id: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_route_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_route_info.py index ee5311c21..c9cb3a0e7 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_route_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_route_info.py @@ -45,18 +45,17 @@ author: ''' EXAMPLES = ''' - - name: Get route - azure_rm_route_info: - resource_group: myResourceGroup - name: routename - route_table_name: routetabename +- name: Get route + azure_rm_route_info: + resource_group: myResourceGroup + name: routename + route_table_name: routetabename - - name: List routes - azure_rm_route_info: - resource_group: myResourceGroup - route_table_name: routetabename - +- name: List routes + azure_rm_route_info: + resource_group: myResourceGroup + route_table_name: routetabename ''' RETURN = ''' @@ -116,9 +115,6 @@ routes: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBase try: from azure.core.exceptions import ResourceNotFoundError - from azure.mgmt.network import NetworkManagementClient - from msrestazure.azure_operation import AzureOperationPoller - from msrest.polling import LROPoller except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_routetable.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_routetable.py index 7558907e9..94468d030 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_routetable.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_routetable.py @@ -20,14 +20,17 @@ options: description: - Name of resource group. required: true + type: str name: description: - Name of the route table. required: true + type: str state: description: - Assert the state of the route table. Use C(present) to create or update and C(absent) to delete. default: present + type: str choices: - absent - present @@ -40,6 +43,7 @@ options: description: - Region of the resource. - Derived from I(resource_group) if not specified. + type: str extends_documentation_fragment: - azure.azcollection.azure @@ -51,19 +55,19 @@ author: ''' EXAMPLES = ''' - - name: Create a route table - azure_rm_routetable: - resource_group: myResourceGroup - name: myRouteTable - disable_bgp_route_propagation: False - tags: - purpose: testing - - - name: Delete a route table - azure_rm_routetable: - resource_group: myResourceGroup - name: myRouteTable - state: absent +- name: Create a route table + azure_rm_routetable: + resource_group: myResourceGroup + name: myRouteTable + disable_bgp_route_propagation: false + tags: + purpose: testing + +- name: Delete a route table + azure_rm_routetable: + resource_group: myResourceGroup + name: myRouteTable + state: absent ''' RETURN = ''' changed: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_routetable_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_routetable_info.py index 901319ab8..56c8802ea 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_routetable_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_routetable_info.py @@ -23,9 +23,11 @@ options: name: description: - Limit results to a specific route table. + type: str resource_group: description: - Limit results in a specific resource group. + type: str tags: description: - Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. @@ -41,20 +43,20 @@ author: ''' EXAMPLES = ''' - - name: Get facts for one route table - azure_rm_routetable_info: - name: Testing - resource_group: myResourceGroup - - - name: Get facts for all route tables - azure_rm_routetable_info: - resource_group: myResourceGroup - - - name: Get facts by tags - azure_rm_routetable_info: - tags: - - testing - - foo:bar +- name: Get facts for one route table + azure_rm_routetable_info: + name: Testing + resource_group: myResourceGroup + +- name: Get facts for all route tables + azure_rm_routetable_info: + resource_group: myResourceGroup + +- name: Get facts by tags + azure_rm_routetable_info: + tags: + - testing + - foo:bar ''' RETURN = ''' id: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_securitygroup.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_securitygroup.py index 28a9b8391..8b25449ca 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_securitygroup.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_securitygroup.py @@ -26,40 +26,142 @@ options: - The set of default rules automatically added to a security group at creation. - In general default rules will not be modified. Modify rules to shape the flow of traffic to or from a subnet or NIC. - See rules below for the makeup of a rule dict. + type: list + elements: dict + suboptions: + name: + description: + - Unique name for the rule. + type: str + required: true + description: + description: + - Short description of the rule's purpose. + type: str + protocol: + description: + - Accepted traffic protocol. + type: str + choices: + - Udp + - Tcp + - Icmp + - "*" + default: "*" + source_port_range: + description: + - Port or range of ports from which traffic originates. + - It can accept string type or a list of string type. + default: "*" + type: raw + destination_port_range: + description: + - Port or range of ports to which traffic is headed. + - It can accept string type or a list of string type. + default: "*" + type: raw + source_address_prefix: + description: + - The CIDR or source IP range. + - Asterisk C(*) can also be used to match all source IPs. + - Default tags such as C(VirtualNetwork), C(AzureLoadBalancer) and C(Internet) can also be used. + - If this is an ingress rule, specifies where network traffic originates from. + - It can accept string type or a list of string type. + - Asterisk C(*) and default tags can only be specified as single string type, not as a list of string. + type: raw + default: "*" + destination_address_prefix: + description: + - The destination address prefix. + - CIDR or destination IP range. + - Asterisk C(*) can also be used to match all source IPs. + - Default tags such as C(VirtualNetwork), C(AzureLoadBalancer) and C(Internet) can also be used. + - It can accept string type or a list of string type. + - Asterisk C(*) and default tags can only be specified as single string type, not as a list of string. + default: "*" + type: raw + source_application_security_groups: + description: + - List of the source application security groups. + - It could be list of resource id. + - It could be list of names in same resource group. + - It could be list of dict containing resource_group and name. + - It is mutually exclusive with C(source_address_prefix) and C(source_address_prefixes). + type: list + elements: raw + destination_application_security_groups: + description: + - List of the destination application security groups. + - It could be list of resource id. + - It could be list of names in same resource group. + - It could be list of dict containing I(resource_group) and I(name). + - It is mutually exclusive with C(destination_address_prefix) and C(destination_address_prefixes). + type: list + elements: raw + access: + description: + - Whether or not to allow the traffic flow. + type: str + choices: + - Allow + - Deny + default: Allow + priority: + description: + - Order in which to apply the rule. Must a unique integer between 100 and 4096 inclusive. + type: int + required: true + direction: + description: + - Indicates the direction of the traffic flow. + type: str + choices: + - Inbound + - Outbound + default: Inbound location: description: - Valid azure location. Defaults to location of the resource group. + type: str name: description: - Name of the security group to operate on. + type: str + required: true purge_default_rules: description: - Remove any existing rules not matching those defined in the default_rules parameter. type: bool - default: 'no' + default: false purge_rules: description: - Remove any existing rules not matching those defined in the rules parameters. type: bool - default: 'no' + default: false resource_group: description: - Name of the resource group the security group belongs to. required: true + type: str rules: description: - Set of rules shaping traffic flow to or from a subnet or NIC. Each rule is a dictionary. + type: list + elements: dict suboptions: name: description: - Unique name for the rule. + type: str required: true description: description: - Short description of the rule's purpose. + type: str protocol: description: - Accepted traffic protocol. + type: str choices: - Udp - Tcp @@ -71,11 +173,13 @@ options: - Port or range of ports from which traffic originates. - It can accept string type or a list of string type. default: "*" + type: raw destination_port_range: description: - Port or range of ports to which traffic is headed. - It can accept string type or a list of string type. default: "*" + type: raw source_address_prefix: description: - The CIDR or source IP range. @@ -84,6 +188,7 @@ options: - If this is an ingress rule, specifies where network traffic originates from. - It can accept string type or a list of string type. - Asterisk C(*) and default tags can only be specified as single string type, not as a list of string. + type: raw default: "*" destination_address_prefix: description: @@ -94,6 +199,7 @@ options: - It can accept string type or a list of string type. - Asterisk C(*) and default tags can only be specified as single string type, not as a list of string. default: "*" + type: raw source_application_security_groups: description: - List of the source application security groups. @@ -115,6 +221,7 @@ options: access: description: - Whether or not to allow the traffic flow. + type: str choices: - Allow - Deny @@ -122,10 +229,12 @@ options: priority: description: - Order in which to apply the rule. Must a unique integer between 100 and 4096 inclusive. + type: int required: true direction: description: - Indicates the direction of the traffic flow. + type: str choices: - Inbound - Outbound @@ -134,6 +243,7 @@ options: description: - Assert the state of the security group. Set to C(present) to create or update a security group. Set to C(absent) to remove a security group. default: present + type: str choices: - absent - present @@ -149,63 +259,62 @@ author: ''' EXAMPLES = ''' +- name: Create a security group + azure_rm_securitygroup: + resource_group: myResourceGroup + name: mysecgroup + purge_rules: true + rules: + - name: DenySSH + protocol: Tcp + destination_port_range: 22 + access: Deny + priority: 100 + direction: Inbound + - name: 'AllowSSH' + protocol: Tcp + source_address_prefix: + - '174.109.158.0/24' + - '174.109.159.0/24' + destination_port_range: 22 + access: Allow + priority: 101 + direction: Inbound + - name: 'AllowMultiplePorts' + protocol: Tcp + source_address_prefix: + - '174.109.158.0/24' + - '174.109.159.0/24' + destination_port_range: + - 80 + - 443 + access: Allow + priority: 102 -# Create a security group -- azure_rm_securitygroup: - resource_group: myResourceGroup - name: mysecgroup - purge_rules: yes - rules: - - name: DenySSH - protocol: Tcp - destination_port_range: 22 - access: Deny - priority: 100 - direction: Inbound - - name: 'AllowSSH' - protocol: Tcp - source_address_prefix: - - '174.109.158.0/24' - - '174.109.159.0/24' - destination_port_range: 22 - access: Allow - priority: 101 - direction: Inbound - - name: 'AllowMultiplePorts' - protocol: Tcp - source_address_prefix: - - '174.109.158.0/24' - - '174.109.159.0/24' - destination_port_range: - - 80 - - 443 - access: Allow - priority: 102 - -# Update rules on existing security group -- azure_rm_securitygroup: - resource_group: myResourceGroup - name: mysecgroup - rules: - - name: DenySSH - protocol: Tcp - destination_port_range: 22-23 - access: Deny - priority: 100 - direction: Inbound - - name: AllowSSHFromHome - protocol: Tcp - source_address_prefix: '174.109.158.0/24' - destination_port_range: 22-23 - access: Allow - priority: 102 - direction: Inbound - tags: - testing: testing - delete: on-exit - -# Create a securiy group with I(protocol=Icmp) -- azure_rm_securitygroup: +- name: Update rules on existing security group + azure_rm_securitygroup: + resource_group: myResourceGroup + name: mysecgroup + rules: + - name: DenySSH + protocol: Tcp + destination_port_range: 22-23 + access: Deny + priority: 100 + direction: Inbound + - name: AllowSSHFromHome + protocol: Tcp + source_address_prefix: '174.109.158.0/24' + destination_port_range: 22-23 + access: Allow + priority: 102 + direction: Inbound + tags: + testing: testing + delete: on-exit + +- name: Create a securiy group with I(protocol=Icmp) + azure_rm_securitygroup: name: mysecgroup resource_group: myResourceGroup rules: @@ -219,11 +328,11 @@ EXAMPLES = ''' protocol: Icmp priority: 106 -# Delete security group -- azure_rm_securitygroup: - resource_group: myResourceGroup - name: mysecgroup - state: absent +- name: Delete security group + azure_rm_securitygroup: + resource_group: myResourceGroup + name: mysecgroup + state: absent ''' RETURN = ''' @@ -417,14 +526,12 @@ state: try: from azure.core.exceptions import ResourceNotFoundError - from msrestazure.tools import is_valid_resource_id - from azure.mgmt.network import NetworkManagementClient + from azure.mgmt.core.tools import is_valid_resource_id except ImportError: # This is handled in azure_rm_common pass from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase -from ansible.module_utils.six import integer_types from ansible.module_utils._text import to_native @@ -633,13 +740,25 @@ class AzureRMSecurityGroup(AzureRMModuleBase): def __init__(self): self.module_arg_spec = dict( - default_rules=dict(type='list', elements='dict', options=rule_spec), + default_rules=dict( + type='list', + elements='dict', + options=rule_spec, + mutually_exclusive=[("source_application_security_groups", "source_address_prefix"), + ("destination_application_security_groups", "destination_address_prefix")] + ), location=dict(type='str'), name=dict(type='str', required=True), purge_default_rules=dict(type='bool', default=False), purge_rules=dict(type='bool', default=False), resource_group=dict(required=True, type='str'), - rules=dict(type='list', elements='dict', options=rule_spec), + rules=dict( + type='list', + elements='dict', + options=rule_spec, + mutually_exclusive=[("source_application_security_groups", "source_address_prefix"), + ("destination_application_security_groups", "destination_address_prefix")] + ), state=dict(type='str', default='present', choices=['present', 'absent']), ) @@ -659,14 +778,8 @@ class AzureRMSecurityGroup(AzureRMModuleBase): state=dict() ) - mutually_exclusive = [["source_application_security_group", "source_address_prefix"], - ["source_application_security_group", "source_address_prefixes"], - ["destination_application_security_group", "destination_address_prefix"], - ["destination_application_security_group", "destination_address_prefixes"]] - super(AzureRMSecurityGroup, self).__init__(self.module_arg_spec, - supports_check_mode=True, - mutually_exclusive=mutually_exclusive) + supports_check_mode=True) def exec_module(self, **kwargs): # tighten up poll interval for security groups; default 30s is an eternity diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_securitygroup_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_securitygroup_info.py index 2a549c631..19fe0c874 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_securitygroup_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_securitygroup_info.py @@ -24,10 +24,12 @@ options: name: description: - Only show results for a specific security group. + type: str resource_group: description: - Name of the resource group to use. required: true + type: str tags: description: - Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. @@ -44,15 +46,14 @@ author: ''' EXAMPLES = ''' - - name: Get facts for one security group - azure_rm_securitygroup_info: - resource_group: myResourceGroup - name: secgroup001 - - - name: Get facts for all security groups - azure_rm_securitygroup_info: - resource_group: myResourceGroup - +- name: Get facts for one security group + azure_rm_securitygroup_info: + resource_group: myResourceGroup + name: secgroup001 + +- name: Get facts for all security groups + azure_rm_securitygroup_info: + resource_group: myResourceGroup ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_servicebus.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_servicebus.py index 07db88849..80c94e9a7 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_servicebus.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_servicebus.py @@ -20,23 +20,28 @@ options: description: - Name of resource group. required: true + type: str name: description: - Name of the servicebus namespace. required: true + type: str state: description: - Assert the state of the servicebus. Use C(present) to create or update and use C(absen) to delete. default: present + type: str choices: - absent - present location: description: - The servicebus's location. + type: str sku: description: - Namespace SKU. + type: str choices: - standard - basic @@ -55,10 +60,10 @@ author: EXAMPLES = ''' - name: Create a namespace azure_rm_servicebus: - name: deadbeef - location: eastus - tags: - key1: value1 + name: deadbeef + location: eastus + tags: + key1: value1 ''' RETURN = ''' id: @@ -75,7 +80,6 @@ except ImportError: # This is handled in azure_rm_common pass -from ansible.module_utils.common.dict_transformations import _snake_to_camel, _camel_to_snake from ansible.module_utils._text import to_native from datetime import datetime, timedelta diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_servicebus_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_servicebus_info.py index 246bb514b..5ccd4dea7 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_servicebus_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_servicebus_info.py @@ -23,9 +23,11 @@ options: name: description: - Limit results to a specific servicebus. + type: str resource_group: description: - Limit results in a specific resource group. + type: str tags: description: - Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. @@ -37,9 +39,12 @@ options: - A namespace is a scoping container for all messaging components. - Multiple queues and topics can reside within a single namespace, and namespaces often serve as application containers. - Required when I(type=namespace). + type: str type: description: - Type of the resource. + type: str + required: true choices: - namespace - queue @@ -49,6 +54,7 @@ options: description: - Topic name. - Required when I(type=subscription). + type: str show_sas_policies: description: - Whether to show the SAS policies. @@ -375,8 +381,7 @@ servicebuses: ''' try: - from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, azure_id_to_dict - from msrestazure.azure_exceptions import CloudError + from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase except Exception: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_servicebusqueue.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_servicebusqueue.py index edb810374..f63da177a 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_servicebusqueue.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_servicebusqueue.py @@ -20,20 +20,24 @@ options: description: - Name of resource group. required: true + type: str name: description: - Name of the queue. required: true + type: str namespace: description: - Servicebus namespace name. - A namespace is a scoping container for all messaging components. - Multiple queues and topics can reside within a single namespace, and namespaces often serve as application containers. required: true + type: str state: description: - Assert the state of the queue. Use C(present) to create or update and use C(absent) to delete. default: present + type: str choices: - absent - present @@ -68,9 +72,11 @@ options: forward_dead_lettered_messages_to: description: - Queue or topic name to forward the Dead Letter message for a queue. + type: str forward_to: description: - Queue or topic name to forward the messages for a queue. + type: str lock_duration_in_seconds: description: - Timespan duration of a peek-lock. @@ -106,6 +112,7 @@ options: status: description: - Status of the entity. + type: str choices: - active - disabled diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_servicebussaspolicy.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_servicebussaspolicy.py index 3acb2f479..63d71a375 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_servicebussaspolicy.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_servicebussaspolicy.py @@ -20,14 +20,17 @@ options: description: - Name of resource group. required: true + type: str name: description: - Name of the SAS policy. required: true + type: str state: description: - Assert the state of the route. Use C(present) to create or update and C(absent) to delete. default: present + type: str choices: - absent - present @@ -36,14 +39,17 @@ options: - Manage SAS policy for a namespace without C(queue) or C(topic) set. - Manage SAS policy for a queue or topic under this namespace. required: true + type: str queue: description: - Type of the messaging queue. - Cannot set C(topc) when this field set. + type: str topic: description: - Name of the messaging topic. - Cannot set C(queue) when this field set. + type: str regenerate_primary_key: description: - Regenerate the SAS policy primary key. @@ -57,7 +63,8 @@ options: rights: description: - Claim rights of the SAS policy. - required: True + - Required when creating. + type: str choices: - manage - listen @@ -153,10 +160,6 @@ except ImportError: # This is handled in azure_rm_common pass -from ansible.module_utils.common.dict_transformations import _snake_to_camel, _camel_to_snake -from ansible.module_utils._text import to_native -from datetime import datetime, timedelta - class AzureRMServiceBusSASPolicy(AzureRMModuleBase): diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_servicebustopic.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_servicebustopic.py index c2eb25e86..75ae477eb 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_servicebustopic.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_servicebustopic.py @@ -20,20 +20,24 @@ options: description: - Name of resource group. required: true + type: str name: description: - Name of the topic. required: true + type: str namespace: description: - Servicebus namespace name. - A namespace is a scoping container for all messaging components. - Multipletopics can reside within a single namespace. + type: str required: true state: description: - Assert the state of the topic. Use C(present) to create or update and use C(absent) to delete. default: present + type: str choices: - absent - present @@ -85,6 +89,7 @@ options: status: description: - Status of the entity. + type: str choices: - active - disabled @@ -156,7 +161,7 @@ class AzureRMServiceBusTopic(AzureRMModuleBase): max_size_in_mb=dict(type='int'), max_message_size_in_kb=dict(type='int'), name=dict(type='str', required=True), - namespace=dict(type='str'), + namespace=dict(type='str', required=True), requires_duplicate_detection=dict(type='bool'), resource_group=dict(type='str', required=True), state=dict(type='str', default='present', choices=['present', 'absent']), diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_servicebustopicsubscription.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_servicebustopicsubscription.py index b6cc523db..aa9ae40dd 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_servicebustopicsubscription.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_servicebustopicsubscription.py @@ -20,14 +20,17 @@ options: description: - Name of resource group. required: true + type: str name: description: - Name of the servicebus subscription. required: true + type: str state: description: - Assert the state of the servicebus subscription. Use C(present) to create or update and use C(absent) to delete. default: present + type: str choices: - absent - present @@ -37,10 +40,12 @@ options: - A namespace is a scoping container for all messaging components. - Multiple subscriptions and topics can reside within a single namespace, and namespaces often serve as application containers. required: true + type: str topic: description: - Topic name which the subscription subscribe to. required: true + type: str auto_delete_on_idle_in_seconds: description: - Time idle interval after which a subscription is automatically deleted. @@ -67,9 +72,11 @@ options: forward_dead_lettered_messages_to: description: - Queue or topic name to forward the Dead Letter message for a subscription. + type: str forward_to: description: - Queue or topic name to forward the messages for a subscription. + type: str lock_duration_in_seconds: description: - Timespan duration of a peek-lock. @@ -92,6 +99,7 @@ options: status: description: - Status of the entity. + type: str choices: - active - disabled diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_snapshot.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_snapshot.py index 15c814414..bd3acd9bd 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_snapshot.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_snapshot.py @@ -24,6 +24,7 @@ options: name: description: - Resource name. + required: true type: str location: description: @@ -130,11 +131,6 @@ import time import json from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBaseExt from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_rest import GenericRestClient -try: - from msrestazure.azure_exceptions import CloudError -except ImportError: - # this is handled in azure_rm_common - pass class Actions: @@ -252,6 +248,7 @@ class AzureRMSnapshots(AzureRMModuleBaseExt): response = None self.mgmt_client = self.get_mgmt_svc_client(GenericRestClient, + is_track2=True, base_url=self._cloud_environment.endpoints.resource_manager) resource_group = self.get_resource_group(self.resource_group) @@ -328,6 +325,7 @@ class AzureRMSnapshots(AzureRMModuleBaseExt): def create_update_resource(self): # self.log('Creating / Updating the Snapshot instance {0}'.format(self.)) + response = None try: response = self.mgmt_client.query(url=self.url, method='PUT', @@ -337,14 +335,16 @@ class AzureRMSnapshots(AzureRMModuleBaseExt): expected_status_codes=self.status_code, polling_timeout=600, polling_interval=30) - except CloudError as exc: + except Exception as exc: self.log('Error attempting to create the Snapshot instance.') self.fail('Error creating the Snapshot instance: {0}'.format(str(exc))) - try: - response = json.loads(response.text) - except Exception: - response = {'text': response.text} + if hasattr(response, 'body'): + response = json.loads(response.body()) + elif hasattr(response, 'context'): + response = response.context['deserialized_data'] + else: + self.fail("Create or Updating fail, no match message return, return info as {0}".format(response)) return response @@ -359,7 +359,7 @@ class AzureRMSnapshots(AzureRMModuleBaseExt): expected_status_codes=self.status_code, polling_timeout=600, polling_interval=30) - except CloudError as e: + except Exception as e: self.log('Error attempting to delete the Snapshot instance.') self.fail('Error deleting the Snapshot instance: {0}'.format(str(e))) @@ -377,11 +377,11 @@ class AzureRMSnapshots(AzureRMModuleBaseExt): expected_status_codes=self.status_code, polling_timeout=600, polling_interval=30) - response = json.loads(response.text) + response = json.loads(response.body()) found = True self.log("Response : {0}".format(response)) # self.log("Snapshot instance : {0} found".format(response.name)) - except CloudError as e: + except Exception as e: self.log('Did not find the Snapshot instance.') if found is True: return response diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqldatabase.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqldatabase.py index 972125b2e..b66e886b6 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqldatabase.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqldatabase.py @@ -21,20 +21,25 @@ options: description: - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. required: True + type: str server_name: description: - The name of the server. required: True + type: str name: description: - The name of the database to be operated on (updated or created). required: True + type: str location: description: - Resource location. If not set, location from the resource group will be used as default. + type: str collation: description: - The collation of the database. If not I(create_mode=default), this value is ignored. + type: str create_mode: description: - Specifies the mode of database creation. @@ -46,6 +51,7 @@ options: - C(restore), Creates a database by restoring a backup of a deleted database. - C(restore_long_term_retention_backup), Creates a database by restoring from a long term retention vault. - C(copy), C(non_readable_secondary), C(online_secondary) and C(restore_long_term_retention_backup) are not supported for C(data_warehouse) edition. + type: str choices: - 'copy' - 'default' @@ -59,24 +65,29 @@ options: description: - Required unless I(create_mode=default) or I(create_mode=restore_long_term_retention_backup). - Specifies the resource ID of the source database. + type: str source_database_deletion_date: description: - Required if I(create_mode=restore) and I(source_database_id) is the deleted database's original resource id when it existed (as opposed to its current restorable dropped database ID), then this value is required. Specifies the time that the database was deleted. + type: str restore_point_in_time: description: - Required if I(create_mode=point_in_time_restore), this value is required. If I(create_mode=restore), this value is optional. - Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. - Must be greater than or equal to the source database's earliestRestoreDate value. + type: str recovery_services_recovery_point_resource_id: description: - Required if I(create_mode=restore_long_term_retention_backup), then this value is required. - Specifies the resource ID of the recovery point to restore from. + type: str edition: description: - (Deprecate)The edition of the database. The DatabaseEditions enumeration contains all the valid editions. - This option will be deprecated in 2.11, use I(sku) instead. - Cannot set C(sku) when this field set. + type: str choices: - 'web' - 'business' @@ -95,32 +106,40 @@ options: - To see possible values, query the capabilities API (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) referred to by operationId:'Capabilities_ListByLocation'. - Cannot set C(edition) when this field set. + type: dict suboptions: name: description: - Name of the database SKU, typically, a letter + Number code, e.g. P3 required: True + type: str tier: description: - The tier or edition of the particular SKU, e.g. Basic, Premium + type: str capacity: description: - Capacity of the particular SKU. + type: int size: description: - Size of the particular SKU + type: str family: description: - If the service has different generations of hardware, for the same SKU, then that can be used here + type: str max_size_bytes: description: - The max size of the database expressed in bytes. - If not I(create_mode=default), this value is ignored. - To see possible values, query the capabilities API (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities). referred to by operationId:'Capabilities_ListByLocation'. + type: str elastic_pool_name: description: - The name of the elastic pool the database is in. Not supported for I(edition=data_warehouse). + type: str read_scale: description: - If the database is a geo-secondary, indicates whether read-only connections are allowed to this database or not. @@ -132,6 +151,7 @@ options: - Indicates the name of the sample schema to apply when creating this database. - If not I(create_mode=default), this value is ignored. - Not supported for I(edition=data_warehouse). + type: str choices: - 'adventure_works_lt' zone_redundant: @@ -140,17 +160,18 @@ options: type: bool default: False force_update: - description: - - SQL Database will be updated if given parameters differ from existing resource state. - - To force SQL Database update in any circumstances set this parameter to True. - type: bool + description: + - SQL Database will be updated if given parameters differ from existing resource state. + - To force SQL Database update in any circumstances set this parameter to True. + type: bool state: - description: - - Assert the state of the SQL Database. Use C(present) to create or update an SQL Database and C(absent) to delete it. - default: present - choices: - - absent - - present + description: + - Assert the state of the SQL Database. Use C(present) to create or update an SQL Database and C(absent) to delete it. + default: present + type: str + choices: + - absent + - present extends_documentation_fragment: - azure.azcollection.azure @@ -162,42 +183,41 @@ author: ''' EXAMPLES = ''' - - name: Create (or update) SQL Database - azure_rm_sqldatabase: - resource_group: myResourceGroup - server_name: sqlcrudtest-5961 - name: testdb - location: eastus - - - name: Restore SQL Database - azure_rm_sqldatabase: - resource_group: myResourceGroup - server_name: sqlcrudtest-5961 - name: restoreddb - location: eastus - create_mode: restore - restorable_dropped_database_id: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Sql/s - ervers/testsvr/restorableDroppedDatabases/testdb2,131444841315030000" - - - name: Create SQL Database in Copy Mode - azure_rm_sqldatabase: - resource_group: myResourceGroup - server_name: sqlcrudtest-5961 - name: copydb - location: eastus - create_mode: copy - source_database_id: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Sql/servers/tests - vr/databases/testdb" - - - name: Create (or update) SQL Database with SKU - azure_rm_sqldatabase: - resource_group: myResourceGroup - server_name: sqlcrudtest-5961 - name: testdb - location: eastus - sku: - name: S0 - +- name: Create (or update) SQL Database + azure_rm_sqldatabase: + resource_group: myResourceGroup + server_name: sqlcrudtest-5961 + name: testdb + location: eastus + +- name: Restore SQL Database + azure_rm_sqldatabase: + resource_group: myResourceGroup + server_name: sqlcrudtest-5961 + name: restoreddb + location: eastus + create_mode: restore + restorable_dropped_database_id: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Sql/s + ervers/testsvr/restorableDroppedDatabases/testdb2,131444841315030000" + +- name: Create SQL Database in Copy Mode + azure_rm_sqldatabase: + resource_group: myResourceGroup + server_name: sqlcrudtest-5961 + name: copydb + location: eastus + create_mode: copy + source_database_id: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Sql/servers/tests + vr/databases/testdb" + +- name: Create (or update) SQL Database with SKU + azure_rm_sqldatabase: + resource_group: myResourceGroup + server_name: sqlcrudtest-5961 + name: testdb + location: eastus + sku: + name: S0 ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqldatabase_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqldatabase_info.py index 9c9af2501..4a53ec243 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqldatabase_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqldatabase_info.py @@ -21,16 +21,20 @@ options: description: - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. required: True + type: str server_name: description: - The name of the server. required: True + type: str name: description: - The name of the database. + type: str elastic_pool_name: description: - The name of the elastic pool. + type: str tags: description: - Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. @@ -46,22 +50,22 @@ author: ''' EXAMPLES = ''' - - name: Get instance of SQL Database - azure_rm_sqldatabase_info: - resource_group: testrg - server_name: testserver - name: testdb - - - name: List instances of SQL Database - azure_rm_sqldatabase_info: - resource_group: testrg - server_name: testserver - elastic_pool_name: testep - - - name: List instances of SQL Database - azure_rm_sqldatabase_info: - resource_group: testrg - server_name: testserver +- name: Get instance of SQL Database + azure_rm_sqldatabase_info: + resource_group: testrg + server_name: testserver + name: testdb + +- name: List instances of SQL Database + azure_rm_sqldatabase_info: + resource_group: testrg + server_name: testserver + elastic_pool_name: testep + +- name: List instances of SQL Database + azure_rm_sqldatabase_info: + resource_group: testrg + server_name: testserver ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlelasticpool.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlelasticpool.py index 563e9111b..b74432ba0 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlelasticpool.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlelasticpool.py @@ -119,25 +119,25 @@ author: ''' EXAMPLES = ''' - - name: Create (or update) SQL Elastic Pool - azure_rm_elastic_pool: - resource_group: myResourceGroup - server_name: sqlcrudtest-5961 - name: testEP - zone_redundant: False - sku: - name: GP_Gen5 - family: Gen5 - capacity: 3 - tags: - key1: value1 - - - name: Delete SQL Elastic Pool - azure_rm_elastic_pool: - resource_group: myResourceGroup - server_name: sqlcrudtest-5961 - name: testEP - state: absent +- name: Create (or update) SQL Elastic Pool + azure_rm_elastic_pool: + resource_group: myResourceGroup + server_name: sqlcrudtest-5961 + name: testEP + zone_redundant: false + sku: + name: GP_Gen5 + family: Gen5 + capacity: 3 + tags: + key1: value1 + +- name: Delete SQL Elastic Pool + azure_rm_elastic_pool: + resource_group: myResourceGroup + server_name: sqlcrudtest-5961 + name: testEP + state: absent ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlelasticpool_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlelasticpool_info.py index 4ac9ac86e..2aed051c7 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlelasticpool_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlelasticpool_info.py @@ -48,16 +48,16 @@ author: ''' EXAMPLES = ''' - - name: Get instance of SQL Elastic Pool - azure_rm_sqlelasticpool_info: - resource_group: testrg - server_name: testserver - name: testEP +- name: Get instance of SQL Elastic Pool + azure_rm_sqlelasticpool_info: + resource_group: testrg + server_name: testserver + name: testEP - - name: List instances of SQL Elastic Pool - azure_rm_sqlelasticpool_info: - resource_group: testrg - server_name: testserver +- name: List instances of SQL Elastic Pool + azure_rm_sqlelasticpool_info: + resource_group: testrg + server_name: testserver ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlfirewallrule.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlfirewallrule.py index 059256a07..e41e4f66c 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlfirewallrule.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlfirewallrule.py @@ -21,26 +21,32 @@ options: description: - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. required: True + type: str server_name: description: - The name of the server. required: True + type: str name: description: - The name of the firewall rule. required: True + type: str start_ip_address: description: - The start IP address of the firewall rule. - Must be IPv4 format. Use value C(0.0.0.0) to represent all Azure-internal IP addresses. + type: str end_ip_address: description: - The end IP address of the firewall rule. - Must be IPv4 format. Must be greater than or equal to I(start_ip_address). Use value C(0.0.0.0) to represent all Azure-internal IP addresses. + type: str state: description: - State of the SQL Database. Use C(present) to create or update an SQL Database and C(absent) to delete it. default: present + type: str choices: - absent - present @@ -54,13 +60,13 @@ author: ''' EXAMPLES = ''' - - name: Create (or update) Firewall Rule - azure_rm_sqlfirewallrule: - resource_group: myResourceGroup - server_name: firewallrulecrudtest-6285 - name: firewallrulecrudtest-5370 - start_ip_address: 172.28.10.136 - end_ip_address: 172.28.10.138 +- name: Create (or update) Firewall Rule + azure_rm_sqlfirewallrule: + resource_group: myResourceGroup + server_name: firewallrulecrudtest-6285 + name: firewallrulecrudtest-5370 + start_ip_address: 172.28.10.136 + end_ip_address: 172.28.10.138 ''' RETURN = ''' @@ -78,7 +84,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError - from azure.core.polling import LROPoller from azure.mgmt.sql.models import FirewallRule except ImportError: # This is handled in azure_rm_common diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlfirewallrule_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlfirewallrule_info.py index 7c9bb0459..73c22f5b9 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlfirewallrule_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlfirewallrule_info.py @@ -21,13 +21,16 @@ options: description: - The name of the resource group that contains the server. required: True + type: str server_name: description: - The name of the server. required: True + type: str name: description: - The name of the firewall rule. + type: str extends_documentation_fragment: - azure.azcollection.azure @@ -38,16 +41,16 @@ author: ''' EXAMPLES = ''' - - name: Get instance of SQL Firewall Rule - azure_rm_sqlfirewallrule_info: - resource_group: myResourceGroup - server_name: testserver - name: testrule - - - name: List instances of SQL Firewall Rule - azure_rm_sqlfirewallrule_info: - resource_group: myResourceGroup - server_name: testserver +- name: Get instance of SQL Firewall Rule + azure_rm_sqlfirewallrule_info: + resource_group: myResourceGroup + server_name: testserver + name: testrule + +- name: List instances of SQL Firewall Rule + azure_rm_sqlfirewallrule_info: + resource_group: myResourceGroup + server_name: testserver ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlmanagedinstance.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlmanagedinstance.py index c9d905343..b59421062 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlmanagedinstance.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlmanagedinstance.py @@ -513,7 +513,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError - from azure.core.polling import LROPoller except ImportError: pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlmanagedinstance_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlmanagedinstance_info.py index ad0b11012..5434cb6a4 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlmanagedinstance_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlmanagedinstance_info.py @@ -40,19 +40,19 @@ author: ''' EXAMPLES = ''' - - name: Get SQL managed instance by name - azure_rm_sqlmanagedinstance_info: - resource_group: testrg - name: testinstancename +- name: Get SQL managed instance by name + azure_rm_sqlmanagedinstance_info: + resource_group: testrg + name: testinstancename - - name: List SQL managed instance by resource group - azure_rm_sqlmanagedinstance_info: - resource_group: testrg +- name: List SQL managed instance by resource group + azure_rm_sqlmanagedinstance_info: + resource_group: testrg - - name: List SQL manged instance by subscription and filter by tags - azure_rm_sqlmanagedinstance_info: - tags: - - foo +- name: List SQL manged instance by subscription and filter by tags + azure_rm_sqlmanagedinstance_info: + tags: + - foo ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlserver.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlserver.py index f4cf45f08..bffd8e7ab 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlserver.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlserver.py @@ -20,27 +20,34 @@ options: resource_group: description: - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + type: str required: True name: description: - The name of the server. + type: str required: True location: description: - Resource location. + type: str admin_username: description: - Username of the SQL administrator account for server. Once created it cannot be changed. + type: str admin_password: description: - Password of the SQL administrator account for server (required for server creation). + type: str version: description: - The version of the server. For example C(12.0). + type: str identity: description: - The identity type. Set this to C(SystemAssigned) in order to automatically create and assign an Azure Active Directory principal for the resource. - Possible values include C(SystemAssigned). + type: str minimal_tls_version: description: - Require clients to use a specified TLS version. @@ -111,6 +118,7 @@ options: description: - State of the SQL server. Use C(present) to create or update a server and use C(absent) to delete a server. default: present + type: str choices: - absent - present diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlserver_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlserver_info.py index 06e34ea22..51351d3c3 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlserver_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_sqlserver_info.py @@ -20,10 +20,12 @@ options: resource_group: description: - The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + type: str required: True server_name: description: - The name of the server. + type: str extends_documentation_fragment: - azure.azcollection.azure @@ -35,14 +37,14 @@ author: ''' EXAMPLES = ''' - - name: Get instance of SQL Server - azure_rm_sqlserver_info: - resource_group: myResourceGroup - server_name: server_name +- name: Get instance of SQL Server + azure_rm_sqlserver_info: + resource_group: myResourceGroup + server_name: server_name - - name: List instances of SQL Server - azure_rm_sqlserver_info: - resource_group: myResourceGroup +- name: List instances of SQL Server + azure_rm_sqlserver_info: + resource_group: myResourceGroup ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_storageaccount.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_storageaccount.py index d3b5bb807..c7c280ef4 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_storageaccount.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_storageaccount.py @@ -21,16 +21,20 @@ options: description: - Name of the resource group to use. required: true + type: str aliases: - resource_group_name name: description: - Name of the storage account to update or create. + type: str + required: true state: description: - State of the storage account. Use C(present) to create or update a storage account and use C(absent) to delete an account. - C(failover) is used to failover the storage account to its secondary. This process can take up to a hour. default: present + type: str choices: - absent - present @@ -38,11 +42,13 @@ options: location: description: - Valid Azure location. Defaults to location of the resource group. + type: str account_type: description: - Type of storage account. Required when creating a storage account. - C(Standard_ZRS) and C(Premium_LRS) accounts cannot be changed to other account types. - Other account types cannot be changed to C(Standard_ZRS) or C(Premium_LRS). + type: str choices: - Premium_LRS - Standard_GRS @@ -61,6 +67,7 @@ options: - Only one custom domain is supported per storage account at this time. - To clear the existing custom domain, use an empty string for the custom domain name property. - Can be added to an existing storage account. Will be ignored during storage account creation. + type: dict aliases: - custom_dns_domain_suffix kind: @@ -68,6 +75,7 @@ options: - The kind of storage. - The C(FileStorage) and (BlockBlobStorage) only used when I(account_type=Premium_LRS) or I(account_type=Premium_ZRS). default: 'Storage' + type: str choices: - Storage - StorageV2 @@ -82,6 +90,7 @@ options: access_tier: description: - The access tier for this storage account. Required when I(kind=BlobStorage). + type: str choices: - Hot - Cool @@ -101,6 +110,7 @@ options: description: - The minimum required version of Transport Layer Security (TLS) for requests to a storage account. - If omitted, new account creation will default to null which is currently interpreted to TLS1_0. Existing accounts will not be modified. + type: str choices: - TLS1_0 - TLS1_1 @@ -109,6 +119,7 @@ options: public_network_access: description: - Allow or disallow public network access to Storage Account. + type: str choices: - Enabled - Disabled @@ -129,6 +140,7 @@ options: description: - Default firewall traffic rule. - If I(default_action=Allow) no other settings have effect. + type: str choices: - Allow - Deny @@ -140,28 +152,37 @@ options: - It can be any combination of the example C(AzureServices), C(Logging), C(Metrics). - If no Azure components are allowed, explicitly set I(bypass=""). default: AzureServices + type: str virtual_network_rules: description: - A list of subnets and their actions. + type: list + elements: dict suboptions: id: description: - The complete path to the subnet. + type: str action: description: - The only logical I(action=Allow) because this setting is only accessible when I(default_action=Deny). default: 'Allow' + type: str ip_rules: description: - A list of IP addresses or ranges in CIDR format. + type: list + elements: dict suboptions: value: description: - The IP address or range. + type: str action: description: - The only logical I(action=Allow) because this setting is only accessible when I(default_action=Deny). default: 'Allow' + type: str blob_cors: description: - Specifies CORS rules for the Blob service. @@ -288,65 +309,65 @@ author: ''' EXAMPLES = ''' - - name: remove account, if it exists - azure_rm_storageaccount: - resource_group: myResourceGroup - name: clh0002 - state: absent - - - name: create an account - azure_rm_storageaccount: - resource_group: myResourceGroup - name: clh0002 - type: Standard_RAGRS - tags: - testing: testing - delete: on-exit - - - name: Create an account with kind of FileStorage - azure_rm_storageaccount: - resource_group: myResourceGroup - name: c1h0002 - type: Premium_LRS - kind: FileStorage - tags: - testing: testing - - - name: configure firewall and virtual networks - azure_rm_storageaccount: - resource_group: myResourceGroup - name: clh0002 - type: Standard_RAGRS - network_acls: - bypass: AzureServices,Metrics - default_action: Deny - virtual_network_rules: - - id: /subscriptions/mySubscriptionId/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet - action: Allow - ip_rules: - - value: 1.2.3.4 - action: Allow - - value: 123.234.123.0/24 - action: Allow - - - name: create an account with blob CORS - azure_rm_storageaccount: - resource_group: myResourceGroup - name: clh002 - type: Standard_RAGRS - blob_cors: - - allowed_origins: - - http://www.example.com/ - allowed_methods: - - GET - - POST - allowed_headers: - - x-ms-meta-data* - - x-ms-meta-target* - - x-ms-meta-abc - exposed_headers: - - x-ms-meta-* - max_age_in_seconds: 200 +- name: remove account, if it exists + azure_rm_storageaccount: + resource_group: myResourceGroup + name: clh0002 + state: absent + +- name: create an account + azure_rm_storageaccount: + resource_group: myResourceGroup + name: clh0002 + type: Standard_RAGRS + tags: + testing: testing + delete: on-exit + +- name: Create an account with kind of FileStorage + azure_rm_storageaccount: + resource_group: myResourceGroup + name: c1h0002 + type: Premium_LRS + kind: FileStorage + tags: + testing: testing + +- name: configure firewall and virtual networks + azure_rm_storageaccount: + resource_group: myResourceGroup + name: clh0002 + type: Standard_RAGRS + network_acls: + bypass: AzureServices,Metrics + default_action: Deny + virtual_network_rules: + - id: /subscriptions/mySubscriptionId/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet + action: Allow + ip_rules: + - value: 1.2.3.4 + action: Allow + - value: 123.234.123.0/24 + action: Allow + +- name: create an account with blob CORS + azure_rm_storageaccount: + resource_group: myResourceGroup + name: clh002 + type: Standard_RAGRS + blob_cors: + - allowed_origins: + - http://www.example.com/ + allowed_methods: + - GET + - POST + allowed_headers: + - x-ms-meta-data* + - x-ms-meta-target* + - x-ms-meta-abc + exposed_headers: + - x-ms-meta-* + max_age_in_seconds: 200 ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_storageaccount_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_storageaccount_info.py index 2b0c301c3..75f179b6f 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_storageaccount_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_storageaccount_info.py @@ -24,9 +24,11 @@ options: name: description: - Only show results for a specific account. + type: str resource_group: description: - Limit results to a resource group. Required when filtering by name. + type: str aliases: - resource_group_name tags: @@ -61,20 +63,20 @@ author: ''' EXAMPLES = ''' - - name: Get facts for one account - azure_rm_storageaccount_info: - resource_group: myResourceGroup - name: clh0002 +- name: Get facts for one account + azure_rm_storageaccount_info: + resource_group: myResourceGroup + name: clh0002 - - name: Get facts for all accounts in a resource group - azure_rm_storageaccount_info: - resource_group: myResourceGroup +- name: Get facts for all accounts in a resource group + azure_rm_storageaccount_info: + resource_group: myResourceGroup - - name: Get facts for all accounts by tags - azure_rm_storageaccount_info: - tags: - - testing - - foo:bar +- name: Get facts for all accounts by tags + azure_rm_storageaccount_info: + tags: + - testing + - foo:bar ''' RETURN = ''' @@ -477,6 +479,7 @@ storageaccounts: description: - The account key for the secondary_endpoints sample: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + type: str georeplication_stats: description: - Parameters related to the status of geo-replication. @@ -533,11 +536,6 @@ storageaccounts: sample: error.html ''' -try: - from azure.core.exceptions import ResourceNotFoundError -except Exception: - # This is handled in azure_rm_common - pass from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from ansible.module_utils._text import to_native @@ -609,7 +607,7 @@ class AzureRMStorageAccountInfo(AzureRMModuleBase): account = None try: expand = None - if(self.show_georeplication_stats): + if (self.show_georeplication_stats): expand = 'georeplicationstats' account = self.storage_client.storage_accounts.get_properties(self.resource_group, self.name, expand=expand) return [account] diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_storageblob.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_storageblob.py index 0999494be..868069f42 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_storageblob.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_storageblob.py @@ -26,6 +26,7 @@ options: description: - Name of the storage account to use. required: true + type: str aliases: - account_name - storage_account @@ -34,10 +35,12 @@ options: - Name of a blob object within the container. aliases: - blob_name + type: str blob_type: description: - Type of blob object. default: block + type: str choices: - block - page @@ -46,31 +49,39 @@ options: description: - Name of a blob container within the storage account. required: true + type: str aliases: - container_name content_type: description: - Set the blob content-type header. For example C(image/png). + type: str cache_control: description: - Set the blob cache-control header. + type: str content_disposition: description: - Set the blob content-disposition header. + type: str content_encoding: description: - Set the blob encoding header. + type: str content_language: description: - Set the blob content-language header. + type: str content_md5: description: - Set the blob md5 hash value. + type: str dest: description: - Destination file path. Use with state C(present) to download a blob. aliases: - destination + type: path force: description: - Overwrite existing blob or file when uploading or downloading. Force deletion of a container that contains blobs. @@ -80,19 +91,23 @@ options: description: - Name of the resource group to use. required: true + type: str aliases: - resource_group_name src: description: - Source file path. Use with state C(present) to upload a blob. + type: str aliases: - source batch_upload_src: description: - Batch upload source directory. Use with state C(present) to upload batch of files under the directory. + type: path batch_upload_dst: description: - Base directory in container when upload batch of files. + type: path state: description: - State of a container or blob. @@ -105,6 +120,7 @@ options: to download. If a blob (uploading) or a file (downloading) already exists, it will not be overwritten unless I(force=true). default: present + type: str choices: - absent - present @@ -112,6 +128,7 @@ options: description: - A container's level of public access. By default containers are private. - Can only be set at time of container creation. + type: str choices: - container - blob diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_storageshare.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_storageshare.py index e4749b87a..747a24ac0 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_storageshare.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_storageshare.py @@ -57,7 +57,23 @@ options: - The maximum size of the file share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For large file shares, the maximum size is 102400. By default 102400 type: int - + enabled_protocols: + description: + - The authentication protocol that is used for the file share. + - Can only be specified when creating a share. + type: str + choices: + - SMB + - NFS + root_squash: + description: + - The property is for NFS share only. + - The default is C(NoRootSquash). + type: str + choices: + - NoRootSquash + - RootSquash + - AllSquash extends_documentation_fragment: - azure.azcollection.azure @@ -80,6 +96,15 @@ EXAMPLES = ''' key1: value1 key2: value2 +- name: Create share with enalbed protocols + azure_rm_storageshare: + name: "{{ share_name }}" + resource_group: "{{ resource_group }}" + account_name: "{{ storage_account }}" + access_tier: "{{ access_tier }}" + root_squash: RootSquash + enabled_protocols: NFS + - name: Delete storage share azure_rm_storageshare: name: testShare @@ -184,6 +209,8 @@ class AzureRMStorageShare(AzureRMModuleBase): choices=['TransactionOptimized', 'Hot', 'Cool', 'Premium']), quota=dict(type='int', default=None), metadata=dict(type='dict', default=None), + root_squash=dict(type='str', choices=['NoRootSquash', 'RootSquash', 'AllSquash']), + enabled_protocols=dict(type='str', choices=['SMB', 'NFS']), ) self.results = dict( changed=False, @@ -196,6 +223,8 @@ class AzureRMStorageShare(AzureRMModuleBase): self.state = None self.quota = None self.metadata = None + self.root_squash = None + self.enabled_protocols = None self.to_do = Actions.NoAction @@ -259,7 +288,9 @@ class AzureRMStorageShare(AzureRMModuleBase): ''' return ((self.access_tier is not None) and (self.access_tier != old_response.get('access_tier')) or (self.quota is not None) and (self.quota != old_response.get('share_quota')) or - (self.metadata is not None) and (self.metadata != old_response.get('metadata'))) + (self.metadata is not None) and (self.metadata != old_response.get('metadata')) or + (self.root_squash is not None) and (self.root_squash != old_response.get('root_squash')) or + (self.enabled_protocols is not None) and (self.enabled_protocols != old_response.get('enabled_protocols'))) def get_share(self): ''' @@ -294,6 +325,8 @@ class AzureRMStorageShare(AzureRMModuleBase): share_quota=storage_share.share_quota, access_tier=storage_share.access_tier, access_tier_change_time=storage_share.access_tier_change_time, + root_squash=storage_share.root_squash, + enabled_protocols=storage_share.enabled_protocols ) def create_storage_share(self): @@ -308,7 +341,9 @@ class AzureRMStorageShare(AzureRMModuleBase): share_name=self.name, file_share=dict(access_tier=self.access_tier, share_quota=self.quota, - metadata=self.metadata)) + metadata=self.metadata, + root_squash=self.root_squash, + enabled_protocols=self.enabled_protocols)) except Exception as e: self.fail("Error creating file share {0} : {1}".format(self.name, str(e))) return self.get_share() @@ -323,7 +358,9 @@ class AzureRMStorageShare(AzureRMModuleBase): file_share_details = dict( access_tier=self.access_tier if self.access_tier else old_responce.get('access_tier'), share_quota=self.quota if self.quota else old_responce.get('share_quota'), - metadata=self.metadata if self.metadata else old_responce.get('metadata') + metadata=self.metadata if self.metadata else old_responce.get('metadata'), + enabled_protocols=self.enabled_protocols if self.enabled_protocols else old_responce.get('enabled_protocols'), + root_squash=self.root_squash if self.root_squash else old_responce.get('self.root_squash') ) try: self.storage_client.file_shares.update(resource_group_name=self.resource_group, diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_subnet.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_subnet.py index 063ba1504..ec7117c37 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_subnet.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_subnet.py @@ -23,13 +23,16 @@ options: description: - Name of resource group. required: true + type: str name: description: - Name of the subnet. required: true + type: str address_prefix_cidr: description: - CIDR defining the IPv4 address space of the subnet. Must be valid within the context of the virtual network. + type: str aliases: - address_prefix address_prefixes_cidr: @@ -38,20 +41,23 @@ options: - If set I(address_prefix), It will not set. aliases: - address_prefixes - type: list version_added: "1.0.0" + type: list + elements: str security_group: description: - Existing security group with which to associate the subnet. - It can be the security group name which is in the same resource group. - Can be the resource ID of the security group. - Can be a dict containing the I(name) and I(resource_group) of the security group. + type: raw aliases: - security_group_name state: description: - Assert the state of the subnet. Use C(present) to create or update a subnet and use C(absent) to delete a subnet. default: present + type: str choices: - absent - present @@ -59,6 +65,7 @@ options: description: - Name of an existing virtual network with which the subnet is or will be associated. required: true + type: str aliases: - virtual_network route_table: @@ -67,19 +74,23 @@ options: - Can be the name or resource ID of the route table. - Can be a dict containing the I(name) and I(resource_group) of the route table. - Without this configuration, the associated route table will be dissociate. If there is no associated route table, it has no impact. + type: raw service_endpoints: description: - An array of service endpoints. type: list + elements: dict suboptions: service: description: - The type of the endpoint service. required: True + type: str locations: description: - A list of locations. type: list + elements: str private_endpoint_network_policies: description: - C(Enabled) or C(Disabled) apply network policies on private endpoints in the subnet. @@ -100,15 +111,18 @@ options: description: - An array of delegations. type: list + elements: dict suboptions: name: description: - The name of delegation. + type: str required: True serviceName: description: - The type of the endpoint service. required: True + type: str choices: - Microsoft.Web/serverFarms - Microsoft.ContainerInstance/containerGroups @@ -143,6 +157,8 @@ options: description: - A list of actions. type: list + elements: str + default: [] nat_gateway: description: - Existing NAT Gateway with which to associate the subnet. @@ -161,59 +177,59 @@ author: ''' EXAMPLES = ''' - - name: Create a subnet - azure_rm_subnet: - resource_group: myResourceGroup - virtual_network_name: myVirtualNetwork - name: mySubnet - address_prefix_cidr: "10.1.0.0/24" - - - name: Create a subnet refer nsg from other resource group - azure_rm_subnet: - resource_group: myResourceGroup - virtual_network_name: myVirtualNetwork - name: mySubnet - address_prefix_cidr: "10.1.0.0/16" - security_group: - name: secgroupfoo - resource_group: mySecondResourceGroup - route_table: route - - - name: Create a subnet with service endpoint - azure_rm_subnet: - resource_group: myResourceGroup - virtual_network_name: myVirtualNetwork - name: mySubnet - address_prefix_cidr: "10.1.0.0/16" - service_endpoints: - - service: "Microsoft.Sql" - locations: - - "eastus" - - - name: Create a subnet with delegations - azure_rm_subnet: - resource_group: myResourceGroup - virtual_network_name: myVirtualNetwork - name: mySubnet - address_prefix_cidr: "10.1.0.0/16" - delegations: - - name: 'mydeleg' - serviceName: 'Microsoft.ContainerInstance/containerGroups' - - - name: Create a subnet with an associated NAT Gateway - azure_rm_subnet: - resource_group: myResourceGroup - virtual_network_name: myVirtualNetwork - name: mySubnet - address_prefix_cidr: "10.1.0.0/16" - nat_gateway: myNatGateway - - - name: Delete a subnet - azure_rm_subnet: - resource_group: myResourceGroup - virtual_network_name: myVirtualNetwork - name: mySubnet - state: absent +- name: Create a subnet + azure_rm_subnet: + resource_group: myResourceGroup + virtual_network_name: myVirtualNetwork + name: mySubnet + address_prefix_cidr: "10.1.0.0/24" + +- name: Create a subnet refer nsg from other resource group + azure_rm_subnet: + resource_group: myResourceGroup + virtual_network_name: myVirtualNetwork + name: mySubnet + address_prefix_cidr: "10.1.0.0/16" + security_group: + name: secgroupfoo + resource_group: mySecondResourceGroup + route_table: route + +- name: Create a subnet with service endpoint + azure_rm_subnet: + resource_group: myResourceGroup + virtual_network_name: myVirtualNetwork + name: mySubnet + address_prefix_cidr: "10.1.0.0/16" + service_endpoints: + - service: "Microsoft.Sql" + locations: + - "eastus" + +- name: Create a subnet with delegations + azure_rm_subnet: + resource_group: myResourceGroup + virtual_network_name: myVirtualNetwork + name: mySubnet + address_prefix_cidr: "10.1.0.0/16" + delegations: + - name: 'mydeleg' + serviceName: 'Microsoft.ContainerInstance/containerGroups' + +- name: Create a subnet with an associated NAT Gateway + azure_rm_subnet: + resource_group: myResourceGroup + virtual_network_name: myVirtualNetwork + name: mySubnet + address_prefix_cidr: "10.1.0.0/16" + nat_gateway: myNatGateway + +- name: Delete a subnet + azure_rm_subnet: + resource_group: myResourceGroup + virtual_network_name: myVirtualNetwork + name: mySubnet + state: absent ''' RETURN = ''' @@ -313,7 +329,7 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError - from msrestazure.tools import is_valid_resource_id + from azure.mgmt.core.tools import is_valid_resource_id except ImportError: # This is handled in azure_rm_common pass @@ -340,6 +356,7 @@ delegations_spec = dict( ), actions=dict( type='list', + elements='str', default=[] ) ) @@ -387,11 +404,16 @@ class AzureRMSubnet(AzureRMModuleBase): state=dict(type='str', default='present', choices=['present', 'absent']), virtual_network_name=dict(type='str', required=True, aliases=['virtual_network']), address_prefix_cidr=dict(type='str', aliases=['address_prefix']), - address_prefixes_cidr=dict(type='list', aliases=['address_prefixes']), + address_prefixes_cidr=dict(type='list', aliases=['address_prefixes'], elements='str'), security_group=dict(type='raw', aliases=['security_group_name']), route_table=dict(type='raw'), service_endpoints=dict( - type='list' + type='list', + elements='dict', + options=dict( + service=dict(type='str', required=True), + locations=dict(type='list', elements='str') + ) ), private_endpoint_network_policies=dict( type='str', @@ -485,7 +507,7 @@ class AzureRMSubnet(AzureRMModuleBase): else: subnet['private_endpoint_network_policies'] = results['private_endpoint_network_policies'] if self.private_link_service_network_policies is not None: - if results['private_link_service_network_policies'] != self.private_link_service_network_policies is not None: + if results['private_link_service_network_policies'] != self.private_link_service_network_policies: self.log("CHANGED: subnet {0} private_link_service_network_policies".format(self.private_link_service_network_policies)) changed = True results['private_link_service_network_policies'] = self.private_link_service_network_policies diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_subnet_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_subnet_info.py index ec75ff6b9..eb004a891 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_subnet_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_subnet_info.py @@ -21,13 +21,16 @@ options: description: - The name of the resource group. required: True + type: str virtual_network_name: description: - The name of the virtual network. required: True + type: str name: description: - The name of the subnet. + type: str extends_documentation_fragment: - azure.azcollection.azure @@ -38,17 +41,17 @@ author: ''' EXAMPLES = ''' - - name: Get facts of specific subnet - azure_rm_subnet_info: - resource_group: myResourceGroup - virtual_network_name: myVirtualNetwork - name: mySubnet +- name: Get facts of specific subnet + azure_rm_subnet_info: + resource_group: myResourceGroup + virtual_network_name: myVirtualNetwork + name: mySubnet - - name: List facts for all subnets in virtual network - azure_rm_subnet_info: - resource_group: myResourceGroup - virtual_network_name: myVirtualNetwork - name: mySubnet +- name: List facts for all subnets in virtual network + azure_rm_subnet_info: + resource_group: myResourceGroup + virtual_network_name: myVirtualNetwork + name: mySubnet ''' RETURN = ''' @@ -192,7 +195,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_subscription_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_subscription_info.py index 9caeb3ef7..ec544d41c 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_subscription_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_subscription_info.py @@ -63,13 +63,13 @@ EXAMPLES = ''' - name: Get facts for all subscriptions, including ones that are disabled. azure_rm_subscription_info: - all: True + all: true - name: Get facts for subscriptions containing tags provided. azure_rm_subscription_info: tags: - - testing - - foo:bar + - testing + - foo:bar ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_trafficmanager.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_trafficmanager.py index 422a8df14..7764b7142 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_trafficmanager.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_trafficmanager.py @@ -20,24 +20,29 @@ options: description: - Name of a resource group where the Traffic Manager profile exists or will be created. required: true + type: str name: description: - Name of the Traffic Manager profile. required: true + type: str state: description: - Assert the state of the Traffic Manager profile. Use C(present) to create or update a Traffic Manager profile and C(absent) to delete it. default: present + type: str choices: - absent - present location: description: - Valid azure location. Defaults to 'global'. + type: str profile_status: description: - The status of the Traffic Manager profile. default: Enabled + type: str choices: - Enabled - Disabled @@ -45,6 +50,7 @@ options: description: - The traffic routing method of the Traffic Manager profile. default: Performance + type: str choices: - Performance - Priority @@ -53,22 +59,30 @@ options: dns_config: description: - The DNS settings of the Traffic Manager profile. + type: dict suboptions: relative_name: description: - The relative DNS name provided by this Traffic Manager profile. - If no provided, name of the Traffic Manager will be used + type: str ttl: description: - The DNS Time-To-Live (TTL), in seconds. - default: 60 + type: int monitor_config: description: - The endpoint monitoring settings of the Traffic Manager profile. + type: dict suboptions: + profile_monitor_status: + description: + - The profile-level monitoring status of the Traffic Manager. + type: str protocol: description: - The protocol (HTTP, HTTPS or TCP) used to probe for endpoint health. + type: str choices: - HTTP - HTTPS @@ -76,18 +90,23 @@ options: port: description: - The TCP port used to probe for endpoint health. + type: int path: description: - The path relative to the endpoint domain name used to probe for endpoint health. + type: str interval_in_seconds: description: - The monitor interval for endpoints in this profile. + type: int timeout_in_seconds: description: - The monitor timeout for endpoints in this profile. + type: int tolerated_number_of_failures: description: - The number of consecutive failed health check before declaring an endpoint in this profile Degraded after the next failed health check. + type: int default: protocol: HTTP port: 80 @@ -95,28 +114,39 @@ options: endpoints: description: - The list of endpoints in the Traffic Manager profile. + type: list + elements: dict + default: [] suboptions: + endpoint_monitor_status: + description: + - The monitoring status of the endpoint. + type: str id: description: - Fully qualified resource Id for the resource. + type: str name: description: - The name of the endpoint. - required: true + type: str type: description: - The type of the endpoint. Ex- Microsoft.network/TrafficManagerProfiles/ExternalEndpoints. - required: true + type: str target_resource_id: description: - The Azure Resource URI of the of the endpoint. - Not applicable to endpoints of type 'ExternalEndpoints'. + type: str target: description: - The fully-qualified DNS name of the endpoint. + type: str endpoint_status: description: - The status of the endpoint. + type: str choices: - Enabled - Disabled @@ -124,63 +154,69 @@ options: description: - The weight of this endpoint when using the 'Weighted' traffic routing method. - Possible values are from 1 to 1000. + type: int priority: description: - The priority of this endpoint when using the 'Priority' traffic routing method. - Possible values are from 1 to 1000, lower values represent higher priority. - This is an optional parameter. If specified, it must be specified on all endpoints. - No two endpoints can share the same priority value. + type: int endpoint_location: description: - Specifies the location of the external or nested endpoints when using the 'Performance' traffic routing method. + type: str min_child_endpoints: description: - The minimum number of endpoints that must be available in the child profile in order for the parent profile to be considered available. - Only applicable to endpoint of type 'NestedEndpoints'. + type: int geo_mapping: description: - The list of countries/regions mapped to this endpoint when using the 'Geographic' traffic routing method. + type: list + elements: str extends_documentation_fragment: - azure.azcollection.azure - azure.azcollection.azure_tags author: - - "Hai Cao <t-haicao@microsoft.com>" + - Hai Cao (@caohai) ''' EXAMPLES = ''' - - name: Create a Traffic Manager Profile - azure_rm_trafficmanager: - name: tmtest - resource_group: tmt - location: global - profile_status: Enabled - traffic_routing_method: Priority - dns_config: - relative_name: tmtest - ttl: 60 - monitor_config: - protocol: HTTPS - port: 80 - path: '/' - endpoints: - - name: e1 - type: Microsoft.network/TrafficManagerProfiles/ExternalEndpoints - endpoint_location: West US 2 - endpoint_status: Enabled - priority: 2 - target: 1.2.3.4 - weight: 1 - tags: - Environment: Test - - - name: Delete a Traffic Manager Profile - azure_rm_trafficmanager: - state: absent - name: tmtest - resource_group: tmt +- name: Create a Traffic Manager Profile + azure_rm_trafficmanager: + name: tmtest + resource_group: tmt + location: global + profile_status: Enabled + traffic_routing_method: Priority + dns_config: + relative_name: tmtest + ttl: 60 + monitor_config: + protocol: HTTPS + port: 80 + path: '/' + endpoints: + - name: e1 + type: Microsoft.network/TrafficManagerProfiles/ExternalEndpoints + endpoint_location: West US 2 + endpoint_status: Enabled + priority: 2 + target: 1.2.3.4 + weight: 1 + tags: + Environment: Test + +- name: Delete a Traffic Manager Profile + azure_rm_trafficmanager: + state: absent + name: tmtest + resource_group: tmt ''' RETURN = ''' state: @@ -330,7 +366,7 @@ dns_config_spec = dict( monitor_config_spec = dict( profile_monitor_status=dict(type='str'), - protocol=dict(type='str'), + protocol=dict(type='str', choices=['HTTP', 'HTTPS', 'TCP']), port=dict(type='int'), path=dict(type='str'), interval_in_seconds=dict(type='int'), @@ -344,7 +380,7 @@ endpoint_spec = dict( type=dict(type='str'), target_resource_id=dict(type='str'), target=dict(type='str'), - endpoint_status=dict(type='str'), + endpoint_status=dict(type='str', choices=['Enabled', 'Disabled']), weight=dict(type='int'), priority=dict(type='int'), endpoint_location=dict(type='str'), diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_trafficmanagerendpoint.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_trafficmanagerendpoint.py index df87ed93f..8acf7ede9 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_trafficmanagerendpoint.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_trafficmanagerendpoint.py @@ -35,6 +35,7 @@ options: description: - The type of the endpoint. required: true + type: str choices: - azure_endpoints - external_endpoints @@ -83,6 +84,7 @@ options: description: - Assert the state of the Traffic Manager endpoint. Use C(present) to create or update a Traffic Manager endpoint and C(absent) to delete it. default: present + type: str choices: - absent - present @@ -97,16 +99,16 @@ author: ''' EXAMPLES = ''' - - name: create a endpoint for a traffic manager profile - azure_rm_trafficmanagerendpoint: - resource_group: testresourcegroup - profile_name: myprofilename - name: testendpoint1 - type: external_endpoints - location: westus - priority: 2 - weight: 1 - target: 1.2.3.4 +- name: create a endpoint for a traffic manager profile + azure_rm_trafficmanagerendpoint: + resource_group: testresourcegroup + profile_name: myprofilename + name: testendpoint1 + type: external_endpoints + location: westus + priority: 2 + weight: 1 + target: 1.2.3.4 ''' RETURN = ''' @@ -119,14 +121,12 @@ id: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/trafficManagerProfiles/testProfil e/externalEndpoints/testendpoint" ''' -from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, normalize_location_name +from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from ansible.module_utils.common.dict_transformations import _snake_to_camel try: from azure.core.exceptions import ResourceNotFoundError - from azure.mgmt.trafficmanager.models import ( - Endpoint, DnsConfig, MonitorConfig - ) + from azure.mgmt.trafficmanager.models import Endpoint except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_trafficmanagerendpoint_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_trafficmanagerendpoint_info.py index 94bd2ac87..e25608553 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_trafficmanagerendpoint_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_trafficmanagerendpoint_info.py @@ -23,17 +23,21 @@ options: name: description: - Limit results to a specific Traffic Manager endpoint. + type: str resource_group: description: - The resource group to search for the desired Traffic Manager profile. required: True + type: str profile_name: description: - Name of Traffic Manager Profile. required: True + type: str type: description: - Type of endpoint. + type: str choices: - azure_endpoints - external_endpoints @@ -48,17 +52,16 @@ author: ''' EXAMPLES = ''' - - name: Get endpoints facts of a Traffic Manager profile - azure_rm_trafficmanagerendpoint_info: - resource_group: myResourceGroup - profile_name: Testing - - - name: Get specific endpoint of a Traffic Manager profile - azure_rm_trafficmanager_info: - resource_group: myResourceGroup - profile_name: Testing - name: test_external_endpoint - +- name: Get endpoints facts of a Traffic Manager profile + azure_rm_trafficmanagerendpoint_info: + resource_group: myResourceGroup + profile_name: Testing + +- name: Get specific endpoint of a Traffic Manager profile + azure_rm_trafficmanager_info: + resource_group: myResourceGroup + profile_name: Testing + name: test_external_endpoint ''' RETURN = ''' @@ -150,8 +153,6 @@ except Exception: # handled in azure_rm_common pass -import re - AZURE_OBJECT_CLASS = 'TrafficManagerEndpoints' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_trafficmanagerprofile.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_trafficmanagerprofile.py index b529666d3..c74cd8ccd 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_trafficmanagerprofile.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_trafficmanagerprofile.py @@ -20,14 +20,17 @@ options: description: - Name of a resource group where the Traffic Manager profile exists or will be created. required: true + type: str name: description: - Name of the Traffic Manager profile. required: true + type: str state: description: - Assert the state of the Traffic Manager profile. Use C(present) to create or update a Traffic Manager profile and C(absent) to delete it. default: present + type: str choices: - absent - present @@ -35,11 +38,13 @@ options: description: - Valid Azure location. Defaults to C(global) because in default public Azure cloud, Traffic Manager profile can only be deployed globally. - Reference U(https://docs.microsoft.com/en-us/azure/traffic-manager/quickstart-create-traffic-manager-profile#create-a-traffic-manager-profile). + type: str default: global profile_status: description: - The status of the Traffic Manager profile. default: enabled + type: str choices: - enabled - disabled @@ -47,6 +52,7 @@ options: description: - The traffic routing method of the Traffic Manager profile. default: performance + type: str choices: - performance - priority @@ -55,33 +61,42 @@ options: dns_config: description: - The DNS settings of the Traffic Manager profile. + type: dict suboptions: relative_name: description: - The relative DNS name provided by this Traffic Manager profile. - If not provided, name of the Traffic Manager will be used. + type: str ttl: description: - The DNS Time-To-Live (TTL), in seconds. type: int - default: 60 monitor_config: description: - The endpoint monitoring settings of the Traffic Manager profile. + type: dict suboptions: + profile_monitor_status: + description: + - The profile-level monitoring status of the Traffic Manager. + type: str protocol: description: - The protocol C(HTTP), C(HTTPS) or C(TCP) used to probe for endpoint health. + type: str choices: - - HTTP - HTTPS + - HTTP - TCP port: description: - The TCP port used to probe for endpoint health. + type: int path: description: - The path relative to the endpoint domain name used to probe for endpoint health. + type: str interval: description: - The monitor interval for endpoints in this profile in seconds. @@ -93,6 +108,7 @@ options: tolerated_failures: description: - The number of consecutive failed health check before declaring an endpoint in this profile Degraded after the next failed health check. + type: int default: protocol: HTTP port: 80 @@ -109,28 +125,28 @@ author: ''' EXAMPLES = ''' - - name: Create a Traffic Manager Profile - azure_rm_trafficmanagerprofile: - name: tmtest - resource_group: myResourceGroup - location: global - profile_status: enabled - routing_method: priority - dns_config: - relative_name: tmtest - ttl: 60 - monitor_config: - protocol: HTTPS - port: 80 - path: '/' - tags: - Environment: Test - - - name: Delete a Traffic Manager Profile - azure_rm_trafficmanagerprofile: - state: absent - name: tmtest - resource_group: myResourceGroup +- name: Create a Traffic Manager Profile + azure_rm_trafficmanagerprofile: + name: tmtest + resource_group: myResourceGroup + location: global + profile_status: enabled + routing_method: priority + dns_config: + relative_name: tmtest + ttl: 60 + monitor_config: + protocol: HTTPS + port: 80 + path: '/' + tags: + Environment: Test + +- name: Delete a Traffic Manager Profile + azure_rm_trafficmanagerprofile: + state: absent + name: tmtest + resource_group: myResourceGroup ''' RETURN = ''' id: @@ -156,7 +172,7 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError from azure.mgmt.trafficmanager.models import ( - Profile, Endpoint, DnsConfig, MonitorConfig + Profile, DnsConfig, MonitorConfig ) except ImportError: # This is handled in azure_rm_common @@ -240,7 +256,7 @@ dns_config_spec = dict( monitor_config_spec = dict( profile_monitor_status=dict(type='str'), - protocol=dict(type='str'), + protocol=dict(type='str', choices=['HTTP', 'HTTPS', 'TCP']), port=dict(type='int'), path=dict(type='str'), interval=dict(type='int'), diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_trafficmanagerprofile_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_trafficmanagerprofile_info.py index 43a3492de..e8477e370 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_trafficmanagerprofile_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_trafficmanagerprofile_info.py @@ -23,9 +23,11 @@ options: name: description: - Limit results to a specific Traffic Manager profile. + type: str resource_group: description: - The resource group to search for the desired Traffic Manager profile. + type: str tags: description: - Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. @@ -41,18 +43,18 @@ author: ''' EXAMPLES = ''' - - name: Get facts for one Traffic Manager profile - azure_rm_trafficmanager_info: - name: Testing - resource_group: myResourceGroup - - - name: Get facts for all Traffic Manager profiles - azure_rm_trafficmanager_info: - - - name: Get facts by tags - azure_rm_trafficmanager_info: - tags: - - Environment:Test +- name: Get facts for one Traffic Manager profile + azure_rm_trafficmanager_info: + name: Testing + resource_group: myResourceGroup + +- name: Get facts for all Traffic Manager profiles + azure_rm_trafficmanager_info: + +- name: Get facts by tags + azure_rm_trafficmanager_info: + tags: + - Environment:Test ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualhub.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualhub.py index d29abf3be..4de5a13f3 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualhub.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualhub.py @@ -208,23 +208,23 @@ author: ''' EXAMPLES = ''' - - name: Create a VirtualHub - azure_rm_virtualhub: - resource_group: myResourceGroup - name: my_virtual_hub_name - address_prefix: 10.2.0.0/24 - sku: Standard - location: eastus - enable_virtual_router_route_propogation: false - virtual_wan: - id: /subscriptions/xxx-xxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualWans/fredwan - - - name: Delete VirtualHub - azure_rm_virtualhub: - resource_group: myResourceGroup - name: my_virtual_hub_name - location: eastus - state: absent +- name: Create a VirtualHub + azure_rm_virtualhub: + resource_group: myResourceGroup + name: my_virtual_hub_name + address_prefix: 10.2.0.0/24 + sku: Standard + location: eastus + enable_virtual_router_route_propogation: false + virtual_wan: + id: /subscriptions/xxx-xxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualWans/fredwan + +- name: Delete VirtualHub + azure_rm_virtualhub: + resource_group: myResourceGroup + name: my_virtual_hub_name + location: eastus + state: absent ''' RETURN = ''' @@ -493,7 +493,6 @@ state: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBaseExt try: - from msrestazure.azure_operation import AzureOperationPoller from azure.core.exceptions import ResourceNotFoundError from azure.core.polling import LROPoller except ImportError: @@ -733,7 +732,7 @@ class AzureRMVirtualHub(AzureRMModuleBaseExt): response = self.network_client.virtual_hubs.begin_create_or_update(resource_group_name=self.resource_group, virtual_hub_name=self.name, virtual_hub_parameters=self.body) - if isinstance(response, AzureOperationPoller) or isinstance(response, LROPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) except Exception as exc: self.log('Error attempting to create the VirtualHub instance.') diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualhub_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualhub_info.py index b7c1b8fae..0a81abee4 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualhub_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualhub_info.py @@ -33,18 +33,17 @@ author: ''' EXAMPLES = ''' - - name: Get virtual hub info by name - azure_rm_virtualhub_info: - resource_group: myResourceGroup - name: virtualHub +- name: Get virtual hub info by name + azure_rm_virtualhub_info: + resource_group: myResourceGroup + name: virtualHub - - name: Get virtual hub info by resource group - azure_rm_virtualhub_info: - resource_group: myResourceGroup - - - name: Get birtual hub info by sub - azure_rm_virtualhub_info: +- name: Get virtual hub info by resource group + azure_rm_virtualhub_info: + resource_group: myResourceGroup +- name: Get birtual hub info by sub + azure_rm_virtualhub_info: ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualhubconnection.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualhubconnection.py index 5208f665e..a14caf799 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualhubconnection.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualhubconnection.py @@ -155,7 +155,6 @@ EXAMPLES = ''' vhub_name: testhub name: Myconnection state: absent - ''' RETURN = ''' @@ -289,7 +288,6 @@ state: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBaseExt try: - from msrestazure.azure_operation import AzureOperationPoller from azure.core.exceptions import ResourceNotFoundError from azure.core.polling import LROPoller except ImportError: @@ -467,7 +465,7 @@ class AzureRMVirtualHubConnection(AzureRMModuleBaseExt): virtual_hub_name=self.vhub_name, connection_name=self.name, hub_virtual_network_connection_parameters=self.body) - if isinstance(response, AzureOperationPoller) or isinstance(response, LROPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) except Exception as exc: self.log('Error attempting to create the VirtualHub instance.') diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualhubconnection_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualhubconnection_info.py index d2d01dc25..d12d689d3 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualhubconnection_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualhubconnection_info.py @@ -40,16 +40,16 @@ author: ''' EXAMPLES = ''' - - name: Get virtual hub connection info by name - azure_rm_virtualhubconnection_info: - resource_group: myResourceGroup - virtual_hub_name: virtualHub - name: vhubname +- name: Get virtual hub connection info by name + azure_rm_virtualhubconnection_info: + resource_group: myResourceGroup + virtual_hub_name: virtualHub + name: vhubname - - name: Get virtual hub connection info by resource group - azure_rm_virtualhubconnection_info: - resource_group: myResourceGroup - virtual_hub_name: virtualHub +- name: Get virtual hub connection info by resource group + azure_rm_virtualhubconnection_info: + resource_group: myResourceGroup + virtual_hub_name: virtualHub ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachine.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachine.py index 9fe82d75a..35435b821 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachine.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachine.py @@ -30,16 +30,19 @@ options: description: - Name of the resource group containing the VM. required: true + type: str name: description: - Name of the VM. required: true + type: str custom_data: description: - Data made available to the VM and used by C(cloud-init). - Only used on Linux images with C(cloud-init) enabled. - Consult U(https://docs.microsoft.com/en-us/azure/virtual-machines/linux/using-cloud-init#cloud-init-overview) for cloud-init ready images. - To enable cloud-init on a Linux image, follow U(https://docs.microsoft.com/en-us/azure/virtual-machines/linux/cloudinit-prepare-custom-image). + type: str state: description: - State of the VM. @@ -47,15 +50,23 @@ options: - Set to C(absent) to remove a VM. - Does not affect power state. Use I(started)/I(allocated)/I(restarted) parameters to change the power state of a VM. default: present + type: str choices: - absent - present started: description: - Whether the VM is started or stopped. - - Set to (true) with I(state=present) to start the VM. + - Set to C(true) with I(state=present) to start the VM. - Set to C(false) to stop the VM. type: bool + force: + description: + - Use more force during stop of VM + - Set to C(true) with I(started=false) to stop the VM forcefully (hard poweroff -- skip_shutdown) + - Set to C(false) to power off gracefully + default: false + type: bool allocated: description: - Whether the VM is allocated or deallocated, only useful with I(state=present). @@ -76,19 +87,23 @@ options: location: description: - Valid Azure location for the VM. Defaults to location of the resource group. + type: str short_hostname: description: - Name assigned internally to the host. On a Linux VM this is the name returned by the C(hostname) command. - When creating a VM, short_hostname defaults to I(name). + type: str vm_size: description: - A valid Azure VM size value. For example, C(Standard_D4). - Choices vary depending on the subscription and location. Check your subscription for available choices. - Required when creating a VM. + type: str priority: description: - Priority of the VM. - C(None) is the equivalent of Regular VM. + type: str choices: - None - Spot @@ -96,6 +111,7 @@ options: description: - Specifies the eviction policy for the Azure Spot virtual machine. - Requires priority to be set to Spot. + type: str choices: - Deallocate - Delete @@ -105,15 +121,18 @@ options: - This price is in US Dollars. - C(-1) indicates default price to be up-to on-demand. - Requires priority to be set to Spot. + type: float default: -1 admin_username: description: - Admin username used to access the VM after it is created. - Required when creating a VM. + type: str admin_password: description: - Password for the admin username. - Not required if the I(os_type=Linux) and SSH password authentication is disabled by setting I(ssh_password_enabled=false). + type: str ssh_password_enabled: description: - Whether to enable or disable SSH passwords. @@ -126,16 +145,20 @@ options: - Accepts a list of dicts where each dictionary contains two keys, I(path) and I(key_data). - Set I(path) to the default location of the authorized_keys files. For example, I(path=/home/<admin username>/.ssh/authorized_keys). - Set I(key_data) to the actual value of the public key. + type: list + elements: dict image: description: - The image used to build the VM. - For custom images, the name of the image. To narrow the search to a specific resource group, a dict with the keys I(name) and I(resource_group). - For Marketplace images, a dict with the keys I(publisher), I(offer), I(sku), and I(version). - Set I(version=latest) to get the most recent version of a given image. - required: true + - Required when creating. + type: raw availability_set: description: - Name or ID of an existing availability set to add the VM to. The I(availability_set) should be in the same resource group as VM. + type: str proximity_placement_group: description: - The name or ID of the proximity placement group the VM should be associated with. @@ -157,6 +180,7 @@ options: description: - Name of a storage account that supports creation of VHD blobs. - If not specified for a new VM, a new storage account named <vm name>01 will be created using storage type C(Standard_LRS). + type: str aliases: - storage_account storage_container_name: @@ -164,6 +188,7 @@ options: - Name of the container to use within the storage account to store VHD blobs. - If not specified, a default container will be created. default: vhds + type: str aliases: - storage_container storage_blob_name: @@ -171,6 +196,7 @@ options: - Name of the storage blob used to hold the OS disk image of the VM. - Must end with '.vhd'. - If not specified, defaults to the VM name + '.vhd'. + type: str aliases: - storage_blob managed_disk_type: @@ -178,6 +204,7 @@ options: - Managed OS disk type. - Create OS disk with managed disk if defined. - If not defined, the OS disk will be created with virtual hard disk (VHD). + type: str choices: - Standard_LRS - StandardSSD_LRS @@ -188,9 +215,11 @@ options: os_disk_name: description: - OS disk name. + type: str os_disk_caching: description: - Type of OS disk caching. + type: str choices: - ReadOnly - ReadWrite @@ -199,9 +228,11 @@ options: os_disk_size_gb: description: - Size of OS disk in GB. + type: int os_type: description: - Base type of operating system. + type: str choices: - Windows - Linux @@ -215,22 +246,27 @@ options: description: - Describes list of data disks. - Use M(azure.azcollection.azure_rm_mangeddisk) to manage the specific disk. + type: list + elements: dict suboptions: lun: description: - The logical unit number for data disk. - This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. required: true + type: int disk_size_gb: description: - The initial disk size in GB for blank data disks. - This value cannot be larger than C(1023) GB. - Size can be changed only when the virtual machine is deallocated. - Not sure when I(managed_disk_id) defined. + type: int managed_disk_type: description: - Managed data disk type. - Only used when OS disk created with managed disk. + type: str choices: - Standard_LRS - StandardSSD_LRS @@ -245,6 +281,7 @@ options: - Only used when OS disk created with virtual hard disk (VHD). - Used when I(managed_disk_type) not defined. - Cannot be updated unless I(lun) updated. + type: str storage_container_name: description: - Name of the container to use within the storage account to store VHD blobs. @@ -252,6 +289,7 @@ options: - Only used when OS disk created with virtual hard disk (VHD). - Used when I(managed_disk_type) not defined. - Cannot be updated unless I(lun) updated. + type: str default: vhds storage_blob_name: description: @@ -261,19 +299,21 @@ options: - Only used when OS disk created with virtual hard disk (VHD). - Used when I(managed_disk_type) not defined. - Cannot be updated unless I(lun) updated. + type: str caching: description: - Type of data disk caching. + type: str choices: - ReadOnly - ReadWrite - default: ReadOnly public_ip_allocation_method: description: - Allocation method for the public IP of the VM. - Used only if a network interface is not specified. - When set to C(Dynamic), the public IP address may change any time the VM is rebooted or power cycled. - The C(Disabled) choice was added in Ansible 2.6. + type: str choices: - Dynamic - Static @@ -286,6 +326,8 @@ options: - List of ports to open in the security group for the VM, when a security group and network interface are created with a VM. - For Linux hosts, defaults to allowing inbound TCP connections to port 22. - For Windows hosts, defaults to opening ports 3389 and 5986. + type: list + elements: str network_interface_names: description: - Network interface names to add to the VM. @@ -294,16 +336,19 @@ options: - If a network interface name is not provided when the VM is created, a default network interface will be created. - To create a new network interface, at least one Virtual Network with one Subnet must exist. type: list + elements: raw aliases: - network_interfaces virtual_network_resource_group: description: - The resource group to use when creating a VM with another resource group's virtual network. + type: str virtual_network_name: description: - The virtual network to use when creating a VM. - If not specified, a new network interface will be created and assigned to the first virtual network found in the resource group. - Use with I(virtual_network_resource_group) to place the virtual network in another resource group. + type: str aliases: - virtual_network subnet_name: @@ -311,6 +356,7 @@ options: - Subnet for the VM. - Defaults to the first subnet found in the virtual network or the subnet of the I(network_interface_name), if provided. - If the subnet is in another resource group, specify the resource group with I(virtual_network_resource_group). + type: str aliases: - subnet created_nsg: @@ -318,7 +364,7 @@ options: - Whether network security group created and attached to network interface or not. type: bool default: True - version_added: '1.15.0' + version_added: '1.16.0' remove_on_absent: description: - Associated resources to remove when removing a VM using I(state=absent). @@ -327,6 +373,7 @@ options: - To remove only specific resources, set to C(network_interfaces), C(virtual_storage) or C(public_ips). - Any other input will be ignored. type: list + elements: str default: ['all'] plan: description: @@ -337,17 +384,21 @@ options: description: - Billing plan name. required: true + type: str product: description: - Product name. required: true + type: str publisher: description: - Publisher offering the plan. required: true + type: str promotion_code: description: - Optional promotion code. + type: str accept_terms: description: - Accept terms for Marketplace images that require it. @@ -359,11 +410,13 @@ options: description: - A list of Availability Zones for your VM. type: list + elements: str license_type: description: - On-premise license for the image or disk. - Only used for images that contain the Windows Server operating system. - To remove all license type settings, set to the string C(None). + type: str choices: - Windows_Server - Windows_Client @@ -372,30 +425,67 @@ options: vm_identity: description: - Identity for the VM. - choices: - - SystemAssigned + type: dict + suboptions: + type: + description: + - Type of the managed identity + required: true + choices: + - SystemAssigned + - UserAssigned + - SystemAssigned, UserAssigned + - None + type: str + user_assigned_identities: + description: + - User Assigned Managed Identities and its options + required: false + type: dict + default: {} + suboptions: + id: + description: + - List of the user assigned identities IDs associated to the VM + required: false + type: list + elements: str + default: [] + append: + description: + - If the list of identities has to be appended to current identities (true) or if it has to replace current identities (false) + required: false + type: bool + default: True winrm: description: - List of Windows Remote Management configurations of the VM. + type: list + elements: dict suboptions: protocol: description: - The protocol of the winrm listener. required: true + type: str choices: - http - https source_vault: description: - The relative URL of the Key Vault containing the certificate. + type: str certificate_url: description: - The URL of a certificate that has been uploaded to Key Vault as a secret. + type: str certificate_store: description: - The certificate store on the VM to which the certificate should be added. - The specified certificate store is implicitly in the LocalMachine account. + type: str boot_diagnostics: + type: dict description: - Manage boot diagnostics settings for a VM. - Boot diagnostics includes a serial console and remote console screenshots. @@ -403,21 +493,32 @@ options: enabled: description: - Flag indicating if boot diagnostics are enabled. - required: true type: bool + type: + description: + - Should the storage account be managed by azure or a custom storage account + - It is mutually exclusive with suboption I(storage_account) and I(resource_group) + required: false + type: str + choices: + - managed storage_account: description: - The name of an existing storage account to use for boot diagnostics. - If not specified, uses I(storage_account_name) defined one level up. - If storage account is not specified anywhere, and C(enabled) is C(true), a default storage account is created for boot diagnostics data. + - It is mutually exclusive with I(type) + type: str required: false resource_group: description: - Resource group where the storage account is located. + - It is mutually exclusive with I(type) type: str linux_config: description: - Specifies the Linux operating system settings on the virtual machine. + type: dict suboptions: disable_password_authentication: description: @@ -426,6 +527,7 @@ options: windows_config: description: - Specifies Windows operating system settings on the virtual machine. + type: dict suboptions: provision_vm_agent: description: @@ -567,7 +669,8 @@ EXAMPLES = ''' storage_container: osdisk storage_blob: osdisk.vhd boot_diagnostics: - enabled: yes + enabled: true + type: managed image: offer: 0001-com-ubuntu-server-focal publisher: canonical @@ -661,13 +764,13 @@ EXAMPLES = ''' azure_rm_virtualmachine: resource_group: myResourceGroup name: testvm002 - started: no + started: false - name: Deallocate azure_rm_virtualmachine: resource_group: myResourceGroup name: testvm002 - allocated: no + allocated: false - name: Power On azure_rm_virtualmachine: @@ -678,7 +781,7 @@ EXAMPLES = ''' azure_rm_virtualmachine: resource_group: myResourceGroup name: testvm002 - restarted: yes + restarted: true - name: Create a VM with an Availability Zone azure_rm_virtualmachine: @@ -700,9 +803,9 @@ EXAMPLES = ''' admin_password: "{{ password }}" security_profile: uefi_settings: - secure_boot_enabled: True - v_tpm_enabled: True - encryption_at_host: True + secure_boot_enabled: true + v_tpm_enabled: true + encryption_at_host: true security_type: TrustedLaunch ssh_public_keys: - path: /home/azureuser/.ssh/authorized_keys @@ -855,7 +958,7 @@ azure_vm: "adminUsername": "chouseknecht", "computerName": "test10", "linuxConfiguration": { - "disablePasswordAuthentication": false + "disable_password_authentication": false }, "secrets": [] }, @@ -902,9 +1005,8 @@ import time try: from azure.core.exceptions import ResourceNotFoundError from azure.core.polling import LROPoller - from msrestazure.azure_exceptions import CloudError from azure.core.exceptions import ResourceNotFoundError - from msrestazure.tools import parse_resource_id + from azure.mgmt.core.tools import parse_resource_id except ImportError: # This is handled in azure_rm_common pass @@ -949,6 +1051,16 @@ linux_configuration_spec = dict( disable_password_authentication=dict(type='bool') ) +user_assigned_identities_spec = dict( + id=dict(type='list', default=[], elements='str'), + append=dict(type='bool', default=True) +) + +managed_identity_spec = dict( + type=dict(type='str', choices=['SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'], required=True), + user_assigned_identities=dict(type='dict', options=user_assigned_identities_spec, default={}), +) + class AzureRMVirtualMachine(AzureRMModuleBase): @@ -968,7 +1080,7 @@ class AzureRMVirtualMachine(AzureRMModuleBase): admin_username=dict(type='str'), admin_password=dict(type='str', no_log=True), ssh_password_enabled=dict(type='bool', default=True, no_log=False), - ssh_public_keys=dict(type='list'), + ssh_public_keys=dict(type='list', elements='dict'), image=dict(type='raw'), availability_set=dict(type='str'), storage_account_name=dict(type='str', aliases=['storage_account']), @@ -982,9 +1094,9 @@ class AzureRMVirtualMachine(AzureRMModuleBase): os_type=dict(type='str', choices=['Linux', 'Windows'], default='Linux'), public_ip_allocation_method=dict(type='str', choices=['Dynamic', 'Static', 'Disabled'], default='Static', aliases=['public_ip_allocation']), - open_ports=dict(type='list'), + open_ports=dict(type='list', elements='str'), network_interface_names=dict(type='list', aliases=['network_interfaces'], elements='raw'), - remove_on_absent=dict(type='list', default=['all']), + remove_on_absent=dict(type='list', default=['all'], elements='str'), virtual_network_resource_group=dict(type='str'), virtual_network_name=dict(type='str', aliases=['virtual_network']), subnet_name=dict(type='str', aliases=['subnet']), @@ -992,15 +1104,47 @@ class AzureRMVirtualMachine(AzureRMModuleBase): allocated=dict(type='bool', default=True), restarted=dict(type='bool', default=False), started=dict(type='bool'), + force=dict(type='bool', default=False), generalized=dict(type='bool', default=False), - data_disks=dict(type='list'), + data_disks=dict( + type='list', + elements='dict', + options=dict( + lun=dict(type='int', required=True), + disk_size_gb=dict(type='int'), + managed_disk_type=dict(type='str', choices=['Standard_LRS', 'StandardSSD_LRS', + 'StandardSSD_ZRS', 'Premium_LRS', 'Premium_ZRS', 'UltraSSD_LRS']), + storage_account_name=dict(type='str'), + storage_container_name=dict(type='str', default='vhds'), + storage_blob_name=dict(type='str'), + caching=dict(type='str', choices=['ReadOnly', 'ReadOnly']) + ) + ), plan=dict(type='dict'), - zones=dict(type='list'), + zones=dict(type='list', elements='str'), accept_terms=dict(type='bool', default=False), license_type=dict(type='str', choices=['Windows_Server', 'Windows_Client', 'RHEL_BYOS', 'SLES_BYOS']), - vm_identity=dict(type='str', choices=['SystemAssigned']), - winrm=dict(type='list'), - boot_diagnostics=dict(type='dict'), + vm_identity=dict(type='dict', options=managed_identity_spec), + winrm=dict( + type='list', + elements='dict', + options=dict( + protocol=dict(type='str', required=True, choices=['http', 'https']), + source_vault=dict(type='str'), + certificate_url=dict(type='str'), + certificate_store=dict(type='str') + ) + ), + boot_diagnostics=dict( + type='dict', + options=dict( + enabled=dict(type='bool'), + type=dict(type='str', choices=['managed']), + storage_account=dict(type='str'), + resource_group=dict(type='str'), + ), + mutually_exclusive=[('type', 'storage_account'), ('type', 'resource_group')], + ), ephemeral_os_disk=dict(type='bool'), windows_config=dict(type='dict', options=windows_configuration_spec), linux_config=dict(type='dict', options=linux_configuration_spec), @@ -1070,7 +1214,7 @@ class AzureRMVirtualMachine(AzureRMModuleBase): @property def boot_diagnostics_present(self): - return self.boot_diagnostics is not None and 'enabled' in self.boot_diagnostics + return self.boot_diagnostics is not None and self.boot_diagnostics.get('enabled') is not None def get_boot_diagnostics_storage_account(self, limited=False, vm_dict=None): """ @@ -1095,8 +1239,8 @@ class AzureRMVirtualMachine(AzureRMModuleBase): - if not there, None """ bsa = None - if 'storage_account' in self.boot_diagnostics: - if 'resource_group' in self.boot_diagnostics: + if self.boot_diagnostics is not None and self.boot_diagnostics.get('storage_account') is not None: + if self.boot_diagnostics.get('resource_group') is not None: bsa = self.get_storage_account(self.boot_diagnostics['resource_group'], self.boot_diagnostics['storage_account']) else: bsa = self.get_storage_account(self.resource_group, self.boot_diagnostics['storage_account']) @@ -1235,18 +1379,18 @@ class AzureRMVirtualMachine(AzureRMModuleBase): differences = [] current_nics = [] results = vm_dict - current_osdisk = vm_dict['properties']['storageProfile']['osDisk'] - current_ephemeral = current_osdisk.get('diffDiskSettings', None) - current_properties = vm_dict['properties'] + current_osdisk = vm_dict['storage_profile']['os_disk'] + current_ephemeral = current_osdisk.get('diff_disk_ettings', None) + current_properties = vm_dict if self.priority and self.priority != current_properties.get('priority', 'None'): self.fail('VM Priority is not updatable: requested virtual machine priority is {0}'.format(self.priority)) if self.eviction_policy and \ - self.eviction_policy != current_properties.get('evictionPolicy', None): + self.eviction_policy != current_properties.get('eviction_policy', None): self.fail('VM Eviction Policy is not updatable: requested virtual machine eviction policy is {0}'.format(self.eviction_policy)) if self.max_price and \ - vm_dict['properties'].get('billingProfile', None) and \ - self.max_price != vm_dict['properties']['billingProfile'].get('maxPrice', None): + vm_dict.get('billing_profile', None) and \ + self.max_price != vm_dict['billing_profile'].get('max_price', None): self.fail('VM Maximum Price is not updatable: requested virtual machine maximum price is {0}'.format(self.max_price)) if self.ephemeral_os_disk and current_ephemeral is None: @@ -1256,7 +1400,7 @@ class AzureRMVirtualMachine(AzureRMModuleBase): # Try to determine if the VM needs to be updated if self.network_interface_names: - for nic in vm_dict['properties']['networkProfile']['networkInterfaces']: + for nic in vm_dict['network_profile']['network_interfaces']: current_nics.append(nic['id']) if set(current_nics) != set(network_interfaces): @@ -1264,47 +1408,47 @@ class AzureRMVirtualMachine(AzureRMModuleBase): differences.append('Network Interfaces') updated_nics = [dict(id=id, primary=(i == 0)) for i, id in enumerate(network_interfaces)] - vm_dict['properties']['networkProfile']['networkInterfaces'] = updated_nics + vm_dict['network_profile']['network_interfaces'] = updated_nics changed = True if self.os_disk_caching and \ - self.os_disk_caching != vm_dict['properties']['storageProfile']['osDisk']['caching']: + self.os_disk_caching != vm_dict['storage_profile']['os_disk']['caching']: self.log('CHANGED: virtual machine {0} - OS disk caching'.format(self.name)) differences.append('OS Disk caching') changed = True - vm_dict['properties']['storageProfile']['osDisk']['caching'] = self.os_disk_caching + vm_dict['storage_profile']['os_disk']['caching'] = self.os_disk_caching if self.os_disk_name and \ - self.os_disk_name != vm_dict['properties']['storageProfile']['osDisk']['name']: + self.os_disk_name != vm_dict['storage_profile']['os_disk']['name']: self.log('CHANGED: virtual machine {0} - OS disk name'.format(self.name)) differences.append('OS Disk name') changed = True - vm_dict['properties']['storageProfile']['osDisk']['name'] = self.os_disk_name + vm_dict['storage_profile']['os_disk']['name'] = self.os_disk_name if self.os_disk_size_gb and \ - self.os_disk_size_gb != vm_dict['properties']['storageProfile']['osDisk'].get('diskSizeGB'): + self.os_disk_size_gb != vm_dict['storage_profile']['os_disk'].get('disk_size_gb'): self.log('CHANGED: virtual machine {0} - OS disk size '.format(self.name)) differences.append('OS Disk size') changed = True - vm_dict['properties']['storageProfile']['osDisk']['diskSizeGB'] = self.os_disk_size_gb + vm_dict['storage_profile']['os_disk']['disk_size_gb'] = self.os_disk_size_gb if self.vm_size and \ - self.vm_size != vm_dict['properties']['hardwareProfile']['vmSize']: + self.vm_size != vm_dict['hardware_profile']['vm_size']: self.log('CHANGED: virtual machine {0} - size '.format(self.name)) differences.append('VM size') changed = True - vm_dict['properties']['hardwareProfile']['vmSize'] = self.vm_size + vm_dict['hardware_profile']['vm_size'] = self.vm_size update_tags, vm_dict['tags'] = self.update_tags(vm_dict.get('tags', dict())) if update_tags: differences.append('Tags') changed = True - if self.short_hostname and self.short_hostname != vm_dict['properties']['osProfile']['computerName']: + if self.short_hostname and self.short_hostname != vm_dict['os_profile']['computer_name']: self.log('CHANGED: virtual machine {0} - short hostname'.format(self.name)) differences.append('Short Hostname') changed = True - vm_dict['properties']['osProfile']['computerName'] = self.short_hostname + vm_dict['os_orofile']['computer_name'] = self.short_hostname if self.started and vm_dict['powerstate'] not in ['starting', 'running'] and self.allocated: self.log("CHANGED: virtual machine {0} not running and requested state 'running'".format(self.name)) @@ -1335,74 +1479,108 @@ class AzureRMVirtualMachine(AzureRMModuleBase): differences.append('Zones') changed = True - if self.license_type is not None and vm_dict['properties'].get('licenseType') != self.license_type: + if self.license_type is not None and vm_dict.get('licenseType') != self.license_type: differences.append('License Type') changed = True + if self.vm_identity: + update_vm_identity = False + # If type set to None, and VM has no current identities, nothing to do + if 'None' in self.vm_identity.get('type') and 'identity' not in vm_dict: + pass + # If type different to None, and VM has no current identities, update identities + elif 'identity' not in vm_dict: + update_vm_identity = True + # If type in module args different from type of vm_dict, update identities + elif vm_dict['identity']['type'] != self.vm_identity.get('type'): + update_vm_identity = True + # If type in module args contains 'UserAssigned' + elif 'UserAssigned' in self.vm_identity.get('type'): + # Create sets with current user identities and module args identities + new_managed_identities = set(self.vm_identity.get('user_assigned_identities', {}).get('id', [])) + current_managed_identities = set(vm_dict['identity']['user_assigned_identities'].keys()) + # If new identities have to be appended to VM + if self.vm_identity.get('user_assigned_identities', {}).get('append', False) is True: + # and the union of identities is longer + if len(current_managed_identities) != len(new_managed_identities.union(current_managed_identities)): + # update identities + update_vm_identity = True + # If new identities have to overwrite current identities + else: + # Check if module args identities are different as current ones + if current_managed_identities.difference(new_managed_identities) != set(): + update_vm_identity = True + if update_vm_identity: + differences.append('Managed Identities') + changed = True + if self.security_profile is not None: update_security_profile = False - if 'securityProfile' not in vm_dict['properties'].keys(): + if 'securityProfile' not in vm_dict.keys(): update_security_profile = True differences.append('security_profile') else: if self.security_profile.get('encryption_at_host') is not None: - if bool(self.security_profile.get('encryption_at_host')) != bool(vm_dict['properties']['securityProfile']['encryptionAtHost']): - update_security_profle = True + if bool(self.security_profile.get('encryption_at_host')) != bool(vm_dict['security_profile']['encryption_at_host']): + update_security_profile = True else: - self.security_profile['encryption_at_host'] = vm_dict['properties']['securityProfile']['encryptionAtHost'] + self.security_profile['encryption_at_host'] = vm_dict['security_profile']['encryption_at_host'] if self.security_profile.get('security_type') is not None: - if self.security_profile.get('security_type') != vm_dict['properties']['securityProfile']['securityType']: + if self.security_profile.get('security_type') != vm_dict['security_profile']['security_type']: update_security_profile = True if self.security_profile.get('uefi_settings') is not None: if self.security_profile['uefi_settings'].get('secure_boot_enabled') is not None: if bool(self.security_profile['uefi_settings']['secure_boot_enabled']) != \ - bool(vm_dict['properties']['securityProfile']['uefiSettings']['secureBootEnabled']): + bool(vm_dict['security_profile']['uefi_settings']['secure_boot_enabled']): update_security_profile = True else: self.security_profile['uefi_settings']['secure_boot_enabled'] = \ - vm_dict['properties']['securityProfile']['uefiSettings']['secureBootEnabled'] + vm_dict['security_profile']['uefi_settings']['secure_soot_enabled'] if self.security_profile['uefi_settings'].get('v_tpm_enabled') is not None: if bool(self.security_profile['uefi_settings']['v_tpm_enabled']) != \ - bool(vm_dict['properties']['securityProfile']['uefiSettings']['vTpmEnabled']): + bool(vm_dict['security_profile']['uefi_settings']['v_tpm_enabled']): update_security_profile = True else: self.security_profile['uefi_settings']['v_tpm_enabled'] = \ - vm_dict['properties']['securityProfile']['uefiSettings']['vTpmEnabled'] - if update_security_profile: - changed = True - differences.append('security_profile') + vm_dict['security_profile']['uefi_settings']['v_tpm_enabled'] + if update_security_profile: + changed = True + differences.append('security_profile') - if self.windows_config is not None and vm_dict['properties']['osProfile'].get('windowsConfiguration') is not None: - if self.windows_config['enable_automatic_updates'] != vm_dict['properties']['osProfile']['windowsConfiguration']['enableAutomaticUpdates']: + if self.windows_config is not None and vm_dict['os_profile'].get('windows_configuration') is not None: + if self.windows_config['enable_automatic_updates'] != vm_dict['os_profile']['windows_configuration']['enable_automatic_updates']: self.fail("(PropertyChangeNotAllowed) Changing property 'windowsConfiguration.enableAutomaticUpdates' is not allowed.") - if self.windows_config['provision_vm_agent'] != vm_dict['properties']['osProfile']['windowsConfiguration']['provisionVMAgent']: + if self.windows_config['provision_vm_agent'] != vm_dict['os_profile']['windows_configuration']['provision_vm_agent']: self.fail("(PropertyChangeNotAllowed) Changing property 'windowsConfiguration.provisionVMAgent' is not allowed.") - if self.linux_config is not None and vm_dict['properties']['osProfile'].get('linuxConfiguration') is not None: + if self.linux_config is not None and vm_dict['os_profile'].get('linux_configuration') is not None: if self.linux_config['disable_password_authentication'] != \ - vm_dict['properties']['osProfile']['linuxConfiguration']['disablePasswordAuthentication']: + vm_dict['os_profile']['linux_configuration']['disable_password_authentication']: self.fail("(PropertyChangeNotAllowed) Changing property 'linuxConfiguration.disablePasswordAuthentication' is not allowed.") # Defaults for boot diagnostics - if 'diagnosticsProfile' not in vm_dict['properties']: - vm_dict['properties']['diagnosticsProfile'] = {} - if 'bootDiagnostics' not in vm_dict['properties']['diagnosticsProfile']: - vm_dict['properties']['diagnosticsProfile']['bootDiagnostics'] = { + if 'diagnostics_profile' not in vm_dict: + vm_dict['diagnostics_profile'] = {} + if 'boot_diagnostics' not in vm_dict['diagnostics_profile']: + vm_dict['diagnostics_profile']['boot_diagnostics'] = { 'enabled': False, 'storageUri': None } if self.boot_diagnostics_present: - current_boot_diagnostics = vm_dict['properties']['diagnosticsProfile']['bootDiagnostics'] + current_boot_diagnostics = vm_dict['diagnostics_profile']['boot_diagnostics'] boot_diagnostics_changed = False if self.boot_diagnostics['enabled'] != current_boot_diagnostics['enabled']: current_boot_diagnostics['enabled'] = self.boot_diagnostics['enabled'] boot_diagnostics_changed = True - boot_diagnostics_storage_account = self.get_boot_diagnostics_storage_account( - limited=not self.boot_diagnostics['enabled'], vm_dict=vm_dict) - boot_diagnostics_blob = boot_diagnostics_storage_account.primary_endpoints.blob if boot_diagnostics_storage_account else None + if self.boot_diagnostics.get('type') is not None and self.boot_diagnostics['type'] == 'managed': + boot_diagnostics_blob = None + else: + boot_diagnostics_storage_account = self.get_boot_diagnostics_storage_account( + limited=not self.boot_diagnostics['enabled'], vm_dict=vm_dict) + boot_diagnostics_blob = boot_diagnostics_storage_account.primary_endpoints.blob if boot_diagnostics_storage_account else None if current_boot_diagnostics.get('storageUri') != boot_diagnostics_blob: current_boot_diagnostics['storageUri'] = boot_diagnostics_blob boot_diagnostics_changed = True @@ -1529,7 +1707,7 @@ class AzureRMVirtualMachine(AzureRMModuleBase): promotion_code=self.plan.get('promotion_code')) # do this before creating vm_resource as it can modify tags - if self.boot_diagnostics_present and self.boot_diagnostics['enabled']: + if self.boot_diagnostics_present and self.boot_diagnostics['enabled'] and self.boot_diagnostics.get('type') != 'managed': boot_diag_storage_account = self.get_boot_diagnostics_storage_account() vm_resource = self.compute_models.VirtualMachine( @@ -1574,7 +1752,22 @@ class AzureRMVirtualMachine(AzureRMModuleBase): vm_resource.license_type = self.license_type if self.vm_identity: - vm_resource.identity = self.compute_models.VirtualMachineIdentity(type=self.vm_identity) + # If UserAssigned in module args and ids specified + if 'UserAssigned' in self.vm_identity.get('type') and len(self.vm_identity.get('user_assigned_identities', {}).get('id', [])) != 0: + user_assigned_identities_dict = {uami: dict() for uami in self.vm_identity.get('user_assigned_identities').get('id')} + # Append identities to the model + vm_resource.identity = self.compute_models.VirtualMachineIdentity( + type=self.vm_identity.get('type'), + user_assigned_identities=user_assigned_identities_dict + ) + # If UserAssigned in module args, but ids are not specified + elif 'UserAssigned' in self.vm_identity.get('type') and len(self.vm_identity.get('user_assigned_identities', {}).get('id', [])) == 0: + self.fail("UserAssigned specified but no User Identity IDs provided") + # In any other case ('SystemAssigned' or 'None') apply the configuration to the model + else: + vm_resource.identity = self.compute_models.VirtualMachineIdentity( + type=self.vm_identity.get('type') + ) if self.winrm: winrm_listeners = list() @@ -1611,7 +1804,7 @@ class AzureRMVirtualMachine(AzureRMModuleBase): ) if self.boot_diagnostics_present: - if self.boot_diagnostics['enabled']: + if self.boot_diagnostics['enabled'] and self.boot_diagnostics.get('type') != 'managed': storage_uri = boot_diag_storage_account.primary_endpoints.blob else: storage_uri = None @@ -1732,43 +1925,43 @@ class AzureRMVirtualMachine(AzureRMModuleBase): self.log("Update virtual machine {0}".format(self.name)) self.results['actions'].append('Updated VM {0}'.format(self.name)) nics = [self.compute_models.NetworkInterfaceReference(id=interface['id'], primary=(i == 0)) - for i, interface in enumerate(vm_dict['properties']['networkProfile']['networkInterfaces'])] + for i, interface in enumerate(vm_dict['network_profile']['network_interfaces'])] # os disk - if not vm_dict['properties']['storageProfile']['osDisk'].get('managedDisk'): + if not vm_dict['storage_profile']['os_disk'].get('managedDisk'): managed_disk = None - vhd = self.compute_models.VirtualHardDisk(uri=vm_dict['properties']['storageProfile']['osDisk'].get('vhd', {}).get('uri')) + vhd = self.compute_models.VirtualHardDisk(uri=vm_dict['storage_profile']['os_disk'].get('vhd', {}).get('uri')) else: vhd = None managed_disk = self.compute_models.ManagedDiskParameters( - storage_account_type=vm_dict['properties']['storageProfile']['osDisk']['managedDisk'].get('storageAccountType') + storage_account_type=vm_dict['storage_profile']['os_disk']['managed_disk'].get('storage_account_type') ) proximity_placement_group_resource = None try: - proximity_placement_group_resource = self.compute_models.SubResource(id=vm_dict['properties']['proximityPlacementGroup'].get('id')) + proximity_placement_group_resource = self.compute_models.SubResource(id=vm_dict['proximity_placement_group'].get('id')) except Exception: # pass if the proximity Placement Group pass availability_set_resource = None try: - availability_set_resource = self.compute_models.SubResource(id=vm_dict['properties']['availabilitySet'].get('id')) + availability_set_resource = self.compute_models.SubResource(id=vm_dict['availability_set'].get('id')) except Exception: # pass if the availability set is not set pass - if 'imageReference' in vm_dict['properties']['storageProfile'].keys(): - if 'id' in vm_dict['properties']['storageProfile']['imageReference'].keys(): + if 'imageReference' in vm_dict['storage_profile'].keys(): + if 'id' in vm_dict['storage_profile']['image_reference'].keys(): image_reference = self.compute_models.ImageReference( - id=vm_dict['properties']['storageProfile']['imageReference']['id'] + id=vm_dict['storage_profile']['image_reference']['id'] ) else: image_reference = self.compute_models.ImageReference( - publisher=vm_dict['properties']['storageProfile']['imageReference'].get('publisher'), - offer=vm_dict['properties']['storageProfile']['imageReference'].get('offer'), - sku=vm_dict['properties']['storageProfile']['imageReference'].get('sku'), - version=vm_dict['properties']['storageProfile']['imageReference'].get('version') + publisher=vm_dict['storage_profile']['image_reference'].get('publisher'), + offer=vm_dict['storage_profile']['image_reference'].get('offer'), + sku=vm_dict['storage_profile']['image_reference'].get('sku'), + version=vm_dict['storage_profile']['image_reference'].get('version') ) else: image_reference = None @@ -1777,10 +1970,10 @@ class AzureRMVirtualMachine(AzureRMModuleBase): if self.zones is not None and vm_dict['zones'] != self.zones: self.fail("You can't change the Availability Zone of a virtual machine (have: {0}, want: {1})".format(vm_dict['zones'], self.zones)) - if 'osProfile' in vm_dict['properties']: + if 'os_profile' in vm_dict: os_profile = self.compute_models.OSProfile( - admin_username=vm_dict['properties'].get('osProfile', {}).get('adminUsername'), - computer_name=vm_dict['properties'].get('osProfile', {}).get('computerName') + admin_username=vm_dict.get('os_profile', {}).get('admin_username'), + computer_name=vm_dict.get('os_profile', {}).get('computer_name') ) else: os_profile = None @@ -1789,17 +1982,17 @@ class AzureRMVirtualMachine(AzureRMModuleBase): location=vm_dict['location'], os_profile=os_profile, hardware_profile=self.compute_models.HardwareProfile( - vm_size=vm_dict['properties']['hardwareProfile'].get('vmSize') + vm_size=vm_dict['hardware_profile'].get('vm_size') ), storage_profile=self.compute_models.StorageProfile( os_disk=self.compute_models.OSDisk( - name=vm_dict['properties']['storageProfile']['osDisk'].get('name'), + name=vm_dict['storage_profile']['os_disk'].get('name'), vhd=vhd, managed_disk=managed_disk, - create_option=vm_dict['properties']['storageProfile']['osDisk'].get('createOption'), - os_type=vm_dict['properties']['storageProfile']['osDisk'].get('osType'), - caching=vm_dict['properties']['storageProfile']['osDisk'].get('caching'), - disk_size_gb=vm_dict['properties']['storageProfile']['osDisk'].get('diskSizeGB') + create_option=vm_dict['storage_profile']['os_disk'].get('create_option'), + os_type=vm_dict['storage_profile']['os_disk'].get('os_type'), + caching=vm_dict['storage_profile']['os_disk'].get('caching'), + disk_size_gb=vm_dict['storage_profile']['os_disk'].get('disk_size_gb') ), image_reference=image_reference ), @@ -1813,27 +2006,75 @@ class AzureRMVirtualMachine(AzureRMModuleBase): if self.license_type is not None: vm_resource.license_type = self.license_type + if self.vm_identity is not None: + # If 'append' is set to True save current user assigned managed identities to use later + if (self.vm_identity.get('user_assigned_identities', {}) is not None + and self.vm_identity.get('user_assigned_identities', {}).get('append', False) is True): + if 'identity' in vm_dict and 'user_assigned_identities' in vm_dict['identity']: + current_user_assigned_identities_dict = {uami: dict() for uami in vm_dict['identity']['user_assigned_identities'].keys()} + vm_identity_user_assigned_append = True + else: + # Nothing to append to + vm_identity_user_assigned_append = False + else: + # 'append' is False or unset + vm_identity_user_assigned_append = False + # If there are identities in 'id' and 'UserAssigned' in type + if 'UserAssigned' in self.vm_identity.get('type') and len(self.vm_identity.get('user_assigned_identities', {}).get('id', [])) != 0: + user_assigned_identities_dict = {uami: dict() for uami in self.vm_identity.get('user_assigned_identities').get('id')} + # If there are identities to append, merge the dicts + if vm_identity_user_assigned_append: + user_assigned_identities_dict = {**user_assigned_identities_dict, **current_user_assigned_identities_dict} + # Save the identity + vm_resource.identity = self.compute_models.VirtualMachineIdentity( + type=self.vm_identity.get('type'), + user_assigned_identities=user_assigned_identities_dict + ) + # If there are no identities in 'id' and 'UserAssigned' in type + elif 'UserAssigned' in self.vm_identity.get('type') and len(self.vm_identity.get('user_assigned_identities', {}).get('id', [])) == 0: + # Fail if append is False + if vm_identity_user_assigned_append is False: + self.fail("UserAssigned specified but no User Assigned IDs provided" + + " and no UserAssigned identities are currently assigned to the VM") + # If append is true, user is changing from 'UserAssigned' to 'SystemAssigned, UserAssigned' + # and wants to keep current UserAssigned identities + else: + # Save current identities + vm_resource.identity = self.compute_models.VirtualMachineIdentity( + type=self.vm_identity.get('type'), + user_assigned_identities=current_user_assigned_identities_dict + ) + # Set 'SystemAssigned' or 'None' + else: + vm_resource.identity = self.compute_models.VirtualMachineIdentity( + type=self.vm_identity.get('type') + ) + if self.boot_diagnostics is not None: + storage_uri = None + # storageUri is undefined if boot diagnostics is disabled + if 'storageUri' in vm_dict['diagnostics_profile']['boot_diagnostics']: + storage_uri = vm_dict['diagnostics_profile']['boot_diagnostics']['storageUri'] vm_resource.diagnostics_profile = self.compute_models.DiagnosticsProfile( boot_diagnostics=self.compute_models.BootDiagnostics( - enabled=vm_dict['properties']['diagnosticsProfile']['bootDiagnostics']['enabled'], - storage_uri=vm_dict['properties']['diagnosticsProfile']['bootDiagnostics']['storageUri'])) + enabled=vm_dict['diagnostics_profile']['boot_diagnostics']['enabled'], + storage_uri=storage_uri)) if vm_dict.get('tags'): vm_resource.tags = vm_dict['tags'] # Add custom_data, if provided - if vm_dict['properties'].get('osProfile', {}).get('customData'): - custom_data = vm_dict['properties']['osProfile']['customData'] + if vm_dict.get('os_profile', {}).get('custom_data'): + custom_data = vm_dict['os_profile']['custom_data'] # Azure SDK (erroneously?) wants native string type for this vm_resource.os_profile.custom_data = to_native(base64.b64encode(to_bytes(custom_data))) # Add admin password, if one provided - if vm_dict['properties'].get('osProfile', {}).get('adminPassword'): - vm_resource.os_profile.admin_password = vm_dict['properties']['osProfile']['adminPassword'] + if vm_dict.get('os_profile', {}).get('admin_password'): + vm_resource.os_profile.admin_password = vm_dict['os_profile']['admin_password'] # Add Windows configuration, if applicable - windows_config = vm_dict['properties'].get('osProfile', {}).get('windowsConfiguration') + windows_config = vm_dict.get('os_profile', {}).get('windows_configuration') if windows_config: if self.windows_config is not None: vm_resource.os_profile.windows_configuration = self.compute_models.WindowsConfiguration( @@ -1847,7 +2088,7 @@ class AzureRMVirtualMachine(AzureRMModuleBase): ) # Add linux configuration, if applicable - linux_config = vm_dict['properties'].get('osProfile', {}).get('linuxConfiguration') + linux_config = vm_dict.get('os_profile', {}).get('linux_configuration') if linux_config: if self.linux_config is not None: vm_resource.os_profile.linux_configuration = self.compute_models.LinuxConfiguration( @@ -1855,7 +2096,7 @@ class AzureRMVirtualMachine(AzureRMModuleBase): ) else: vm_resource.os_profile.linux_configuration = self.compute_models.LinuxConfiguration( - disable_password_authentication=linux_config.get('disablePasswordAuthentication', False) + disable_password_authentication=linux_config.get('disable_password_authentication', False) ) ssh_config = linux_config.get('ssh', None) if ssh_config: @@ -1868,12 +2109,12 @@ class AzureRMVirtualMachine(AzureRMModuleBase): ) # data disk - if vm_dict['properties']['storageProfile'].get('dataDisks'): + if vm_dict['storage_profile'].get('data_disks'): data_disks = [] - for data_disk in vm_dict['properties']['storageProfile']['dataDisks']: - if data_disk.get('managedDisk'): - managed_disk_type = data_disk['managedDisk'].get('storageAccountType') + for data_disk in vm_dict['storage_profile']['data_disks']: + if data_disk.get('managed_disk'): + managed_disk_type = data_disk['managed_disk'].get('storage_account_type') data_disk_managed_disk = self.compute_models.ManagedDiskParameters(storage_account_type=managed_disk_type) data_disk_vhd = None else: @@ -1885,8 +2126,8 @@ class AzureRMVirtualMachine(AzureRMModuleBase): name=data_disk.get('name'), vhd=data_disk_vhd, caching=data_disk.get('caching'), - create_option=data_disk.get('createOption'), - disk_size_gb=int(data_disk.get('diskSizeGB', 0)) or None, + create_option=data_disk.get('create_option'), + disk_size_gb=int(data_disk.get('disk_size_gb', 0)) or None, managed_disk=data_disk_managed_disk, )) vm_resource.storage_profile.data_disks = data_disks @@ -1980,16 +2221,16 @@ class AzureRMVirtualMachine(AzureRMModuleBase): for interface in vm.network_profile.network_interfaces: int_dict = azure_id_to_dict(interface.id) nic = self.get_network_interface(int_dict['resourceGroups'], int_dict['networkInterfaces']) - for interface_dict in result['properties']['networkProfile']['networkInterfaces']: + for interface_dict in result['network_profile']['network_interfaces']: if interface_dict['id'] == interface.id: nic_dict = self.serialize_obj(nic, 'NetworkInterface') interface_dict['name'] = int_dict['networkInterfaces'] - interface_dict['properties'] = nic_dict['properties'] + interface_dict['properties'] = nic_dict # Expand public IPs to include config properties - for interface in result['properties']['networkProfile']['networkInterfaces']: - for config in interface['properties']['ipConfigurations']: - if config['properties'].get('publicIPAddress'): - pipid_dict = azure_id_to_dict(config['properties']['publicIPAddress']['id']) + for interface in result['network_profile']['network_interfaces']: + for config in interface['properties']['ip_configurations']: + if config.get('public_ip_address'): + pipid_dict = azure_id_to_dict(config['public_ip_address']['id']) try: pip = self.network_client.public_ip_addresses.get(pipid_dict['resourceGroups'], pipid_dict['publicIPAddresses']) @@ -1997,8 +2238,8 @@ class AzureRMVirtualMachine(AzureRMModuleBase): self.fail("Error fetching public ip {0} - {1}".format(pipid_dict['publicIPAddresses'], str(exc))) pip_dict = self.serialize_obj(pip, 'PublicIPAddress') - config['properties']['publicIPAddress']['name'] = pipid_dict['publicIPAddresses'] - config['properties']['publicIPAddress']['properties'] = pip_dict['properties'] + config['public_ip_address']['name'] = pipid_dict['publicIPAddresses'] + config['public_ip_address']['properties'] = pip_dict['ip_configuration'] self.log(result, pretty_print=True) if self.state != 'absent' and not result['powerstate']: @@ -2006,10 +2247,10 @@ class AzureRMVirtualMachine(AzureRMModuleBase): return result def power_off_vm(self): - self.log("Powered off virtual machine {0}".format(self.name)) - self.results['actions'].append("Powered off virtual machine {0}".format(self.name)) + self.log("Powered off virtual machine {0} - Skip_Shutdown {1}".format(self.name, self.force)) + self.results['actions'].append("Powered off virtual machine {0} - Skip_Shutdown {1}".format(self.name, self.force)) try: - poller = self.compute_client.virtual_machines.begin_power_off(self.resource_group, self.name) + poller = self.compute_client.virtual_machines.begin_power_off(self.resource_group, self.name, skip_shutdown=self.force) self.get_poller_result(poller) except Exception as exc: self.fail("Error powering off virtual machine {0} - {1}".format(self.name, str(exc))) @@ -2459,7 +2700,7 @@ class AzureRMVirtualMachine(AzureRMModuleBase): try: subnet = self.network_client.subnets.get(virtual_network_resource_group, virtual_network_name, self.subnet_name) subnet_id = subnet.id - except CloudError as exc: + except Exception as exc: self.fail("Error: fetching subnet {0} - {1}".format(self.subnet_name, str(exc))) else: no_subnets_msg = "Error: unable to find a subnet in virtual network {0}. A virtual network " \ diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachine_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachine_info.py index 50d909c92..d94f9848e 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachine_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachine_info.py @@ -25,9 +25,11 @@ options: resource_group: description: - Name of the resource group containing the virtual machines (required when filtering by vm name). + type: str name: description: - Name of the virtual machine. + type: str tags: description: - Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. @@ -44,21 +46,21 @@ author: ''' EXAMPLES = ''' - - name: Get facts for all virtual machines of a resource group - azure_rm_virtualmachine_info: - resource_group: myResourceGroup - - - name: Get facts by name - azure_rm_virtualmachine_info: - resource_group: myResourceGroup - name: myVm - - - name: Get facts by tags - azure_rm_virtualmachine_info: - resource_group: myResourceGroup - tags: - - testing - - foo:bar +- name: Get facts for all virtual machines of a resource group + azure_rm_virtualmachine_info: + resource_group: myResourceGroup + +- name: Get facts by name + azure_rm_virtualmachine_info: + resource_group: myResourceGroup + name: myVm + +- name: Get facts by tags + azure_rm_virtualmachine_info: + resource_group: myResourceGroup + tags: + - testing + - foo:bar ''' RETURN = ''' @@ -275,44 +277,44 @@ vms: description: - Specifies the Security related profile settings for the virtual machine. type: complex - returned: always + returned: when-used contains: encryption_at_host: description: - This property can be used by user in the request to enable or disable the Host Encryption for the virtual machine. - This will enable the encryption for all the disks including Resource/Temp disk at host itself. type: bool - returned: always + returned: when-enabled sample: True security_type: description: - Specifies the SecurityType of the virtual machine. - It is set as TrustedLaunch to enable UefiSettings. type: str - returned: always + returned: when-enabled sample: TrustedLaunch uefi_settings: description: - Specifies the security settings like secure boot and vTPM used while creating the virtual machine. type: complex - returned: always + returned: when-enabled contains: secure_boot_enabled: description: - Specifies whether secure boot should be enabled on the virtual machine. type: bool - returned: always + returned: when-enabled sample: True v_tpm_enabled: description: - Specifies whether vTPM should be enabled on the virtual machine. type: bool - returned: always + returned: when-enabled sample: True ''' try: - from msrestazure.tools import parse_resource_id + from azure.mgmt.core.tools import parse_resource_id from azure.core.exceptions import ResourceNotFoundError except Exception: # This is handled in azure_rm_common @@ -445,13 +447,13 @@ class AzureRMVirtualMachineInfo(AzureRMModuleBase): code = instance['statuses'][index]['code'].split('/') if code[0] == 'PowerState': power_state = code[1] - display_status = instance['statuses'][index]['displayStatus'] + display_status = instance['statuses'][index]['display_status'] elif code[0] == 'OSState' and code[1] == 'generalized': - display_status = instance['statuses'][index]['displayStatus'] + display_status = instance['statuses'][index]['display_status'] power_state = 'generalized' break elif code[0] == 'ProvisioningState' and code[1] == 'failed': - display_status = instance['statuses'][index]['displayStatus'] + display_status = instance['statuses'][index]['display_status'] power_state = '' break @@ -459,11 +461,16 @@ class AzureRMVirtualMachineInfo(AzureRMModuleBase): if vm.security_profile is not None: new_result['security_profile'] = dict() - new_result['security_profile']['encryption_at_host'] = vm.security_profile.encryption_at_host - new_result['security_profile']['security_type'] = vm.security_profile.security_type - new_result['security_profile']['uefi_settings'] = dict() - new_result['security_profile']['uefi_settings']['secure_boot_enabled'] = vm.security_profile.uefi_settings.secure_boot_enabled - new_result['security_profile']['uefi_settings']['v_tpm_enabled'] = vm.security_profile.uefi_settings.v_tpm_enabled + if vm.security_profile.encryption_at_host is not None: + new_result['security_profile']['encryption_at_host'] = vm.security_profile.encryption_at_host + if vm.security_profile.security_type is not None: + new_result['security_profile']['security_type'] = vm.security_profile.security_type + if vm.security_profile.uefi_settings is not None: + new_result['security_profile']['uefi_settings'] = dict() + if vm.security_profile.uefi_settings.secure_boot_enabled is not None: + new_result['security_profile']['uefi_settings']['secure_boot_enabled'] = vm.security_profile.uefi_settings.secure_boot_enabled + if vm.security_profile.uefi_settings.v_tpm_enabled is not None: + new_result['security_profile']['uefi_settings']['v_tpm_enabled'] = vm.security_profile.uefi_settings.v_tpm_enabled new_result['power_state'] = power_state new_result['display_status'] = display_status @@ -473,13 +480,13 @@ class AzureRMVirtualMachineInfo(AzureRMModuleBase): new_result['name'] = vm.name new_result['state'] = 'present' new_result['location'] = vm.location - new_result['vm_size'] = result['properties']['hardwareProfile']['vmSize'] - new_result['proximityPlacementGroup'] = result['properties'].get('proximityPlacementGroup') + new_result['vm_size'] = result['hardware_profile']['vm_size'] + new_result['proximityPlacementGroup'] = result.get('proximity_placement_group') new_result['zones'] = result.get('zones', None) - os_profile = result['properties'].get('osProfile') + os_profile = result.get('os_profile') if os_profile is not None: - new_result['admin_username'] = os_profile.get('adminUsername') - image = result['properties']['storageProfile'].get('imageReference') + new_result['admin_username'] = os_profile.get('admin_username') + image = result['storage_profile'].get('image_reference') if image is not None: if image.get('publisher', None) is not None: new_result['image'] = { @@ -494,40 +501,40 @@ class AzureRMVirtualMachineInfo(AzureRMModuleBase): } new_result['boot_diagnostics'] = { - 'enabled': 'diagnosticsProfile' in result['properties'] and - 'bootDiagnostics' in result['properties']['diagnosticsProfile'] and - result['properties']['diagnosticsProfile']['bootDiagnostics']['enabled'] or False, - 'storage_uri': 'diagnosticsProfile' in result['properties'] and - 'bootDiagnostics' in result['properties']['diagnosticsProfile'] and - result['properties']['diagnosticsProfile']['bootDiagnostics'].get('storageUri', None) + 'enabled': 'diagnostics_profile' in result and + 'boot_diagnostics' in result['diagnostics_profile'] and + result['diagnostics_profile']['boot_diagnostics']['enabled'] or False, + 'storage_uri': 'diagnostics_profile' in result and + 'boot_diagnostics' in result['diagnostics_profile'] and + result['diagnostics_profile']['boot_diagnostics'].get('storageUri', None) } if new_result['boot_diagnostics']['enabled']: - new_result['boot_diagnostics']['console_screenshot_uri'] = result['properties']['instanceView']['bootDiagnostics'].get('consoleScreenshotBlobUri') - new_result['boot_diagnostics']['serial_console_log_uri'] = result['properties']['instanceView']['bootDiagnostics'].get('serialConsoleLogBlobUri') + new_result['boot_diagnostics']['console_screenshot_uri'] = result['instance_view']['boot_diagnostics'].get('console_screenshot_blob_uri') + new_result['boot_diagnostics']['serial_console_log_uri'] = result['instance_view']['boot_diagnostics'].get('serial_console_log_blob_uri') - vhd = result['properties']['storageProfile']['osDisk'].get('vhd') + vhd = result['storage_profile']['os_disk'].get('vhd') if vhd is not None: url = urlparse(vhd['uri']) new_result['storage_account_name'] = url.netloc.split('.')[0] new_result['storage_container_name'] = url.path.split('/')[1] new_result['storage_blob_name'] = url.path.split('/')[-1] - new_result['os_disk_caching'] = result['properties']['storageProfile']['osDisk']['caching'] - new_result['os_type'] = result['properties']['storageProfile']['osDisk']['osType'] + new_result['os_disk_caching'] = result['storage_profile']['os_disk']['caching'] + new_result['os_type'] = result['storage_profile']['os_disk']['os_type'] new_result['data_disks'] = [] - disks = result['properties']['storageProfile']['dataDisks'] + disks = result['storage_profile']['data_disks'] for disk_index in range(len(disks)): new_result['data_disks'].append({ 'lun': disks[disk_index].get('lun'), 'name': disks[disk_index].get('name'), - 'disk_size_gb': disks[disk_index].get('diskSizeGB'), - 'managed_disk_type': disks[disk_index].get('managedDisk', {}).get('storageAccountType'), - 'managed_disk_id': disks[disk_index].get('managedDisk', {}).get('id'), + 'disk_size_gb': disks[disk_index].get('disk_size_gb'), + 'managed_disk_type': disks[disk_index].get('managed_disk', {}).get('storage_account_type'), + 'managed_disk_id': disks[disk_index].get('managed_disk', {}).get('id'), 'caching': disks[disk_index].get('caching') }) new_result['network_interface_names'] = [] - nics = result['properties']['networkProfile']['networkInterfaces'] + nics = result['network_profile']['network_interfaces'] for nic_index in range(len(nics)): new_result['network_interface_names'].append(re.sub('.*networkInterfaces/', '', nics[nic_index]['id'])) diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachineextension_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachineextension_info.py index 98f748c2f..f9068d7ae 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachineextension_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachineextension_info.py @@ -46,16 +46,16 @@ author: ''' EXAMPLES = ''' - - name: Get information on specific Virtual Machine Extension - azure_rm_virtualmachineextension_info: - resource_group: myResourceGroup - virtual_machine_name: myvm - name: myextension - - - name: List installed Virtual Machine Extensions - azure_rm_virtualmachineextension_info: - resource_group: myResourceGroup - virtual_machine_name: myvm +- name: Get information on specific Virtual Machine Extension + azure_rm_virtualmachineextension_info: + resource_group: myResourceGroup + virtual_machine_name: myvm + name: myextension + +- name: List installed Virtual Machine Extensions + azure_rm_virtualmachineextension_info: + resource_group: myResourceGroup + virtual_machine_name: myvm ''' RETURN = ''' @@ -138,7 +138,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachineimage_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachineimage_info.py index fc18f2dd2..9d314ef91 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachineimage_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachineimage_info.py @@ -26,18 +26,23 @@ options: - Azure location value, for example C(westus), C(eastus), C(eastus2), C(northcentralus), etc. - Supplying only a location value will yield a list of available publishers for the location. required: true + type: str publisher: description: - Name of an image publisher. List image offerings associated with a particular publisher. + type: str offer: description: - Name of an image offering. Combine with SKU to see a list of available image versions. + type: str sku: description: - Image offering SKU. Combine with offer to see a list of available versions. + type: str version: description: - Specific version number of an image. + type: str extends_documentation_fragment: - azure.azcollection.azure @@ -49,30 +54,29 @@ author: ''' EXAMPLES = ''' - - name: Get facts for a specific image - azure_rm_virtualmachineimage_info: - location: eastus - publisher: OpenLogic - offer: CentOS - sku: '7.1' - version: '7.1.20160308' - - - name: List available versions - azure_rm_virtualmachineimage_info: - location: eastus - publisher: OpenLogic - offer: CentOS - sku: '7.1' - - - name: List available offers - azure_rm_virtualmachineimage_info: - location: eastus - publisher: OpenLogic - - - name: List available publishers - azure_rm_virtualmachineimage_info: - location: eastus - +- name: Get facts for a specific image + azure_rm_virtualmachineimage_info: + location: eastus + publisher: OpenLogic + offer: CentOS + sku: '7.1' + version: '7.1.20160308' + +- name: List available versions + azure_rm_virtualmachineimage_info: + location: eastus + publisher: OpenLogic + offer: CentOS + sku: '7.1' + +- name: List available offers + azure_rm_virtualmachineimage_info: + location: eastus + publisher: OpenLogic + +- name: List available publishers + azure_rm_virtualmachineimage_info: + location: eastus ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinescaleset.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinescaleset.py index ee3b822b5..4a64628fb 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinescaleset.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinescaleset.py @@ -25,10 +25,12 @@ options: description: - Name of the resource group containing the virtual machine scale set. required: true + type: str name: description: - Name of the virtual machine. required: true + type: str state: description: - Assert the state of the virtual machine scale set. @@ -36,26 +38,32 @@ options: of the existing machine does not match, the machine will be updated. - State C(absent) will remove the virtual machine scale set. default: present + type: str choices: - absent - present location: description: - Valid Azure location. Defaults to location of the resource group. + type: str short_hostname: description: - Short host name. + type: str vm_size: description: - A valid Azure VM size value. For example, C(Standard_D4). - The list of choices varies depending on the subscription and location. Check your subscription for available choices. + type: str capacity: description: - Capacity of VMSS. default: 1 + type: int tier: description: - SKU Tier. + type: str choices: - Basic - Standard @@ -63,6 +71,7 @@ options: description: - Upgrade policy. - Required when creating the Azure virtual machine scale sets. + type: str choices: - Manual - Automatic @@ -70,6 +79,7 @@ options: description: - Priority of the VMSS. - C(None) is the equivalent of Regular VM. + type: str choices: - None - Spot @@ -77,6 +87,7 @@ options: description: - Specifies the eviction policy for the Azure Spot virtual machine. - Requires priority to be set to Spot. + type: str choices: - Deallocate - Delete @@ -87,13 +98,16 @@ options: - C(-1) indicates default price to be up-to on-demand. - Requires priority to be set to Spot. default: -1 + type: float admin_username: description: - Admin username used to access the host after it is created. Required when creating a VM. + type: str admin_password: description: - Password for the admin username. - Not required if the os_type is Linux and SSH password authentication is disabled by setting I(ssh_password_enabled=false). + type: str ssh_password_enabled: description: - When the os_type is Linux, setting I(ssh_password_enabled=false) will disable SSH password authentication and require use of SSH keys. @@ -106,6 +120,8 @@ options: - Set the C(path) to the default location of the authorized_keys files. - On an Enterprise Linux host, for example, the I(path=/home/<admin username>/.ssh/authorized_keys). Set C(key_data) to the actual value of the public key. + type: list + elements: dict image: description: - Specifies the image used to build the VM. @@ -115,10 +131,12 @@ options: - If a dict with the keys I(name) and I(resource_group), the image is sourced from a custom image based on the I(name) and I(resource_group) set. Note that the key I(resource_group) is optional and if omitted, all images in the subscription will be searched for by I(name). - Custom image support was added in Ansible 2.5. - required: true + - Required when creating. + type: raw os_disk_caching: description: - Type of OS disk caching. + type: str choices: - ReadOnly - ReadWrite @@ -133,6 +151,7 @@ options: os_type: description: - Base type of operating system. + type: str choices: - Windows - Linux @@ -145,6 +164,7 @@ options: managed_disk_type: description: - Managed disk type. + type: str choices: - Standard_LRS - Premium_LRS @@ -155,17 +175,22 @@ options: data_disks: description: - Describes list of data disks. + type: list + elements: dict suboptions: lun: description: - The logical unit number for data disk. - default: 0 + default: '0' + type: str disk_size_gb: description: - The initial disk size in GB for blank data disks. + type: int managed_disk_type: description: - Managed data disk type. + type: str choices: - Standard_LRS - Premium_LRS @@ -176,6 +201,7 @@ options: caching: description: - Type of data disk caching. + type: str choices: - ReadOnly - ReadWrite @@ -185,14 +211,17 @@ options: - When creating a virtual machine, if a specific virtual network from another resource group should be used. - Use this parameter to specify the resource group to use. + type: str virtual_network_name: description: - Virtual Network name. aliases: - virtual_network + type: str subnet_name: description: - Subnet name. + type: str aliases: - subnet public_ip_per_vm: @@ -203,14 +232,18 @@ options: load_balancer: description: - Load balancer name. + type: str application_gateway: description: - Application gateway name. + type: str remove_on_absent: description: - When removing a VM using I(state=absent), also remove associated resources. - It can be C(all) or a list with any of the following ['network_interfaces', 'virtual_storage', 'public_ips']. - Any other input will be ignored. + type: list + elements: str default: ['all'] enable_accelerated_networking: description: @@ -224,6 +257,7 @@ options: - It can be a dict which contains I(name) and I(resource_group) of the security group. aliases: - security_group_name + type: raw overprovision: description: - Specifies whether the Virtual Machine Scale Set should be overprovisioned. @@ -242,21 +276,26 @@ options: description: - Billing plan name. required: true + type: str product: description: - Product name. required: true + type: str publisher: description: - Publisher offering the plan. required: true + type: str promotion_code: description: - Optional promotion code. + type: str zones: description: - A list of Availability Zones for your virtual machine scale set. type: list + elements: str custom_data: description: - Data which is made available to the virtual machine and used by e.g., C(cloud-init). @@ -264,9 +303,11 @@ options: - If the image you are attempting to use is not listed in U(https://docs.microsoft.com/en-us/azure/virtual-machines/linux/using-cloud-init#cloud-init-overview), follow these steps U(https://docs.microsoft.com/en-us/azure/virtual-machines/linux/cloudinit-prepare-custom-image). + type: str scale_in_policy: description: - define the order in which vmss instances are scaled-in + type: str choices: - Default - NewestVM @@ -275,6 +316,7 @@ options: description: - timeout time for termination notification event - in range between 5 and 15 + type: int platform_fault_domain_count: description: - Fault Domain count for each placement group. @@ -411,7 +453,7 @@ EXAMPLES = ''' name: testvmss vm_size: Standard_DS1_v2 capacity: 120 - single_placement_group: False + single_placement_group: false virtual_network_name: testvnet upgrade_policy: Manual subnet_name: testsubnet @@ -458,9 +500,9 @@ EXAMPLES = ''' name: testVMSS{{ rpfx }} vm_size: Standard_D4s_v3 admin_username: testuser - single_placement_group: False + single_placement_group: false platform_fault_domain_count: 1 - public_ip_per_vm: True + public_ip_per_vm: true ssh_password_enabled: false ssh_public_keys: - path: /home/testuser/.ssh/authorized_keys @@ -472,9 +514,9 @@ EXAMPLES = ''' os_disk_caching: ReadWrite security_profile: uefi_settings: - secure_boot_enabled: True - v_tpm_enabled: False - encryption_at_host: False + secure_boot_enabled: true + v_tpm_enabled: false + encryption_at_host: false security_type: TrustedLaunch image: offer: 0001-com-ubuntu-server-jammy @@ -606,9 +648,8 @@ azure_vmss: import base64 try: - from msrestazure.azure_exceptions import CloudError from azure.core.exceptions import ResourceNotFoundError - from msrestazure.tools import parse_resource_id + from azure.mgmt.core.tools import parse_resource_id from azure.core.exceptions import ResourceNotFoundError except ImportError: @@ -644,25 +685,37 @@ class AzureRMVirtualMachineScaleSet(AzureRMModuleBase): admin_username=dict(type='str'), admin_password=dict(type='str', no_log=True), ssh_password_enabled=dict(type='bool', default=True), - ssh_public_keys=dict(type='list'), + ssh_public_keys=dict(type='list', elements='dict'), image=dict(type='raw'), os_disk_caching=dict(type='str', aliases=['disk_caching'], choices=['ReadOnly', 'ReadWrite'], default='ReadOnly'), os_type=dict(type='str', choices=['Linux', 'Windows'], default='Linux'), managed_disk_type=dict(type='str', choices=['Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS', 'Premium_ZRS', 'StandardSSD_ZRS']), - data_disks=dict(type='list'), + data_disks=dict( + type='list', + elements='dict', + options=dict( + lun=dict(type='str', default='0'), + disk_size_gb=dict(type='int'), + caching=dict(type='str', default='ReadOnly', choices=['ReadOnly', 'ReadWrite']), + managed_disk_type=dict( + type='str', + choices=['Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS', 'Premium_ZRS', 'StandardSSD_ZRS'] + ) + ) + ), subnet_name=dict(type='str', aliases=['subnet']), public_ip_per_vm=dict(type='bool', default=False), load_balancer=dict(type='str'), application_gateway=dict(type='str'), virtual_network_resource_group=dict(type='str'), virtual_network_name=dict(type='str', aliases=['virtual_network']), - remove_on_absent=dict(type='list', default=['all']), + remove_on_absent=dict(type='list', default=['all'], elements='str'), enable_accelerated_networking=dict(type='bool'), security_group=dict(type='raw', aliases=['security_group_name']), overprovision=dict(type='bool'), single_placement_group=dict(type='bool', default=False), - zones=dict(type='list'), + zones=dict(type='list', elements='str'), custom_data=dict(type='str'), plan=dict(type='dict', options=dict(publisher=dict(type='str', required=True), product=dict(type='str', required=True), name=dict(type='str', required=True), @@ -862,18 +915,18 @@ class AzureRMVirtualMachineScaleSet(AzureRMModuleBase): if self.state == 'present': differences = [] results = vmss_dict - current_osdisk = vmss_dict['properties']['virtualMachineProfile']['storageProfile']['osDisk'] - current_ephemeral = current_osdisk.get('diffDiskSettings', None) - current_properties = vmss_dict['properties']['virtualMachineProfile'] + current_osdisk = vmss_dict['virtual_machine_profile']['storage_profile']['os_disk'] + current_ephemeral = current_osdisk.get('diff_disk_settings', None) + current_properties = vmss_dict['virtual_machine_profile'] if self.priority and self.priority != current_properties.get('priority', 'None'): self.fail('VM Priority is not updatable: requested virtual machine priority is {0}'.format(self.priority)) if self.eviction_policy and \ - self.eviction_policy != current_properties.get('evictionPolicy', None): + self.eviction_policy != current_properties.get('eviction_policy', None): self.fail('VM Eviction Policy is not updatable: requested virtual machine eviction policy is {0}'.format(self.eviction_policy)) if self.max_price and \ - vmss_dict['properties']['virtualMachineProfile'].get('billingProfile', None) and \ - self.max_price != vmss_dict['properties']['virtualMachineProfile']['billingProfile'].get('maxPrice', None): + vmss_dict['virtual_machine_profile'].get('billing_profile', None) and \ + self.max_price != vmss_dict['virtual_machine_profile']['billing_profile'].get('max_price', None): self.fail('VM Maximum Price is not updatable: requested virtual machine maximum price is {0}'.format(self.max_price)) if self.ephemeral_os_disk and current_ephemeral is None: @@ -882,15 +935,15 @@ class AzureRMVirtualMachineScaleSet(AzureRMModuleBase): self.fail('Ephemeral OS disk not updatable: virtual machine scale set ephemeral OS disk is {0}'.format(self.ephemeral_os_disk)) if self.os_disk_size_gb and \ - self.os_disk_size_gb != vmss_dict['properties']['virtualMachineProfile']['storageProfile']['osDisk']['diskSizeGB']: + self.os_disk_size_gb != vmss_dict['virtual_machine_profile']['storage_profile']['os_disk']['disk_size_gb']: self.fail('VMSS OS disk size is not updatable: requested virtual machine OS disk size is {0}'.format(self.os_disk_size_gb)) if self.os_disk_caching and \ - self.os_disk_caching != vmss_dict['properties']['virtualMachineProfile']['storageProfile']['osDisk']['caching']: + self.os_disk_caching != vmss_dict['virtual_machine_profile']['storage_profile']['os_disk']['caching']: self.log('CHANGED: virtual machine scale set {0} - OS disk caching'.format(self.name)) differences.append('OS Disk caching') changed = True - vmss_dict['properties']['virtualMachineProfile']['storageProfile']['osDisk']['caching'] = self.os_disk_caching + vmss_dict['virtual_machine_profile']['storage_profile']['os_disk']['caching'] = self.os_disk_caching if self.capacity and \ self.capacity != vmss_dict['sku']['capacity']: @@ -900,35 +953,35 @@ class AzureRMVirtualMachineScaleSet(AzureRMModuleBase): vmss_dict['sku']['capacity'] = self.capacity if self.data_disks and \ - len(self.data_disks) != len(vmss_dict['properties']['virtualMachineProfile']['storageProfile'].get('dataDisks', [])): + len(self.data_disks) != len(vmss_dict['virtual_machine_profile']['storage_profile'].get('data_disks', [])): self.log('CHANGED: virtual machine scale set {0} - Data Disks'.format(self.name)) differences.append('Data Disks') changed = True if self.upgrade_policy and \ - self.upgrade_policy != vmss_dict['properties']['upgradePolicy']['mode']: + self.upgrade_policy != vmss_dict['upgrade_policy']['mode']: self.log('CHANGED: virtual machine scale set {0} - Upgrade Policy'.format(self.name)) differences.append('Upgrade Policy') changed = True - vmss_dict['properties']['upgradePolicy']['mode'] = self.upgrade_policy + vmss_dict['upgrade_policy']['mode'] = self.upgrade_policy if image_reference and \ - image_reference.as_dict() != vmss_dict['properties']['virtualMachineProfile']['storageProfile']['imageReference']: + image_reference.as_dict() != vmss_dict['virtual_machine_profile']['storage_profile']['image_reference']: self.log('CHANGED: virtual machine scale set {0} - Image'.format(self.name)) differences.append('Image') changed = True - vmss_dict['properties']['virtualMachineProfile']['storageProfile']['imageReference'] = image_reference.as_dict() + vmss_dict['virtual_machine_profile']['storage_profile']['image_reference'] = image_reference.as_dict() update_tags, vmss_dict['tags'] = self.update_tags(vmss_dict.get('tags', dict())) if update_tags: differences.append('Tags') changed = True - if self.overprovision is not None and bool(self.overprovision) != bool(vmss_dict['properties'].get('overprovision')): + if self.overprovision is not None and bool(self.overprovision) != bool(vmss_dict.get('overprovision')): differences.append('overprovision') changed = True - if bool(self.single_placement_group) != bool(vmss_dict['properties']['singlePlacementGroup']): + if bool(self.single_placement_group) != bool(vmss_dict['single_placement_group']): differences.append('single_placement_group') changed = True @@ -944,26 +997,26 @@ class AzureRMVirtualMachineScaleSet(AzureRMModuleBase): if timeout < 5 or timeout > 15: self.fail("terminate_event_timeout_minutes should >= 5 and <= 15") iso_8601_format = "PT" + str(timeout) + "M" - old = vmss_dict['properties']['virtualMachineProfile'].get('scheduledEventsProfile', {}).\ - get('terminateNotificationProfile', {}).get('notBeforeTimeout', "") + old = vmss_dict['virtual_machine_profile'].get('scheduled_events_profile', {}).\ + get('terminate_notification_profile', {}).get('not_before_timeout', "") if old != iso_8601_format: differences.append('terminateNotification') changed = True - vmss_dict['properties']['virtualMachineProfile'].setdefault('scheduledEventsProfile', {})['terminateNotificationProfile'] = { - 'notBeforeTimeout': iso_8601_format, + vmss_dict['virtual_machine_profile'].setdefault('scheduled_events_profile', {})['terminate_notification_profile'] = { + 'not_before_timeout': iso_8601_format, "enable": 'true' } - if self.scale_in_policy and self.scale_in_policy != vmss_dict['properties'].get('scaleInPolicy', {}).get('rules', [""])[0]: + if self.scale_in_policy and self.scale_in_policy != vmss_dict.get('scale_in_policy', {}).get('rules', [""])[0]: self.log("CHANGED: virtual machine sale sets {0} scale in policy".format(self.name)) differences.append('scaleInPolicy') changed = True - vmss_dict['properties'].setdefault('scaleInPolicy', {})['rules'] = [self.scale_in_policy] + vmss_dict.setdefault('scale_in_policy', {})['rules'] = [self.scale_in_policy] - nicConfigs = vmss_dict['properties']['virtualMachineProfile']['networkProfile']['networkInterfaceConfigurations'] + nicConfigs = vmss_dict['virtual_machine_profile']['network_profile']['network_interface_configurations'] - backend_address_pool = nicConfigs[0]['properties']['ipConfigurations'][0]['properties'].get('loadBalancerBackendAddressPools', []) - backend_address_pool += nicConfigs[0]['properties']['ipConfigurations'][0]['properties'].get('applicationGatewayBackendAddressPools', []) + backend_address_pool = nicConfigs[0]['ip_configurations'][0].get('load_balancer_backend_address_pools', []) + backend_address_pool += nicConfigs[0]['ip_configurations'][0].get('application_gateway_backend_address_pools', []) lb_or_ag_id = None if (len(nicConfigs) != 1 or len(backend_address_pool) != 1): support_lb_change = False # Currently not support for the vmss contains more than one loadbalancer @@ -980,51 +1033,51 @@ class AzureRMVirtualMachineScaleSet(AzureRMModuleBase): changed = True if self.custom_data: - if self.custom_data != vmss_dict['properties']['virtualMachineProfile']['osProfile'].get('customData'): + if self.custom_data != vmss_dict['virtual_machine_profile']['os_profile'].get('custom_data'): differences.append('custom_data') changed = True - vmss_dict['properties']['virtualMachineProfile']['osProfile']['customData'] = self.custom_data + vmss_dict['virtual_machine_profile']['os_profile']['custom_data'] = self.custom_data - if self.orchestration_mode and self.orchestration_mode != vmss_dict['properties'].get('orchestrationMode'): + if self.orchestration_mode and self.orchestration_mode != vmss_dict.get('orchestration_mode'): self.fail("The orchestration_mode parameter cannot be updated!") else: - self.orchestration_mode = vmss_dict['properties'].get('orchestrationMode') + self.orchestration_mode = vmss_dict.get('orchestration_mode') - if self.platform_fault_domain_count and self.platform_fault_domain_count != vmss_dict['properties'].get('platformFaultDomainCount'): + if self.platform_fault_domain_count and self.platform_fault_domain_count != vmss_dict.get('platform_fault_domain_count'): self.fail("The platform_fault_domain_count parameter cannot be updated!") if self.security_profile is not None: update_security_profile = False - if 'securityProfile' not in vmss_dict['properties']['virtualMachineProfile'].keys(): + if 'securityProfile' not in vmss_dict['virtual_machine_profile'].keys(): update_security_profile = True differences.append('security_profile') else: if self.security_profile.get('encryption_at_host') is not None: if bool(self.security_profile.get('encryption_at_host')) != \ - bool(vmss_dict['properties']['virtualMachineProfile']['securityProfile']['encryptionAtHost']): + bool(vmss_dict['virtual_machine_profile']['security_profile']['encryption_at_host']): update_security_profle = True else: self.security_profile['encryption_at_host'] = \ - vmss_dict['properties']['virtualMachineProfile']['securityProfile']['encryptionAtHost'] + vmss_dict['virtual_machine_profile']['security_profile']['encryption_at_host'] if self.security_profile.get('security_type') is not None: if self.security_profile.get('security_type') != \ - vmss_dict['properties']['virtualMachineProfile']['securityProfile']['securityType']: + vmss_dict['virtual_machine_profile']['security_profile']['security_type']: update_security_profile = True if self.security_profile.get('uefi_settings') is not None: if self.security_profile['uefi_settings'].get('secure_boot_enabled') is not None: if bool(self.security_profile['uefi_settings']['secure_boot_enabled']) != \ - bool(vmss_dict['properties']['virtualMachineProfile']['securityProfile']['uefiSettings']['secureBootEnabled']): + bool(vmss_dict['virtual_machine_profile']['security_profile']['uefi_settings']['secure_boot_nabled']): update_security_profile = True else: self.security_profile['uefi_settings']['secure_boot_enabled'] = \ - vmss_dict['properties']['virtualMachineProfile']['securityProfile']['uefiSettings']['secureBootEnabled'] + vmss_dict['virtual_machine_profile']['security_profile']['uefi_settings']['secure_boot_enabled'] if self.security_profile['uefi_settings'].get('v_tpm_enabled') is not None: if bool(self.security_profile['uefi_settings']['v_tpm_enabled']) != \ - bool(vmss_dict['properties']['virtualMachineProfile']['securityProfile']['uefiSettings']['vTpmEnabled']): + bool(vmss_dict['virtual_machine_profile']['security_profile']['uefi_settings']['v_tpm_enabled']): update_security_profile = True else: self.security_profile['uefi_settings']['v_tpm_enabled'] = \ - vmss_dict['properties']['virtualMachineProfile']['securityProfile']['uefiSettings']['vTpmEnabled'] + vmss_dict['virtual_machine_profile']['security_profile']['uefi_settings']['v_tpm_enabled'] if update_security_profile: changed = True differences.append('security_profile') @@ -1338,7 +1391,7 @@ class AzureRMVirtualMachineScaleSet(AzureRMModuleBase): self.log("Fetching subnet {0} in virtual network {1}".format(subnet_name, vnet_name)) try: subnet = self.network_client.subnets.get(self.virtual_network_resource_group, vnet_name, subnet_name) - except CloudError as exc: + except Exception as exc: self.fail("Error: fetching subnet {0} in virtual network {1} - {2}".format( subnet_name, vnet_name, diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinescaleset_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinescaleset_info.py index a2154d017..642f6b58d 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinescaleset_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinescaleset_info.py @@ -23,9 +23,11 @@ options: name: description: - Limit results to a specific virtual machine scale set. + type: str resource_group: description: - The resource group to search for the desired virtual machine scale set. + type: str tags: description: - Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. @@ -39,6 +41,7 @@ options: - In Ansible 2.5 and lower facts are always returned in raw format. - Please note that this option will be deprecated in 2.10 when curated format will become the only supported format. default: 'raw' + type: str choices: - 'curated' - 'raw' @@ -51,21 +54,21 @@ author: ''' EXAMPLES = ''' - - name: Get facts for a virtual machine scale set - azure_rm_virtualmachinescaleset_info: - resource_group: myResourceGroup - name: testvmss001 - format: curated - - - name: Get facts for all virtual networks - azure_rm_virtualmachinescaleset_info: - resource_group: myResourceGroup - - - name: Get facts by tags - azure_rm_virtualmachinescaleset_info: - resource_group: myResourceGroup - tags: - - testing +- name: Get facts for a virtual machine scale set + azure_rm_virtualmachinescaleset_info: + resource_group: myResourceGroup + name: testvmss001 + format: curated + +- name: Get facts for all virtual networks + azure_rm_virtualmachinescaleset_info: + resource_group: myResourceGroup + +- name: Get facts by tags + azure_rm_virtualmachinescaleset_info: + resource_group: myResourceGroup + tags: + - testing ''' RETURN = ''' @@ -329,34 +332,34 @@ class AzureRMVirtualMachineScaleSetInfo(AzureRMModuleBase): ssh_password_enabled = False try: - subnet_id = (vmss['properties']['virtualMachineProfile']['networkProfile']['networkInterfaceConfigurations'][0] - ['properties']['ipConfigurations'][0]['properties']['subnet']['id']) + subnet_id = (vmss['virtual_machine_profile']['network_profile']['network_interface_configurations'][0] + ['ipConfigurations'][0]['subnet']['id']) subnet_name = re.sub('.*subnets\\/', '', subnet_id) except Exception: self.log('Could not extract subnet name') try: - backend_address_pool_id = (vmss['properties']['virtualMachineProfile']['networkProfile']['networkInterfaceConfigurations'][0] - ['properties']['ipConfigurations'][0]['properties']['loadBalancerBackendAddressPools'][0]['id']) + backend_address_pool_id = (vmss['virtual_machine_profile']['network_profile']['network_interface_configurations'][0] + ['ip_configurations'][0]['load_balancer_backend_address_pools'][0]['id']) load_balancer_name = re.sub('\\/backendAddressPools.*', '', re.sub('.*loadBalancers\\/', '', backend_address_pool_id)) virtual_network_name = re.sub('.*virtualNetworks\\/', '', re.sub('\\/subnets.*', '', subnet_id)) except Exception: self.log('Could not extract load balancer / virtual network name') try: - ssh_password_enabled = (not vmss['properties']['virtualMachineProfile']['osProfile'] - ['linuxConfiguration']['disablePasswordAuthentication']) + ssh_password_enabled = (not vmss['virtual_machine_profile']['os_profile'] + ['linux_configuration']['disable_password_authentication']) except Exception: self.log('Could not extract SSH password enabled') - data_disks = vmss['properties']['virtualMachineProfile']['storageProfile'].get('dataDisks', []) + data_disks = vmss['virtual_machine_profile']['storage_profile'].get('data_disks', []) for disk_index in range(len(data_disks)): old_disk = data_disks[disk_index] new_disk = { 'lun': old_disk['lun'], - 'disk_size_gb': old_disk['diskSizeGB'], - 'managed_disk_type': old_disk['managedDisk']['storageAccountType'], + 'disk_size_gb': old_disk['disk_size_gb'], + 'managed_disk_type': old_disk['managed_disk']['storage_account_type'], 'caching': old_disk['caching'] } data_disks[disk_index] = new_disk @@ -370,17 +373,17 @@ class AzureRMVirtualMachineScaleSetInfo(AzureRMModuleBase): 'vm_size': vmss['sku']['name'], 'capacity': vmss['sku']['capacity'], 'tier': vmss['sku']['tier'], - 'upgrade_policy': vmss['properties'].get('upgradePolicy'), - 'orchestrationMode': vmss['properties'].get('orchestrationMode'), - 'platformFaultDomainCount': vmss['properties'].get('platformFaultDomainCount'), - 'admin_username': vmss['properties']['virtualMachineProfile']['osProfile']['adminUsername'], - 'admin_password': vmss['properties']['virtualMachineProfile']['osProfile'].get('adminPassword'), + 'upgrade_policy': vmss.get('upgrade_policy'), + 'orchestrationMode': vmss.get('orchestration_mode'), + 'platformFaultDomainCount': vmss.get('platform_fault_domain_count'), + 'admin_username': vmss['virtual_machine_profile']['os_profile']['admin_username'], + 'admin_password': vmss['virtual_machine_profile']['os_profile'].get('admin_password'), 'ssh_password_enabled': ssh_password_enabled, - 'image': vmss['properties']['virtualMachineProfile']['storageProfile']['imageReference'], - 'os_disk_caching': vmss['properties']['virtualMachineProfile']['storageProfile']['osDisk']['caching'], - 'os_type': 'Linux' if (vmss['properties']['virtualMachineProfile']['osProfile'].get('linuxConfiguration') is not None) else 'Windows', - 'overprovision': vmss['properties'].get('overprovision'), - 'managed_disk_type': vmss['properties']['virtualMachineProfile']['storageProfile']['osDisk']['managedDisk']['storageAccountType'], + 'image': vmss['virtual_machine_profile']['storage_profile']['image_reference'], + 'os_disk_caching': vmss['virtual_machine_profile']['storage_profile']['os_disk']['caching'], + 'os_type': 'Linux' if (vmss['virtual_machine_profile']['os_profile'].get('linux_configuration') is not None) else 'Windows', + 'overprovision': vmss.get('overprovision'), + 'managed_disk_type': vmss['virtual_machine_profile']['storage_profile']['os_disk']['managed_disk']['storage_account_type'], 'data_disks': data_disks, 'virtual_network_name': virtual_network_name, 'subnet_name': subnet_name, diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinescalesetextension.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinescalesetextension.py index eec58bcf1..7385ca7d6 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinescalesetextension.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinescalesetextension.py @@ -24,35 +24,45 @@ options: description: - Name of a resource group where the VMSS extension exists or will be created. required: true + type: str vmss_name: description: - The name of the virtual machine where the extension should be create or updated. required: true + type: str name: description: - Name of the VMSS extension. + type: str + required: true location: description: - Valid Azure location. Defaults to location of the resource group. + type: str publisher: description: - The name of the extension handler publisher. + type: str type: description: - The type of the extension handler. + type: str type_handler_version: description: - The type version of the extension handler. + type: str settings: description: - A dictionary containing extension settings. - Settings depend on extension type. - Refer to U(https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/overview) for more information. + type: dict protected_settings: description: - A dictionary containing protected extension settings. - Settings depend on extension type. - Refer to U(https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/overview) for more information. + type: dict auto_upgrade_minor_version: description: - Whether the extension handler should be automatically upgraded across minor versions. @@ -62,6 +72,7 @@ options: - Assert the state of the extension. - Use C(present) to create or update an extension and C(absent) to delete it. default: present + type: str choices: - absent - present @@ -75,25 +86,25 @@ author: ''' EXAMPLES = ''' - - name: Install VMSS Extension - azure_rm_virtualmachinescalesetextension: - name: myvmssextension - location: eastus - resource_group: myResourceGroup - vmss_name: myvm - publisher: Microsoft.Azure.Extensions - type: CustomScript - type_handler_version: 2.0 - settings: '{"commandToExecute": "hostname"}' - auto_upgrade_minor_version: true - - - name: Remove VMSS Extension - azure_rm_virtualmachinescalesetextension: - name: myvmssextension - location: eastus - resource_group: myResourceGroup - vmss_name: myvm - state: absent +- name: Install VMSS Extension + azure_rm_virtualmachinescalesetextension: + name: myvmssextension + location: eastus + resource_group: myResourceGroup + vmss_name: myvm + publisher: Microsoft.Azure.Extensions + type: CustomScript + type_handler_version: 2.0 + settings: '{"commandToExecute": "hostname"}' + auto_upgrade_minor_version: true + +- name: Remove VMSS Extension + azure_rm_virtualmachinescalesetextension: + name: myvmssextension + location: eastus + resource_group: myResourceGroup + vmss_name: myvm + state: absent ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinescalesetextension_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinescalesetextension_info.py index 3c54de11a..58eadf271 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinescalesetextension_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinescalesetextension_info.py @@ -21,13 +21,16 @@ options: description: - The name of the resource group. required: True + type: str vmss_name: description: - The name of VMSS containing the extension. required: True + type: str name: description: - The name of the virtual machine extension. + type: str extends_documentation_fragment: - azure.azcollection.azure @@ -38,16 +41,16 @@ author: ''' EXAMPLES = ''' - - name: Get information on specific Virtual Machine Scale Set Extension - azure_rm_virtualmachineextension_info: - resource_group: myResourceGroup - vmss_name: myvmss - name: myextension - - - name: List installed Virtual Machine Scale Set Extensions - azure_rm_virtualmachineextension_info: - resource_group: myrg - vmss_name: myvmss +- name: Get information on specific Virtual Machine Scale Set Extension + azure_rm_virtualmachineextension_info: + resource_group: myResourceGroup + vmss_name: myvmss + name: myextension + +- name: List installed Virtual Machine Scale Set Extensions + azure_rm_virtualmachineextension_info: + resource_group: myrg + vmss_name: myvmss ''' RETURN = ''' @@ -117,7 +120,6 @@ extensions: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase try: - from msrest.serialization import Model from azure.core.exceptions import ResourceNotFoundError except ImportError: # This is handled in azure_rm_common diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinescalesetinstance.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinescalesetinstance.py index 54ed23b86..ca20000a8 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinescalesetinstance.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinescalesetinstance.py @@ -21,14 +21,17 @@ options: description: - The name of the resource group. required: True + type: str vmss_name: description: - The name of the VM scale set. required: True + type: str instance_id: description: - The instance ID of the virtual machine. - required: True + type: str + required: true latest_model: type: bool description: @@ -36,6 +39,7 @@ options: power_state: description: - Use this option to change power state of the instance. + type: str choices: - 'running' - 'stopped' @@ -52,6 +56,7 @@ options: description: - State of the VMSS instance. Use C(present) to update an instance and C(absent) to delete an instance. default: present + type: str choices: - absent - present @@ -65,19 +70,19 @@ author: ''' EXAMPLES = ''' - - name: Upgrade instance to the latest image - azure_rm_virtualmachinescalesetinstance: - resource_group: myResourceGroup - vmss_name: myVMSS - instance_id: "2" - latest_model: yes - - - name: Turn on protect from scale in - azure_rm_virtualmachinescalesetinstance: - resource_group: myResourceGroup - vmss_name: myVMSS - instance_id: "2" - protect_from_scale_in: true +- name: Upgrade instance to the latest image + azure_rm_virtualmachinescalesetinstance: + resource_group: myResourceGroup + vmss_name: myVMSS + instance_id: "2" + latest_model: true + +- name: Turn on protect from scale in + azure_rm_virtualmachinescalesetinstance: + resource_group: myResourceGroup + vmss_name: myVMSS + instance_id: "2" + protect_from_scale_in: true ''' RETURN = ''' @@ -100,7 +105,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError from azure.mgmt.compute import ComputeManagementClient - from msrest.serialization import Model except ImportError: # This is handled in azure_rm_common pass @@ -119,7 +123,8 @@ class AzureRMVirtualMachineScaleSetInstance(AzureRMModuleBase): required=True ), instance_id=dict( - type='str' + type='str', + required=True ), latest_model=dict( type='bool' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinescalesetinstance_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinescalesetinstance_info.py index 6d9888728..07b6cf92c 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinescalesetinstance_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinescalesetinstance_info.py @@ -21,13 +21,16 @@ options: description: - The name of the resource group. required: True + type: str vmss_name: description: - The name of the VM scale set. required: True + type: str instance_id: description: - The instance ID of the virtual machine. + type: str tags: description: - Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. @@ -43,10 +46,10 @@ author: ''' EXAMPLES = ''' - - name: List VM instances in Virtual Machine ScaleSet - azure_rm_virtualmachinescalesetinstance_info: - resource_group: myResourceGroup - vmss_name: myVMSS +- name: List VM instances in Virtual Machine ScaleSet + azure_rm_virtualmachinescalesetinstance_info: + resource_group: myResourceGroup + vmss_name: myVMSS ''' RETURN = ''' @@ -118,7 +121,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.mgmt.compute import ComputeManagementClient - from msrest.serialization import Model from azure.core.exceptions import ResourceNotFoundError except ImportError: # This is handled in azure_rm_common diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinesize_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinesize_info.py index a0fe189af..982a7ea95 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinesize_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualmachinesize_info.py @@ -40,14 +40,14 @@ author: ''' EXAMPLES = ''' - - name: Get all virtual machine size info in eastus - azure_rm_virtualmachinesize_info: - location: eastus - - - name: Get virtual machine size info for eastus for Standard_A1_v2 - azure_rm_virtualmachinesize_info: - location: eastus - name: Standard_A1_v2 +- name: Get all virtual machine size info in eastus + azure_rm_virtualmachinesize_info: + location: eastus + +- name: Get virtual machine size info for eastus for Standard_A1_v2 + azure_rm_virtualmachinesize_info: + location: eastus + name: Standard_A1_v2 ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork.py index 2cbf0de55..c497fa3c3 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork.py @@ -12,7 +12,7 @@ __metaclass__ = type DOCUMENTATION = ''' --- module: azure_rm_virtualnetwork -version_added: "0.1.0" +version_added: 0.1.0 short_description: Manage Azure virtual networks description: - Create, update or delete a virtual networks. Allows setting and updating the available IPv4 address ranges @@ -22,37 +22,44 @@ options: description: - Name of resource group. required: true + type: str address_prefixes_cidr: + aliases: + - address_prefixes description: - List of IPv4 address ranges where each is formatted using CIDR notation. - Required when creating a new virtual network or using I(purge_address_prefixes). - aliases: - - address_prefixes + elements: str + type: list dns_servers: description: - Custom list of DNS servers. - The first server in the list will be treated as the Primary server. This is an explicit list. - Existing DNS servers will be replaced with the specified list. - Use the I(purge_dns_servers) option to remove all custom DNS servers and revert to default Azure servers. + elements: str + type: list location: description: - Valid Azure location. Defaults to location of the resource group. + type: str name: description: - Name of the virtual network. required: true + type: str purge_address_prefixes: description: - Use with I(state=present) to remove any existing I(address_prefixes). type: bool - default: 'no' + default: false aliases: - purge purge_dns_servers: description: - Use with I(state=present) to remove existing DNS servers, reverting to default Azure servers. Mutually exclusive with DNS servers. type: bool - default: 'no' + default: false flow_timeout_in_minutes: description: - The FlowTimeout value (in minutes) for the Virtual Network. @@ -61,6 +68,7 @@ options: description: - State of the virtual network. Use C(present) to create or update and C(absent) to delete. default: present + type: str choices: - absent - present @@ -76,25 +84,25 @@ author: ''' EXAMPLES = ''' - - name: Create a virtual network - azure_rm_virtualnetwork: - resource_group: myResourceGroup - name: myVirtualNetwork - address_prefixes_cidr: - - "10.1.0.0/16" - - "172.100.0.0/16" - dns_servers: - - "127.0.0.1" - - "127.0.0.2" - tags: - testing: testing - delete: on-exit - - - name: Delete a virtual network - azure_rm_virtualnetwork: - resource_group: myResourceGroup - name: myVirtualNetwork - state: absent +- name: Create a virtual network + azure_rm_virtualnetwork: + resource_group: myResourceGroup + name: myVirtualNetwork + address_prefixes_cidr: + - 10.1.0.0/16 + - 172.100.0.0/16 + dns_servers: + - 127.0.0.1 + - 127.0.0.2 + tags: + testing: testing + delete: on-exit + +- name: Delete a virtual network + azure_rm_virtualnetwork: + resource_group: myResourceGroup + name: myVirtualNetwork + state: absent ''' RETURN = ''' state: @@ -217,8 +225,8 @@ class AzureRMVirtualNetwork(AzureRMModuleBase): name=dict(type='str', required=True), state=dict(type='str', default='present', choices=['present', 'absent']), location=dict(type='str'), - address_prefixes_cidr=dict(type='list', aliases=['address_prefixes']), - dns_servers=dict(type='list',), + address_prefixes_cidr=dict(type='list', elements='str', aliases=['address_prefixes']), + dns_servers=dict(type='list', elements='str'), purge_address_prefixes=dict(type='bool', default=False, aliases=['purge']), purge_dns_servers=dict(type='bool', default=False), flow_timeout_in_minutes=dict(type='int'), diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py index 43bfb5314..072f8db7b 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetwork_info.py @@ -24,9 +24,11 @@ options: name: description: - Only show results for a specific virtual network. + type: str resource_group: description: - Limit results by resource group. Required when filtering by name. + type: str tags: description: - Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. @@ -43,19 +45,19 @@ author: ''' EXAMPLES = ''' - - name: Get facts for one virtual network - azure_rm_virtualnetwork_info: - resource_group: myResourceGroup - name: secgroup001 - - - name: Get facts for all virtual networks - azure_rm_virtualnetwork_info: - resource_group: myResourceGroup - - - name: Get facts by tags - azure_rm_virtualnetwork_info: - tags: - - testing +- name: Get facts for one virtual network + azure_rm_virtualnetwork_info: + resource_group: myResourceGroup + name: secgroup001 + +- name: Get facts for all virtual networks + azure_rm_virtualnetwork_info: + resource_group: myResourceGroup + +- name: Get facts by tags + azure_rm_virtualnetwork_info: + tags: + - testing ''' RETURN = ''' azure_virtualnetworks: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetworkgateway.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetworkgateway.py index 4371fb162..c5f8271cd 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetworkgateway.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetworkgateway.py @@ -22,14 +22,17 @@ options: description: - Name of a resource group where VPN Gateway exists or will be created. required: true + type: str name: description: - Name of VPN Gateway. required: true + type: str state: description: - State of the VPN Gateway. Use C(present) to create or update VPN gateway and C(absent) to delete VPN gateway. default: present + type: str choices: - absent - present @@ -37,7 +40,7 @@ options: location: description: - Valid Azure location. Defaults to location of the resource group. - required: false + type: str virtual_network: description: - An existing virtual network with which the VPN Gateway will be associated. @@ -46,35 +49,42 @@ options: - Must be in the same resource group as VPN gateway when specified by name. - Can be the resource ID of the virtual network. - Can be a dict which contains I(name) and I(resource_group) of the virtual network. + - Required when creating. + type: raw aliases: - virtual_network_name - required: true ip_configurations: description: - List of IP configurations. + type: list + elements: dict suboptions: name: description: - Name of the IP configuration. + type: str required: true private_ip_allocation_method: description: - Private IP allocation method. + type: str choices: - - dynamic - - static - default: dynamic + - Dynamic + - Static + default: Dynamic public_ip_address_name: description: - Name of the public IP address. Use 'None' to disable the public IP address. + type: str subnet: description: - ID of the gateway subnet for VPN. - default: GatewaySubnet + type: str gateway_type: description: - The type of this virtual network gateway. default: vpn + type: str choices: - vpn - express_route @@ -82,6 +92,7 @@ options: description: - The type of this virtual private network. default: route_based + type: str choices: - route_based - policy_based @@ -89,10 +100,12 @@ options: description: - Whether BGP is enabled for this virtual network gateway or not. default: false + type: bool sku: description: - The reference of the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway. default: VpnGw1 + type: str choices: - VpnGw1 - VpnGw2 @@ -104,6 +117,7 @@ options: description: - The generation for this VirtualNetworkGateway. Must be C(None) if C(gateway_type) is not VPN. default: Generation1 + type: str choices: - None - Generation1 @@ -111,10 +125,12 @@ options: bgp_settings: description: - Virtual network gateway's BGP speaker settings. + type: dict suboptions: asn: description: - The BGP speaker's ASN. + type: int required: True extends_documentation_fragment: @@ -126,54 +142,54 @@ author: ''' EXAMPLES = ''' - - name: Create virtual network gateway without bgp settings - azure_rm_virtualnetworkgateway: - resource_group: myResourceGroup - name: myVirtualNetworkGateway - ip_configurations: - - name: testipconfig - private_ip_allocation_method: Dynamic - public_ip_address_name: testipaddr - virtual_network: myVirtualNetwork - tags: - common: "xyz" - - - name: Create virtual network gateway Generation2 - azure_rm_virtualnetworkgateway: - resource_group: myResourceGroup - name: myVirtualNetworkGateway - sku: vpn_gw2 - vpn_gateway_generation: Generation2 - ip_configurations: - - name: testipconfig - private_ip_allocation_method: Dynamic - public_ip_address_name: testipaddr - virtual_network: myVirtualNetwork - tags: - common: "xyz" - - - name: Create virtual network gateway with bgp - azure_rm_virtualnetworkgateway: - resource_group: myResourceGroup - name: myVirtualNetworkGateway - sku: vpn_gw1 - ip_configurations: - - name: testipconfig - private_ip_allocation_method: Dynamic - public_ip_address_name: testipaddr - enable_bgp: yes - virtual_network: myVirtualNetwork - bgp_settings: - asn: 65515 - bgp_peering_address: "169.254.54.209" - tags: - common: "xyz" - - - name: Delete instance of virtual network gateway - azure_rm_virtualnetworkgateway: - resource_group: myResourceGroup - name: myVirtualNetworkGateway - state: absent +- name: Create virtual network gateway without bgp settings + azure_rm_virtualnetworkgateway: + resource_group: myResourceGroup + name: myVirtualNetworkGateway + ip_configurations: + - name: testipconfig + private_ip_allocation_method: Dynamic + public_ip_address_name: testipaddr + virtual_network: myVirtualNetwork + tags: + common: "xyz" + +- name: Create virtual network gateway Generation2 + azure_rm_virtualnetworkgateway: + resource_group: myResourceGroup + name: myVirtualNetworkGateway + sku: vpn_gw2 + vpn_gateway_generation: Generation2 + ip_configurations: + - name: testipconfig + private_ip_allocation_method: Dynamic + public_ip_address_name: testipaddr + virtual_network: myVirtualNetwork + tags: + common: "xyz" + +- name: Create virtual network gateway with bgp + azure_rm_virtualnetworkgateway: + resource_group: myResourceGroup + name: myVirtualNetworkGateway + sku: vpn_gw1 + ip_configurations: + - name: testipconfig + private_ip_allocation_method: Dynamic + public_ip_address_name: testipaddr + enable_bgp: true + virtual_network: myVirtualNetwork + bgp_settings: + asn: 65515 + bgp_peering_address: "169.254.54.209" + tags: + common: "xyz" + +- name: Delete instance of virtual network gateway + azure_rm_virtualnetworkgateway: + resource_group: myResourceGroup + name: myVirtualNetworkGateway + state: absent ''' RETURN = ''' @@ -192,7 +208,7 @@ except ImportError: # This is handled in azure_rm_common pass -from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase, CIDR_PATTERN +from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase from ansible.module_utils.common.dict_transformations import _snake_to_camel @@ -257,7 +273,7 @@ class AzureRMVirtualNetworkGateway(AzureRMModuleBase): vpn_type=dict(type='str', default='route_based', choices=['route_based', 'policy_based']), vpn_gateway_generation=dict(type='str', default='Generation1', choices=['None', 'Generation1', 'Generation2']), enable_bgp=dict(type='bool', default=False), - sku=dict(default='VpnGw1', choices=['VpnGw1', 'VpnGw2', 'VpnGw3', 'Standard', 'Basic', 'HighPerformance']), + sku=dict(type='str', default='VpnGw1', choices=['VpnGw1', 'VpnGw2', 'VpnGw3', 'Standard', 'Basic', 'HighPerformance']), bgp_settings=dict(type='dict', options=bgp_spec), virtual_network=dict(type='raw', aliases=['virtual_network_name']) ) @@ -274,12 +290,14 @@ class AzureRMVirtualNetworkGateway(AzureRMModuleBase): self.vpn_gateway_generation = None self.bgp_settings = None + required_if = [('state', 'present', ['virtual_network'])] self.results = dict( changed=False, state=dict() ) super(AzureRMVirtualNetworkGateway, self).__init__(derived_arg_spec=self.module_arg_spec, + required_if=required_if, supports_check_mode=True) def exec_module(self, **kwargs): diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetworkpeering.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetworkpeering.py index 5bdc35f45..71025e25e 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetworkpeering.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetworkpeering.py @@ -20,13 +20,16 @@ options: description: - Name of a resource group where the vnet exists. required: true + type: str name: description: - Name of the virtual network peering. required: true + type: str virtual_network: description: - Name or resource ID of the virtual network to be peered. + type: raw required: true remote_virtual_network: description: @@ -35,6 +38,7 @@ options: - It can be remote virtual network resource ID. - It can be a dict which contains I(name) and I(resource_group) of remote virtual network. - Required when creating. + type: raw allow_virtual_network_access: description: - Allows VMs in the remote VNet to access all VMs in the local VNet. @@ -60,6 +64,7 @@ options: description: - State of the virtual network peering. Use C(present) to create or update a peering and C(absent) to delete it. default: present + type: str choices: - absent - present @@ -72,23 +77,23 @@ author: ''' EXAMPLES = ''' - - name: Create virtual network peering - azure_rm_virtualnetworkpeering: - resource_group: myResourceGroup - virtual_network: myVirtualNetwork - name: myPeering - remote_virtual_network: - resource_group: mySecondResourceGroup - name: myRemoteVirtualNetwork - allow_virtual_network_access: false - allow_forwarded_traffic: true - - - name: Delete the virtual network peering - azure_rm_virtualnetworkpeering: - resource_group: myResourceGroup - virtual_network: myVirtualNetwork - name: myPeering - state: absent +- name: Create virtual network peering + azure_rm_virtualnetworkpeering: + resource_group: myResourceGroup + virtual_network: myVirtualNetwork + name: myPeering + remote_virtual_network: + resource_group: mySecondResourceGroup + name: myRemoteVirtualNetwork + allow_virtual_network_access: false + allow_forwarded_traffic: true + +- name: Delete the virtual network peering + azure_rm_virtualnetworkpeering: + resource_group: myResourceGroup + virtual_network: myVirtualNetwork + name: myPeering + state: absent ''' RETURN = ''' id: @@ -107,7 +112,7 @@ peering_sync_level: ''' try: - from msrestazure.tools import is_valid_resource_id + from azure.mgmt.core.tools import is_valid_resource_id from azure.core.exceptions import ResourceNotFoundError from azure.core.polling import LROPoller except ImportError: @@ -177,7 +182,8 @@ class AzureRMVirtualNetworkPeering(AzureRMModuleBase): required=True ), virtual_network=dict( - type='raw' + type='raw', + required=True ), remote_virtual_network=dict( type='raw' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetworkpeering_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetworkpeering_info.py index 87563f01a..e48f4e49f 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetworkpeering_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualnetworkpeering_info.py @@ -20,13 +20,16 @@ options: description: - Name of a resource group where the vnet exists. required: True + type: str virtual_network: description: - Name or resource ID of a virtual network. required: True + type: raw name: description: - Name of the virtual network peering. + type: str extends_documentation_fragment: - azure.azcollection.azure @@ -36,16 +39,16 @@ author: ''' EXAMPLES = ''' - - name: Get virtual network peering by name - azure_rm_virtualnetworkpeering_info: - resource_group: myResourceGroup - virtual_network: myVnet1 - name: myVnetPeer +- name: Get virtual network peering by name + azure_rm_virtualnetworkpeering_info: + resource_group: myResourceGroup + virtual_network: myVnet1 + name: myVnetPeer - - name: List virtual network peering of virtual network - azure_rm_virtualnetworkpeering: - resource_group: myResourceGroup - virtual_network: myVnet1 +- name: List virtual network peering of virtual network + azure_rm_virtualnetworkpeering: + resource_group: myResourceGroup + virtual_network: myVnet1 ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualwan.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualwan.py index 10869012d..38c542695 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualwan.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualwan.py @@ -48,6 +48,7 @@ options: description: - List of VirtualHubs in the VirtualWAN. type: list + elements: dict suboptions: id: description: @@ -57,11 +58,12 @@ options: description: - List of VpnSites in the VirtualWAN. type: list + elements: dict suboptions: id: - description: - - The vpn site resource ID. - type: str + description: + - The vpn site resource ID. + type: str allow_branch_to_branch_traffic: description: - True if branch to branch traffic is allowed. @@ -82,6 +84,7 @@ options: - Assert the state of the VirtualWan. - Use C(present) to create or update an VirtualWan and C(absent) to delete it. default: present + type: str choices: - absent - present @@ -94,21 +97,20 @@ author: ''' EXAMPLES = ''' - - name: Create a VirtualWan - azure_rm_virtualwan: - resource_group: myResouceGroup - name: testwan - disable_vpn_encryption: true - allow_branch_to_branch_traffic: true - allow_vnet_to_vnet_traffic: true - virtual_wan_type: Standard - - - name: Delete the VirtualWan - azure_rm_virtualwan: - resource_group: myResouceGroup - name: testwan - state: absent - +- name: Create a VirtualWan + azure_rm_virtualwan: + resource_group: myResouceGroup + name: testwan + disable_vpn_encryption: true + allow_branch_to_branch_traffic: true + allow_vnet_to_vnet_traffic: true + virtual_wan_type: Standard + +- name: Delete the VirtualWan + azure_rm_virtualwan: + resource_group: myResouceGroup + name: testwan + state: absent ''' RETURN = ''' @@ -221,7 +223,6 @@ from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common try: from azure.core.exceptions import ResourceNotFoundError from azure.core.polling import LROPoller - from msrestazure.azure_operation import AzureOperationPoller except ImportError: # This is handled in azure_rm_common pass @@ -255,6 +256,7 @@ class AzureRMVirtualWan(AzureRMModuleBaseExt): ), virtual_hubs=dict( type='list', + elements='dict', updatable=False, disposition='/virtual_hubs', options=dict( @@ -266,6 +268,7 @@ class AzureRMVirtualWan(AzureRMModuleBaseExt): ), vpn_sites=dict( type='list', + elements='dict', updatable=False, disposition='/vpn_sites', options=dict( @@ -365,7 +368,7 @@ class AzureRMVirtualWan(AzureRMModuleBaseExt): response = self.network_client.virtual_wans.begin_create_or_update(resource_group_name=self.resource_group, virtual_wan_name=self.name, wan_parameters=self.body) - if isinstance(response, AzureOperationPoller) or isinstance(response, LROPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) except Exception as exc: self.log('Error attempting to create the VirtualWan instance.') diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualwan_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualwan_info.py index 562422129..4c395a415 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualwan_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_virtualwan_info.py @@ -32,18 +32,17 @@ author: ''' EXAMPLES = ''' - - name: Get Virtual WAN by name - azure_rm_virtualwan_info: - resource_group: myResouceGroup - name: testwan +- name: Get Virtual WAN by name + azure_rm_virtualwan_info: + resource_group: myResouceGroup + name: testwan - - name: List all Virtual WANLs by resource group - azure_rm_virtualwan_info: - resource_group: myResourceGroup - - - name: List all Virtual WANs by subscription_id - azure_rm_virtualwan_info: +- name: List all Virtual WANLs by resource group + azure_rm_virtualwan_info: + resource_group: myResourceGroup +- name: List all Virtual WANs by subscription_id + azure_rm_virtualwan_info: ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_vmbackuppolicy.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_vmbackuppolicy.py index 3f6a6e862..5cd10c978 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_vmbackuppolicy.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_vmbackuppolicy.py @@ -42,18 +42,21 @@ options: required: false default: ['Monday'] type: list + elements: str weeks: description: - List of weeks of month. required: false default: ['First'] type: list + elements: str months: description: - List of months of year of yearly retention policy. required: false default: ['January'] type: list + elements: str count: description: - Count of duration types. Retention duration is obtained by the counting the duration type Count times. @@ -235,14 +238,17 @@ class VMBackupPolicy(AzureRMModuleBaseExt): ), weekdays=dict( type='list', + elements='str', default=['Monday'] ), weeks=dict( type='list', + elements='str', default=['First'] ), months=dict( type='list', + elements='str', default=['January'] ), count=dict( @@ -360,6 +366,7 @@ class VMBackupPolicy(AzureRMModuleBaseExt): response = None self.mgmt_client = self.get_mgmt_svc_client(GenericRestClient, + is_track2=True, base_url=self._cloud_environment.endpoints.resource_manager) old_response = self.get_resource() @@ -397,9 +404,9 @@ class VMBackupPolicy(AzureRMModuleBaseExt): self.fail('Error in creating Backup Policy {0}'.format(str(e))) try: - response = json.loads(response.text) + response = json.loads(response.body()) except Exception: - response = {'text': response.text} + response = {'text': response.context['deserialized_data']} return response @@ -420,12 +427,6 @@ class VMBackupPolicy(AzureRMModuleBaseExt): self.log('Error attempting to delete Azure Backup policy.') self.fail('Error attempting to delete Azure Backup policy: {0}'.format(str(e))) - try: - response = json.loads(response.text) - except Exception: - response = {'text': response.text} - return response - def get_resource(self): # self.log('Fetch Backup Policy Details {0}'.format(self.)) found = False @@ -444,7 +445,7 @@ class VMBackupPolicy(AzureRMModuleBaseExt): except Exception as e: self.log('Backup policy does not exist.') if found is True: - response = json.loads(response.text) + response = json.loads(response.body()) return response else: return False diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_vmbackuppolicy_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_vmbackuppolicy_info.py index 18aaf718c..0aa7b5918 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_vmbackuppolicy_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_vmbackuppolicy_info.py @@ -38,10 +38,11 @@ author: ''' EXAMPLES = ''' - azure_rm_backvmuppolicy_info: - name: 'myBackupPolicy' - vault_name: 'myVault' - resource_group: 'myResourceGroup' +- name: Get backvm policy facts + azure_rm_backvmuppolicy_info: + name: 'myBackupPolicy' + vault_name: 'myVault' + resource_group: 'myResourceGroup' ''' RETURN = ''' @@ -215,6 +216,7 @@ class BackupPolicyVMInfo(AzureRMModuleBaseExt): self.url = self.get_url() self.mgmt_client = self.get_mgmt_svc_client(GenericRestClient, + is_track2=True, base_url=self._cloud_environment.endpoints.resource_manager) response = self.get_resource() @@ -242,9 +244,9 @@ class BackupPolicyVMInfo(AzureRMModuleBaseExt): self.log('Backup policy does not exist.') self.fail('Error in fetching VM Backup Policy {0}'.format(str(e))) try: - response = json.loads(response.text) + response = json.loads(response.body()) except Exception: - response = {'text': response.text} + response = {'text': response.context['deserialized_data']} return response diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_vmssnetworkinterface_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_vmssnetworkinterface_info.py index e7f2b8474..ac7c5be10 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_vmssnetworkinterface_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_vmssnetworkinterface_info.py @@ -49,23 +49,23 @@ author: ''' EXAMPLES = ''' - - name: Get information by the network name - azure_rm_vmssnetworkinterface_info: - resource_group: myResourceGroup - name: nic001 - vmss_name: testVMSS - vm_index: 0 - - - name: Get all network interface information in virtual machine scale set - azure_rm_vmssnetworkinterface_info: - resource_group: myResourceGroup - vmss_name: testVMSS - - - name: Get all network interface information in the same virtual machine index. - azure_rm_vmssnetworkinterface_info: - resource_group: myResourceGroup - vmss_name: testVMSS - vm_index: 1 +- name: Get information by the network name + azure_rm_vmssnetworkinterface_info: + resource_group: myResourceGroup + name: nic001 + vmss_name: testVMSS + vm_index: 0 + +- name: Get all network interface information in virtual machine scale set + azure_rm_vmssnetworkinterface_info: + resource_group: myResourceGroup + vmss_name: testVMSS + +- name: Get all network interface information in the same virtual machine index. + azure_rm_vmssnetworkinterface_info: + resource_group: myResourceGroup + vmss_name: testVMSS + vm_index: 1 ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_vpnsite.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_vpnsite.py index e72c5474e..32d4fafee 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_vpnsite.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_vpnsite.py @@ -205,16 +205,15 @@ author: ''' EXAMPLES = ''' - - name: Create VpnSite - azure_rm_vpnsite: - resource_group: myResourceGroup - name: vpnSite_name - - - name: Delete Vpn Site - azure_rm_vpnsite: - resource_group: myResourceGroup - name: vpnSite_name - +- name: Create VpnSite + azure_rm_vpnsite: + resource_group: myResourceGroup + name: vpnSite_name + +- name: Delete Vpn Site + azure_rm_vpnsite: + resource_group: myResourceGroup + name: vpnSite_name ''' RETURN = ''' @@ -300,7 +299,6 @@ state: from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common_ext import AzureRMModuleBaseExt try: - from msrestazure.azure_operation import AzureOperationPoller from azure.core.exceptions import ResourceNotFoundError from azure.core.polling import LROPoller except ImportError: @@ -572,7 +570,7 @@ class AzureRMVpnSite(AzureRMModuleBaseExt): response = self.network_client.vpn_sites.begin_create_or_update(resource_group_name=self.resource_group, vpn_site_name=self.name, vpn_site_parameters=self.body) - if isinstance(response, AzureOperationPoller) or isinstance(response, LROPoller): + if isinstance(response, LROPoller): response = self.get_poller_result(response) except Exception as exc: self.log('Error attempting to create the VpnSite instance.') diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_vpnsite_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_vpnsite_info.py index 0799959ab..36fb4b268 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_vpnsite_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_vpnsite_info.py @@ -33,18 +33,17 @@ author: ''' EXAMPLES = ''' - - name: Get Vpn Site Info by name - azure_rm_vpnsite_info: - resource_group: myResourceGroup - name: vwan_site_name +- name: Get Vpn Site Info by name + azure_rm_vpnsite_info: + resource_group: myResourceGroup + name: vwan_site_name - - name: Get Vpn Site List By ResourceGroup - azure_rm_vpnsite_info: - resource_group: myResourceGroup - - - name: Get Vpn Site List By Subscription - azure_rm_vpnsite_info: +- name: Get Vpn Site List By ResourceGroup + azure_rm_vpnsite_info: + resource_group: myResourceGroup +- name: Get Vpn Site List By Subscription + azure_rm_vpnsite_info: ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_vpnsitelink_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_vpnsitelink_info.py index 5643d785f..2759b0fec 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_vpnsitelink_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_vpnsitelink_info.py @@ -40,17 +40,17 @@ author: ''' EXAMPLES = ''' - - name: Get Vpn Site Link info by the name - azure_rm_vpnsitelink_info: - resource_group: myResourceGroup - name: vpnSiteLink1 - vpn_site_name: vpnSite1 +- name: Get Vpn Site Link info by the name + azure_rm_vpnsitelink_info: + resource_group: myResourceGroup + name: vpnSiteLink1 + vpn_site_name: vpnSite1 - - name: Get Vpn Site Links by the Vpn Site - azure_rm_vpnsitelink_info: - resource_group: myResourceGroup - vpn_site_name: vpnSite1 +- name: Get Vpn Site Links by the Vpn Site + azure_rm_vpnsitelink_info: + resource_group: myResourceGroup + vpn_site_name: vpnSite1 ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webapp.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webapp.py index 50256ea0c..05697176b 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webapp.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webapp.py @@ -21,14 +21,17 @@ options: description: - Name of the resource group to which the resource belongs. required: True + type: str name: description: - Unique name of the app to create or update. To create or update a deployment slot, use the {slot} parameter. required: True + type: str location: description: - Resource location. If not set, location from the resource group will be used as default. + type: str plan: description: @@ -42,11 +45,14 @@ options: - C(sku), SKU of app service plan, allowed values listed on U(https://azure.microsoft.com/en-us/pricing/details/app-service/linux/). - C(is_linux), whether or not the app service plan is Linux. defaults to C(False). - C(number_of_workers), number of workers for app service plan. + type: raw frameworks: description: - Set of run time framework settings. Each setting is a dictionary. - See U(https://docs.microsoft.com/en-us/azure/app-service/app-service-web-overview) for more info. + type: list + elements: dict suboptions: name: description: @@ -57,6 +63,8 @@ options: - Linux web apps support C(java), C(ruby), C(php), C(python), C(dotnetcore), and C(node) from June 2018. - Linux web apps support only one framework. - Java framework is mutually exclusive with others. + type: str + required: true choices: - java - net_framework @@ -75,42 +83,56 @@ options: - C(dotnetcore) supported value sample, C(1.0), C(1.1), C(1.2). - C(ruby) supported value sample, C(2.3). - C(java) supported value sample, C(1.9) for Windows web app. C(1.8) for Linux web app. + type: str + required: true settings: description: - List of settings of the framework. + type: dict suboptions: java_container: description: - Name of Java container. - Supported only when I(frameworks=java). Sample values C(Tomcat), C(Jetty). + type: str + required: True java_container_version: description: - Version of Java container. - Supported only when I(frameworks=java). - Sample values for C(Tomcat), C(8.0), C(8.5), C(9.0). For C(Jetty,), C(9.1), C(9.3). + type: str + required: True container_settings: description: - Web app container settings. + type: dict suboptions: name: description: - Name of the container, for example C(imagename:tag). - To create a multi-container app, the name should be 'COMPOSE|' or 'KUBE|' followed by base64 encoded configuration. + type: str + required: True registry_server_url: description: - Container registry server URL, for example C(mydockerregistry.io). + type: str registry_server_user: description: - The container registry server user name. + type: str registry_server_password: description: - The container registry server password. + type: str scm_type: description: - Repository type of deployment source, for example C(LocalGit), C(GitHub). - List of supported values maintained at U(https://docs.microsoft.com/en-us/rest/api/appservice/webapps/createorupdate#scmtype). + type: str always_on: description: @@ -138,18 +160,22 @@ options: deployment_source: description: - Deployment source for git. + type: dict suboptions: url: description: - Repository url of deployment source. + type: str branch: description: - The branch name of the repository. + type: str startup_file: description: - The web's startup file. - Used only for Linux web apps. + type: str client_affinity_enabled: description: @@ -165,6 +191,7 @@ options: app_settings: description: - Configure web app application settings. Suboptions are in key value pair format. + type: dict purge_app_settings: description: @@ -187,6 +214,7 @@ options: - State of the Web App. - Use C(present) to create or update a Web App and C(absent) to delete it. default: present + type: str choices: - absent - present @@ -201,121 +229,121 @@ author: ''' EXAMPLES = ''' - - name: Create a windows web app with non-exist app service plan - azure_rm_webapp: - resource_group: myResourceGroup - name: myWinWebapp - plan: - resource_group: myAppServicePlan_rg - name: myAppServicePlan - is_linux: false - sku: S1 - - - name: Create a docker web app with some app settings, with docker image - azure_rm_webapp: - resource_group: myResourceGroup - name: myDockerWebapp - plan: - resource_group: myAppServicePlan_rg - name: myAppServicePlan - is_linux: true - sku: S1 - number_of_workers: 2 - app_settings: - testkey: testvalue - testkey2: testvalue2 - container_settings: - name: ansible/ansible:ubuntu1404 - - - name: Create a docker web app with private acr registry - azure_rm_webapp: - resource_group: myResourceGroup - name: myDockerWebapp - plan: myAppServicePlan - app_settings: - testkey: testvalue - container_settings: - name: ansible/ubuntu1404 - registry_server_url: myregistry.io - registry_server_user: user - registry_server_password: pass - - - name: Create a multi-container web app - azure_rm_webapp: - resource_group: myResourceGroup - name: myMultiContainerWebapp - plan: myAppServicePlan - app_settings: - testkey: testvalue - container_settings: - name: "COMPOSE|{{ lookup('file', 'docker-compose.yml') | b64encode }}" - - - name: Create a linux web app with Node 6.6 framework - azure_rm_webapp: - resource_group: myResourceGroup - name: myLinuxWebapp - plan: - resource_group: myAppServicePlan_rg - name: myAppServicePlan - app_settings: - testkey: testvalue - frameworks: - - name: "node" - version: "6.6" - - - name: Create a windows web app with node, php - azure_rm_webapp: - resource_group: myResourceGroup - name: myWinWebapp - plan: - resource_group: myAppServicePlan_rg - name: myAppServicePlan - app_settings: - testkey: testvalue - frameworks: - - name: "node" - version: 6.6 - - name: "php" - version: "7.0" - - - name: Create a stage deployment slot for an existing web app - azure_rm_webapp: - resource_group: myResourceGroup - name: myWebapp/slots/stage - plan: - resource_group: myAppServicePlan_rg - name: myAppServicePlan - app_settings: - testkey:testvalue - - - name: Create a linux web app with java framework - azure_rm_webapp: - resource_group: myResourceGroup - name: myLinuxWebapp - plan: - resource_group: myAppServicePlan_rg - name: myAppServicePlan - app_settings: - testkey: testvalue - frameworks: - - name: "java" - version: "8" - settings: - java_container: "Tomcat" - java_container_version: "8.5" - - - name: Create a linux web app with python framework - azure_rm_webapp: - resource_group: myResourceGroup - name: myLinuxWebapp - plan: - resource_group: myAppServicePlan_rg - name: myAppServicePlan - app_settings: - testkey: testvalue - frameworks: - - name: "python" - version: "3.10" +- name: Create a windows web app with non-exist app service plan + azure_rm_webapp: + resource_group: myResourceGroup + name: myWinWebapp + plan: + resource_group: myAppServicePlan_rg + name: myAppServicePlan + is_linux: false + sku: S1 + +- name: Create a docker web app with some app settings, with docker image + azure_rm_webapp: + resource_group: myResourceGroup + name: myDockerWebapp + plan: + resource_group: myAppServicePlan_rg + name: myAppServicePlan + is_linux: true + sku: S1 + number_of_workers: 2 + app_settings: + testkey: testvalue + testkey2: testvalue2 + container_settings: + name: ansible/ansible:ubuntu1404 + +- name: Create a docker web app with private acr registry + azure_rm_webapp: + resource_group: myResourceGroup + name: myDockerWebapp + plan: myAppServicePlan + app_settings: + testkey: testvalue + container_settings: + name: ansible/ubuntu1404 + registry_server_url: myregistry.io + registry_server_user: user + registry_server_password: pass + +- name: Create a multi-container web app + azure_rm_webapp: + resource_group: myResourceGroup + name: myMultiContainerWebapp + plan: myAppServicePlan + app_settings: + testkey: testvalue + container_settings: + name: "COMPOSE|{{ lookup('file', 'docker-compose.yml') | b64encode }}" + +- name: Create a linux web app with Node 6.6 framework + azure_rm_webapp: + resource_group: myResourceGroup + name: myLinuxWebapp + plan: + resource_group: myAppServicePlan_rg + name: myAppServicePlan + app_settings: + testkey: testvalue + frameworks: + - name: "node" + version: "6.6" + +- name: Create a windows web app with node, php + azure_rm_webapp: + resource_group: myResourceGroup + name: myWinWebapp + plan: + resource_group: myAppServicePlan_rg + name: myAppServicePlan + app_settings: + testkey: testvalue + frameworks: + - name: "node" + version: 6.6 + - name: "php" + version: "7.0" + +- name: Create a stage deployment slot for an existing web app + azure_rm_webapp: + resource_group: myResourceGroup + name: myWebapp/slots/stage + plan: + resource_group: myAppServicePlan_rg + name: myAppServicePlan + app_settings: + testkey:testvalue + +- name: Create a linux web app with java framework + azure_rm_webapp: + resource_group: myResourceGroup + name: myLinuxWebapp + plan: + resource_group: myAppServicePlan_rg + name: myAppServicePlan + app_settings: + testkey: testvalue + frameworks: + - name: "java" + version: "8" + settings: + java_container: "Tomcat" + java_container_version: "8.5" + +- name: Create a linux web app with python framework + azure_rm_webapp: + resource_group: myResourceGroup + name: myLinuxWebapp + plan: + resource_group: myAppServicePlan_rg + name: myAppServicePlan + app_settings: + testkey: testvalue + frameworks: + - name: "python" + version: "3.10" ''' RETURN = ''' @@ -327,7 +355,6 @@ id: sample: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Web/sites/myWebApp" ''' -import time from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase try: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webapp_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webapp_info.py index 36b3eb3d3..af035b152 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webapp_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webapp_info.py @@ -23,9 +23,11 @@ options: name: description: - Only show results for a specific web app. + type: str resource_group: description: - Limit results by resource group. + type: str return_publish_profile: description: - Indicate whether to return publishing profile of the web app. @@ -45,20 +47,20 @@ author: ''' EXAMPLES = ''' - - name: Get facts for web app by name - azure_rm_webapp_info: - resource_group: myResourceGroup - name: winwebapp1 +- name: Get facts for web app by name + azure_rm_webapp_info: + resource_group: myResourceGroup + name: winwebapp1 - - name: Get facts for web apps in resource group - azure_rm_webapp_info: - resource_group: myResourceGroup +- name: Get facts for web apps in resource group + azure_rm_webapp_info: + resource_group: myResourceGroup - - name: Get facts for web apps with tags - azure_rm_webapp_info: - tags: - - testtag - - foo:bar +- name: Get facts for web apps with tags + azure_rm_webapp_info: + tags: + - testtag + - foo:bar ''' RETURN = ''' @@ -441,20 +443,20 @@ class AzureRMWebAppInfo(AzureRMModuleBase): curated_output = dict() curated_output['id'] = webapp['id'] curated_output['name'] = webapp['name'] - curated_output['resource_group'] = webapp['properties']['resourceGroup'] + curated_output['resource_group'] = webapp['resource_group'] curated_output['location'] = webapp['location'] - curated_output['plan'] = webapp['properties']['serverFarmId'] + curated_output['plan'] = webapp['server_farm_id'] curated_output['tags'] = webapp.get('tags', None) # important properties from output. not match input arguments. - curated_output['app_state'] = webapp['properties']['state'] - curated_output['availability_state'] = webapp['properties']['availabilityState'] - curated_output['default_host_name'] = webapp['properties']['defaultHostName'] - curated_output['host_names'] = webapp['properties']['hostNames'] - curated_output['enabled'] = webapp['properties']['enabled'] - curated_output['enabled_host_names'] = webapp['properties']['enabledHostNames'] - curated_output['host_name_ssl_states'] = webapp['properties']['hostNameSslStates'] - curated_output['outbound_ip_addresses'] = webapp['properties']['outboundIpAddresses'] + curated_output['app_state'] = webapp['state'] + curated_output['availability_state'] = webapp['availability_state'] + curated_output['default_host_name'] = webapp['default_host_name'] + curated_output['host_names'] = webapp['host_names'] + curated_output['enabled'] = webapp['enabled'] + curated_output['enabled_host_names'] = webapp['enabled_host_names'] + curated_output['host_name_ssl_states'] = webapp['host_name_ssl_states'] + curated_output['outbound_ip_addresses'] = webapp['outbound_ip_addresses'] # curated site_config if configuration: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webappaccessrestriction.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webappaccessrestriction.py index d8b49a335..bfe2b7591 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webappaccessrestriction.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webappaccessrestriction.py @@ -39,6 +39,7 @@ options: - The web app's HTTP access restrictions. type: list elements: dict + default: [] suboptions: name: description: @@ -73,6 +74,7 @@ options: the SCM restrictions will be configured but not used. type: list elements: dict + default: [] suboptions: name: description: @@ -116,26 +118,26 @@ author: ''' EXAMPLES = ''' - - name: Configure web app access restrictions. - azure.azcollection.azure_rm_webappaccessrestriction: - name: "MyWebapp" - resource_group: "MyResourceGroup" - ip_security_restrictions: - - name: "Datacenter 1" - action: "Allow" - ip_address: "1.1.1.1/24" - priority: 1 - - name: "Datacenter 2" - action: "Allow" - ip_address: "2.2.2.2/24" - priority: 2 - scm_ip_security_restrictions_use_main: true - - - name: Delete web app network access restrictions. - azure.azcollection.azure_rm_webappaccessrestriction: - name: "MyWebapp" - resource_group: "MyResourceGroup" - state: "absent" +- name: Configure web app access restrictions. + azure.azcollection.azure_rm_webappaccessrestriction: + name: "MyWebapp" + resource_group: "MyResourceGroup" + ip_security_restrictions: + - name: "Datacenter 1" + action: "Allow" + ip_address: "1.1.1.1/24" + priority: 1 + - name: "Datacenter 2" + action: "Allow" + ip_address: "2.2.2.2/24" + priority: 2 + scm_ip_security_restrictions_use_main: true + +- name: Delete web app network access restrictions. + azure.azcollection.azure_rm_webappaccessrestriction: + name: "MyWebapp" + resource_group: "MyResourceGroup" + state: "absent" ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webappaccessrestriction_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webappaccessrestriction_info.py index 0c3eb3260..2d07bc2de 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webappaccessrestriction_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webappaccessrestriction_info.py @@ -35,10 +35,10 @@ author: ''' EXAMPLES = ''' - - name: View web app access restrictions. - azure.azcollection.azure_rm_webappaccessrestriction_info: - name: "MyWebapp" - resource_group: "MyResourceGroup" +- name: View web app access restrictions. + azure.azcollection.azure_rm_webappaccessrestriction_info: + name: "MyWebapp" + resource_group: "MyResourceGroup" ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webappslot.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webappslot.py index 08ca490b0..85b7e96c8 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webappslot.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webappslot.py @@ -21,28 +21,35 @@ options: description: - Name of the resource group to which the resource belongs. required: True + type: str name: description: - Unique name of the deployment slot to create or update. required: True + type: str webapp_name: description: - Web app name which this deployment slot belongs to. required: True + type: str location: description: - Resource location. If not set, location from the resource group will be used as default. + type: str configuration_source: description: - Source slot to clone configurations from when creating slot. Use webapp's name to refer to the production slot. + type: str auto_swap_slot_name: description: - Used to configure target slot name to auto swap, or disable auto swap. - Set it target slot name to auto swap. - Set it to False to disable auto slot swap. + type: raw swap: description: - Swap deployment slots of a web app. + type: dict suboptions: action: description: @@ -50,6 +57,7 @@ options: - C(preview) is to apply target slot settings on source slot first. - C(swap) is to complete swapping. - C(reset) is to reset the swap. + type: str choices: - preview - swap @@ -58,6 +66,7 @@ options: target_slot: description: - Name of target slot to swap. If set to None, then swap with production slot. + type: str preserve_vnet: description: - C(True) to preserve virtual network to the slot during swap. Otherwise C(False). @@ -67,6 +76,8 @@ options: description: - Set of run time framework settings. Each setting is a dictionary. - See U(https://docs.microsoft.com/en-us/azure/app-service/app-service-web-overview) for more info. + type: list + elements: dict suboptions: name: description: @@ -77,6 +88,8 @@ options: - Linux web apps support C(java), C(ruby), C(php), C(dotnetcore), and C(node) from June 2018. - Linux web apps support only one framework. - Java framework is mutually exclusive with others. + type: str + required: true choices: - java - net_framework @@ -95,40 +108,55 @@ options: - C(dotnetcore) supported value sample, C(1.0), C(1.1), C(1.2). - C(ruby) supported value sample, 2.3. - C(java) supported value sample, C(1.9) for Windows web app. C(1.8) for Linux web app. + type: str + required: true settings: description: - List of settings of the framework. + type: dict suboptions: java_container: description: - Name of Java container. This is supported by specific framework C(java) onlys, for example C(Tomcat), C(Jetty). + type: str + required: true java_container_version: description: - Version of Java container. This is supported by specific framework C(java) only. - For C(Tomcat), for example C(8.0), C(8.5), C(9.0). For C(Jetty), for example C(9.1), C(9.3). + type: str + required: true container_settings: description: - Web app slot container settings. + type: dict suboptions: name: description: - Name of container, for example C(imagename:tag). + type: str + required: true registry_server_url: description: - Container registry server URL, for example C(mydockerregistry.io). + type: str registry_server_user: description: - The container registry server user name. + type: str registry_server_password: description: - The container registry server password. + type: str startup_file: description: - The slot startup file. - This only applies for Linux web app slot. + type: str app_settings: description: - Configure web app slot application settings. Suboptions are in key value pair format. + type: dict purge_app_settings: description: - Purge any existing application settings. Replace slot application settings with app_settings. @@ -137,13 +165,16 @@ options: deployment_source: description: - Deployment source for git. + type: dict suboptions: url: description: - Repository URL of deployment source. + type: str branch: description: - The branch name of the repository. + type: str app_state: description: - Start/Stop/Restart the slot. @@ -154,13 +185,14 @@ options: - restarted default: started state: - description: - - State of the Web App deployment slot. - - Use C(present) to create or update a slot and C(absent) to delete it. - default: present - choices: - - absent - - present + description: + - State of the Web App deployment slot. + - Use C(present) to create or update a slot and C(absent) to delete it. + default: present + type: str + choices: + - absent + - present extends_documentation_fragment: - azure.azcollection.azure @@ -172,46 +204,46 @@ author: ''' EXAMPLES = ''' - - name: Create a webapp slot - azure_rm_webappslot: - resource_group: myResourceGroup - webapp_name: myJavaWebApp - name: stage - configuration_source: myJavaWebApp - app_settings: - testkey: testvalue - - - name: swap the slot with production slot - azure_rm_webappslot: - resource_group: myResourceGroup - webapp_name: myJavaWebApp - name: stage - swap: - action: swap - - - name: stop the slot - azure_rm_webappslot: - resource_group: myResourceGroup - webapp_name: myJavaWebApp - name: stage - app_state: stopped - - - name: udpate a webapp slot app settings - azure_rm_webappslot: - resource_group: myResourceGroup - webapp_name: myJavaWebApp - name: stage - app_settings: - testkey: testvalue2 - - - name: udpate a webapp slot frameworks - azure_rm_webappslot: - resource_group: myResourceGroup - webapp_name: myJavaWebApp - name: stage - frameworks: - - name: "node" - version: "10.1" +- name: Create a webapp slot + azure_rm_webappslot: + resource_group: myResourceGroup + webapp_name: myJavaWebApp + name: stage + configuration_source: myJavaWebApp + app_settings: + testkey: testvalue + +- name: swap the slot with production slot + azure_rm_webappslot: + resource_group: myResourceGroup + webapp_name: myJavaWebApp + name: stage + swap: + action: swap + +- name: stop the slot + azure_rm_webappslot: + resource_group: myResourceGroup + webapp_name: myJavaWebApp + name: stage + app_state: stopped + +- name: udpate a webapp slot app settings + azure_rm_webappslot: + resource_group: myResourceGroup + webapp_name: myJavaWebApp + name: stage + app_settings: + testkey: testvalue2 + +- name: udpate a webapp slot frameworks + azure_rm_webappslot: + resource_group: myResourceGroup + webapp_name: myJavaWebApp + name: stage + frameworks: + - name: "node" + version: "10.1" ''' RETURN = ''' @@ -223,7 +255,6 @@ id: sample: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Web/sites/testapp/slots/stage1 ''' -import time from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase try: diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webappvnetconnection.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webappvnetconnection.py index 4b55a93f4..198273351 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webappvnetconnection.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webappvnetconnection.py @@ -55,26 +55,26 @@ author: ''' EXAMPLES = ''' - - name: Configure web app with virtual network - azure.azcollection.azure_rm_webappvnetconnection: - name: "MyWebapp" - resource_group: "MyResourceGroup" - vnet_name: "MyVnetName" - subnet: "MySubnetName" - - - name: Configure web app with virtual network in different resource group - azure.azcollection.azure_rm_webappvnetconnection: - name: "MyWebapp" - resource_group: "MyResourceGroup" - vnet_name: "MyVnetName" - subnet: "MySubnetName" - vnet_resource_group: "MyOtherResourceGroup" - - - name: Delete web app virtual network - azure.azcollection.azure_rm_webappvnetconnection: - name: "MyWebapp" - resource_group: "MyResourceGroup" - state: "absent" +- name: Configure web app with virtual network + azure.azcollection.azure_rm_webappvnetconnection: + name: "MyWebapp" + resource_group: "MyResourceGroup" + vnet_name: "MyVnetName" + subnet: "MySubnetName" + +- name: Configure web app with virtual network in different resource group + azure.azcollection.azure_rm_webappvnetconnection: + name: "MyWebapp" + resource_group: "MyResourceGroup" + vnet_name: "MyVnetName" + subnet: "MySubnetName" + vnet_resource_group: "MyOtherResourceGroup" + +- name: Delete web app virtual network + azure.azcollection.azure_rm_webappvnetconnection: + name: "MyWebapp" + resource_group: "MyResourceGroup" + state: "absent" ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webappvnetconnection_info.py b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webappvnetconnection_info.py index 8ad772918..c114b63ff 100644 --- a/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webappvnetconnection_info.py +++ b/ansible_collections/azure/azcollection/plugins/modules/azure_rm_webappvnetconnection_info.py @@ -39,10 +39,10 @@ author: ''' EXAMPLES = ''' - - name: Get web app virtual network connection - azure_rm_webappvnetconnection_info: - name: "MyWebapp" - resource_group: "MyResourceGroup" +- name: Get web app virtual network connection + azure_rm_webappvnetconnection_info: + name: "MyWebapp" + resource_group: "MyResourceGroup" ''' RETURN = ''' diff --git a/ansible_collections/azure/azcollection/pr-pipelines.yml b/ansible_collections/azure/azcollection/pr-pipelines.yml index c8b943d62..6f40e066a 100644 --- a/ansible_collections/azure/azcollection/pr-pipelines.yml +++ b/ansible_collections/azure/azcollection/pr-pipelines.yml @@ -1,146 +1,147 @@ parameters: -- name: PYTHON_VER - displayName: 'Python Version' - type: string - default: "3.8" - values: - - "2.7" - - "3.6" - - "3.8" - - "3.9" - - "3.10" - - "3.11" -- name: ANSIBLE_VER - displayName: 'Ansible Version' - type: string - default: "2.12" - values: - - "2.9" - - "2.10" - - "2.11" - - "2.12" - - "2.13" - - "2.14" - - "devel" -- name: MODULE_NAME - displayName: 'Test Module' - type: string - default: 'all' - values: - - 'all' - - 'sanity' - - 'azure_rm_adapplication' - - "azure_rm_acs" - - "azure_rm_adgroup" - - "azure_rm_aduser" - - "azure_rm_aks" - - "azure_rm_aksagentpool" - - "azure_rm_apimanagement" - - "azure_rm_appgateway" - - "azure_rm_appserviceplan" - - "azure_rm_automationaccount" - - "azure_rm_automationrunbook" - - "azure_rm_autoscale" - - "azure_rm_availabilityset" - - "azure_rm_azurefirewall" - - "azure_rm_apimanagementservice" - - "azure_rm_batchaccount" - - "azure_rm_backuppolicy" - - "azure_rm_cdnprofile" - - "azure_rm_containerinstance" - - "azure_rm_containerregistry" - - "azure_rm_containerregistrytag" - - "azure_rm_cosmosdbaccount" - - "azure_rm_datalakestore" - - "azure_rm_ddosprotectionplan" - - "azure_rm_deployment" - - "azure_rm_diskencryptionset" - - "azure_rm_dnsrecordset" - - "azure_rm_dnszone" - - "azure_rm_eventhub" - - "azure_rm_expressroute" - - "azure_rm_firewallpolicy" - - "azure_rm_functionapp" - - "azure_rm_gallery" - - "azure_rm_hdinsightcluster" - - "azure_rm_hostgroup" - - "azure_rm_image" - - "azure_rm_iothub" - - "azure_rm_ipgroup" - - "azure_rm_keyvault" - - "azure_rm_keyvaultkey" - - "azure_rm_keyvaultsecret" - - "azure_rm_loadbalancer" - - "azure_rm_loganalyticsworkspace" - - "azure_rm_manageddisk" - - "azure_rm_managementgroup" - - "azure_rm_mariadbserver" - - "azure_rm_monitordiagnosticsetting" - - "azure_rm_monitorlogprofile" - - "azure_rm_multiplemanageddisks" - - "azure_rm_mysqlserver" - - "azure_rm_natgateway" - - "azure_rm_networkinterface" - - "azure_rm_notificationhub" - - "azure_rm_openshiftmanagedcluster" - - "azure_rm_postgresqlserver" - - "azure_rm_privatednsrecordset" - - "azure_rm_privatednszone" - - "azure_rm_privateendpoint" - - "azure_rm_privateendpointdnszonegroup" - - "azure_rm_privatelinkservice" - - "azure_rm_privatednszonelink" - - "azure_rm_publicipaddress" - - "azure_rm_proximityplacementgroup" - - "azure_rm_rediscache" - - "azure_rm_resource" - - "azure_rm_resourcegroup" - - "azure_rm_routetable" - - "azure_rm_roleassignment" - - "azure_rm_roledefinition" - - "azure_rm_registrationassignment" - - "azure_rm_registrationdefinition" - - "azure_rm_cognitivesearch" - - "azure_rm_securitygroup" - - "azure_rm_servicebus" - - "azure_rm_sqlserver" - - "azure_rm_storageaccount" - - "azure_rm_storageblob" - - "azure_rm_storageshare" - - "azure_rm_subnet" - - "azure_rm_subscription" - - "azure_rm_trafficmanagerprofile" - - "azure_rm_virtualmachine" - - "azure_rm_virtualmachineextension" - - "azure_rm_virtualmachineimage_info" - - "azure_rm_virtualmachinescaleset" - - "azure_rm_virtualmachinesize_info" - - "azure_rm_virtualnetwork" - - "azure_rm_virtualnetworkgateway" - - "azure_rm_virtualnetworkpeering" - - "azure_rm_virtualwan" - - "azure_rm_vpnsite" - - "azure_rm_virtualhub" - - "azure_rm_virtualhubconnection" - - "azure_rm_backupazurevm" - - "azure_rm_recoveryservicesvault" - - "azure_rm_vmbackuppolicy" - - "azure_rm_webapp" - - "azure_rm_webappvnetconnection" - - "azure_rm_webappaccessrestriction" - - "azure_rm_workspace" - - "azure_rm_datafactory" - - "azure_rm_bastionhost" - - "azure_rm_devtestlab" - - "azure_rm_sqlmanagedinstance" - - "azure_rm_vmssnetworkinterface_info" - - "inventory_azure" - - "setup_azure" + - name: PYTHON_VER + displayName: 'Python Version' + type: string + default: "3.9" + values: + - "2.7" + - "3.6" + - "3.8" + - "3.9" + - "3.10" + - "3.11" + - name: ANSIBLE_VER + displayName: 'Ansible Version' + type: string + default: "2.15" + values: + - "2.9" + - "2.10" + - "2.11" + - "2.12" + - "2.13" + - "2.14" + - "2.15" + - "devel" + - name: MODULE_NAME + displayName: 'Test Module' + type: string + default: 'all' + values: + - 'all' + - 'sanity' + - 'azure_rm_adapplication' + - "azure_rm_acs" + - "azure_rm_adgroup" + - "azure_rm_aduser" + - "azure_rm_aks" + - "azure_rm_aksagentpool" + - "azure_rm_apimanagement" + - "azure_rm_appgateway" + - "azure_rm_appserviceplan" + - "azure_rm_automationaccount" + - "azure_rm_automationrunbook" + - "azure_rm_autoscale" + - "azure_rm_availabilityset" + - "azure_rm_azurefirewall" + - "azure_rm_apimanagementservice" + - "azure_rm_batchaccount" + - "azure_rm_backuppolicy" + - "azure_rm_cdnprofile" + - "azure_rm_containerinstance" + - "azure_rm_containerregistry" + - "azure_rm_containerregistrytag" + - "azure_rm_cosmosdbaccount" + - "azure_rm_datalakestore" + - "azure_rm_ddosprotectionplan" + - "azure_rm_deployment" + - "azure_rm_diskencryptionset" + - "azure_rm_dnsrecordset" + - "azure_rm_dnszone" + - "azure_rm_eventhub" + - "azure_rm_expressroute" + - "azure_rm_firewallpolicy" + - "azure_rm_functionapp" + - "azure_rm_gallery" + - "azure_rm_hdinsightcluster" + - "azure_rm_hostgroup" + - "azure_rm_image" + - "azure_rm_iothub" + - "azure_rm_ipgroup" + - "azure_rm_keyvault" + - "azure_rm_keyvaultkey" + - "azure_rm_keyvaultsecret" + - "azure_rm_loadbalancer" + - "azure_rm_loganalyticsworkspace" + - "azure_rm_manageddisk" + - "azure_rm_managementgroup" + - "azure_rm_mariadbserver" + - "azure_rm_monitordiagnosticsetting" + - "azure_rm_monitorlogprofile" + - "azure_rm_multiplemanageddisks" + - "azure_rm_mysqlserver" + - "azure_rm_natgateway" + - "azure_rm_networkinterface" + - "azure_rm_notificationhub" + - "azure_rm_openshiftmanagedcluster" + - "azure_rm_postgresqlserver" + - "azure_rm_privatednsrecordset" + - "azure_rm_privatednszone" + - "azure_rm_privateendpoint" + - "azure_rm_privateendpointdnszonegroup" + - "azure_rm_privatelinkservice" + - "azure_rm_privatednszonelink" + - "azure_rm_publicipaddress" + - "azure_rm_proximityplacementgroup" + - "azure_rm_rediscache" + - "azure_rm_resource" + - "azure_rm_resourcegroup" + - "azure_rm_routetable" + - "azure_rm_roleassignment" + - "azure_rm_roledefinition" + - "azure_rm_registrationassignment" + - "azure_rm_registrationdefinition" + - "azure_rm_cognitivesearch" + - "azure_rm_securitygroup" + - "azure_rm_servicebus" + - "azure_rm_sqlserver" + - "azure_rm_storageaccount" + - "azure_rm_storageblob" + - "azure_rm_storageshare" + - "azure_rm_subnet" + - "azure_rm_subscription" + - "azure_rm_trafficmanagerprofile" + - "azure_rm_virtualmachine" + - "azure_rm_virtualmachineextension" + - "azure_rm_virtualmachineimage_info" + - "azure_rm_virtualmachinescaleset" + - "azure_rm_virtualmachinesize_info" + - "azure_rm_virtualnetwork" + - "azure_rm_virtualnetworkgateway" + - "azure_rm_virtualnetworkpeering" + - "azure_rm_virtualwan" + - "azure_rm_vpnsite" + - "azure_rm_virtualhub" + - "azure_rm_virtualhubconnection" + - "azure_rm_backupazurevm" + - "azure_rm_recoveryservicesvault" + - "azure_rm_vmbackuppolicy" + - "azure_rm_webapp" + - "azure_rm_webappvnetconnection" + - "azure_rm_webappaccessrestriction" + - "azure_rm_workspace" + - "azure_rm_datafactory" + - "azure_rm_bastionhost" + - "azure_rm_devtestlab" + - "azure_rm_sqlmanagedinstance" + - "azure_rm_vmssnetworkinterface_info" + - "inventory_azure" + - "setup_azure" trigger: none pr: -- dev + - dev pool: name: pool-ubuntu-2004 @@ -172,7 +173,7 @@ jobs: variables: TEST_RESOURCE_GROUP: $[ dependencies.CreateResourceGroups.outputs['setvar.resource_group'] ] TEST_RESOURCE_GROUP_SECONDARY: $[ dependencies.CreateResourceGroups.outputs['setvar.resource_group_secondary'] ] - TEST_RESOURCE_GROUP_DATALAKE: $[ dependencies.CreateResourceGroups.outputs['setvar.resource_group_datalake'] ] + TEST_RESOURCE_GROUP_DATALAKE: $[ dependencies.CreateResourceGroups.outputs['setvar.resource_group_datalake'] ] strategy: matrix: "Python${{ parameters.PYTHON_VER }}_sanity": @@ -222,26 +223,26 @@ jobs: test.key: '15' steps: - - task: UsePythonVersion@0 - displayName: 'Use Python $(python.version)' - inputs: - versionSpec: '$(python.version)' + - task: UsePythonVersion@0 + displayName: 'Use Python $(python.version)' + inputs: + versionSpec: '$(python.version)' - - script: tests/utils/ado/ado.sh $(test.key) ${{ parameters.PYTHON_VER }} ${{ parameters.ANSIBLE_VER }} ${{ parameters.MODULE_NAME }} - env: - SHIPPABLE_BUILD_DIR: $(Build.Repository.LocalPath) - AZURE_CLIENT_ID: $(AZURE_CLIENT_ID) - AZURE_SECRET: $(AZURE_SECRET) - AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID) - AZURE_SUBSCRIPTION_SEC_ID: $(AZURE_SUBSCRIPTION_SEC_ID) - AZURE_TENANT: $(AZURE_TENANT) - AZURE_PRINCIPAL_ID: $(AZURE_PRINCIPAL_ID) - AZURE_MANAGED_BY_TENANT_ID: $(AZURE_MANAGED_BY_TENANT_ID) - AZURE_ROLE_DEFINITION_ID: $(AZURE_ROLE_DEFINITION_ID) - RESOURCE_GROUP: $(TEST_RESOURCE_GROUP) - RESOURCE_GROUP_SECONDARY: $(TEST_RESOURCE_GROUP_SECONDARY) - RESOURCE_GROUP_DATALAKE: $(TEST_RESOURCE_GROUP_DATALAKE) - displayName: 'Running Tests' + - script: tests/utils/ado/ado.sh $(test.key) ${{ parameters.PYTHON_VER }} ${{ parameters.ANSIBLE_VER }} ${{ parameters.MODULE_NAME }} + env: + SHIPPABLE_BUILD_DIR: $(Build.Repository.LocalPath) + AZURE_CLIENT_ID: $(AZURE_CLIENT_ID) + AZURE_SECRET: $(AZURE_SECRET) + AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID) + AZURE_SUBSCRIPTION_SEC_ID: $(AZURE_SUBSCRIPTION_SEC_ID) + AZURE_TENANT: $(AZURE_TENANT) + AZURE_PRINCIPAL_ID: $(AZURE_PRINCIPAL_ID) + AZURE_MANAGED_BY_TENANT_ID: $(AZURE_MANAGED_BY_TENANT_ID) + AZURE_ROLE_DEFINITION_ID: $(AZURE_ROLE_DEFINITION_ID) + RESOURCE_GROUP: $(TEST_RESOURCE_GROUP) + RESOURCE_GROUP_SECONDARY: $(TEST_RESOURCE_GROUP_SECONDARY) + RESOURCE_GROUP_DATALAKE: $(TEST_RESOURCE_GROUP_DATALAKE) + displayName: 'Running Tests' - job: CleanupResourceGroups dependsOn: diff --git a/ansible_collections/azure/azcollection/release-pipelines.yml b/ansible_collections/azure/azcollection/release-pipelines.yml index adb69fb4d..212de7665 100644 --- a/ansible_collections/azure/azcollection/release-pipelines.yml +++ b/ansible_collections/azure/azcollection/release-pipelines.yml @@ -4,9 +4,9 @@ # https://aka.ms/yaml trigger: - tags: - include: - - v*.*.* + tags: + include: + - v*.*.* pr: none @@ -14,16 +14,16 @@ pool: name: pool-ubuntu-2004 steps: -- script: | - pip install wheel - pip install ansible==v2.9.0 - ansible --version - displayName: 'install ansible' + - script: | + pip install wheel + pip install ansible==v2.14.0 + ansible --version + displayName: 'install ansible' -- script: | - ansible-galaxy collection build . - displayName: 'build collection' + - script: | + ansible-galaxy collection build . + displayName: 'build collection' -- script: | - ansible-galaxy collection publish *.tar.gz --api-key $(GALAXY_KEY) - displayName: 'publish collection'
\ No newline at end of file + - script: | + ansible-galaxy collection publish *.tar.gz --api-key $(GALAXY_KEY) + displayName: 'publish collection' diff --git a/ansible_collections/azure/azcollection/requirements-azure.txt b/ansible_collections/azure/azcollection/requirements-azure.txt index 32603e2af..4aae3275d 100644 --- a/ansible_collections/azure/azcollection/requirements-azure.txt +++ b/ansible_collections/azure/azcollection/requirements-azure.txt @@ -1,12 +1,13 @@ packaging requests[security] xmltodict +msal==1.23.0 azure-cli-core==2.34.0 azure-common==1.1.11 azure-identity==1.7.0 azure-mgmt-authorization==2.0.0 azure-mgmt-apimanagement==3.0.0 -azure-mgmt-batch==5.0.1 +azure-mgmt-batch==16.2.0 azure-mgmt-cdn==11.0.0 azure-mgmt-compute==26.1.0 azure-mgmt-containerinstance==9.0.0 @@ -36,8 +37,9 @@ azure-mgmt-web==6.1.0 azure-nspkg==2.0.0 azure-storage-blob==12.11.0 msrest==0.7.1 +azure-core==1.28.0 msrestazure==0.6.4 -azure-keyvault==1.1.0 +azure-keyvault==4.2.0 azure-mgmt-keyvault==10.0.0 azure-graphrbac==0.61.1 azure-mgmt-cosmosdb==6.4.0 @@ -46,6 +48,7 @@ azure-mgmt-devtestlabs==9.0.0 azure-mgmt-loganalytics==12.0.0 azure-mgmt-automation==1.0.0 azure-mgmt-iothub==2.2.0 +azure-iot-hub==2.6.1 azure-mgmt-recoveryservices==2.0.0 azure-mgmt-recoveryservicesbackup==3.0.0 azure-mgmt-notificationhubs==7.0.0 diff --git a/ansible_collections/azure/azcollection/sanity-requirements-azure.txt b/ansible_collections/azure/azcollection/sanity-requirements-azure.txt index f879956da..e18c13718 100644 --- a/ansible_collections/azure/azcollection/sanity-requirements-azure.txt +++ b/ansible_collections/azure/azcollection/sanity-requirements-azure.txt @@ -1,5 +1,5 @@ voluptuous==0.13.1 pycodestyle==2.8.0 yamllint==1.26.3 -cryptography==38.0.3 +cryptography==41.0.4 pylint==2.13.5 diff --git a/ansible_collections/azure/azcollection/tests/config.yml b/ansible_collections/azure/azcollection/tests/config.yml index ecfdc9425..4676bc0d5 100644 --- a/ansible_collections/azure/azcollection/tests/config.yml +++ b/ansible_collections/azure/azcollection/tests/config.yml @@ -1,2 +1,2 @@ modules: - python_requires: '>= 3.6'
\ No newline at end of file + python_requires: '>= 3.6' diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_account_info/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_account_info/tasks/main.yml index 5c010972f..ddc52368e 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_account_info/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_account_info/tasks/main.yml @@ -2,7 +2,8 @@ azure.azcollection.azure_rm_account_info: register: result -- assert: +- name: Assert the facts + ansible.builtin.assert: that: - result is not changed - result is not failed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_acs/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_acs/tasks/main.yml index a35871c09..a2f3fdafa 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_acs/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_acs/tasks/main.yml @@ -1,149 +1,149 @@ - - name: Create an ACS instance - DCOS - azure_rm_acs: - name: "acsdcos{{ resource_group | hash('md5') | truncate(7, True, '') }}" - resource_group: "{{ resource_group }}" - location: eastus - orchestration_platform: DCOS - master_profile: - - count: 1 - dns_prefix: "acsdcos{{ resource_group | hash('md5') | truncate(10, True, '') }}" - vm_size: Standard_A0 - linux_profile: - - admin_username: azureuser - ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+io238wdhjkasndq238e2/983289dasjnasey823/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+928dfsjsejk298r/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+dsajda82e78sdja/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt juliens@msft.com - agent_pool_profiles: - - name: default - count: 1 - dns_prefix: "acsdcos{{ resource_group | hash('md5') | truncate(12, True, '') }}" - vm_size: Standard_A0 - diagnostics_profile: false - register: output +- name: Create an ACS instance - DCOS + azure_rm_acs: + name: "acsdcos{{ resource_group | hash('md5') | truncate(7, True, '') }}" + resource_group: "{{ resource_group }}" + location: eastus + orchestration_platform: DCOS + master_profile: + - count: 1 + dns_prefix: "acsdcos{{ resource_group | hash('md5') | truncate(10, True, '') }}" + vm_size: Standard_A0 + linux_profile: + - admin_username: azureuser + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+io238wdhjkasndq238e2/983289dasjnasey823/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+928dfsjsejk298r/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+dsajda82e78sdja/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt juliens@msft.com + agent_pool_profiles: + - name: default + count: 1 + dns_prefix: "acsdcos{{ resource_group | hash('md5') | truncate(12, True, '') }}" + vm_size: Standard_A0 + diagnostics_profile: false + register: output - - name: Assert the ACS instance is well created - assert: - that: - - output.changed - - output.state.provisioning_state == 'Succeeded' +- name: Assert the ACS instance is well created + ansible.builtin.assert: + that: + - output.changed + - output.state.provisioning_state == 'Succeeded' - - name: Scale the ACS instance from 1 to 2 - DCOS - azure_rm_acs: - name: "acsdcos{{ resource_group | hash('md5') | truncate(7, True, '') }}" - resource_group: "{{ resource_group }}" - location: eastus - orchestration_platform: DCOS - master_profile: - - count: 1 - dns_prefix: "acsdcos{{ resource_group | hash('md5') | truncate(10, True, '') }}" - vm_size: Standard_A0 - linux_profile: - - admin_username: azureuser - ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+io238wdhjkasndq238e2/983289dasjnasey823/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+928dfsjsejk298r/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+dsajda82e78sdja/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt juliens@msft.com - agent_pool_profiles: - - name: default - count: 2 - dns_prefix: "acsdcos{{ resource_group | hash('md5') | truncate(12, True, '') }}" - vm_size: Standard_A0 - diagnostics_profile: false - register: output +- name: Scale the ACS instance from 1 to 2 - DCOS + azure_rm_acs: + name: "acsdcos{{ resource_group | hash('md5') | truncate(7, True, '') }}" + resource_group: "{{ resource_group }}" + location: eastus + orchestration_platform: DCOS + master_profile: + - count: 1 + dns_prefix: "acsdcos{{ resource_group | hash('md5') | truncate(10, True, '') }}" + vm_size: Standard_A0 + linux_profile: + - admin_username: azureuser + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+io238wdhjkasndq238e2/983289dasjnasey823/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+928dfsjsejk298r/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+dsajda82e78sdja/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt juliens@msft.com + agent_pool_profiles: + - name: default + count: 2 + dns_prefix: "acsdcos{{ resource_group | hash('md5') | truncate(12, True, '') }}" + vm_size: Standard_A0 + diagnostics_profile: false + register: output - - name: Assert the ACS instance is well scaled - assert: - that: - - output.changed - - output.state.agent_pool_profiles[0].count == 2 +- name: Assert the ACS instance is well scaled + ansible.builtin.assert: + that: + - output.changed + - output.state.agent_pool_profiles[0].count == 2 - - name: Delete the DCOS ACS instance - DCOS - azure_rm_acs: - name: "acsdcos{{ resource_group | hash('md5') | truncate(7, True, '') }}" - resource_group: "{{ resource_group }}" - location: eastus - orchestration_platform: DCOS - state: absent - master_profile: - - count: 1 - dns_prefix: "acsdcos{{ resource_group | hash('md5') | truncate(10, True, '') }}" - vm_size: Standard_A0 - linux_profile: - - admin_username: azureuser - ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+io238wdhjkasndq238e2/983289dasjnasey823/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+928dfsjsejk298r/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+dsajda82e78sdja/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt juliens@msft.com - agent_pool_profiles: - - name: default - count: 2 - dns_prefix: "acsdcos{{ resource_group | hash('md5') | truncate(12, True, '') }}" - vm_size: Standard_A0 - diagnostics_profile: false +- name: Delete the DCOS ACS instance - DCOS + azure_rm_acs: + name: "acsdcos{{ resource_group | hash('md5') | truncate(7, True, '') }}" + resource_group: "{{ resource_group }}" + location: eastus + orchestration_platform: DCOS + state: absent + master_profile: + - count: 1 + dns_prefix: "acsdcos{{ resource_group | hash('md5') | truncate(10, True, '') }}" + vm_size: Standard_A0 + linux_profile: + - admin_username: azureuser + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+io238wdhjkasndq238e2/983289dasjnasey823/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+928dfsjsejk298r/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+dsajda82e78sdja/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt juliens@msft.com + agent_pool_profiles: + - name: default + count: 2 + dns_prefix: "acsdcos{{ resource_group | hash('md5') | truncate(12, True, '') }}" + vm_size: Standard_A0 + diagnostics_profile: false - - name: Create an ACS instance - Swarm - azure_rm_acs: - name: "acssw{{ resource_group | hash('md5') | truncate(7, True, '') }}" - resource_group: "{{ resource_group }}" - location: eastus - orchestration_platform: Swarm - master_profile: - - count: 1 - dns_prefix: "acssw{{ resource_group | hash('md5') | truncate(10, True, '') }}" - vm_size: Standard_A0 - linux_profile: - - admin_username: azureuser - ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+io238wdhjkasndq238e2/983289dasjnasey823/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+928dfsjsejk298r/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+dsajda82e78sdja/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt juliens@msft.com - agent_pool_profiles: - - name: default - count: 1 - dns_prefix: "acssw{{ resource_group | hash('md5') | truncate(12, True, '') }}" - vm_size: Standard_A0 - diagnostics_profile: false - register: output +- name: Create an ACS instance - Swarm + azure_rm_acs: + name: "acssw{{ resource_group | hash('md5') | truncate(7, True, '') }}" + resource_group: "{{ resource_group }}" + location: eastus + orchestration_platform: Swarm + master_profile: + - count: 1 + dns_prefix: "acssw{{ resource_group | hash('md5') | truncate(10, True, '') }}" + vm_size: Standard_A0 + linux_profile: + - admin_username: azureuser + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+io238wdhjkasndq238e2/983289dasjnasey823/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+928dfsjsejk298r/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+dsajda82e78sdja/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt juliens@msft.com + agent_pool_profiles: + - name: default + count: 1 + dns_prefix: "acssw{{ resource_group | hash('md5') | truncate(12, True, '') }}" + vm_size: Standard_A0 + diagnostics_profile: false + register: output - - name: Assert the ACS instance is well created - assert: - that: - - output.changed - - output.state.provisioning_state == 'Succeeded' +- name: Assert the ACS instance is well created + ansible.builtin.assert: + that: + - output.changed + - output.state.provisioning_state == 'Succeeded' - - name: Scale the ACS instance from 1 to 2 - Swarm - azure_rm_acs: - name: "acssw{{ resource_group | hash('md5') | truncate(7, True, '') }}" - resource_group: "{{ resource_group }}" - location: eastus - orchestration_platform: Swarm - master_profile: - - count: 1 - dns_prefix: "acssw{{ resource_group | hash('md5') | truncate(10, True, '') }}" - vm_size: Standard_A0 - linux_profile: - - admin_username: azureuser - ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+io238wdhjkasndq238e2/983289dasjnasey823/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+928dfsjsejk298r/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+dsajda82e78sdja/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt juliens@msft.com - agent_pool_profiles: - - name: default - count: 2 - dns_prefix: "acssw{{ resource_group | hash('md5') | truncate(12, True, '') }}" - vm_size: Standard_A0 - diagnostics_profile: false - register: output +- name: Scale the ACS instance from 1 to 2 - Swarm + azure_rm_acs: + name: "acssw{{ resource_group | hash('md5') | truncate(7, True, '') }}" + resource_group: "{{ resource_group }}" + location: eastus + orchestration_platform: Swarm + master_profile: + - count: 1 + dns_prefix: "acssw{{ resource_group | hash('md5') | truncate(10, True, '') }}" + vm_size: Standard_A0 + linux_profile: + - admin_username: azureuser + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+io238wdhjkasndq238e2/983289dasjnasey823/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+928dfsjsejk298r/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+dsajda82e78sdja/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt juliens@msft.com + agent_pool_profiles: + - name: default + count: 2 + dns_prefix: "acssw{{ resource_group | hash('md5') | truncate(12, True, '') }}" + vm_size: Standard_A0 + diagnostics_profile: false + register: output - - name: Assert the ACS instance is well scaled - assert: - that: - - output.changed - - output.state.agent_pool_profiles[0].count == 2 +- name: Assert the ACS instance is well scaled + ansible.builtin.assert: + that: + - output.changed + - output.state.agent_pool_profiles[0].count == 2 - - name: Delete the ACS instance - Swarm - azure_rm_acs: - name: "acssw{{ resource_group | hash('md5') | truncate(7, True, '') }}" - resource_group: "{{ resource_group }}" - location: eastus - orchestration_platform: Swarm - state: absent - master_profile: - - count: 1 - dns_prefix: "acssw{{ resource_group | hash('md5') | truncate(10, True, '') }}" - vm_size: Standard_A0 - linux_profile: - - admin_username: azureuser - ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+io238wdhjkasndq238e2/983289dasjnasey823/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+928dfsjsejk298r/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+dsajda82e78sdja/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt juliens@msft.com - agent_pool_profiles: - - name: default - count: 2 - dns_prefix: "acssw{{ resource_group | hash('md5') | truncate(12, True, '') }}" - vm_size: Standard_A0 - diagnostics_profile: false
\ No newline at end of file +- name: Delete the ACS instance - Swarm + azure_rm_acs: + name: "acssw{{ resource_group | hash('md5') | truncate(7, True, '') }}" + resource_group: "{{ resource_group }}" + location: eastus + orchestration_platform: Swarm + state: absent + master_profile: + - count: 1 + dns_prefix: "acssw{{ resource_group | hash('md5') | truncate(10, True, '') }}" + vm_size: Standard_A0 + linux_profile: + - admin_username: azureuser + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+io238wdhjkasndq238e2/983289dasjnasey823/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+928dfsjsejk298r/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+dsajda82e78sdja/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt juliens@msft.com + agent_pool_profiles: + - name: default + count: 2 + dns_prefix: "acssw{{ resource_group | hash('md5') | truncate(12, True, '') }}" + vm_size: Standard_A0 + diagnostics_profile: false diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_adapplication/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_adapplication/tasks/main.yml index c8dfcb2b7..99813a48d 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_adapplication/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_adapplication/tasks/main.yml @@ -1,7 +1,8 @@ -- set_fact: +- name: Set variables + ansible.builtin.set_fact: tenant_id: "{{ azure_tenant }}" display_name: "app{{ resource_group | hash('sha1') | truncate(20, True, '') }}" - run_once: yes + run_once: true - name: Create application azure_rm_adapplication: @@ -9,23 +10,25 @@ display_name: "{{ display_name }}" register: create_output -- assert: +- name: Assert create successfully + ansible.builtin.assert: that: create_output.changed -- name: Create application again (idempotent test) +- name: Create application again idempotent test azure_rm_adapplication: tenant: "{{ tenant_id }}" app_id: "{{ create_output.app_id }}" register: output -- assert: +- name: Assert the idempotent success + ansible.builtin.assert: that: not output.changed - name: Create application with more parameter azure_rm_adapplication: tenant: "{{ tenant_id }}" display_name: "{{ display_name }}-01" - available_to_other_tenants: False + available_to_other_tenants: false credential_description: "for test" end_date: 2021-10-01 start_date: 2021-05-18 @@ -36,56 +39,61 @@ - User description: "for app role test" display_name: "{{ display_name }}_approle" - is_enabled: True + is_enabled: true value: Password@0329 register: second_output -- assert: +- name: Assert secondary resource create success + ansible.builtin.assert: that: second_output.changed -- name: get ad app info ---- by object ID +- name: Get ad app info by object id azure_rm_adapplication_info: object_id: "{{ create_output.object_id }}" tenant: "{{ tenant_id }}" register: output -- name: get ad app info ---- by app ID +- name: Get ad app info by app id azure_rm_adapplication_info: app_id: "{{ create_output.app_id }}" tenant: "{{ tenant_id }}" register: output -- assert: +- name: Assert the application facts + ansible.builtin.assert: that: - output.applications[0].app_display_name == "{{ display_name }}" - output.applications | length == 1 -- name: delete ad app by app id +- name: Delete ad app by app id azure_rm_adapplication: app_id: "{{ create_output.app_id }}" tenant: "{{ tenant_id }}" state: absent register: output -- assert: +- name: Assert the application delete success + ansible.builtin.assert: that: output.changed -- name: delete ad app by app id +- name: Delete ad app by app id azure_rm_adapplication: app_id: "{{ second_output.app_id }}" tenant: "{{ tenant_id }}" state: absent register: output -- assert: +- name: Assert the secondary application delete success + ansible.builtin.assert: that: output.changed -- name: get ad app info ---- by app id +- name: Get ad app info by app id azure_rm_adapplication_info: app_id: "{{ create_output.app_id }}" tenant: "{{ tenant_id }}" register: output -- assert: +- name: Assert there is no application + ansible.builtin.assert: that: - output.applications | length == 0 diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_adgroup/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_adgroup/tasks/main.yml index 09b3f686e..b10580e65 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_adgroup/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_adgroup/tasks/main.yml @@ -1,16 +1,17 @@ -- set_fact: +- name: Set variables + ansible.builtin.set_fact: tenant_id: "{{ azure_tenant }}" resource_prefix: "{{ 999999999999999999994 | random | to_uuid }}" - run_once: yes + run_once: true - name: Try to return non-existent group using display name azure_rm_adgroup_info: attribute_name: "displayName" attribute_value: "{{ resource_prefix }}-Group-Root" tenant: "{{ tenant_id }}" - register: get_nonexistent_group_display_name_ShouldFail + register: get_nonexistent_group_display_name_shouldfail failed_when: - - get_nonexistent_group_display_name_ShouldFail.ad_groups != [] + - get_nonexistent_group_display_name_shouldfail.ad_groups != [] - name: Create Group Root azure_rm_adgroup: @@ -18,7 +19,7 @@ display_name: "{{ resource_prefix }}-Group-Root" mail_nickname: "{{ resource_prefix }}-Group-Root" state: 'present' - register: group_create_changed_ShouldPass + register: group_create_changed_shouldpass - name: Create Group Should Return Not Changed azure_rm_adgroup: @@ -26,29 +27,29 @@ display_name: "{{ resource_prefix }}-Group-Root" mail_nickname: "{{ resource_prefix }}-Group-Root" state: 'present' - register: group_create_unchanged_ShouldPass + register: group_create_unchanged_shouldpass - name: Assert Otherwise Changed Returns are Equal - assert: + ansible.builtin.assert: that: - - group_create_changed_ShouldPass.changed == True - - group_create_unchanged_ShouldPass.changed == False - - group_create_changed_ShouldPass.display_name == group_create_unchanged_ShouldPass.display_name - - group_create_changed_ShouldPass.mail_enabled == group_create_unchanged_ShouldPass.mail_enabled - - group_create_changed_ShouldPass.mail_nickname == group_create_unchanged_ShouldPass.mail_nickname - - group_create_changed_ShouldPass.object_id == group_create_unchanged_ShouldPass.object_id - - group_create_changed_ShouldPass.security_enabled == group_create_unchanged_ShouldPass.security_enabled + - group_create_changed_shouldpass.changed == True + - group_create_unchanged_shouldpass.changed == False + - group_create_changed_shouldpass.display_name == group_create_unchanged_shouldpass.display_name + - group_create_changed_shouldpass.mail_enabled == group_create_unchanged_shouldpass.mail_enabled + - group_create_changed_shouldpass.mail_nickname == group_create_unchanged_shouldpass.mail_nickname + - group_create_changed_shouldpass.object_id == group_create_unchanged_shouldpass.object_id + - group_create_changed_shouldpass.security_enabled == group_create_unchanged_shouldpass.security_enabled - name: Return previously created group using object_id azure_rm_adgroup_info: - object_id: "{{ group_create_unchanged_ShouldPass.object_id }}" + object_id: "{{ group_create_unchanged_shouldpass.object_id }}" tenant: "{{ tenant_id }}" - register: get_created_object_id_ShouldPass + register: get_created_object_id_shouldpass - name: Assert Returns are Equal to Created Group - assert: + ansible.builtin.assert: that: - - get_created_object_id_ShouldPass.ad_groups[0].object_id == group_create_unchanged_ShouldPass.object_id + - get_created_object_id_shouldpass.ad_groups[0].object_id == group_create_unchanged_shouldpass.object_id - name: Create Group Member 1 azure_rm_adgroup: @@ -56,7 +57,7 @@ display_name: "{{ resource_prefix }}-Group-Member-1" mail_nickname: "{{ resource_prefix }}-Group-Member-1" state: 'present' - register: create_group_member_1_ShouldPass + register: create_pass_first - name: Create Group Member 2 azure_rm_adgroup: @@ -64,7 +65,7 @@ display_name: "{{ resource_prefix }}-Group-Member-2" mail_nickname: "{{ resource_prefix }}-Group-Member-2" state: 'present' - register: create_group_member_2_ShouldPass + register: create_pass_second - name: Ensure member is in group using display_name and mail_nickname azure_rm_adgroup: @@ -73,44 +74,44 @@ mail_nickname: "{{ resource_prefix }}-Group-Root" state: 'present' present_members: - - "https://graph.windows.net/{{ tenant_id }}/directoryObjects/{{ create_group_member_1_ShouldPass.object_id }}" - - "https://graph.windows.net/{{ tenant_id }}/directoryObjects/{{ create_group_member_2_ShouldPass.object_id }}" - register: add_members_to_group_ShouldPass + - "https://graph.windows.net/{{ tenant_id }}/directoryObjects/{{ create_pass_first.object_id }}" + - "https://graph.windows.net/{{ tenant_id }}/directoryObjects/{{ create_pass_second.object_id }}" + register: add_pass - name: Validate members are in the group - assert: + ansible.builtin.assert: that: - - add_members_to_group_ShouldPass.group_members[0].object_id == create_group_member_1_ShouldPass.object_id or add_members_to_group_ShouldPass.group_members[1].object_id == create_group_member_1_ShouldPass.object_id - - add_members_to_group_ShouldPass.group_members[1].object_id == create_group_member_2_ShouldPass.object_id or add_members_to_group_ShouldPass.group_members[0].object_id == create_group_member_2_ShouldPass.object_id + - add_pass.group_members[0].object_id == create_pass_first.object_id or add_pass.group_members[1].object_id == create_pass_first.object_id + - add_pass.group_members[1].object_id == create_pass_second.object_id or add_pass.group_members[0].object_id == create_pass_second.object_id - name: Ensure member is in group that is already present using object_id azure_rm_adgroup: tenant: "{{ tenant_id }}" - object_id: "{{ group_create_changed_ShouldPass.object_id }}" + object_id: "{{ group_create_changed_shouldpass.object_id }}" state: 'present' present_members: - - "https://graph.windows.net/{{ tenant_id }}/directoryObjects/{{ create_group_member_1_ShouldPass.object_id }}" - register: add_already_present_member_to_group_ShouldPass + - "https://graph.windows.net/{{ tenant_id }}/directoryObjects/{{ create_pass_first.object_id }}" + register: add_already_present_member_to_group_shouldpass - name: Validate nothing changed from already present member - assert: + ansible.builtin.assert: that: - - add_already_present_member_to_group_ShouldPass.changed == false + - add_already_present_member_to_group_shouldpass.changed == false - name: Ensure member is not in group using object_id azure_rm_adgroup: tenant: "{{ tenant_id }}" - object_id: "{{ group_create_changed_ShouldPass.object_id }}" + object_id: "{{ group_create_changed_shouldpass.object_id }}" state: 'present' absent_members: - - "{{ create_group_member_2_ShouldPass.object_id }}" - register: remove_member_from_group_ShouldPass + - "{{ create_pass_second.object_id }}" + register: remove_member_from_group_shouldpass - name: Validate Group Member 1 is in the group and Group Member 2 is not - assert: + ansible.builtin.assert: that: - - remove_member_from_group_ShouldPass.group_members[0].object_id == create_group_member_1_ShouldPass.object_id - - remove_member_from_group_ShouldPass.group_members | length == 1 + - remove_member_from_group_shouldpass.group_members[0].object_id == create_pass_first.object_id + - remove_member_from_group_shouldpass.group_members | length == 1 - name: Ensure member is not in group that is already not in group using display_name and mail_nickname azure_rm_adgroup: @@ -119,121 +120,121 @@ mail_nickname: "{{ resource_prefix }}-Group-Root" state: 'present' absent_members: - - "{{ create_group_member_2_ShouldPass.object_id }}" - register: remove_already_absent_member_from_group_ShouldPass + - "{{ create_pass_second.object_id }}" + register: remove_already_absent_member_from_group_shouldpass - name: Validate nothing changed from already absent member - assert: + ansible.builtin.assert: that: - - remove_already_absent_member_from_group_ShouldPass.changed == false + - remove_already_absent_member_from_group_shouldpass.changed == false - name: Return a specific group using object_id azure_rm_adgroup_info: - object_id: "{{ group_create_changed_ShouldPass.object_id }}" + object_id: "{{ group_create_changed_shouldpass.object_id }}" tenant: "{{ tenant_id }}" - register: object_id_ShouldPass + register: object_id_shouldpass - name: Return a specific group using object_id and return_owners azure_rm_adgroup_info: - object_id: "{{ group_create_changed_ShouldPass.object_id }}" - return_owners: True + object_id: "{{ group_create_changed_shouldpass.object_id }}" + return_owners: true tenant: "{{ tenant_id }}" - register: object_id_return_owners_ShouldPass + register: object_id_return_owners_shouldpass - name: Return a specific group using object_id and return_owners and return_group_members azure_rm_adgroup_info: - object_id: "{{ group_create_changed_ShouldPass.object_id }}" - return_owners: True - return_group_members: True + object_id: "{{ group_create_changed_shouldpass.object_id }}" + return_owners: true + return_group_members: true tenant: "{{ tenant_id }}" - register: object_id_return_owners_and_group_members_ShouldPass + register: object_id_return_owners_and_group_members_shouldpass - name: Return a specific group using object_id and member_groups azure_rm_adgroup_info: - object_id: "{{ group_create_changed_ShouldPass.object_id }}" - return_member_groups: True + object_id: "{{ group_create_changed_shouldpass.object_id }}" + return_member_groups: true tenant: "{{ tenant_id }}" - register: object_id_return_member_groups_ShouldPass + register: object_id_return_member_groups_shouldpass - name: Return a specific group using object_id and check_membership azure_rm_adgroup_info: - object_id: "{{ group_create_changed_ShouldPass.object_id }}" - check_membership: "{{ create_group_member_1_ShouldPass.object_id }}" + object_id: "{{ group_create_changed_shouldpass.object_id }}" + check_membership: "{{ create_pass_first.object_id }}" tenant: "{{ tenant_id }}" - register: object_id_return_check_membership_ShouldPass + register: object_id_return_check_membership_shouldpass - name: Return a specific group using displayName attribute azure_rm_adgroup_info: attribute_name: "displayName" - attribute_value: "{{ group_create_changed_ShouldPass.display_name }}" + attribute_value: "{{ group_create_changed_shouldpass.display_name }}" tenant: "{{ tenant_id }}" - register: displayName_attribute_ShouldPass + register: displayname_attribute_shouldpass - name: Return a specific group using mailNickname filter azure_rm_adgroup_info: - odata_filter: "mailNickname eq '{{ group_create_changed_ShouldPass.mail_nickname }}'" + odata_filter: "mailNickname eq '{{ group_create_changed_shouldpass.mail_nickname }}'" tenant: "{{ tenant_id }}" - register: mailNickname_filter_ShouldPass + register: mailnickname_filter_shouldpass - name: Return a different group using displayName attribute azure_rm_adgroup_info: attribute_name: "displayName" - attribute_value: "{{ create_group_member_2_ShouldPass.display_name }}" + attribute_value: "{{ create_pass_second.display_name }}" tenant: "{{ tenant_id }}" - register: displayName_attribute_different_ShouldPass + register: displayname_attribute_different_shouldpass - name: Assert All Returns Are Equal - assert: + ansible.builtin.assert: that: - - object_id_ShouldPass == displayName_attribute_ShouldPass - - object_id_ShouldPass == mailNickname_filter_ShouldPass + - object_id_shouldpass == displayname_attribute_shouldpass + - object_id_shouldpass == mailnickname_filter_shouldpass - name: Assert Returns Are Not Equal - assert: + ansible.builtin.assert: that: - - object_id_ShouldPass != displayName_attribute_different_ShouldPass + - object_id_shouldpass != displayname_attribute_different_shouldpass - name: Delete group Group Root on object_id azure_rm_adgroup: tenant: "{{ tenant_id }}" - object_id: "{{ group_create_unchanged_ShouldPass.object_id }}" + object_id: "{{ group_create_unchanged_shouldpass.object_id }}" state: 'absent' - register: group_delete_group_root_ShouldPass + register: group_delete_group_root_shouldpass - name: Try to return now deleted group Group Root using object_id azure_rm_adgroup_info: - object_id: "{{ group_create_unchanged_ShouldPass.object_id }}" + object_id: "{{ group_create_unchanged_shouldpass.object_id }}" tenant: "{{ tenant_id }}" - register: get_deleted_object_group_root_ShouldFail + register: get_deleted_object_group_root_shouldfail failed_when: - - '"failed to get ad group info Resource" not in get_deleted_object_group_root_ShouldFail.msg' + - '"failed to get ad group info Resource" not in get_deleted_object_group_root_shouldfail.msg' - name: Delete group Group Member 1 on object_id azure_rm_adgroup: tenant: "{{ tenant_id }}" - object_id: "{{ create_group_member_1_ShouldPass.object_id }}" + object_id: "{{ create_pass_first.object_id }}" state: 'absent' - register: group_delete_group_member_1_ShouldPass + register: group_delete_group_member_1_shouldpass - name: Try to return now deleted group Group Member 1 using object_id azure_rm_adgroup_info: - object_id: "{{ create_group_member_1_ShouldPass.object_id }}" + object_id: "{{ create_pass_first.object_id }}" tenant: "{{ tenant_id }}" - register: get_deleted_object_group_member_1_ShouldFail + register: get_deleted_object_group_member_1_shouldfail failed_when: - - '"failed to get ad group info Resource" not in get_deleted_object_group_member_1_ShouldFail.msg' + - '"failed to get ad group info Resource" not in get_deleted_object_group_member_1_shouldfail.msg' - name: Delete group Group Member 2 on object_id azure_rm_adgroup: tenant: "{{ tenant_id }}" - object_id: "{{ create_group_member_2_ShouldPass.object_id }}" + object_id: "{{ create_pass_second.object_id }}" state: 'absent' - register: group_delete_group_member_2_ShouldPass + register: group_delete_group_member_2_shouldpass - name: Try to return now deleted group Group Member 2 using object_id azure_rm_adgroup_info: - object_id: "{{ create_group_member_2_ShouldPass.object_id }}" + object_id: "{{ create_pass_second.object_id }}" tenant: "{{ tenant_id }}" - register: get_deleted_object_group_member_2_ShouldFail + register: get_deleted_object_group_member_2_shouldfail failed_when: - - '"failed to get ad group info Resource" not in get_deleted_object_group_member_2_ShouldFail.msg' + - '"failed to get ad group info Resource" not in get_deleted_object_group_member_2_shouldfail.msg' diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_adpassword/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_adpassword/tasks/main.yml index 7c3782f17..f430af17f 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_adpassword/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_adpassword/tasks/main.yml @@ -1,9 +1,10 @@ -- set_fact: +- name: Set variables + ansible.builtin.set_fact: app_id: "e0a62513-1d81-480e-a6dc-5c99cdd58d9a" tenant_id: "72f988bf-86f1-41af-91ab-2d7cd011db47" app_object_id: "b52e8275-a1ee-4c4a-86ff-15992e0920ed" -- name: create first ad password by app_id +- name: Create first ad password by app_id azure_rm_adpassword: app_id: "{{ app_id }}" value: "Password@032900001" @@ -11,11 +12,12 @@ state: present register: ad_fact -- assert: +- name: Assert the password created + ansible.builtin.assert: that: - - ad_fact.changed + - ad_fact.changed -- name: create second ad password by app_object_id +- name: Create second ad password by app_object_id azure_rm_adpassword: value: "Password@032900002" tenant: "{{ tenant_id }}" @@ -23,11 +25,12 @@ state: present register: ad_fact02 -- assert: +- name: Assert the secondary password created + ansible.builtin.assert: that: - - ad_fact02.changed + - ad_fact02.changed -- name: create ad service principal +- name: Create ad service principal azure_rm_adserviceprincipal: app_id: "{{ app_id }}" tenant: "{{ tenant_id }}" @@ -38,10 +41,11 @@ tenant: "{{ tenant_id }}" app_id: "{{ app_id }}" register: sp_info -- debug: +- name: Print Service principals facts + ansible.builtin.debug: var: sp_info -- name: create third ad password by service_principal_object_id +- name: Create third ad password by service_principal_object_id azure_rm_adpassword: value: "Password@032900003" tenant: "{{ tenant_id }}" @@ -49,11 +53,12 @@ state: present register: ad_fact03 -- assert: +- name: Assert the third add password created + ansible.builtin.assert: that: - - ad_fact03.changed + - ad_fact03.changed -- name: can't update ad password +- name: Can't update ad password azure_rm_adpassword: app_id: "{{ app_id }}" value: "Password@032900003" @@ -62,7 +67,7 @@ app_object_id: "{{ app_object_id }}" state: present register: output - ignore_errors: True + ignore_errors: true - name: Get ad password info azure_rm_adpassword_info: @@ -72,12 +77,13 @@ app_object_id: "{{ app_object_id }}" register: ad_info -- assert: +- name: Assert the ad password facts + ansible.builtin.assert: that: - - ad_info.passwords[0].start_date == ad_fact.start_date - - ad_info.passwords[0].end_date == ad_fact.end_date + - ad_info.passwords[0].start_date == ad_fact.start_date + - ad_info.passwords[0].end_date == ad_fact.end_date -- name: delete one ad password +- name: Delete one ad password azure_rm_adpassword: app_id: "{{ app_id }}" key_id: "{{ ad_fact.key_id }}" @@ -86,11 +92,12 @@ state: absent register: output -- assert: +- name: Assert the ad password deleted + ansible.builtin.assert: that: - - output.changed + - output.changed -- name: delete all ad password +- name: Delete all ad password azure_rm_adpassword: app_id: "{{ app_id }}" tenant: "{{ tenant_id }}" @@ -98,6 +105,7 @@ state: absent register: output -- assert: +- name: Assert the ad password delete + ansible.builtin.assert: that: - - output.changed + - output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_adserviceprincipal/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_adserviceprincipal/tasks/main.yml index 4e4b50161..b138740d6 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_adserviceprincipal/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_adserviceprincipal/tasks/main.yml @@ -1,34 +1,37 @@ -- set_fact: +- name: Set variables + ansible.builtin.set_fact: app_id: "e0a62513-1d81-480e-a6dc-5c99cdd58d9a" tenant_id: "72f988bf-86f1-41af-91ab-2d7cd011db47" -- name: delete ad service principal +- name: Delete ad service principal azure_rm_adserviceprincipal: app_id: "{{ app_id }}" tenant: "{{ tenant_id }}" state: absent -- name: create ad service principal +- name: Create ad service principal azure_rm_adserviceprincipal: app_id: "{{ app_id }}" tenant: "{{ tenant_id }}" state: present register: ad_fact -- assert: +- name: Assert the ad service prinicipal created + ansible.builtin.assert: that: - - ad_fact.changed + - ad_fact.changed -- name: create ad service principal (idempontent) +- name: Create ad service principal (idempontent) azure_rm_adserviceprincipal: app_id: "{{ app_id }}" tenant: "{{ tenant_id }}" state: present register: output -- assert: +- name: Assert the ad service principal idempotent + ansible.builtin.assert: that: - - not output.changed + - not output.changed - name: Get ad service principal info by app_id azure_rm_adserviceprincipal_info: @@ -36,16 +39,17 @@ tenant: "{{ tenant_id }}" register: ad_info -- assert: +- name: Assert The ad service principals facts + ansible.builtin.assert: that: - - ad_info.service_principals[0].app_display_name == ad_fact.app_display_name - - ad_info.service_principals[0].app_role_assignment_required == False + - ad_info.service_principals[0].app_display_name == ad_fact.app_display_name + - ad_info.service_principals[0].app_role_assignment_required == False -- name: update ad service principal app_role_assignmentrequired to True +- name: Update ad service principal app_role_assignmentrequired to True azure_rm_adserviceprincipal: app_id: "{{ app_id }}" tenant: "{{ tenant_id }}" - app_role_assignment_required: True + app_role_assignment_required: true state: present register: output @@ -55,18 +59,20 @@ object_id: "{{ ad_info.service_principals[0].object_id }}" register: ad_info -- assert: +- name: Assert the ad service principals facts + ansible.builtin.assert: that: - - ad_info.service_principals[0].app_display_name == ad_fact.app_display_name - - ad_info.service_principals[0].app_role_assignment_required == True + - ad_info.service_principals[0].app_display_name == ad_fact.app_display_name + - ad_info.service_principals[0].app_role_assignment_required == True -- name: delete ad service principal +- name: Delete ad service principal azure_rm_adserviceprincipal: app_id: "{{ app_id }}" tenant: "{{ tenant_id }}" state: absent register: output -- assert: +- name: Assert the ad service principals deleted + ansible.builtin.assert: that: - - output.changed + - output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_aduser/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_aduser/tasks/main.yml index 98dfc3241..e3c9225e6 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_aduser/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_aduser/tasks/main.yml @@ -1,17 +1,17 @@ - name: Prepare facts - set_fact: + ansible.builtin.set_fact: tenant_id: "{{ azure_tenant }}" user_id: "user{{ 999999999999999999994 | random | to_uuid }}@contoso.com" object_id: "{{ 999999999999999999994 | random | to_uuid }}" user_principal_name: "{{ 999999999999999999994 | random | to_uuid }}" - run_once: yes + run_once: true - name: Create test user azure_rm_aduser: user_principal_name: "{{ user_id }}" tenant: "{{ tenant_id }}" state: "present" - account_enabled: "True" + account_enabled: true display_name: "Test_{{ user_principal_name }}_Display_Name" password_profile: "password" mail_nickname: "Test_{{ user_principal_name }}_mail_nickname" @@ -36,18 +36,18 @@ register: attempted_update_with_no_changes_should_pass - name: Assert Nothing Changed - assert: + ansible.builtin.assert: that: - attempted_update_with_no_changes_should_pass["changed"] == False -- name: user_principal_name Should Pass +- name: User_principal_name Should Pass azure_rm_aduser_info: user_principal_name: "{{ user_id }}" tenant: "{{ tenant_id }}" register: get_user_should_pass - name: Assert user was created and account is enabled - assert: + ansible.builtin.assert: that: - "create_user_should_pass['ad_users'][0]['account_enabled'] == True" - "get_user_should_pass['ad_users'][0]['account_enabled'] == True" @@ -57,17 +57,17 @@ user_principal_name: "{{ user_id }}" tenant: "{{ tenant_id }}" state: "present" - account_enabled: "False" + account_enabled: false register: update_user_should_pass -- name: user_principal_name on updated user Should Pass +- name: User_principal_name on updated user Should Pass azure_rm_aduser_info: user_principal_name: "{{ user_id }}" tenant: "{{ tenant_id }}" register: get_updated_user_should_pass - name: Assert user was updated and account is disabled - assert: + ansible.builtin.assert: that: - "update_user_should_pass['ad_users'][0]['account_enabled'] == False" - "get_updated_user_should_pass['ad_users'][0]['account_enabled'] == False" @@ -79,7 +79,7 @@ state: "absent" register: delete_user_should_pass -- name: user_principal_name Should Fail +- name: User_principal_name Should Fail azure_rm_aduser_info: user_principal_name: "{{ user_id }}" tenant: "{{ tenant_id }}" @@ -87,30 +87,30 @@ ignore_errors: true - name: Assert task failed - assert: + ansible.builtin.assert: that: - "get_user_should_fail['failed'] == True" - name: Run with bad tenant Should Fail azure_rm_aduser_info: - user_principal_name: "{{user_id}}" + user_principal_name: "{{ user_id }}" tenant: None register: missing_tenant - ignore_errors: yes + ignore_errors: true - name: Assert task failed - assert: + ansible.builtin.assert: that: - "missing_tenant['failed'] == True" - name: Missing any identifiers Should Fail azure_rm_aduser_info: tenant: "{{ tenant_id }}" - register: missing_any_identifiers - ignore_errors: yes + register: missing_any_identifiers + ignore_errors: true - name: Assert task failed - assert: + ansible.builtin.assert: that: - "missing_any_identifiers is undefined" @@ -119,11 +119,11 @@ user_principal_name: "{{ user_id }}" object_id: "{{ object_id }}" tenant: "{{ tenant_id }}" - register: too_many_identifiers - ignore_errors: yes + register: too_many_identifiers + ignore_errors: true - name: Assert task failed - assert: + ansible.builtin.assert: that: - "too_many_identifiers is undefined" @@ -131,35 +131,35 @@ azure_rm_aduser_info: attribute_name: proxyAddresses tenant: "{{ tenant_id }}" - register: missing attribute_value - ignore_errors: yes + register: missing_attribute_value + ignore_errors: true - name: Assert task failed - assert: + ansible.builtin.assert: that: - - "attribute_value is undefined" + - "missing_attribute_value is undefined" - name: Missing attribute_name Should Fail azure_rm_aduser_info: attribute_value: SMTP:user@contoso.com tenant: "{{ tenant_id }}" - register: missing attribute_name - ignore_errors: yes + register: missing_attribute_name + ignore_errors: true - name: Assert task failed - assert: + ansible.builtin.assert: that: - - "attribute_name is undefined" + - "missing_attribute_name is undefined" - name: Using all with principal name should fail azure_rm_aduser_info: - all: True + all: true user_principal_name: "{{ user_id }}" tenant: "{{ tenant_id }}" - register: using_all_with_principal_name - ignore_errors: yes + register: using_all_with_principal_name + ignore_errors: true - name: Assert task failed - assert: + ansible.builtin.assert: that: - "using_all_with_principal_name is undefined" diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_aks/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_aks/tasks/main.yml index cf3f856ec..ff60ca681 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_aks/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_aks/tasks/main.yml @@ -1,572 +1,578 @@ - - set_fact: - rpfx: "{{ resource_group | hash('md5') | truncate(8, True, '') }}" - noderpfx: "{{ resource_group | hash('md5') | truncate(4, True, '') }}" - - - include: minimal-cluster.yml - - - name: Find available k8s version - azure_rm_aksversion_info: - location: eastus - register: versions - - - name: Create an AKS instance (check mode) - azure_rm_aks: - name: "aks{{ rpfx }}" - resource_group: "{{ resource_group }}" - location: eastus - dns_prefix: "aks{{ rpfx }}" - kubernetes_version: "{{ versions.azure_aks_versions[0] }}" - service_principal: - client_id: "{{ azure_client_id }}" - client_secret: "{{ azure_secret }}" - linux_profile: - admin_username: azureuser - ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible - agent_pool_profiles: - - name: default - count: 1 - vm_size: Standard_B2s - type: VirtualMachineScaleSets - mode: System - node_labels: {"release":"stable"} - max_pods: 42 - availability_zones: - - 1 - - 2 - node_resource_group: "node{{ noderpfx }}" - enable_rbac: yes - network_profile: - load_balancer_sku: standard - check_mode: yes - - - name: Check there is no AKS created - azure_rm_aks_info: - name: "aks{{ rpfx }}" - resource_group: "{{ resource_group }}" - register: fact - - - name: Check there is no AKS created - assert: - that: - - "fact.aks | length == 0" - - - name: Create an AKS instance - azure_rm_aks: - name: "aks{{ rpfx }}" - resource_group: "{{ resource_group }}" - location: eastus - dns_prefix: "aks{{ rpfx }}" - kubernetes_version: "{{ versions.azure_aks_versions[0] }}" - service_principal: - client_id: "{{ azure_client_id }}" - client_secret: "{{ azure_secret }}" - linux_profile: - admin_username: azureuser - ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible - agent_pool_profiles: - - name: default - count: 1 - vm_size: Standard_B2s - type: VirtualMachineScaleSets - mode: System - node_labels: {"release":"stable"} - max_pods: 42 - availability_zones: - - 1 - - 2 - node_resource_group: "node{{ noderpfx }}" - enable_rbac: yes - network_profile: - load_balancer_sku: standard - register: output - - - name: Assert the AKS instance is well created - assert: - that: - - output.changed - - output.provisioning_state == 'Succeeded' - - - name: Get AKS fact - azure_rm_aks_info: - name: "aks{{ rpfx }}" - resource_group: "{{ resource_group }}" - register: fact - - - name: Assert fact returns the created one - assert: - that: - - "fact.aks | length == 1" - - fact.aks[0].id == output.id - - fact.aks[0].properties.agentPoolProfiles[0].availabilityZones == ["1", "2"] - - fact.aks[0].properties.agentPoolProfiles[0].mode == "System" - - fact.aks[0].properties.agentPoolProfiles[0].nodeLabels | length == 1 - - - name: Update an AKS instance node_labels - azure_rm_aks: - name: "aks{{ rpfx }}" - resource_group: "{{ resource_group }}" - location: eastus - dns_prefix: "aks{{ rpfx }}" - kubernetes_version: "{{ versions.azure_aks_versions[0] }}" - service_principal: - client_id: "{{ azure_client_id }}" - client_secret: "{{ azure_secret }}" - linux_profile: - admin_username: azureuser - ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible - agent_pool_profiles: - - name: default - count: 1 - vm_size: Standard_B2s - type: VirtualMachineScaleSets - mode: System - node_labels: {"release":"stable", "environment":"dev"} - max_pods: 42 - availability_zones: - - 1 - - 2 - node_resource_group: "node{{ noderpfx }}" - enable_rbac: yes - network_profile: - load_balancer_sku: standard - register: output - - - name: Assert the AKS instance is well update - assert: - that: - - output.changed - - - name: Get AKS fact - azure_rm_aks_info: - name: "aks{{ rpfx }}" - resource_group: "{{ resource_group }}" - register: fact - - - name: Assert fact returns the created one - assert: - that: - - "fact.aks | length == 1" - - fact.aks[0].id == output.id - - fact.aks[0].properties.agentPoolProfiles[0].nodeLabels | length == 2 - - - name: Get AKS upgrade versions - azure_rm_aksupgrade_info: - name: "aks{{ rpfx }}" - resource_group: "{{ resource_group }}" - register: upgrades - - - name: Assert available control-plane versions for upgrade - assert: - that: - - "upgrades.azure_aks_upgrades.control_plane_profile.kubernetes_version == versions.azure_aks_versions[0]" - - "upgrades.azure_aks_upgrades.control_plane_profile.upgrades | length > 0" - - - name: Create an AKS instance (idempotent) - azure_rm_aks: - name: "aks{{ rpfx }}" - resource_group: "{{ resource_group }}" - location: eastus - dns_prefix: "aks{{ rpfx }}" - kubernetes_version: "{{ versions.azure_aks_versions[0] }}" - service_principal: - client_id: "{{ azure_client_id }}" - linux_profile: - admin_username: azureuser - ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible - agent_pool_profiles: - - name: default - count: 1 - vm_size: Standard_B2s - type: VirtualMachineScaleSets - mode: System - max_pods: 42 - availability_zones: - - 1 - - 2 - node_resource_group: "node{{ noderpfx }}" - enable_rbac: yes - network_profile: - load_balancer_sku: standard - register: output - - - name: Assert idempotent - assert: - that: - - not output.changed - - - name: Get available version - azure_rm_aksversion_info: - location: eastus - version: "{{ versions.azure_aks_versions[0] }}" - register: version1 - - - name: Upgrade the AKS instance with addon - azure_rm_aks: - name: "aks{{ rpfx }}" - resource_group: "{{ resource_group }}" - location: eastus - dns_prefix: "aks{{ rpfx }}" - kubernetes_version: "{{ version1.azure_aks_versions[0] }}" - service_principal: - client_id: "{{ azure_client_id }}" - linux_profile: - admin_username: azureuser - ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible - agent_pool_profiles: - - name: default - count: 1 - vm_size: Standard_B2s - type: VirtualMachineScaleSets - mode: System - max_pods: 42 - availability_zones: - - 1 - - 2 - node_resource_group: "node{{ noderpfx }}" - addon: - http_application_routing: {} - network_profile: - network_plugin: kubenet - load_balancer_sku: standard - enable_rbac: yes - register: output - - - name: Assert the AKS instance is upgraded - assert: - that: - - output.changed - - output.kubernetes_version == version1.azure_aks_versions[0] - - output.addon.httpApplicationRouting.enabled == True - - output.agent_pool_profiles[0].count == 1 - - output.network_profile.network_plugin == 'kubenet' - - - name: Upgrade the AKS instance with addon (idempontent) - azure_rm_aks: - name: "aks{{ rpfx }}" - resource_group: "{{ resource_group }}" - location: eastus - dns_prefix: "aks{{ rpfx }}" - kubernetes_version: "{{ version1.azure_aks_versions[0] }}" - service_principal: - client_id: "{{ azure_client_id }}" - linux_profile: - admin_username: azureuser - ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible - agent_pool_profiles: - - name: default - count: 1 - vm_size: Standard_B2s - type: VirtualMachineScaleSets - mode: System - max_pods: 42 - availability_zones: - - 1 - - 2 - node_resource_group: "node{{ noderpfx }}" - addon: - http_application_routing: {} - network_profile: - network_plugin: kubenet - load_balancer_sku: standard - enable_rbac: yes - register: output - - - assert: - that: - - not output.changed - - - name: Upgrade the AKS instance with agent pool profiles - azure_rm_aks: - name: "aks{{ rpfx }}" - resource_group: "{{ resource_group }}" - location: eastus - dns_prefix: "aks{{ rpfx }}" - kubernetes_version: "{{ version1.azure_aks_versions[0] }}" - service_principal: - client_id: "{{ azure_client_id }}" - client_secret: "{{ azure_secret }}" - linux_profile: - admin_username: azureuser - ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible - agent_pool_profiles: - - name: default - count: 1 - vm_size: Standard_B2s - type: VirtualMachineScaleSets - mode: System - enable_auto_scaling: True - max_count: 6 - min_count: 1 - max_pods: 42 - availability_zones: - - 1 - - 2 - node_resource_group: "node{{ noderpfx }}" - enable_rbac: yes - network_profile: - load_balancer_sku: standard - register: output - ignore_errors: yes - - - name: Assert the AKS instance is well created - assert: - that: - - output.changed - - output.provisioning_state == 'Succeeded' - ignore_errors: yes - - - name: Upgrade the AKS instance with agent pool profiles (idempontent) - azure_rm_aks: - name: "aks{{ rpfx }}" - resource_group: "{{ resource_group }}" - location: eastus - dns_prefix: "aks{{ rpfx }}" - kubernetes_version: "{{ version1.azure_aks_versions[0] }}" - service_principal: - client_id: "{{ azure_client_id }}" - client_secret: "{{ azure_secret }}" - linux_profile: - admin_username: azureuser - ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible - agent_pool_profiles: - - name: default - count: 1 - vm_size: Standard_B2s - type: VirtualMachineScaleSets - mode: System - enable_auto_scaling: True - max_count: 6 - min_count: 1 - max_pods: 42 - availability_zones: - - 1 - - 2 - node_resource_group: "node{{ noderpfx }}" - enable_rbac: yes - network_profile: - load_balancer_sku: standard - register: output - - - name: Assert the AKS instance is well created - assert: - that: - - not output.changed - - - name: Upgrade the AKS instance with multiple agent pool profiles - azure_rm_aks: - name: "aks{{ rpfx }}" - resource_group: "{{ resource_group }}" - location: eastus - dns_prefix: "aks{{ rpfx }}" - kubernetes_version: "{{ version1.azure_aks_versions[0] }}" - service_principal: - client_id: "{{ azure_client_id }}" - client_secret: "{{ azure_secret }}" - linux_profile: - admin_username: azureuser - ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible - agent_pool_profiles: - - name: default - count: 1 - vm_size: Standard_B2s - type: VirtualMachineScaleSets - mode: System - enable_auto_scaling: True - max_count: 6 - min_count: 1 - max_pods: 42 - availability_zones: - - 1 - - 2 - - name: default2 - count: 1 - vm_size: Standard_B2s - type: VirtualMachineScaleSets - mode: User - node_resource_group: "node{{ noderpfx }}" - enable_rbac: yes - network_profile: - load_balancer_sku: standard - register: output - ignore_errors: yes - - - name: Assert the AKS instance is well created - assert: - that: - - output.changed - - "output.agent_pool_profiles | length == 2" - - output.provisioning_state == 'Succeeded' - - output.agent_pool_profiles[1].mode == 'User' - ignore_errors: yes - - - name: Upgrade the AKS instance with multiple agent pool profiles (idempontent) - azure_rm_aks: - name: "aks{{ rpfx }}" - resource_group: "{{ resource_group }}" - location: eastus - dns_prefix: "aks{{ rpfx }}" - kubernetes_version: "{{ version1.azure_aks_versions[0] }}" - service_principal: - client_id: "{{ azure_client_id }}" - client_secret: "{{ azure_secret }}" - linux_profile: - admin_username: azureuser - ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible - agent_pool_profiles: - - name: default - count: 1 - vm_size: Standard_B2s - type: VirtualMachineScaleSets - enable_auto_scaling: True - max_count: 6 - min_count: 1 - max_pods: 42 - availability_zones: - - 1 - - 2 - - name: default2 - count: 1 - vm_size: Standard_B2s - type: VirtualMachineScaleSets - mode: User - node_resource_group: "node{{ noderpfx }}" - enable_rbac: yes - network_profile: - load_balancer_sku: standard - register: output - - - name: Assert the AKS instance is well created - assert: - that: - - not output.changed - - - name: Update the default2 agent_pool mode from User to System - azure_rm_aks: - name: "aks{{ rpfx }}" - resource_group: "{{ resource_group }}" - location: eastus - dns_prefix: "aks{{ rpfx }}" - kubernetes_version: "{{ version1.azure_aks_versions[0] }}" - service_principal: - client_id: "{{ azure_client_id }}" - client_secret: "{{ azure_secret }}" - linux_profile: - admin_username: azureuser - ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible - agent_pool_profiles: - - name: default - count: 1 - vm_size: Standard_B2s - type: VirtualMachineScaleSets - mode: System - enable_auto_scaling: True - max_count: 6 - min_count: 1 - max_pods: 42 - availability_zones: - - 1 - - 2 - - name: default2 - count: 1 - vm_size: Standard_B2s - type: VirtualMachineScaleSets - mode: System - node_resource_group: "node{{ noderpfx }}" - enable_rbac: yes - network_profile: - load_balancer_sku: standard - ignore_errors: yes - register: output - - - name: Assert the AKS instance is well created - assert: - that: - - output.changed - - "output.agent_pool_profiles | length == 2" - - output.provisioning_state == 'Succeeded' - - output.agent_pool_profiles[1].mode == 'System' - ignore_errors: yes - - - name: Update the default2 agent_pool mode from User to System (idempontent) - azure_rm_aks: - name: "aks{{ rpfx }}" - resource_group: "{{ resource_group }}" - location: eastus - dns_prefix: "aks{{ rpfx }}" - kubernetes_version: "{{ version1.azure_aks_versions[0] }}" - service_principal: - client_id: "{{ azure_client_id }}" - client_secret: "{{ azure_secret }}" - linux_profile: - admin_username: azureuser - ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible - agent_pool_profiles: - - name: default - count: 1 - vm_size: Standard_B2s - type: VirtualMachineScaleSets - enable_auto_scaling: True - max_count: 6 - min_count: 1 - max_pods: 42 - availability_zones: - - 1 - - 2 - - name: default2 - count: 1 - vm_size: Standard_B2s - type: VirtualMachineScaleSets - mode: System - node_resource_group: "node{{ noderpfx }}" - enable_rbac: yes - network_profile: - load_balancer_sku: standard - register: output - - - name: Get AKS fact - azure_rm_aks_info: - name: "aks{{ rpfx }}" - resource_group: "{{ resource_group }}" - show_kubeconfig: user - register: fact - - - name: Assert fact returns the created one - assert: - that: - - "fact.aks | length == 1" - - fact.aks[0].kube_config == output.kube_config - - - name: Delete the AKS instance - azure_rm_aks: - name: "aks{{ rpfx }}" - resource_group: "{{ resource_group }}" - state: absent - register: output - - - name: Assert the AKS instance is well deleted - assert: - that: - - output.changed - - - name: Delete the AKS instance (idempotent) - azure_rm_aks: - name: "aks{{ rpfx }}" - resource_group: "{{ resource_group }}" - state: absent - register: output - - - name: Assert idempotent - assert: - that: - - not output.changed - - - name: Get AKS fact - azure_rm_aks_info: - name: "aks{{ rpfx }}" - resource_group: "{{ resource_group }}" - register: fact - - - name: Assert fact returns empty - assert: - that: - - "fact.aks | length == 0" +- name: Set varialbles + ansible.builtin.set_fact: + rpfx: "{{ resource_group | hash('md5') | truncate(8, True, '') }}" + noderpfx: "{{ resource_group | hash('md5') | truncate(4, True, '') }}" + +- name: Include aks tasks + ansible.builtin.include_tasks: minimal-cluster.yml + +- name: Find available k8s version + azure_rm_aksversion_info: + location: eastus + register: versions + +- name: Create an AKS instance (check mode) + azure_rm_aks: + name: "aks{{ rpfx }}" + resource_group: "{{ resource_group }}" + location: eastus + dns_prefix: "aks{{ rpfx }}" + kubernetes_version: "{{ versions.azure_aks_versions[0] }}" + service_principal: + client_id: "{{ azure_client_id }}" + client_secret: "{{ azure_secret }}" + linux_profile: + admin_username: azureuser + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible + agent_pool_profiles: + - name: default + count: 1 + vm_size: Standard_B2s + type: VirtualMachineScaleSets + mode: System + node_labels: {"release":"stable"} + max_pods: 42 + availability_zones: + - 1 + - 2 + node_resource_group: "node{{ noderpfx }}" + enable_rbac: true + network_profile: + load_balancer_sku: standard + check_mode: true + +- name: Check there is no AKS created + azure_rm_aks_info: + name: "aks{{ rpfx }}" + resource_group: "{{ resource_group }}" + register: fact + +- name: Check there is no AKS created + ansible.builtin.assert: + that: + - "fact.aks | length == 0" + +- name: Create an AKS instance + azure_rm_aks: + name: "aks{{ rpfx }}" + resource_group: "{{ resource_group }}" + location: eastus + dns_prefix: "aks{{ rpfx }}" + kubernetes_version: "{{ versions.azure_aks_versions[0] }}" + service_principal: + client_id: "{{ azure_client_id }}" + client_secret: "{{ azure_secret }}" + linux_profile: + admin_username: azureuser + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible + agent_pool_profiles: + - name: default + count: 1 + vm_size: Standard_B2s + type: VirtualMachineScaleSets + mode: System + node_labels: {"release":"stable"} + max_pods: 42 + availability_zones: + - 1 + - 2 + node_resource_group: "node{{ noderpfx }}" + enable_rbac: true + network_profile: + load_balancer_sku: standard + register: output + +- name: Assert the AKS instance is well created + ansible.builtin.assert: + that: + - output.changed + - output.provisioning_state == 'Succeeded' + +- name: Get AKS fact + azure_rm_aks_info: + name: "aks{{ rpfx }}" + resource_group: "{{ resource_group }}" + register: fact + +- name: Assert fact returns the created one + ansible.builtin.assert: + that: + - "fact.aks | length == 1" + - fact.aks[0].id == output.id + - fact.aks[0].agent_pool_profiles[0].availability_zones == ["1", "2"] + - fact.aks[0].agent_pool_profiles[0].mode == "System" + - fact.aks[0].agent_pool_profiles[0].node_labels | length == 1 + +- name: Update an AKS instance node_labels + azure_rm_aks: + name: "aks{{ rpfx }}" + resource_group: "{{ resource_group }}" + location: eastus + dns_prefix: "aks{{ rpfx }}" + kubernetes_version: "{{ versions.azure_aks_versions[0] }}" + service_principal: + client_id: "{{ azure_client_id }}" + client_secret: "{{ azure_secret }}" + linux_profile: + admin_username: azureuser + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible + agent_pool_profiles: + - name: default + count: 1 + vm_size: Standard_B2s + type: VirtualMachineScaleSets + mode: System + node_labels: {"release":"stable", "environment":"dev"} + max_pods: 42 + availability_zones: + - 1 + - 2 + node_resource_group: "node{{ noderpfx }}" + enable_rbac: true + network_profile: + load_balancer_sku: standard + register: output + +- name: Assert the AKS instance is well update + ansible.builtin.assert: + that: + - output.changed + +- name: Get AKS fact + azure_rm_aks_info: + name: "aks{{ rpfx }}" + resource_group: "{{ resource_group }}" + register: fact + +- name: Assert fact returns the created one + ansible.builtin.assert: + that: + - "fact.aks | length == 1" + - fact.aks[0].id == output.id + - fact.aks[0].agent_pool_profiles[0].node_labels | length == 2 + +- name: Get AKS upgrade versions + azure_rm_aksupgrade_info: + name: "aks{{ rpfx }}" + resource_group: "{{ resource_group }}" + register: upgrades + +- name: Assert available control-plane versions for upgrade + ansible.builtin.assert: + that: + - "upgrades.azure_aks_upgrades.control_plane_profile.kubernetes_version == versions.azure_aks_versions[0]" + - "upgrades.azure_aks_upgrades.control_plane_profile.upgrades | length > 0" + +- name: Create an AKS instance (idempotent) + azure_rm_aks: + name: "aks{{ rpfx }}" + resource_group: "{{ resource_group }}" + location: eastus + dns_prefix: "aks{{ rpfx }}" + kubernetes_version: "{{ versions.azure_aks_versions[0] }}" + service_principal: + client_id: "{{ azure_client_id }}" + linux_profile: + admin_username: azureuser + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible + agent_pool_profiles: + - name: default + count: 1 + vm_size: Standard_B2s + type: VirtualMachineScaleSets + mode: System + max_pods: 42 + availability_zones: + - 1 + - 2 + node_resource_group: "node{{ noderpfx }}" + enable_rbac: true + network_profile: + load_balancer_sku: standard + register: output + +- name: Assert idempotent + ansible.builtin.assert: + that: + - not output.changed + +- name: Get available version + azure_rm_aksversion_info: + location: eastus + version: "{{ versions.azure_aks_versions[0] }}" + register: version1 + +- name: Upgrade the AKS instance with addon + azure_rm_aks: + name: "aks{{ rpfx }}" + resource_group: "{{ resource_group }}" + location: eastus + dns_prefix: "aks{{ rpfx }}" + kubernetes_version: "{{ version1.azure_aks_versions[0] }}" + service_principal: + client_id: "{{ azure_client_id }}" + linux_profile: + admin_username: azureuser + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible + agent_pool_profiles: + - name: default + count: 1 + vm_size: Standard_B2s + type: VirtualMachineScaleSets + mode: System + max_pods: 42 + availability_zones: + - 1 + - 2 + node_resource_group: "node{{ noderpfx }}" + addon: + http_application_routing: {} + network_profile: + network_plugin: kubenet + load_balancer_sku: standard + enable_rbac: true + register: output + +- name: Assert the AKS instance is upgraded + ansible.builtin.assert: + that: + - output.changed + - output.kubernetes_version == version1.azure_aks_versions[0] + - output.addon.httpApplicationRouting.enabled == True + - output.agent_pool_profiles[0].count == 1 + - output.network_profile.network_plugin == 'kubenet' + +- name: Upgrade the AKS instance with addon (idempontent) + azure_rm_aks: + name: "aks{{ rpfx }}" + resource_group: "{{ resource_group }}" + location: eastus + dns_prefix: "aks{{ rpfx }}" + kubernetes_version: "{{ version1.azure_aks_versions[0] }}" + service_principal: + client_id: "{{ azure_client_id }}" + linux_profile: + admin_username: azureuser + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible + agent_pool_profiles: + - name: default + count: 1 + vm_size: Standard_B2s + type: VirtualMachineScaleSets + mode: System + max_pods: 42 + availability_zones: + - 1 + - 2 + node_resource_group: "node{{ noderpfx }}" + addon: + http_application_routing: {} + network_profile: + network_plugin: kubenet + load_balancer_sku: standard + enable_rbac: true + register: output + +- name: Assert the aks idempotent + ansible.builtin.assert: + that: + - not output.changed + +- name: Upgrade the AKS instance with agent pool profiles + azure_rm_aks: + name: "aks{{ rpfx }}" + resource_group: "{{ resource_group }}" + location: eastus + dns_prefix: "aks{{ rpfx }}" + kubernetes_version: "{{ version1.azure_aks_versions[0] }}" + service_principal: + client_id: "{{ azure_client_id }}" + client_secret: "{{ azure_secret }}" + linux_profile: + admin_username: azureuser + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible + agent_pool_profiles: + - name: default + count: 1 + vm_size: Standard_B2s + type: VirtualMachineScaleSets + mode: System + enable_auto_scaling: true + max_count: 6 + min_count: 1 + max_pods: 42 + availability_zones: + - 1 + - 2 + node_resource_group: "node{{ noderpfx }}" + enable_rbac: true + network_profile: + load_balancer_sku: standard + register: output + ignore_errors: true + +- name: Assert the AKS instance is well created + ansible.builtin.assert: + that: + - output.changed + - output.provisioning_state == 'Succeeded' + ignore_errors: true + register: ignore_errors_register + +- name: Upgrade the AKS instance with agent pool profiles (idempontent) + azure_rm_aks: + name: "aks{{ rpfx }}" + resource_group: "{{ resource_group }}" + location: eastus + dns_prefix: "aks{{ rpfx }}" + kubernetes_version: "{{ version1.azure_aks_versions[0] }}" + service_principal: + client_id: "{{ azure_client_id }}" + client_secret: "{{ azure_secret }}" + linux_profile: + admin_username: azureuser + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible + agent_pool_profiles: + - name: default + count: 1 + vm_size: Standard_B2s + type: VirtualMachineScaleSets + mode: System + enable_auto_scaling: true + max_count: 6 + min_count: 1 + max_pods: 42 + availability_zones: + - 1 + - 2 + node_resource_group: "node{{ noderpfx }}" + enable_rbac: true + network_profile: + load_balancer_sku: standard + register: output + +- name: Assert the AKS instance is well created + ansible.builtin.assert: + that: + - not output.changed + +- name: Upgrade the AKS instance with multiple agent pool profiles + azure_rm_aks: + name: "aks{{ rpfx }}" + resource_group: "{{ resource_group }}" + location: eastus + dns_prefix: "aks{{ rpfx }}" + kubernetes_version: "{{ version1.azure_aks_versions[0] }}" + service_principal: + client_id: "{{ azure_client_id }}" + client_secret: "{{ azure_secret }}" + linux_profile: + admin_username: azureuser + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible + agent_pool_profiles: + - name: default + count: 1 + vm_size: Standard_B2s + type: VirtualMachineScaleSets + mode: System + enable_auto_scaling: true + max_count: 6 + min_count: 1 + max_pods: 42 + availability_zones: + - 1 + - 2 + - name: default2 + count: 1 + vm_size: Standard_B2s + type: VirtualMachineScaleSets + mode: User + node_resource_group: "node{{ noderpfx }}" + enable_rbac: true + network_profile: + load_balancer_sku: standard + register: output + ignore_errors: true + +- name: Assert the AKS instance is well created + ansible.builtin.assert: + that: + - output.changed + - "output.agent_pool_profiles | length == 2" + - output.provisioning_state == 'Succeeded' + - output.agent_pool_profiles[1].mode == 'User' + ignore_errors: true + register: ignore_errors_register + +- name: Upgrade the AKS instance with multiple agent pool profiles (idempontent) + azure_rm_aks: + name: "aks{{ rpfx }}" + resource_group: "{{ resource_group }}" + location: eastus + dns_prefix: "aks{{ rpfx }}" + kubernetes_version: "{{ version1.azure_aks_versions[0] }}" + service_principal: + client_id: "{{ azure_client_id }}" + client_secret: "{{ azure_secret }}" + linux_profile: + admin_username: azureuser + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible + agent_pool_profiles: + - name: default + count: 1 + vm_size: Standard_B2s + type: VirtualMachineScaleSets + enable_auto_scaling: true + max_count: 6 + min_count: 1 + max_pods: 42 + availability_zones: + - 1 + - 2 + - name: default2 + count: 1 + vm_size: Standard_B2s + type: VirtualMachineScaleSets + mode: User + node_resource_group: "node{{ noderpfx }}" + enable_rbac: true + network_profile: + load_balancer_sku: standard + register: output + +- name: Assert the AKS instance is well created + ansible.builtin.assert: + that: + - not output.changed + +- name: Update the default2 agent_pool mode from User to System + azure_rm_aks: + name: "aks{{ rpfx }}" + resource_group: "{{ resource_group }}" + location: eastus + dns_prefix: "aks{{ rpfx }}" + kubernetes_version: "{{ version1.azure_aks_versions[0] }}" + service_principal: + client_id: "{{ azure_client_id }}" + client_secret: "{{ azure_secret }}" + linux_profile: + admin_username: azureuser + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible + agent_pool_profiles: + - name: default + count: 1 + vm_size: Standard_B2s + type: VirtualMachineScaleSets + mode: System + enable_auto_scaling: true + max_count: 6 + min_count: 1 + max_pods: 42 + availability_zones: + - 1 + - 2 + - name: default2 + count: 1 + vm_size: Standard_B2s + type: VirtualMachineScaleSets + mode: System + node_resource_group: "node{{ noderpfx }}" + enable_rbac: true + network_profile: + load_balancer_sku: standard + ignore_errors: true + register: output + +- name: Assert the AKS instance is well created + ansible.builtin.assert: + that: + - output.changed + - "output.agent_pool_profiles | length == 2" + - output.provisioning_state == 'Succeeded' + - output.agent_pool_profiles[1].mode == 'System' + ignore_errors: true + register: ignore_errors_register + +- name: Update the default2 agent_pool mode from User to System (idempontent) + azure_rm_aks: + name: "aks{{ rpfx }}" + resource_group: "{{ resource_group }}" + location: eastus + dns_prefix: "aks{{ rpfx }}" + kubernetes_version: "{{ version1.azure_aks_versions[0] }}" + service_principal: + client_id: "{{ azure_client_id }}" + client_secret: "{{ azure_secret }}" + linux_profile: + admin_username: azureuser + ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible + agent_pool_profiles: + - name: default + count: 1 + vm_size: Standard_B2s + type: VirtualMachineScaleSets + enable_auto_scaling: true + max_count: 6 + min_count: 1 + max_pods: 42 + availability_zones: + - 1 + - 2 + - name: default2 + count: 1 + vm_size: Standard_B2s + type: VirtualMachineScaleSets + mode: System + node_resource_group: "node{{ noderpfx }}" + enable_rbac: true + network_profile: + load_balancer_sku: standard + register: output + +- name: Get AKS fact + azure_rm_aks_info: + name: "aks{{ rpfx }}" + resource_group: "{{ resource_group }}" + show_kubeconfig: user + register: fact + +- name: Assert fact returns the created one + ansible.builtin.assert: + that: + - "fact.aks | length == 1" + - fact.aks[0].kube_config == output.kube_config + +- name: Delete the AKS instance + azure_rm_aks: + name: "aks{{ rpfx }}" + resource_group: "{{ resource_group }}" + state: absent + register: output + +- name: Assert the AKS instance is well deleted + ansible.builtin.assert: + that: + - output.changed + +- name: Delete the AKS instance (idempotent) + azure_rm_aks: + name: "aks{{ rpfx }}" + resource_group: "{{ resource_group }}" + state: absent + register: output + +- name: Assert idempotent + ansible.builtin.assert: + that: + - not output.changed + +- name: Get AKS fact + azure_rm_aks_info: + name: "aks{{ rpfx }}" + resource_group: "{{ resource_group }}" + register: fact + +- name: Assert fact returns empty + ansible.builtin.assert: + that: + - "fact.aks | length == 0" diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_aks/tasks/minimal-cluster.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_aks/tasks/minimal-cluster.yml index bda3c06ec..79362b384 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_aks/tasks/minimal-cluster.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_aks/tasks/minimal-cluster.yml @@ -1,4 +1,5 @@ -- set_fact: +- name: Set varialbles + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(8, True, '') }}" - name: Find available k8s version @@ -26,30 +27,30 @@ - "192.0.2.0" - "198.51.100.0" - "203.0.113.0" - enable_private_cluster: no + enable_private_cluster: false network_profile: load_balancer_sku: standard outbound_type: loadBalancer register: output - name: Assert the AKS instance is well created - assert: + ansible.builtin.assert: that: - output.changed - output.provisioning_state == 'Succeeded' - name: Get AKS fact azure_rm_aks_info: - name: "minimal{{ rpfx }}" - resource_group: "{{ resource_group }}" + name: "minimal{{ rpfx }}" + resource_group: "{{ resource_group }}" register: fact - name: Assert fact returns the created one - assert: + ansible.builtin.assert: that: - "fact.aks | length == 1" - fact.aks[0].id == output.id - - fact.aks[0].properties.aadProfile.managed == true + - fact.aks[0].aad_profile.managed == true - name: Use minimal parameters and system-assigned identity (idempotent) azure_rm_aks: @@ -71,14 +72,14 @@ - "192.0.2.0" - "198.51.100.0" - "203.0.113.0" - enable_private_cluster: no + enable_private_cluster: false network_profile: load_balancer_sku: standard outbound_type: loadBalancer register: output - name: Assert idempotent - assert: + ansible.builtin.assert: that: - not output.changed @@ -101,14 +102,14 @@ - "192.0.2.0" - "198.51.100.0" - "203.0.113.0" - enable_private_cluster: no + enable_private_cluster: false network_profile: load_balancer_sku: standard outbound_type: loadBalancer register: output - name: Assert idempotent - assert: + ansible.builtin.assert: that: - output.changed @@ -120,7 +121,7 @@ register: output - name: Assert the AKS instance is well deleted - assert: + ansible.builtin.assert: that: - output.changed @@ -131,6 +132,6 @@ register: fact - name: Assert fact returns empty - assert: + ansible.builtin.assert: that: - "fact.aks | length == 0" diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_aksagentpool/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_aksagentpool/tasks/main.yml index 1d098e7f1..26f71c211 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_aksagentpool/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_aksagentpool/tasks/main.yml @@ -1,4 +1,5 @@ -- set_fact: +- name: Set varialbes + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(8, True, '') }}" - name: Find available k8s version @@ -26,7 +27,7 @@ - "192.0.2.0" - "198.51.100.0" - "203.0.113.0" - enable_private_cluster: no + enable_private_cluster: false network_profile: load_balancer_sku: standard outbound_type: loadBalancer @@ -39,7 +40,7 @@ register: output - name: Assert the cluster with one agent pool - assert: + ansible.builtin.assert: that: - "output.aks_agent_pools | length == 1" @@ -50,7 +51,7 @@ register: agentpool_version - name: Assert the orchestrator version is not None - assert: + ansible.builtin.assert: that: - "agentpool_version.azure_orchestrator_version | length >= 1" @@ -65,7 +66,7 @@ mode: System node_labels: {"release":"stable"} max_pods: 42 - enable_auto_scaling: True + enable_auto_scaling: true min_count: 1 max_count: 10 orchestrator_version: "{{ agentpool_version.azure_orchestrator_version[0] }}" @@ -75,7 +76,7 @@ register: output - name: Assert the node agent pool created - assert: + ansible.builtin.assert: that: - output.changed @@ -90,7 +91,7 @@ mode: System node_labels: {"release":"stable"} max_pods: 42 - enable_auto_scaling: True + enable_auto_scaling: true min_count: 1 max_count: 10 orchestrator_version: "{{ agentpool_version.azure_orchestrator_version[0] }}" @@ -100,7 +101,7 @@ register: output - name: Assert the node agent pool not changed - assert: + ansible.builtin.assert: that: - not output.changed @@ -111,7 +112,7 @@ register: output - name: Assert node agent pool - assert: + ansible.builtin.assert: that: - "output.aks_agent_pools | length == 2" @@ -126,7 +127,7 @@ mode: System node_labels: {"release":"stable"} max_pods: 42 - enable_auto_scaling: True + enable_auto_scaling: true min_count: 2 max_count: 20 orchestrator_version: "{{ agentpool_version.azure_orchestrator_version[0] }}" @@ -136,7 +137,7 @@ register: output - name: Assert the node agent pool udpated - assert: + ansible.builtin.assert: that: - output.changed @@ -148,10 +149,9 @@ register: output - name: Assert node agent configuration - assert: + ansible.builtin.assert: that: - output.aks_agent_pools[0].availability_zones == [1, 2] - - output.aks_agent_pools[0].count == 1 - output.aks_agent_pools[0].min_count == 2 - output.aks_agent_pools[0].max_count == 20 - output.aks_agent_pools[0].type_properties_type == "VirtualMachineScaleSets" @@ -167,6 +167,6 @@ register: output - name: Assert the node agent pool has deleted - assert: + ansible.builtin.assert: that: - output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_apimanagement/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_apimanagement/tasks/main.yml index 72b5588c4..d7d9b5fc5 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_apimanagement/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_apimanagement/tasks/main.yml @@ -1,11 +1,11 @@ - name: Fix resource prefix - set_fact: + ansible.builtin.set_fact: api_id: "myPolicy{{ resource_group | hash('md5') | truncate(23, True, '') }}" service_name: "myService{{ resource_group | hash('md5') | truncate(22, True, '') }}" display_name: test-api path: myapipath -- name: create API management service +- name: Create API management service azure_rm_apimanagementservice: resource_group: "{{ resource_group }}" name: "{{ service_name }}" @@ -15,8 +15,9 @@ sku_capacity: 1 - name: Pause for 60 mimutes to create api mangement - pause: + ansible.builtin.pause: minutes: 60 + changed_when: true - name: Create a new API instance azure_rm_apimanagement: @@ -29,15 +30,15 @@ path: "{{ path }}" protocols: - https - register: newApi - + register: newapi + - name: Assert that output has changed - assert: + ansible.builtin.assert: that: - - newApi.changed == True - - newApi.failed == False + - newapi.changed == True + - newapi.failed == False -- name: Create a new API instance(Idempotent) +- name: Create a new API instance Idempotent azure_rm_apimanagement: resource_group: "{{ resource_group }}" service_name: "{{ service_name }}" @@ -48,15 +49,15 @@ path: "{{ path }}" protocols: - https - register: newApi_idempotent + register: newapi_idempotent - name: Assert that output has changed - assert: + ansible.builtin.assert: that: - - newApi_idempotent.changed == False - - newApi_idempotent.failed == False + - newapi_idempotent.changed == False + - newapi_idempotent.failed == False -- name: Update API's protocols +- name: Update protocols azure_rm_apimanagement: resource_group: "{{ resource_group }}" service_name: "{{ service_name }}" @@ -68,12 +69,12 @@ protocols: - https - http - register: updateApi + register: updateapi - name: Assert that output has changed - assert: + ansible.builtin.assert: that: - - updateApi.changed == True + - updateapi.changed == True - name: Create different format api azure_rm_apimanagement: @@ -85,13 +86,13 @@ display_name: "{{ display_name }}-secondary" protocols: - https - register: newOpenApi + register: newopenapi - name: Assert that output has changed - assert: + ansible.builtin.assert: that: - - newOpenApi.changed == True - - newOpenApi.failed == False + - newopenapi.changed == True + - newopenapi.failed == False - name: Get api information azure_rm_apimanagement_info: @@ -101,7 +102,7 @@ register: output - name: Assert that output has changed - assert: + ansible.builtin.assert: that: - output.api.id != None @@ -111,25 +112,25 @@ service_name: "{{ service_name }}" api_id: "{{ api_id }}" state: absent - register: deleteApi + register: deleteapi - name: Assert the changes - assert: + ansible.builtin.assert: that: - - deleteApi.changed == True + - deleteapi.changed == True -- name: Delete an api(Idempotent) +- name: Delete an api Idempotent azure_rm_apimanagement: resource_group: "{{ resource_group }}" service_name: "{{ service_name }}" api_id: "{{ api_id }}" state: absent - register: deleteApi_idempotent + register: deleteapi_idempotent - name: Assert the changes - assert: + ansible.builtin.assert: that: - - deleteApi_idempotent.changed == False + - deleteapi_idempotent.changed == False - name: Delete an api azure_rm_apimanagement: diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_apimanagementservice/meta/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_apimanagementservice/meta/main.yml index 48f5726d8..95e1952f9 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_apimanagementservice/meta/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_apimanagementservice/meta/main.yml @@ -1,2 +1,2 @@ dependencies: - - setup_azure
\ No newline at end of file + - setup_azure diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_apimanagementservice/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_apimanagementservice/tasks/main.yml index 0dab04af8..01b3d982c 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_apimanagementservice/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_apimanagementservice/tasks/main.yml @@ -1,11 +1,11 @@ - name: Fix resource prefix - set_fact: - name: "myPolicy{{ resource_group | hash('md5') | truncate(22, True, '') }}" + ansible.builtin.set_fact: + name_rpfx: "myPolicy{{ resource_group | hash('md5') | truncate(22, True, '') }}" -- name: To create API Management service +- name: To create api management service azure_rm_apimanagementservice: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" publisher_email: user@example.com publisher_name: Username sku_name: Developer @@ -13,15 +13,15 @@ register: output - name: Assert that output has changed - assert: + ansible.builtin.assert: that: - output.changed == True - output.failed == False -- name: Recreate API Management service( Idempotent test) +- name: Recreate api management service idempotent test azure_rm_apimanagementservice: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" publisher_email: user@example.com publisher_name: Username sku_name: Developer @@ -29,7 +29,7 @@ register: output - name: Assert that output has changed - assert: + ansible.builtin.assert: that: - output.changed == False - output.failed == False @@ -37,22 +37,22 @@ - name: Get api management service information azure_rm_apimanagementservice_info: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" register: output - name: Assert that output has changed - assert: + ansible.builtin.assert: that: - - output.api_management_service.name == "{{ name }}" + - output.api_management_service.name == "{{ name_rpfx }}" - name: To delete an api management service azure_rm_apimanagementservice: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" state: absent register: output - name: Assert the changes - assert: + ansible.builtin.assert: that: - output.changed == True diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_appgateway/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_appgateway/tasks/main.yml index 1367300c7..b5584d2f5 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_appgateway/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_appgateway/tasks/main.yml @@ -1,20 +1,20 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" cert1_file: "cert1.txt" cert2_file: "cert2.txt" cert3b64_file: "cert3b64.txt" - run_once: yes + run_once: true - name: Set json query to only retrieve gateways from this test - set_fact: + ansible.builtin.set_fact: query: "[?ends_with(name, `{{ rpfx }}`)]" - run_once: yes + run_once: true - name: Load app gateways azure_rm_appgateway_info: register: appgw_output - name: Assert there are no gateways - assert: + ansible.builtin.assert: that: - appgw_output.gateways | community.general.json_query(query) | length == 0 @@ -23,11 +23,11 @@ name: vnet{{ rpfx }} resource_group: "{{ resource_group }}" address_prefixes_cidr: - - 10.1.0.0/16 - - 172.100.0.0/16 + - 10.1.0.0/16 + - 172.100.0.0/16 dns_servers: - - 127.0.0.1 - - 127.0.0.2 + - 127.0.0.1 + - 127.0.0.2 register: vnet_output - name: Create a subnet azure_rm_subnet: @@ -73,13 +73,13 @@ - ip_address: 10.0.0.4 name: test_backend_address_pool probes: - - name: custom_probe - protocol: http - host: 10.0.0.4 - path: /healthz - interval: 30 - timeout: 30 - unhealthy_threshold: 3 + - name: custom_probe + protocol: http + host: 10.0.0.4 + path: /healthz + interval: 30 + timeout: 30 + unhealthy_threshold: 3 backend_http_settings_collection: - port: 80 protocol: http @@ -97,29 +97,29 @@ protocol: http name: http_listener request_routing_rules: - - rule_type: Basic + - rule_type: basic backend_address_pool: test_backend_address_pool backend_http_settings: sample_appgateway_http_settings http_listener: sample_http_listener name: rule1 - - rule_type: Basic + - rule_type: basic http_listener: http_listener redirect_configuration: redirect_site_to_https name: http_redirect_rule redirect_configurations: - - redirect_type: permanent - target_listener: sample_http_listener - include_path: true - include_query_string: true - name: redirect_site_to_https + - redirect_type: permanent + target_listener: sample_http_listener + include_path: true + include_query_string: true + name: redirect_site_to_https register: output - check_mode: yes + check_mode: true - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed -- name: Create instance of Application Gateway +- name: Create instance of application gateway azure_rm_appgateway: resource_group: "{{ resource_group }}" name: "appgateway{{ rpfx }}" @@ -155,13 +155,13 @@ - ip_address: 10.0.0.4 name: test_backend_address_pool probes: - - name: custom_probe - protocol: http - host: 10.0.0.4 - path: /healthz - interval: 30 - timeout: 30 - unhealthy_threshold: 3 + - name: custom_probe + protocol: http + host: 10.0.0.4 + path: /healthz + interval: 30 + timeout: 30 + unhealthy_threshold: 3 backend_http_settings_collection: - port: 80 protocol: http @@ -179,24 +179,24 @@ protocol: http name: http_listener request_routing_rules: - - rule_type: Basic + - rule_type: basic backend_address_pool: test_backend_address_pool backend_http_settings: sample_appgateway_http_settings http_listener: sample_http_listener name: rule1 - - rule_type: Basic + - rule_type: basic http_listener: http_listener redirect_configuration: redirect_site_to_https name: http_redirect_rule redirect_configurations: - - redirect_type: permanent - target_listener: sample_http_listener - include_path: true - include_query_string: true - name: redirect_site_to_https + - redirect_type: permanent + target_listener: sample_http_listener + include_path: true + include_query_string: true + name: redirect_site_to_https register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -206,7 +206,7 @@ resource_group: "{{ resource_group }}" register: output - name: Assert properties - assert: + ansible.builtin.assert: that: - output.gateways | length == 1 - output.gateways[0].name == 'appgateway{{ rpfx }}' @@ -222,7 +222,7 @@ check_mode: true register: output - name: Assert the resource instance is stopped - assert: + ansible.builtin.assert: that: - output.changed @@ -233,7 +233,7 @@ gateway_state: stopped register: output - name: Assert the resource instance is stopped - assert: + ansible.builtin.assert: that: - output.changed - output.operational_state == 'Stopped' @@ -245,7 +245,7 @@ gateway_state: stopped register: output - name: Assert the resource instance did not change - assert: + ansible.builtin.assert: that: - not output.changed - output.operational_state == 'Stopped' @@ -258,7 +258,7 @@ check_mode: true register: output - name: Assert the resource instance is started - assert: + ansible.builtin.assert: that: - output.changed @@ -269,7 +269,7 @@ gateway_state: started register: output - name: Assert the resource instance is started - assert: + ansible.builtin.assert: that: - output.changed - output.operational_state == 'Running' @@ -281,7 +281,7 @@ gateway_state: started register: output - name: Assert the resource instance did not change - assert: + ansible.builtin.assert: that: - not output.changed - output.operational_state == 'Running' @@ -322,13 +322,13 @@ - ip_address: 10.0.0.4 name: test_backend_address_pool probes: - - name: custom_probe - protocol: http - host: 10.0.0.4 - path: /healthz - interval: 30 - timeout: 30 - unhealthy_threshold: 3 + - name: custom_probe + protocol: http + host: 10.0.0.4 + path: /healthz + interval: 30 + timeout: 30 + unhealthy_threshold: 3 backend_http_settings_collection: - port: 80 protocol: http @@ -346,24 +346,24 @@ protocol: http name: http_listener request_routing_rules: - - rule_type: Basic + - rule_type: basic backend_address_pool: test_backend_address_pool backend_http_settings: sample_appgateway_http_settings http_listener: sample_http_listener name: rule1 - - rule_type: Basic + - rule_type: basic http_listener: http_listener redirect_configuration: redirect_site_to_https name: http_redirect_rule redirect_configurations: - - redirect_type: permanent - target_listener: sample_http_listener - include_path: true - include_query_string: true - name: redirect_site_to_https + - redirect_type: permanent + target_listener: sample_http_listener + include_path: true + include_query_string: true + name: redirect_site_to_https register: output - name: Assert the resource instance is not changed - assert: + ansible.builtin.assert: that: - not output.changed @@ -403,13 +403,13 @@ - ip_address: 10.0.0.4 name: test_backend_address_pool probes: - - name: custom_probe - protocol: http - host: 10.0.0.4 - path: /healthz - interval: 30 - timeout: 30 - unhealthy_threshold: 3 + - name: custom_probe + protocol: http + host: 10.0.0.4 + path: /healthz + interval: 30 + timeout: 30 + unhealthy_threshold: 3 backend_http_settings_collection: - port: 81 protocol: http @@ -427,24 +427,24 @@ protocol: http name: http_listener request_routing_rules: - - rule_type: Basic + - rule_type: basic backend_address_pool: test_backend_address_pool backend_http_settings: sample_appgateway_http_settings http_listener: sample_http_listener name: rule1 - - rule_type: Basic + - rule_type: basic http_listener: http_listener redirect_configuration: redirect_site_to_https name: http_redirect_rule redirect_configurations: - - redirect_type: permanent - target_listener: sample_http_listener - include_path: true - include_query_string: true - name: redirect_site_to_https + - redirect_type: permanent + target_listener: sample_http_listener + include_path: true + include_query_string: true + name: redirect_site_to_https register: output - name: Assert the resource instance is updated - assert: + ansible.builtin.assert: that: - output.changed @@ -488,13 +488,13 @@ - ip_address: 10.0.0.4 name: test_backend_address_pool probes: - - name: custom_probe - protocol: http - host: 10.0.0.4 - path: /healthz - interval: 30 - timeout: 30 - unhealthy_threshold: 3 + - name: custom_probe + protocol: http + host: 10.0.0.4 + path: /healthz + interval: 30 + timeout: 30 + unhealthy_threshold: 3 backend_http_settings_collection: - port: 81 protocol: http @@ -512,24 +512,24 @@ protocol: http name: http_listener request_routing_rules: - - rule_type: Basic + - rule_type: basic backend_address_pool: test_backend_address_pool backend_http_settings: sample_appgateway_http_settings http_listener: sample_http_listener name: rule1 - - rule_type: Basic + - rule_type: basic http_listener: http_listener redirect_configuration: redirect_site_to_https name: http_redirect_rule redirect_configurations: - - redirect_type: permanent - target_listener: sample_http_listener - include_path: true - include_query_string: true - name: redirect_site_to_https + - redirect_type: permanent + target_listener: sample_http_listener + include_path: true + include_query_string: true + name: redirect_site_to_https register: output - name: Assert the resource instance is updated - assert: + ansible.builtin.assert: that: - output.changed @@ -539,7 +539,7 @@ resource_group: "{{ resource_group }}" register: output - name: Assert SSL config updated - assert: + ansible.builtin.assert: that: - output.gateways[0].ssl_policy.policy_type == 'custom' @@ -583,13 +583,13 @@ - ip_address: 10.0.0.4 name: test_backend_address_pool probes: - - name: custom_probe - protocol: http - host: 10.0.0.4 - path: /healthz - interval: 30 - timeout: 30 - unhealthy_threshold: 3 + - name: custom_probe + protocol: http + host: 10.0.0.4 + path: /healthz + interval: 30 + timeout: 30 + unhealthy_threshold: 3 backend_http_settings_collection: - port: 81 protocol: http @@ -607,24 +607,24 @@ protocol: http name: http_listener request_routing_rules: - - rule_type: Basic + - rule_type: basic backend_address_pool: test_backend_address_pool backend_http_settings: sample_appgateway_http_settings http_listener: sample_http_listener name: rule1 - - rule_type: Basic + - rule_type: basic http_listener: http_listener redirect_configuration: redirect_site_to_https name: http_redirect_rule redirect_configurations: - - redirect_type: permanent - target_listener: sample_http_listener - include_path: true - include_query_string: true - name: redirect_site_to_https + - redirect_type: permanent + target_listener: sample_http_listener + include_path: true + include_query_string: true + name: redirect_site_to_https register: output - name: Assert the resource instance is not changed - assert: + ansible.builtin.assert: that: - not output.changed @@ -666,13 +666,13 @@ - ip_address: 10.0.0.4 name: test_backend_address_pool probes: - - name: custom_probe - protocol: http - host: 10.0.0.4 - path: /healthz - interval: 30 - timeout: 30 - unhealthy_threshold: 3 + - name: custom_probe + protocol: http + host: 10.0.0.4 + path: /healthz + interval: 30 + timeout: 30 + unhealthy_threshold: 3 backend_http_settings_collection: - port: 80 protocol: http @@ -690,24 +690,24 @@ protocol: http name: http_listener request_routing_rules: - - rule_type: Basic + - rule_type: basic backend_address_pool: test_backend_address_pool backend_http_settings: sample_appgateway_http_settings http_listener: sample_http_listener name: rule1 - - rule_type: Basic + - rule_type: basic http_listener: http_listener redirect_configuration: redirect_site_to_https name: http_redirect_rule redirect_configurations: - - redirect_type: permanent - target_listener: sample_http_listener - include_path: true - include_query_string: true - name: redirect_site_to_https + - redirect_type: permanent + target_listener: sample_http_listener + include_path: true + include_query_string: true + name: redirect_site_to_https register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -715,7 +715,7 @@ azure_rm_appgateway_info: register: appgw_output - name: Assert there are the correct number of gateways - assert: + ansible.builtin.assert: that: - appgw_output.gateways | community.general.json_query(query) | length == 2 @@ -725,7 +725,7 @@ resource_group: "{{ resource_group }}" register: appgw_output - name: Assert there are the correct number of gateways - assert: + ansible.builtin.assert: that: - appgw_output.gateways | community.general.json_query(query) | length == 1 - (appgw_output.gateways | community.general.json_query(query))[0].name == 'appgateway-subnet-lookup{{ rpfx }}' @@ -769,13 +769,13 @@ - ip_address: 10.0.0.4 name: test_backend_address_pool probes: - - name: custom_probe - protocol: http - path: /healthz - interval: 30 - timeout: 30 - unhealthy_threshold: 3 - pick_host_name_from_backend_http_settings: true + - name: custom_probe + protocol: http + path: /healthz + interval: 30 + timeout: 30 + unhealthy_threshold: 3 + pick_host_name_from_backend_http_settings: true backend_http_settings_collection: - port: 80 protocol: http @@ -794,24 +794,24 @@ protocol: http name: http_listener request_routing_rules: - - rule_type: Basic + - rule_type: basic backend_address_pool: test_backend_address_pool backend_http_settings: sample_appgateway_http_settings http_listener: sample_http_listener name: rule1 - - rule_type: Basic + - rule_type: basic http_listener: http_listener redirect_configuration: redirect_site_to_https name: http_redirect_rule redirect_configurations: - - redirect_type: permanent - target_listener: sample_http_listener - include_path: true - include_query_string: true - name: redirect_site_to_https + - redirect_type: permanent + target_listener: sample_http_listener + include_path: true + include_query_string: true + name: redirect_site_to_https register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -852,13 +852,13 @@ - ip_address: 10.0.0.4 name: test_backend_address_pool probes: - - name: custom_probe - protocol: http - path: /healthz - interval: 30 - timeout: 30 - unhealthy_threshold: 3 - pick_host_name_from_backend_http_settings: true + - name: custom_probe + protocol: http + path: /healthz + interval: 30 + timeout: 30 + unhealthy_threshold: 3 + pick_host_name_from_backend_http_settings: true backend_http_settings_collection: - port: 80 protocol: http @@ -877,24 +877,24 @@ protocol: http name: http_listener request_routing_rules: - - rule_type: Basic + - rule_type: basic backend_address_pool: test_backend_address_pool backend_http_settings: sample_appgateway_http_settings http_listener: sample_http_listener name: rule1 - - rule_type: Basic + - rule_type: basic http_listener: http_listener redirect_configuration: redirect_site_to_https name: http_redirect_rule redirect_configurations: - - redirect_type: permanent - target_listener: sample_http_listener - include_path: true - include_query_string: true - name: redirect_site_to_https + - redirect_type: permanent + target_listener: sample_http_listener + include_path: true + include_query_string: true + name: redirect_site_to_https register: output - name: Assert the resource instance is not changed - assert: + ansible.builtin.assert: that: - not output.changed @@ -903,7 +903,7 @@ resource_group: "{{ resource_group_secondary }}" register: appgw_output - name: Assert there are the correct number of gateways and they are the right ones - assert: + ansible.builtin.assert: that: - appgw_output.gateways | community.general.json_query(query) | length == 1 - (appgw_output.gateways | community.general.json_query(query))[0].name == 'appgateway-probe-{{ rpfx }}' @@ -914,7 +914,7 @@ resource_group: "{{ resource_group_secondary }}" register: appgw_output - name: Assert there are no results - assert: + ansible.builtin.assert: that: - appgw_output.gateways | community.general.json_query(query) | length == 0 @@ -954,13 +954,13 @@ - ip_address: 10.0.0.4 name: test_backend_address_pool probes: - - name: custom_probe - protocol: http - host: 10.0.0.4 - path: /healthz - interval: 30 - timeout: 30 - unhealthy_threshold: 3 + - name: custom_probe + protocol: http + host: 10.0.0.4 + path: /healthz + interval: 30 + timeout: 30 + unhealthy_threshold: 3 backend_http_settings_collection: - port: 80 protocol: http @@ -982,7 +982,7 @@ http_listener: sample_http_listener name: rule1 url_path_map: path_mappings - - rule_type: Basic + - rule_type: basic http_listener: http_listener redirect_configuration: redirect_site_to_https name: http_redirect_rule @@ -998,14 +998,14 @@ - "/abc" - "/123/*" redirect_configurations: - - redirect_type: permanent - target_listener: sample_http_listener - include_path: true - include_query_string: true - name: redirect_site_to_https + - redirect_type: permanent + target_listener: sample_http_listener + include_path: true + include_query_string: true + name: redirect_site_to_https register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -1045,13 +1045,13 @@ - ip_address: 10.0.0.4 name: test_backend_address_pool probes: - - name: custom_probe - protocol: http - host: 10.0.0.4 - path: /healthz - interval: 30 - timeout: 30 - unhealthy_threshold: 3 + - name: custom_probe + protocol: http + host: 10.0.0.4 + path: /healthz + interval: 30 + timeout: 30 + unhealthy_threshold: 3 backend_http_settings_collection: - port: 80 protocol: http @@ -1073,7 +1073,7 @@ http_listener: sample_http_listener name: rule1 url_path_map: path_mappings - - rule_type: Basic + - rule_type: basic http_listener: http_listener redirect_configuration: redirect_site_to_https name: http_redirect_rule @@ -1089,14 +1089,14 @@ - "/abc" - "/123/*" redirect_configurations: - - redirect_type: permanent - target_listener: sample_http_listener - include_path: true - include_query_string: true - name: redirect_site_to_https + - redirect_type: permanent + target_listener: sample_http_listener + include_path: true + include_query_string: true + name: redirect_site_to_https register: output - name: Assert the resource instance is not changed - assert: + ansible.builtin.assert: that: - not output.changed @@ -1192,20 +1192,20 @@ http_listener: "inbound-http" redirect_configuration: "redirect-http" probes: - - name: "http-probe1" - interval: 30 - path: "/abc" - protocol: "https" - pick_host_name_from_backend_http_settings: true - timeout: 30 - unhealthy_threshold: 2 - - name: "http-probe2" - interval: 30 - path: "/xyz" - protocol: "http" - pick_host_name_from_backend_http_settings: true - timeout: 30 - unhealthy_threshold: 2 + - name: "http-probe1" + interval: 30 + path: "/abc" + protocol: "https" + pick_host_name_from_backend_http_settings: true + timeout: 30 + unhealthy_threshold: 2 + - name: "http-probe2" + interval: 30 + path: "/xyz" + protocol: "http" + pick_host_name_from_backend_http_settings: true + timeout: 30 + unhealthy_threshold: 2 redirect_configurations: - name: "redirect-http" redirect_type: "permanent" @@ -1223,7 +1223,7 @@ - "path_mappings" register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -1319,20 +1319,20 @@ http_listener: "inbound-http" redirect_configuration: "redirect-http" probes: - - name: "http-probe1" - interval: 30 - path: "/abc" - protocol: "https" - pick_host_name_from_backend_http_settings: true - timeout: 30 - unhealthy_threshold: 2 - - name: "http-probe2" - interval: 30 - path: "/xyz" - protocol: "http" - pick_host_name_from_backend_http_settings: true - timeout: 30 - unhealthy_threshold: 2 + - name: "http-probe1" + interval: 30 + path: "/abc" + protocol: "https" + pick_host_name_from_backend_http_settings: true + timeout: 30 + unhealthy_threshold: 2 + - name: "http-probe2" + interval: 30 + path: "/xyz" + protocol: "http" + pick_host_name_from_backend_http_settings: true + timeout: 30 + unhealthy_threshold: 2 redirect_configurations: - name: "redirect-http" redirect_type: "permanent" @@ -1350,7 +1350,7 @@ - "path_mappings" register: output - name: Assert the resource instance is not changed - assert: + ansible.builtin.assert: that: - not output.changed @@ -1481,20 +1481,20 @@ - header_name: "Foo" header_value: "Bar" probes: - - name: "http-probe1" - interval: 30 - path: "/abc" - protocol: "https" - pick_host_name_from_backend_http_settings: true - timeout: 30 - unhealthy_threshold: 2 - - name: "http-probe2" - interval: 30 - path: "/xyz" - protocol: "http" - pick_host_name_from_backend_http_settings: true - timeout: 30 - unhealthy_threshold: 2 + - name: "http-probe1" + interval: 30 + path: "/abc" + protocol: "https" + pick_host_name_from_backend_http_settings: true + timeout: 30 + unhealthy_threshold: 2 + - name: "http-probe2" + interval: 30 + path: "/xyz" + protocol: "http" + pick_host_name_from_backend_http_settings: true + timeout: 30 + unhealthy_threshold: 2 redirect_configurations: - name: "redirect-http" redirect_type: "permanent" @@ -1512,7 +1512,7 @@ - "path_mappings" register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -1636,20 +1636,20 @@ - header_name: "Foo" header_value: "Bar" probes: - - name: "http-probe1" - interval: 30 - path: "/abc" - protocol: "https" - pick_host_name_from_backend_http_settings: true - timeout: 30 - unhealthy_threshold: 2 - - name: "http-probe2" - interval: 30 - path: "/xyz" - protocol: "http" - pick_host_name_from_backend_http_settings: true - timeout: 30 - unhealthy_threshold: 2 + - name: "http-probe1" + interval: 30 + path: "/abc" + protocol: "https" + pick_host_name_from_backend_http_settings: true + timeout: 30 + unhealthy_threshold: 2 + - name: "http-probe2" + interval: 30 + path: "/xyz" + protocol: "http" + pick_host_name_from_backend_http_settings: true + timeout: 30 + unhealthy_threshold: 2 redirect_configurations: - name: "redirect-http" redirect_type: "permanent" @@ -1667,7 +1667,7 @@ - "path_mappings" register: output - name: Assert the resource instance is not updated - assert: + ansible.builtin.assert: that: - not output.changed @@ -1794,20 +1794,20 @@ - header_name: "FooResponse" header_value: "BarResponse" probes: - - name: "http-probe1" - interval: 30 - path: "/abc" - protocol: "https" - pick_host_name_from_backend_http_settings: true - timeout: 30 - unhealthy_threshold: 2 - - name: "http-probe2" - interval: 30 - path: "/xyz" - protocol: "http" - pick_host_name_from_backend_http_settings: true - timeout: 30 - unhealthy_threshold: 2 + - name: "http-probe1" + interval: 30 + path: "/abc" + protocol: "https" + pick_host_name_from_backend_http_settings: true + timeout: 30 + unhealthy_threshold: 2 + - name: "http-probe2" + interval: 30 + path: "/xyz" + protocol: "http" + pick_host_name_from_backend_http_settings: true + timeout: 30 + unhealthy_threshold: 2 redirect_configurations: - name: "redirect-http" redirect_type: "permanent" @@ -1825,7 +1825,7 @@ - "path_mappings" register: output - name: Assert the resource instance is updated - assert: + ansible.builtin.assert: that: - output.changed @@ -1877,8 +1877,8 @@ probe: "http-probe1" cookie_based_affinity: "Disabled" connection_draining: - drain_timeout_in_sec: 60 - enabled: true + drain_timeout_in_sec: 60 + enabled: true trusted_root_certificates: - "rootCert3" - name: "http-profile2" @@ -1960,20 +1960,20 @@ - header_name: "Foo" header_value: "Bar" probes: - - name: "http-probe1" - interval: 30 - path: "/abc" - protocol: "https" - pick_host_name_from_backend_http_settings: true - timeout: 30 - unhealthy_threshold: 2 - - name: "http-probe2" - interval: 30 - path: "/xyz" - protocol: "http" - pick_host_name_from_backend_http_settings: true - timeout: 30 - unhealthy_threshold: 2 + - name: "http-probe1" + interval: 30 + path: "/abc" + protocol: "https" + pick_host_name_from_backend_http_settings: true + timeout: 30 + unhealthy_threshold: 2 + - name: "http-probe2" + interval: 30 + path: "/xyz" + protocol: "http" + pick_host_name_from_backend_http_settings: true + timeout: 30 + unhealthy_threshold: 2 redirect_configurations: - name: "redirect-http" redirect_type: "permanent" @@ -1992,7 +1992,7 @@ register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -2160,7 +2160,7 @@ register: output - name: Assert the resource instance is not updated - assert: + ansible.builtin.assert: that: - not output.changed @@ -2321,17 +2321,17 @@ url_path_maps: - "path_mappings" web_application_firewall_configuration: - enabled: true - firewall_mode: "Detection" - rule_set_type: "OWASP" - rule_set_version: "3.0" - request_body_check: true - max_request_body_size_in_kb: 128 - file_upload_limit_in_mb: 100 + enabled: true + firewall_mode: "Detection" + rule_set_type: "OWASP" + rule_set_version: "3.0" + request_body_check: true + max_request_body_size_in_kb: 128 + file_upload_limit_in_mb: 100 register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -2495,7 +2495,7 @@ register: output - name: Assert the resource instance is not updated - assert: + ansible.builtin.assert: that: - not output.changed @@ -2504,10 +2504,10 @@ resource_group: "{{ resource_group }}" name: "appgateway{{ rpfx }}" state: absent - check_mode: yes + check_mode: true register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -2518,7 +2518,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -2529,7 +2529,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed == false @@ -2540,7 +2540,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -2551,7 +2551,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -2562,7 +2562,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -2573,7 +2573,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -2584,7 +2584,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -2595,7 +2595,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -2606,7 +2606,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -2617,7 +2617,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_appserviceplan/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_appserviceplan/tasks/main.yml index 3e0906bfc..3c65aa299 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_appserviceplan/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_appserviceplan/tasks/main.yml @@ -1,29 +1,29 @@ - name: Prepare facts - set_fact: + ansible.builtin.set_fact: resource_prefix: "{{ resource_group_secondary | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - run_once: yes + run_once: true - name: Prepare facts - set_fact: + ansible.builtin.set_fact: linux_plan_resource_group: "{{ resource_group_secondary }}" - win_plan_name: "{{ (resource_prefix | replace('-','x'))[-8:] }}winplan" - linux_plan_name: "{{ (resource_prefix | replace('-','x'))[-8:] }}linplan" - run_once: yes + win_plan_name: "{{ (resource_prefix | replace('-', 'x'))[-8:] }}winplan" + linux_plan_name: "{{ (resource_prefix | replace('-', 'x'))[-8:] }}linplan" + run_once: true -- name: create a windows plan +- name: Create a windows plan azure_rm_appserviceplan: name: "{{ win_plan_name }}1" resource_group: "{{ resource_group }}" sku: B1 register: output -- name: assert app service was created - assert: +- name: Assert app service was created + ansible.builtin.assert: that: - output.changed - output.id -- name: create a linux plan +- name: Create a linux plan azure_rm_appserviceplan: resource_group: "{{ linux_plan_resource_group }}" name: "{{ linux_plan_name }}1" @@ -32,25 +32,25 @@ number_of_workers: 1 register: output -- name: assert app service was created - assert: +- name: Assert app service was created + ansible.builtin.assert: that: - output.changed - output.id -- name: get app service plan by name +- name: Get app service plan by name azure_rm_appserviceplan_info: resource_group: "{{ linux_plan_resource_group }}" name: "{{ linux_plan_name }}1" register: output -- name: assert is_linux is True - assert: +- name: Assert is_linux is True + ansible.builtin.assert: that: - output.appserviceplans | length == 1 - output.appserviceplans[0].is_linux == True -- name: create linux app service plan idempotent +- name: Create linux app service plan idempotent azure_rm_appserviceplan: resource_group: "{{ linux_plan_resource_group }}" name: "{{ linux_plan_name }}1" @@ -59,23 +59,23 @@ number_of_workers: 1 register: output -- name: assert app service is not updated - assert: +- name: Assert app service is not updated + ansible.builtin.assert: that: not output.changed -- name: update a windows plan sku +- name: Update a windows plan sku azure_rm_appserviceplan: name: "{{ win_plan_name }}1" resource_group: "{{ resource_group }}" sku: B2 register: output -- name: assert app service was updated - assert: +- name: Assert app service was updated + ansible.builtin.assert: that: - output.changed -- name: update a linux plan number of workers +- name: Update a linux plan number of workers azure_rm_appserviceplan: resource_group: "{{ linux_plan_resource_group }}" name: "{{ linux_plan_name }}1" @@ -84,12 +84,12 @@ number_of_workers: 2 register: output -- name: assert app service was updated - assert: +- name: Assert app service was updated + ansible.builtin.assert: that: - output.changed -- name: create premium linux plan +- name: Create premium linux plan azure_rm_appserviceplan: resource_group: "{{ linux_plan_resource_group }}" name: "{{ linux_plan_name }}-premium" @@ -97,13 +97,13 @@ is_linux: true register: output -- name: assert app service was created - assert: +- name: Assert app service was created + ansible.builtin.assert: that: - output.changed - output.id -- name: create premium linux plan idempotent +- name: Create premium linux plan idempotent azure_rm_appserviceplan: resource_group: "{{ linux_plan_resource_group }}" name: "{{ linux_plan_name }}-premium" @@ -111,6 +111,6 @@ is_linux: true register: output -- name: assert app service is not updated - assert: +- name: Assert app service is not updated + ansible.builtin.assert: that: not output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_automationaccount/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_automationaccount/tasks/main.yml index 1e00eb9ac..96e386733 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_automationaccount/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_automationaccount/tasks/main.yml @@ -1,88 +1,95 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - name: "account{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - run_once: yes + name_rpfx: "account{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" + run_once: true - name: Create automation account azure_rm_automationaccount: - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" - check_mode: yes + check_mode: true register: output -- assert: +- name: Check the check mode return + ansible.builtin.assert: that: - - output.changed + - output.changed - name: Create automation account azure_rm_automationaccount: - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" register: output -- assert: +- name: Assert the account created + ansible.builtin.assert: that: - - output.changed - - output.id + - output.changed + - output.id - name: Create automation account azure_rm_automationaccount: - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" register: output -- assert: +- name: Assert the account already created + ansible.builtin.assert: that: - - not output.changed + - not output.changed - name: Get automation account azure_rm_automationaccount_info: - name: "{{ name }}" - resource_group: "{{ resource_group }}" - list_statistics: yes - list_usages: yes - list_keys: yes + name: "{{ name_rpfx }}" + resource_group: "{{ resource_group }}" + list_statistics: true + list_usages: true + list_keys: true register: facts -- assert: +- name: Assert the account facts + ansible.builtin.assert: that: - - facts.automation_accounts | length == 1 - - facts.automation_accounts[0].keys - - facts.automation_accounts[0].usages - - facts.automation_accounts[0].statistics - - facts.automation_accounts[0].state == "Ok" + - facts.automation_accounts | length == 1 + - facts.automation_accounts[0].keys + - facts.automation_accounts[0].usages + - facts.automation_accounts[0].statistics + - facts.automation_accounts[0].state == "Ok" - name: Delete account azure_rm_automationaccount: - name: "{{ name }}" - resource_group: "{{ resource_group }}" - state: absent - check_mode: yes + name: "{{ name_rpfx }}" + resource_group: "{{ resource_group }}" + state: absent + check_mode: true register: output -- assert: - that: - - output.changed +- name: Assert the account deleted + ansible.builtin.assert: + that: + - output.changed - name: Delete account azure_rm_automationaccount: - name: "{{ name }}" - resource_group: "{{ resource_group }}" - state: absent + name: "{{ name_rpfx }}" + resource_group: "{{ resource_group }}" + state: absent register: output -- assert: - that: - - output.changed +- name: Assert the account deleted + ansible.builtin.assert: + that: + - output.changed - name: Delete account azure_rm_automationaccount: - name: "{{ name }}" - resource_group: "{{ resource_group }}" - state: absent + name: "{{ name_rpfx }}" + resource_group: "{{ resource_group }}" + state: absent register: output -- assert: - that: - - not output.changed +- name: Assert the account delete + ansible.builtin.assert: + that: + - not output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_automationrunbook/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_automationrunbook/tasks/main.yml index d6f7ba8a1..1901474c3 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_automationrunbook/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_automationrunbook/tasks/main.yml @@ -1,23 +1,23 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(10, True, '') }}" - run_once: yes + run_once: true - name: Create automation account azure_rm_automationaccount: name: "account-{{ rpfx }}" resource_group: "{{ resource_group }}" -- name: create automation runbook (check mode) +- name: Create automation runbook (check mode) azure_rm_automationrunbook: resource_group: "{{ resource_group }}" automation_account_name: "account-{{ rpfx }}" name: "runbook-{{ rpfx }}" runbook_type: "Script" description: "Fred test" - check_mode: yes + check_mode: true -- name: create automation runbook with default parameters +- name: Create automation runbook with default parameters azure_rm_automationrunbook: resource_group: "{{ resource_group }}" automation_account_name: "account-{{ rpfx }}" @@ -27,11 +27,11 @@ register: output - name: Assert the automation runbook is well created - assert: + ansible.builtin.assert: that: - output.changed -- name: create automation runbook with default parameters (idempotent) +- name: Create automation runbook with default parameters (idempotent) azure_rm_automationrunbook: resource_group: "{{ resource_group }}" automation_account_name: "account-{{ rpfx }}" @@ -41,11 +41,11 @@ register: output - name: Assert the automation runbook is well created - assert: + ansible.builtin.assert: that: - not output.changed -- name: Create automation runbook with more paramters +- name: Create automation runbook with more paramters azure_rm_automationrunbook: resource_group: "{{ resource_group }}" automation_account_name: "account-{{ rpfx }}" @@ -53,18 +53,18 @@ runbook_type: "Script" description: "test" log_activity_trace: 2 - log_progress: False - log_verbose: True - tags: + log_progress: false + log_verbose: true + tags: key1: value1 register: output - name: Assert the automation runbook is well created - assert: + ansible.builtin.assert: that: - output.changed -- name: Update automation runbook with more paramters +- name: Update automation runbook with more paramters azure_rm_automationrunbook: resource_group: "{{ resource_group }}" automation_account_name: "account-{{ rpfx }}" @@ -72,27 +72,27 @@ runbook_type: "Script" description: "update" log_activity_trace: 3 - log_progress: True - log_verbose: False - tags: + log_progress: true + log_verbose: false + tags: key2: value2 register: output - name: Assert the automation runbook is well created - assert: + ansible.builtin.assert: that: - output.changed -- name: Publish automation runbook +- name: Publish automation runbook azure_rm_automationrunbook: resource_group: "{{ resource_group }}" automation_account_name: "account-{{ rpfx }}" name: "runbook-{{ rpfx }}-secondary" - publish: True + publish: true register: output - name: Assert the automation runbook is well published - assert: + ansible.builtin.assert: that: - output.changed @@ -104,7 +104,7 @@ register: output - name: Assert the automation runbook is well created - assert: + ansible.builtin.assert: that: - output.automation_runbook[0].description == 'update' - output.automation_runbook[0].log_activity_trace == 3 @@ -120,18 +120,18 @@ register: output - name: Assert the automation runbook is well created - assert: + ansible.builtin.assert: that: - output.automation_runbook | length == 2 -- name: delete automation runbook +- name: Delete automation runbook azure_rm_automationrunbook: resource_group: "{{ resource_group }}" automation_account_name: "account-{{ rpfx }}" name: "runbook-{{ rpfx }}" state: absent -- name: delete automation runbook +- name: Delete automation runbook azure_rm_automationrunbook: resource_group: "{{ resource_group }}" automation_account_name: "account-{{ rpfx }}" diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_autoscale/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_autoscale/tasks/main.yml index 8c8f144dc..4a19ee340 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_autoscale/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_autoscale/tasks/main.yml @@ -1,8 +1,8 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - name: "scale{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - run_once: yes + name_rpfx: "scale{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" + run_once: true - name: Create virtual network azure_rm_virtualnetwork: @@ -35,9 +35,9 @@ managed_disk_type: Standard_LRS os_disk_caching: ReadWrite image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal publisher: Canonical - sku: 18.04-LTS + sku: 20_04-lts version: latest data_disks: - lun: 0 @@ -46,157 +46,164 @@ managed_disk_type: Standard_LRS register: vmss -- name: create auto scaling (check mode) +- name: Create auto scaling (check mode) azure_rm_autoscale: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" target: "{{ vmss.ansible_facts.azure_vmss.id }}" enabled: true profiles: - - count: '1' - recurrence_days: - - Monday - name: Auto created scale condition - recurrence_timezone: China Standard Time - recurrence_mins: - - '0' - min_count: '1' - max_count: '1' - recurrence_frequency: Week - recurrence_hours: - - '18' - check_mode: yes + - count: '1' + recurrence_days: + - Monday + name: Auto created scale condition + recurrence_timezone: China Standard Time + recurrence_mins: + - '0' + min_count: '1' + max_count: '1' + recurrence_frequency: Week + recurrence_hours: + - '18' + check_mode: true register: output -- assert: +- name: Assert check mode facts + ansible.builtin.assert: that: - output.changed -- name: create auto scaling +- name: Create auto scaling azure_rm_autoscale: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" target: name: "testVMSS{{ rpfx }}" types: "virtualMachineScaleSets" namespace: "Microsoft.Compute" enabled: true profiles: - - count: '1' - recurrence_days: - - Monday - name: Auto created scale condition - recurrence_timezone: China Standard Time - recurrence_mins: - - '0' - min_count: '1' - max_count: '1' - recurrence_frequency: Week - recurrence_hours: - - '18' + - count: '1' + recurrence_days: + - Monday + name: Auto created scale condition + recurrence_timezone: China Standard Time + recurrence_mins: + - '0' + min_count: '1' + max_count: '1' + recurrence_frequency: Week + recurrence_hours: + - '18' register: output -- assert: +- name: Assert the auto scale created + ansible.builtin.assert: that: - output.changed - output.id -- name: create auto scaling (idemponent) +- name: Create auto scaling (idemponent) azure_rm_autoscale: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" target: "{{ vmss.ansible_facts.azure_vmss.id }}" enabled: true profiles: - - count: '1' - recurrence_days: - - Monday - name: Auto created scale condition - recurrence_timezone: China Standard Time - recurrence_mins: - - '0' - min_count: '1' - max_count: '1' - recurrence_frequency: Week - recurrence_hours: - - '18' + - count: '1' + recurrence_days: + - Monday + name: Auto created scale condition + recurrence_timezone: China Standard Time + recurrence_mins: + - '0' + min_count: '1' + max_count: '1' + recurrence_frequency: Week + recurrence_hours: + - '18' register: output -- assert: +- name: Assert the auto scale idempotent + ansible.builtin.assert: that: - not output.changed - output.id -- name: update auto scaling +- name: Update auto scaling azure_rm_autoscale: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" target: "{{ vmss.ansible_facts.azure_vmss.id }}" enabled: true profiles: - - count: '1' - recurrence_days: - - Monday - name: Auto created scale condition 0 - rules: - - time_aggregation: Average - time_window: 10 - direction: Increase - metric_name: Percentage CPU - metric_resource_uri: "{{ vmss.ansible_facts.azure_vmss.id }}" - value: '1' - threshold: 70 - cooldown: 5 - time_grain: 1 - statistic: Average - operator: GreaterThan - type: ChangeCount - max_count: '1' - recurrence_mins: - - '0' - min_count: '1' - recurrence_timezone: China Standard Time - recurrence_frequency: Week - recurrence_hours: - - '6' + - count: '1' + recurrence_days: + - Monday + name: Auto created scale condition 0 + rules: + - time_aggregation: Average + time_window: 10 + direction: Increase + metric_name: Percentage CPU + metric_resource_uri: "{{ vmss.ansible_facts.azure_vmss.id }}" + value: '1' + threshold: 70 + cooldown: 5 + time_grain: 1 + statistic: Average + operator: GreaterThan + type: ChangeCount + max_count: '1' + recurrence_mins: + - '0' + min_count: '1' + recurrence_timezone: China Standard Time + recurrence_frequency: Week + recurrence_hours: + - '6' register: output -- assert: +- name: Assert the auto scale created + ansible.builtin.assert: that: - output.changed - output.profiles[0].rules[0].metric_resource_uri == vmss.ansible_facts.azure_vmss.id -- name: delete auto scaling (check mode) +- name: Delete auto scaling (check mode) azure_rm_autoscale: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" state: absent - check_mode: yes + check_mode: true register: output -- assert: +- name: Assert the auto scaling deleted + ansible.builtin.assert: that: - output.changed -- name: delete auto scaling +- name: Delete auto scaling azure_rm_autoscale: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" state: absent register: output -- assert: +- name: Assert the auto scaling deleted + ansible.builtin.assert: that: - output.changed -- name: delete auto scaling (idemponetent) +- name: Delete auto scaling (idemponetent) azure_rm_autoscale: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" state: absent register: output -- assert: +- name: Assert the auto scaling deleted idempotent + ansible.builtin.assert: that: - not output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_availabilityset/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_availabilityset/tasks/main.yml index 7dc00bf26..c1e42e9bc 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_availabilityset/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_availabilityset/tasks/main.yml @@ -5,9 +5,10 @@ tags: tag1: testtag register: results - check_mode: yes + check_mode: true -- assert: +- name: Assert the availability created + ansible.builtin.assert: that: results.changed - name: Create an availability set with default options @@ -18,11 +19,12 @@ tag1: testtag register: results -- assert: +- name: Assert the availability created + ansible.builtin.assert: that: results.changed - name: Create proximity placement group name - set_fact: + ansible.builtin.set_fact: ppgroup_name: "ppg{{ resource_group | hash('md5') | truncate(22, True, '') }}" - name: Create a proximity placement group @@ -43,7 +45,8 @@ sku: Aligned register: results -- assert: +- name: Assert the availability set created + ansible.builtin.assert: that: results.changed - name: Modify availabilty set immutable options - no changes, fail for immutable options @@ -55,12 +58,13 @@ proximity_placement_group: "{{ ppgroup_name }}" sku: Aligned register: results - ignore_errors: yes + ignore_errors: true -- assert: - that: - - not results.changed - - results.msg == 'You tried to change platform_update_domain_count but is was unsuccessful. An Availability Set is immutable, except tags' +- name: Assert availabilty set modified + ansible.builtin.assert: + that: + - not results.changed + - results.msg == 'You tried to change platform_update_domain_count but is was unsuccessful. An Availability Set is immutable, except tags' - name: Modify availabilty set immutable options and set tags - change tags and fail for immutable options azure_rm_availabilityset: @@ -73,12 +77,13 @@ tags: test1: modified register: results - ignore_errors: yes + ignore_errors: true -- assert: - that: - - not results.changed - - results.msg == 'You tried to change platform_update_domain_count but is was unsuccessful. An Availability Set is immutable, except tags' +- name: Assert the availabilty set idempotent + ansible.builtin.assert: + that: + - not results.changed + - results.msg == 'You tried to change platform_update_domain_count but is was unsuccessful. An Availability Set is immutable, except tags' - name: Modify availabilty set options to update tags azure_rm_availabilityset: @@ -92,7 +97,8 @@ test2: modified register: results -- assert: +- name: Assert availabilty set updated + ansible.builtin.assert: that: - results.state.tags.test2 == 'modified' @@ -104,9 +110,10 @@ platform_fault_domain_count: 4 sku: Aligned register: results - ignore_errors: yes + ignore_errors: true -- assert: +- name: Assert the error return + ansible.builtin.assert: { that: "'The specified fault domain count 4 must fall in the range 1 to' in results['msg']" } - name: Test check_mode @@ -120,11 +127,12 @@ tags: checktest1: modified1 checktest2: modified2 - check_mode: yes + check_mode: true register: results -- assert: - that: +- name: Assert the check mode test + ansible.builtin.assert: + that: - results.changed - results.state.tags.checktest1 == 'modified1' @@ -137,23 +145,25 @@ resource_group: "{{ resource_group }}" register: results -- assert: - that: +- name: Assert the availabilty set facts + ansible.builtin.assert: + that: - not results.changed - not results.failed - - results.ansible_info.azure_availabilitysets[0].properties.platformFaultDomainCount == 2 - - results.ansible_info.azure_availabilitysets[0].properties.platformUpdateDomainCount == 5 + - results.ansible_info.azure_availabilitysets[0].platform_fault_domain_count == 2 + - results.ansible_info.azure_availabilitysets[0].platform_update_domain_count == 5 - results.ansible_info.azure_availabilitysets[0].sku == 'Aligned' - - results.ansible_info.azure_availabilitysets[0].properties.proximityPlacementGroup.id.split('/')[-1] == ppgroup_name + - results.ansible_info.azure_availabilitysets[0].proximity_placement_group.id.split('/')[-1] == ppgroup_name - name: Delete an availability set - Check Mode azure_rm_availabilityset: name: myavailabilityset1 resource_group: "{{ resource_group }}" state: absent - check_mode: yes + check_mode: true register: results -- assert: +- name: Assert the availabilty set deleted + ansible.builtin.assert: that: - results.changed @@ -168,9 +178,10 @@ name: myavailabilityset1 resource_group: "{{ resource_group }}" state: absent - check_mode: yes + check_mode: true register: results -- assert: +- name: Assert check mode return + ansible.builtin.assert: that: - not results.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_azurefirewall/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_azurefirewall/tasks/main.yml index face59c2b..168e197bf 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_azurefirewall/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_azurefirewall/tasks/main.yml @@ -1,5 +1,5 @@ - name: Fix resource prefix - set_fact: + ansible.builtin.set_fact: virtual_network_name: myVirtualNetwork subnet_name: AzureFirewallSubnet public_ipaddress_name: myPublicIpAddress @@ -28,21 +28,22 @@ - name: Create public IP address azure_rm_publicipaddress: - resource_group: "{{ resource_group }}" - allocation_method: Static - name: "{{ public_ipaddress_name }}" - sku: Standard + resource_group: "{{ resource_group }}" + allocation_method: Static + name: "{{ public_ipaddress_name }}" + sku: Standard register: pip_output -- debug: +- name: Print the creating return + ansible.builtin.debug: var: pip_output - name: Create Azure Firewall azure_rm_azurefirewall: - resource_group: '{{resource_group}}' - name: '{{azure_firewall_name}}' - #tags: - # key1: value1 + resource_group: '{{ resource_group }}' + name: '{{ azure_firewall_name }}' + # tags: + # key1: value1 application_rule_collections: - priority: 110 action: deny @@ -101,18 +102,19 @@ name: azureFirewallIpConfiguration register: output -- debug: +- name: Print the creating return + ansible.builtin.debug: var: output - name: Assert that output has changed - assert: + ansible.builtin.assert: that: - output.changed - name: Create Azure Firewall -- idempotent azure_rm_azurefirewall: - resource_group: '{{resource_group}}' - name: '{{azure_firewall_name}}' + resource_group: '{{ resource_group }}' + name: '{{ azure_firewall_name }}' application_rule_collections: - priority: 110 action: deny @@ -171,18 +173,19 @@ name: azureFirewallIpConfiguration register: output -- debug: +- name: Print the return value + ansible.builtin.debug: var: output - name: Assert that output has not changed - assert: + ansible.builtin.assert: that: - not output.changed - name: Create Azure Firewall -- change something azure_rm_azurefirewall: - resource_group: '{{resource_group}}' - name: '{{azure_firewall_name}}' + resource_group: '{{ resource_group }}' + name: '{{ azure_firewall_name }}' application_rule_collections: - priority: 110 action: deny @@ -239,22 +242,23 @@ public_ip_address: name: "{{ public_ipaddress_name }}" name: azureFirewallIpConfiguration - check_mode: yes + check_mode: true register: output - name: Assert that output has changed - assert: + ansible.builtin.assert: that: - output.changed - name: Get info of the Azure Firewall azure_rm_azurefirewall_info: - resource_group: '{{resource_group}}' - name: '{{azure_firewall_name}}' + resource_group: '{{ resource_group }}' + name: '{{ azure_firewall_name }}' register: output -- assert: - that: +- name: Assert the azure firewall facts + ansible.builtin.assert: + that: - not output.changed - output.firewalls['id'] != None - output.firewalls['name'] != None @@ -267,11 +271,12 @@ - name: Delete Azure Firewall azure_rm_azurefirewall: - resource_group: '{{resource_group}}' - name: '{{azure_firewall_name}}' + resource_group: '{{ resource_group }}' + name: '{{ azure_firewall_name }}' state: absent register: output -- assert: - that: +- name: Assert the azure firewall deleted + ansible.builtin.assert: + that: - output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_backupazurevm/meta/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_backupazurevm/meta/main.yml index 48f5726d8..95e1952f9 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_backupazurevm/meta/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_backupazurevm/meta/main.yml @@ -1,2 +1,2 @@ dependencies: - - setup_azure
\ No newline at end of file + - setup_azure diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_backupazurevm/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_backupazurevm/tasks/main.yml index b8d0064f2..27ec031f2 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_backupazurevm/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_backupazurevm/tasks/main.yml @@ -1,5 +1,5 @@ - name: Fix resource prefix - set_fact: + ansible.builtin.set_fact: resource_group: 'MyResourceGroup' recovery_vault_name: 'MyRecoveryVault' resource_id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/MyVM" @@ -15,7 +15,7 @@ register: output - name: Assert that output has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -30,10 +30,10 @@ register: output - name: Assert that output has changed - assert: + ansible.builtin.assert: that: - output.changed - + - name: Stop protection but retain existing data azure_rm_backupazurevm: resource_group: "{{ resource_group }}" @@ -44,7 +44,7 @@ register: output - name: Assert that output has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -56,7 +56,7 @@ register: output - name: Assert that output has changed - assert: + ansible.builtin.assert: that: - output.response.id != None - output.response.name != None @@ -69,8 +69,8 @@ backup_policy_id: "{{ backup_policy_id }}" state: "delete" register: output - + - name: Assert that output has changed - assert: + ansible.builtin.assert: that: - output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_backuppolicy/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_backuppolicy/tasks/main.yml index f57eed4a8..c37a7fefd 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_backuppolicy/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_backuppolicy/tasks/main.yml @@ -1,5 +1,5 @@ - name: Set Facts for Tests - set_fact: + ansible.builtin.set_fact: vault_name: "rsv{{ resource_group | hash('md5') | truncate(22, True, '') }}" location: "eastus" policy_name_daily: "bp-daily-policy-{{ resource_group | hash('md5') | truncate(22, True, '') }}" @@ -34,13 +34,13 @@ register: backup_policy_exists - name: Assert success on daily backup policy creation - assert: + ansible.builtin.assert: that: - daily_policy_output.changed - daily_policy_output.name == policy_name_daily - name: Assert Policy Success Retrieving Info - assert: + ansible.builtin.assert: that: - backup_policy_exists.id == daily_policy_output.id - backup_policy_exists.location == daily_policy_output.location @@ -62,7 +62,7 @@ register: daily_policy_output_update - name: Assert success on update of daily policy - assert: + ansible.builtin.assert: that: - daily_policy_output_update.changed - daily_policy_output_update.name == policy_name_daily @@ -86,7 +86,7 @@ register: weekly_policy_output - name: Assert success on weekly backup policy creation - assert: + ansible.builtin.assert: that: - weekly_policy_output.changed - weekly_policy_output.name == policy_name_weekly @@ -110,7 +110,7 @@ register: weekly_policy_output_update - name: Assert success on update of weekly policy - assert: + ansible.builtin.assert: that: - weekly_policy_output_update.changed - weekly_policy_output_update.name == policy_name_weekly @@ -124,7 +124,7 @@ register: daily_policy_output_delete - name: Assert success on daily backup policy deletion - assert: + ansible.builtin.assert: that: - daily_policy_output_delete.changed @@ -137,7 +137,7 @@ register: weekly_policy_output_delete - name: Assert success on weekly backup policy deletion - assert: + ansible.builtin.assert: that: - weekly_policy_output_delete.changed @@ -150,7 +150,7 @@ register: daily_policy_output_delete_idempotent - name: Assert that there is no change after second deletion of daily backup policy - assert: + ansible.builtin.assert: that: - not daily_policy_output_delete_idempotent.changed @@ -163,6 +163,6 @@ register: weekly_policy_output_delete_idempotent - name: Assert that there is no change after second deletion of weekly backup policy - assert: + ansible.builtin.assert: that: - not weekly_policy_output_delete_idempotent.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_bastionhost/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_bastionhost/tasks/main.yml index c9d9c23d7..e38f91eac 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_bastionhost/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_bastionhost/tasks/main.yml @@ -1,8 +1,8 @@ - name: Set Bastion host name - set_fact: + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(8, True, '') }}" -- name: create resource group +- name: Create resource group azure_rm_resourcegroup: name: "{{ resource_group }}" location: eastus @@ -36,7 +36,7 @@ azure_rm_publicipaddress_info: resource_group: "{{ resource_group }}" name: "pip{{ rpfx }}" - register: publicIP_output + register: publicip_output - name: Create bastion host (checkmode test) azure_rm_bastionhost: @@ -44,22 +44,22 @@ name: "bh{{ rpfx }}" ip_configurations: - name: testip_configuration - subnet: + subnet: id: "{{ subnet_output.state.id }}" - public_ip_address: - id: "{{ publicIP_output.publicipaddresses[0].id }}" + public_ip_address: + id: "{{ publicip_output.publicipaddresses[0].id }}" private_ip_allocation_method: Dynamic sku: name: Standard - enable_tunneling: False - enable_shareable_link: False - enable_ip_connect: False - enable_file_copy: False + enable_tunneling: false + enable_shareable_link: false + enable_ip_connect: false + enable_file_copy: false scale_units: 6 - disable_copy_paste: False + disable_copy_paste: false tags: key3: value3 - check_mode: yes + check_mode: true register: output - name: Create bastion host @@ -68,25 +68,25 @@ name: "bh{{ rpfx }}" ip_configurations: - name: testip_configuration - subnet: + subnet: id: "{{ subnet_output.state.id }}" - public_ip_address: - id: "{{ publicIP_output.publicipaddresses[0].id }}" + public_ip_address: + id: "{{ publicip_output.publicipaddresses[0].id }}" private_ip_allocation_method: Dynamic sku: name: Standard - enable_tunneling: False - enable_shareable_link: False - enable_ip_connect: False - enable_file_copy: False + enable_tunneling: false + enable_shareable_link: false + enable_ip_connect: false + enable_file_copy: false scale_units: 6 - disable_copy_paste: False + disable_copy_paste: false tags: key3: value3 register: output - name: Assert the bastion host created - assert: + ansible.builtin.assert: that: - output.changed @@ -96,30 +96,32 @@ name: "bh{{ rpfx }}" ip_configurations: - name: testip_configuration - subnet: + subnet: id: "{{ subnet_output.state.id }}" - public_ip_address: - id: "{{ publicIP_output.publicipaddresses[0].id }}" + public_ip_address: + id: "{{ publicip_output.publicipaddresses[0].id }}" private_ip_allocation_method: Dynamic sku: name: Standard - enable_tunneling: False - enable_shareable_link: False - enable_ip_connect: False - enable_file_copy: False + enable_tunneling: false + enable_shareable_link: false + enable_ip_connect: false + enable_file_copy: false scale_units: 6 - disable_copy_paste: False + disable_copy_paste: false tags: key3: value3 register: output - name: Assert the bastion host no changed - assert: + ansible.builtin.assert: that: - not output.changed - name: Pause for 20 mimutes to Bastion host updating - shell: sleep 1200 + ansible.builtin.command: + sleep 1200 + changed_when: true - name: Update bastion host azure_rm_bastionhost: @@ -127,25 +129,25 @@ name: "bh{{ rpfx }}" ip_configurations: - name: testip_configuration - subnet: + subnet: id: "{{ subnet_output.state.id }}" - public_ip_address: - id: "{{ publicIP_output.publicipaddresses[0].id }}" + public_ip_address: + id: "{{ publicip_output.publicipaddresses[0].id }}" private_ip_allocation_method: Dynamic sku: name: Basic - enable_tunneling: True - enable_shareable_link: True - enable_ip_connect: True - enable_file_copy: True + enable_tunneling: true + enable_shareable_link: true + enable_ip_connect: true + enable_file_copy: true scale_units: 8 - disable_copy_paste: True + disable_copy_paste: true tags: key2: value2 register: output - name: Assert the bastion host updated - assert: + ansible.builtin.assert: that: - output.changed @@ -154,9 +156,9 @@ resource_group: "{{ resource_group }}" name: "bh{{ rpfx }}" register: output - + - name: Assert the bastion host is well create - assert: + ansible.builtin.assert: that: - output.bastion_host[0].disable_copy_paste == true - output.bastion_host[0].enable_file_copy == true diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_batchaccount/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_batchaccount/tasks/main.yml index e62cb67cf..e56a572a7 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_batchaccount/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_batchaccount/tasks/main.yml @@ -11,66 +11,80 @@ # # ---------------------------------------------------------------------------- - name: Prepare random number - set_fact: + ansible.builtin.set_fact: storage_account_name: "st{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" batch_account_name: "ba{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - run_once: yes + run_once: true - name: Create Storage Account azure_rm_storageaccount: - resource_group: "{{ resource_group }}" - name: "{{ storage_account_name }}" - location: eastus - account_type: Standard_LRS + resource_group: "{{ resource_group }}" + name: "{{ storage_account_name }}" + location: eastus + account_type: Standard_LRS - name: Create Batch Account azure_rm_batchaccount: - resource_group: "{{ resource_group }}" - name: "{{ batch_account_name }}" - location: eastus - auto_storage_account: - name: "{{ storage_account_name }}" - pool_allocation_mode: batch_service + resource_group: "{{ resource_group }}" + name: "{{ batch_account_name }}" + location: eastus + auto_storage_account: + name: "{{ storage_account_name }}" + pool_allocation_mode: batch_service + tags: + key1: value1 + key2: value2 register: output - name: Assert the resource was created - assert: + ansible.builtin.assert: that: - output.changed - name: Create Batch Account -- idempotent azure_rm_batchaccount: - resource_group: "{{ resource_group }}" - name: "{{ batch_account_name }}" - location: eastus - auto_storage_account: - name: "{{ storage_account_name }}" - pool_allocation_mode: batch_service + resource_group: "{{ resource_group }}" + name: "{{ batch_account_name }}" + location: eastus + auto_storage_account: + name: "{{ storage_account_name }}" + pool_allocation_mode: batch_service + tags: + key1: value1 + key2: value2 register: output - name: Assert the resource was created - assert: + ansible.builtin.assert: that: - not output.changed +- name: Get Batch Account facts + azure_rm_batchaccount_info: + resource_group: "{{ resource_group }}" + name: "{{ batch_account_name }}" + register: output + +- name: Assert the facts + ansible.builtin.assert: + that: + - output.batch_account | length == 1 + - output.batch_account[0].tags | length == 2 + - name: Delete Batch Account azure_rm_batchaccount: - resource_group: "{{ resource_group }}" - name: "{{ batch_account_name }}" - location: eastus - auto_storage_account: - name: "{{ storage_account_name }}" - pool_allocation_mode: batch_service - state: absent + resource_group: "{{ resource_group }}" + name: "{{ batch_account_name }}" + state: absent register: output - name: Assert that state has changed - assert: + ansible.builtin.assert: that: - output.changed - name: Clean up storage account azure_rm_storageaccount: - resource_group: "{{ resource_group }}" - name: "{{ storage_account_name }}" - state: absent + resource_group: "{{ resource_group }}" + name: "{{ storage_account_name }}" + state: absent diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_cdnprofile/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_cdnprofile/tasks/main.yml index 657881a50..92012c6f5 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_cdnprofile/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_cdnprofile/tasks/main.yml @@ -1,90 +1,91 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: cdnprofilename: "cdnprofile{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" endpointname: "endpoint{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - run_once: yes + run_once: true - name: Create a CDN profile(check mode) azure_rm_cdnprofile: - resource_group: "{{ resource_group }}" - name: "{{ cdnprofilename }}" - sku: standard_akamai - tags: - testing: testing - delete: on-exit - foo: bar - check_mode: yes + resource_group: "{{ resource_group }}" + name: "{{ cdnprofilename }}" + sku: standard_verizon + tags: + testing: testing + delete: on-exit + foo: bar + check_mode: true - name: Check there is no CDN profile created azure_rm_cdnprofile_info: - resource_group: "{{ resource_group }}" - name: "{{ cdnprofilename }}" + resource_group: "{{ resource_group }}" + name: "{{ cdnprofilename }}" register: fact - name: Check there is no CDN profile created - assert: { that: "{{ fact.cdnprofiles | length }} == 0" } + ansible.builtin.assert: + { that: "{{ fact.cdnprofiles | length }} == 0" } - name: Create a CDN profile azure_rm_cdnprofile: - resource_group: "{{ resource_group }}" - name: "{{ cdnprofilename }}" - sku: standard_akamai - tags: - testing: testing - delete: on-exit - foo: bar + resource_group: "{{ resource_group }}" + name: "{{ cdnprofilename }}" + sku: standard_verizon + tags: + testing: testing + delete: on-exit + foo: bar register: output - name: Assert the CDN profile is well created - assert: + ansible.builtin.assert: that: - output.changed - output.id != '' - name: Gather CDN profile facts azure_rm_cdnprofile_info: - resource_group: "{{ resource_group }}" - name: "{{ cdnprofilename }}" + resource_group: "{{ resource_group }}" + name: "{{ cdnprofilename }}" register: fact - name: Assert fact returns the created one - assert: - that: - - "fact.cdnprofiles | length == 1" - - fact.cdnprofiles[0].sku == 'Standard_Akamai' - - fact.cdnprofiles[0].tags.foo == 'bar' + ansible.builtin.assert: + that: + - "fact.cdnprofiles | length == 1" + - fact.cdnprofiles[0].sku == 'Standard_Verizon' + - fact.cdnprofiles[0].tags.foo == 'bar' - name: Create a CDN profile (idempotent) azure_rm_cdnprofile: - resource_group: "{{ resource_group }}" - name: "{{ cdnprofilename }}" - sku: standard_akamai - tags: - testing: testing - delete: on-exit - foo: bar + resource_group: "{{ resource_group }}" + name: "{{ cdnprofilename }}" + sku: standard_verizon + tags: + testing: testing + delete: on-exit + foo: bar register: output - name: Assert idempotent - assert: + ansible.builtin.assert: that: - not output.changed - name: Update the CDN profile azure_rm_cdnprofile: - resource_group: "{{ resource_group }}" - name: "{{ cdnprofilename }}" - sku: standard_akamai - tags: - testing: testing - delete: on-exit - foo: bar - baz: qux + resource_group: "{{ resource_group }}" + name: "{{ cdnprofilename }}" + sku: standard_verizon + tags: + testing: testing + delete: on-exit + foo: bar + baz: qux register: output - name: Assert the CDN profile is updated - assert: + ansible.builtin.assert: that: - output.changed @@ -93,65 +94,65 @@ resource_group: "{{ resource_group }}" name: "{{ cdnprofilename }}" state: absent - check_mode: yes + check_mode: true - name: Gather CDN profile facts azure_rm_cdnprofile_info: - resource_group: "{{ resource_group }}" - name: "{{ cdnprofilename }}" + resource_group: "{{ resource_group }}" + name: "{{ cdnprofilename }}" register: fact - name: Assert the CDN is still there - assert: - that: - - "fact.cdnprofiles | length == 1" - - fact.cdnprofiles[0].sku == 'Standard_Akamai' - - fact.cdnprofiles[0].tags.foo == 'bar' - - fact.cdnprofiles[0].tags.baz == 'qux' + ansible.builtin.assert: + that: + - "fact.cdnprofiles | length == 1" + - fact.cdnprofiles[0].sku == 'Standard_Verizon' + - fact.cdnprofiles[0].tags.foo == 'bar' + - fact.cdnprofiles[0].tags.baz == 'qux' - name: Create a Azure CDN endpoint(check mode) azure_rm_cdnendpoint: - resource_group: "{{ resource_group }}" - name: "{{ endpointname }}" - profile_name: "{{ cdnprofilename }}" - origins: - - name: "org{{ endpointname }}" - host_name: "www.google.com" - tags: - testing: testing - delete: on-exit - foo: bar - check_mode: yes + resource_group: "{{ resource_group }}" + name: "{{ endpointname }}" + profile_name: "{{ cdnprofilename }}" + origins: + - name: "org{{ endpointname }}" + host_name: "www.google.com" + tags: + testing: testing + delete: on-exit + foo: bar + check_mode: true - name: Create a Azure CDN endpoint azure_rm_cdnendpoint: - resource_group: "{{ resource_group }}" - name: "{{ endpointname }}" - profile_name: "{{ cdnprofilename }}" - origins: - - name: "org{{ endpointname }}" - host_name: "www.google.com" - tags: - testing: testing - delete: on-exit - foo: bar + resource_group: "{{ resource_group }}" + name: "{{ endpointname }}" + profile_name: "{{ cdnprofilename }}" + origins: + - name: "org{{ endpointname }}" + host_name: "www.google.com" + tags: + testing: testing + delete: on-exit + foo: bar register: output - name: Assert the Azure CDN endpoint is well created - assert: + ansible.builtin.assert: that: - output.changed - output.id - name: Get facts of a Azure CDN endpoint azure_rm_cdnendpoint_info: - resource_group: "{{ resource_group }}" - name: "{{ endpointname }}" - profile_name: "{{ cdnprofilename }}" + resource_group: "{{ resource_group }}" + name: "{{ endpointname }}" + profile_name: "{{ cdnprofilename }}" register: facts - name: Assert facts output - assert: + ansible.builtin.assert: that: - facts['cdnendpoints'] | length == 1 - facts['cdnendpoints'][0]['id'] @@ -164,93 +165,93 @@ - name: Create a Azure CDN endpoint(idempotent) azure_rm_cdnendpoint: - resource_group: "{{ resource_group }}" - name: "{{ endpointname }}" - profile_name: "{{ cdnprofilename }}" - origins: - - name: "org{{ endpointname }}" - host_name: "www.google.com" - tags: - testing: testing - delete: on-exit - foo: bar + resource_group: "{{ resource_group }}" + name: "{{ endpointname }}" + profile_name: "{{ cdnprofilename }}" + origins: + - name: "org{{ endpointname }}" + host_name: "www.google.com" + tags: + testing: testing + delete: on-exit + foo: bar register: output - name: Assert idempotent - assert: + ansible.builtin.assert: that: - not output.changed - name: Stop a Azure CDN endpoint azure_rm_cdnendpoint: - resource_group: "{{ resource_group }}" - name: "{{ endpointname }}" - profile_name: "{{ cdnprofilename }}" - started: False + resource_group: "{{ resource_group }}" + name: "{{ endpointname }}" + profile_name: "{{ cdnprofilename }}" + started: false register: output - name: Assert stopped - assert: + ansible.builtin.assert: that: - output.changed - name: Stop a Azure CDN endpoint(idempotent) azure_rm_cdnendpoint: - resource_group: "{{ resource_group }}" - name: "{{ endpointname }}" - profile_name: "{{ cdnprofilename }}" - started: False + resource_group: "{{ resource_group }}" + name: "{{ endpointname }}" + profile_name: "{{ cdnprofilename }}" + started: false register: output - name: Assert still stopped and not changed - assert: + ansible.builtin.assert: that: - not output.changed - name: Start a Azure CDN endpoint azure_rm_cdnendpoint: - resource_group: "{{ resource_group }}" - name: "{{ endpointname }}" - profile_name: "{{ cdnprofilename }}" - started: True + resource_group: "{{ resource_group }}" + name: "{{ endpointname }}" + profile_name: "{{ cdnprofilename }}" + started: true register: output - name: Assert started - assert: + ansible.builtin.assert: that: - output.changed - name: Update the Azure CDN endpoint azure_rm_cdnendpoint: - resource_group: "{{ resource_group }}" - name: "{{ endpointname }}" - profile_name: "{{ cdnprofilename }}" - origin_path: /test/ - tags: - testing: testing - delete: on-exit - foo: baz + resource_group: "{{ resource_group }}" + name: "{{ endpointname }}" + profile_name: "{{ cdnprofilename }}" + origin_path: /test/ + tags: + testing: testing + delete: on-exit + foo: baz register: output - name: Assert the Azure CDN endpoint is updated - assert: + ansible.builtin.assert: that: - output.changed - name: Delete a Azure CDN endpoint(check mode) azure_rm_cdnendpoint: - resource_group: "{{ resource_group }}" - name: "{{ endpointname }}" - profile_name: "{{ cdnprofilename }}" - state: absent - check_mode: yes + resource_group: "{{ resource_group }}" + name: "{{ endpointname }}" + profile_name: "{{ cdnprofilename }}" + state: absent + check_mode: true - name: Delete a Azure CDN endpoint azure_rm_cdnendpoint: - resource_group: "{{ resource_group }}" - name: "{{ endpointname }}" - profile_name: "{{ cdnprofilename }}" - state: absent + resource_group: "{{ resource_group }}" + name: "{{ endpointname }}" + profile_name: "{{ cdnprofilename }}" + state: absent - name: Delete the CDN profile azure_rm_cdnprofile: @@ -260,17 +261,17 @@ register: output - name: Assert the CDN profile is well deleted - assert: + ansible.builtin.assert: that: - output.changed - name: Get CDN profile fact azure_rm_cdnprofile_info: - resource_group: "{{ resource_group }}" - name: "{{ cdnprofilename }}" + resource_group: "{{ resource_group }}" + name: "{{ cdnprofilename }}" register: fact - name: Assert fact returns empty - assert: + ansible.builtin.assert: that: - "fact.cdnprofiles | length == 0" diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_cognitivesearch/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_cognitivesearch/tasks/main.yml index fefad59a8..bcc19ced0 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_cognitivesearch/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_cognitivesearch/tasks/main.yml @@ -1,5 +1,5 @@ - name: Create Azure Search name - set_fact: + ansible.builtin.set_fact: search_name: "search{{ resource_group | hash('md5') | truncate(16, True, '') }}" search_name_secondary: "search{{ resource_group | hash('md5') | truncate(16, True, '') }}-secondary" @@ -9,11 +9,11 @@ resource_group: "{{ resource_group }}" hosting_mode: highDensity register: invalid_hosting_name - ignore_errors: yes + ignore_errors: true - name: Assert task failed - assert: - that: + ansible.builtin.assert: + that: - invalid_hosting_name.failed == True - name: Create invalid Azure Search - Partition Count High Density @@ -24,11 +24,11 @@ hosting_mode: highDensity partition_count: 4 register: invalid_partition_count - ignore_errors: yes + ignore_errors: true - name: Assert task failed - assert: - that: + ansible.builtin.assert: + that: - invalid_partition_count.failed == True - name: Create invalid Azure Search - Partition Count @@ -37,11 +37,11 @@ resource_group: "{{ resource_group }}" partition_count: 7 register: invalid_partition_count - ignore_errors: yes + ignore_errors: true - name: Assert task failed - assert: - that: + ansible.builtin.assert: + that: - invalid_partition_count.failed == True - name: Create invalid Azure Search - Replica Count @@ -51,11 +51,11 @@ sku: standard replica_count: 13 register: invalid_replica_count - ignore_errors: yes + ignore_errors: true - name: Assert task failed - assert: - that: + ansible.builtin.assert: + that: - invalid_replica_count.failed == True - name: Create invalid Azure Search - Replica Count SKU basic @@ -65,11 +65,11 @@ replica_count: 4 sku: basic register: invalid_replica_count - ignore_errors: yes + ignore_errors: true - name: Assert task failed - assert: - that: + ansible.builtin.assert: + that: - invalid_replica_count.failed == True - name: Create basic Azure Search @@ -79,7 +79,7 @@ register: search_info - name: Assert status succeeded and results - assert: + ansible.builtin.assert: that: - search_info.changed - search_info.state.id is defined @@ -101,7 +101,7 @@ register: search_info_module - name: Assert status succeeded and results - assert: + ansible.builtin.assert: that: - search_info_module.search.id is defined - search_info_module.search.identity.type == "None" @@ -122,7 +122,7 @@ register: search_info - name: Assert that idempotence is ok - assert: + ansible.builtin.assert: that: - not search_info.changed @@ -132,7 +132,7 @@ resource_group: "{{ resource_group }}" state: absent -- name: Create Azure Search '{{ search_name }}' not default parameters +- name: Create Azure Search not default parameters azure_rm_cognitivesearch: name: "{{ search_name_secondary }}" resource_group: "{{ resource_group }}" @@ -150,7 +150,7 @@ register: search_info - name: Assert status succeeded and results - assert: + ansible.builtin.assert: that: - search_info.changed - search_info.state.id is defined @@ -164,7 +164,7 @@ - search_info.state.provisioning_state == "succeeded" - search_info.state.status == "running" -- name: Update Azure Search '{{ search_name }}' not default parameters (Idempotence) +- name: Update Azure Search not default parameters (Idempotence) azure_rm_cognitivesearch: name: "{{ search_name_secondary }}" resource_group: "{{ resource_group }}" @@ -182,7 +182,7 @@ register: search_info - name: Assert that idempotence is ok - assert: + ansible.builtin.assert: that: - not search_info.changed @@ -191,4 +191,3 @@ name: "{{ search_name_secondary }}" resource_group: "{{ resource_group }}" state: absent - diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_containerinstance/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_containerinstance/tasks/main.yml index 44bb852a5..d8bd5f36e 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_containerinstance/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_containerinstance/tasks/main.yml @@ -1,5 +1,5 @@ - name: Set Container Instance Names - set_fact: + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - name: Create sample container instance @@ -20,11 +20,12 @@ - 81 register: output -- debug: +- name: Print the created results + ansible.builtin.debug: var: output - name: Assert the container instance is well created - assert: + ansible.builtin.assert: that: - output.changed - output.provisioning_state == 'Succeeded' @@ -48,7 +49,7 @@ register: output - name: Assert the container instance is well created - assert: + ansible.builtin.assert: that: - output.changed == False @@ -68,11 +69,11 @@ ports: - 80 - 81 - force_update: yes + force_update: true register: output - name: Assert the container instance is well created - assert: + ansible.builtin.assert: that: - output.changed - output.provisioning_state == 'Succeeded' @@ -142,7 +143,7 @@ register: output - name: Assert the container instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -150,13 +151,14 @@ azure_rm_containerinstance_info: resource_group: "{{ resource_group }}" name: "aci{{ rpfx }}sec" - register: output + register: output -- debug: +- name: Print the container instance facts + ansible.builtin.debug: var: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.containerinstances[0]['resource_group'] != None @@ -175,7 +177,7 @@ register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.containerinstances[0]['resource_group'] != None @@ -219,32 +221,37 @@ share_name: "{{ file_share_name }}" storage_account_key: "{{ storage_account_key }}" register: output - ignore_errors: True + ignore_errors: true -- debug: +- name: Print failed return + ansible.builtin.debug: var: output - ignore_errors: True + ignore_errors: true + register: ignore_errors_register - name: Assert the container instance is well created - assert: + ansible.builtin.assert: that: - output.changed - output.provisioning_state == 'Succeeded' - ignore_errors: True + register: ignore_errors_register + ignore_errors: true - name: Gather facts for Container Instance azure_rm_containerinstance_info: resource_group: "{{ resource_group }}" name: "aci{{ rpfx }}thi" register: output - ignore_errors: True + ignore_errors: true -- debug: +- name: Assert the container instance facts + ansible.builtin.debug: var: output - ignore_errors: True + ignore_errors: true + register: ignore_errors_register - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.containerinstances[0]['resource_group'] != None @@ -258,7 +265,8 @@ - output.containerinstances[0]['containers'][0]['volume_mounts'] | length == 1 - output.containerinstances[0]['containers'][0]['volume_mounts'][0]['name'] != None - output.containerinstances[0]['containers'][0]['volume_mounts'][0]['mount_path'] != None - ignore_errors: True + ignore_errors: true + register: ignore_errors_register - name: Remove container instance azure_rm_containerinstance: @@ -287,7 +295,7 @@ storage_account_key: "{{ storage_account_key }}" state: absent register: output - ignore_errors: True + ignore_errors: true - name: Remove container instance azure_rm_containerinstance: @@ -309,7 +317,7 @@ register: output - name: Assert the container instance is deleted - assert: + ansible.builtin.assert: that: - output.changed @@ -351,6 +359,6 @@ register: output - name: Assert the changed is false - assert: + ansible.builtin.assert: that: - output.changed == False diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_containerregistry/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_containerregistry/tasks/main.yml index 7c83c5c5d..b474b0e1f 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_containerregistry/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_containerregistry/tasks/main.yml @@ -1,116 +1,116 @@ - - name: Create an container registry - azure_rm_containerregistry: - name: "acr{{ resource_group | hash('md5') | truncate(7, True, '') }}" - resource_group: "{{ resource_group }}" - location: eastus2 - admin_user_enabled: true - sku: Premium - tags: - Release: beta1 - Environment: Production - register: output +- name: Create an container registry + azure_rm_containerregistry: + name: "acr{{ resource_group | hash('md5') | truncate(7, True, '') }}" + resource_group: "{{ resource_group }}" + location: eastus2 + admin_user_enabled: true + sku: Premium + tags: + Release: beta1 + Environment: Production + register: output - - name: Assert the container registry instance is well created - assert: - that: - - output.changed - - output.admin_user_enabled - - output.location == 'eastus2' - - output.sku == 'Premium' - - output.tags['Environment'] == 'Production' - - output.tags['Release'] == 'beta1' - - output.provisioning_state == 'Succeeded' - - output.credentials['password'] is defined - - output.credentials['password2'] is defined +- name: Assert the container registry instance is well created + ansible.builtin.assert: + that: + - output.changed + - output.admin_user_enabled + - output.location == 'eastus2' + - output.sku == 'Premium' + - output.tags['Environment'] == 'Production' + - output.tags['Release'] == 'beta1' + - output.provisioning_state == 'Succeeded' + - output.credentials['password'] is defined + - output.credentials['password2'] is defined - - name: Update the ACR instance sku, tags and admin_user_enabled - azure_rm_containerregistry: - name: "acr{{ resource_group | hash('md5') | truncate(7, True, '') }}" - resource_group: "{{ resource_group }}" - location: eastus2 - admin_user_enabled: false - sku: Standard - tags: - NewTag: newtag - Release: beta1 - Environment: Production - register: output +- name: Update the ACR instance sku, tags and admin_user_enabled + azure_rm_containerregistry: + name: "acr{{ resource_group | hash('md5') | truncate(7, True, '') }}" + resource_group: "{{ resource_group }}" + location: eastus2 + admin_user_enabled: false + sku: Standard + tags: + NewTag: newtag + Release: beta1 + Environment: Production + register: output - - name: Create second container registry (to test facts) - azure_rm_containerregistry: - name: "acr{{ resource_group | hash('md5') | truncate(7, True, '') }}sec" - resource_group: "{{ resource_group }}" - location: eastus2 - admin_user_enabled: false - sku: Premium - tags: - Release: beta1 - Environment: Production +- name: Create second container registry (to test facts) + azure_rm_containerregistry: + name: "acr{{ resource_group | hash('md5') | truncate(7, True, '') }}sec" + resource_group: "{{ resource_group }}" + location: eastus2 + admin_user_enabled: false + sku: Premium + tags: + Release: beta1 + Environment: Production - - name: Assert the ACR instance is well updated - assert: - that: - - output.changed == True - - output.admin_user_enabled == False - - output.sku == 'Standard' - - output.tags['NewTag'] == 'newtag' - - output.credentials | length == 0 - - output.credentials['password'] is not defined - - output.credentials['password2'] is not defined +- name: Assert the ACR instance is well updated + ansible.builtin.assert: + that: + - output.changed == True + - output.admin_user_enabled == False + - output.sku == 'Standard' + - output.tags['NewTag'] == 'newtag' + - output.credentials | length == 0 + - output.credentials['password'] is not defined + - output.credentials['password2'] is not defined - - name: Gather facts for single Container Registry - azure_rm_containerregistry_info: - resource_group: "{{ resource_group }}" - name: "acr{{ resource_group | hash('md5') | truncate(7, True, '') }}" - register: output +- name: Gather facts for single Container Registry + azure_rm_containerregistry_info: + resource_group: "{{ resource_group }}" + name: "acr{{ resource_group | hash('md5') | truncate(7, True, '') }}" + register: output - - name: Assert that facts are returned - assert: - that: - - output.changed == False - - output.registries[0]['name'] != None - - output.registries[0]['location'] != None - - output.registries[0]['admin_user_enabled'] != None - - output.registries[0]['sku'] != None - - output.registries[0]['provisioning_state'] != None - - output.registries[0]['login_server'] != None - - output.registries[0]['id'] != None - - output.registries[0]['credentials'] != None +- name: Assert that facts are returned + ansible.builtin.assert: + that: + - output.changed == False + - output.registries[0]['name'] != None + - output.registries[0]['location'] != None + - output.registries[0]['admin_user_enabled'] != None + - output.registries[0]['sku'] != None + - output.registries[0]['provisioning_state'] != None + - output.registries[0]['login_server'] != None + - output.registries[0]['id'] != None + - output.registries[0]['credentials'] != None - - name: Gather facts for all Container Registries in the resource group - azure_rm_containerregistry_info: - resource_group: "{{ resource_group }}" - register: output +- name: Gather facts for all Container Registries in the resource group + azure_rm_containerregistry_info: + resource_group: "{{ resource_group }}" + register: output - - name: Assert that facts are returned - assert: - that: - - output.changed == False - - output.registries[0]['name'] != None - - output.registries[0]['location'] != None - - output.registries[0]['admin_user_enabled'] != None - - output.registries[0]['sku'] != None - - output.registries[0]['provisioning_state'] != None - - output.registries[0]['login_server'] != None - - output.registries[0]['id'] != None - - output.registries[0]['credentials'] != None - - output.registries[1]['name'] != None - - output.registries[1]['location'] != None - - output.registries[1]['admin_user_enabled'] != None - - output.registries[1]['sku'] != None - - output.registries[1]['provisioning_state'] != None - - output.registries[1]['login_server'] != None - - output.registries[1]['id'] != None - - output.registries[1]['credentials'] != None +- name: Assert that facts are returned + ansible.builtin.assert: + that: + - output.changed == False + - output.registries[0]['name'] != None + - output.registries[0]['location'] != None + - output.registries[0]['admin_user_enabled'] != None + - output.registries[0]['sku'] != None + - output.registries[0]['provisioning_state'] != None + - output.registries[0]['login_server'] != None + - output.registries[0]['id'] != None + - output.registries[0]['credentials'] != None + - output.registries[1]['name'] != None + - output.registries[1]['location'] != None + - output.registries[1]['admin_user_enabled'] != None + - output.registries[1]['sku'] != None + - output.registries[1]['provisioning_state'] != None + - output.registries[1]['login_server'] != None + - output.registries[1]['id'] != None + - output.registries[1]['credentials'] != None - - name: Delete first container registry - azure_rm_containerregistry: - name: "acr{{ resource_group | hash('md5') | truncate(7, True, '') }}" - resource_group: "{{ resource_group }}" - state: absent +- name: Delete first container registry + azure_rm_containerregistry: + name: "acr{{ resource_group | hash('md5') | truncate(7, True, '') }}" + resource_group: "{{ resource_group }}" + state: absent - - name: Delete second container registry - azure_rm_containerregistry: - name: "acr{{ resource_group | hash('md5') | truncate(7, True, '') }}sec" - resource_group: "{{ resource_group }}" - state: absent +- name: Delete second container registry + azure_rm_containerregistry: + name: "acr{{ resource_group | hash('md5') | truncate(7, True, '') }}sec" + resource_group: "{{ resource_group }}" + state: absent diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_containerregistrytag/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_containerregistrytag/tasks/main.yml index 6f90bcddf..eec64c3bb 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_containerregistrytag/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_containerregistrytag/tasks/main.yml @@ -1,5 +1,5 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" run_once: true @@ -16,7 +16,7 @@ registry: "acr{{ rpfx }}" register: output - name: Verify no tags exist - assert: + ansible.builtin.assert: that: output.repositories | length == 0 - name: Load all tags for non-existant repository @@ -25,7 +25,7 @@ repository_name: "does-not-exist" register: output - name: Verify no tags exist - assert: + ansible.builtin.assert: that: output.repositories | length == 0 - name: Import tag (check mode) @@ -40,7 +40,7 @@ check_mode: true register: output - name: Assert output - assert: + ansible.builtin.assert: that: output.changed - name: Import tag (actually import) @@ -54,7 +54,7 @@ name: "latest" register: output - name: Assert output - assert: + ansible.builtin.assert: that: output.changed - name: Import tag (test idempotency) @@ -68,7 +68,7 @@ name: "latest" register: output - name: Assert output - assert: + ansible.builtin.assert: that: not output.changed - name: Import additional tag @@ -82,7 +82,7 @@ name: "latest" register: output - name: Assert output - assert: + ansible.builtin.assert: that: output.changed - name: Import additional tag @@ -96,7 +96,7 @@ name: "latest" register: output - name: Assert output - assert: + ansible.builtin.assert: that: output.changed - name: Import additional tag @@ -110,7 +110,7 @@ name: "latest" register: output - name: Assert output - assert: + ansible.builtin.assert: that: output.changed - name: Load all tags @@ -118,7 +118,7 @@ registry: "acr{{ rpfx }}" register: output - name: Assert tags exist - assert: + ansible.builtin.assert: that: - output.repositories | length == 2 - output.repositories[0].name == 'app1' @@ -136,7 +136,7 @@ repository_name: "app2" register: output - name: Assert tags exist - assert: + ansible.builtin.assert: that: - output.repositories | length == 1 - output.repositories[0].name == 'app2' @@ -152,7 +152,7 @@ name: "test-image" register: output - name: Assert tags exist - assert: + ansible.builtin.assert: that: - output.repositories | length == 1 - output.repositories[0].name == 'app2' @@ -165,7 +165,7 @@ name: "v1" register: output - name: Assert tags exist - assert: + ansible.builtin.assert: that: - output.repositories | length == 2 - output.repositories[0].name == 'app1' @@ -184,7 +184,7 @@ check_mode: true register: output - name: Assert output - assert: + ansible.builtin.assert: that: output.changed - name: Delete tag by name (actually delete) @@ -195,7 +195,7 @@ state: "absent" register: output - name: Assert output - assert: + ansible.builtin.assert: that: output.changed - name: Delete tag by name (test idempotency) @@ -206,7 +206,7 @@ state: "absent" register: output - name: Assert output - assert: + ansible.builtin.assert: that: not output.changed - name: Load tags by repository @@ -215,7 +215,7 @@ repository_name: "app2" register: output - name: Assert tags exist - assert: + ansible.builtin.assert: that: - output.repositories | length == 1 - output.repositories[0].name == 'app2' @@ -231,7 +231,7 @@ check_mode: true register: output - name: Assert output - assert: + ansible.builtin.assert: that: output.changed - name: Delete repository (actually delete) @@ -241,7 +241,7 @@ state: "absent" register: output - name: Assert output - assert: + ansible.builtin.assert: that: output.changed - name: Delete repository (test idempotency) @@ -251,7 +251,7 @@ state: "absent" register: output - name: Assert output - assert: + ansible.builtin.assert: that: not output.changed - name: Load all tags @@ -259,7 +259,7 @@ registry: "acr{{ rpfx }}" register: output - name: Assert tags exist - assert: + ansible.builtin.assert: that: - output.repositories | length == 1 - output.repositories[0].name == 'app1' @@ -275,7 +275,7 @@ name: "latest" register: output - name: Assert output - assert: + ansible.builtin.assert: that: output.changed - name: Import tag with same name (test idempotency) @@ -287,7 +287,7 @@ name: "latest" register: output - name: Assert output - assert: + ansible.builtin.assert: that: not output.changed - name: Import tag with different repo, same name @@ -300,7 +300,7 @@ name: "latest" register: output - name: Assert output - assert: + ansible.builtin.assert: that: output.changed - name: Import tag with different repo, same name (test idempotency) @@ -313,7 +313,7 @@ name: "latest" register: output - name: Assert output - assert: + ansible.builtin.assert: that: not output.changed - name: Import tag with different name, same repo @@ -326,7 +326,7 @@ name: "latest" register: output - name: Assert output - assert: + ansible.builtin.assert: that: output.changed - name: Import tag with different name, same repo (test idempotency) @@ -339,7 +339,7 @@ name: "latest" register: output - name: Assert output - assert: + ansible.builtin.assert: that: not output.changed - name: Load all tags @@ -347,7 +347,7 @@ registry: "acr{{ rpfx }}" register: output - name: Assert tags exist - assert: + ansible.builtin.assert: that: - output.repositories | length == 2 - output.repositories[0].name == 'app1' diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_cosmosdbaccount/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_cosmosdbaccount/tasks/main.yml index ca1cc8b90..5e1f3f4d8 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_cosmosdbaccount/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_cosmosdbaccount/tasks/main.yml @@ -1,11 +1,11 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: dbname: "cosmos-{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" db2name: "cosmos2-{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" vnname: "vn{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" subnetname: "subnet{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" free_tier_supported: false # https://github.com/ansible-collections/azure/pull/675#discussion_r843584406 - run_once: yes + run_once: true - name: Create virtual network azure_rm_virtualnetwork: @@ -34,10 +34,10 @@ - name: eastasia failover_priority: 0 database_account_offer_type: Standard - check_mode: yes + check_mode: true register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -53,16 +53,16 @@ - name: westus failover_priority: 1 database_account_offer_type: Standard - is_virtual_network_filter_enabled: yes + is_virtual_network_filter_enabled: true virtual_network_rules: - subnet: resource_group: "{{ resource_group }}" virtual_network_name: "{{ vnname }}" subnet_name: "{{ subnetname }}" - ignore_missing_v_net_service_endpoint: yes + ignore_missing_v_net_service_endpoint: true register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -78,16 +78,16 @@ - name: westus failover_priority: 1 database_account_offer_type: Standard - is_virtual_network_filter_enabled: yes + is_virtual_network_filter_enabled: true virtual_network_rules: - subnet: resource_group: "{{ resource_group }}" virtual_network_name: "{{ vnname }}" subnet_name: "{{ subnetname }}" - ignore_missing_v_net_service_endpoint: yes + ignore_missing_v_net_service_endpoint: true register: output - name: Assert the state has not changed - assert: + ansible.builtin.assert: that: - output.changed == false @@ -103,17 +103,17 @@ - name: westus failover_priority: 1 database_account_offer_type: Standard - is_virtual_network_filter_enabled: yes + is_virtual_network_filter_enabled: true virtual_network_rules: - subnet: resource_group: "{{ resource_group }}" virtual_network_name: "{{ vnname }}" subnet_name: "{{ subnetname }}" - ignore_missing_v_net_service_endpoint: yes - enable_automatic_failover: yes + ignore_missing_v_net_service_endpoint: true + enable_automatic_failover: true register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -129,16 +129,16 @@ - name: westus failover_priority: 1 database_account_offer_type: Standard - is_virtual_network_filter_enabled: yes + is_virtual_network_filter_enabled: true virtual_network_rules: - subnet: resource_group: "{{ resource_group }}" virtual_network_name: "{{ vnname }}" subnet_name: "{{ subnetname }}" - ignore_missing_v_net_service_endpoint: yes + ignore_missing_v_net_service_endpoint: true register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -148,7 +148,7 @@ name: "{{ dbname }}" register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.accounts | length == 1 @@ -184,7 +184,7 @@ retrieve_keys: all register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.accounts[0]['primary_master_key'] != None @@ -197,10 +197,10 @@ resource_group: "{{ resource_group }}" name: "{{ dbname }}" retrieve_keys: readonly - retrieve_connection_strings: yes + retrieve_connection_strings: true register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - "'primary_master_key' not in output.accounts[0]" @@ -214,7 +214,7 @@ resource_group: "{{ resource_group }}" register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.accounts | length == 1 @@ -247,7 +247,7 @@ azure_rm_cosmosdbaccount_info: register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.accounts | length >= 2 @@ -272,17 +272,17 @@ - name: westus failover_priority: 1 database_account_offer_type: Standard - is_virtual_network_filter_enabled: yes + is_virtual_network_filter_enabled: true virtual_network_rules: - subnet: resource_group: "{{ resource_group }}" virtual_network_name: "{{ vnname }}" subnet_name: "{{ subnetname }}" - ignore_missing_v_net_service_endpoint: yes - enable_automatic_failover: yes + ignore_missing_v_net_service_endpoint: true + enable_automatic_failover: true register: output - name: Assert resource created - assert: + ansible.builtin.assert: that: - output.changed @@ -292,7 +292,7 @@ name: "{{ dbname }}-free4" register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.accounts[0]['mongo_version'] == '4.0' - output.accounts[0]['enable_free_tier'] == free_tier_supported @@ -307,10 +307,10 @@ resource_group: "{{ resource_group }}" name: "{{ dbname }}" state: absent - check_mode: yes + check_mode: true register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -321,7 +321,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -332,7 +332,7 @@ state: absent register: output - name: Assert the state has not changed - assert: + ansible.builtin.assert: that: - output.changed == false @@ -343,7 +343,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -354,7 +354,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_datafactory/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_datafactory/tasks/main.yml index 25afbe8bb..5e6295247 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_datafactory/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_datafactory/tasks/main.yml @@ -1,76 +1,79 @@ - name: Create data factory name - set_fact: - name: "df{{ resource_group | hash('md5') | truncate(21, True, '') }}" + ansible.builtin.set_fact: + name_rpfx: "df{{ resource_group | hash('md5') | truncate(21, True, '') }}" - name: Create data factory (Checkmode) azure_rm_datafactory: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" public_network_access: Enabled tags: key1: value1 - check_mode: True + check_mode: true -- name: Create data factory +- name: Create data factory azure_rm_datafactory: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" public_network_access: Enabled tags: key1: value1 register: output -- assert: +- name: Assert the data factory created + ansible.builtin.assert: that: - output.changed - name: Create data factory again (Idempotent test) azure_rm_datafactory: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" public_network_access: Enabled tags: key1: value1 register: output -- assert: +- name: Assert the idempotent success + ansible.builtin.assert: that: - not output.changed - name: Update data factory azure_rm_datafactory: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" public_network_access: Disabled tags: key1: value1 key2: value2 register: output -- assert: +- name: Assert the data factory updated + ansible.builtin.assert: that: - output.changed - name: Get data factory info azure_rm_datafactory_info: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" register: output - name: Assert status succeed and result match expectations - assert: + ansible.builtin.assert: that: - output.datafactory[0].tags | length == 2 - output.datafactory[0].public_network_access == 'Disabled' - - name: Delete data factory azure_rm_datafactory: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" state: absent register: output -- assert: +- name: Assert the data factory deleted + ansible.builtin.assert: that: - output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_datalakestore/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_datalakestore/tasks/main.yml index 1b9e2409b..c72dfc2ce 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_datalakestore/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_datalakestore/tasks/main.yml @@ -1,5 +1,5 @@ - name: Create data lake store name - set_fact: + ansible.builtin.set_fact: adl_name: "adl{{ resource_group_datalake | hash('md5') | truncate(21, True, '') }}" vnet_name: "vnet{{ resource_group_datalake | hash('md5') | truncate(20, True, '') }}" @@ -28,7 +28,7 @@ register: output - name: Assert status succeeded and results - assert: + ansible.builtin.assert: that: - output.changed - output.state.id is defined @@ -52,7 +52,7 @@ register: output - name: Assert that status has not changed - assert: + ansible.builtin.assert: that: - not output.changed @@ -66,7 +66,7 @@ register: output - name: Assert status succeeded and results include virtual_network_rules - assert: + ansible.builtin.assert: that: - output.changed - output.state.virtual_network_rules | length == 1 @@ -79,13 +79,13 @@ name: "{{ adl_name }}" encryption_state: Disabled register: output - ignore_errors: yes + ignore_errors: true - name: Assert that encryption state cannot change - assert: - that: - - not output.changed - - output.msg == 'Encryption type cannot be updated.' + ansible.builtin.assert: + that: + - not output.changed + - output.msg == 'Encryption type cannot be updated.' - name: Update data lake store to add new_tier azure_rm_datalakestore: @@ -95,7 +95,7 @@ register: output - name: Assert status succeeded and results include virtual_network_rules - assert: + ansible.builtin.assert: that: - output.changed - output.state.current_tier == "Consumption" @@ -122,12 +122,10 @@ firewall_state: Enabled firewall_allow_azure_ips: Enabled firewall_rules: - - - name: test_rule_1 + - name: test_rule_1 start_ip_address: 192.168.1.1 end_ip_address: 192.168.1.254 - - - name: test_rule_2 + - name: test_rule_2 start_ip_address: 10.0.0.1 end_ip_address: 10.1.0.1 virtual_network_rules: @@ -135,8 +133,8 @@ subnet_id: "{{ subnet_output.state.id }}" register: output -- name: Assert status succeeded and results include an Id value - assert: +- name: Assert status succeeded and results include an Id value + ansible.builtin.assert: that: - output.changed - output.state.id is defined @@ -172,12 +170,10 @@ firewall_state: Enabled firewall_allow_azure_ips: Enabled firewall_rules: - - - name: test_rule_1 + - name: test_rule_1 start_ip_address: 192.168.1.1 end_ip_address: 192.168.1.254 - - - name: test_rule_2 + - name: test_rule_2 start_ip_address: 10.0.0.1 end_ip_address: 10.1.0.1 virtual_network_rules: @@ -186,7 +182,7 @@ register: output - name: Assert that status has not changed - assert: + ansible.builtin.assert: that: - not output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_ddosprotectionplan/meta/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_ddosprotectionplan/meta/main.yml index cf34ae763..50fd77acf 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_ddosprotectionplan/meta/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_ddosprotectionplan/meta/main.yml @@ -1,2 +1,2 @@ dependencies: - - setup_azure
\ No newline at end of file + - setup_azure diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_ddosprotectionplan/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_ddosprotectionplan/tasks/main.yml index a61003680..f51a7b91c 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_ddosprotectionplan/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_ddosprotectionplan/tasks/main.yml @@ -1,16 +1,17 @@ - name: Create random ddos protection plan - set_fact: - ddosprotectionplan: "test{{ resource_group | hash('md5') | truncate(16, True, '') + (65535 | random | string) }}" + ansible.builtin.set_fact: + ddosprotectionplan: "test{{ resource_group | hash('md5') | truncate(16, True, '') + (65535 | random | string) }}" - name: Create DDoS protection plan (check mode) azure_rm_ddosprotectionplan: location: eastus2 name: "{{ ddosprotectionplan }}" resource_group: "{{ resource_group }}" - check_mode: yes + check_mode: true register: results -- assert: +- name: Assert the ddos protection check mode return + ansible.builtin.assert: that: results.changed - name: Create DDoS protection plan @@ -20,7 +21,8 @@ resource_group: "{{ resource_group }}" register: results -- assert: +- name: Assert the ddos protection created + ansible.builtin.assert: that: results.changed - name: Update DDoS protection plan @@ -32,8 +34,9 @@ test: modified register: results -- assert: - that: +- name: Assert the ddos protection updated + ansible.builtin.assert: + that: - results.changed - results.state.tags.test == 'modified' @@ -44,8 +47,8 @@ register: results - name: Assert that facts module returned result - assert: - that: + ansible.builtin.assert: + that: - results.ddosprotectionplan[0].tags.test == 'modified' - name: Test idempotent @@ -55,7 +58,8 @@ resource_group: "{{ resource_group }}" register: results -- assert: +- name: Assert the ddos protection created + ansible.builtin.assert: that: - not results.changed @@ -78,5 +82,6 @@ state: absent register: results -- assert: +- name: Assert the ddos protection plan deleted + ansible.builtin.assert: that: not results.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_deployment/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_deployment/tasks/main.yml index 7e83a4c28..f2ed58b15 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_deployment/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_deployment/tasks/main.yml @@ -1,5 +1,5 @@ - name: Create random dns label - set_fact: + ansible.builtin.set_fact: dns_label: "test{{ resource_group | hash('md5') | truncate(16, True, '') + (65535 | random | string) }}" - name: Error Create Azure Deploy @@ -18,7 +18,7 @@ ubuntuOSVersion: value: "Never-LTS" register: output - ignore_errors: yes + ignore_errors: true - name: Create Azure Deploy azure_rm_deployment: @@ -38,7 +38,7 @@ register: output - name: Add new instance to host group - add_host: + ansible.builtin.add_host: hostname: "{{ item.vm_name }}" ansible_host: "{{ item['ips'][0].public_ip }}" ansible_user: chouseknecht @@ -50,7 +50,8 @@ azure_rm_deployment_info: resource_group: "{{ resource_group }}" register: output -- debug: +- name: Print the deployment facts + ansible.builtin.debug: var: output - name: Get Deployment Facts for named deployment @@ -58,11 +59,12 @@ resource_group: "{{ resource_group }}" name: "{{ dns_label }}" register: output -- debug: +- name: Print the deployment facts + ansible.builtin.debug: var: output - name: Assert that values are returned - assert: + ansible.builtin.assert: that: - not output.changed - output.deployments[0]['provisioning_state'] != None diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_devtestlab/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_devtestlab/tasks/main.yml index 87d63ad88..47d32dc70 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_devtestlab/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_devtestlab/tasks/main.yml @@ -1,5 +1,5 @@ - name: Set devtest labe value - set_fact: + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(20, True, '') }}" - name: Create a DevTest Lab (check mode) @@ -10,7 +10,7 @@ premium_data_disks: true tags: key1: value1 - check_mode: yes + check_mode: true - name: Create a DevTest Lab azure_rm_devtestlab: @@ -23,7 +23,7 @@ register: output - name: Check the devtest lab changed - assert: + ansible.builtin.assert: that: output.changed - name: Create a DevTest Lab (Idempotent test) @@ -37,7 +37,7 @@ register: output - name: Check the devtest lab not changed - assert: + ansible.builtin.assert: that: not output.changed - name: Get devtest lab facts @@ -45,9 +45,9 @@ resource_group: "{{ resource_group }}" name: "dev-{{ rpfx }}" register: output - + - name: Assert the devtest lab create success - assert: + ansible.builtin.assert: that: - output.labs | length == 1 - output.labs[0].provisioning_state == "Succeeded" @@ -63,7 +63,7 @@ register: output - name: Assert the devtest lab virtual network create successfully - assert: + ansible.builtin.assert: that: - output.changed @@ -75,7 +75,7 @@ register: output - name: Assert the devtest lab virtual network facts - assert: + ansible.builtin.assert: that: - output.virtualnetworks | length == 1 - output.virtualnetworks[0].description == "My Lab Virtual network" @@ -95,17 +95,17 @@ name: "vnet-{{ rpfx }}Subnet" virtual_network_name: "vnet-{{ rpfx }}" image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal publisher: Canonical - sku: 16.04-LTS + sku: 20_04-lts os_type: Linux version: latest - allow_claim: no + allow_claim: false expiration_date: "2025-10-22T01:49:12.117974Z" register: output - name: Assert the devtest lab virtual machine create successfully - assert: + ansible.builtin.assert: that: - output.changed @@ -117,13 +117,13 @@ register: output - name: Assert the devtest lab virtualmachine facts - assert: + ansible.builtin.assert: that: - output.virtualmachines | length == 1 - output.virtualmachines[0].provisioning_state == "Succeeded" - output.virtualmachines[0].expiration_date == "2025-10-22T01:49:12.117974Z" -- name: create a instance devtest lab image +- name: Create a instance devtest lab image azure_rm_devtestlabcustomimage: resource_group: "{{ resource_group }}" lab_name: "dev-{{ rpfx }}" @@ -133,7 +133,7 @@ register: output - name: Assert the devtest lab image create successufully - assert: + ansible.builtin.assert: that: - output.changed @@ -145,7 +145,7 @@ register: output - name: Assert the devtest lab image facts - assert: + ansible.builtin.assert: that: - output.custom_images | length == 1 - output.custom_images[0].lab_name @@ -157,9 +157,9 @@ lab_name: "dev-{{ rpfx }}" artifact_source_name: "public environment repo" register: output - + - name: Assert the devtest lab armtemplate is returned successfully - assert: + ansible.builtin.assert: that: - output.armtemplates | length >= 1 @@ -174,7 +174,7 @@ register: output - name: Assert the devtest lab policy creatre successfully - assert: + ansible.builtin.assert: that: - output.changed @@ -186,7 +186,7 @@ register: output - name: Assert the devtest lab policy facts - assert: + ansible.builtin.assert: that: - output.policies | length >= 1 @@ -200,7 +200,7 @@ register: output - name: Assert the devtest lab schedule create sussessfully - assert: + ansible.builtin.assert: that: - output.changed @@ -212,7 +212,7 @@ register: output - name: Assert the devtest lab schedule facts - assert: + ansible.builtin.assert: that: - output.schedules | length >= 1 - output.schedules[0].name == "lab_vms_shutdown" diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_diskencryptionset/lookup_plugins/azure_service_principal_attribute.py b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_diskencryptionset/lookup_plugins/azure_service_principal_attribute.py index 1b7d0318f..c6f488f13 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_diskencryptionset/lookup_plugins/azure_service_principal_attribute.py +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_diskencryptionset/lookup_plugins/azure_service_principal_attribute.py @@ -45,15 +45,13 @@ _raw: """ from ansible.errors import AnsibleError -from ansible.plugins import AnsiblePlugin from ansible.plugins.lookup import LookupBase from ansible.module_utils._text import to_native try: from azure.common.credentials import ServicePrincipalCredentials from azure.graphrbac import GraphRbacManagementClient - from msrestazure import azure_cloud - from msrestazure.azure_exceptions import CloudError + from azure.cli.core import cloud as azure_cloud except ImportError: raise AnsibleError( "The lookup azure_service_principal_attribute requires azure.graphrbac, msrest") @@ -89,6 +87,6 @@ class LookupModule(LookupBase): sp = response[0] return sp.object_id.split(',') - except CloudError as ex: + except Exception as ex: raise AnsibleError("Failed to get service principal object id: %s" % to_native(ex)) return False diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_diskencryptionset/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_diskencryptionset/tasks/main.yml index 79055e213..0d805598e 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_diskencryptionset/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_diskencryptionset/tasks/main.yml @@ -1,23 +1,23 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: set_name: "des{{ resource_group | hash('md5') | truncate(22, True, '') }}" rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" tenant_id: "{{ azure_tenant }}" - run_once: yes + run_once: true -- name: lookup service principal object id - set_fact: +- name: Lookup service principal object id + ansible.builtin.set_fact: object_id: "{{ lookup('azure_service_principal_attribute', azure_client_id=azure_client_id, azure_secret=azure_secret, azure_tenant=tenant_id) }}" register: object_id_facts -- name: create a key vault +- name: Create a key vault azure_rm_keyvault: resource_group: "{{ resource_group }}" vault_name: "myvault{{ rpfx }}" - enabled_for_disk_encryption: yes + enabled_for_disk_encryption: true vault_tenant: "{{ tenant_id }}" sku: name: standard @@ -50,10 +50,11 @@ name: testkey register: results -- set_fact: +- name: Assert the key vault facts + ansible.builtin.set_fact: key_url: "{{ results['keys'][0]['kid'] }}" -- name: create disk encryption set +- name: Create disk encryption set azure_rm_diskencryptionset: resource_group: "{{ resource_group }}" name: "{{ set_name }}" @@ -63,10 +64,10 @@ register: results - name: Assert that disk encryption set is created - assert: + ansible.builtin.assert: that: results.changed -- name: create disk encryption set (Idempotent test) +- name: Create disk encryption set (Idempotent test) azure_rm_diskencryptionset: resource_group: "{{ resource_group }}" name: "{{ set_name }}" @@ -76,7 +77,7 @@ register: results - name: Assert that output is not changed - assert: + ansible.builtin.assert: that: not results.changed - name: Update disk encryption set @@ -91,7 +92,7 @@ register: results - name: Assert that disk encryption set is updated - assert: + ansible.builtin.assert: that: results.changed - name: Get disk encryption set facts @@ -100,7 +101,8 @@ name: "{{ set_name }}" register: results -- assert: +- name: Assert the disk encryption facts + ansible.builtin.assert: that: - not results.changed - results.diskencryptionsets[0].id != None @@ -117,7 +119,7 @@ register: results - name: Assert that disk encryption set is deleted - assert: + ansible.builtin.assert: that: results.changed - name: Delete disk encryption set (Idempotent test) @@ -128,7 +130,7 @@ register: results - name: Asset that output is not changed - assert: + ansible.builtin.assert: that: not results.changed - name: Delete the Key Vault diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_dnsrecordset/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_dnsrecordset/tasks/main.yml index 6b9acee8d..4481a596e 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_dnsrecordset/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_dnsrecordset/tasks/main.yml @@ -1,5 +1,5 @@ - name: Create random domain name - set_fact: + ansible.builtin.set_fact: domain_name: "{{ resource_group | hash('md5') | truncate(16, True, '') + (65535 | random | string) }}" - name: Create a DNS zone @@ -10,10 +10,10 @@ register: results - name: Assert that DNS zone was created - assert: + ansible.builtin.assert: that: results.changed -- name: create "A" record set with multiple records +- name: Create "A" record set with multiple records azure_rm_dnsrecordset: resource_group: "{{ resource_group }}" relative_name: www @@ -26,10 +26,10 @@ register: results - name: Assert that A record set was created - assert: + ansible.builtin.assert: that: results.changed -- name: re-run "A" record with same values +- name: Re-run "A" record with same values azure_rm_dnsrecordset: resource_group: "{{ resource_group }}" relative_name: www @@ -42,7 +42,7 @@ register: results - name: Assert that A record set was not changed - assert: + ansible.builtin.assert: that: not results.changed - name: Update "A" record set with additional record @@ -57,11 +57,11 @@ register: results - name: Assert that new record was appended - assert: - that: + ansible.builtin.assert: + that: - results.changed -- name: re-update "A" record set with additional record +- name: Re-update "A" record set with additional record azure_rm_dnsrecordset: resource_group: "{{ resource_group }}" relative_name: www @@ -73,7 +73,7 @@ register: results - name: Assert that A record set was not changed - assert: + ansible.builtin.assert: that: - not results.changed @@ -90,7 +90,7 @@ register: results - name: Assert that record was deleted - assert: + ansible.builtin.assert: that: - results.changed @@ -102,17 +102,17 @@ record_type: A records: - entry: 192.168.100.105 - check_mode: yes + check_mode: true register: results - name: Assert that check_mode returns new state - assert: - that: + ansible.builtin.assert: + that: - results.changed # FUTURE: add facts module calls to ensure that we really didn't touch anything -- name: delete a record set +- name: Delete a record set azure_rm_dnsrecordset: resource_group: "{{ resource_group }}" relative_name: www @@ -122,10 +122,10 @@ register: results - name: Assert that record set deleted - assert: + ansible.builtin.assert: that: results.changed -- name: (idempotence test) re-run record set absent +- name: Re-run record set absent(idempotence test) azure_rm_dnsrecordset: resource_group: "{{ resource_group }}" relative_name: www @@ -134,11 +134,11 @@ state: absent register: results -- name: - assert: +- name: Assert the record set deleted + ansible.builtin.assert: that: not results.changed -- name: create SRV records in a new record set +- name: Create SRV records in a new record set azure_rm_dnsrecordset: resource_group: "{{ resource_group }}" relative_name: "_sip._tcp.{{ domain_name }}.com" @@ -147,18 +147,18 @@ record_type: SRV state: present records: - - entry: sip.{{ domain_name }}.com - priority: 20 - weight: 10 - port: 5060 + - entry: sip.{{ domain_name }}.com + priority: 20 + weight: 10 + port: 5060 register: results - name: Assert that SRV record set was created - assert: - that: + ansible.builtin.assert: + that: - results.changed -- name: create TXT records in a new record set +- name: Create TXT records in a new record set azure_rm_dnsrecordset: resource_group: "{{ resource_group }}" relative_name: "_txt.{{ domain_name }}.com" @@ -174,7 +174,7 @@ register: results - name: Assert that TXT record set was created - assert: + ansible.builtin.assert: that: - results.changed @@ -196,7 +196,7 @@ register: results - name: Assert that SOA record set was created - assert: + ansible.builtin.assert: that: - results.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_dnszone/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_dnszone/tasks/main.yml index 3f38ca554..849755798 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_dnszone/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_dnszone/tasks/main.yml @@ -1,5 +1,5 @@ - name: Create random domain name - set_fact: + ansible.builtin.set_fact: domain_name: "{{ resource_group | hash('md5') | truncate(16, True, '') + (65535 | random | string) }}" - name: Create a DNS zone (check mode) @@ -7,9 +7,10 @@ resource_group: "{{ resource_group }}" name: "{{ domain_name }}.com" register: results - check_mode: yes + check_mode: true -- assert: +- name: Assert the dns zone created + ansible.builtin.assert: that: results.changed - name: Create a DNS zone @@ -18,7 +19,8 @@ name: "{{ domain_name }}.com" register: results -- assert: +- name: Assert the dns zone created + ansible.builtin.assert: that: results.changed - name: Update DNS zone with tags @@ -29,8 +31,9 @@ test: modified register: results -- assert: - that: +- name: Assert the dns zone updated + ansible.builtin.assert: + that: - results.changed - results.state.tags.test == 'modified' @@ -41,8 +44,8 @@ register: zones - name: Assert that facts module returned result - assert: - that: + ansible.builtin.assert: + that: - zones.dnszones[0].tags.test == 'modified' - zones.dnszones[0].type == 'public' @@ -52,7 +55,8 @@ resource_group: "{{ resource_group }}" register: results -- assert: +- name: Assert idempotent test result + ansible.builtin.assert: that: - not results.changed @@ -60,7 +64,7 @@ # azure_rm_dnsrecordset test # -- name: create "A" record set with multiple records +- name: Create "A" record set with multiple records azure_rm_dnsrecordset: resource_group: "{{ resource_group }}" relative_name: www @@ -73,12 +77,12 @@ register: results - name: Assert that A record set was created - assert: + ansible.builtin.assert: that: - - results.changed - - 'results.state.a_records | length == 3' + - results.changed + - 'results.state.a_records | length == 3' -- name: re-run "A" record with same values +- name: Re-run "A" record with same values azure_rm_dnsrecordset: resource_group: "{{ resource_group }}" relative_name: www @@ -91,7 +95,7 @@ register: results - name: Assert that A record set was not changed - assert: + ansible.builtin.assert: that: not results.changed - name: Update "A" record set with additional record @@ -106,12 +110,12 @@ register: results - name: Assert that new record was appended - assert: - that: + ansible.builtin.assert: + that: - results.changed - 'results.state.a_records | length == 4' -- name: re-update "A" record set with additional record +- name: Re-update "A" record set with additional record azure_rm_dnsrecordset: resource_group: "{{ resource_group }}" relative_name: www @@ -123,7 +127,7 @@ register: results - name: Assert that A record set was not changed - assert: + ansible.builtin.assert: that: - not results.changed @@ -140,10 +144,10 @@ register: results - name: Assert that record was deleted - assert: + ansible.builtin.assert: that: - results.changed - - 'results.state.a_records | length == 3' + - 'results.state.a_records | length == 3' - name: Check_mode test azure_rm_dnsrecordset: @@ -153,17 +157,17 @@ record_type: A records: - entry: 192.168.100.105 - check_mode: yes + check_mode: true register: results - name: Assert that check_mode returns new state - assert: - that: + ansible.builtin.assert: + that: - results.changed # FUTURE: add facts module calls to ensure that we really didn't touch anything -- name: create SRV records in a new record set +- name: Create SRV records in a new record set azure_rm_dnsrecordset: resource_group: "{{ resource_group }}" relative_name: "_sip._tcp.{{ domain_name }}.com" @@ -171,18 +175,18 @@ time_to_live: 7200 record_type: SRV records: - - entry: sip.{{ domain_name }}.com - priority: 20 - weight: 10 - port: 5060 + - entry: sip.{{ domain_name }}.com + priority: 20 + weight: 10 + port: 5060 register: results - name: Assert that SRV record set was created - assert: - that: + ansible.builtin.assert: + that: - results.changed -- name: create TXT records in a new record set +- name: Create TXT records in a new record set azure_rm_dnsrecordset: resource_group: "{{ resource_group }}" relative_name: "_txt.{{ domain_name }}.com" @@ -196,8 +200,8 @@ - "baz" register: results -- name: Assert that TXT record set was created - assert: +- name: Cssert that TXT record set was created + ansible.builtin.assert: that: - results.changed @@ -214,8 +218,8 @@ register: results - name: Assert that facts module returned result for single Record Set - assert: - that: + ansible.builtin.assert: + that: - not results.changed # - azure_dnsrecordset[0].name == 'www' - results.dnsrecordsets[0].relative_name == 'www' @@ -229,8 +233,8 @@ register: facts - name: Assert that facts module returned result for all Record Sets - assert: - that: + ansible.builtin.assert: + that: - not facts.changed # - facts.ansible_facts.azure_dnsrecordset[0].name == '@' # - facts.ansible_facts.azure_dnsrecordset[1].name == '@' @@ -239,7 +243,7 @@ # # azure_rm_dnsrecordset cleanup # -- name: delete all record sets except for @ +- name: Delete all record sets except for @ azure_rm_dnsrecordset: resource_group: "{{ resource_group }}" relative_name: "{{ item.relative_name }}" @@ -252,7 +256,7 @@ register: results - name: Assert that record set deleted - assert: + ansible.builtin.assert: that: results.changed - name: Retrieve DNS Record Set Facts for all Record Sets @@ -262,12 +266,12 @@ register: facts - name: Assert all record set deleted - assert: + ansible.builtin.assert: that: - - item.relative_name == '@' + - item.relative_name == '@' with_items: "{{ facts.dnsrecordsets }}" -- name: (idempotence test) re-run record set absent +- name: Re-run record set absent(Idempotent test) azure_rm_dnsrecordset: resource_group: "{{ resource_group }}" relative_name: www @@ -276,8 +280,8 @@ state: absent register: results -- name: - assert: +- name: Assert the dns recored deleted + ansible.builtin.assert: that: not results.changed # @@ -286,7 +290,7 @@ - name: Delete DNS zone azure_rm_dnszone: resource_group: "{{ resource_group }}" - name: "{{ domain_name }}.com" + name: "{{ domain_name }}.com" state: absent - name: Delete DNS zone (idempotent) @@ -296,5 +300,6 @@ state: absent register: results -- assert: +- name: Assert the dns zone deleted + ansible.builtin.assert: that: not results.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_eventhub/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_eventhub/tasks/main.yml index 484f0146d..62e60e95b 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_eventhub/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_eventhub/tasks/main.yml @@ -1,7 +1,7 @@ - name: Create random event hub and namespace - set_fact: - namespace_name: "test{{ resource_group | hash('md5') | truncate(16, True, '') + (65535 | random | string) }}" - name: "test{{ resource_group | hash('md5') | truncate(16, True, '') + (65535 | random | string) }}" + ansible.builtin.set_fact: + namespace_name: "test{{ resource_group | hash('md5') | truncate(16, True, '') + (65535 | random | string) }}" + name_rpfx: "test{{ resource_group | hash('md5') | truncate(16, True, '') + (65535 | random | string) }}" - name: Create Event Hub Namespace (check mode) azure_rm_eventhub: @@ -9,23 +9,25 @@ namespace_name: "{{ namespace_name }}" resource_group: "{{ resource_group }}" sku: "Basic" - check_mode: yes + check_mode: true register: results -- assert: +- name: Assert the check mode result + ansible.builtin.assert: that: results.changed -- name: Create Event Hub (check mode) +- name: Create Event Hub (check mode) azure_rm_eventhub: location: eastus2 namespace_name: "{{ namespace_name }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" sku: "Basic" - check_mode: yes + check_mode: true register: results -- assert: +- name: Assert the check mode result + ansible.builtin.assert: that: results.changed - name: Create Event Hub Namespace @@ -36,18 +38,20 @@ sku: "Basic" register: results -- assert: +- name: Assert the event hub namespace created + ansible.builtin.assert: that: results.changed - name: Create Event Hub azure_rm_eventhub: location: eastus2 namespace_name: "{{ namespace_name }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" register: results -- assert: +- name: Assert the event hub created + ansible.builtin.assert: that: results.changed - name: Update Namespace @@ -60,8 +64,9 @@ test: modified register: results -- assert: - that: +- name: Assert the namespace updated + ansible.builtin.assert: + that: - results.changed - results.state.tags.test == 'modified' @@ -69,7 +74,7 @@ azure_rm_eventhub: location: eastus2 namespace_name: "{{ namespace_name }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" message_retention_in_days: 4 state: present @@ -77,8 +82,9 @@ test: modified register: results -- assert: - that: +- name: Assert the event hub updated + ansible.builtin.assert: + that: - results.changed - name: Retrieve Namespace @@ -97,16 +103,17 @@ test: modified register: results -- assert: +- name: Assert idempotent success + ansible.builtin.assert: that: - not results.changed -#cleanup +# cleanup - name: Delete Event Hub azure_rm_eventhub: location: eastus2 namespace_name: "{{ namespace_name }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" state: absent @@ -114,12 +121,13 @@ azure_rm_eventhub: location: eastus2 namespace_name: "{{ namespace_name }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" state: absent register: results -- assert: +- name: Assert the event hub deleted + ansible.builtin.assert: that: not results.changed - name: Delete Namespace @@ -130,8 +138,9 @@ state: absent - name: Pause for 1 minutes to check namespace deleted - pause: + ansible.builtin.pause: minutes: 1 + changed_when: true - name: Delete Namespace (idempotent) azure_rm_eventhub: @@ -141,5 +150,6 @@ state: absent register: results -- assert: +- name: Assert the namespace deleted + ansible.builtin.assert: that: not results.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_expressroute/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_expressroute/tasks/main.yml index d90dbfdf6..3d70ddd82 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_expressroute/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_expressroute/tasks/main.yml @@ -1,5 +1,5 @@ - name: Create random express route - set_fact: + ansible.builtin.set_fact: express_route: "test{{ resource_group | hash('md5') | truncate(16, True, '') + (65535 | random | string) }}" - name: Create Express route (check mode) @@ -21,9 +21,10 @@ tier: premium family: metereddata register: results - check_mode: yes + check_mode: true -- assert: +- name: Assert the excpress route check mode result + ansible.builtin.assert: that: results.changed @@ -34,7 +35,7 @@ resource_group: "{{ resource_group }}" allow_classic_operations: true global_reach_enabled: false - tags: + tags: a: b authorizations: - name: authorization_test @@ -47,7 +48,8 @@ family: metereddata register: results -- assert: +- name: Assert the express route created + ansible.builtin.assert: that: results.changed @@ -58,7 +60,7 @@ resource_group: "{{ resource_group }}" allow_classic_operations: true global_reach_enabled: false - tags: + tags: test: modified authorizations: - name: authorization_test @@ -71,8 +73,9 @@ family: metereddata register: results -- assert: - that: +- name: Assert the express route updated + ansible.builtin.assert: + that: - results.changed - results.state.tags.test == 'modified' @@ -84,8 +87,8 @@ register: results - name: Assert that facts module returned result - assert: - that: + ansible.builtin.assert: + that: - results.expressroute[0].tags.test == 'modified' - results.expressroute[0].type == 'Microsoft.Network/expressRouteCircuits' @@ -95,7 +98,8 @@ resource_group: "{{ resource_group }}" register: results -- assert: +- name: Assert the idempotent + ansible.builtin.assert: that: - not results.changed @@ -105,7 +109,7 @@ - name: Delete Express Route azure_rm_expressroute: resource_group: "{{ resource_group }}" - name: "{{ express_route }}" + name: "{{ express_route }}" state: absent - name: Delete Express Route (idempotent) @@ -115,5 +119,6 @@ state: absent register: results -- assert: +- name: Assert the express route deleted + ansible.builtin.assert: that: not results.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_firewallpolicy/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_firewallpolicy/tasks/main.yml index 4bbba792e..f81ab9708 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_firewallpolicy/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_firewallpolicy/tasks/main.yml @@ -1,5 +1,5 @@ - name: Create firewall policy name - set_fact: + ansible.builtin.set_fact: policy_name: "fp{{ resource_group | hash('md5') | truncate(22, True, '') }}" - name: Create firewall policy @@ -18,7 +18,7 @@ register: results - name: Assert that firewall policy is created - assert: + ansible.builtin.assert: that: results.changed - name: Create a firewall policy again (Idempotent test) @@ -37,7 +37,7 @@ register: results - name: Assert that output is not changed - assert: + ansible.builtin.assert: that: not results.changed - name: Update a firewall policy @@ -58,7 +58,7 @@ register: results - name: Assert that firewall policy is updated - assert: + ansible.builtin.assert: that: results.changed - name: Get firewall policy facts @@ -67,7 +67,8 @@ name: "{{ policy_name }}" register: results -- assert: +- name: Assert the firewall policy facts + ansible.builtin.assert: that: - not results.changed - results.firewallpolicies[0].id != None @@ -85,7 +86,7 @@ register: results - name: Assert that firewall policy is deleted - assert: + ansible.builtin.assert: that: results.changed - name: Delete firewall policy again (Idempotent test) @@ -96,5 +97,5 @@ register: results - name: Asset that output is not changed - assert: + ansible.builtin.assert: that: not results.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_functionapp/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_functionapp/tasks/main.yml index e618e7038..5c5d5e3fe 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_functionapp/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_functionapp/tasks/main.yml @@ -1,56 +1,56 @@ - name: Fix resource prefix - set_fact: + ansible.builtin.set_fact: fixed_resource_prefix: "fa{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - name: Fix resource prefix - set_fact: + ansible.builtin.set_fact: funcapp_name_basic: "fa{{ fixed_resource_prefix }}basic" funcapp_name_container: "fa{{ fixed_resource_prefix }}container" funcapp_name_params: "fa{{ fixed_resource_prefix }}params" storage_account_name: "sa{{ fixed_resource_prefix }}" plan_name: "ap{{ fixed_resource_prefix }}" -- name: create storage account for function apps +- name: Create storage account for function apps azure_rm_storageaccount: resource_group: '{{ resource_group }}' name: "{{ storage_account_name }}" account_type: Standard_LRS -- name: create basic function app +- name: Create basic function app azure_rm_functionapp: resource_group: "{{ resource_group }}" name: "{{ funcapp_name_basic }}" storage_account: "{{ storage_account_name }}" register: output -- name: assert the function was created - assert: +- name: Assert the function was created + ansible.builtin.assert: that: output.changed -- name: list facts for function +- name: List facts for function azure_rm_functionapp_info: resource_group: '{{ resource_group }}' name: "{{ funcapp_name_basic }}" register: results -- name: assert the facts were retrieved - assert: +- name: Assert the facts were retrieved + ansible.builtin.assert: that: - - results.ansible_info.azure_functionapps|length == 1 - - results.ansible_info.azure_functionapps[0].name == "{{ funcapp_name_basic }}" + - results.ansible_info.azure_functionapps|length == 1 + - results.ansible_info.azure_functionapps[0].name == "{{ funcapp_name_basic }}" -- name: delete basic function app +- name: Delete basic function app azure_rm_functionapp: resource_group: '{{ resource_group }}' name: "{{ funcapp_name_basic }}" state: absent register: output -- name: assert the function was deleted - assert: +- name: Assert the function was deleted + ansible.builtin.assert: that: output.changed -- name: create a function with app settings +- name: Create a function with app settings azure_rm_functionapp: resource_group: '{{ resource_group }}' name: "{{ funcapp_name_params }}" @@ -61,11 +61,11 @@ FUNCTIONS_EXTENSION_VERSION: "~2" register: output -- name: assert the function with app settings was created - assert: +- name: Assert the function with app settings was created + ansible.builtin.assert: that: output.changed -- name: change app settings +- name: Change app settings azure_rm_functionapp: resource_group: '{{ resource_group }}' name: "{{ funcapp_name_params }}" @@ -77,19 +77,19 @@ another: one register: output -- name: assert the function was changed - assert: +- name: Assert the function was changed + ansible.builtin.assert: that: output.changed -- name: delete the function app +- name: Delete the function app azure_rm_functionapp: resource_group: '{{ resource_group }}' name: "{{ funcapp_name_params }}" state: absent register: output -- name: assert the function was deleted - assert: +- name: Assert the function was deleted + ansible.builtin.assert: that: output.changed - name: Create a linux app service plan @@ -106,25 +106,25 @@ name: "{{ funcapp_name_container }}" storage_account: "{{ storage_account_name }}" plan: - resource_group: "{{ resource_group }}" - name: "{{ plan_name }}" + resource_group: "{{ resource_group }}" + name: "{{ plan_name }}" container_settings: - name: httpd + name: httpd app_settings: - FUNCTIONS_EXTENSION_VERSION: "~2" + FUNCTIONS_EXTENSION_VERSION: "~2" register: output -- name: assert the function was changed - assert: +- name: Assert the function was changed + ansible.builtin.assert: that: output.changed -- name: delete the function app +- name: Delete the function app azure_rm_functionapp: resource_group: '{{ resource_group }}' name: "{{ funcapp_name_container }}" state: absent -- name: delete storage account +- name: Delete storage account azure_rm_storageaccount: resource_group: '{{ resource_group }}' name: "{{ storage_account_name }}" diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_gallery/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_gallery/tasks/main.yml index f67fa218f..b9705dc34 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_gallery/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_gallery/tasks/main.yml @@ -1,7 +1,7 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - run_once: yes + run_once: true - name: Create virtual network azure_rm_virtualnetwork: @@ -42,9 +42,9 @@ vm_size: Standard_B1ms network_interfaces: "vmforimage{{ rpfx }}nic" image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal publisher: Canonical - sku: 16.04-LTS + sku: 20_04-lts version: latest - name: Get VM facts @@ -54,7 +54,9 @@ register: output - name: Pause for 10 mimutes to VM updating - shell: sleep 600 + ansible.builtin.command: + sleep 600 + changed_when: true - name: Create a snapshot by importing an unmanaged blob from the same subscription. azure_rm_snapshot: @@ -66,8 +68,9 @@ source_uri: 'https://{{ output.vms[0].storage_account_name }}.blob.core.windows.net/{{ output.vms[0].storage_container_name }}/{{ output.vms[0].storage_blob_name }}' register: output -- assert: - that: +- name: Assert the snapshot created + ansible.builtin.assert: + that: - output.changed - name: Create a managed disk @@ -82,13 +85,14 @@ resource_group: "{{ resource_group }}" name: "mySnapshot-{{ rpfx }}02" location: eastus - incremental: True + incremental: true creation_data: create_option: Copy source_id: "{{ disk_output.state.id }}" register: output -- assert: +- name: Assert the snapshot idempotent result + ansible.builtin.assert: that: - output.changed @@ -96,7 +100,7 @@ azure_rm_virtualmachine: resource_group: "{{ resource_group }}" name: "vmforimage{{ rpfx }}" - generalized: yes + generalized: true - name: Create custom image azure_rm_image: resource_group: "{{ resource_group }}" @@ -110,8 +114,9 @@ description: This is the gallery description. register: output -- assert: - that: +- name: Assert the gallery created + ansible.builtin.assert: + that: - output.changed - name: Create or update a simple gallery - idempotent @@ -122,8 +127,9 @@ description: This is the gallery description. register: output -- assert: - that: +- name: Assert the gallery created + ansible.builtin.assert: + that: - not output.changed - name: Create or update a simple gallery - change description @@ -134,8 +140,9 @@ description: This is the gallery description - xxx. register: output -- assert: - that: +- name: Assert the gallery updated + ansible.builtin.assert: + that: - output.changed - name: Get a gallery info. @@ -144,8 +151,9 @@ name: myGallery{{ rpfx }} register: output -- assert: - that: +- name: Assedrt the gallery facts + ansible.builtin.assert: + that: - not output.changed - output.galleries['id'] != None - output.galleries['name'] != None @@ -168,8 +176,9 @@ description: Image Description register: output -- assert: - that: +- name: Assert the gallery image created + ansible.builtin.assert: + that: - output.changed - name: Create or update gallery image - idempotent @@ -187,8 +196,9 @@ description: Image Description register: output -- assert: - that: +- name: Assert the gallery image idempotent result + ansible.builtin.assert: + that: - not output.changed - name: Create or update gallery image - change description @@ -206,8 +216,9 @@ description: Image Description XXXs register: output -- assert: - that: +- name: Assert the gallery image updated + ansible.builtin.assert: + that: - output.changed - name: Get a gallery image info. @@ -217,8 +228,9 @@ name: myImage register: output -- assert: - that: +- name: Assert the gallery image facts + ansible.builtin.assert: + that: - not output.changed - output.images['id'] != None - output.images['name'] != None @@ -236,7 +248,7 @@ location: eastus publishing_profile: end_of_life_date: "2050-10-01t00:00:00+00:00" - exclude_from_latest: yes + exclude_from_latest: true replica_count: 3 storage_account_type: Standard_LRS target_regions: @@ -250,8 +262,9 @@ resource_group: "{{ resource_group }}" register: output -- assert: - that: +- name: Assert the gallery image version created + ansible.builtin.assert: + that: - output.changed - name: Create or update a simple gallery Image Version - idempotent @@ -263,7 +276,7 @@ location: eastus publishing_profile: end_of_life_date: "2050-10-01t00:00:00+00:00" - exclude_from_latest: yes + exclude_from_latest: true replica_count: 3 storage_account_type: Standard_LRS target_regions: @@ -277,8 +290,9 @@ resource_group: "{{ resource_group }}" register: output -- assert: - that: +- name: Assert the gallery image version result + ansible.builtin.assert: + that: - not output.changed - name: Create or update a simple gallery Image Version - change end of life @@ -290,7 +304,7 @@ location: eastus publishing_profile: end_of_life_date: "2051-10-01t00:00:00+00:00" - exclude_from_latest: yes + exclude_from_latest: true replica_count: 3 storage_account_type: Standard_LRS target_regions: @@ -304,8 +318,9 @@ resource_group: "{{ resource_group }}" register: output -- assert: - that: +- name: Assert the gallery image version updated + ansible.builtin.assert: + that: - output.changed - name: Get a simple gallery Image Version info. @@ -316,8 +331,9 @@ name: 10.1.3 register: output -- assert: - that: +- name: Assert the gallery image version facts + ansible.builtin.assert: + that: - not output.changed - output.versions['id'] != None - output.versions['name'] != None @@ -334,13 +350,15 @@ state: absent register: output -- assert: - that: +- name: Assert the gallery image version deleted + ansible.builtin.assert: + that: - output.changed -- name: pasue 2 minutes, wait for deletion complete - pause: +- name: Pasue 2 minutes, wait for deletion complete + ansible.builtin.pause: minutes: 2 + changed_when: true - name: Delete gallery image azure_rm_galleryimage: @@ -350,13 +368,15 @@ state: absent register: output -- assert: - that: +- name: Assert the gallery image deleted + ansible.builtin.assert: + that: - output.changed -- name: pasue 2 minutes, wait for deletion complete - pause: +- name: Pasue 2 minutes, wait for deletion complete + ansible.builtin.pause: minutes: 2 + changed_when: true - name: Delete gallery azure_rm_gallery: @@ -365,6 +385,7 @@ state: absent register: output -- assert: - that: +- name: Assert the gallery deleted + ansible.builtin.assert: + that: - output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_hdinsightcluster/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_hdinsightcluster/tasks/main.yml index edb99c4c1..23b80aa4e 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_hdinsightcluster/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_hdinsightcluster/tasks/main.yml @@ -1,14 +1,14 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - run_once: yes + run_once: true - name: Create storage account azure_rm_storageaccount: - resource_group: "{{ resource_group }}" - name: "storage{{ rpfx }}" - account_type: Standard_LRS - location: eastus2 + resource_group: "{{ resource_group }}" + name: "storage{{ rpfx }}" + account_type: Standard_LRS + location: eastus2 - name: Sample for Azure REST API - StorageAccounts_ListKeys azure_rm_resource: @@ -22,7 +22,8 @@ - type: listkeys register: storage_output -- debug: +- name: Print the storage account keys + ansible.builtin.debug: var: storage_output - name: Create instance of Cluster -- check mode @@ -38,8 +39,8 @@ gateway_rest_username: http-user gateway_rest_password: Password123! storage_accounts: - - name: storage{{ rpfx }}.blob.core.windows.net - is_default: yes + - name: storage{{ rpfx }}.blob.core.windows.net + is_default: true container: "cluster{{ rpfx }}" key: "{{ storage_output['response']['keys'][0]['value'] }}" compute_profile_roles: @@ -61,10 +62,10 @@ linux_profile: username: sshuser password: Password123! - check_mode: yes + check_mode: true register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -81,8 +82,8 @@ gateway_rest_username: http-user gateway_rest_password: Password123! storage_accounts: - - name: storage{{ rpfx }}.blob.core.windows.net - is_default: yes + - name: storage{{ rpfx }}.blob.core.windows.net + is_default: true container: "cluster{{ rpfx }}" key: "{{ storage_output['response']['keys'][0]['value'] }}" compute_profile_roles: @@ -107,7 +108,7 @@ register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -124,8 +125,8 @@ gateway_rest_username: http-user gateway_rest_password: Password123! storage_accounts: - - name: storage{{ rpfx }}.blob.core.windows.net - is_default: yes + - name: storage{{ rpfx }}.blob.core.windows.net + is_default: true container: "cluster{{ rpfx }}" key: "{{ storage_output['response']['keys'][0]['value'] }}" compute_profile_roles: @@ -149,7 +150,7 @@ password: Password123! register: output - name: Assert the state has not changed - assert: + ansible.builtin.assert: that: - output.changed == false @@ -166,8 +167,8 @@ gateway_rest_username: http-user gateway_rest_password: Password123! storage_accounts: - - name: storage{{ rpfx }}.blob.core.windows.net - is_default: yes + - name: storage{{ rpfx }}.blob.core.windows.net + is_default: true container: "cluster{{ rpfx }}" key: "{{ storage_output['response']['keys'][0]['value'] }}" compute_profile_roles: @@ -192,10 +193,11 @@ tags: aaa: bbb register: output -- debug: +- name: Print the cluster creating result + ansible.builtin.debug: var: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -206,7 +208,7 @@ register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.clusters[0]['id'] != None @@ -225,10 +227,10 @@ resource_group: "{{ resource_group }}" name: "cluster{{ rpfx }}" state: absent - check_mode: yes + check_mode: true register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -239,6 +241,6 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_hostgroup/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_hostgroup/tasks/main.yml index 8b2d408eb..04808a62a 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_hostgroup/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_hostgroup/tasks/main.yml @@ -1,5 +1,5 @@ - name: Create host group name - set_fact: + ansible.builtin.set_fact: group_name: "hostgroup{{ resource_group | hash('md5') | truncate(22, True, '') }}" - name: Create a host group @@ -14,7 +14,7 @@ register: results - name: Assert that host group is created - assert: + ansible.builtin.assert: that: results.changed - name: Create a host group again (Idempotent test) @@ -29,7 +29,7 @@ register: results - name: Assert that output is not changed - assert: + ansible.builtin.assert: that: not results.changed - name: Update a host group @@ -46,7 +46,7 @@ register: results - name: Assert that host group is updated - assert: + ansible.builtin.assert: that: results.changed - name: Get host group facts @@ -55,7 +55,8 @@ name: "{{ group_name }}" register: results -- assert: +- name: Assert the host group facts + ansible.builtin.assert: that: - not results.changed - results.hostgroups[0].name == "{{ group_name }}" @@ -72,7 +73,7 @@ register: results - name: Assert that host group is deleted - assert: + ansible.builtin.assert: that: results.changed - name: Delete host group again (Idempotent test) @@ -83,5 +84,5 @@ register: results - name: Asset that output is not changed - assert: + ansible.builtin.assert: that: not results.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_image/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_image/tasks/main.yml index cbe9baa31..2fc543091 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_image/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_image/tasks/main.yml @@ -1,115 +1,118 @@ - name: Create storage account name - set_fact: - vm_name: "vm{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}x" - public_ip_name: "pip{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - security_group_name: "sg{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - empty_disk_name: "emptydisk{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" + ansible.builtin.set_fact: + vm_name: "vm{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}x" + public_ip_name: "pip{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" + security_group_name: "sg{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" + empty_disk_name: "emptydisk{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - name: Create virtual network azure_rm_virtualnetwork: - resource_group: "{{ resource_group }}" - name: "{{ vm_name }}" - address_prefixes: "10.10.0.0/16" + resource_group: "{{ resource_group }}" + name: "{{ vm_name }}" + address_prefixes: "10.10.0.0/16" - name: Add subnet azure_rm_subnet: - resource_group: "{{ resource_group }}" - name: "{{ vm_name }}" - address_prefix: "10.10.0.0/24" - virtual_network: "{{ vm_name }}" + resource_group: "{{ resource_group }}" + name: "{{ vm_name }}" + address_prefix: "10.10.0.0/24" + virtual_network: "{{ vm_name }}" - name: Create public ip azure_rm_publicipaddress: - resource_group: "{{ resource_group }}" - allocation_method: Static - name: "{{ public_ip_name }}" + resource_group: "{{ resource_group }}" + allocation_method: Static + name: "{{ public_ip_name }}" - name: Create security group azure_rm_securitygroup: - resource_group: "{{ resource_group }}" - name: "{{ security_group_name }}" + resource_group: "{{ resource_group }}" + name: "{{ security_group_name }}" - name: Create NIC azure_rm_networkinterface: - resource_group: "{{ resource_group }}" - name: "{{ vm_name }}" - virtual_network: "{{ vm_name }}" - subnet: "{{ vm_name }}" - public_ip_name: "{{ public_ip_name }}" - security_group: "{{ security_group_name }}" + resource_group: "{{ resource_group }}" + name: "{{ vm_name }}" + virtual_network: "{{ vm_name }}" + subnet: "{{ vm_name }}" + public_ip_name: "{{ public_ip_name }}" + security_group: "{{ security_group_name }}" - name: Create virtual machine azure_rm_virtualmachine: - resource_group: "{{ resource_group }}" - name: "{{ vm_name }}" - vm_size: Standard_B1ms - managed_disk_type: Standard_LRS - admin_username: adminuser - ssh_password_enabled: false - ssh_public_keys: - - path: /home/adminuser/.ssh/authorized_keys - key_data: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfoYlIV4lTPZTv7hXaVwQQuqBgGs4yeNRX0SPo2+HQt9u4X7IGwrtXc0nEUm6LfaCikMH58bOL8f20NTGz285kxdFHZRcBXtqmnMz2rXwhK9gwq5h1khc+GzHtdcJXsGA4y0xuaNcidcg04jxAlN/06fwb/VYwwWTVbypNC0gpGEpWckCNm8vlDlA55sU5et0SZ+J0RKVvEaweUOeNbFZqckGPA384imfeYlADppK/7eAxqfBVadVvZG8IJk4yvATgaIENIFj2cXxqu2mQ/Bp5Wr45uApvJsFXmi+v/nkiOEV1QpLOnEwAZo6EfFS4CCQtsymxJCl1PxdJ5LD4ZOtP xiuxi.sun@qq.com" - os_type: Linux - network_interfaces: "{{ vm_name }}" - image: - offer: UbuntuServer - publisher: Canonical - sku: 16.04-LTS - version: latest + resource_group: "{{ resource_group }}" + name: "{{ vm_name }}" + vm_size: Standard_B1ms + managed_disk_type: Standard_LRS + admin_username: adminuser + ssh_password_enabled: false + ssh_public_keys: + - path: /home/adminuser/.ssh/authorized_keys + key_data: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfoYlIV4lTPZTv7hXaVwQQuqBgGs4yeNRX0SPo2+HQt9u4X7IGwrtXc0nEUm6LfaCikMH58bOL8f20NTGz285kxdFHZRcBXtqmnMz2rXwhK9gwq5h1khc+GzHtdcJXsGA4y0xuaNcidcg04jxAlN/06fwb/VYwwWTVbypNC0gpGEpWckCNm8vlDlA55sU5et0SZ+J0RKVvEaweUOeNbFZqckGPA384imfeYlADppK/7eAxqfBVadVvZG8IJk4yvATgaIENIFj2cXxqu2mQ/Bp5Wr45uApvJsFXmi+v/nkiOEV1QpLOnEwAZo6EfFS4CCQtsymxJCl1PxdJ5LD4ZOtP xiuxi.sun@qq.com" + os_type: Linux + network_interfaces: "{{ vm_name }}" + image: + offer: 0001-com-ubuntu-server-focal + publisher: Canonical + sku: 20_04-lts + version: latest register: vm - name: Create new empty managed disk azure_rm_manageddisk: - resource_group: "{{ resource_group }}" - name: "{{ empty_disk_name }}" - storage_account_type: "Standard_LRS" - disk_size_gb: 1 + resource_group: "{{ resource_group }}" + name: "{{ empty_disk_name }}" + storage_account_type: "Standard_LRS" + disk_size_gb: 1 register: emptydisk - name: Create an image from VM (check mode) azure_rm_image: - resource_group: "{{ resource_group }}" - source: "{{ vm.ansible_facts.azure_vm.properties.storageProfile.osDisk.managedDisk.id }}" - name: testimage001 - os_type: Linux - hyper_v_generation: V1 - data_disk_sources: - - "{{ empty_disk_name }}" - check_mode: yes + resource_group: "{{ resource_group }}" + source: "{{ vm.ansible_facts.azure_vm.storage_profile.os_disk.managed_disk.id }}" + name: testimage001 + os_type: Linux + hyper_v_generation: V1 + data_disk_sources: + - "{{ empty_disk_name }}" + check_mode: true register: output -- assert: - that: output.changed +- name: Assert the image check mode + ansible.builtin.assert: + that: output.changed - name: Create an image from VM azure_rm_image: - resource_group: "{{ resource_group }}" - source: - name: "{{ vm_name }}" - type: disks - name: testimage001 - hyper_v_generation: V1 - os_type: Linux + resource_group: "{{ resource_group }}" + source: + name: "{{ vm_name }}" + type: disks + name: testimage001 + hyper_v_generation: V1 + os_type: Linux register: output -- assert: - that: - - output.changed - - output.id +- name: Assert the image created + ansible.builtin.assert: + that: + - output.changed + - output.id - name: Create an image from VM (idempotent) azure_rm_image: - resource_group: "{{ resource_group }}" - source: "{{ vm.ansible_facts.azure_vm.properties.storageProfile.osDisk.managedDisk.id }}" - name: testimage001 - hyper_v_generation: V1 - os_type: Linux + resource_group: "{{ resource_group }}" + source: "{{ vm.ansible_facts.azure_vm.storage_profile.os_disk.managed_disk.id }}" + name: testimage001 + hyper_v_generation: V1 + os_type: Linux register: output -- assert: - that: - - not output.changed - - output.id +- name: Assert the image created + ansible.builtin.assert: + that: + - not output.changed + - output.id - name: Gather information about image created azure_rm_image_info: @@ -117,62 +120,66 @@ name: testimage001 register: output -- assert: - that: - - output.images != [] - - output.images[0].hyper_v_generation == 'V1' +- name: Assert the image facts + ansible.builtin.assert: + that: + - output.images != [] + - output.images[0].hyper_v_generation == 'V1' - name: Delete image (check mode) azure_rm_image: - resource_group: "{{ resource_group }}" - name: testimage001 - state: absent + resource_group: "{{ resource_group }}" + name: testimage001 + state: absent register: output - check_mode: yes + check_mode: true -- assert: +- name: Assert the image check mode + ansible.builtin.assert: that: - output.changed - name: Delete image azure_rm_image: - resource_group: "{{ resource_group }}" - name: testimage001 - state: absent + resource_group: "{{ resource_group }}" + name: testimage001 + state: absent register: output -- assert: +- name: Assert the imaged deleted + ansible.builtin.assert: that: - output.changed - name: Delete image (idempotent) azure_rm_image: - resource_group: "{{ resource_group }}" - name: testimage001 - state: absent + resource_group: "{{ resource_group }}" + name: testimage001 + state: absent register: output -- assert: +- name: Assert the image has deleted + ansible.builtin.assert: that: - not output.changed - name: Delete empty disk azure_rm_manageddisk: - resource_group: "{{ resource_group }}" - name: "{{ empty_disk_name }}" - state: absent + resource_group: "{{ resource_group }}" + name: "{{ empty_disk_name }}" + state: absent - name: Delete VM azure_rm_virtualmachine: - resource_group: "{{ resource_group }}" - name: "{{ vm_name }}" - state: absent - vm_size: Standard_A0 + resource_group: "{{ resource_group }}" + name: "{{ vm_name }}" + state: absent + vm_size: Standard_A0 register: output - name: Delete public ip azure_rm_publicipaddress: - resource_group: "{{ resource_group }}" - allocation_method: Static - name: "{{ public_ip_name }}" - state: absent + resource_group: "{{ resource_group }}" + allocation_method: Static + name: "{{ public_ip_name }}" + state: absent diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_iothub/aliases b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_iothub/aliases index aa77c071a..cbb31e489 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_iothub/aliases +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_iothub/aliases @@ -1,3 +1,4 @@ cloud/azure shippable/azure/group2 destructive +disabled diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_iothub/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_iothub/tasks/main.yml index 6cb319050..2b2e33695 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_iothub/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_iothub/tasks/main.yml @@ -1,178 +1,182 @@ -- set_fact: +- name: Set variables + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(8, True, '') }}" - name: Create IoT Hub (check mode) azure_rm_iothub: - name: "hub{{ rpfx }}" - resource_group: "{{ resource_group }}" - ip_filters: - - name: filter1 - action: reject - ip_mask: 40.60.80.10 - check_mode: yes + name: "hub{{ rpfx }}" + resource_group: "{{ resource_group }}" + ip_filters: + - name: filter1 + action: reject + ip_mask: 40.60.80.10 + check_mode: true register: iothub -- assert: +- name: Assert the check mode result + ansible.builtin.assert: that: - - iothub.changed + - iothub.changed - name: Query IoT Hub azure_rm_iothub_info: - name: "hub{{ rpfx }}" - resource_group: "{{ resource_group }}" + name: "hub{{ rpfx }}" + resource_group: "{{ resource_group }}" register: iothub - ignore_errors: yes + ignore_errors: true - name: Create IoT Hub azure_rm_iothub: - name: "hub{{ rpfx }}" - resource_group: "{{ resource_group }}" - ip_filters: - - name: filter1 - action: reject - ip_mask: 40.60.80.10 + name: "hub{{ rpfx }}" + resource_group: "{{ resource_group }}" + ip_filters: + - name: filter1 + action: reject + ip_mask: 40.60.80.10 register: iothub -- assert: +- name: Assert tht iot hub created + ansible.builtin.assert: that: - - iothub.changed + - iothub.changed - name: Create IoT Hub (idempontent) azure_rm_iothub: - name: "hub{{ rpfx }}" - resource_group: "{{ resource_group }}" - ip_filters: - - name: filter1 - action: reject - ip_mask: 40.60.80.10 + name: "hub{{ rpfx }}" + resource_group: "{{ resource_group }}" + ip_filters: + - name: filter1 + action: reject + ip_mask: 40.60.80.10 register: iothub -- assert: +- name: Assert the iot hub created + ansible.builtin.assert: that: - - not iothub.changed + - not iothub.changed - name: Query IoT Hub azure_rm_iothub_info: - name: "hub{{ rpfx }}" - resource_group: "{{ resource_group }}" - list_keys: yes + name: "hub{{ rpfx }}" + resource_group: "{{ resource_group }}" + list_keys: true register: iothub -- assert: +- name: Assert the iot hub facts + ansible.builtin.assert: that: - - iothub.iothubs | length == 1 + - iothub.iothubs | length == 1 -- set_fact: +- name: Set variables + ansible.builtin.set_fact: registry_write_name: "{{ item.key_name }}" registry_write_key: "{{ item.primary_key }}" + secondary_key: "{{ item.secondary_key }}" with_items: "{{ iothub.iothubs[0]['keys'] }}" when: item.rights == 'RegistryWrite, ServiceConnect, DeviceConnect' - name: Create devices azure_rm_iotdevice: - hub: "hub{{ rpfx }}" - hub_policy_name: "{{ registry_write_name }}" - hub_policy_key: "{{ registry_write_key }}" - name: "mydevice{{ item }}" - twin_tags: - location: - country: US - city: Redmond - sensor: humidity + hub: "hub{{ rpfx }}" + hub_policy_name: "{{ registry_write_name }}" + hub_policy_key: "{{ registry_write_key }}" + name: "mydevice{{ item }}" + primary_key: "{{ registry_write_key }}" + secondary_key: "{{ secondary_key }}" + twin_tags: + location: + country: US + city: Redmond + sensor: humidity with_items: - 1 - 2 - name: Query devices azure_rm_iotdevice_info: - hub: "hub{{ rpfx }}" - hub_policy_name: "{{ registry_write_name }}" - hub_policy_key: "{{ registry_write_key }}" + hub: "hub{{ rpfx }}" + hub_policy_name: "{{ registry_write_name }}" + hub_policy_key: "{{ registry_write_key }}" register: devices -- assert: - that: - - devices.iot_devices | length == 2 +- name: Assert the iot devices facts + ansible.builtin.assert: + that: + - devices.iot_devices | length == 2 -- name: Query devices +- name: Query devices by name azure_rm_iotdevice_info: - hub: "hub{{ rpfx }}" - name: "mydevice1" - hub_policy_name: "{{ registry_write_name }}" - hub_policy_key: "{{ registry_write_key }}" + hub: "hub{{ rpfx }}" + name: "mydevice1" + hub_policy_name: "{{ registry_write_name }}" + hub_policy_key: "{{ registry_write_key }}" register: devices -- assert: - that: - - devices.iot_devices | length == 1 - - devices.iot_devices[0].deviceId == 'mydevice1' +- name: Assert the iot device facts + ansible.builtin.assert: + that: + - devices.iot_devices | length == 1 + - devices.iot_devices[0].deviceId == 'mydevice1' - name: Pause for 5 mimutes - shell: sleep 300 - -- name: Query devices twin - azure_rm_iotdevice_info: - hub: "hub{{ rpfx }}" - query: "SELECT * FROM devices WHERE tags.location.country = 'US'" - hub_policy_name: "{{ registry_write_name }}" - hub_policy_key: "{{ registry_write_key }}" - register: devices - -- assert: - that: - - devices.iot_devices | length == 2 + ansible.builtin.command: sleep 300 + changed_when: true - name: Update devices azure_rm_iotdevice: - hub: "hub{{ rpfx }}" - hub_policy_name: "{{ registry_write_name }}" - hub_policy_key: "{{ registry_write_key }}" - name: "mydevice{{ item }}" - edge_enabled: yes - twin_tags: - location: - country: China - city: Shanghai - sensor: humidity + hub: "hub{{ rpfx }}" + hub_policy_name: "{{ registry_write_name }}" + hub_policy_key: "{{ registry_write_key }}" + name: "mydevice{{ item }}" + edge_enabled: true + primary_key: "{{ registry_write_key }}" + secondary_key: "{{ secondary_key }}" + twin_tags: + location: + country: China + city: Shanghai + sensor: humidity with_items: - 1 - - 3 + - 2 - name: Pause for 5 mimutes - shell: sleep 300 + changed_when: true + ansible.builtin.command: sleep 300 - name: Query devices twin azure_rm_iotdevice_info: - hub: "hub{{ rpfx }}" - query: "SELECT * FROM devices WHERE tags.location.country = 'US'" - hub_policy_name: "{{ registry_write_name }}" - hub_policy_key: "{{ registry_write_key }}" + hub: "hub{{ rpfx }}" + hub_policy_name: "{{ registry_write_name }}" + hub_policy_key: "{{ registry_write_key }}" register: devices -- assert: - that: - - devices.iot_devices | length == 1 - - devices.iot_devices[0].deviceId == 'mydevice2' +- name: Assert the iot devices facts + ansible.builtin.assert: + that: + - devices.iot_devices | length == 2 - name: Delete IoT Hub (check mode) azure_rm_iothub: - name: "hub{{ rpfx }}" - resource_group: "{{ resource_group }}" - state: absent - check_mode: yes + name: "hub{{ rpfx }}" + resource_group: "{{ resource_group }}" + state: absent + check_mode: true register: iothub -- assert: +- name: Assert iot hub check mode result + ansible.builtin.assert: that: - - iothub.changed + - iothub.changed - name: Delete IoT Hub azure_rm_iothub: - name: "hub{{ rpfx }}" - resource_group: "{{ resource_group }}" - state: absent + name: "hub{{ rpfx }}" + resource_group: "{{ resource_group }}" + state: absent register: iothub -- assert: +- name: Assert the iot hub deleted + ansible.builtin.assert: that: - - iothub.changed + - iothub.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_ipgroup/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_ipgroup/tasks/main.yml index 8656c7110..604ecce32 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_ipgroup/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_ipgroup/tasks/main.yml @@ -1,5 +1,5 @@ - name: Create IP group name - set_fact: + ansible.builtin.set_fact: group_name: "ipgroup{{ resource_group | hash('md5') | truncate(22, True, '') }}" - name: Create IP group (check mode) @@ -14,7 +14,7 @@ tags: key1: "value1" state: present - check_mode: yes + check_mode: true - name: Create IP group azure_rm_ipgroup: @@ -31,7 +31,7 @@ register: results - name: Assert that IP group is created - assert: + ansible.builtin.assert: that: results.changed - name: Create same IP group again (Idempotent test) @@ -49,7 +49,7 @@ register: results - name: Assert that output is not changed - assert: + ansible.builtin.assert: that: not results.changed - name: Update IP group @@ -64,7 +64,7 @@ register: results - name: Assert that IP group is updated - assert: + ansible.builtin.assert: that: results.changed - name: Get IP group facts @@ -73,7 +73,8 @@ name: "{{ group_name }}" register: results -- assert: +- name: Assert the ip group facts + ansible.builtin.assert: that: - not results.changed - results.ipgroups[0].id != None @@ -91,7 +92,7 @@ register: results - name: Assert that IP group is deleted - assert: + ansible.builtin.assert: that: results.changed - name: Delete IP group again (Idempotent test) @@ -102,5 +103,5 @@ register: results - name: Asset that output is not changed - assert: + ansible.builtin.assert: that: not results.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_keyvault/lookup_plugins/azure_service_principal_attribute.py b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_keyvault/lookup_plugins/azure_service_principal_attribute.py index 1b7d0318f..c6f488f13 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_keyvault/lookup_plugins/azure_service_principal_attribute.py +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_keyvault/lookup_plugins/azure_service_principal_attribute.py @@ -45,15 +45,13 @@ _raw: """ from ansible.errors import AnsibleError -from ansible.plugins import AnsiblePlugin from ansible.plugins.lookup import LookupBase from ansible.module_utils._text import to_native try: from azure.common.credentials import ServicePrincipalCredentials from azure.graphrbac import GraphRbacManagementClient - from msrestazure import azure_cloud - from msrestazure.azure_exceptions import CloudError + from azure.cli.core import cloud as azure_cloud except ImportError: raise AnsibleError( "The lookup azure_service_principal_attribute requires azure.graphrbac, msrest") @@ -89,6 +87,6 @@ class LookupModule(LookupBase): sp = response[0] return sp.object_id.split(',') - except CloudError as ex: + except Exception as ex: raise AnsibleError("Failed to get service principal object id: %s" % to_native(ex)) return False diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_keyvault/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_keyvault/tasks/main.yml index 2cd690fbc..07f324d22 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_keyvault/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_keyvault/tasks/main.yml @@ -1,11 +1,11 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" tenant_id: "{{ azure_tenant }}" - run_once: yes + run_once: true -- name: lookup service principal object id - set_fact: +- name: Lookup service principal object id + ansible.builtin.set_fact: object_id: "{{ lookup('azure_service_principal_attribute', azure_client_id=azure_client_id, azure_secret=azure_secret, @@ -16,7 +16,7 @@ azure_rm_keyvault: resource_group: "{{ resource_group }}" vault_name: "vault{{ rpfx }}" - enabled_for_deployment: yes + enabled_for_deployment: true vault_tenant: "{{ tenant_id }}" soft_delete_retention_in_days: 7 sku: @@ -43,10 +43,10 @@ - recover - backup - restore - check_mode: yes + check_mode: true register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -54,7 +54,7 @@ azure_rm_keyvault: resource_group: "{{ resource_group }}" vault_name: "vault{{ rpfx }}" - enabled_for_deployment: yes + enabled_for_deployment: true vault_tenant: "{{ tenant_id }}" soft_delete_retention_in_days: 7 sku: @@ -74,7 +74,7 @@ register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -82,7 +82,7 @@ azure_rm_keyvault: resource_group: "{{ resource_group }}" vault_name: "vault{{ rpfx }}" - enabled_for_deployment: yes + enabled_for_deployment: true vault_tenant: "{{ tenant_id }}" soft_delete_retention_in_days: 7 sku: @@ -101,7 +101,7 @@ - restore register: output - name: Assert the state has not changed - assert: + ansible.builtin.assert: that: - output.changed == false @@ -109,7 +109,7 @@ azure_rm_keyvault: resource_group: "{{ resource_group }}" vault_name: "vault{{ rpfx }}" - enabled_for_deployment: yes + enabled_for_deployment: true vault_tenant: "{{ tenant_id }}" soft_delete_retention_in_days: 7 sku: @@ -140,7 +140,7 @@ aaa: bbb register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed == true @@ -151,7 +151,7 @@ register: facts - name: Assert the facts are properly set - assert: + ansible.builtin.assert: that: - facts['keyvaults'] | length == 1 - facts['keyvaults'][0]['vault_uri'] != None @@ -165,19 +165,22 @@ # azure_rm_keyvaultkey tests # -- name: create a keyvault key +- name: Create a keyvault key block: - - azure_rm_keyvaultkey: + - name: Create a keyvault key + azure_rm_keyvaultkey: keyvault_uri: https://vault{{ rpfx }}.vault.azure.net key_name: testkey tags: testing: test delete: on-exit register: output - - assert: + - name: Assert the keyvault key created + ansible.builtin.assert: that: output.changed rescue: - - azure_rm_keyvaultkey: + - name: Delete the keyvault key + azure_rm_keyvaultkey: keyvault_uri: https://vault{{ rpfx }}.vault.azure.net state: absent key_name: testkey @@ -189,7 +192,7 @@ register: facts - name: Assert key facts - assert: + ansible.builtin.assert: that: - facts['keys'] | length == 1 - facts['keys'][0]['kid'] @@ -197,22 +200,24 @@ - facts['keys'][0]['type'] - facts['keys'][0]['version'] -- name: delete a kevyault key +- name: Delete a kevyault key azure_rm_keyvaultkey: keyvault_uri: https://vault{{ rpfx }}.vault.azure.net state: absent key_name: testkey register: output -- assert: +- name: Assert the keyvault deleted + ansible.builtin.assert: that: output.changed # # azure_rm_keyvaultsecret tests # -- name: create a keyvault secret +- name: Create a keyvault secret block: - - azure_rm_keyvaultsecret: + - name: Create a keyvault secret + azure_rm_keyvaultsecret: keyvault_uri: https://vault{{ rpfx }}.vault.azure.net secret_name: testsecret secret_value: 'mysecret' @@ -220,22 +225,25 @@ testing: test delete: on-exit register: output - - assert: + - name: Assert the keyvault secret created + ansible.builtin.assert: that: output.changed rescue: - - azure_rm_keyvaultsecret: + - name: Delete the keyvault secret + azure_rm_keyvaultsecret: keyvault_uri: https://vault{{ rpfx }}.vault.azure.net state: absent secret_name: testsecret -- name: delete a keyvault secret +- name: Delete a keyvault secret azure_rm_keyvaultsecret: keyvault_uri: https://vault{{ rpfx }}.vault.azure.net state: absent secret_name: testsecret register: output -- assert: +- name: Assert the keyvault secret deleted + ansible.builtin.assert: that: output.changed # @@ -247,10 +255,10 @@ resource_group: "{{ resource_group }}" vault_name: "vault{{ rpfx }}" state: absent - check_mode: yes + check_mode: true register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -261,7 +269,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -272,6 +280,6 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed == false diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_keyvaultkey/lookup_plugins/azure_service_principal_attribute.py b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_keyvaultkey/lookup_plugins/azure_service_principal_attribute.py index 1b7d0318f..c6f488f13 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_keyvaultkey/lookup_plugins/azure_service_principal_attribute.py +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_keyvaultkey/lookup_plugins/azure_service_principal_attribute.py @@ -45,15 +45,13 @@ _raw: """ from ansible.errors import AnsibleError -from ansible.plugins import AnsiblePlugin from ansible.plugins.lookup import LookupBase from ansible.module_utils._text import to_native try: from azure.common.credentials import ServicePrincipalCredentials from azure.graphrbac import GraphRbacManagementClient - from msrestazure import azure_cloud - from msrestazure.azure_exceptions import CloudError + from azure.cli.core import cloud as azure_cloud except ImportError: raise AnsibleError( "The lookup azure_service_principal_attribute requires azure.graphrbac, msrest") @@ -89,6 +87,6 @@ class LookupModule(LookupBase): sp = response[0] return sp.object_id.split(',') - except CloudError as ex: + except Exception as ex: raise AnsibleError("Failed to get service principal object id: %s" % to_native(ex)) return False diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_keyvaultkey/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_keyvaultkey/tasks/main.yml index 1d09f9e6d..869cb7257 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_keyvaultkey/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_keyvaultkey/tasks/main.yml @@ -1,11 +1,11 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" tenant_id: "{{ azure_tenant }}" - run_once: yes + run_once: true -- name: lookup service principal object id - set_fact: +- name: Lookup service principal object id + ansible.builtin.set_fact: object_id: "{{ lookup('azure_service_principal_attribute', azure_client_id=azure_client_id, azure_secret=azure_secret, @@ -16,7 +16,7 @@ azure_rm_keyvault: resource_group: "{{ resource_group }}" vault_name: "vault{{ rpfx }}" - enabled_for_deployment: yes + enabled_for_deployment: true vault_tenant: "{{ tenant_id }}" sku: name: standard @@ -50,33 +50,37 @@ - restore register: output -- name: create a kevyault key +- name: Create a kevyault key block: - - azure_rm_keyvaultkey: + - name: Create a keyvault key + azure_rm_keyvaultkey: keyvault_uri: https://vault{{ rpfx }}.vault.azure.net key_name: testkey tags: testing: test delete: on-exit register: output - - assert: + - name: Assert the keyvault key created + ansible.builtin.assert: that: output.changed rescue: - - azure_rm_keyvaultkey: + - name: Delete the keyvault key + azure_rm_keyvaultkey: keyvault_uri: https://vault{{ rpfx }}.vault.azure.net state: absent key_name: testkey -- name: delete a kevyault key +- name: Delete a kevyault key azure_rm_keyvaultkey: keyvault_uri: https://vault{{ rpfx }}.vault.azure.net state: absent key_name: testkey register: output -- name: create a kevyault key of type EC +- name: Create a kevyault key of type EC block: - - azure_rm_keyvaultkey: + - name: Create a keyvault key of type EC + azure_rm_keyvaultkey: keyvault_uri: https://vault{{ rpfx }}.vault.azure.net key_name: testkeyEC key_type: EC @@ -84,24 +88,27 @@ testing: test delete: on-exit register: output - - assert: + - name: Assert the keyvault key created + ansible.builtin.assert: that: output.changed rescue: - - azure_rm_keyvaultkey: + - name: Delete the keyvault key + azure_rm_keyvaultkey: keyvault_uri: https://vault{{ rpfx }}.vault.azure.net state: absent key_name: testkeyEC -- name: delete a kevyault key of type EC +- name: Delete a kevyault key of type EC azure_rm_keyvaultkey: keyvault_uri: https://vault{{ rpfx }}.vault.azure.net state: absent key_name: testkeyEC register: output -- name: create a kevyault key of size 4096 +- name: Create a kevyault key of size 4096 block: - - azure_rm_keyvaultkey: + - name: Create a keyvault key of size 4096 + azure_rm_keyvaultkey: keyvault_uri: https://vault{{ rpfx }}.vault.azure.net key_name: testkey4096 key_size: 4096 @@ -109,24 +116,27 @@ testing: test delete: on-exit register: output - - assert: + - name: Assert the keyvault key created + ansible.builtin.assert: that: output.changed rescue: - - azure_rm_keyvaultkey: + - name: Delete the keyvault key + azure_rm_keyvaultkey: keyvault_uri: https://vault{{ rpfx }}.vault.azure.net state: absent key_name: testkey4096 -- name: delete a kevyault key of size 4096 +- name: Delete a kevyault key of size 4096 azure_rm_keyvaultkey: keyvault_uri: https://vault{{ rpfx }}.vault.azure.net state: absent key_name: testkey4096 register: output -- name: create a kevyault key with P-521 curve +- name: Create a kevyault key with P-521 curve block: - - azure_rm_keyvaultkey: + - name: Create a keyvault key with P-521 + azure_rm_keyvaultkey: keyvault_uri: https://vault{{ rpfx }}.vault.azure.net key_name: testkeycurve curve: P-521 @@ -134,24 +144,27 @@ testing: test delete: on-exit register: output - - assert: + - name: Assert the keyvault key created + ansible.builtin.assert: that: output.changed rescue: - - azure_rm_keyvaultkey: + - name: Delete the keyvault key + azure_rm_keyvaultkey: keyvault_uri: https://vault{{ rpfx }}.vault.azure.net state: absent key_name: testkeycurve -- name: delete a kevyault key with P-521 curve +- name: Delete a kevyault key with P-521 curve azure_rm_keyvaultkey: keyvault_uri: https://vault{{ rpfx }}.vault.azure.net state: absent key_name: testkeycurve register: output -- name: create a kevyault key with attributes +- name: Create a kevyault key with attributes block: - - azure_rm_keyvaultkey: + - name: Create a keyvault key with attributes + azure_rm_keyvaultkey: keyvault_uri: https://vault{{ rpfx }}.vault.azure.net key_name: testkeyattribute key_attributes: @@ -161,22 +174,25 @@ testing: test delete: on-exit register: output - - assert: + - name: Assert the keyvault key created + ansible.builtin.assert: that: output.changed rescue: - - azure_rm_keyvaultkey: + - name: Delete the keyvault ke + azure_rm_keyvaultkey: keyvault_uri: https://vault{{ rpfx }}.vault.azure.net state: absent key_name: testkeyattributes -- name: delete a kevyault key with attributes +- name: Delete a kevyault key with attributes azure_rm_keyvaultkey: keyvault_uri: https://vault{{ rpfx }}.vault.azure.net state: absent key_name: testkeyattribute register: output -- assert: +- name: Assert the keyvault key deleted + ansible.builtin.assert: that: output.changed - name: Delete instance of Key Vault diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_keyvaultsecret/lookup_plugins/azure_service_principal_attribute.py b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_keyvaultsecret/lookup_plugins/azure_service_principal_attribute.py index 1b7d0318f..c6f488f13 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_keyvaultsecret/lookup_plugins/azure_service_principal_attribute.py +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_keyvaultsecret/lookup_plugins/azure_service_principal_attribute.py @@ -45,15 +45,13 @@ _raw: """ from ansible.errors import AnsibleError -from ansible.plugins import AnsiblePlugin from ansible.plugins.lookup import LookupBase from ansible.module_utils._text import to_native try: from azure.common.credentials import ServicePrincipalCredentials from azure.graphrbac import GraphRbacManagementClient - from msrestazure import azure_cloud - from msrestazure.azure_exceptions import CloudError + from azure.cli.core import cloud as azure_cloud except ImportError: raise AnsibleError( "The lookup azure_service_principal_attribute requires azure.graphrbac, msrest") @@ -89,6 +87,6 @@ class LookupModule(LookupBase): sp = response[0] return sp.object_id.split(',') - except CloudError as ex: + except Exception as ex: raise AnsibleError("Failed to get service principal object id: %s" % to_native(ex)) return False diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_keyvaultsecret/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_keyvaultsecret/tasks/main.yml index 0a4226a0e..d91641d80 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_keyvaultsecret/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_keyvaultsecret/tasks/main.yml @@ -1,11 +1,11 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" tenant_id: "{{ azure_tenant }}" - run_once: yes + run_once: true -- name: lookup service principal object id - set_fact: +- name: Lookup service principal object id + ansible.builtin.set_fact: object_id: "{{ lookup('azure_service_principal_attribute', azure_client_id=azure_client_id, azure_secret=azure_secret, @@ -16,7 +16,7 @@ azure_rm_keyvault: resource_group: "{{ resource_group }}" vault_name: "vault{{ rpfx }}" - enabled_for_deployment: yes + enabled_for_deployment: true vault_tenant: "{{ tenant_id }}" sku: name: standard @@ -44,23 +44,26 @@ - restore register: output -- name: create a kevyault secret +- name: Create a kevyault secret block: - - azure_rm_keyvaultsecret: + - name: Create a kevyault secret + azure_rm_keyvaultsecret: keyvault_uri: https://vault{{ rpfx }}.vault.azure.net secret_name: testsecret secret_value: 'mysecret' content_type: 'Content Type Secret' - secret_valid_from: 2000-01-02T010203Z - secret_expiry: 2030-03-04T040506Z + secret_valid_from: 2000-01-02T010203Z + secret_expiry: 2030-03-04T040506Z tags: testing: test delete: on-exit register: output - - assert: + - name: Assert the keyvault secret created + ansible.builtin.assert: that: output.changed rescue: - - azure_rm_keyvaultsecret: + - name: Delete the keyvault secret + azure_rm_keyvaultsecret: keyvault_uri: https://vault{{ rpfx }}.vault.azure.net state: absent secret_name: testsecret @@ -72,7 +75,7 @@ register: facts - name: Assert secret facts - assert: + ansible.builtin.assert: that: - facts['secrets'] | length == 1 - facts['secrets'][0]['sid'] @@ -85,12 +88,13 @@ - facts['secrets'][0]['attributes']['expires'] == "2030-03-04T04:05:06+00:00" - facts['secrets'][0]['attributes']['not_before'] == "2000-01-02T01:02:03+00:00" -- name: delete a kevyault secret +- name: Delete a kevyault secret azure_rm_keyvaultsecret: keyvault_uri: https://vault{{ rpfx }}.vault.azure.net state: absent secret_name: testsecret register: output -- assert: +- name: Assert the keyvault secret deleted + ansible.builtin.assert: that: output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_loadbalancer/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_loadbalancer/tasks/main.yml index 2c1eb736e..913e618d0 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_loadbalancer/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_loadbalancer/tasks/main.yml @@ -1,5 +1,5 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: pipaname: "pipa{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" pipbname: "pipb{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" lbvnname: "lbvn{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" @@ -8,84 +8,84 @@ lbname_c1: "lbc1-{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" lbname_c2: "lbc2-{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" lbname_d: "lbd{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - run_once: yes + run_once: true -- name: create public ip +- name: Create public ip azure_rm_publicipaddress: name: "{{ pipbname }}" sku: Standard allocation_method: Static resource_group: '{{ resource_group }}' -- name: create public ip +- name: Create public ip azure_rm_publicipaddress: name: "{{ pipaname }}" resource_group: '{{ resource_group }}' -- name: clear load balancer +- name: Clear load balancer azure_rm_loadbalancer: resource_group: '{{ resource_group }}' name: "{{ lbname_a }}" state: absent -- name: create load balancer -- check mode +- name: Create load balancer -- check mode azure_rm_loadbalancer: resource_group: '{{ resource_group }}' name: "{{ lbname_a }}" public_ip: "{{ pipaname }}" - check_mode: yes + check_mode: true register: output -- name: assert load balancer created - assert: +- name: Assert load balancer created + ansible.builtin.assert: that: output.changed -- name: create load balancer +- name: Create load balancer azure_rm_loadbalancer: resource_group: '{{ resource_group }}' name: "{{ lbname_a }}" public_ip: "{{ pipaname }}" register: output -- name: assert load balancer created - assert: +- name: Assert load balancer created + ansible.builtin.assert: that: output.changed -- name: create load balancer -- idempotent +- name: Create load balancer -- idempotent azure_rm_loadbalancer: resource_group: '{{ resource_group }}' name: "{{ lbname_a }}" public_ip: "{{ pipaname }}" register: output -- name: assert no change - assert: +- name: Assert no change + ansible.builtin.assert: that: - not output.changed -- name: delete load balancer +- name: Delete load balancer azure_rm_loadbalancer: resource_group: '{{ resource_group }}' name: "{{ lbname_a }}" state: absent register: output -- name: assert load balancer deleted - assert: +- name: Assert load balancer deleted + ansible.builtin.assert: that: output.changed -- name: delete load balancer (idempotent) +- name: Delete load balancer (idempotent) azure_rm_loadbalancer: resource_group: '{{ resource_group }}' name: "{{ lbname_a }}" state: absent register: output -- name: assert load balancer deleted (idempotent) - assert: +- name: Assert load balancer deleted (idempotent) + ansible.builtin.assert: that: not output.changed -- name: create another load balancer with more options +- name: Create another load balancer with more options azure_rm_loadbalancer: resource_group: '{{ resource_group }}' name: "{{ lbname_b }}" @@ -106,13 +106,13 @@ natpool_protocol: Tcp register: output -- name: assert complex load balancer created - assert: +- name: Assert complex load balancer created + ansible.builtin.assert: that: - - output.changed - - output.state.sku.name == 'Standard' + - output.changed + - output.state.sku.name == 'Standard' -- name: create load balancer again to check idempotency +- name: Create load balancer again to check idempotency azure_rm_loadbalancer: resource_group: '{{ resource_group }}' name: "{{ lbname_b }}" @@ -133,12 +133,12 @@ natpool_protocol: Tcp register: output -- name: assert that output has not changed - assert: +- name: Assert that output has not changed + ansible.builtin.assert: that: - - not output.changed + - not output.changed -- name: create load balancer again to check idempotency - change something +- name: Create load balancer again to check idempotency - change something azure_rm_loadbalancer: resource_group: '{{ resource_group }}' name: "{{ lbname_b }}" @@ -159,18 +159,18 @@ natpool_protocol: Tcp register: output -- name: assert that output has changed - assert: +- name: Assert that output has changed + ansible.builtin.assert: that: - - output.changed + - output.changed -- name: delete load balancer +- name: Delete load balancer azure_rm_loadbalancer: resource_group: '{{ resource_group }}' name: "{{ lbname_b }}" state: absent -- name: create load balancer with multiple parameters +- name: Create load balancer with multiple parameters azure_rm_loadbalancer: resource_group: '{{ resource_group }}' name: "{{ lbname_c1 }}" @@ -196,21 +196,21 @@ frontend_port: 80 backend_port: 80 probe: prob0 - disable_outbound_snat: True + disable_outbound_snat: true register: output -- name: assert complex load balancer created - assert: +- name: Assert complex load balancer created + ansible.builtin.assert: that: - output.changed -- name: delete load balancer +- name: Delete load balancer azure_rm_loadbalancer: resource_group: '{{ resource_group }}' name: "{{ lbname_c1 }}" state: absent -- name: create load balancer with multiple parameters +- name: Create load balancer with multiple parameters azure_rm_loadbalancer: resource_group: '{{ resource_group }}' name: "{{ lbname_c2 }}" @@ -229,7 +229,7 @@ frontend_port: 80 backend_port: 80 probe: prob0 - disable_outbound_snat: True + disable_outbound_snat: true inbound_nat_rules: - name: inboundnatrule0 backend_port: 8080 @@ -238,11 +238,11 @@ frontend_ip_configuration: frontendipconf0 register: output -- name: assert complex load balancer created - assert: +- name: Assert complex load balancer created + ansible.builtin.assert: that: output.changed -- name: delete load balancer +- name: Delete load balancer azure_rm_loadbalancer: resource_group: '{{ resource_group }}' name: "{{ lbname_c2 }}" @@ -250,19 +250,19 @@ - name: Create virtual network azure_rm_virtualnetwork: - resource_group: "{{ resource_group }}" - name: "{{ lbvnname }}" - address_prefixes: "10.10.0.0/16" + resource_group: "{{ resource_group }}" + name: "{{ lbvnname }}" + address_prefixes: "10.10.0.0/16" - name: Add subnet azure_rm_subnet: - resource_group: "{{ resource_group }}" - name: "lb{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}sb" - address_prefix: "10.10.0.0/24" - virtual_network: "{{ lbvnname }}" + resource_group: "{{ resource_group }}" + name: "lb{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}sb" + address_prefix: "10.10.0.0/24" + virtual_network: "{{ lbvnname }}" register: subnet -- name: create internal loadbalancer +- name: Create internal loadbalancer azure_rm_loadbalancer: resource_group: '{{ resource_group }}' name: "{{ lbname_d }}" @@ -295,39 +295,39 @@ frontend_port: 80 backend_port: 80 probe: prob0 - disable_outbound_snat: False + disable_outbound_snat: false register: output -- name: assert complex load balancer created - assert: +- name: Assert complex load balancer created + ansible.builtin.assert: that: - output.changed - output.state.frontend_ip_configurations[0].zones | length == 3 -- name: delete load balancer +- name: Delete load balancer azure_rm_loadbalancer: resource_group: '{{ resource_group }}' name: "{{ lbname_d }}" state: absent -- name: cleanup public ip +- name: Cleanup public ip azure_rm_publicipaddress: name: "{{ item }}" resource_group: '{{ resource_group }}' state: absent with_items: - - "{{ pipaname }}" - - "{{ pipbname }}" + - "{{ pipaname }}" + - "{{ pipbname }}" -- name: cleanup subnet +- name: Cleanup subnet azure_rm_subnet: - resource_group: "{{ resource_group }}" - name: "lb{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}sb" - virtual_network: "{{ lbvnname }}" - state: absent + resource_group: "{{ resource_group }}" + name: "lb{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}sb" + virtual_network: "{{ lbvnname }}" + state: absent -- name: cleanup virtual network +- name: Cleanup virtual network azure_rm_virtualnetwork: - resource_group: "{{ resource_group }}" - name: "{{ lbvnname }}" - state: absent + resource_group: "{{ resource_group }}" + name: "{{ lbvnname }}" + state: absent diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_loganalyticsworkspace/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_loganalyticsworkspace/tasks/main.yml index 3c9e1d493..be5e45572 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_loganalyticsworkspace/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_loganalyticsworkspace/tasks/main.yml @@ -1,26 +1,27 @@ - name: Prepare random number - set_fact: - name: "loganalytics{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" + ansible.builtin.set_fact: + name_rpfx: "loganalytics{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" retention_days: 60 - name: Create Log Analytics Workspace (Check Mode On) azure_rm_loganalyticsworkspace: - name: "{{ name }}" + name: "{{ name_rpfx }}" intelligence_packs: Backup: true Containers: true retention_in_days: "{{ retention_days }}" resource_group: "{{ resource_group }}" - check_mode: yes + check_mode: true register: output -- assert: +- name: Assert there is no log analytics workspace + ansible.builtin.assert: that: - output.changed - name: Get Log Analytics workspace information azure_rm_loganalyticsworkspace_info: - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" show_intelligence_packs: true show_management_groups: true @@ -28,13 +29,14 @@ show_usages: true register: facts -- assert: +- name: Assert the log analytics workspace facts + ansible.builtin.assert: that: - facts.workspaces | length == 0 - name: Create Log Analytics Workspace azure_rm_loganalyticsworkspace: - name: "{{ name }}" + name: "{{ name_rpfx }}" intelligence_packs: Backup: true Containers: true @@ -44,7 +46,8 @@ key1: value1 register: output -- assert: +- name: Assert the log analytics workspace created + ansible.builtin.assert: that: - output.changed - output.retention_in_days == 30 @@ -55,7 +58,7 @@ - name: Update Log Analytics Workspace azure_rm_loganalyticsworkspace: - name: "{{ name }}" + name: "{{ name_rpfx }}" intelligence_packs: Backup: true Containers: true @@ -66,7 +69,8 @@ key2: value2 register: output -- assert: +- name: Assert the log analytics workspace updated + ansible.builtin.assert: that: - output.changed - output.retention_in_days == retention_days @@ -74,7 +78,7 @@ - name: Get Log Analytics workspace information (Show full information) azure_rm_loganalyticsworkspace_info: - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" show_intelligence_packs: true show_management_groups: true @@ -82,7 +86,8 @@ show_usages: true register: facts -- assert: +- name: Assert the log analytics workspace facts + ansible.builtin.assert: that: - not facts.changed - facts.workspaces | length > 0 @@ -100,11 +105,12 @@ - name: Get Log Analytics workspace information (Show default information) azure_rm_loganalyticsworkspace_info: - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" register: facts -- assert: +- name: Assert the log analytics workspace facts + ansible.builtin.assert: that: - not facts.changed - facts.workspaces | length > 0 @@ -117,67 +123,73 @@ - name: Create Log Analytics workspace (Test Idempotence) azure_rm_loganalyticsworkspace: - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" retention_in_days: "{{ retention_days }}" register: output -- assert: +- name: Assert the log anaytics workspace already created + ansible.builtin.assert: that: - not output.changed - name: Remove Log Analytics workspace (Check Mode On) azure_rm_loganalyticsworkspace: - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" state: absent - check_mode: yes + check_mode: true register: output -- assert: +- name: Assert there is no log anaytics workspace + ansible.builtin.assert: that: - output.changed - name: Get Log Analytics workspace information(Check still exists after remove Check Mode On) azure_rm_loganalyticsworkspace_info: - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" register: facts -- assert: +- name: Assert the log analytics workspace facts + ansible.builtin.assert: that: - facts.workspaces | length == 1 - name: Remove Log Analytics workspace azure_rm_loganalyticsworkspace: - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" state: absent force: true register: output -- assert: +- name: Assert the log analytics workspace deleted + ansible.builtin.assert: that: - output.changed - name: Get Log Analytics workspace information azure_rm_loganalyticsworkspace_info: - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" register: facts -- assert: +- name: Assert the log analytics workspace facts + ansible.builtin.assert: that: - facts.workspaces | length == 0 - name: Remove Log Analytics workspace (Test Idempotence) azure_rm_loganalyticsworkspace: - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" state: absent force: true register: output -- assert: +- name: Assert the log analytics workspace deleted + ansible.builtin.assert: that: - not output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_manageddisk/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_manageddisk/tasks/main.yml index ce6b4e6b6..1ccae8fc0 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_manageddisk/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_manageddisk/tasks/main.yml @@ -1,260 +1,268 @@ - - name: Prepare random number - set_fact: - rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - parameter: {} - run_once: yes - - - name: Clearing (if) previous disks were created - azure_rm_manageddisk: - resource_group: "{{ resource_group }}" - name: "md{{ rpfx }}{{ item }}" - managed_by: '' - state: absent - with_items: - - 1 - - 2 - - 3 - - - name: Test invalid account name (should give error) - azure_rm_manageddisk: - resource_group: "{{ resource_group }}" - name: "invalid_char$" - disk_size_gb: 1 - register: output - ignore_errors: yes - check_mode: no - - - name: Assert task failed - assert: { that: "output['failed'] == True" } - - - name: Create managed disk (Check Mode) - azure_rm_manageddisk: - resource_group: "{{ resource_group }}" - name: "md{{ rpfx }}1" - storage_account_type: "Standard_LRS" - disk_size_gb: 1 - tags: - testing: testing - delete: never - register: output - check_mode: yes - - - name: Assert status succeeded (Check Mode) - assert: - that: - - output.changed - - output.state - - - name: Create new managed disk succesfully - azure_rm_manageddisk: - resource_group: "{{ resource_group }}" - name: "md{{ rpfx }}1" - storage_account_type: "Standard_LRS" - disk_size_gb: 1 - tags: - testing: testing - delete: never - register: output - - - name: Assert status succeeded and results include an Id value - assert: - that: - - output.changed - - output.state.disk_size_gb == 1 - - output.state.id is defined - - output.state.os_type == None - - output.state.storage_account_type == "Standard_LRS" - - - name: Copy disk to a new managed disk - azure_rm_manageddisk: - resource_group: "{{ resource_group }}" - name: "md{{ rpfx }}2" - create_option: "copy" - source_uri: "{{ output.state.id }}" - disk_size_gb: 1 - register: disk2 - - - name: Assert status succeeded and results include an Id value - assert: - that: - - disk2.changed - - disk2.state.id is defined - - - name: Create disk to a new managed disk with zone and os type - azure_rm_manageddisk: - resource_group: "{{ resource_group }}" - name: "md{{ rpfx }}3" - source_uri: "{{ output.state.id }}" - disk_size_gb: 1 - zone: "1" - os_type: windows - register: disk3 - - - name: Assert status succeeded and results include an Id value - assert: - that: - - disk3.changed - - disk3.state.id is defined - - disk3.state.zone == "1" - - disk3.state.os_type == "windows" - - - name: Change storage account type to an invalid type - azure_rm_manageddisk: - resource_group: "{{ resource_group }}" - name: "md{{ rpfx }}1" - storage_account_type: "PremiumL" - disk_size_gb: 1 - register: output - ignore_errors: yes - - - name: Assert storage account type change failed - assert: { that: "output['failed'] == True" } - - - name: Update disk options (os_type, account_type, size, tags) - azure_rm_manageddisk: - resource_group: "{{ resource_group }}" - name: "md{{ rpfx }}1" - disk_size_gb: 2 - os_type: linux - storage_account_type: "StandardSSD_LRS" - tags: - galaxy: "no" - delete: never - register: output - - - assert: - that: - - output.changed - - output.state.storage_account_type == "StandardSSD_LRS" - - output.state.disk_size_gb == 2 - - "output.state.tags | length == 2" - - "output.state.tags.galaxy == 'no'" - - output.state.os_type == 'linux' - - - name: Gather facts to one specific disk - azure_rm_manageddisk_info: - resource_group: "{{ resource_group }}" - name: "md{{ rpfx }}1" - register: output - - - assert: - that: - - "output.ansible_info.azure_managed_disk | length == 1" - - output.ansible_info.azure_managed_disk[0].storage_account_type == "StandardSSD_LRS" - - output.ansible_info.azure_managed_disk[0].disk_size_gb == 2 - - "output.ansible_info.azure_managed_disk[0].os_type == 'linux'" - - - set_fact: - parameter: "{{parameter |combine({item.key: item.value})}}" - when: "{{item.key not in ['id', 'changed'] and item.value != None}}" - with_dict: "{{ output.ansible_info.azure_managed_disk[0] }}" - - - name: Create disk with facts return value - azure_rm_manageddisk: - resource_group: "{{ resource_group }}" - location: "{{ parameter.location }}" - name: "{{ parameter.name }}" - storage_account_type: "{{ parameter.storage_account_type }}" - disk_size_gb: "{{ parameter.disk_size_gb }}" - create_option: "{{ parameter.create_option }}" - tags: "{{ parameter.tags }}" - register: output - - - assert: - that: - - not output.changed - - - name: Create new managed disk with I(account_type=StandardSSD_ZRS) - azure_rm_manageddisk: - resource_group: "{{ resource_group }}" - name: "md{{ rpfx }}4" - storage_account_type: "StandardSSD_ZRS" - disk_size_gb: 2 - location: westus2 - register: output - - - assert: - that: - - output.changed - - output.state.storage_account_type == "StandardSSD_ZRS" - - output.state.disk_size_gb == 2 - - - name: Gather facts to one specific disk - azure_rm_manageddisk_info: - resource_group: "{{ resource_group }}" - name: "md{{ rpfx }}4" - register: output - - - assert: - that: - - "output.ansible_info.azure_managed_disk | length == 1" - - output.ansible_info.azure_managed_disk[0].storage_account_type == "StandardSSD_ZRS" - - output.ansible_info.azure_managed_disk[0].disk_size_gb == 2 - - - name: Create new managed disk with I(account_type=Premium_ZRS) - azure_rm_manageddisk: - resource_group: "{{ resource_group }}" - name: "md{{ rpfx }}5" - storage_account_type: "Premium_ZRS" - disk_size_gb: 2 - location: westus2 - register: output - - - assert: - that: - - output.changed - - output.state.storage_account_type == "Premium_ZRS" - - output.state.disk_size_gb == 2 - - - name: Gather facts to one specific disk - azure_rm_manageddisk_info: - resource_group: "{{ resource_group }}" - name: "md{{ rpfx }}5" - register: output - - - assert: - that: - - "output.ansible_info.azure_managed_disk | length == 1" - - output.ansible_info.azure_managed_disk[0].storage_account_type == "Premium_ZRS" - - output.ansible_info.azure_managed_disk[0].disk_size_gb == 2 - - - name: Delete managed disk (Check Mode) - azure_rm_manageddisk: - resource_group: "{{ resource_group }}" - name: "md{{ rpfx }}1" - state: absent - register: output - check_mode: yes - - - name: Assert status succeeded - assert: - that: - - output.changed - - output.state - - - name: Delete all managed disk - azure_rm_manageddisk: - resource_group: "{{ resource_group }}" - name: "md{{ rpfx }}{{ item }}" - managed_by: '' - state: absent - with_items: - - 1 - - 2 - - 3 - - 4 - - 5 - - - name: Delete virtual machine - azure_rm_virtualmachine: - resource_group: "{{ resource_group }}" - name: "tr{{ rpfx }}" - state: absent - vm_size: Standard_DS1_v2 - - - name: Delete public ip - azure_rm_publicipaddress: - resource_group: "{{ resource_group }}" - allocation_method: Static - name: "tr{{ rpfx }}" - state: absent +- name: Prepare random number + ansible.builtin.set_fact: + rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" + parameter: {} + run_once: true + +- name: Clearing (if) previous disks were created + azure_rm_manageddisk: + resource_group: "{{ resource_group }}" + name: "md{{ rpfx }}{{ item }}" + managed_by: '' + state: absent + with_items: + - 1 + - 2 + - 3 + +- name: Test invalid account name (should give error) + azure_rm_manageddisk: + resource_group: "{{ resource_group }}" + name: "invalid_char$" + disk_size_gb: 1 + register: output + ignore_errors: true + check_mode: false + +- name: Assert task failed + ansible.builtin.assert: { that: "output['failed'] == True" } + +- name: Create managed disk (Check Mode) + azure_rm_manageddisk: + resource_group: "{{ resource_group }}" + name: "md{{ rpfx }}1" + storage_account_type: "Standard_LRS" + disk_size_gb: 1 + tags: + testing: testing + delete: never + register: output + check_mode: true + +- name: Assert status succeeded (Check Mode) + ansible.builtin.assert: + that: + - output.changed + - output.state + +- name: Create new managed disk succesfully + azure_rm_manageddisk: + resource_group: "{{ resource_group }}" + name: "md{{ rpfx }}1" + storage_account_type: "Standard_LRS" + disk_size_gb: 1 + tags: + testing: testing + delete: never + register: output + +- name: Assert status succeeded and results include an Id value + ansible.builtin.assert: + that: + - output.changed + - output.state.disk_size_gb == 1 + - output.state.id is defined + - output.state.os_type == None + - output.state.storage_account_type == "Standard_LRS" + +- name: Copy disk to a new managed disk + azure_rm_manageddisk: + resource_group: "{{ resource_group }}" + name: "md{{ rpfx }}2" + create_option: "copy" + source_uri: "{{ output.state.id }}" + disk_size_gb: 1 + register: disk2 + +- name: Assert status succeeded and results include an Id value + ansible.builtin.assert: + that: + - disk2.changed + - disk2.state.id is defined + +- name: Create disk to a new managed disk with zone and os type + azure_rm_manageddisk: + resource_group: "{{ resource_group }}" + name: "md{{ rpfx }}3" + source_uri: "{{ output.state.id }}" + disk_size_gb: 1 + zone: "1" + os_type: windows + register: disk3 + +- name: Assert status succeeded and results include an Id value + ansible.builtin.assert: + that: + - disk3.changed + - disk3.state.id is defined + - disk3.state.zone == "1" + - disk3.state.os_type == "windows" + +- name: Change storage account type to an invalid type + azure_rm_manageddisk: + resource_group: "{{ resource_group }}" + name: "md{{ rpfx }}1" + storage_account_type: "PremiumL" + disk_size_gb: 1 + register: output + ignore_errors: true + +- name: Assert storage account type change failed + ansible.builtin.assert: { that: "output['failed'] == True" } + +- name: Update disk options (os_type, account_type, size, tags) + azure_rm_manageddisk: + resource_group: "{{ resource_group }}" + name: "md{{ rpfx }}1" + disk_size_gb: 2 + os_type: linux + storage_account_type: "StandardSSD_LRS" + tags: + galaxy: "no" + delete: never + register: output + +- name: Assert the disk updated + ansible.builtin.assert: + that: + - output.changed + - output.state.storage_account_type == "StandardSSD_LRS" + - output.state.disk_size_gb == 2 + - "output.state.tags | length == 2" + - "output.state.tags.galaxy == 'no'" + - output.state.os_type == 'linux' + +- name: Gather facts to one specific disk + azure_rm_manageddisk_info: + resource_group: "{{ resource_group }}" + name: "md{{ rpfx }}1" + register: output + +- name: Assert the disk facts + ansible.builtin.assert: + that: + - "output.ansible_info.azure_managed_disk | length == 1" + - output.ansible_info.azure_managed_disk[0].storage_account_type == "StandardSSD_LRS" + - output.ansible_info.azure_managed_disk[0].disk_size_gb == 2 + - "output.ansible_info.azure_managed_disk[0].os_type == 'linux'" + +- name: Set variables + ansible.builtin.set_fact: + parameter: "{{ parameter | combine({item.key: item.value}) }}" + when: item.key not in ['id', 'changed'] and item.value != None + with_dict: "{{ output.ansible_info.azure_managed_disk[0] }}" + +- name: Create disk with facts return value + azure_rm_manageddisk: + resource_group: "{{ resource_group }}" + location: "{{ parameter.location }}" + name: "{{ parameter.name }}" + storage_account_type: "{{ parameter.storage_account_type }}" + disk_size_gb: "{{ parameter.disk_size_gb }}" + create_option: "{{ parameter.create_option }}" + tags: "{{ parameter.tags }}" + register: output + +- name: Assert the disk created + ansible.builtin.assert: + that: + - not output.changed + +- name: Create new managed disk with I(account_type=StandardSSD_ZRS) + azure_rm_manageddisk: + resource_group: "{{ resource_group }}" + name: "md{{ rpfx }}4" + storage_account_type: "StandardSSD_ZRS" + disk_size_gb: 2 + location: westus2 + register: output + +- name: Assert the managed disk update + ansible.builtin.assert: + that: + - output.changed + - output.state.storage_account_type == "StandardSSD_ZRS" + - output.state.disk_size_gb == 2 + +- name: Gather facts to one specific disk + azure_rm_manageddisk_info: + resource_group: "{{ resource_group }}" + name: "md{{ rpfx }}4" + register: output + +- name: Assert the managed disk facts + ansible.builtin.assert: + that: + - "output.ansible_info.azure_managed_disk | length == 1" + - output.ansible_info.azure_managed_disk[0].storage_account_type == "StandardSSD_ZRS" + - output.ansible_info.azure_managed_disk[0].disk_size_gb == 2 + +- name: Create new managed disk with I(account_type=Premium_ZRS) + azure_rm_manageddisk: + resource_group: "{{ resource_group }}" + name: "md{{ rpfx }}5" + storage_account_type: "Premium_ZRS" + disk_size_gb: 2 + location: westus2 + register: output + +- name: Assert the managed disk created + ansible.builtin.assert: + that: + - output.changed + - output.state.storage_account_type == "Premium_ZRS" + - output.state.disk_size_gb == 2 + +- name: Gather facts to one specific disk + azure_rm_manageddisk_info: + resource_group: "{{ resource_group }}" + name: "md{{ rpfx }}5" + register: output + +- name: Assert the managed disk facts + ansible.builtin.assert: + that: + - "output.ansible_info.azure_managed_disk | length == 1" + - output.ansible_info.azure_managed_disk[0].storage_account_type == "Premium_ZRS" + - output.ansible_info.azure_managed_disk[0].disk_size_gb == 2 + +- name: Delete managed disk (Check Mode) + azure_rm_manageddisk: + resource_group: "{{ resource_group }}" + name: "md{{ rpfx }}1" + state: absent + register: output + check_mode: true + +- name: Assert status succeeded + ansible.builtin.assert: + that: + - output.changed + - output.state + +- name: Delete all managed disk + azure_rm_manageddisk: + resource_group: "{{ resource_group }}" + name: "md{{ rpfx }}{{ item }}" + managed_by: '' + state: absent + with_items: + - 1 + - 2 + - 3 + - 4 + - 5 + +- name: Delete virtual machine + azure_rm_virtualmachine: + resource_group: "{{ resource_group }}" + name: "tr{{ rpfx }}" + state: absent + vm_size: Standard_DS1_v2 + +- name: Delete public ip + azure_rm_publicipaddress: + resource_group: "{{ resource_group }}" + allocation_method: Static + name: "tr{{ rpfx }}" + state: absent diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_managementgroup/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_managementgroup/tasks/main.yml index 3a6c03649..1f4e94634 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_managementgroup/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_managementgroup/tasks/main.yml @@ -5,31 +5,31 @@ - name: Get a managementgroup by id azure_rm_managementgroup_info: id: "{{ az_all_managementgroups.management_groups[0].id }}" - recurse: True - flatten: True - children: True + recurse: true + flatten: true + children: true register: az_recursive_managementgroups - name: Get a managementgroup by name azure_rm_managementgroup_info: name: "{{ az_all_managementgroups.management_groups[0].name }}" - recurse: True - flatten: True + recurse: true + flatten: true - name: Test invalid name id combo azure_rm_managementgroup_info: name: "{{ az_all_managementgroups.management_groups[0].name }}" id: "{{ az_all_managementgroups.management_groups[0].id }}" register: invalid_name - ignore_errors: yes + ignore_errors: true - name: Validate expected states - assert: + ansible.builtin.assert: that: - invalid_name['failed'] - name: Validate expected attributes - assert: + ansible.builtin.assert: that: - "{{ item.id is defined }}" loop: "{{ az_recursive_managementgroups.management_groups + az_recursive_managementgroups.subscriptions }}" diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_mariadbserver/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_mariadbserver/tasks/main.yml index 14d101a9a..4fd89fb26 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_mariadbserver/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_mariadbserver/tasks/main.yml @@ -1,7 +1,7 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - run_once: yes + run_once: true - name: Create instance of MariaDB Server -- check mode azure_rm_mariadbserver: @@ -13,13 +13,13 @@ location: westus2 storage_mb: 51200 version: 10.2 - enforce_ssl: True + enforce_ssl: true admin_username: zimxyz admin_password: Password123! - check_mode: yes + check_mode: true register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -33,12 +33,12 @@ location: westus2 storage_mb: 51200 version: 10.2 - enforce_ssl: True + enforce_ssl: true admin_username: zimxyz admin_password: Password123! register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed - output.state == 'Ready' @@ -53,12 +53,12 @@ location: westus2 storage_mb: 51200 version: 10.2 - enforce_ssl: True + enforce_ssl: true admin_username: zimxyz admin_password: Password123! register: output - name: Assert the state has not changed - assert: + ansible.builtin.assert: that: - output.changed == false - output.state == 'Ready' @@ -73,16 +73,17 @@ location: westus2 storage_mb: 128000 version: 10.2 - enforce_ssl: True + enforce_ssl: true admin_username: zimxyz admin_password: Password123! register: output - name: Assert the state has not changed - assert: + ansible.builtin.assert: that: - output.changed - output.state == 'Ready' -- debug: +- name: Print the state of the mariadb server + ansible.builtin.debug: var: output - name: Gather facts MariaDB Server @@ -91,7 +92,7 @@ name: mariadbsrv{{ rpfx }} register: output - name: Assert that storage size is correct - assert: + ansible.builtin.assert: that: - output.servers[0]['storage_mb'] == 128000 @@ -105,7 +106,7 @@ location: westus2 storage_mb: 51200 version: 10.3 - enforce_ssl: True + enforce_ssl: true admin_username: zimxyz admin_password: Password123! tags: @@ -121,7 +122,7 @@ location: westus2 storage_mb: 51200 version: 10.3 - enforce_ssl: True + enforce_ssl: true admin_username: zimxyz admin_password: Password123! tags: @@ -131,10 +132,10 @@ azure_rm_mariadbserver_info: resource_group: "{{ resource_group }}" name: mariadbsrv{{ rpfx }}second - register: output + register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.servers[0]['id'] != None @@ -154,7 +155,7 @@ resource_group: "{{ resource_group }}" register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.servers[0]['id'] != None @@ -184,10 +185,10 @@ resource_group: "{{ resource_group }}" server_name: mariadbsrv{{ rpfx }} name: testdatabase - check_mode: yes + check_mode: true register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -200,7 +201,7 @@ charset: latin1 register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed - output.name == 'testdatabase' @@ -214,7 +215,7 @@ charset: latin1 register: output - name: Assert the state has not changed - assert: + ansible.builtin.assert: that: - output.changed == false - output.name == 'testdatabase' @@ -226,10 +227,10 @@ name: testdatabase collation: utf8_general_ci charset: utf8 - ignore_errors: yes + ignore_errors: true register: output - name: Assert that nothing has changed - assert: + ansible.builtin.assert: that: - output.changed == False @@ -240,10 +241,10 @@ name: testdatabase collation: utf8_general_ci charset: utf8 - force_update: yes + force_update: true register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed - output.name == 'testdatabase' @@ -259,10 +260,10 @@ resource_group: "{{ resource_group }}" server_name: mariadbsrv{{ rpfx }} name: testdatabase - register: output + register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.databases[0]['server_name'] != None @@ -276,7 +277,7 @@ server_name: mariadbsrv{{ rpfx }} register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.databases[0]['server_name'] != None @@ -294,10 +295,10 @@ server_name: mariadbsrv{{ rpfx }} name: testdatabase state: absent - check_mode: yes + check_mode: true register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -309,7 +310,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -321,7 +322,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed == false @@ -335,10 +336,10 @@ name: firewallrule{{ rpfx }} start_ip_address: 172.28.10.136 end_ip_address: 172.28.10.138 - check_mode: yes + check_mode: true register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -351,7 +352,7 @@ end_ip_address: 172.28.10.138 register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -364,7 +365,7 @@ end_ip_address: 172.28.10.138 register: output - name: Assert the state has not changed - assert: + ansible.builtin.assert: that: - output.changed == false @@ -374,10 +375,10 @@ server_name: mariadbsrv{{ rpfx }} name: firewallrule{{ rpfx }} state: absent - check_mode: yes + check_mode: true register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -390,7 +391,7 @@ end_ip_address: 172.28.10.138 register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -401,7 +402,7 @@ name: firewallrule{{ rpfx }} register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.rules[0].id != None @@ -417,7 +418,7 @@ server_name: mariadbsrv{{ rpfx }} register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.rules[0].id != None @@ -439,7 +440,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -451,7 +452,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed == false @@ -469,7 +470,7 @@ name: firewallrule{{ rpfx }} register: output - name: Assert that empty list was returned - assert: + ansible.builtin.assert: that: - output.changed == False - "output.rules | length == 0" @@ -483,10 +484,10 @@ server_name: mariadbsrv{{ rpfx }} name: event_scheduler value: "ON" - check_mode: yes + check_mode: true register: output - name: Assert that change was registered - assert: + ansible.builtin.assert: that: - output.changed @@ -497,7 +498,7 @@ name: event_scheduler register: output - name: Get facts of event_scheduler - debug: + ansible.builtin.debug: var: output - name: Try to delete default configuraion @@ -508,7 +509,7 @@ state: absent register: output - name: Assert that change was registered - assert: + ansible.builtin.assert: that: - not output.changed @@ -520,7 +521,7 @@ value: "ON" register: output - name: Assert that change was registered - assert: + ansible.builtin.assert: that: - output.changed @@ -532,7 +533,7 @@ value: "ON" register: output - name: Assert that change was registered - assert: + ansible.builtin.assert: that: - not output.changed @@ -544,7 +545,7 @@ state: absent register: output - name: Assert that change was registered - assert: + ansible.builtin.assert: that: - output.changed @@ -556,7 +557,7 @@ state: absent register: output - name: Assert that change was registered - assert: + ansible.builtin.assert: that: - not output.changed @@ -567,7 +568,7 @@ name: event_scheduler register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.settings[0].id != None @@ -583,7 +584,7 @@ server_name: mariadbsrv{{ rpfx }} register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.settings[0].id != None @@ -602,10 +603,10 @@ resource_group: "{{ resource_group }}" name: mariadbsrv{{ rpfx }} state: absent - check_mode: yes + check_mode: true register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -616,7 +617,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -627,7 +628,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed == false diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_monitordiagnosticsetting/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_monitordiagnosticsetting/tasks/main.yml index a725a0b33..46ef90a8d 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_monitordiagnosticsetting/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_monitordiagnosticsetting/tasks/main.yml @@ -1,18 +1,18 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - run_once: yes + run_once: true # ------ setup ------ -- name: create virtual network +- name: Create virtual network azure_rm_virtualnetwork: name: "vnet-{{ rpfx }}" resource_group: "{{ resource_group }}" address_prefixes: "10.0.0.0/16" register: vnet_output -- name: create web app +- name: Create web app azure_rm_webapp: name: "webapp-{{ rpfx }}" resource_group: "{{ resource_group }}" @@ -23,7 +23,7 @@ sku: S1 register: webapp_output -- name: create storage account +- name: Create storage account azure_rm_storageaccount: name: "storage{{ rpfx }}" resource_group: "{{ resource_group }}" @@ -31,7 +31,7 @@ kind: StorageV2 register: storage_output -- name: create second storage account +- name: Create second storage account azure_rm_storageaccount: name: "storagesecond{{ rpfx }}" resource_group: "{{ resource_group_secondary }}" @@ -39,13 +39,13 @@ kind: StorageV2 register: storage2_output -- name: create event hub namespace +- name: Create event hub namespace azure_rm_eventhub: namespace_name: "hub-{{ rpfx }}" resource_group: "{{ resource_group }}" sku: "Basic" -- name: create log analytics workspace +- name: Create log analytics workspace azure_rm_loganalyticsworkspace: name: "analytics-{{ rpfx }}" resource_group: "{{ resource_group_secondary }}" @@ -54,23 +54,23 @@ # ------ tests ------ -- name: get diagnostic settings for non-existant resource +- name: Get diagnostic settings for non-existant resource azure_rm_monitordiagnosticsetting_info: resource: "123abc" register: output failed_when: '"failed" not in output.msg | lower' -- name: get diagnostic settings for virtual network +- name: Get diagnostic settings for virtual network azure_rm_monitordiagnosticsetting_info: resource: "{{ vnet_output.state.id }}" register: output -- name: assert no settings - assert: +- name: Assert no settings + ansible.builtin.assert: that: - not output.changed - output.settings | length == 0 -- name: create storage-based diagnostic setting for vnet (check mode) +- name: Create storage-based diagnostic setting for vnet (check mode) azure_rm_monitordiagnosticsetting: name: "logs-storage" resource: "{{ vnet_output.state.id }}" @@ -81,12 +81,12 @@ - category: "AllMetrics" check_mode: true register: output -- name: assert resource created - assert: +- name: Assert resource created + ansible.builtin.assert: that: - output.changed -- name: create storage-based diagnostic setting for vnet (actually create) +- name: Create storage-based diagnostic setting for vnet (actually create) azure_rm_monitordiagnosticsetting: name: "logs-storage" resource: "{{ vnet_output.state.id }}" @@ -96,8 +96,8 @@ metrics: - category: "AllMetrics" register: output -- name: assert resource created - assert: +- name: Assert resource created + ansible.builtin.assert: that: - output.changed - output.state.name == 'logs-storage' @@ -111,7 +111,7 @@ - not output.state.event_hub - not output.state.log_analytics -- name: create storage-based diagnostic setting for vnet (idempotent) +- name: Create storage-based diagnostic setting for vnet (idempotent) azure_rm_monitordiagnosticsetting: name: "logs-storage" resource: "{{ vnet_output.state.id }}" @@ -122,12 +122,12 @@ - category: "AllMetrics" check_mode: true register: output -- name: assert resource not changed - assert: +- name: Assert resource not changed + ansible.builtin.assert: that: - not output.changed -- name: create storage-based diagnostic setting for vnet by resource dict (idempotent) +- name: Create storage-based diagnostic setting for vnet by resource dict (idempotent) azure_rm_monitordiagnosticsetting: name: "logs-storage" resource: @@ -140,12 +140,12 @@ metrics: - category: "AllMetrics" register: output -- name: assert resource not changed - assert: +- name: Assert resource not changed + ansible.builtin.assert: that: - not output.changed -- name: update storage-based diagnostic setting for vnet +- name: Update storage-based diagnostic setting for vnet azure_rm_monitordiagnosticsetting: name: "logs-storage" resource: "{{ vnet_output.state.id }}" @@ -153,8 +153,8 @@ logs: - category_group: "allLogs" register: output -- name: assert resource updated - assert: +- name: Assert resource updated + ansible.builtin.assert: that: - output.changed - output.state.name == 'logs-storage' @@ -166,7 +166,7 @@ - not output.state.event_hub - not output.state.log_analytics -- name: create second storage-based diagnostic setting for vnet +- name: Create second storage-based diagnostic setting for vnet azure_rm_monitordiagnosticsetting: name: "logs-storage2" resource: "{{ vnet_output.state.id }}" @@ -178,8 +178,8 @@ retention_policy: days: 15 register: output -- name: assert resource created - assert: +- name: Assert resource created + ansible.builtin.assert: that: - output.changed - output.state.name == 'logs-storage2' @@ -193,7 +193,7 @@ - not output.state.event_hub - not output.state.log_analytics -- name: update second storage-based diagnostic setting for vnet +- name: Update second storage-based diagnostic setting for vnet azure_rm_monitordiagnosticsetting: name: "logs-storage2" resource: "{{ vnet_output.state.id }}" @@ -205,13 +205,13 @@ retention_policy: days: 30 register: output -- name: assert resource created - assert: +- name: Assert resource created + ansible.builtin.assert: that: - output.changed - output.state.logs[0].retention_policy.days == 30 -- name: update second storage-based diagnostic setting for vnet (idempotent) +- name: Update second storage-based diagnostic setting for vnet (idempotent) azure_rm_monitordiagnosticsetting: name: "logs-storage2" resource: "{{ vnet_output.state.id }}" @@ -223,17 +223,17 @@ retention_policy: days: 30 register: output -- name: assert resource not changed - assert: +- name: Assert resource not changed + ansible.builtin.assert: that: - not output.changed -- name: get diagnostic settings for virtual network +- name: Get diagnostic settings for virtual network azure_rm_monitordiagnosticsetting_info: resource: "{{ vnet_output.state.id }}" register: output -- name: assert output maches expectations - assert: +- name: Assert output maches expectations + ansible.builtin.assert: that: - output.settings | length == 2 - output.settings[0].name == 'logs-storage' @@ -255,13 +255,13 @@ - not output.settings[1].event_hub - not output.settings[1].log_analytics -- name: get specific diagnostic settings for virtual network +- name: Get specific diagnostic settings for virtual network azure_rm_monitordiagnosticsetting_info: name: "logs-storage2" resource: "{{ vnet_output.state.id }}" register: output -- name: assert output maches expectations - assert: +- name: Assert output maches expectations + ansible.builtin.assert: that: - output.settings | length == 1 - output.settings[0].name == 'logs-storage2' @@ -275,17 +275,17 @@ - not output.settings[0].event_hub - not output.settings[0].log_analytics -- name: get non-existant diagnostic setting for virtual network +- name: Get non-existant diagnostic setting for virtual network azure_rm_monitordiagnosticsetting_info: name: "does-not-exist" resource: "{{ vnet_output.state.id }}" register: output -- name: assert no settings - assert: +- name: Assert no settings + ansible.builtin.assert: that: - output.settings | length == 0 -- name: create diagnostic setting for webapp with log analytics, event hub, and storage +- name: Create diagnostic setting for webapp with log analytics, event hub, and storage azure_rm_monitordiagnosticsetting: name: "logs" resource: @@ -308,8 +308,8 @@ - category: "AppServiceIPSecAuditLogs" - category: "AppServicePlatformLogs" register: output -- name: assert resource created - assert: +- name: Assert resource created + ansible.builtin.assert: that: - output.changed - output.state.name == 'logs' @@ -326,7 +326,7 @@ - output.state.logs[5].category == 'AppServicePlatformLogs' - output.state.metrics | length == 0 -- name: create diagnostic setting for webapp with log analytics, event hub, and storage (idempotent) +- name: Create diagnostic setting for webapp with log analytics, event hub, and storage (idempotent) azure_rm_monitordiagnosticsetting: name: "logs" resource: @@ -349,12 +349,12 @@ - category: "AppServiceIPSecAuditLogs" - category: "AppServicePlatformLogs" register: output -- name: assert resource created - assert: +- name: Assert resource created + ansible.builtin.assert: that: - not output.changed -- name: update diagnostic setting to remove storage and log category +- name: Update diagnostic setting to remove storage and log category azure_rm_monitordiagnosticsetting: name: "logs" resource: @@ -374,8 +374,8 @@ - category: "AppServiceIPSecAuditLogs" - category: "AppServicePlatformLogs" register: output -- name: assert resource updated - assert: +- name: Assert resource updated + ansible.builtin.assert: that: - output.changed - not output.state.storage_account @@ -386,7 +386,7 @@ - output.state.logs[3].category == 'AppServiceIPSecAuditLogs' - output.state.logs[4].category == 'AppServicePlatformLogs' -- name: delete diagnostic setting via resource dict +- name: Delete diagnostic setting via resource dict azure_rm_monitordiagnosticsetting: name: "logs" resource: @@ -395,12 +395,12 @@ resource_group: "{{ resource_group }}" state: "absent" register: output -- name: assert resource delete - assert: +- name: Assert resource delete + ansible.builtin.assert: that: - output.changed -- name: delete diagnostic setting via resource dict (idempotent) +- name: Delete diagnostic setting via resource dict (idempotent) azure_rm_monitordiagnosticsetting: name: "logs" resource: @@ -409,95 +409,95 @@ resource_group: "{{ resource_group }}" state: "absent" register: output -- name: assert resource delete - assert: +- name: Assert resource delete + ansible.builtin.assert: that: - not output.changed -- name: delete diagnostic setting (check mode) +- name: Delete diagnostic setting (check mode) azure_rm_monitordiagnosticsetting: name: "logs-storage" resource: "{{ vnet_output.state.id }}" state: "absent" check_mode: true register: output -- name: assert resource deleted - assert: +- name: Assert resource deleted + ansible.builtin.assert: that: - output.changed -- name: delete diagnostic setting (actually delete) +- name: Delete diagnostic setting (actually delete) azure_rm_monitordiagnosticsetting: name: "logs-storage" resource: "{{ vnet_output.state.id }}" state: "absent" register: output -- name: assert resource deleted - assert: +- name: Assert resource deleted + ansible.builtin.assert: that: - output.changed -- name: delete diagnostic setting (idempotent) +- name: Delete diagnostic setting (idempotent) azure_rm_monitordiagnosticsetting: name: "logs-storage" resource: "{{ vnet_output.state.id }}" state: "absent" register: output -- name: assert resource already deleted - assert: +- name: Assert resource already deleted + ansible.builtin.assert: that: - not output.changed -- name: delete second diagnostic setting +- name: Delete second diagnostic setting azure_rm_monitordiagnosticsetting: name: "logs-storage2" resource: "{{ vnet_output.state.id }}" state: "absent" register: output -- name: assert resource deleted - assert: +- name: Assert resource deleted + ansible.builtin.assert: that: - output.changed # ------ teardown ------ -- name: delete log analytics workspace +- name: Delete log analytics workspace azure_rm_loganalyticsworkspace: name: "analytics-{{ rpfx }}" resource_group: "{{ resource_group_secondary }}" state: "absent" -- name: delete event hub namespace +- name: Delete event hub namespace azure_rm_eventhub: namespace_name: "hub-{{ rpfx }}" resource_group: "{{ resource_group }}" state: "absent" -- name: delete second storage account +- name: Delete second storage account azure_rm_storageaccount: name: "storagesecond{{ rpfx }}" resource_group: "{{ resource_group_secondary }}" state: "absent" -- name: delete storage account +- name: Delete storage account azure_rm_storageaccount: name: "storage{{ rpfx }}" resource_group: "{{ resource_group }}" state: "absent" -- name: delete web app +- name: Delete web app azure_rm_webapp: name: "webapp-{{ rpfx }}" resource_group: "{{ resource_group }}" state: "absent" -- name: delete web app plan +- name: Delete web app plan azure_rm_appserviceplan: name: "webapp-{{ rpfx }}-plan" resource_group: "{{ resource_group }}" state: "absent" -- name: delete virtual network +- name: Delete virtual network azure_rm_virtualnetwork: name: "vnet-{{ rpfx }}" resource_group: "{{ resource_group }}" diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_monitorlogprofile/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_monitorlogprofile/tasks/main.yml index dc30caf98..0a41203ad 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_monitorlogprofile/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_monitorlogprofile/tasks/main.yml @@ -1,17 +1,17 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: storage_name: "storage{{ resource_group | hash('md5') | truncate(5, True, '') }}{{ 1000 | random }}" profile_name: "profile{{ resource_group | hash('md5') | truncate(5, True, '') }}{{ 1000 | random }}" location: eastus - run_once: yes + run_once: true -- name: create Azure storage account +- name: Create Azure storage account azure_rm_storageaccount: name: '{{ storage_name }}' resource_group: "{{ resource_group }}" account_type: Standard_LRS -- name: create log profile (check mode) +- name: Create log profile (check mode) azure_rm_monitorlogprofile: name: "{{ profile_name }}" location: "{{ location }}" @@ -22,20 +22,20 @@ - Write - Action retention_policy: - enabled: False + enabled: false days: 1 storage_account: resource_group: "{{ resource_group }}" name: "{{ storage_name }}" - check_mode: yes + check_mode: true register: output -- name: assert create check mode - assert: +- name: Assert create check mode + ansible.builtin.assert: that: - output.changed -- name: create log profile +- name: Create log profile azure_rm_monitorlogprofile: name: "{{ profile_name }}" location: "{{ location }}" @@ -46,19 +46,19 @@ - Write - Action retention_policy: - enabled: False + enabled: false days: 1 storage_account: resource_group: "{{ resource_group }}" name: "{{ storage_name }}" register: output -- name: assert create - assert: +- name: Assert create + ansible.builtin.assert: that: - output.changed - output.id -- name: update log profile (idempotence) +- name: Update log profile (idempotence) azure_rm_monitorlogprofile: name: "{{ profile_name }}" location: "{{ location }}" @@ -69,18 +69,18 @@ - Write - Action retention_policy: - enabled: False + enabled: false days: 1 storage_account: resource_group: "{{ resource_group }}" name: "{{ storage_name }}" register: output -- name: assert update idempotence - assert: +- name: Assert update idempotence + ansible.builtin.assert: that: - not output.changed -- name: update log profile +- name: Update log profile azure_rm_monitorlogprofile: name: "{{ profile_name }}" location: "{{ location }}" @@ -90,44 +90,44 @@ - Write - Action retention_policy: - enabled: False + enabled: false days: 2 storage_account: resource_group: "{{ resource_group }}" name: "{{ storage_name }}" register: output -- name: assert update - assert: +- name: Assert update + ansible.builtin.assert: that: - output.changed -- name: delete log profile (check mode) +- name: Delete log profile (check mode) azure_rm_monitorlogprofile: name: "{{ profile_name }}" state: absent register: output check_mode: true -- name: assert delete - assert: +- name: Assert delete + ansible.builtin.assert: that: - output.changed -- name: delete log profile +- name: Delete log profile azure_rm_monitorlogprofile: name: "{{ profile_name }}" state: absent register: output -- name: assert delete - assert: +- name: Assert delete + ansible.builtin.assert: that: - output.changed -- name: delete log profile (idempotence) +- name: Delete log profile (idempotence) azure_rm_monitorlogprofile: name: "{{ profile_name }}" state: absent register: output -- name: assert delete - assert: +- name: Assert delete + ansible.builtin.assert: that: - not output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_multiplemanageddisks/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_multiplemanageddisks/tasks/main.yml index 78b712653..b25349009 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_multiplemanageddisks/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_multiplemanageddisks/tasks/main.yml @@ -1,2 +1,4 @@ -- include_tasks: tasks/test_shared.yml -- include_tasks: tasks/test_async.yml +- name: Excute test_shared.yml + ansible.builtin.include_tasks: tasks/test_shared.yml +- name: Excute test_async.yml + ansible.builtin.include_tasks: tasks/test_async.yml diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_multiplemanageddisks/tasks/test_async.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_multiplemanageddisks/tasks/test_async.yml index 448a54dde..25398bf7e 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_multiplemanageddisks/tasks/test_async.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_multiplemanageddisks/tasks/test_async.yml @@ -16,28 +16,28 @@ - name: Create virtual machines azure_rm_virtualmachine: - resource_group: "{{ resource_group_secondary }}" - name: "{{ async_virtual_machine_prefix }}-{{ item }}" - vm_size: Standard_E2_v3 - managed_disk_type: Standard_LRS - virtual_network: "{{ async_virtual_network }}-{{ item }}" - admin_username: adminuser - admin_password: "!test123@" - os_type: Linux - image: - offer: UbuntuServer - publisher: Canonical - sku: 16.04-LTS - version: latest - tags: - key: value + resource_group: "{{ resource_group_secondary }}" + name: "{{ async_virtual_machine_prefix }}-{{ item }}" + vm_size: Standard_E2_v3 + managed_disk_type: Standard_LRS + virtual_network: "{{ async_virtual_network }}-{{ item }}" + admin_username: adminuser + admin_password: "!test123@" + os_type: Linux + image: + offer: 0001-com-ubuntu-server-focal + publisher: Canonical + sku: 20_04-lts + version: latest + tags: + key: value with_sequence: start=1 end="{{ async_number_virtual_machine }}" register: create_vms async: 1000 poll: 0 - name: Wait for Virtual machine to be created - async_status: + ansible.builtin.async_status: jid: "{{ item.ansible_job_id }}" register: wait_create_vm until: wait_create_vm.finished @@ -52,7 +52,8 @@ - key register: _vms -- set_fact: +- name: Set varialbes + ansible.builtin.set_fact: attach_disk_config: "{{ lookup('template', 'disk_config.j2') | from_yaml }}" vars: virtual_machines: "{{ _vms.vms }}" @@ -68,7 +69,7 @@ with_items: "{{ attach_disk_config }}" - name: Wait for disks to be created and attached - async_status: + ansible.builtin.async_status: jid: "{{ item.ansible_job_id }}" register: attach_disk until: attach_disk.finished @@ -84,7 +85,7 @@ with_items: "{{ attach_disk_config | map(attribute='disks') | flatten | list }}" - name: Validate that disks are attached to VMs - assert: + ansible.builtin.assert: that: - result.ansible_info.azure_managed_disk[0].managed_by with_items: "{{ disks_info.results }}" @@ -103,7 +104,7 @@ with_items: "{{ attach_disk_config }}" - name: Wait for disks to be created and attached - async_status: + ansible.builtin.async_status: jid: "{{ item.ansible_job_id }}" register: attach_disk until: attach_disk.finished @@ -119,7 +120,7 @@ with_items: "{{ attach_disk_config | map(attribute='disks') | flatten | list }}" - name: Validate that disks are attached to VMs - assert: + ansible.builtin.assert: that: - not result.ansible_info.azure_managed_disk[0].managed_by with_items: "{{ disks_info.results }}" @@ -136,7 +137,7 @@ with_items: "{{ attach_disk_config }}" - name: Wait for disks to be created and attached - async_status: + ansible.builtin.async_status: jid: "{{ item.ansible_job_id }}" register: attach_disk until: attach_disk.finished @@ -152,7 +153,7 @@ with_items: "{{ attach_disk_config | map(attribute='disks') | flatten | list }}" - name: Validate that disks are attached to VMs - assert: + ansible.builtin.assert: that: - result.ansible_info.azure_managed_disk == [] with_items: "{{ disks_info.results }}" diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_multiplemanageddisks/tasks/test_shared.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_multiplemanageddisks/tasks/test_shared.yml index 853ef8ed4..4b6e5f638 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_multiplemanageddisks/tasks/test_shared.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_multiplemanageddisks/tasks/test_shared.yml @@ -18,7 +18,7 @@ ignore_errors: true - name: Validate that disk creation failed - assert: + ansible.builtin.assert: that: - result is failed - 'result.msg == "Some required options are missing from managed disks configuration."' @@ -33,7 +33,7 @@ register: azure_disks - name: Ensure result is changed - assert: + ansible.builtin.assert: that: - azure_disks is changed - azure_disks.state | length == 2 @@ -51,12 +51,12 @@ register: create_idempotency - name: Ensure result is not changed - assert: + ansible.builtin.assert: that: - create_idempotency is not changed - name: Validate that disks have been created - assert: + ansible.builtin.assert: that: - item.name in disk_names with_items: "{{ shared_disks }}" @@ -81,26 +81,26 @@ - name: Create virtual machines azure_rm_virtualmachine: - resource_group: "{{ item.resource_group }}" - name: "{{ item.name }}" - vm_size: Standard_E2_v3 - virtual_network: "vnet-{{ item.name }}" - managed_disk_type: Standard_LRS - admin_username: adminuser - admin_password: "!test123@" - os_type: Linux - image: - offer: UbuntuServer - publisher: Canonical - sku: 16.04-LTS - version: latest + resource_group: "{{ item.resource_group }}" + name: "{{ item.name }}" + vm_size: Standard_E2_v3 + virtual_network: "vnet-{{ item.name }}" + managed_disk_type: Standard_LRS + admin_username: adminuser + admin_password: "!test123@" + os_type: Linux + image: + offer: 0001-com-ubuntu-server-focal + publisher: Canonical + sku: 20_04-lts + version: latest with_items: "{{ shared_virtual_machines }}" register: create_vms async: 1000 poll: 0 - name: Wait for Virtual machine to be created - async_status: + ansible.builtin.async_status: jid: "{{ item.ansible_job_id }}" register: wait_create_vm until: wait_create_vm.finished @@ -115,7 +115,8 @@ register: vm_result with_items: "{{ shared_virtual_machines }}" -- set_fact: +- name: Assert the virtualmachine facts + ansible.builtin.set_fact: vm_ids: "{{ vm_result.results | map(attribute='vms') | flatten | map(attribute='id') | list }}" # Test attach disk on VMs @@ -128,7 +129,7 @@ with_items: "{{ shared_virtual_machines }}" - name: Ensure result is changed - assert: + ansible.builtin.assert: that: - attach_disks is changed - attach_disks.results | length == 2 @@ -141,7 +142,7 @@ with_items: "{{ shared_disks }}" - name: Validate disks are attached to the VMs - assert: + ansible.builtin.assert: that: - azure_managed_disks | length == 2 - azure_managed_disks.0.managed_by_extended | length == 2 @@ -160,7 +161,7 @@ register: attach_idempotency - name: Ensure result is not changed - assert: + ansible.builtin.assert: that: - attach_idempotency is not changed @@ -169,13 +170,13 @@ azure.azcollection.azure_rm_multiplemanageddisks: managed_disks: - "{{ shared_disks[0] }}" - managed_by_extended: + managed_by_extended: - "{{ shared_virtual_machines[0] }}" state: absent register: detach_disks - name: Ensure result is changed - assert: + ansible.builtin.assert: that: - detach_disks is changed @@ -187,7 +188,7 @@ with_items: "{{ shared_disks }}" - name: Ensure disk 1 is attached to VM 1 only and disk 2 is attached to VM 1 and VM 2 - assert: + ansible.builtin.assert: that: - azure_managed_disks | length == 2 - azure_managed_disks.0.managed_by_extended | length == 1 @@ -204,20 +205,20 @@ azure.azcollection.azure_rm_multiplemanageddisks: managed_disks: - "{{ shared_disks[0] }}" - managed_by_extended: + managed_by_extended: - "{{ shared_virtual_machines[0] }}" state: absent register: detach_idempotency - name: Ensure result is not changed - assert: + ansible.builtin.assert: that: - detach_idempotency is not changed # Test Detach disks from all VMs - name: Detach disk 2 from all VMs azure.azcollection.azure_rm_multiplemanageddisks: - managed_disks: + managed_disks: - "{{ shared_disks[1] }}" managed_by_extended: [] state: present @@ -230,7 +231,7 @@ register: azure_disks - name: Ensure disk is not attached to any VM - assert: + ansible.builtin.assert: that: - detach_from_vms is changed - azure_disks.ansible_info.azure_managed_disk | length == 1 @@ -239,14 +240,14 @@ - name: Detach disk 2 from all VMs once again (idempotency) azure.azcollection.azure_rm_multiplemanageddisks: - managed_disks: + managed_disks: - "{{ shared_disks[1] }}" managed_by_extended: [] state: present register: detach_from_vms - name: Ensure nothing changed - assert: + ansible.builtin.assert: that: - detach_from_vms is not changed @@ -258,14 +259,14 @@ register: azure_disks - name: Ensure disk is attached to at least one VM - assert: + ansible.builtin.assert: that: - azure_disks.ansible_info.azure_managed_disk.0.managed_by - azure_disks.ansible_info.azure_managed_disk.0.managed_by_extended | length > 0 - name: Delete managed disk attached to VM azure.azcollection.azure_rm_multiplemanageddisks: - managed_disks: + managed_disks: - "{{ shared_disks[0] }}" state: absent register: delete_attached_disk @@ -277,41 +278,41 @@ register: azure_disks - name: Ensure disk was deleted - assert: + ansible.builtin.assert: that: - delete_attached_disk is changed - azure_disks.ansible_info.azure_managed_disk | length == 0 - name: Delete managed disk once again (idempotency) azure.azcollection.azure_rm_multiplemanageddisks: - managed_disks: + managed_disks: - "{{ shared_disks[0] }}" state: absent register: delete_attached_disk - name: Ensure delete idempotency - assert: + ansible.builtin.assert: that: - delete_attached_disk is not changed # Test managed disks deletion with managed_by_extended set to [] - name: Trying to delete managed disks with managed_by_extended set to [] azure.azcollection.azure_rm_multiplemanageddisks: - managed_disks: + managed_disks: - "{{ shared_disks[1] }}" managed_by_extended: [] state: absent register: delete_with_wrong_parameter - name: Ensure disks were not deleted - assert: + ansible.builtin.assert: that: - delete_with_wrong_parameter is not changed # Test managed disks deletion - name: Delete managed disks azure.azcollection.azure_rm_multiplemanageddisks: - managed_disks: + managed_disks: - "{{ shared_disks[1] }}" state: absent register: delete_disk @@ -323,19 +324,19 @@ register: azure_disks - name: Ensure disk was deleted - assert: + ansible.builtin.assert: that: - delete_disk is changed - azure_disks.ansible_info.azure_managed_disk | length == 0 - name: Delete managed disks once again (idempotency) azure.azcollection.azure_rm_multiplemanageddisks: - managed_disks: + managed_disks: - "{{ shared_disks[1] }}" state: absent register: delete_idempotency - name: Ensure nothing changed - assert: + ansible.builtin.assert: that: - delete_idempotency is not changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_mysqlserver/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_mysqlserver/tasks/main.yml index 75475bc3b..819ebd9f7 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_mysqlserver/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_mysqlserver/tasks/main.yml @@ -1,7 +1,7 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - run_once: yes + run_once: true - name: Create instance of MySQL Server -- check mode azure_rm_mysqlserver: @@ -17,13 +17,13 @@ geo_redundant_backup: Disabled storage_autogrow: Disabled version: 5.7 - enforce_ssl: True + enforce_ssl: true admin_username: zimxyz admin_password: Password123! - check_mode: yes + check_mode: true register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -41,12 +41,12 @@ geo_redundant_backup: Disabled storage_autogrow: Disabled version: 5.7 - enforce_ssl: True + enforce_ssl: true admin_username: zimxyz admin_password: Password123! register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed - output.state == 'Ready' @@ -65,12 +65,12 @@ geo_redundant_backup: Disabled storage_autogrow: Disabled version: 5.7 - enforce_ssl: True + enforce_ssl: true admin_username: zimxyz admin_password: Password123! register: output - name: Assert the state has not changed - assert: + ansible.builtin.assert: that: - output.changed == false - output.state == 'Ready' @@ -89,16 +89,17 @@ geo_redundant_backup: Disabled storage_autogrow: Disabled version: 5.7 - enforce_ssl: True + enforce_ssl: true admin_username: zimxyz admin_password: Password123! register: output - name: Assert the state has not changed - assert: + ansible.builtin.assert: that: - output.changed - output.state == 'Ready' -- debug: +- name: Print the state of the mysql server + ansible.builtin.debug: var: output - name: Gather facts MySQL Server @@ -107,7 +108,7 @@ name: mysqlsrv{{ rpfx }} register: output - name: Assert that storage size is correct - assert: + ansible.builtin.assert: that: - output.servers[0]['storage_profile']['storage_mb'] == 128000 @@ -115,10 +116,10 @@ azure_rm_mysqlserver: resource_group: "{{ resource_group }}" name: mysqlsrv{{ rpfx }} - restarted: True + restarted: true register: output - name: Assert the state has not changed - assert: + ansible.builtin.assert: that: - output.changed @@ -136,7 +137,7 @@ geo_redundant_backup: Disabled storage_autogrow: Disabled version: 5.7 - enforce_ssl: True + enforce_ssl: true admin_username: zimxyz admin_password: Password123! tags: @@ -156,7 +157,7 @@ geo_redundant_backup: Disabled storage_autogrow: Disabled version: 5.7 - enforce_ssl: True + enforce_ssl: true admin_username: zimxyz admin_password: Password123! tags: @@ -166,10 +167,10 @@ azure_rm_mysqlserver_info: resource_group: "{{ resource_group }}" name: mysqlsrv{{ rpfx }}second - register: output + register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.servers[0]['id'] != None @@ -189,7 +190,7 @@ resource_group: "{{ resource_group }}" register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.servers[0]['id'] != None @@ -219,10 +220,10 @@ resource_group: "{{ resource_group }}" server_name: mysqlsrv{{ rpfx }} name: testdatabase - check_mode: yes + check_mode: true register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -235,7 +236,7 @@ charset: latin1 register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed - output.name == 'testdatabase' @@ -249,7 +250,7 @@ charset: latin1 register: output - name: Assert the state has not changed - assert: + ansible.builtin.assert: that: - output.changed == false - output.name == 'testdatabase' @@ -261,10 +262,10 @@ name: testdatabase collation: utf8_general_ci charset: utf8 - ignore_errors: yes + ignore_errors: true register: output - name: Assert that nothing has changed - assert: + ansible.builtin.assert: that: - output.changed == False @@ -275,10 +276,10 @@ name: testdatabase collation: utf8_general_ci charset: utf8 - force_update: yes + force_update: true register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed - output.name == 'testdatabase' @@ -294,10 +295,10 @@ resource_group: "{{ resource_group }}" server_name: mysqlsrv{{ rpfx }} name: testdatabase - register: output + register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.databases[0]['server_name'] != None @@ -311,7 +312,7 @@ server_name: mysqlsrv{{ rpfx }} register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.databases[0]['server_name'] != None @@ -329,10 +330,10 @@ server_name: mysqlsrv{{ rpfx }} name: testdatabase state: absent - check_mode: yes + check_mode: true register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -344,7 +345,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -356,7 +357,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed == false @@ -370,10 +371,10 @@ name: firewallrule{{ rpfx }} start_ip_address: 172.28.10.136 end_ip_address: 172.28.10.138 - check_mode: yes + check_mode: true register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -386,7 +387,7 @@ end_ip_address: 172.28.10.138 register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -399,7 +400,7 @@ end_ip_address: 172.28.10.138 register: output - name: Assert the state has not changed - assert: + ansible.builtin.assert: that: - output.changed == false @@ -409,10 +410,10 @@ server_name: mysqlsrv{{ rpfx }} name: firewallrule{{ rpfx }} state: absent - check_mode: yes + check_mode: true register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -425,7 +426,7 @@ end_ip_address: 172.28.10.138 register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -436,7 +437,7 @@ name: firewallrule{{ rpfx }} register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.rules[0].id != None @@ -452,7 +453,7 @@ server_name: mysqlsrv{{ rpfx }} register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.rules[0].id != None @@ -474,7 +475,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -486,7 +487,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed == false @@ -504,7 +505,7 @@ name: firewallrule{{ rpfx }} register: output - name: Assert that empty list was returned - assert: + ansible.builtin.assert: that: - output.changed == False - "output.rules | length == 0" @@ -518,10 +519,10 @@ server_name: mysqlsrv{{ rpfx }} name: event_scheduler value: "ON" - check_mode: yes + check_mode: true register: output - name: Assert that change was registered - assert: + ansible.builtin.assert: that: - output.changed @@ -532,7 +533,7 @@ name: event_scheduler register: output - name: Get facts of event_scheduler - debug: + ansible.builtin.debug: var: output - name: Try to delete default configuraion @@ -543,7 +544,7 @@ state: absent register: output - name: Assert that change was registered - assert: + ansible.builtin.assert: that: - not output.changed @@ -555,7 +556,7 @@ value: "ON" register: output - name: Assert that change was registered - assert: + ansible.builtin.assert: that: - output.changed @@ -567,7 +568,7 @@ value: "ON" register: output - name: Assert that change was registered - assert: + ansible.builtin.assert: that: - not output.changed @@ -579,7 +580,7 @@ state: absent register: output - name: Assert that change was registered - assert: + ansible.builtin.assert: that: - output.changed @@ -591,7 +592,7 @@ state: absent register: output - name: Assert that change was registered - assert: + ansible.builtin.assert: that: - not output.changed @@ -602,7 +603,7 @@ name: event_scheduler register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.settings[0].id != None @@ -618,7 +619,7 @@ server_name: mysqlsrv{{ rpfx }} register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.settings[0].id != None @@ -637,10 +638,10 @@ resource_group: "{{ resource_group }}" name: mysqlsrv{{ rpfx }} state: absent - check_mode: yes + check_mode: true register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -651,7 +652,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -662,7 +663,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed == false diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_natgateway/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_natgateway/tasks/main.yml index b411d2422..d950304eb 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_natgateway/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_natgateway/tasks/main.yml @@ -1,9 +1,9 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" run_once: true - name: Set json query to only retrieve gateways from this test - set_fact: + ansible.builtin.set_fact: query: "[?ends_with(name, `{{ rpfx }}`)]" run_once: true @@ -12,7 +12,7 @@ name: "{{ resource_group }}" register: rg_output - name: Store rg location - set_fact: + ansible.builtin.set_fact: rg_location: "{{ rg_output.resourcegroups[0].location }}" run_once: true @@ -21,7 +21,7 @@ resource_group: "{{ resource_group }}" register: natgw_output - name: Assert there are no gateways - assert: + ansible.builtin.assert: that: - natgw_output.gateways | community.general.json_query(query) | length == 0 @@ -30,9 +30,9 @@ resource_group: "{{ resource_group }}" name: nat-gateway{{ rpfx }}1 register: output - check_mode: yes + check_mode: true - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -41,7 +41,7 @@ resource_group: "{{ resource_group }}" register: natgw_output - name: Assert there are still no gateways - assert: + ansible.builtin.assert: that: - natgw_output.gateways | community.general.json_query(query) | length == 0 @@ -51,7 +51,7 @@ name: nat-gateway{{ rpfx }}1 register: natgw_output - name: Assert that gateway is well created - assert: + ansible.builtin.assert: that: - natgw_output.changed - natgw_output.resource_group == "{{ resource_group }}" @@ -63,7 +63,7 @@ resource_group: "{{ resource_group }}" register: natgw_output - name: Assert that gateway has the right default parameters - assert: + ansible.builtin.assert: that: - natgw_output.gateways[0].idle_timeout_in_minutes == 4 @@ -73,7 +73,7 @@ name: nat-gateway{{ rpfx }}1 register: output - name: Assert the resource instance is not changed - assert: + ansible.builtin.assert: that: - not output.changed @@ -84,7 +84,7 @@ idle_timeout_in_minutes: 10 register: natgw_output - name: Assert the resource instance is changed - assert: + ansible.builtin.assert: that: - natgw_output.changed - natgw_output.location == "{{ rg_location }}" @@ -94,7 +94,7 @@ resource_group: "{{ resource_group }}" register: natgw_output - name: Assert that gateway has the right parameters - assert: + ansible.builtin.assert: that: - natgw_output.gateways[0].idle_timeout_in_minutes == 10 @@ -107,7 +107,7 @@ idle_timeout_in_minutes: 10 register: output - name: Assert the resource instance is not changed - assert: + ansible.builtin.assert: that: - not output.changed @@ -142,7 +142,7 @@ - "nat-gateway{{ rpfx }}-pip2" register: natgw_output - name: Assert the resource instance is changed - assert: + ansible.builtin.assert: that: - natgw_output.changed - name: Get NAT gateways @@ -151,7 +151,7 @@ resource_group: "{{ resource_group }}" register: natgw_output - name: Assert that gateway has the right parameters - assert: + ansible.builtin.assert: that: - natgw_output.gateways[0].public_ip_addresses | length == 2 @@ -166,7 +166,7 @@ - "nat-gateway{{ rpfx }}-pip2" register: natgw_output - name: Assert the resource instance is changed - assert: + ansible.builtin.assert: that: - natgw_output.changed - name: Get NAT gateways @@ -175,7 +175,7 @@ resource_group: "{{ resource_group }}" register: natgw_output - name: Assert that gateway has the right parameters - assert: + ansible.builtin.assert: that: - natgw_output.gateways[0].public_ip_addresses | length == 1 @@ -189,7 +189,7 @@ name: standard register: natgw_output - name: Assert the resource instance is changed - assert: + ansible.builtin.assert: that: - natgw_output.changed - name: Get NAT gateways @@ -198,7 +198,7 @@ resource_group: "{{ resource_group }}" register: natgw_output - name: Assert that gateway has the right parameters - assert: + ansible.builtin.assert: that: - natgw_output.gateways[0].public_ip_addresses == None @@ -231,7 +231,7 @@ resource_group: "{{ resource_group }}" register: output - name: Assert the NAT Gateway is associated - assert: + ansible.builtin.assert: that: - output.subnets[0].nat_gateway == "{{ natgw_output.gateways[0].id }}" @@ -254,7 +254,7 @@ resource_group: "{{ resource_group }}" register: output - name: Assert the NAT Gateway is not associated - assert: + ansible.builtin.assert: that: - output.subnets[0].nat_gateway == "{{ natgw_output3.id }}" @@ -271,7 +271,7 @@ resource_group: "{{ resource_group }}" register: output - name: Assert the NAT Gateway is not associated - assert: + ansible.builtin.assert: that: - output.subnets[0].nat_gateway == None @@ -282,12 +282,12 @@ name: nat-gateway{{ rpfx }}2 idle_timeout_in_minutes: 10 location: eastus - zones: [ 1 ] + zones: [1] sku: name: standard register: natgw_output - name: Assert the resource instance is changed - assert: + ansible.builtin.assert: that: - natgw_output.changed - natgw_output.location == "eastus" @@ -297,7 +297,7 @@ resource_group: "{{ resource_group }}" register: natgw_output - name: Assert that gateway has the right parameters - assert: + ansible.builtin.assert: that: - natgw_output.gateways[0].idle_timeout_in_minutes == 10 - natgw_output.gateways[0].zones[0] == "1" @@ -310,9 +310,9 @@ state: absent register: output with_items: - - 1 - - 2 - - 3 + - 1 + - 2 + - 3 - name: Remove subnet azure_rm_subnet: @@ -332,15 +332,15 @@ resource_group: "{{ resource_group }}" register: natgw_output - name: Assert there are no gateways left - assert: + ansible.builtin.assert: that: - natgw_output.gateways | community.general.json_query(query) | length == 0 - name: Delete public IPs for NAT Gateway azure_rm_publicipaddress: - resource_group: "{{ resource_group }}" - name: "nat-gateway{{ rpfx }}-pip{{ item }}" - state: absent + resource_group: "{{ resource_group }}" + name: "nat-gateway{{ rpfx }}-pip{{ item }}" + state: absent with_items: - - 1 - - 2 + - 1 + - 2 diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_networkinterface/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_networkinterface/tasks/main.yml index 7e38fc7ee..e47906d72 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_networkinterface/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_networkinterface/tasks/main.yml @@ -1,24 +1,24 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" applicationsecuritygroup_name1: "asg{{ resource_group | hash('md5') | truncate(5, True, '') }}{{ 1000 | random }}" applicationsecuritygroup_name2: "asg{{ resource_group | hash('md5') | truncate(5, True, '') }}{{ 1000 | random }}" nic_name1: "nic1{{ resource_group | hash('md5') | truncate(5, True, '') }}{{ 1000 | random }}" - run_once: yes + run_once: true - name: Create virtual network azure_rm_virtualnetwork: - resource_group: "{{ resource_group_secondary }}" - name: "tn{{ rpfx }}" - address_prefixes: ["10.10.0.0/16", "fdae:f296:2787::/48"] + resource_group: "{{ resource_group_secondary }}" + name: "tn{{ rpfx }}" + address_prefixes: ["10.10.0.0/16", "fdae:f296:2787::/48"] register: vn - name: Add subnet azure_rm_subnet: - resource_group: "{{ resource_group_secondary }}" - name: "tn{{ rpfx }}" - address_prefixes_cidr: ["10.10.0.0/24", "fdae:f296:2787::/64"] - virtual_network: "tn{{ rpfx }}" + resource_group: "{{ resource_group_secondary }}" + name: "tn{{ rpfx }}" + address_prefixes_cidr: ["10.10.0.0/24", "fdae:f296:2787::/64"] + virtual_network: "tn{{ rpfx }}" - name: Create public IP addresses azure_rm_publicipaddress: @@ -37,7 +37,7 @@ - name: 'tn{{ rpfx }}v6' version: 'ipv6' -- name: create load balancer with multiple parameters +- name: Create load balancer with multiple parameters azure_rm_loadbalancer: resource_group: '{{ resource_group }}' name: "lb{{ rpfx }}" @@ -84,32 +84,34 @@ - name: Create most simple NIC with virtual_network id (check mode) azure_rm_networkinterface: - resource_group: "{{ resource_group }}" - name: "tn{{ rpfx }}" - virtual_network: "{{ vn.state.id }}" - subnet: "tn{{ rpfx }}" - public_ip: False - create_with_security_group: False + resource_group: "{{ resource_group }}" + name: "tn{{ rpfx }}" + virtual_network: "{{ vn.state.id }}" + subnet: "tn{{ rpfx }}" + public_ip: false + create_with_security_group: false register: output - check_mode: yes + check_mode: true -- assert: +- name: Assert the check mode facts + ansible.builtin.assert: that: - output.changed - name: Create most simple NIC with virtual_network resource_group azure_rm_networkinterface: - resource_group: "{{ resource_group }}" + resource_group: "{{ resource_group }}" + name: "tn{{ rpfx }}" + virtual_network: name: "tn{{ rpfx }}" - virtual_network: - name: "tn{{ rpfx }}" - resource_group: "{{ resource_group_secondary }}" - subnet: "tn{{ rpfx }}" - public_ip: False - create_with_security_group: False + resource_group: "{{ resource_group_secondary }}" + subnet: "tn{{ rpfx }}" + public_ip: false + create_with_security_group: false register: output -- assert: +- name: Assert the NIC created + ansible.builtin.assert: that: - output.changed - output.state.id @@ -121,7 +123,8 @@ name: "tn{{ rpfx }}" register: facts -- assert: +- name: Assert the NIC facts + ansible.builtin.assert: that: - "facts.networkinterfaces | length == 1" - facts.networkinterfaces[0].id == output.state.id @@ -134,149 +137,157 @@ - name: Create most simple NIC with ip configurations (idempotent) azure_rm_networkinterface: - resource_group: "{{ facts.networkinterfaces[0].resource_group }}" - name: "{{ facts.networkinterfaces[0].name }}" - virtual_network: "{{ facts.networkinterfaces[0].virtual_network }}" - create_with_security_group: False - ip_configurations: - - name: "{{ facts.networkinterfaces[0].ip_configurations[0].name }}" - private_ip_address: "{{ facts.networkinterfaces[0].ip_configurations[0].private_ip_address }}" - private_ip_allocation_method: "{{ facts.networkinterfaces[0].ip_configurations[0].private_ip_allocation_method }}" - primary: "{{ facts.networkinterfaces[0].ip_configurations[0].primary }}" - subnet: "{{ facts.networkinterfaces[0].subnet }}" + resource_group: "{{ facts.networkinterfaces[0].resource_group }}" + name: "{{ facts.networkinterfaces[0].name }}" + virtual_network: "{{ facts.networkinterfaces[0].virtual_network }}" + create_with_security_group: false + ip_configurations: + - name: "{{ facts.networkinterfaces[0].ip_configurations[0].name }}" + private_ip_address: "{{ facts.networkinterfaces[0].ip_configurations[0].private_ip_address }}" + private_ip_allocation_method: "{{ facts.networkinterfaces[0].ip_configurations[0].private_ip_allocation_method }}" + primary: "{{ facts.networkinterfaces[0].ip_configurations[0].primary }}" + subnet: "{{ facts.networkinterfaces[0].subnet }}" register: output -- assert: +- name: Assert the NIC created + ansible.builtin.assert: that: - not output.changed - name: Create most simple NIC (idempotent) azure_rm_networkinterface: - resource_group: "{{ resource_group }}" - name: "tn{{ rpfx }}" - virtual_network: "{{ vn.state.id }}" - subnet: "tn{{ rpfx }}" - create_with_security_group: False - public_ip: False + resource_group: "{{ resource_group }}" + name: "tn{{ rpfx }}" + virtual_network: "{{ vn.state.id }}" + subnet: "tn{{ rpfx }}" + create_with_security_group: false + public_ip: false register: output -- assert: +- name: Assert NIC created + ansible.builtin.assert: that: - not output.changed - name: Update security group (check mode) azure_rm_networkinterface: - resource_group: "{{ resource_group }}" - name: "tn{{ rpfx }}" - virtual_network: "{{ vn.state.id }}" - subnet: "tn{{ rpfx }}" - public_ip: False - security_group: "tn{{ rpfx }}sg" + resource_group: "{{ resource_group }}" + name: "tn{{ rpfx }}" + virtual_network: "{{ vn.state.id }}" + subnet: "tn{{ rpfx }}" + public_ip: false + security_group: "tn{{ rpfx }}sg" register: output - check_mode: yes + check_mode: true -- assert: +- name: Assert the security group check mode + ansible.builtin.assert: that: - output.changed - name: Update public ip address (check mode) azure_rm_networkinterface: - resource_group: "{{ resource_group }}" - name: "tn{{ rpfx }}" - virtual_network: "{{ vn.state.id }}" - subnet: "tn{{ rpfx }}" - public_ip_address_name: "tn{{ rpfx }}" - create_with_security_group: False + resource_group: "{{ resource_group }}" + name: "tn{{ rpfx }}" + virtual_network: "{{ vn.state.id }}" + subnet: "tn{{ rpfx }}" + public_ip_address_name: "tn{{ rpfx }}" + create_with_security_group: false register: output - check_mode: yes + check_mode: true -- assert: +- name: Assert the public ip check mode + ansible.builtin.assert: that: - output.changed - name: Update accelerated networking (check mode) azure_rm_networkinterface: - resource_group: "{{ resource_group }}" - name: "tn{{ rpfx }}" - virtual_network: "{{ vn.state.id }}" - subnet: "tn{{ rpfx }}" - enable_accelerated_networking: True - create_with_security_group: False - public_ip: False + resource_group: "{{ resource_group }}" + name: "tn{{ rpfx }}" + virtual_network: "{{ vn.state.id }}" + subnet: "tn{{ rpfx }}" + enable_accelerated_networking: true + create_with_security_group: false + public_ip: false register: output - check_mode: yes + check_mode: true -- assert: +- name: Assert the network check mode facts + ansible.builtin.assert: that: - output.changed - name: Update IP forwarding networking (check mode) azure_rm_networkinterface: - resource_group: "{{ resource_group }}" - name: "tn{{ rpfx }}" - virtual_network: "{{ vn.state.id }}" - subnet: "tn{{ rpfx }}" - create_with_security_group: False - enable_ip_forwarding: True - public_ip: False + resource_group: "{{ resource_group }}" + name: "tn{{ rpfx }}" + virtual_network: "{{ vn.state.id }}" + subnet: "tn{{ rpfx }}" + create_with_security_group: false + enable_ip_forwarding: true + public_ip: false register: output - check_mode: yes + check_mode: true -- assert: +- name: Assert the NIC check mode facts + ansible.builtin.assert: that: - output.changed - name: Update dns server (check mode) azure_rm_networkinterface: - resource_group: "{{ resource_group }}" - name: "tn{{ rpfx }}" - virtual_network: "{{ vn.state.id }}" - subnet: "tn{{ rpfx }}" - create_with_security_group: False - public_ip: False - dns_servers: - - 8.9.10.11 - - 7.8.9.10 + resource_group: "{{ resource_group }}" + name: "tn{{ rpfx }}" + virtual_network: "{{ vn.state.id }}" + subnet: "tn{{ rpfx }}" + create_with_security_group: false + public_ip: false + dns_servers: + - 8.9.10.11 + - 7.8.9.10 register: output - check_mode: yes + check_mode: true -- assert: +- name: Assert the NIC check mode facts + ansible.builtin.assert: that: - output.changed - name: Update NIC azure_rm_networkinterface: - resource_group: "{{ resource_group }}" - name: "tn{{ rpfx }}" - virtual_network: "{{ vn.state.id }}" - subnet: "tn{{ rpfx }}" - enable_accelerated_networking: True - enable_ip_forwarding: True - security_group: "tn{{ rpfx }}sg" - dns_servers: - - 8.9.10.11 - - 7.8.9.10 - ip_configurations: - - name: "{{ facts.networkinterfaces[0].ip_configurations[0].name }}" - private_ip_address: "{{ facts.networkinterfaces[0].ip_configurations[0].private_ip_address }}" - private_ip_allocation_method: "{{ facts.networkinterfaces[0].ip_configurations[0].private_ip_allocation_method }}" - primary: "{{ facts.networkinterfaces[0].ip_configurations[0].primary }}" - - name: ipconfig1 - public_ip_name: "tn{{ rpfx }}" - load_balancer_backend_address_pools: - - "{{ lb.state.backend_address_pools[0].id }}" - - name: backendaddrpool1 - load_balancer: "lb{{ rpfx }}" - - name: ipconfig2 - public_ip_name: "tn{{ rpfx }}v6" - private_ip_address_version: 'IPv6' - load_balancer_backend_address_pools: - - "{{ lb.state.backend_address_pools[2].id }}" - - name: backendaddrpool2 - load_balancer: "lb{{ rpfx }}" - register: output - -- assert: + resource_group: "{{ resource_group }}" + name: "tn{{ rpfx }}" + virtual_network: "{{ vn.state.id }}" + subnet: "tn{{ rpfx }}" + enable_accelerated_networking: true + enable_ip_forwarding: true + security_group: "tn{{ rpfx }}sg" + dns_servers: + - 8.9.10.11 + - 7.8.9.10 + ip_configurations: + - name: "{{ facts.networkinterfaces[0].ip_configurations[0].name }}" + private_ip_address: "{{ facts.networkinterfaces[0].ip_configurations[0].private_ip_address }}" + private_ip_allocation_method: "{{ facts.networkinterfaces[0].ip_configurations[0].private_ip_allocation_method }}" + primary: "{{ facts.networkinterfaces[0].ip_configurations[0].primary }}" + - name: ipconfig1 + public_ip_name: "tn{{ rpfx }}" + load_balancer_backend_address_pools: + - "{{ lb.state.backend_address_pools[0].id }}" + - name: backendaddrpool1 + load_balancer: "lb{{ rpfx }}" + - name: ipconfig2 + public_ip_name: "tn{{ rpfx }}v6" + private_ip_address_version: 'IPv6' + load_balancer_backend_address_pools: + - "{{ lb.state.backend_address_pools[2].id }}" + - name: backendaddrpool2 + load_balancer: "lb{{ rpfx }}" + register: output + +- name: Assert NIC update facts + ansible.builtin.assert: that: - output.changed - output.state.dns_settings.dns_servers == ['8.9.10.11', '7.8.9.10'] @@ -286,37 +297,38 @@ - name: Complicated NIC (idempontent) azure_rm_networkinterface: - resource_group: "{{ resource_group }}" - name: "tn{{ rpfx }}" - virtual_network: "{{ vn.state.id }}" - subnet: "tn{{ rpfx }}" - enable_accelerated_networking: True - security_group: "tn{{ rpfx }}sg" - enable_ip_forwarding: True - dns_servers: - - 8.9.10.11 - - 7.8.9.10 - ip_configurations: - - name: "{{ facts.networkinterfaces[0].ip_configurations[0].name }}" - private_ip_address: "{{ facts.networkinterfaces[0].ip_configurations[0].private_ip_address }}" - private_ip_allocation_method: "{{ facts.networkinterfaces[0].ip_configurations[0].private_ip_allocation_method }}" - primary: "{{ facts.networkinterfaces[0].ip_configurations[0].primary }}" - - name: ipconfig1 - public_ip_name: "tn{{ rpfx }}" - load_balancer_backend_address_pools: - - "{{ lb.state.backend_address_pools[0].id }}" - - name: backendaddrpool1 - load_balancer: "lb{{ rpfx }}" - - name: ipconfig2 - public_ip_name: "tn{{ rpfx }}v6" - private_ip_address_version: 'IPv6' - load_balancer_backend_address_pools: - - "{{ lb.state.backend_address_pools[2].id }}" - - name: backendaddrpool2 - load_balancer: "lb{{ rpfx }}" - register: output - -- assert: + resource_group: "{{ resource_group }}" + name: "tn{{ rpfx }}" + virtual_network: "{{ vn.state.id }}" + subnet: "tn{{ rpfx }}" + enable_accelerated_networking: true + security_group: "tn{{ rpfx }}sg" + enable_ip_forwarding: true + dns_servers: + - 8.9.10.11 + - 7.8.9.10 + ip_configurations: + - name: "{{ facts.networkinterfaces[0].ip_configurations[0].name }}" + private_ip_address: "{{ facts.networkinterfaces[0].ip_configurations[0].private_ip_address }}" + private_ip_allocation_method: "{{ facts.networkinterfaces[0].ip_configurations[0].private_ip_allocation_method }}" + primary: "{{ facts.networkinterfaces[0].ip_configurations[0].primary }}" + - name: ipconfig1 + public_ip_name: "tn{{ rpfx }}" + load_balancer_backend_address_pools: + - "{{ lb.state.backend_address_pools[0].id }}" + - name: backendaddrpool1 + load_balancer: "lb{{ rpfx }}" + - name: ipconfig2 + public_ip_name: "tn{{ rpfx }}v6" + private_ip_address_version: 'IPv6' + load_balancer_backend_address_pools: + - "{{ lb.state.backend_address_pools[2].id }}" + - name: backendaddrpool2 + load_balancer: "lb{{ rpfx }}" + register: output + +- name: Assert the NIC no change + ansible.builtin.assert: that: - not output.changed @@ -324,9 +336,10 @@ azure_rm_networkinterface_info: resource_group: "{{ resource_group }}" name: "tn{{ rpfx }}" - register: facts + register: facts -- assert: +- name: Assert the NIC facts + ansible.builtin.assert: that: - "facts.networkinterfaces | length == 1" - facts.networkinterfaces[0].id == output.state.id @@ -339,26 +352,27 @@ - name: Remove one dns server and ip configuration azure_rm_networkinterface: - resource_group: "{{ resource_group }}" - name: "tn{{ rpfx }}" - virtual_network: "{{ vn.state.id }}" - subnet: "tn{{ rpfx }}" - security_group: "tn{{ rpfx }}sg" - enable_accelerated_networking: True - enable_ip_forwarding: True - dns_servers: - - 8.9.10.11 - ip_configurations: - - name: ipconfig1 - public_ip_name: "tn{{ rpfx }}" - primary: True - load_balancer_backend_address_pools: - - "{{ lb.state.backend_address_pools[0].id }}" - - name: backendaddrpool1 - load_balancer: "lb{{ rpfx }}" - register: output - -- assert: + resource_group: "{{ resource_group }}" + name: "tn{{ rpfx }}" + virtual_network: "{{ vn.state.id }}" + subnet: "tn{{ rpfx }}" + security_group: "tn{{ rpfx }}sg" + enable_accelerated_networking: true + enable_ip_forwarding: true + dns_servers: + - 8.9.10.11 + ip_configurations: + - name: ipconfig1 + public_ip_name: "tn{{ rpfx }}" + primary: true + load_balancer_backend_address_pools: + - "{{ lb.state.backend_address_pools[0].id }}" + - name: backendaddrpool1 + load_balancer: "lb{{ rpfx }}" + register: output + +- name: Assert the NIC changed + ansible.builtin.assert: that: - output.changed - output.state.dns_settings.dns_servers == ['8.9.10.11'] @@ -370,15 +384,15 @@ - name: Create application security group(check mode) azure_rm_applicationsecuritygroup: - resource_group: "{{ resource_group }}" - name: "{{ applicationsecuritygroup_name1 }}" - tags: - testing: testing - check_mode: yes + resource_group: "{{ resource_group }}" + name: "{{ applicationsecuritygroup_name1 }}" + tags: + testing: testing + check_mode: true register: output - name: Assert check mode creation - assert: + ansible.builtin.assert: that: - output.changed @@ -387,11 +401,11 @@ resource_group: "{{ resource_group }}" name: "{{ applicationsecuritygroup_name1 }}" tags: - testing: testing + testing: testing register: output - name: Assert application security group creation - assert: + ansible.builtin.assert: that: - output.changed - output.id != '' @@ -403,7 +417,7 @@ register: facts - name: Assert facts - assert: + ansible.builtin.assert: that: - facts['applicationsecuritygroups'] | length == 1 - facts['applicationsecuritygroups'][0]['name'] != None @@ -412,28 +426,28 @@ - name: Create application security group (idempotent) azure_rm_applicationsecuritygroup: - resource_group: "{{ resource_group }}" - name: "{{ applicationsecuritygroup_name1 }}" - tags: - testing: testing + resource_group: "{{ resource_group }}" + name: "{{ applicationsecuritygroup_name1 }}" + tags: + testing: testing register: output - name: Assert idempotent - assert: + ansible.builtin.assert: that: - not output.changed - name: Update application security group azure_rm_applicationsecuritygroup: - resource_group: "{{ resource_group }}" - name: "{{ applicationsecuritygroup_name1 }}" - tags: - testing: testing - foo: bar + resource_group: "{{ resource_group }}" + name: "{{ applicationsecuritygroup_name1 }}" + tags: + testing: testing + foo: bar register: output - name: Assert update - assert: + ansible.builtin.assert: that: - output.changed @@ -449,18 +463,18 @@ name: "{{ nic_name1 }}" virtual_network: "{{ vn.state.id }}" subnet: "tn{{ rpfx }}" - create_with_security_group: True - public_ip: False + create_with_security_group: true + public_ip: false ip_configurations: - name: ipconfig1 application_security_groups: - "{{ applicationsecuritygroup_name1 }}" - "{{ asg.id }}" - primary: True + primary: true register: output -- name: assert creation succeeded - assert: +- name: Assert creation succeeded + ansible.builtin.assert: that: - output.changed @@ -470,18 +484,18 @@ name: "{{ nic_name1 }}" virtual_network: "{{ vn.state.id }}" subnet: "tn{{ rpfx }}" - create_with_security_group: True - public_ip: False + create_with_security_group: true + public_ip: false ip_configurations: - name: ipconfig1 application_security_groups: - "{{ asg.id }}" - "{{ applicationsecuritygroup_name1 }}" - primary: True + primary: true register: output -- name: assert idempotent - assert: +- name: Assert idempotent + ansible.builtin.assert: that: - not output.changed @@ -491,17 +505,17 @@ name: "{{ nic_name1 }}" virtual_network: "{{ vn.state.id }}" subnet: "tn{{ rpfx }}" - create_with_security_group: True - public_ip: False + create_with_security_group: true + public_ip: false ip_configurations: - name: ipconfig1 application_security_groups: - "{{ applicationsecuritygroup_name1 }}" - primary: True + primary: true register: output -- name: assert update succeeded - assert: +- name: Assert update succeeded + ansible.builtin.assert: that: - output.changed @@ -511,7 +525,8 @@ name: "{{ nic_name1 }}" register: facts -- assert: +- name: Assert the NIC created + ansible.builtin.assert: that: - "facts.networkinterfaces[0].ip_configurations[0].application_security_groups | length == 1" @@ -523,22 +538,29 @@ address_prefix_cidr: 10.10.1.0/24 register: appgw_subnet_output +- name: Create public IP addresses + azure_rm_publicipaddress: + name: my-appgw-pip + resource_group: "{{ resource_group_secondary }}" + sku: 'standard' + allocation_method: 'static' + version: 'ipv4' + - name: Create application gateway to connect NIC to azure_rm_appgateway: resource_group: "{{ resource_group_secondary }}" name: "appgateway{{ rpfx }}" sku: - name: standard_small - tier: standard + name: standard_v2 + tier: standard_v2 capacity: 2 gateway_ip_configurations: - subnet: id: "{{ appgw_subnet_output.state.id }}" name: app_gateway_ip_config frontend_ip_configurations: - - subnet: - id: "{{ appgw_subnet_output.state.id }}" - name: sample_gateway_frontend_ip_config + - name: sample_gateway_frontend_ip_config + public_ip_address: my-appgw-pip frontend_ports: - port: 80 name: http_frontend_port @@ -555,7 +577,7 @@ protocol: http name: http_listener request_routing_rules: - - rule_type: Basic + - rule_type: basic backend_address_pool: test_backend_address_pool backend_http_settings: sample_appgateway_http_settings http_listener: http_listener @@ -584,7 +606,8 @@ - name: "test_backend_address_pool" application_gateway: "appgateway{{ rpfx }}" register: output -- assert: +- name: Assert the NIC created + ansible.builtin.assert: that: - output.changed - output.state.ip_configurations | length == 1 @@ -606,7 +629,8 @@ - name: "test_backend_address_pool" application_gateway: "appgateway{{ rpfx }}" register: output -- assert: +- name: Assert the NIC idempotent + ansible.builtin.assert: that: - not output.changed @@ -615,7 +639,8 @@ name: "appgw-nic{{ rpfx }}" resource_group: "{{ resource_group_secondary }}" register: facts -- assert: +- name: Assert the NIC facts + ansible.builtin.assert: that: - facts.networkinterfaces | length == 1 - facts.networkinterfaces[0].id == output.state.id @@ -629,7 +654,8 @@ resource_group: "{{ resource_group_secondary }}" state: absent register: output -- assert: +- name: Assert the NIC deleted + ansible.builtin.assert: that: - output.changed @@ -639,51 +665,55 @@ resource_group: "{{ resource_group_secondary }}" state: absent register: output -- assert: +- name: Assert the application gateway deleted + ansible.builtin.assert: that: - output.changed - name: Delete the NIC (check mode) azure_rm_networkinterface: - resource_group: "{{ resource_group }}" - name: "tn{{ rpfx }}" - state: absent - check_mode: yes + resource_group: "{{ resource_group }}" + name: "tn{{ rpfx }}" + state: absent + check_mode: true register: output -- assert: +- name: Assert the NIC check mode + ansible.builtin.assert: that: - output.changed - name: Delete the NIC azure_rm_networkinterface: - resource_group: "{{ resource_group }}" - name: "tn{{ rpfx }}" - state: absent + resource_group: "{{ resource_group }}" + name: "tn{{ rpfx }}" + state: absent register: output -- assert: +- name: Assert the NIC deleted + ansible.builtin.assert: that: - output.changed - name: Delete the NIC (idempotent) azure_rm_networkinterface: - resource_group: "{{ resource_group }}" - name: "tn{{ rpfx }}" - state: absent + resource_group: "{{ resource_group }}" + name: "tn{{ rpfx }}" + state: absent register: output -- assert: +- name: Assert the NIC idempotent + ansible.builtin.assert: that: - not output.changed -- name: delete load balancer +- name: Delete load balancer azure_rm_loadbalancer: resource_group: '{{ resource_group }}' name: "lb{{ rpfx }}" state: absent -- name: delete public ip addresses +- name: Delete public ip addresses azure_rm_publicipaddress: name: "{{ item }}" resource_group: '{{ resource_group }}' @@ -695,47 +725,48 @@ - 'tn{{ rpfx }}' - 'tn{{ rpfx }}v6' -- assert: +- name: Assert the NIC deleted + ansible.builtin.assert: that: - output.changed - output.results | length == 4 - name: Delete the NIC azure_rm_networkinterface: - resource_group: "{{ resource_group }}" - name: "{{ nic_name1 }}" - state: absent + resource_group: "{{ resource_group }}" + name: "{{ nic_name1 }}" + state: absent - name: Delete the application security group (check mode) azure_rm_applicationsecuritygroup: - resource_group: "{{ resource_group }}" - name: "{{ applicationsecuritygroup_name1 }}" - state: absent - check_mode: yes + resource_group: "{{ resource_group }}" + name: "{{ applicationsecuritygroup_name1 }}" + state: absent + check_mode: true register: output - name: Assert delete check mode - assert: - that: - - output.changed + ansible.builtin.assert: + that: + - output.changed - name: Delete the application security group azure_rm_applicationsecuritygroup: - resource_group: "{{ resource_group }}" - name: "{{ applicationsecuritygroup_name1 }}" - state: absent + resource_group: "{{ resource_group }}" + name: "{{ applicationsecuritygroup_name1 }}" + state: absent register: output - name: Assert the deletion - assert: - that: - - output.changed + ansible.builtin.assert: + that: + - output.changed - name: Delete second application security group azure_rm_applicationsecuritygroup: - resource_group: "{{ resource_group_secondary }}" - name: "{{ applicationsecuritygroup_name2 }}" - state: absent + resource_group: "{{ resource_group_secondary }}" + name: "{{ applicationsecuritygroup_name2 }}" + state: absent register: output - name: Delete network security groups @@ -748,7 +779,8 @@ - '{{ nic_name1 }}' - 'tn{{ rpfx }}sg' -- assert: +- name: Assert the security group deleted + ansible.builtin.assert: that: - output.changed - output.results | length == 2 @@ -760,6 +792,7 @@ state: 'absent' register: output -- assert: +- name: Assert the virtual network deleted + ansible.builtin.assert: that: - output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_notificationhub/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_notificationhub/tasks/main.yml index ed79aff83..7d734b077 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_notificationhub/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_notificationhub/tasks/main.yml @@ -1,7 +1,7 @@ - name: Create random notification hub and namespace - set_fact: - namespace_name: "test{{ resource_group | hash('md5') | truncate(16, True, '') + (65535 | random | string) }}" - name: "test{{ resource_group | hash('md5') | truncate(16, True, '') + (65535 | random | string) }}" + ansible.builtin.set_fact: + namespace_name: "test{{ resource_group | hash('md5') | truncate(16, True, '') + (65535 | random | string) }}" + name_rpfx: "test{{ resource_group | hash('md5') | truncate(16, True, '') + (65535 | random | string) }}" - name: Create Notification Hub Namespace (check mode) azure_rm_notificationhub: @@ -9,23 +9,25 @@ namespace_name: "{{ namespace_name }}" resource_group: "{{ resource_group }}" sku: "free" - check_mode: yes + check_mode: true register: results -- assert: +- name: Assert the notification hub check mode + ansible.builtin.assert: that: results.changed - name: Create Notification Hub (check mode) azure_rm_notificationhub: location: eastus2 namespace_name: "{{ namespace_name }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" sku: "free" - check_mode: yes + check_mode: true register: results -- assert: +- name: Assert the notfication hub check mode + ansible.builtin.assert: that: results.changed - name: Create Namespace Hub @@ -36,19 +38,21 @@ sku: "free" register: results -- assert: +- name: Assert the notification hub created + ansible.builtin.assert: that: results.changed - name: Create Notification Hub azure_rm_notificationhub: location: eastus2 namespace_name: "{{ namespace_name }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" sku: "free" register: results -- assert: +- name: Assert the notification hub created + ansible.builtin.assert: that: results.changed - name: Update Namespace @@ -60,24 +64,25 @@ test: modified register: results -- assert: - that: +- name: Assert the namespace updated + ansible.builtin.assert: + that: - results.changed - results.state.tags.test == 'modified' - - name: Update Notification Hub azure_rm_notificationhub: location: eastus2 namespace_name: "{{ namespace_name }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" tags: test: modified register: results -- assert: - that: +- name: Assert the notification hub updated + ansible.builtin.assert: + that: - results.changed - results.state.tags.test == 'modified' @@ -88,8 +93,8 @@ register: results - name: Assert that facts module returned result - assert: - that: + ansible.builtin.assert: + that: - results.namespace[0].tags.test == 'modified' - name: Test idempotent @@ -98,7 +103,8 @@ resource_group: "{{ resource_group }}" register: results -- assert: +- name: Assert the notification hub check mode + ansible.builtin.assert: that: - not results.changed @@ -114,8 +120,9 @@ state: absent - name: Pause for 3 minutes to make sure delete successfully - pause: + ansible.builtin.pause: minutes: 3 + changed_when: true - name: Delete Namespace (idempotent) azure_rm_notificationhub: @@ -125,29 +132,32 @@ state: absent register: results -- assert: +- name: Assert the namespace deleted + ansible.builtin.assert: that: not results.changed - name: Delete Notification Hub azure_rm_notificationhub: location: eastus2 namespace_name: "{{ namespace_name }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" state: absent - name: Pause for 3 minutes to make sure delete successfully - pause: + ansible.builtin.pause: minutes: 3 + changed_when: true - name: Delete Notification Hub (idempotent) azure_rm_notificationhub: location: eastus2 namespace_name: "{{ namespace_name }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" state: absent register: results -- assert: +- name: Assert the notificationhub deleted + ansible.builtin.assert: that: not results.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_openshiftmanagedcluster/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_openshiftmanagedcluster/tasks/main.yml index a173bf929..969347b8d 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_openshiftmanagedcluster/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_openshiftmanagedcluster/tasks/main.yml @@ -1,7 +1,8 @@ -- set_fact: +- name: Set variables + ansible.builtin.set_fact: cluster_name: "{{ resource_group | hash('md5') | truncate(8, True, '') }}" -- name: get resource group info +- name: Get resource group info azure_rm_resourcegroup_info: name: "{{ resource_group_secondary }}" register: rg_output @@ -11,8 +12,9 @@ resource_group: "{{ resource_group_secondary }}" register: output -- assert: - that: output['clusters'] | length == 0 +- name: Assert the cluster facts + ansible.builtin.assert: + that: output['clusters'] | length == 0 - name: Get specific cluster information for a specific cluster azure_rm_openshiftmanagedcluster_info: @@ -20,15 +22,17 @@ name: "{{ cluster_name }}" register: output -- assert: - that: output['clusters'].keys() | length == 0 +- name: Assert the cluster facts + ansible.builtin.assert: + that: output['clusters'].keys() | length == 0 - name: Get all clusters azure_rm_openshiftmanagedcluster_info: register: output -- assert: - that: output['clusters']['value'] | length == 0 +- name: Assert all clusters facts + ansible.builtin.assert: + that: output['clusters']['value'] | length == 0 - name: Create virtual network azure_rm_virtualnetwork: @@ -38,7 +42,7 @@ - 10.151.0.0/16 - 10.152.0.0/16 -- name: create master subnet +- name: Create master subnet azure_rm_subnet: name: master_foobar virtual_network_name: testVnet @@ -46,7 +50,7 @@ address_prefix_cidr: 10.151.0.0/24 register: master_sub_output -- name: create work subnet +- name: Create work subnet azure_rm_subnet: name: worker_foobar virtual_network_name: testVnet @@ -78,8 +82,9 @@ subnet_id: "{{ master_sub_output.state.id }}" register: output -- assert: - that: output.changed +- name: Assert the cluster created + ansible.builtin.assert: + that: output.changed - name: Get available clusters for a specific resource_group @@ -87,8 +92,9 @@ resource_group: "{{ resource_group }}" register: output -- assert: - that: output['clusters'] | length == 1 +- name: Assert the cluster facts + ansible.builtin.assert: + that: output['clusters'] | length == 1 - name: Get specific cluster information for a specific cluster azure_rm_openshiftmanagedcluster_info: @@ -96,15 +102,17 @@ name: "{{ cluster_name }}" register: output -- assert: - that: output['clusters']['name'] == "{{ cluster_name }}" +- name: Assert the cluster facts + ansible.builtin.assert: + that: output['clusters']['name'] == "{{ cluster_name }}" - name: Get all clusters azure_rm_openshiftmanagedcluster_info: register: output -- assert: - that: output['clusters'] | length >= 1 +- name: Assert all cluster + ansible.builtin.assert: + that: output['clusters'] | length >= 1 - name: Delete openshift cluster azure_rm_openshiftmanagedcluster: @@ -114,5 +122,6 @@ state: absent register: output -- assert: - that: output.changed +- name: Assert the cluster deleted + ansible.builtin.assert: + that: output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_postgresqlserver/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_postgresqlserver/tasks/main.yml index b4022b27b..e9602517a 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_postgresqlserver/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_postgresqlserver/tasks/main.yml @@ -1,7 +1,7 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - run_once: yes + run_once: true - name: Create instance of PostgreSQL Server -- check mode azure_rm_postgresqlserver: @@ -12,13 +12,13 @@ tier: Basic location: westus2 storage_mb: 51200 - enforce_ssl: True + enforce_ssl: true admin_username: zimxyz admin_password: Password123! - check_mode: yes + check_mode: true register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -31,12 +31,12 @@ tier: Basic location: westus2 storage_mb: 51200 - enforce_ssl: True + enforce_ssl: true admin_username: zimxyz admin_password: Password123! register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed - output.state == 'Ready' @@ -50,12 +50,12 @@ tier: Basic location: westus2 storage_mb: 51200 - enforce_ssl: True + enforce_ssl: true admin_username: zimxyz admin_password: Password123! register: output - name: Assert the state has not changed - assert: + ansible.builtin.assert: that: - output.changed == false - output.state == 'Ready' @@ -69,16 +69,17 @@ tier: Basic location: westus2 storage_mb: 128000 - enforce_ssl: True + enforce_ssl: true admin_username: zimxyz admin_password: Password123! register: output - name: Assert the state has not changed - assert: + ansible.builtin.assert: that: - output.changed - output.state == 'Ready' -- debug: +- name: Print the postgresql server states + ansible.builtin.debug: var: output - name: Gather facts postgresql Server @@ -87,7 +88,7 @@ name: postgresqlsrv{{ rpfx }} register: output - name: Assert that storage size is correct - assert: + ansible.builtin.assert: that: - output.servers[0]['storage_mb'] == 128000 @@ -100,8 +101,8 @@ tier: Basic location: westus2 storage_mb: 51200 - enforce_ssl: True - storage_autogrow: True + enforce_ssl: true + storage_autogrow: true backup_retention_days: 7 admin_username: zimxyz admin_password: Password123! @@ -117,8 +118,8 @@ tier: Basic location: westus2 storage_mb: 51200 - enforce_ssl: True - storage_autogrow: True + enforce_ssl: true + storage_autogrow: true backup_retention_days: 7 admin_username: zimxyz admin_password: Password123! @@ -132,7 +133,7 @@ register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.servers[0]['id'] != None @@ -153,7 +154,7 @@ resource_group: "{{ resource_group }}" register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.servers[0]['id'] != None @@ -185,10 +186,10 @@ name: testdatabase charset: UTF8 collation: English_United States.1252 - check_mode: yes + check_mode: true register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -201,7 +202,7 @@ collation: English_United States.1252 register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed - output.name == 'testdatabase' @@ -215,7 +216,7 @@ collation: English_United States.1252 register: output - name: Assert the state has not changed - assert: + ansible.builtin.assert: that: - output.changed == false - output.name == 'testdatabase' @@ -227,10 +228,10 @@ name: testdatabase charset: utf8 collation: en_US.utf8 - ignore_errors: yes + ignore_errors: true register: output - name: Assert that nothing has changed - assert: + ansible.builtin.assert: that: - output.changed == False @@ -241,10 +242,10 @@ name: testdatabase charset: utf8 collation: en_US.utf8 - force_update: yes + force_update: true register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed - output.name == 'testdatabase' @@ -263,7 +264,7 @@ register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.databases[0]['server_name'] != None @@ -277,7 +278,7 @@ server_name: postgresqlsrv{{ rpfx }} register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.databases[0]['server_name'] != None @@ -295,10 +296,10 @@ server_name: postgresqlsrv{{ rpfx }} name: testdatabase state: absent - check_mode: yes + check_mode: true register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -310,7 +311,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -322,7 +323,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed == false @@ -337,10 +338,10 @@ name: firewallrule{{ rpfx }} start_ip_address: 172.28.10.136 end_ip_address: 172.28.10.138 - check_mode: yes + check_mode: true register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -353,7 +354,7 @@ end_ip_address: 172.28.10.138 register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -366,7 +367,7 @@ end_ip_address: 172.28.10.138 register: output - name: Assert the state has not changed - assert: + ansible.builtin.assert: that: - output.changed == false @@ -385,7 +386,7 @@ name: firewallrule{{ rpfx }} register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.rules[0].id != None @@ -401,7 +402,7 @@ server_name: postgresqlsrv{{ rpfx }} register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.rules[0].id != None @@ -421,10 +422,10 @@ server_name: postgresqlsrv{{ rpfx }} name: firewallrule{{ rpfx }} state: absent - check_mode: yes + check_mode: true register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -436,7 +437,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -448,7 +449,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed == false @@ -466,7 +467,7 @@ name: firewallrule{{ rpfx }} register: output - name: Assert that empty list was returned - assert: + ansible.builtin.assert: that: - output.changed == False - "output.rules | length == 0" @@ -480,10 +481,10 @@ server_name: postgresqlsrv{{ rpfx }} name: deadlock_timeout value: 2000 - check_mode: yes + check_mode: true register: output - name: Assert that change was registered - assert: + ansible.builtin.assert: that: - output.changed @@ -495,7 +496,7 @@ value: 2000 register: output - name: Assert that change was registered - assert: + ansible.builtin.assert: that: - output.changed @@ -507,7 +508,7 @@ value: 2000 register: output - name: Assert that change was not registered - assert: + ansible.builtin.assert: that: - not output.changed @@ -519,7 +520,7 @@ state: absent register: output - name: Assert that change was registered - assert: + ansible.builtin.assert: that: - output.changed @@ -531,7 +532,7 @@ state: absent register: output - name: Assert that change was registered - assert: + ansible.builtin.assert: that: - not output.changed @@ -542,7 +543,7 @@ name: deadlock_timeout register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.settings[0].id != None @@ -558,7 +559,7 @@ server_name: postgresqlsrv{{ rpfx }} register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.settings[0].id != None @@ -577,10 +578,10 @@ resource_group: "{{ resource_group }}" name: postgresqlsrv{{ rpfx }} state: absent - check_mode: yes + check_mode: true register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -591,7 +592,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -602,7 +603,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed == false diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_privatednsrecordset/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_privatednsrecordset/tasks/main.yml index 645851a04..3de80ce43 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_privatednsrecordset/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_privatednsrecordset/tasks/main.yml @@ -1,5 +1,5 @@ - name: Create random domain name - set_fact: + ansible.builtin.set_fact: domain_name: "{{ resource_group | hash('md5') | truncate(16, True, '') + (65535 | random | string) }}" - name: Create a Private DNS zone @@ -10,10 +10,10 @@ register: results - name: Assert that Private DNS zone was created - assert: + ansible.builtin.assert: that: results.changed -- name: create "A" record set with multiple records +- name: Create "A" record set with multiple records azure_rm_privatednsrecordset: resource_group: "{{ resource_group }}" relative_name: www @@ -26,10 +26,10 @@ register: results - name: Assert that A record set was created - assert: + ansible.builtin.assert: that: results.changed -- name: re-run "A" record with same values +- name: Re-run "A" record with same values azure_rm_privatednsrecordset: resource_group: "{{ resource_group }}" relative_name: www @@ -42,7 +42,7 @@ register: results - name: Assert that A record set was not changed - assert: + ansible.builtin.assert: that: not results.changed - name: Update "A" record set with additional record @@ -57,11 +57,11 @@ register: results - name: Assert that new record was appended - assert: + ansible.builtin.assert: that: - results.changed -- name: re-update "A" record set with additional record +- name: Re-update "A" record set with additional record azure_rm_privatednsrecordset: resource_group: "{{ resource_group }}" relative_name: www @@ -73,7 +73,7 @@ register: results - name: Assert that A record set was not changed - assert: + ansible.builtin.assert: that: - not results.changed @@ -90,7 +90,7 @@ register: results - name: Assert that record was deleted - assert: + ansible.builtin.assert: that: - results.changed @@ -102,11 +102,11 @@ record_type: A records: - entry: 192.168.100.105 - check_mode: yes + check_mode: true register: results - name: Assert that check_mode returns new state - assert: + ansible.builtin.assert: that: - results.changed @@ -118,7 +118,8 @@ record_type: A register: results -- assert: +- name: Assert the DNS recoredset facts + ansible.builtin.assert: that: - not results.changed - results.dnsrecordsets[0].id != None @@ -128,7 +129,7 @@ - results.dnsrecordsets[0].relative_name == 'www' - results.dnsrecordsets[0].records | length > 0 -- name: delete a record set +- name: Delete a record set azure_rm_privatednsrecordset: resource_group: "{{ resource_group }}" relative_name: www @@ -138,10 +139,10 @@ register: results - name: Assert that record set deleted - assert: + ansible.builtin.assert: that: results.changed -- name: (idempotence test) re-run record set absent +- name: Re-run record set absent (idempotence test) azure_rm_privatednsrecordset: resource_group: "{{ resource_group }}" relative_name: www @@ -150,11 +151,11 @@ state: absent register: results -- name: - assert: +- name: Assert recored set deleted + ansible.builtin.assert: that: not results.changed -- name: create SRV records in a new record set +- name: Create SRV records in a new record set azure_rm_privatednsrecordset: resource_group: "{{ resource_group }}" relative_name: "_sip._tcp.{{ domain_name }}.com" @@ -163,14 +164,14 @@ record_type: SRV state: present records: - - entry: sip.{{ domain_name }}.com - priority: 20 - weight: 10 - port: 5060 + - entry: sip.{{ domain_name }}.com + priority: 20 + weight: 10 + port: 5060 register: results - name: Assert that SRV record set was created - assert: + ansible.builtin.assert: that: - results.changed @@ -182,7 +183,8 @@ record_type: SRV register: results -- assert: +- name: Assert the DNS recordset facts + ansible.builtin.assert: that: - not results.changed - results.dnsrecordsets[0].id != None @@ -192,7 +194,7 @@ - results.dnsrecordsets[0].relative_name == "_sip._tcp.{{ domain_name }}.com" - results.dnsrecordsets[0].records | length > 0 -- name: create TXT records in a new record set +- name: Create TXT records in a new record set azure_rm_privatednsrecordset: resource_group: "{{ resource_group }}" relative_name: "_txt.{{ domain_name }}.com" @@ -208,7 +210,7 @@ register: results - name: Assert that TXT record set was created - assert: + ansible.builtin.assert: that: - results.changed @@ -220,7 +222,8 @@ record_type: TXT register: results -- assert: +- name: Assert the DNS recordset facts + ansible.builtin.assert: that: - not results.changed - results.dnsrecordsets[0].id != None @@ -248,7 +251,7 @@ register: results - name: Assert that SOA record set was created - assert: + ansible.builtin.assert: that: - results.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_privatednszone/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_privatednszone/tasks/main.yml index eba80899d..92b91344f 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_privatednszone/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_privatednszone/tasks/main.yml @@ -1,5 +1,5 @@ - name: Create random domain name - set_fact: + ansible.builtin.set_fact: domain_name: "{{ resource_group | hash('md5') | truncate(16, True, '') + (65535 | random | string) }}" - name: Create a private DNS zone (check mode) @@ -9,7 +9,8 @@ register: results check_mode: true -- assert: +- name: Assert there is no private dns zone resource + ansible.builtin.assert: that: results.changed - name: Create a private DNS zone @@ -18,7 +19,8 @@ name: "{{ domain_name }}.com" register: results -- assert: +- name: Assert the private dns zone created + ansible.builtin.assert: that: results.changed - name: Update private DNS zone with tags @@ -29,7 +31,8 @@ test: modified register: results -- assert: +- name: Assert the private dns zone updated + ansible.builtin.assert: that: - results.changed - results.state.tags.test == 'modified' @@ -40,7 +43,8 @@ resource_group: "{{ resource_group }}" register: results -- assert: +- name: Assert idempotent + ansible.builtin.assert: that: - not results.changed @@ -51,7 +55,7 @@ register: zones - name: Assert that facts module returned result - assert: + ansible.builtin.assert: that: - zones.privatednszones[0].tags.test == 'modified' - zones.privatednszones[0].number_of_record_sets == 1 @@ -63,7 +67,7 @@ - name: Delete private DNS zone azure_rm_privatednszone: resource_group: "{{ resource_group }}" - name: "{{ domain_name }}.com" + name: "{{ domain_name }}.com" state: absent - name: Delete private DNS zone (idempotent) @@ -73,5 +77,6 @@ state: absent register: results -- assert: +- name: Assert the private dns zone deleted + ansible.builtin.assert: that: not results.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_privatednszonelink/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_privatednszonelink/tasks/main.yml index 6125abaa3..febd845bb 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_privatednszonelink/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_privatednszonelink/tasks/main.yml @@ -1,14 +1,14 @@ - name: Create virtual network link name - set_fact: + ansible.builtin.set_fact: link_name: "link{{ resource_group | hash('md5') | truncate(22, True, '') }}" - name: Create random number - set_fact: + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - run_once: yes + run_once: true - name: Create random domain name - set_fact: + ansible.builtin.set_fact: domain_name: "{{ resource_group | hash('md5') | truncate(16, True, '') + (65535 | random | string) }}" - name: Create a Private DNS zone @@ -22,11 +22,11 @@ name: "vnet{{ rpfx }}" resource_group: "{{ resource_group }}" address_prefixes_cidr: - - 10.1.0.0/16 - - 172.100.0.0/16 + - 10.1.0.0/16 + - 172.100.0.0/16 dns_servers: - - 127.0.0.1 - - 127.0.0.2 + - 127.0.0.1 + - 127.0.0.2 - name: Create a subnet azure_rm_subnet: @@ -45,7 +45,7 @@ register: results - name: Assert that virtual network link is created - assert: + ansible.builtin.assert: that: results.changed - name: Create a virtual network link (Idempotent test) @@ -58,7 +58,7 @@ register: results - name: Assert that output is not changed - assert: + ansible.builtin.assert: that: not results.changed - name: Update a virtual network link @@ -72,7 +72,7 @@ register: results - name: Assert that virtual network link is updated - assert: + ansible.builtin.assert: that: results.changed - name: Get virtual network link @@ -82,7 +82,8 @@ zone_name: "{{ domain_name }}.com" register: results -- assert: +- name: Assert the virtual network link facts + ansible.builtin.assert: that: - not results.changed - results.virtualnetworklinks[0].name == "{{ link_name }}" @@ -98,7 +99,7 @@ register: results - name: Assert that virtual network link is deleted - assert: + ansible.builtin.assert: that: results.changed - name: Delete virtual network link (Idempotent test) @@ -110,7 +111,7 @@ register: results - name: Asset that output is not changed - assert: + ansible.builtin.assert: that: not results.changed - name: Delete virtual network diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_privateendpoint/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_privateendpoint/tasks/main.yml index 306c1cc0a..589c27843 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_privateendpoint/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_privateendpoint/tasks/main.yml @@ -1,5 +1,5 @@ - name: Set Private Endpoint Name - set_fact: + ansible.builtin.set_fact: rpfx: "private{{ resource_group | hash('md5') | truncate(18, True, '') }}" - name: Create virtual network @@ -42,7 +42,7 @@ tier: GeneralPurpose location: eastus storage_mb: 51200 - enforce_ssl: True + enforce_ssl: true admin_username: zimxyz admin_password: Password123! register: post_output @@ -70,7 +70,7 @@ register: output - name: Assert status succeeded and results match expectations - assert: + ansible.builtin.assert: that: - output.changed - output.state.id is defined @@ -88,15 +88,16 @@ - postgresqlServer subnet: id: "{{ subnet_output.state.id }}" - tags: + tags: key1: value1 register: output - name: Assert status succeeded and results match expectations - assert: - that: + ansible.builtin.assert: + that: - not output.changed - ignore_errors: yes + ignore_errors: true + register: ignore_errors_register - name: Update private endpoint with tags azure_rm_privateendpoint: @@ -109,13 +110,13 @@ - postgresqlServer subnet: id: "{{ subnet_output.state.id }}" - tags: + tags: key1: value1 key2: value2 register: output - name: Assert status succeeded and results match expectations - assert: + ansible.builtin.assert: that: - output.changed - output.state.tags | length == 2 @@ -127,7 +128,7 @@ register: output - name: Assert private endpoint info - assert: + ansible.builtin.assert: that: - output.privateendpoints[0].provisioning_state == "Succeeded" - output.privateendpoints[0].tags | length == 2 @@ -140,7 +141,7 @@ register: output - name: Assert status succeeded and results match expectations - assert: + ansible.builtin.assert: that: - output.changed @@ -152,6 +153,6 @@ register: output - name: Assert status succeeded and results match expectations - assert: + ansible.builtin.assert: that: - not output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_privateendpointdnszonegroup/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_privateendpointdnszonegroup/tasks/main.yml index e58a3ba22..b5fc3e1f1 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_privateendpointdnszonegroup/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_privateendpointdnszonegroup/tasks/main.yml @@ -1,5 +1,5 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" run_once: true @@ -42,7 +42,7 @@ ignore_errors: true register: output - name: Assert results match expectations - assert: + ansible.builtin.assert: that: - output.msg is match("Could not load the private endpoint", ignorecase=True) @@ -76,7 +76,7 @@ resource_group: "{{ resource_group }}" register: output - name: Assert results match expectations - assert: + ansible.builtin.assert: that: - not output.changed - output.groups | length == 0 @@ -92,7 +92,7 @@ register: output check_mode: true - name: Assert results match expectations - assert: + ansible.builtin.assert: that: - output.changed @@ -106,7 +106,7 @@ private_dns_zone: "privatelink.postgres.database.azure.com" register: output - name: Assert results match expectations - assert: + ansible.builtin.assert: that: - output.changed - output.state.id @@ -134,7 +134,7 @@ private_dns_zone: "privatelink.postgres.database.azure.com" register: output - name: Assert results match expectations - assert: + ansible.builtin.assert: that: - not output.changed @@ -145,7 +145,7 @@ resource_group: "{{ resource_group }}" register: output - name: Assert results match expectations - assert: + ansible.builtin.assert: that: - not output.changed - output.groups | length == 1 @@ -170,7 +170,7 @@ resource_group: "{{ resource_group }}" register: output - name: Assert results match expectations - assert: + ansible.builtin.assert: that: - not output.changed - output.groups | length == 1 @@ -199,7 +199,7 @@ private_dns_zone: "privatelink.postgres.database.azure.com" register: output - name: Assert results match expectations - assert: + ansible.builtin.assert: that: - output.changed - output.state.id @@ -226,7 +226,7 @@ register: output check_mode: true - name: Assert results match expectations - assert: + ansible.builtin.assert: that: - output.changed @@ -238,7 +238,7 @@ state: "absent" register: output - name: Assert results match expectations - assert: + ansible.builtin.assert: that: - output.changed @@ -250,6 +250,6 @@ state: "absent" register: output - name: Assert results match expectations - assert: + ansible.builtin.assert: that: - not output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_privatelinkservice/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_privatelinkservice/tasks/main.yml index bc0363c56..a3743b074 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_privatelinkservice/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_privatelinkservice/tasks/main.yml @@ -1,5 +1,5 @@ - name: Set Private Link Service Names - set_fact: + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(20, True, '') }}" azure_subscription_id: f64d4ee8-be94-457d-ba26-3fa6b6506cef @@ -27,14 +27,14 @@ private_endpoint_network_policies: Disabled register: subnet_output -- name: create public ip +- name: Create public ip azure_rm_publicipaddress: resource_group: '{{ resource_group }}' name: "pip{{ rpfx }}" sku: Standard allocation_method: Static -- name: create load balancer with frontend_ip_configurations +- name: Create load balancer with frontend_ip_configurations azure_rm_loadbalancer: resource_group: '{{ resource_group }}' name: "lb{{ rpfx }}" @@ -66,54 +66,55 @@ azure_rm_privatelinkservice: name: "lsp{{ rpfx }}" resource_group: "{{ resource_group }}" - enable_proxy_protocol: True + enable_proxy_protocol: true fqdns: - 'dns01.com' - 'dns02.com' visibility: - subscriptions: - - "{{ azure_subscription_id }}" + subscriptions: + - "{{ azure_subscription_id }}" auto_approval: - subscriptions: - - "{{ azure_subscription_id }}" + subscriptions: + - "{{ azure_subscription_id }}" load_balancer_frontend_ip_configurations: - id: "{{ lb_output.state.frontend_ip_configurations[0].id }}" ip_configurations: - name: ip_configuration01 properties: - primary: True + primary: true private_ip_allocation_method: 'Dynamic' private_ip_address_version: 'IPv4' subnet: id: "{{ subnet_output.state.id }}" tags: key1: value1 - check_mode: True + check_mode: true register: output -- assert: +- name: Assert there is no private link service + ansible.builtin.assert: that: output.changed - name: Create private link service azure_rm_privatelinkservice: name: "lsp{{ rpfx }}" resource_group: "{{ resource_group }}" - enable_proxy_protocol: True + enable_proxy_protocol: true fqdns: - 'dns01.com' - 'dns02.com' visibility: - subscriptions: - - "{{ azure_subscription_id }}" + subscriptions: + - "{{ azure_subscription_id }}" auto_approval: - subscriptions: - - "{{ azure_subscription_id }}" + subscriptions: + - "{{ azure_subscription_id }}" load_balancer_frontend_ip_configurations: - id: "{{ lb_output.state.frontend_ip_configurations[0].id }}" ip_configurations: - name: ip_configuration01 properties: - primary: True + primary: true private_ip_allocation_method: 'Dynamic' private_ip_address_version: 'IPv4' subnet: @@ -122,29 +123,30 @@ key1: value1 register: output -- assert: +- name: Assert the private link service created + ansible.builtin.assert: that: output.changed - name: Create private link service (Idempotent test) azure_rm_privatelinkservice: name: "lsp{{ rpfx }}" resource_group: "{{ resource_group }}" - enable_proxy_protocol: True + enable_proxy_protocol: true fqdns: - 'dns01.com' - 'dns02.com' visibility: - subscriptions: - - "{{ azure_subscription_id }}" + subscriptions: + - "{{ azure_subscription_id }}" auto_approval: - subscriptions: - - "{{ azure_subscription_id }}" + subscriptions: + - "{{ azure_subscription_id }}" load_balancer_frontend_ip_configurations: - id: "{{ lb_output.state.frontend_ip_configurations[0].id }}" ip_configurations: - name: ip_configuration01 properties: - primary: True + primary: true private_ip_allocation_method: 'Dynamic' private_ip_address_version: 'IPv4' subnet: @@ -153,29 +155,30 @@ key1: value1 register: output -- assert: +- name: Assert idempotent + ansible.builtin.assert: that: not output.changed - name: Update private link service azure_rm_privatelinkservice: name: "lsp{{ rpfx }}" resource_group: "{{ resource_group }}" - enable_proxy_protocol: False + enable_proxy_protocol: false fqdns: - 'dns03.com' - 'dns04.com' visibility: - subscriptions: - - "{{ azure_subscription_id }}" + subscriptions: + - "{{ azure_subscription_id }}" auto_approval: - subscriptions: - - "{{ azure_subscription_id }}" + subscriptions: + - "{{ azure_subscription_id }}" load_balancer_frontend_ip_configurations: - id: "{{ lb_output.state.frontend_ip_configurations[0].id }}" ip_configurations: - name: ip_configuration01 properties: - primary: True + primary: true private_ip_allocation_method: 'Dynamic' private_ip_address_version: 'IPv4' subnet: @@ -185,7 +188,8 @@ key3: value3 register: output -- assert: +- name: Assert the private link service update + ansible.builtin.assert: that: output.changed - name: Get private link service info by name @@ -194,7 +198,8 @@ resource_group: "{{ resource_group }}" register: output -- assert: +- name: Assert the private link service facts + ansible.builtin.assert: that: - output.link_service[0].tags | length == 3 - output.link_service[0].fqdns | length == 4 @@ -217,7 +222,8 @@ resource_group: "{{ resource_group }}" register: output -- assert: +- name: Assert the private endpoint connection facts + ansible.builtin.assert: that: - output.endpoint_connection[0].private_link_service_connection_state.actions_required == "None" - output.endpoint_connection[0].private_link_service_connection_state.description == "Approved" @@ -234,7 +240,8 @@ actions_required: "actions required" register: output -- assert: +- name: Assert the private endpoint connection updated + ansible.builtin.assert: that: output.changed - name: Get private endpoint connection info by name @@ -244,7 +251,8 @@ resource_group: "{{ resource_group }}" register: output -- assert: +- name: Assert the private endpoint connection facts + ansible.builtin.assert: that: - output.endpoint_connection[0].private_link_service_connection_state.actions_required == "actions required" - output.endpoint_connection[0].private_link_service_connection_state.description == "Rejected" @@ -258,7 +266,8 @@ state: absent register: output -- assert: +- name: Assert the private endpoint connection deleted + ansible.builtin.assert: that: output.changed - name: Delete private endpoint @@ -267,11 +276,13 @@ resource_group: "{{ resource_group }}" state: absent -- assert: +- name: Assert the private endpoint deleted + ansible.builtin.assert: that: output.changed - name: Pause for 5 mimutes to waiting - shell: sleep 300 + ansible.builtin.command: sleep 300 + changed_when: true - name: Delete private link service azure_rm_privatelinkservice: @@ -280,5 +291,6 @@ state: absent register: output -- assert: +- name: Assert the private link service deleted + ansible.builtin.assert: that: output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_proximityplacementgroup/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_proximityplacementgroup/tasks/main.yml index bf7dbfd0b..c418d06d5 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_proximityplacementgroup/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_proximityplacementgroup/tasks/main.yml @@ -1,5 +1,5 @@ - name: Create proximity placement group name - set_fact: + ansible.builtin.set_fact: group_name: "ppg{{ resource_group | hash('md5') | truncate(22, True, '') }}" - name: Create a proximity placement group @@ -11,7 +11,7 @@ register: results - name: Assert that placement group is created - assert: + ansible.builtin.assert: that: results.changed - name: Create a proximity placement group again (Idempotent test) @@ -23,7 +23,7 @@ register: results - name: Assert that output is not changed - assert: + ansible.builtin.assert: that: not results.changed - name: Update a proximity placement group @@ -37,7 +37,7 @@ register: results - name: Assert that placement group is updated - assert: + ansible.builtin.assert: that: results.changed - name: Get proximity placement group facts @@ -46,7 +46,8 @@ name: "{{ group_name }}" register: results -- assert: +- name: Assert the proximity placement facts + ansible.builtin.assert: that: - not results.changed - results.proximityplacementgroups[0].name == "{{ group_name }}" @@ -61,7 +62,7 @@ register: results - name: Assert that placement group is deleted - assert: + ansible.builtin.assert: that: results.changed - name: Delete proximity placement group again (Idempotent test) @@ -72,5 +73,5 @@ register: results - name: Asset that output is not changed - assert: + ansible.builtin.assert: that: not results.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_publicipaddress/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_publicipaddress/tasks/main.yml index 119747b26..07b60f46b 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_publicipaddress/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_publicipaddress/tasks/main.yml @@ -1,109 +1,116 @@ - name: Create domain name - set_fact: - domain_name: "ansible-{{ resource_group | hash('md5') | truncate(24, True, '') }}" - rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" + ansible.builtin.set_fact: + domain_name: "ansible-{{ resource_group | hash('md5') | truncate(24, True, '') }}" + rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - name: Remove public ip azure_rm_publicipaddress: - resource_group: "{{ resource_group }}" - name: "pip{{ rpfx }}" - state: absent + resource_group: "{{ resource_group }}" + name: "pip{{ rpfx }}" + state: absent - name: Create public ip azure_rm_publicipaddress: - resource_group: "{{ resource_group }}" - name: "pip{{ rpfx }}" - allocation_method: Static - domain_name: "{{ domain_name }}" - tags: - testing: testing - delete: on-exit + resource_group: "{{ resource_group }}" + name: "pip{{ rpfx }}" + allocation_method: Static + domain_name: "{{ domain_name }}" + tags: + testing: testing + delete: on-exit register: output -- assert: - that: - - output.state.public_ip_allocation_method == 'static' - - output.state.dns_settings.domain_name_label == domain_name - - output.state.tags | length == 2 - - output.state.tags.testing == 'testing' +- name: Assert the public ip created + ansible.builtin.assert: + that: + - output.state.public_ip_allocation_method == 'static' + - output.state.dns_settings.domain_name_label == domain_name + - output.state.tags | length == 2 + - output.state.tags.testing == 'testing' - name: Create public ip with IPV6 azure_rm_publicipaddress: - resource_group: "{{ resource_group }}" - name: "pip{{ rpfx }}-02" - allocation_method: Static - domain_name: "{{ domain_name }}-02" - version: 'ipv6' - sku: 'Standard' - zones: - - 1 + resource_group: "{{ resource_group }}" + name: "pip{{ rpfx }}-02" + allocation_method: Static + domain_name: "{{ domain_name }}-02" + version: 'ipv6' + sku: 'Standard' + zones: + - 1 register: output -- assert: - that: - - output.state.public_ip_address_version == 'ipv6' - - output.state.zones == ['1'] +- name: Assert the public ip created + ansible.builtin.assert: + that: + - output.state.public_ip_address_version == 'ipv6' + - output.state.zones == ['1'] - name: Should be idempotent azure_rm_publicipaddress: - resource_group: "{{ resource_group }}" - name: "pip{{ rpfx }}" - allocation_method: static - domain_name: "{{ domain_name }}" + resource_group: "{{ resource_group }}" + name: "pip{{ rpfx }}" + allocation_method: static + domain_name: "{{ domain_name }}" register: output -- assert: - that: not output.changed +- name: Assert idempotent + ansible.builtin.assert: + that: not output.changed - name: Update tags azure_rm_publicipaddress: - resource_group: "{{ resource_group }}" - name: "pip{{ rpfx }}" - allocation_method: static - domain_name: "{{ domain_name }}" - append_tags: yes - tags: - delete: never - foo: bar + resource_group: "{{ resource_group }}" + name: "pip{{ rpfx }}" + allocation_method: static + domain_name: "{{ domain_name }}" + append_tags: true + tags: + delete: never + foo: bar register: output -- assert: - that: - - output.state.tags | length == 3 - - output.state.tags.delete == 'never' +- name: Assert the public ip address updated + ansible.builtin.assert: + that: + - output.state.tags | length == 3 + - output.state.tags.delete == 'never' - name: Gather facts, filtering by tag azure_rm_publicipaddress_info: - resource_group: "{{ resource_group }}" - tags: - - testing - - foo:bar + resource_group: "{{ resource_group }}" + tags: + - testing + - foo:bar register: infos -- assert: - that: infos.publicipaddresses | length == 1 +- name: Assert the public ip address facts + ansible.builtin.assert: + that: infos.publicipaddresses | length == 1 - name: Purge all tags azure_rm_publicipaddress: - resource_group: "{{ resource_group }}" - name: "pip{{ rpfx }}" - allocation_method: static - domain_name: "{{ domain_name }}" - append_tags: no + resource_group: "{{ resource_group }}" + name: "pip{{ rpfx }}" + allocation_method: static + domain_name: "{{ domain_name }}" + append_tags: false register: output -- assert: - that: - - output.state.tags | length == 0 +- name: Assert purge all tags + ansible.builtin.assert: + that: + - output.state.tags | length == 0 - name: Gather facts for a public ip azure_rm_publicipaddress_info: - resource_group: "{{ resource_group }}" - name: "pip{{ rpfx }}" + resource_group: "{{ resource_group }}" + name: "pip{{ rpfx }}" register: pip -- assert: - that: +- name: Assert the public ip address facts + ansible.builtin.assert: + that: - "pip.publicipaddresses | length == 1" - pip.publicipaddresses[0].name == "pip{{ rpfx }}" - pip.publicipaddresses[0].allocation_method == 'static' @@ -111,29 +118,31 @@ - name: Gather facts for all public ips azure_rm_publicipaddress_info: - resource_group: "{{ resource_group }}" + resource_group: "{{ resource_group }}" register: infos -- assert: - that: infos.publicipaddresses | length > 0 +- name: Assert all public ips + ansible.builtin.assert: + that: infos.publicipaddresses | length > 0 - name: Remove IPV6 public ip azure_rm_publicipaddress: - resource_group: "{{ resource_group }}" - name: "pip{{ rpfx }}-02" - state: absent + resource_group: "{{ resource_group }}" + name: "pip{{ rpfx }}-02" + state: absent - name: Remove public ip azure_rm_publicipaddress: - resource_group: "{{ resource_group }}" - name: "pip{{ rpfx }}" - state: absent + resource_group: "{{ resource_group }}" + name: "pip{{ rpfx }}" + state: absent - name: Gather facts for a public ip azure_rm_publicipaddress_info: - resource_group: "{{ resource_group }}" - name: "pip{{ rpfx }}" + resource_group: "{{ resource_group }}" + name: "pip{{ rpfx }}" register: infos -- assert: - that: infos.publicipaddresses | length == 0 +- name: Assert public ip address facts + ansible.builtin.assert: + that: infos.publicipaddresses | length == 0 diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_recoveryservicesvault/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_recoveryservicesvault/tasks/main.yml index fc92da931..6918632cd 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_recoveryservicesvault/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_recoveryservicesvault/tasks/main.yml @@ -1,42 +1,42 @@ - name: Fix resource prefix - set_fact: - name: "revault{{ resource_group | hash('md5') | truncate(22, True, '') }}" + ansible.builtin.set_fact: + name_rpfx: "revault{{ resource_group | hash('md5') | truncate(22, True, '') }}" location: "eastus" - name: Create Azure Recovery Service vault azure_rm_recoveryservicesvault: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" location: "{{ location }}" state: "present" register: output - name: Assert that output has changed - assert: + ansible.builtin.assert: that: - output.changed - + - name: Create Azure Recovery Service vault (idempotent) azure_rm_recoveryservicesvault: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" location: "{{ location }}" state: "present" register: output - name: Assert that output has no changed - assert: + ansible.builtin.assert: that: - not output.changed - name: Get Azure Recovery Service Vault Details azure_rm_recoveryservicesvault_info: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" register: output - name: Assert that output has changed - assert: + ansible.builtin.assert: that: - output.response.id != None - output.response.name != None @@ -44,12 +44,12 @@ - name: Delete Azure Recovery Service vault azure_rm_recoveryservicesvault: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" location: "{{ location }}" state: "absent" register: output - name: Assert that output has changed - assert: + ansible.builtin.assert: that: - output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_rediscache/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_rediscache/tasks/main.yml index 18e71e56e..4d134b0e9 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_rediscache/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_rediscache/tasks/main.yml @@ -1,10 +1,10 @@ - name: Fix resource prefix - set_fact: + ansible.builtin.set_fact: redis_name: "redis-{{ resource_group | hash('md5') | truncate(7, True, '') }}-{{ 1000 | random }}" vnet_name: "vnet-{{ resource_group | hash('md5') | truncate(7, True, '') }}-{{ 1000 | random }}" subnet_name: "subnet-{{ resource_group | hash('md5') | truncate(7, True, '') }}-{{ 1000 | random }}" rule_name: "rule1" - run_once: yes + run_once: true - name: Create a redis cache (Check Mode) azure_rm_rediscache: @@ -13,12 +13,12 @@ sku: name: basic size: C1 - wait_for_provisioning: False - check_mode: yes + wait_for_provisioning: false + check_mode: true register: output - name: Assert creating redis cache check mode - assert: + ansible.builtin.assert: that: - output.changed @@ -29,11 +29,11 @@ sku: name: basic size: C1 - wait_for_provisioning: False + wait_for_provisioning: false register: output - name: Assert creating redis cache - assert: + ansible.builtin.assert: that: - output.changed - output.id @@ -45,7 +45,7 @@ register: facts - name: Assert facts - assert: + ansible.builtin.assert: that: - facts.rediscaches | length == 1 - facts.rediscaches[0].id != None @@ -61,119 +61,121 @@ sku: name: basic size: C1 - wait_for_provisioning: False + wait_for_provisioning: false register: output -- name: assert output not changed - assert: +- name: Assert output not changed + ansible.builtin.assert: that: - not output.changed -- name: long-running rediscache tests [run with `--tags long_run,untagged` to enable] +- name: Long-running rediscache tests [run with `--tags long_run,untagged` to enable] # creating redis Cache costs about 20 mins async operation, # need to poll status from Creating to Running, then able to perform updating/deleting operation, # otherwise, will met error: # "The resource '<resource_id>' is busy processing a previous update request or is undergoing system maintenance. # As such, it is currently unable to accept the update request. Please try again later." block: - - name: Wait for Redis provisioning to complete - azure_rm_rediscache_info: + - name: Wait for Redis provisioning to complete + azure_rm_rediscache_info: resource_group: "{{ resource_group }}" name: "{{ redis_name }}" - register: facts - until: facts.rediscaches[0]['provisioning_state'] == 'Succeeded' - retries: 30 - delay: 60 - - - name: (actually) update redis cache - azure_rm_rediscache: - resource_group: "{{ resource_group }}" - name: "{{ redis_name }}" - sku: - name: basic - size: C1 - enable_non_ssl_port: true - tags: - testing: foo - wait_for_provisioning: True - register: output - - - name: assert output changed - assert: - that: - - output.changed - - - name: Update redis cache configuration - azure_rm_rediscache: - resource_group: "{{ resource_group }}" - name: "{{ redis_name }}" - sku: - name: basic - size: C1 - enable_non_ssl_port: True - maxmemory_policy: allkeys_lru - tags: - testing: foo - register: output - - - name: assert output changed - assert: - that: - - output.changed - - - name: Scale up the redis cache - azure_rm_rediscache: - resource_group: "{{ resource_group }}" - name: "{{ redis_name }}" - sku: - name: standard - size: C1 - tags: - testing: foo - wait_for_provisioning: True - register: output - - - assert: - that: - - output.changed - - - name: Force reboot redis cache - azure_rm_rediscache: - resource_group: "{{ resource_group }}" - name: "{{ redis_name }}" - reboot: - reboot_type: all - register: output - - - name: assert redis rebooted - assert: - that: - - output.changed - - - name: Delete the redis cache (Check Mode) - azure_rm_rediscache: - resource_group: "{{ resource_group }}" - name: "{{ redis_name }}" - state: absent - check_mode: yes - register: output - - - name: assert deleting redis cache check mode - assert: - that: output.changed - - - name: Delete the redis cache - azure_rm_rediscache: - resource_group: "{{ resource_group }}" - name: "{{ redis_name }}" - state: absent - register: output - - - assert: - that: - - output.changed - tags: [long_run, never] + register: facts + until: facts.rediscaches[0]['provisioning_state'] == 'Succeeded' + retries: 30 + delay: 60 + + - name: (Actually) update redis cache + azure_rm_rediscache: + resource_group: "{{ resource_group }}" + name: "{{ redis_name }}" + sku: + name: basic + size: C1 + enable_non_ssl_port: true + tags: + testing: foo + wait_for_provisioning: true + register: output + + - name: Assert output changed + ansible.builtin.assert: + that: + - output.changed + + - name: Update redis cache configuration + azure_rm_rediscache: + resource_group: "{{ resource_group }}" + name: "{{ redis_name }}" + sku: + name: basic + size: C1 + enable_non_ssl_port: true + maxmemory_policy: allkeys_lru + tags: + testing: foo + register: output + + - name: Assert output changed + ansible.builtin.assert: + that: + - output.changed + + - name: Scale up the redis cache + azure_rm_rediscache: + resource_group: "{{ resource_group }}" + name: "{{ redis_name }}" + sku: + name: standard + size: C1 + tags: + testing: foo + wait_for_provisioning: true + register: output + + - name: Assert the redis cache + ansible.builtin.assert: + that: + - output.changed + + - name: Force reboot redis cache + azure_rm_rediscache: + resource_group: "{{ resource_group }}" + name: "{{ redis_name }}" + reboot: + reboot_type: all + register: output + + - name: Assert redis rebooted + ansible.builtin.assert: + that: + - output.changed + + - name: Delete the redis cache (Check Mode) + azure_rm_rediscache: + resource_group: "{{ resource_group }}" + name: "{{ redis_name }}" + state: absent + check_mode: true + register: output + + - name: Assert deleting redis cache check mode + ansible.builtin.assert: + that: output.changed + + - name: Delete the redis cache + azure_rm_rediscache: + resource_group: "{{ resource_group }}" + name: "{{ redis_name }}" + state: absent + register: output + + - name: Assert the redis cache deleted + ansible.builtin.assert: + that: + - output.changed + tags: [long_run, never] - name: Create a redis cache with enhanced configuration options @@ -189,7 +191,7 @@ wait_for_provisioning: false register: output - name: Assert creating redis cache - assert: + ansible.builtin.assert: that: - output.changed @@ -199,7 +201,7 @@ name: "{{ redis_name }}-enhanced" register: facts - name: Assert enhanced cache facts - assert: + ansible.builtin.assert: that: - facts.rediscaches | length == 1 - facts.rediscaches[0].id != None @@ -212,122 +214,123 @@ - facts.rediscaches[0].public_network_access == 'Disabled' -- name: long-running enhanced rediscache tests [run with `--tags long_run,untagged` to enable] +- name: Long-running enhanced rediscache tests [run with `--tags long_run,untagged` to enable] # creating redis Cache costs about 20 mins async operation, # need to poll status from Creating to Running, then able to perform updating/deleting operation, # otherwise, will met error: # "The resource '<resource_id>' is busy processing a previous update request or is undergoing system maintenance. # As such, it is currently unable to accept the update request. Please try again later." block: - - name: Wait for Redis provisioning to complete - azure_rm_rediscache_info: + - name: Wait for Redis provisioning to complete + azure_rm_rediscache_info: resource_group: "{{ resource_group }}" name: "{{ redis_name }}-enhanced" - register: facts - until: facts.rediscaches[0]['provisioning_state'] == 'Succeeded' - retries: 30 - delay: 60 - - - name: update redis (idempotent) - azure_rm_rediscache: - resource_group: "{{ resource_group }}" - name: "{{ redis_name }}-enhanced" - sku: - name: basic - size: C1 - redis_version: "6" - minimum_tls_version: "1.2" - public_network_access: "Disabled" - wait_for_provisioning: true - register: output - - name: assert output not changed - assert: - that: - - not output.changed - - - name: update redis cache TLS - azure_rm_rediscache: - resource_group: "{{ resource_group }}" - name: "{{ redis_name }}-enhanced" - sku: - name: basic - size: C1 - redis_version: "6" - minimum_tls_version: "1.1" - public_network_access: "Disabled" - wait_for_provisioning: true - register: output - - name: assert output changed - assert: - that: - - output.changed - - - name: update redis cache public network access - azure_rm_rediscache: - resource_group: "{{ resource_group }}" - name: "{{ redis_name }}-enhanced" - sku: - name: basic - size: C1 - redis_version: "6" - minimum_tls_version: "1.1" - public_network_access: "Enabled" - wait_for_provisioning: true - register: output - - name: assert output changed - assert: - that: - - output.changed - - - name: Get facts for enhanced cache - azure_rm_rediscache_info: - resource_group: "{{ resource_group }}" - name: "{{ redis_name }}-enhanced" - register: facts - - name: Assert enhanced cache facts - assert: - that: - - facts.rediscaches[0].minimum_tls_version == '1.1' - - facts.rediscaches[0].public_network_access == 'Enabled' - - - name: update redis cache version - azure_rm_rediscache: - resource_group: "{{ resource_group }}" - name: "{{ redis_name }}-enhanced" - sku: - name: basic - size: C1 - redis_version: "6" - minimum_tls_version: "1.1" - public_network_access: "Enabled" - wait_for_provisioning: true - register: output - failed_when: "output.changed or 'not supported' not in output.msg" - - - name: Delete the redis cache - azure_rm_rediscache: - resource_group: "{{ resource_group }}" - name: "{{ redis_name }}-enhanced" - state: absent - register: output - - assert: - that: - - output.changed - tags: [long_run, never] + register: facts + until: facts.rediscaches[0]['provisioning_state'] == 'Succeeded' + retries: 30 + delay: 60 + + - name: Update redis (idempotent) + azure_rm_rediscache: + resource_group: "{{ resource_group }}" + name: "{{ redis_name }}-enhanced" + sku: + name: basic + size: C1 + redis_version: "6" + minimum_tls_version: "1.2" + public_network_access: "Disabled" + wait_for_provisioning: true + register: output + - name: Assert output not changed + ansible.builtin.assert: + that: + - not output.changed + + - name: Update redis cache TLS + azure_rm_rediscache: + resource_group: "{{ resource_group }}" + name: "{{ redis_name }}-enhanced" + sku: + name: basic + size: C1 + redis_version: "6" + minimum_tls_version: "1.1" + public_network_access: "Disabled" + wait_for_provisioning: true + register: output + - name: Assert output changed + ansible.builtin.assert: + that: + - output.changed + + - name: Update redis cache public network access + azure_rm_rediscache: + resource_group: "{{ resource_group }}" + name: "{{ redis_name }}-enhanced" + sku: + name: basic + size: C1 + redis_version: "6" + minimum_tls_version: "1.1" + public_network_access: "Enabled" + wait_for_provisioning: true + register: output + - name: Assert output changed + ansible.builtin.assert: + that: + - output.changed + + - name: Get facts for enhanced cache + azure_rm_rediscache_info: + resource_group: "{{ resource_group }}" + name: "{{ redis_name }}-enhanced" + register: facts + - name: Assert enhanced cache facts + ansible.builtin.assert: + that: + - facts.rediscaches[0].minimum_tls_version == '1.1' + - facts.rediscaches[0].public_network_access == 'Enabled' + + - name: Update redis cache version + azure_rm_rediscache: + resource_group: "{{ resource_group }}" + name: "{{ redis_name }}-enhanced" + sku: + name: basic + size: C1 + redis_version: "6" + minimum_tls_version: "1.1" + public_network_access: "Enabled" + wait_for_provisioning: true + register: output + failed_when: "output.changed or 'not supported' not in output.msg" + + - name: Delete the redis cache + azure_rm_rediscache: + resource_group: "{{ resource_group }}" + name: "{{ redis_name }}-enhanced" + state: absent + register: output + - name: Assert the redis cache deleted + ansible.builtin.assert: + that: + - output.changed + tags: [long_run, never] - name: Create virtual network azure_rm_virtualnetwork: - resource_group: "{{ resource_group }}" - name: "{{ vnet_name }}" - address_prefixes: "10.10.0.0/16" + resource_group: "{{ resource_group }}" + name: "{{ vnet_name }}" + address_prefixes: "10.10.0.0/16" - name: Add subnet azure_rm_subnet: - resource_group: "{{ resource_group }}" - name: "{{ subnet_name }}" - address_prefix: "10.10.0.0/24" - virtual_network: "{{ vnet_name }}" + resource_group: "{{ resource_group }}" + name: "{{ subnet_name }}" + address_prefix: "10.10.0.0/24" + virtual_network: "{{ vnet_name }}" - name: Create redis with subnet azure_rm_rediscache: @@ -339,11 +342,11 @@ subnet: name: "{{ subnet_name }}" virtual_network_name: "{{ vnet_name }}" - wait_for_provisioning: False + wait_for_provisioning: false register: output - name: Assert creating redis cache - assert: + ansible.builtin.assert: that: - output.changed - output.id @@ -352,11 +355,11 @@ azure_rm_rediscache_info: resource_group: "{{ resource_group }}" name: "{{ redis_name }}2" - return_access_keys: True + return_access_keys: true register: facts - name: Assert facts - assert: + ansible.builtin.assert: that: - facts.rediscaches | length == 1 - facts.rediscaches[0].subnet != None @@ -369,16 +372,15 @@ name: "{{ rule_name }}" start_ip_address: 192.168.1.1 end_ip_address: 192.168.1.4 - check_mode: yes + check_mode: true register: output - name: Assert check mode creation - assert: + ansible.builtin.assert: that: - output.changed - -- name: long-running key/firewallrule tests [run with `--tags long_run,untagged` to enable] +- name: Long-running key/firewallrule tests [run with `--tags long_run,untagged` to enable] # Creating firewall rule need Redis status is running, while creating redis Cache costs about 20 mins async operation, # need to poll status from Creating to Running, then able to perform firewall rule creating, # otherwise, will met error: @@ -386,107 +388,107 @@ # '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Cache/Redis/myRedis' is busy processing # a previous update request or is undergoing system maintenance. As such, it is currently unable to accept the update request. Please try again later." block: - - name: Wait for Redis provisioning to complete - azure_rm_rediscache_info: + - name: Wait for Redis provisioning to complete + azure_rm_rediscache_info: + resource_group: "{{ resource_group }}" + name: "{{ redis_name }}2" + register: facts + until: facts.rediscaches[0]['provisioning_state'] == 'Succeeded' + retries: 30 + delay: 60 + + - name: Create firewall rule + azure_rm_rediscachefirewallrule: + resource_group: "{{ resource_group }}" + cache_name: "{{ redis_name }}2" + name: "{{ rule_name }}" + start_ip_address: 192.168.1.1 + end_ip_address: 192.168.1.4 + register: output + + - name: Assert creation + ansible.builtin.assert: + that: + - output.changed + - output.id + + - name: Update firewall rule idempotence + azure_rm_rediscachefirewallrule: + resource_group: "{{ resource_group }}" + cache_name: "{{ redis_name }}2" + name: "{{ rule_name }}" + start_ip_address: 192.168.1.1 + end_ip_address: 192.168.1.4 + register: output + + - name: Assert idempotence + ansible.builtin.assert: + that: + - output.changed == false + + - name: Update firewall rule + azure_rm_rediscachefirewallrule: + resource_group: "{{ resource_group }}" + cache_name: "{{ redis_name }}2" + name: "{{ rule_name }}" + end_ip_address: 192.168.1.5 + register: output + + - name: Assert updating + ansible.builtin.assert: + that: + - output.changed + + - name: Get key facts + azure_rm_rediscache_info: + resource_group: "{{ resource_group }}" + name: "{{ redis_name }}2" + return_access_keys: true + register: key_facts + + - name: Regenerate primary redis key + azure_rm_rediscache: + resource_group: "{{ resource_group }}" + name: "{{ redis_name }}2" + regenerate_key: + key_type: "primary" + register: output + + - name: Assert output + ansible.builtin.assert: + that: + - output.changed + + - name: Get facts after key regeneration + azure_rm_rediscache_info: + resource_group: "{{ resource_group }}" + name: "{{ redis_name }}2" + return_access_keys: true + register: key_facts2 + + - name: Assert key change + ansible.builtin.assert: + that: + - key_facts.rediscaches[0].access_keys.primary != key_facts2.rediscaches[0].access_keys.primary + - key_facts.rediscaches[0].access_keys.secondary == key_facts2.rediscaches[0].access_keys.secondary + + - name: Delete firewall rule + azure_rm_rediscachefirewallrule: + resource_group: "{{ resource_group }}" + cache_name: "{{ redis_name }}2" + name: "{{ rule_name }}" + state: absent + register: output + + - name: Assert deletion + ansible.builtin.assert: + that: + - output.changed + + - name: Delete the redis cache + azure_rm_rediscache: resource_group: "{{ resource_group }}" name: "{{ redis_name }}2" - register: facts - until: facts.rediscaches[0]['provisioning_state'] == 'Succeeded' - retries: 30 - delay: 60 - - - name: Create firewall rule - azure_rm_rediscachefirewallrule: - resource_group: "{{ resource_group }}" - cache_name: "{{ redis_name }}2" - name: "{{ rule_name }}" - start_ip_address: 192.168.1.1 - end_ip_address: 192.168.1.4 - register: output - - - name: Assert creation - assert: - that: - - output.changed - - output.id - - - name: Update firewall rule idempotence - azure_rm_rediscachefirewallrule: - resource_group: "{{ resource_group }}" - cache_name: "{{ redis_name }}2" - name: "{{ rule_name }}" - start_ip_address: 192.168.1.1 - end_ip_address: 192.168.1.4 - register: output - - - name: Assert idempotence - assert: - that: - - output.changed == False - - - name: Update firewall rule - azure_rm_rediscachefirewallrule: - resource_group: "{{ resource_group }}" - cache_name: "{{ redis_name }}2" - name: "{{ rule_name }}" - end_ip_address: 192.168.1.5 - register: output - - - name: Assert updating - assert: - that: - - output.changed - - - name: Get key facts - azure_rm_rediscache_info: - resource_group: "{{ resource_group }}" - name: "{{ redis_name }}2" - return_access_keys: True - register: key_facts - - - name: regenerate primary redis key - azure_rm_rediscache: - resource_group: "{{ resource_group }}" - name: "{{ redis_name }}2" - regenerate_key: - key_type: "primary" - register: output - - - name: Assert output - assert: - that: - - output.changed - - - name: Get facts after key regeneration - azure_rm_rediscache_info: - resource_group: "{{ resource_group }}" - name: "{{ redis_name }}2" - return_access_keys: true - register: key_facts2 - - - name: Assert key change - assert: - that: - - key_facts.rediscaches[0].access_keys.primary != key_facts2.rediscaches[0].access_keys.primary - - key_facts.rediscaches[0].access_keys.secondary == key_facts2.rediscaches[0].access_keys.secondary - - - name: Delete firewall rule - azure_rm_rediscachefirewallrule: - resource_group: "{{ resource_group }}" - cache_name: "{{ redis_name }}2" - name: "{{ rule_name }}" - state: absent - register: output - - - name: Assert deletion - assert: - that: - - output.changed - - - name: Delete the redis cache - azure_rm_rediscache: - resource_group: "{{ resource_group }}" - name: "{{ redis_name }}2" - state: absent - register: output - tags: [long_run, never] + state: absent + register: output + tags: [long_run, never] diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_registrationassignment/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_registrationassignment/tasks/main.yml index 055524705..05cc5d552 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_registrationassignment/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_registrationassignment/tasks/main.yml @@ -1,10 +1,10 @@ -- name: set facts - set_fact: +- name: Set facts + ansible.builtin.set_fact: subscription_id: "{{ azure_subscription_id }}" managed_by_tenant_id: "{{ azure_managed_by_tenant_id }}" principal_id: "{{ azure_principal_id }}" role_definition_id: "{{ azure_role_definition_id }}" - run_once: yes + run_once: true - name: Create a RegistrationDefinition azure_rm_registrationdefinition: @@ -23,42 +23,46 @@ properties: registration_definition_id: "{{ output1.state.id }}" register: output - check_mode: yes + check_mode: true -- assert: +- name: Assert the registration assignment check mode + ansible.builtin.assert: that: - - output.changed + - output.changed -- name: Create a RegistrationAssignment +- name: Create a RegistrationAssignment azure_rm_registrationassignment: scope: subscriptions/{{ subscription_id }} properties: registration_definition_id: "{{ output1.state.id }}" register: output2 -- assert: +- name: Assert the registration assignment created + ansible.builtin.assert: that: - output2.changed - name: Create a RegistrationAssignment -- idempotent azure_rm_registrationassignment: scope: subscriptions/{{ subscription_id }} - registration_assignment_id: "{{ output2.state.name }}" + registration_assignment_id: "{{ output2.state.name }}" properties: registration_definition_id: "{{ output1.state.id }}" register: output -- assert: +- name: Assert idempotent + ansible.builtin.assert: that: - not output.changed - name: Get a RegistrationAssignment azure_rm_registrationassignment_info: scope: subscriptions/{{ subscription_id }} - registration_assignment_id: "{{ output2.state.name }}" + registration_assignment_id: "{{ output2.state.name }}" register: output -- assert: +- name: Assert the registration assignment facts + ansible.builtin.assert: that: - output.registration_assignments[0].properties.registration_definition_id == "{{ output1.state.id }}" @@ -67,12 +71,13 @@ scope: subscriptions/{{ subscription_id }} register: output -- assert: +- name: Assert all registration assignment facts + ansible.builtin.assert: that: - output.registration_assignments | length >= 1 - name: Delete the RegistrationAssignment azure_rm_registrationassignment: scope: subscriptions/{{ subscription_id }} - registration_assignment_id: "{{ output2.state.name }}" + registration_assignment_id: "{{ output2.state.name }}" state: absent diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_registrationdefinition/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_registrationdefinition/tasks/main.yml index 0395db002..3a5d58143 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_registrationdefinition/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_registrationdefinition/tasks/main.yml @@ -1,12 +1,12 @@ -- name: set facts - set_fact: - subscription_id: "{{ azure_subscription_id }}" - subscription_sec_id: "{{ azure_subscription_sec_id }}" - managed_by_tenant_id: "{{ azure_managed_by_tenant_id }}" - principal_id: "{{ azure_principal_id }}" - role_definition_id: "{{ azure_role_definition_id }}" - reg_def_name: test_name - run_once: yes +- name: Set facts + ansible.builtin.set_fact: + subscription_id: "{{ azure_subscription_id }}" + subscription_sec_id: "{{ azure_subscription_sec_id }}" + managed_by_tenant_id: "{{ azure_managed_by_tenant_id }}" + principal_id: "{{ azure_principal_id }}" + role_definition_id: "{{ azure_role_definition_id }}" + reg_def_name: test_name + run_once: true - name: Create a RegistrationDefinition -- check mode azure_rm_registrationdefinition: @@ -17,11 +17,11 @@ role_definition_id: "{{ role_definition_id }}" managed_by_tenant_id: "{{ managed_by_tenant_id }}" registration_definition_name: "{{ reg_def_name }}" - check_mode: yes + check_mode: true register: output - name: Assert creating registration definition check mode - assert: + ansible.builtin.assert: that: - output.changed @@ -38,7 +38,7 @@ register: output2 - name: Assert creating registration definition - assert: + ansible.builtin.assert: that: - output2.changed @@ -54,7 +54,7 @@ register: output1 - name: Assert creating registration definition - assert: + ansible.builtin.assert: that: - output1.changed @@ -71,7 +71,7 @@ register: output - name: Assert creating registration definition - assert: + ansible.builtin.assert: that: - not output.changed @@ -88,17 +88,17 @@ register: output - name: Assert creating registration definition - assert: + ansible.builtin.assert: that: - output.changed - name: Get the Registration Definition info azure_rm_registrationdefinition_info: - registration_definition_id: "{{ output1.state.name }}" + registration_definition_id: "{{ output1.state.name }}" register: output - name: Assert the registration definition info - assert: + ansible.builtin.assert: that: - output.registration_definitions[0].name == "{{ output1.state.name }}" - output.registration_definitions[0].properties.authorizations[0].principal_id == "{{ principal_id }}" @@ -109,11 +109,11 @@ - name: Get All Registration Definition info in the subscription azure_rm_registrationdefinition_info: - scope: "{{ subscription_id }}" + scope: "{{ subscription_id }}" register: output - name: Assert all the registration definition info - assert: + ansible.builtin.assert: that: - output.registration_definitions | length >=1 @@ -124,7 +124,7 @@ register: output - name: Assert delete registration definition success - assert: + ansible.builtin.assert: that: - output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_resource/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_resource/tasks/main.yml index 6ec87237d..0f9834165 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_resource/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_resource/tasks/main.yml @@ -1,9 +1,9 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: nsgname: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" storageaccountname: "stacc{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" dbname: "mdb{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - run_once: yes + run_once: true - name: Call REST API azure_rm_resource: @@ -14,11 +14,11 @@ resource_name: "{{ nsgname }}" body: location: eastus - idempotency: yes + idempotency: true register: output - name: Assert that something has changed - assert: + ansible.builtin.assert: that: output.changed - name: Call REST API @@ -30,11 +30,11 @@ resource_name: "{{ nsgname }}" body: location: eastus - idempotency: yes + idempotency: true register: output - name: Assert that nothing has changed - assert: + ansible.builtin.assert: that: not output.changed - name: Call REST API @@ -49,11 +49,11 @@ tags: a: "abc" b: "cde" - idempotency: yes + idempotency: true register: output - name: Assert that something has changed - assert: + ansible.builtin.assert: that: output.changed - name: Try to get information about account @@ -66,7 +66,7 @@ register: output - name: Assert value was returned - assert: + ansible.builtin.assert: that: - not output.changed - output.response[0]['name'] != None @@ -80,7 +80,7 @@ resource_type: networksecuritygroups register: output - name: Assert value was returned - assert: + ansible.builtin.assert: that: - not output.changed - output.response[0]['name'] != None @@ -93,7 +93,7 @@ resource_type: networksecuritygroups register: output - name: Assert value was returned - assert: + ansible.builtin.assert: that: - not output.changed - output.response[0]['name'] != None @@ -105,7 +105,7 @@ resource_type: resources register: output - name: Assert value was returned - assert: + ansible.builtin.assert: that: - not output.changed - output.response | length >= 1 @@ -127,7 +127,7 @@ register: output - name: Assert that storage was successfully created - assert: + ansible.builtin.assert: that: "output['response']['name'] == '{{ storageaccountname }}'" @@ -144,7 +144,7 @@ register: keys - name: Assert that key was returned - assert: + ansible.builtin.assert: that: keys['response']['keys'][0]['value'] | length > 0 - name: Delete storage - without API version diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_resourcegroup/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_resourcegroup/tasks/main.yml index 706a855e8..4f66237b7 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_resourcegroup/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_resourcegroup/tasks/main.yml @@ -1,50 +1,55 @@ - name: Get resource group datalake info azure_rm_resourcegroup_info: - name: "{{ resource_group_datalake }}" - list_resources: yes + name: "{{ resource_group_datalake }}" + list_resources: true register: rg -- assert: +- name: Assert the resource group facts + ansible.builtin.assert: that: - - rg.resourcegroups | length == 1 - - rg.resourcegroups[0].resources | length >= 0 + - rg.resourcegroups | length == 1 + - rg.resourcegroups[0].resources | length >= 0 - name: Get resource group info azure_rm_resourcegroup_info: register: rg -- assert: +- name: Assert all resource group facts + ansible.builtin.assert: that: - - rg.resourcegroups | length >= 1 + - rg.resourcegroups | length >= 1 - name: Get resource group info azure_rm_resourcegroup_info: - name: "{{ resource_group }}" - list_resources: yes + name: "{{ resource_group }}" + list_resources: true register: rg -- assert: +- name: Assert the resource group facts + ansible.builtin.assert: that: - - rg.resourcegroups | length == 1 - - rg.resourcegroups[0].resources | length >= 0 + - rg.resourcegroups | length == 1 + - rg.resourcegroups[0].resources | length >= 0 - name: Create resource group (idempontent) azure_rm_resourcegroup: - name: "{{ resource_group }}" - location: "{{ rg.resourcegroups[0].location }}" + name: "{{ resource_group }}" + location: "{{ rg.resourcegroups[0].location }}" register: output -- assert: +- name: Assert idempotent + ansible.builtin.assert: that: - - not output.changed + - not output.changed -- name: delete resource group +- name: Delete resource group azure_rm_resourcegroup: - name: "{{ resource_group }}" - state: absent - check_mode: yes + name: "{{ resource_group }}" + state: absent + check_mode: true register: output -- assert: +- name: Assert the resource group deleted + ansible.builtin.assert: that: - - output.changed
\ No newline at end of file + - output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_roleassignment/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_roleassignment/tasks/main.yml index c4e4d15d6..e918bdc19 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_roleassignment/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_roleassignment/tasks/main.yml @@ -1,5 +1,5 @@ -- name: setup basic facts - set_fact: +- name: Setup basic facts + ansible.builtin.set_fact: uuid: bb21a88b-30e1-42b5-84e8-1d3f322de033 # Disk Backup Reader, unlikely to be already assigned in ansible-test resource groups. az_role_definition_guid: '3e5e47e6-65f7-47ef-90b5-e5dd4d455f24' @@ -15,7 +15,7 @@ id: "{{ item.id | default(omit) }}" role_definition_id: "{{ item.role_definition_id | default(omit) }}" scope: "{{ item.scope | default(omit) }}" - strict_scope_match: True + strict_scope_match: true register: az_role_assignment_specific loop: - name: "{{ az_role_assignments.roleassignments[0].name }}" @@ -25,10 +25,10 @@ role_definition_id: "{{ az_role_assignments.roleassignments[0].role_definition_id }}" - id: "{{ az_role_assignments.roleassignments[0].id }}" -- name: check specific fetch for single return - assert: +- name: Check specific fetch for single return + ansible.builtin.assert: that: - - "{{ ( item.roleassignments | length) == 1 }}" + - "{{ (item.roleassignments | length) == 1 }}" loop: "{{ az_role_assignment_specific.results }}" - name: Intentional mutual exclusion info @@ -38,7 +38,7 @@ id: "{{ item.id | default(omit) }}" scope: "{{ item.scope | default(omit) }}" register: failures_info - ignore_errors: True + ignore_errors: true loop: - name: "{{ az_role_assignments.roleassignments[0].name }}" assignee: "{{ az_role_assignments.roleassignments[0].principal_id }}" @@ -47,8 +47,8 @@ - name: "{{ az_role_assignments.roleassignments[0].name }}" id: "{{ az_role_assignments.roleassignments[0].id }}" -- name: check intended failures - assert: +- name: Check intended failures + ansible.builtin.assert: that: - item.failed loop: "{{ failures_info.results }}" @@ -62,7 +62,7 @@ role_definition_id: "{{ item.role_definition_id | default(omit) }}" state: "{{ item.state | default(omit) }}" register: failures_mutable - ignore_errors: True + ignore_errors: true loop: # mutually exclusive - scope: "{{ az_role_assignments.roleassignments[0].scope }}" @@ -87,33 +87,33 @@ role_definition_id: "{{ az_role_assignments.roleassignments[0].role_definition_id }}" state: "absent" -- name: check intended failures - assert: +- name: Check intended failures + ansible.builtin.assert: that: - item.failed loop: "{{ failures_mutable.results }} " -- name: get resource group info +- name: Get resource group info azure_rm_resourcegroup_info: name: "{{ resource_group }}" register: az_resource_group -- name: create role assignment by id +- name: Create role assignment by id azure_rm_roleassignment: id: "{{ az_resource_group.resourcegroups[0].id }}/providers/Microsoft.Authorization/roleAssignments/{{ uuid }}" assignee_object_id: "{{ az_role_assignments.roleassignments[0].principal_id }}" role_definition_id: "/subscriptions/{{ az_resource_group.resourcegroups[0].id.split('/')[2] }}/providers/Microsoft.Authorization/roleDefinitions/{{ az_role_definition_guid }}" register: az_role_assignment_create -- name: create role assignment by scope +- name: Create role assignment by scope azure_rm_roleassignment: scope: "{{ az_resource_group.resourcegroups[0].id }}" assignee_object_id: "{{ az_role_assignments.roleassignments[0].principal_id }}" role_definition_id: "/subscriptions/{{ az_resource_group.resourcegroups[0].id.split('/')[2] }}/providers/Microsoft.Authorization/roleDefinitions/{{ az_role_definition_guid }}" register: az_role_assignment_idempotent -- name: check idempotence - assert: +- name: Check idempotence + ansible.builtin.assert: that: - az_role_assignment_idempotent.changed == False @@ -131,13 +131,13 @@ - name: List Role Assignments at scope with strict matching azure_rm_roleassignment_info: scope: "{{ az_role_assignments.roleassignments[0].scope }}" - strict_scope_match: True + strict_scope_match: true register: az_role_assignment_by_scope_strict -- name: check strict scope matching - assert: +- name: Check strict scope matching + ansible.builtin.assert: that: - - item.scope == az_role_assignments.roleassignments[0].scope + - item.scope == az_role_assignments.roleassignments[0].scope loop: "{{ az_role_assignment_by_scope_strict.roleassignments }}" - name: List Role Assignments at id @@ -157,12 +157,12 @@ register: az_role_assignment_delete when: az_role_assignment_create.changed -- name: create role assignment with name +- name: Create role assignment with name azure_rm_roleassignment: scope: "{{ az_resource_group.resourcegroups[0].id }}" assignee_object_id: "{{ az_role_assignments.roleassignments[0].principal_id }}" role_definition_id: "/subscriptions/{{ az_resource_group.resourcegroups[0].id.split('/')[2] }}/providers/Microsoft.Authorization/roleDefinitions/{{ az_role_definition_guid }}" - name: "{{ uuid }}" + name: "{{ uuid }}" register: az_role_assignment_create - name: Delete Role by Name @@ -173,14 +173,14 @@ register: az_role_assignment_delete when: az_role_assignment_create.changed -- name: create role assignment by scope +- name: Create role assignment by scope azure_rm_roleassignment: scope: "{{ az_resource_group.resourcegroups[0].id }}" assignee_object_id: "{{ az_role_assignments.roleassignments[0].principal_id }}" role_definition_id: "/subscriptions/{{ az_resource_group.resourcegroups[0].id.split('/')[2] }}/providers/Microsoft.Authorization/roleDefinitions/{{ az_role_definition_guid }}" register: az_role_assignment_create_by_scope -- name: delete by scope, assignee_object_id and role_definition_id +- name: Delete by scope, assignee_object_id and role_definition_id azure_rm_roleassignment: scope: "{{ az_resource_group.resourcegroups[0].id }}" assignee_object_id: "{{ az_role_assignments.roleassignments[0].principal_id }}" @@ -189,20 +189,20 @@ register: az_role_assignment_delete when: az_role_assignment_create.changed -- name: absent assignment that doesn't exist - id +- name: Absent assignment that doesn't exist - id azure.azcollection.azure_rm_roleassignment: id: "{{ az_role_assignment_delete.id }}" state: absent register: absent_nochange_id -- name: absent assignment that doesn't exist - name +- name: Absent assignment that doesn't exist - name azure.azcollection.azure_rm_roleassignment: name: "{{ az_role_assignment_delete.name }}" scope: "{{ az_role_assignment_delete.scope }}" state: absent register: absent_nochange_name -- name: absent assignment that doesn't exist - properties +- name: Absent assignment that doesn't exist - properties azure.azcollection.azure_rm_roleassignment: scope: "{{ az_role_assignment_delete.scope }}" assignee_object_id: "{{ az_role_assignment_delete.assignee_object_id }}" @@ -210,11 +210,11 @@ state: absent register: absent_nochange_properties -- name: check intended failures info - assert: +- name: Check intended failures info + ansible.builtin.assert: that: - item.changed == false - loop: + loop: - "{{ absent_nochange_properties }}" - "{{ absent_nochange_id }}" - "{{ absent_nochange_name }}" diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_roledefinition/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_roledefinition/tasks/main.yml index 15cf266b6..6367198a8 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_roledefinition/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_roledefinition/tasks/main.yml @@ -1,13 +1,13 @@ - name: Fix resource prefix - set_fact: - role_name: "{{ (resource_group | replace('-','x'))[-8:] }}{{ 1000 | random }}testrole" - subscription_id: "{{azure_subscription_id}}" - principal_id: "{{azure_client_id}}" - run_once: yes + ansible.builtin.set_fact: + my_role_name: "{{ (resource_group | replace('-', 'x'))[-8:] }}{{ 1000 | random }}testrole" + subscription_id: "{{ azure_subscription_id }}" + principal_id: "{{ azure_client_id }}" + run_once: true - name: Create a role definition (Check Mode) azure_rm_roledefinition: - name: "{{ role_name }}" + name: "{{ my_role_name }}" scope: "/subscriptions/{{ subscription_id }}/resourceGroups/{{ resource_group }}" permissions: - actions: @@ -19,18 +19,18 @@ not_data_actions: - "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write" assignable_scopes: - - "/subscriptions/{{ subscription_id }}/resourceGroups/{{ resource_group }}" - check_mode: yes + - "/subscriptions/{{ subscription_id }}/resourceGroups/{{ resource_group }}" + check_mode: true register: output - name: Assert creating role definition check mode - assert: + ansible.builtin.assert: that: - output.changed - name: Create a role definition azure_rm_roledefinition: - name: "{{ role_name }}" + name: "{{ my_role_name }}" scope: "/subscriptions/{{ subscription_id }}/resourceGroups/{{ resource_group }}" permissions: - actions: @@ -42,48 +42,48 @@ not_data_actions: - "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write" assignable_scopes: - - "/subscriptions/{{ subscription_id }}/resourceGroups/{{ resource_group }}" + - "/subscriptions/{{ subscription_id }}/resourceGroups/{{ resource_group }}" register: output - name: Assert creating role definition - assert: + ansible.builtin.assert: that: - output.changed ## because of the bug of azure service , the following tasks will cause failures randomly # -#- name: Get facts by type +# - name: Get facts by type # azure_rm_roledefinition_info: # scope: "/subscriptions/{{ subscription_id }}/resourceGroups/{{ resource_group }}" # type: custom # register: facts # -#- name: Assert facts -# assert: +# - name: Assert facts +# ansible.builtin.assert: # that: # - facts['roledefinitions'] | length > 1 # -#- name: Get facts by name +# - name: Get facts by name # azure_rm_roledefinition_info: # scope: "/subscriptions/{{ subscription_id }}/resourceGroups/{{ resource_group }}" -# role_name: "{{ role_name }}" +# role_name: "{{ my_role_name }}" # register: facts # until: facts.roledefinitions | length > 0 # retries: 50 # delay: 60 # -#- name: Assert facts -# assert: +# - name: Assert facts +# ansible.builtin.assert: # that: # - facts['roledefinitions'] | length == 1 # - facts['roledefinitions'][0]['permissions'] | length == 1 # - facts['roledefinitions'][0]['permissions'][0]['not_data_actions'] | length == 1 # - facts['roledefinitions'][0]['permissions'][0]['data_actions'] | length == 1 # -#- name: Update the role definition (idempotent) +# - name: Update the role definition (idempotent) # azure_rm_roledefinition: -# name: "{{ role_name }}" +# name: "{{ my_role_name }}" # scope: "/subscriptions/{{ subscription_id }}/resourceGroups/{{ resource_group }}" # permissions: # - actions: @@ -98,14 +98,14 @@ # - "/subscriptions/{{ subscription_id }}/resourceGroups/{{ resource_group }}" # register: output # -#- name: assert output not changed -# assert: +# - name: ansible.builtin.assert output not changed +# ansible.builtin.assert: # that: # - not output.changed # -#- name: Update the role definition +# - name: Update the role definition # azure_rm_roledefinition: -# name: "{{ role_name }}" +# name: "{{ my_role_name }}" # description: "update description" # scope: "/subscriptions/{{ subscription_id }}/resourceGroups/{{ resource_group }}" # permissions: @@ -122,14 +122,14 @@ # - "/subscriptions/{{ subscription_id }}/resourceGroups/{{ resource_group }}" # register: output # -#- name: assert output changed -# assert: +# - name: ansible.builtin.assert output changed +# ansible.builtin.assert: # that: # - output.changed # -#- name: Get role definition facts +# - name: Get role definition facts # azure_rm_roledefinition_info: -# role_name: "{{ role_name }}" +# role_name: "{{ my_role_name }}" # scope: "/subscriptions/{{ subscription_id }}/resourceGroups/{{ resource_group }}" # type: custom # register: roledef @@ -137,13 +137,13 @@ # retries: 50 # delay: 60 # -#- name: Assert role definition facts -# assert: +# - name: Assert role definition facts +# ansible.builtin.assert: # that: # - roledef['roledefinitions'] | length == 1 # - roledef['roledefinitions'][0]['id'] # -#- name: Create a role assignment (Check Mode) +# - name: Create a role assignment (Check Mode) # azure_rm_roleassignment: # scope: "/subscriptions/{{ subscription_id }}/resourceGroups/{{ resource_group }}" # assignee_object_id: "{{ principal_id }}" @@ -151,61 +151,61 @@ # check_mode: yes # register: output # -#- name: Assert creating role definition check mode -# assert: +# - name: Assert creating role definition check mode +# ansible.builtin.assert: # that: # - output.changed # -#- name: Create a role assignment +# - name: Create a role assignment # azure_rm_roleassignment: # scope: "/subscriptions/{{ subscription_id }}/resourceGroups/{{ resource_group }}" # assignee_object_id: "{{ principal_id }}" # role_definition_id: "{{ roledef['roledefinitions'][0]['id'] }}" # register: output # -#- name: Assert creating role assignment -# assert: +# - name: Assert creating role assignment +# ansible.builtin.assert: # that: # - output.changed # -#- name: Get facts +# - name: Get facts # azure_rm_roleassignment_info: # scope: "/subscriptions/{{ subscription_id }}/resourceGroups/{{ resource_group }}" # assignee: "{{ principal_id }}" # role_definition_id: "{{ roledef['roledefinitions'][0]['id'] }}" # register: facts # -#- name: assert role assignment facts -# assert: +# - name: ansible.builtin.assert role assignment facts +# ansible.builtin.assert: # that: # - facts['roleassignments'] | length > 0 # - facts['roleassignments'][0]['id'] # -#- name: delete role assignment +# - name: delete role assignment # azure_rm_roleassignment: # name: "{{ facts['roleassignments'][0]['id'].split('/')[-1] }}" # scope: "/subscriptions/{{ subscription_id }}" # state: absent # -#- name: Delete the role definition (Check Mode) +# - name: Delete the role definition (Check Mode) # azure_rm_roledefinition: -# name: "{{ role_name }}" +# name: "{{ my_role_name }}" # scope: "/subscriptions/{{ subscription_id }}/resourceGroups/{{ resource_group }}" # state: absent # check_mode: yes # register: output # -#- name: assert deleting role definition check mode -# assert: +# - name: ansible.builtin.assert deleting role definition check mode +# ansible.builtin.assert: # that: output.changed # -#- name: Delete the role definition +# - name: Delete the role definition # azure_rm_roledefinition: -# name: "{{ role_name }}" +# name: "{{ my_role_name }}" # scope: "/subscriptions/{{ subscription_id }}/resourceGroups/{{ resource_group }}" # state: absent # register: output # -#- assert: +# - ansible.builtin.assert: # that: # - output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_routetable/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_routetable/tasks/main.yml index 98b3c752a..057e516ea 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_routetable/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_routetable/tasks/main.yml @@ -1,55 +1,59 @@ - name: Prepare random number - set_fact: - name: "table{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" + ansible.builtin.set_fact: + name_rpfx: "table{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" route_name: "route{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - run_once: yes + run_once: true - name: Create a route table (check mode) azure_rm_routetable: - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" tags: purpose: testing - check_mode: yes + check_mode: true register: output -- assert: +- name: Assert check mode + ansible.builtin.assert: that: - not output.id - output.changed - name: Create a route table azure_rm_routetable: - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" tags: - purpose: testing + purpose: testing register: output -- assert: +- name: Assert the route table created + ansible.builtin.assert: that: - output.changed - output.id - name: Create a route table (idemponent) azure_rm_routetable: - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" tags: purpose: testing register: output -- assert: +- name: Assert idempotent + ansible.builtin.assert: that: - not output.changed - name: Get facts of the table azure_rm_routetable_info: - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" register: output -- assert: +- name: Assert the route table facts + ansible.builtin.assert: that: - "output.route_tables | length == 1" - "output.route_tables[0].routes | length == 0" @@ -60,11 +64,12 @@ resource_group: "{{ resource_group }}" next_hop_type: virtual_network_gateway address_prefix: "10.1.0.0/16" - route_table_name: "{{ name }}" - check_mode: yes + route_table_name: "{{ name_rpfx }}" + check_mode: true register: output -- assert: +- name: Assert check mode + ansible.builtin.assert: that: - output.changed - not output.id @@ -75,10 +80,11 @@ resource_group: "{{ resource_group }}" next_hop_type: virtual_network_gateway address_prefix: "10.1.0.0/16" - route_table_name: "{{ name }}" + route_table_name: "{{ name_rpfx }}" register: output -- assert: +- name: Assert the route created + ansible.builtin.assert: that: - output.changed - output.id @@ -89,23 +95,25 @@ resource_group: "{{ resource_group }}" next_hop_type: virtual_network_gateway address_prefix: "10.1.0.0/16" - route_table_name: "{{ name }}" + route_table_name: "{{ name_rpfx }}" register: output -- assert: +- name: Assert idempotent + ansible.builtin.assert: that: - not output.changed -- name: update route +- name: Update route azure_rm_route: name: "{{ route_name }}" resource_group: "{{ resource_group }}" next_hop_type: virtual_network_gateway address_prefix: "10.1.0.0/24" - route_table_name: "{{ name }}" + route_table_name: "{{ name_rpfx }}" register: output -- assert: +- name: Assert the route updated + ansible.builtin.assert: that: - output.changed @@ -113,21 +121,23 @@ azure_rm_route_info: name: "{{ route_name }}" resource_group: "{{ resource_group }}" - route_table_name: "{{ name }}" + route_table_name: "{{ name_rpfx }}" register: output -- assert: +- name: Assert the route facts + ansible.builtin.assert: that: - output.routes[0].address_prefix == "10.1.0.0/24" - output.routes[0].next_hop_type == "VirtualNetworkGateway" - name: Get facts of the table azure_rm_routetable_info: - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" register: output -- assert: +- name: Assert the route table facts + ansible.builtin.assert: that: - "output.route_tables | length == 1" - "output.route_tables[0].routes | length == 1" @@ -137,19 +147,20 @@ azure_rm_route: name: "{{ route_name }}" resource_group: "{{ resource_group }}" - route_table_name: "{{ name }}" + route_table_name: "{{ name_rpfx }}" state: absent - check_mode: yes + check_mode: true - name: Delete route azure_rm_route: name: "{{ route_name }}" resource_group: "{{ resource_group }}" state: absent - route_table_name: "{{ name }}" + route_table_name: "{{ name_rpfx }}" register: output -- assert: +- name: Assert the route deleted + ansible.builtin.assert: that: - output.changed @@ -158,38 +169,41 @@ name: "{{ route_name }}" resource_group: "{{ resource_group }}" state: absent - route_table_name: "{{ name }}" + route_table_name: "{{ name_rpfx }}" register: output -- assert: +- name: Assert idempotent + ansible.builtin.assert: that: - not output.changed - name: Delete route table (check mode) azure_rm_routetable: - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" state: absent - check_mode: yes + check_mode: true - name: Delete route table azure_rm_routetable: - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" state: absent register: output -- assert: +- name: Assert the route table deleted + ansible.builtin.assert: that: - output.changed - name: Delete route table (idemponent) azure_rm_routetable: - name: "{{ name }}" + name: "{{ name_rpfx }}" resource_group: "{{ resource_group }}" state: absent register: output -- assert: +- name: Assert idempotent + ansible.builtin.assert: that: - not output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_securitygroup/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_securitygroup/tasks/main.yml index dd35db16a..6dc584a6f 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_securitygroup/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_securitygroup/tasks/main.yml @@ -1,10 +1,10 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: secgroupname: "sg{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" asg_name1: "asg1{{ resource_group | hash('md5') | truncate(7, True, '') }}" asg_name2: "asg2{{ resource_group | hash('md5') | truncate(7, True, '') }}" sg_name1: "sgasg{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - run_once: yes + run_once: true - name: Create security group azure_rm_securitygroup: @@ -15,7 +15,7 @@ delete: on-exit foo: bar testkey: testvalue - purge_rules: yes + purge_rules: true rules: - name: DenySSH protocol: Tcp @@ -31,8 +31,8 @@ priority: 101 direction: Inbound register: output -- name: assert resource created - assert: +- name: Assert resource created + ansible.builtin.assert: that: "{{ output.state.rules | length }} == 2" - name: Gather facts by tags @@ -43,8 +43,8 @@ - foo:bar - testkey register: output -- name: assert resource retrieved - assert: +- name: Assert resource retrieved + ansible.builtin.assert: that: - output.securitygroups | length == 1 - output.securitygroups[0].default_rules | length > 0 @@ -77,8 +77,8 @@ - 443 priority: 103 register: output -- name: assert resource updated - assert: +- name: Assert resource updated + ansible.builtin.assert: that: - "{{ output.state.rules | length }} == 4" - output.state.rules[0].source_address_prefix == '174.108.158.0/24' @@ -88,8 +88,8 @@ resource_group: "{{ resource_group }}" name: "{{ secgroupname }}" register: output -- name: assert rules updated - assert: +- name: Assert rules updated + ansible.builtin.assert: that: - output.securitygroups[0].rules | length == 4 @@ -117,8 +117,8 @@ - 443 priority: 103 register: output -- name: assert resource not updated - assert: +- name: Assert resource not updated + ansible.builtin.assert: that: not output.changed - name: Update tags @@ -131,8 +131,8 @@ baz: bar append_tags: false register: output -- name: assert resource updated - assert: +- name: Assert resource updated + ansible.builtin.assert: that: - output.state.tags | length == 3 - output.state.tags.delete == 'never' @@ -146,8 +146,8 @@ testing: testing delete: on-exit register: output -- name: assert resource updated - assert: +- name: Assert resource updated + ansible.builtin.assert: that: - output.state.tags | length == 2 - output.state.tags.delete == 'on-exit' @@ -157,8 +157,8 @@ resource_group: "{{ resource_group }}" name: "{{ secgroupname }}" register: output -- name: assert resource retrieved - assert: +- name: Assert resource retrieved + ansible.builtin.assert: that: - output.securitygroups | length == 1 @@ -168,8 +168,8 @@ tags: - testing:testing register: output_groups -- name: assert resource retrieved - assert: +- name: Assert resource retrieved + ansible.builtin.assert: that: - output_groups.securitygroups | length > 0 @@ -181,7 +181,7 @@ testing: testing delete: on-exit foo: bar - purge_rules: yes + purge_rules: true rules: - name: AllowSSH protocol: Tcp @@ -194,8 +194,8 @@ priority: 101 direction: Inbound register: output -- name: assert resource created - assert: +- name: Assert resource created + ansible.builtin.assert: that: - "{{ output.state.rules | length }} == 1" - "{{ output.state.rules[0].source_address_prefixes | length }} == 3" @@ -209,7 +209,7 @@ testing: testing delete: on-exit foo: bar - purge_rules: yes + purge_rules: true rules: - name: AllowSSH protocol: Tcp @@ -222,8 +222,8 @@ priority: 101 direction: Inbound register: output -- name: assert resource not updated - assert: +- name: Assert resource not updated + ansible.builtin.assert: that: not output.changed - name: Add a single one group @@ -244,8 +244,8 @@ priority: 102 direction: Inbound register: output -- name: assert resource updated - assert: +- name: Assert resource updated + ansible.builtin.assert: that: - output.changed - "{{ output.state.rules | length }} == 2" @@ -285,8 +285,8 @@ priority: 100 direction: Inbound register: output -- name: assert resource not updated - assert: +- name: Assert resource not updated + ansible.builtin.assert: that: - not output.changed @@ -310,7 +310,7 @@ azure_rm_securitygroup: resource_group: "{{ resource_group }}" name: "{{ sg_name1 }}" - purge_rules: yes + purge_rules: true rules: - name: AsgToAsg protocol: Tcp @@ -324,8 +324,8 @@ priority: 101 direction: Inbound register: output -- name: assert resource retrieved - assert: +- name: Assert resource retrieved + ansible.builtin.assert: that: - output.changed @@ -333,7 +333,7 @@ azure_rm_securitygroup: resource_group: "{{ resource_group }}" name: "{{ sg_name1 }}" - purge_rules: yes + purge_rules: true rules: - name: AsgToAsg protocol: Tcp @@ -347,8 +347,8 @@ priority: 101 direction: Inbound register: output -- name: assert resource not updated - assert: +- name: Assert resource not updated + ansible.builtin.assert: that: - not output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_servicebus/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_servicebus/tasks/main.yml index 1bc4c11f9..3b4495faf 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_servicebus/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_servicebus/tasks/main.yml @@ -1,18 +1,19 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - run_once: yes + run_once: true - name: Create a namespace azure_rm_servicebus: - name: "ns{{ rpfx }}" - resource_group: "{{ resource_group }}" - sku: premium - tags: - key1: value1 + name: "ns{{ rpfx }}" + resource_group: "{{ resource_group }}" + sku: premium + tags: + key1: value1 register: namespace -- assert: +- name: Assert the namespace created + ansible.builtin.assert: that: - namespace.id - namespace.changed @@ -20,162 +21,171 @@ - name: Create a namespace (idempontent) azure_rm_servicebus: - name: "ns{{ rpfx }}" - resource_group: "{{ resource_group }}" + name: "ns{{ rpfx }}" + resource_group: "{{ resource_group }}" register: namespace -- assert: +- name: Assert idempotent + ansible.builtin.assert: that: - not namespace.changed - name: Create a queue azure_rm_servicebusqueue: - name: "queue{{ rpfx }}" - namespace: "ns{{ rpfx }}" - resource_group: "{{ resource_group }}" - max_message_size_in_kb: 2048 - max_size_in_mb: 2048 + name: "queue{{ rpfx }}" + namespace: "ns{{ rpfx }}" + resource_group: "{{ resource_group }}" + max_message_size_in_kb: 2048 + max_size_in_mb: 2048 register: queue -- assert: - that: - - queue.id - - queue.changed +- name: Assert the queue created + ansible.builtin.assert: + that: + - queue.id + - queue.changed - name: Create a topic (check mode) azure_rm_servicebustopic: - name: "topic{{ rpfx }}" - resource_group: "{{ resource_group }}" - namespace: "ns{{ rpfx }}" - duplicate_detection_time_in_seconds: 600 - max_message_size_in_kb: 2048 - max_size_in_mb: 2048 - check_mode: yes + name: "topic{{ rpfx }}" + resource_group: "{{ resource_group }}" + namespace: "ns{{ rpfx }}" + duplicate_detection_time_in_seconds: 600 + max_message_size_in_kb: 2048 + max_size_in_mb: 2048 + check_mode: true register: output -- assert: - that: - - output.changed +- name: Assert the check mode + ansible.builtin.assert: + that: + - output.changed - name: Create a topic azure_rm_servicebustopic: - name: "topic{{ rpfx }}" - resource_group: "{{ resource_group }}" - namespace: "ns{{ rpfx }}" - duplicate_detection_time_in_seconds: 600 - max_message_size_in_kb: 2048 - max_size_in_mb: 2048 + name: "topic{{ rpfx }}" + resource_group: "{{ resource_group }}" + namespace: "ns{{ rpfx }}" + duplicate_detection_time_in_seconds: 600 + max_message_size_in_kb: 2048 + max_size_in_mb: 2048 register: output -- assert: - that: - - output.changed - - output.id - - "'subscription_count' not in output" +- name: Assert the topic created + ansible.builtin.assert: + that: + - output.changed + - output.id + - "'subscription_count' not in output" - name: Create a topic (idempontent) azure_rm_servicebustopic: - name: "topic{{ rpfx }}" - resource_group: "{{ resource_group }}" - namespace: "ns{{ rpfx }}" - duplicate_detection_time_in_seconds: 600 - max_message_size_in_kb: 2048 - max_size_in_mb: 2048 + name: "topic{{ rpfx }}" + resource_group: "{{ resource_group }}" + namespace: "ns{{ rpfx }}" + duplicate_detection_time_in_seconds: 600 + max_message_size_in_kb: 2048 + max_size_in_mb: 2048 register: output -- assert: - that: - - not output.changed +- name: Assert idempotent + ansible.builtin.assert: + that: + - not output.changed - name: Create test policy azure_rm_servicebussaspolicy: - name: testpolicy - resource_group: "{{ resource_group }}" - namespace: "ns{{ rpfx }}" - topic: "topic{{ rpfx }}" - rights: manage + name: testpolicy + resource_group: "{{ resource_group }}" + namespace: "ns{{ rpfx }}" + topic: "topic{{ rpfx }}" + rights: manage - name: Create a subscription azure_rm_servicebustopicsubscription: - name: "subs{{ rpfx }}" - resource_group: "{{ resource_group }}" - namespace: "ns{{ rpfx }}" - topic: "topic{{ rpfx }}" + name: "subs{{ rpfx }}" + resource_group: "{{ resource_group }}" + namespace: "ns{{ rpfx }}" + topic: "topic{{ rpfx }}" register: subs -- assert: - that: - - subs.id - - subs.changed +- name: Assert the subscription created + ansible.builtin.assert: + that: + - subs.id + - subs.changed - name: Retrive topic azure_rm_servicebus_info: - type: topic - name: "topic{{ rpfx }}" - resource_group: "{{ resource_group }}" - namespace: "ns{{ rpfx }}" - show_sas_policies: yes + type: topic + name: "topic{{ rpfx }}" + resource_group: "{{ resource_group }}" + namespace: "ns{{ rpfx }}" + show_sas_policies: true register: facts -- assert: - that: - - "facts.servicebuses | length == 1" - - facts.servicebuses[0].id == output.id - - facts.servicebuses[0].subscription_count == 1 - - facts.servicebuses[0].sas_policies.testpolicy - - facts.servicebuses[0].sas_policies.testpolicy.rights == 'manage' +- name: Assert the topic facts + ansible.builtin.assert: + that: + - "facts.servicebuses | length == 1" + - facts.servicebuses[0].id == output.id + - facts.servicebuses[0].subscription_count == 1 + - facts.servicebuses[0].sas_policies.testpolicy + - facts.servicebuses[0].sas_policies.testpolicy.rights == 'manage' - name: Delete subscription azure_rm_servicebustopicsubscription: - name: "subs{{ rpfx }}" - resource_group: "{{ resource_group }}" - namespace: "ns{{ rpfx }}" - topic: "topic{{ rpfx }}" - state: absent + name: "subs{{ rpfx }}" + resource_group: "{{ resource_group }}" + namespace: "ns{{ rpfx }}" + topic: "topic{{ rpfx }}" + state: absent - name: Retrive topic azure_rm_servicebus_info: - type: topic - name: "topic{{ rpfx }}" - resource_group: "{{ resource_group }}" - namespace: "ns{{ rpfx }}" - show_sas_policies: yes + type: topic + name: "topic{{ rpfx }}" + resource_group: "{{ resource_group }}" + namespace: "ns{{ rpfx }}" + show_sas_policies: true register: facts -- assert: - that: - - facts.servicebuses[0].subscription_count == 0 - - "facts.servicebuses | length == 1" +- name: Assert the topic facts + ansible.builtin.assert: + that: + - facts.servicebuses[0].subscription_count == 0 + - "facts.servicebuses | length == 1" - name: Delete topic azure_rm_servicebustopic: - name: "topic{{ rpfx }}" - resource_group: "{{ resource_group }}" - namespace: "ns{{ rpfx }}" - state: absent + name: "topic{{ rpfx }}" + resource_group: "{{ resource_group }}" + namespace: "ns{{ rpfx }}" + state: absent - name: Retrive topic azure_rm_servicebus_info: - name: "topic{{ rpfx }}" - type: topic - resource_group: "{{ resource_group }}" - namespace: "ns{{ rpfx }}" - show_sas_policies: yes + name: "topic{{ rpfx }}" + type: topic + resource_group: "{{ resource_group }}" + namespace: "ns{{ rpfx }}" + show_sas_policies: true register: facts -- assert: - that: - - "facts.servicebuses | length == 0" +- name: Assert the topic facts + ansible.builtin.assert: + that: + - "facts.servicebuses | length == 0" - name: Delete queue azure_rm_servicebusqueue: - name: "queue{{ rpfx }}" - resource_group: "{{ resource_group }}" - namespace: "ns{{ rpfx }}" - state: absent + name: "queue{{ rpfx }}" + resource_group: "{{ resource_group }}" + namespace: "ns{{ rpfx }}" + state: absent - name: Delete namespace azure_rm_servicebus: - name: "ns{{ rpfx }}" - resource_group: "{{ resource_group }}" - state: absent + name: "ns{{ rpfx }}" + resource_group: "{{ resource_group }}" + state: absent diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_sqlmanagedinstance/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_sqlmanagedinstance/tasks/main.yml index 99c9f80cb..822f1d188 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_sqlmanagedinstance/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_sqlmanagedinstance/tasks/main.yml @@ -1,5 +1,5 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: random_postfix: "sqlmi{{ 1000 | random }}{{ resource_group | hash('md5') | truncate(7, True, '') }}" - name: Create virtual network @@ -29,7 +29,7 @@ testing: testing delete: on-exit foo: bar - purge_rules: yes + purge_rules: true rules: - name: DenySSH protocol: Tcp @@ -83,7 +83,7 @@ register: output - name: Assert the resource instance is not exist - assert: + ansible.builtin.assert: that: - output.changed @@ -108,7 +108,7 @@ register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -132,7 +132,7 @@ register: output - name: Assert the resource instance no changed - assert: + ansible.builtin.assert: that: - not output.changed @@ -158,7 +158,7 @@ register: output - name: Assert the resource instance is update - assert: + ansible.builtin.assert: that: - output.changed @@ -169,7 +169,7 @@ register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.sql_managed_instance[0].tags | length == 1 - output.sql_managed_instance[0].storage_size_in_gb == 256 diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_sqlserver/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_sqlserver/tasks/main.yml index e71b620ca..25ee16b40 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_sqlserver/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_sqlserver/tasks/main.yml @@ -1,11 +1,11 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: random_postfix: "{{ 1000 | random }}{{ resource_group | hash('md5') | truncate(7, True, '') }}" tenant_id: "{{ azure_tenant }}" run_azuread_tests: false azuread_group_name: "Test Security Group" azuread_group_id: "00000000-0000-0000-0000-000000000000" - run_once: yes + run_once: true - name: Create instance of SQL Server -- check mode azure_rm_sqlserver: @@ -14,10 +14,10 @@ location: eastus admin_username: mylogin admin_password: Password123! - check_mode: yes + check_mode: true register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -32,7 +32,7 @@ aaa: bbb register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed - output.state == 'Ready' @@ -46,7 +46,7 @@ admin_password: Password123! register: output - name: Assert the state has not changed - assert: + ansible.builtin.assert: that: - output.changed == false - output.state == 'Ready' @@ -65,7 +65,7 @@ aaa: bbb register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed - output.state == 'Ready' @@ -84,7 +84,7 @@ aaa: bbb register: output - name: Assert the state has not changed - assert: + ansible.builtin.assert: that: - not output.changed - output.state == 'Ready' @@ -98,7 +98,7 @@ change_admin_password: true register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -118,7 +118,7 @@ register: output when: run_azuread_tests | bool - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed - output.state == 'Ready' @@ -140,7 +140,7 @@ register: output when: run_azuread_tests | bool - name: Assert the state has not changed - assert: + ansible.builtin.assert: that: - not output.changed - output.state == 'Ready' @@ -154,7 +154,7 @@ server_name: "sqlsrv{{ random_postfix }}" register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.servers.sqlsrv{{ random_postfix }}.id != None @@ -175,7 +175,7 @@ server_name: "sqlsrv-extended-{{ random_postfix }}" register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.servers['sqlsrv-extended-{{ random_postfix }}'].id != None @@ -200,7 +200,7 @@ register: output when: run_azuread_tests | bool - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.servers['sqlsrv-azuread-{{ random_postfix }}'].id != None @@ -227,7 +227,7 @@ server_name: "unexisting" register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.servers == {} @@ -237,7 +237,7 @@ resource_group: "{{ resource_group }}" register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.servers.sqlsrv{{ random_postfix }}.id != None @@ -257,10 +257,10 @@ server_name: sqlsrv{{ random_postfix }} name: database{{ random_postfix }} location: eastus - check_mode: yes + check_mode: true register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -275,7 +275,7 @@ aaa: bbb register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed - output.status == 'Online' @@ -291,7 +291,7 @@ aaa: bbb register: output - name: Assert the state has not changed - assert: + ansible.builtin.assert: that: - output.changed == false - output.status == 'Online' @@ -305,9 +305,9 @@ register: output until: output.databases[0].earliest_restore_date != None retries: 10 - delay: 20 + delay: 60 - name: Assert that it can be restored from - assert: + ansible.builtin.assert: that: - output.databases[0].id != None - output.databases[0].earliest_restore_date != None @@ -323,7 +323,7 @@ location: eastus register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -335,7 +335,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -354,7 +354,7 @@ name: database{{ random_postfix }} register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.databases[0].id != None @@ -372,7 +372,7 @@ server_name: sqlsrv{{ random_postfix }} register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.databases[0].id != None @@ -406,10 +406,10 @@ server_name: sqlsrv{{ random_postfix }} name: database{{ random_postfix }} state: absent - check_mode: yes + check_mode: true register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -421,7 +421,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -433,7 +433,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed == false @@ -447,14 +447,14 @@ sku: name: S0 tier: Standard - check_mode: yes + check_mode: true register: output - name: Assert the state has not changed - assert: + ansible.builtin.assert: that: - output.changed -- name: Create SQL Database with sku +- name: Create SQL Database with sku azure_rm_sqldatabase: resource_group: "{{ resource_group }}" server_name: sqlsrv{{ random_postfix }} @@ -467,11 +467,11 @@ tier: Standard register: output - name: Assert the resource instance is well created with good SKU - assert: + ansible.builtin.assert: that: - output.changed - output.status == 'Online' - + - name: Gather facts SQL Database with good SKU azure_rm_sqldatabase_info: resource_group: "{{ resource_group }}" @@ -479,7 +479,7 @@ name: database{{ random_postfix }}2 register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.databases[0].id != None @@ -490,7 +490,7 @@ - output.databases[0].sku.capacity != None - output.databases[0].kind != None - output.databases[0].status != None - + - name: Create again instance of SQL Database with same SKU azure_rm_sqldatabase: resource_group: "{{ resource_group }}" @@ -504,7 +504,7 @@ tier: Standard register: output - name: Assert the state has not changed - assert: + ansible.builtin.assert: that: - output.changed == false - output.status == 'Online' @@ -522,7 +522,7 @@ tier: Premium register: output - name: Assert the state has not changed - assert: + ansible.builtin.assert: that: - output.changed - output.status == 'Online' @@ -534,7 +534,7 @@ name: database{{ random_postfix }}2 register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.databases[0].id != None @@ -554,7 +554,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -566,7 +566,7 @@ name: database{{ random_postfix }}2 register: output - name: Assert that empty dictionary was returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.databases | length == 0 @@ -577,7 +577,7 @@ server_name: sqlsrv{{ random_postfix }} register: output - name: Assert that empty dictionary was returned (one database is there by default) - assert: + ansible.builtin.assert: that: - output.changed == False - output.databases | length == 1 @@ -591,10 +591,10 @@ name: firewallrule{{ random_postfix }} start_ip_address: 172.28.10.136 end_ip_address: 172.28.10.138 - check_mode: yes + check_mode: true register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -607,7 +607,7 @@ end_ip_address: 172.28.10.138 register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -620,7 +620,7 @@ end_ip_address: 172.28.10.138 register: output - name: Assert the state has not changed - assert: + ansible.builtin.assert: that: - output.changed == false @@ -643,7 +643,7 @@ name: firewallrule{{ random_postfix }} register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.rules[0].id != None @@ -659,7 +659,7 @@ server_name: sqlsrv{{ random_postfix }} register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.rules[0].id != None @@ -696,7 +696,7 @@ name: firewallrule{{ random_postfix }} register: output - name: Assert that empty dictionary was returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.rules | length == 0 @@ -708,13 +708,13 @@ resource_group: "{{ resource_group }}" server_name: sqlsrv{{ random_postfix }} name: EP{{ random_postfix }} - zone_redundant: False + zone_redundant: false tags: aaa: bbb - check_mode: yes + check_mode: true register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -723,13 +723,13 @@ resource_group: "{{ resource_group }}" server_name: sqlsrv{{ random_postfix }} name: EP{{ random_postfix }} - zone_redundant: False + zone_redundant: false tags: aaa: bbb register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -738,13 +738,13 @@ resource_group: "{{ resource_group }}" server_name: sqlsrv{{ random_postfix }} name: EP{{ random_postfix }} - zone_redundant: False + zone_redundant: false tags: aaa: bbb register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - not output.changed @@ -753,13 +753,13 @@ resource_group: "{{ resource_group }}" server_name: sqlsrv{{ random_postfix }} name: EP{{ random_postfix }} - zone_redundant: True + zone_redundant: true tags: aaa1: bbb1 register: output - name: Assert the resource instance is well created - assert: + ansible.builtin.assert: that: - output.changed @@ -771,7 +771,7 @@ register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.elastic_pool[0].zone_redundant == true @@ -786,7 +786,7 @@ register: output - name: Assert the resource instance is deleted - assert: + ansible.builtin.assert: that: - output.changed @@ -797,10 +797,10 @@ resource_group: "{{ resource_group }}" name: "sqlsrv{{ random_postfix }}" state: absent - check_mode: yes + check_mode: true register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -811,7 +811,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -822,7 +822,7 @@ state: absent register: output - name: Assert the state has changed - assert: + ansible.builtin.assert: that: - output.changed == false diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_storageaccount/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_storageaccount/tasks/main.yml index 8c738a627..dfeabed07 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_storageaccount/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_storageaccount/tasks/main.yml @@ -1,5 +1,5 @@ - name: Set Storage Account Names - set_fact: + ansible.builtin.set_fact: storage_account_name_default: "sa{{ resource_group | hash('md5') | truncate(20, True, '') }}" storage_account_name_explicit: "sa{{ resource_group | hash('sha1') | truncate(20, True, '') }}" @@ -11,7 +11,7 @@ register: output ignore_errors: true - name: Check intentional name failure. - assert: + ansible.builtin.assert: that: - output.failed - output.msg is regex('AccountNameInvalid') @@ -38,14 +38,14 @@ account_type: Standard_LRS register: defaults_output - name: Assert status succeeded and results match expectations - assert: + ansible.builtin.assert: that: - defaults_output.changed - defaults_output.state.name == storage_account_name_default - defaults_output.state.id is defined - defaults_output.state.https_only - defaults_output.state.access_tier == None - - defaults_output.state.allow_blob_public_access == true + - defaults_output.state.allow_blob_public_access == false - defaults_output.state.minimum_tls_version == "TLS1_0" - name: Create storage account with static website disabled @@ -58,7 +58,7 @@ enabled: false register: output - name: Assert output - assert: + ansible.builtin.assert: that: - output.changed - output.state.static_website is defined @@ -76,7 +76,7 @@ enabled: false register: output - name: Assert not changed - assert: + ansible.builtin.assert: that: - not output.changed @@ -90,7 +90,7 @@ enabled: true register: output - name: Assert output - assert: + ansible.builtin.assert: that: - output.changed - output.state.static_website is defined @@ -110,7 +110,7 @@ error_document404_path: "error.html" register: output - name: Assert output - assert: + ansible.builtin.assert: that: - output.changed - output.state.static_website is defined @@ -130,7 +130,7 @@ error_document404_path: "error.html" register: output - name: Assert not changed - assert: + ansible.builtin.assert: that: - not output.changed @@ -143,7 +143,7 @@ is_hns_enabled: true register: output - name: Assert output - assert: + ansible.builtin.assert: that: - output.changed @@ -152,7 +152,8 @@ resource_group: "{{ resource_group }}" name: "{{ storage_account_name_default }}06" register: output -- assert: +- name: Assert the storage account facts + ansible.builtin.assert: that: - "output.storageaccounts | length == 1" - output.storageaccounts[0].is_hns_enabled == true @@ -168,7 +169,7 @@ index_document: "abc.htm" register: output - name: Assert output - assert: + ansible.builtin.assert: that: - output.changed - output.state.static_website is defined @@ -187,7 +188,7 @@ index_document: "abc.htm" register: output - name: Assert not changed - assert: + ansible.builtin.assert: that: - not output.changed @@ -201,7 +202,7 @@ enabled: false register: output - name: Assert output - assert: + ansible.builtin.assert: that: - output.changed - output.state.static_website is defined @@ -217,7 +218,7 @@ kind: FileStorage register: filestorage_output - name: Assert status succeeded and results match I(kind=FileStorage) - assert: + ansible.builtin.assert: that: - filestorage_output.changed - filestorage_output.state.sku_name == "Premium_ZRS" @@ -226,7 +227,7 @@ azure_rm_storageaccount: access_tier: Hot account_type: Premium_LRS - allow_blob_public_access: False + allow_blob_public_access: false append_tags: false blob_cors: - allowed_origins: @@ -241,7 +242,7 @@ exposed_headers: - x-ms-meta-* max_age_in_seconds: 200 - https_only: False + https_only: false kind: StorageV2 location: eastus minimum_tls_version: 'TLS1_2' @@ -258,7 +259,7 @@ galaxy: galaxy register: explicit_output - name: Assert status succeeded and correct parameter results - assert: + ansible.builtin.assert: that: - explicit_output.changed - explicit_output.state.id is defined @@ -274,7 +275,7 @@ azure_rm_storageaccount: access_tier: Hot account_type: Premium_LRS - allow_blob_public_access: False + allow_blob_public_access: false append_tags: false blob_cors: - allowed_origins: @@ -289,7 +290,7 @@ exposed_headers: - x-ms-meta-* max_age_in_seconds: 200 - https_only: False + https_only: false kind: StorageV2 location: eastus minimum_tls_version: 'TLS1_2' @@ -306,7 +307,7 @@ galaxy: galaxy register: output - name: Assert that properties have not changed - assert: + ansible.builtin.assert: that: - not output.changed - output.state.access_tier == explicit_output.state.access_tier @@ -333,7 +334,7 @@ name: "{{ storage_account_name_explicit }}" register: output - name: Assert that properties have not changed - assert: + ansible.builtin.assert: that: - not output.changed - output.state.access_tier == explicit_output.state.access_tier @@ -358,7 +359,7 @@ azure_rm_storageaccount: resource_group: "{{ resource_group }}" name: "{{ storage_account_name_default }}" - allow_blob_public_access: False + allow_blob_public_access: false append_tags: false blob_cors: - allowed_origins: @@ -373,7 +374,7 @@ exposed_headers: - x-ms-meta-* max_age_in_seconds: 200 - https_only: False + https_only: false kind: StorageV2 minimum_tls_version: 'TLS1_1' network_acls: @@ -387,7 +388,7 @@ galaxy: galaxy register: output - name: Assert account change success - assert: + ansible.builtin.assert: that: - output.changed - output.state.allow_blob_public_access == False @@ -409,7 +410,7 @@ register: output ignore_errors: true - name: Assert account type change failed - assert: + ansible.builtin.assert: that: - output.failed - output.msg is regex('Storage account of type .* cannot be changed') @@ -424,7 +425,7 @@ ignore_errors: true register: output - name: Assert CNAME failure - assert: + ansible.builtin.assert: that: - output.failed - output.msg is regex('custom domain name could not be verified') @@ -440,7 +441,7 @@ public_network_access: 'Disabled' register: output - name: Assert desired account config - assert: + ansible.builtin.assert: that: - output.changed - output.state.https_only @@ -459,7 +460,7 @@ public_network_access: 'Disabled' register: output - name: Assert no change - assert: + ansible.builtin.assert: that: - not output.changed @@ -470,7 +471,8 @@ - test - galaxy register: output -- assert: +- name: Assert the storage account facts + ansible.builtin.assert: that: output.storageaccounts | length >= 1 - name: Update account tags @@ -482,7 +484,8 @@ testing: testing delete: never register: output -- assert: +- name: Assert the storage account updated + ansible.builtin.assert: that: - "output.state.tags | length == 2" - "output.state.tags.testing == 'testing'" @@ -492,10 +495,11 @@ azure_rm_storageaccount_info: resource_group: "{{ resource_group }}" name: "{{ storage_account_name_explicit }}" - show_connection_string: True - show_blob_cors: True + show_connection_string: true + show_blob_cors: true register: output -- assert: +- name: Assert the storage account facts + ansible.builtin.assert: that: - "output.storageaccounts | length == 1" - not output.storageaccounts[0].custom_domain @@ -514,7 +518,8 @@ resource_group: "{{ resource_group }}" name: "{{ storage_account_name_default }}01" register: output -- assert: +- name: Assert the storage account facts + ansible.builtin.assert: that: - output.storageaccounts | length == 1 - output.storageaccounts[0].static_website is defined @@ -527,7 +532,8 @@ resource_group: "{{ resource_group }}" name: "{{ storage_account_name_default }}04" register: output -- assert: +- name: Assert the storage account facts + ansible.builtin.assert: that: - output.storageaccounts | length == 1 - output.storageaccounts[0].static_website is defined @@ -551,7 +557,7 @@ register: encryption_output - name: Assert storage account with (require_infrastructure_encryption=false) created - assert: + ansible.builtin.assert: that: - encryption_output.changed @@ -561,7 +567,8 @@ name: "{{ storage_account_name_default }}05" register: encryption_output -- assert: +- name: Assert the storage account facts + ansible.builtin.assert: that: - output.storageaccounts | length == 1 - output.storageaccounts[0].encryption.key_source == 'Microsoft.Storage' @@ -572,7 +579,8 @@ azure_rm_storageaccount_info: resource_group: "{{ resource_group }}" register: output -- assert: +- name: Assert all storage account facts + ansible.builtin.assert: that: - "output.storageaccounts | length >= 2" @@ -581,7 +589,7 @@ resource_group: "{{ resource_group }}" name: "{{ item }}" state: absent - force_delete_nonempty: True + force_delete_nonempty: true loop: - "{{ storage_account_name_default }}" - "{{ storage_account_name_explicit }}" diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_storageblob/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_storageblob/tasks/main.yml index 8ad07331f..307d52d27 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_storageblob/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_storageblob/tasks/main.yml @@ -1,11 +1,11 @@ - name: Create storage account name - set_fact: + ansible.builtin.set_fact: storage_account: "sb{{ resource_group | hash('md5') | truncate(22, True, '') }}" test1_file: "./targets/azure_rm_storageblob/files/Ratings.png" - name: Create storage account azure_rm_storageaccount: - resource_group: "{{ resource_group }}" + resource_group: "{{ resource_group }}" name: "{{ storage_account }}" account_type: Standard_LRS @@ -17,7 +17,7 @@ - name: Force upload blob azure_rm_storageblob: - resource_group: "{{ resource_group }}" + resource_group: "{{ resource_group }}" account_name: "{{ storage_account }}" container_name: my-blobs blob: 'Ratings.png' @@ -30,7 +30,7 @@ - name: Upload blob idempotence azure_rm_storageblob: - resource_group: "{{ resource_group }}" + resource_group: "{{ resource_group }}" account_name: "{{ storage_account }}" container_name: my-blobs blob: 'Ratings.png' @@ -40,71 +40,84 @@ val1: foo val2: bar register: upload_facts -- assert: +- name: Assert idempotent + ansible.builtin.assert: that: "not upload_facts.changed" -- name: Download file idempotence +- name: Download file idempotence azure_rm_storageblob: - resource_group: "{{ resource_group }}" + resource_group: "{{ resource_group }}" account_name: "{{ storage_account }}" container_name: my-blobs blob: 'Ratings.png' dest: '{{ test1_file }}' register: download_results -- assert: +- name: Assert idempotent + ansible.builtin.assert: that: not download_results.changed -- file: path="/tmp/Ratings.png" state=absent +- name: Delete file + ansible.builtin.file: + path: "/tmp/Ratings.png" + state: absent -- name: Download file +- name: Download file azure_rm_storageblob: - resource_group: "{{ resource_group }}" + resource_group: "{{ resource_group }}" account_name: "{{ storage_account }}" container_name: my-blobs blob: 'Ratings.png' dest: '/tmp/Ratings.png' register: download_results -- assert: +- name: Assert download file + ansible.builtin.assert: that: "download_results.changed" -- find: paths='/tmp' patterns="Ratings.png" +- name: Find file + ansible.builtin.find: + paths: '/tmp' + patterns: "Ratings.png" register: find_results -- assert: +- name: Assert matched the file + ansible.builtin.assert: that: "find_results['matched'] == 1" -- name: Do not delete container that has blobs +- name: Do not delete container that has blobs azure_rm_storageblob: resource_group: "{{ resource_group }}" account_name: "{{ storage_account }}" - container_name: my-blobs + container_name: my-blobs state: absent register: output -- assert: +- name: Assert no blobs + ansible.builtin.assert: that: "not output.changed" - name: Delete blob object azure_rm_storageblob: - resource_group: "{{ resource_group }}" + resource_group: "{{ resource_group }}" account_name: "{{ storage_account }}" - container_name: my-blobs + container_name: my-blobs blob: "Ratings.png" state: absent register: output -- assert: +- name: Assert the blob deleted + ansible.builtin.assert: that: "output.changed" -- name: Delete container +- name: Delete container azure_rm_storageblob: resource_group: "{{ resource_group }}" account_name: "{{ storage_account }}" - container_name: my-blobs + container_name: my-blobs state: absent register: output -- assert: +- name: Assert delete the container + ansible.builtin.assert: that: "output.changed" - name: Delete storage account azure_rm_storageaccount: - resource_group: "{{ resource_group }}" + resource_group: "{{ resource_group }}" name: "{{ storage_account }}" - state: absent + state: absent diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_storageshare/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_storageshare/tasks/main.yml index ffe672d4d..15ea83446 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_storageshare/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_storageshare/tasks/main.yml @@ -1,7 +1,6 @@ ---- - name: Set storage account name - set_fact: - storage_account: "sb{{ resource_group | hash('md5') | truncate(22, True, '') }}" + ansible.builtin.set_fact: + storage_account: "sb{{ resource_group | hash('md5') | truncate(22, True, '') }}" - name: Create storage account azure_rm_storageaccount: @@ -11,7 +10,7 @@ kind: StorageV2 - name: Set storage share facts - set_fact: + ansible.builtin.set_fact: share_name: testshare quota: 32 access_tier: Cool @@ -30,7 +29,7 @@ register: create_result - name: Assert create success - assert: + ansible.builtin.assert: that: - create_result.changed - create_result.state.name == share_name @@ -49,7 +48,7 @@ register: create_result - name: Assert idempotence - assert: + ansible.builtin.assert: that: not create_result.changed - name: Get share details @@ -60,7 +59,7 @@ register: share_facts - name: Assert storage share details - assert: + ansible.builtin.assert: that: - not share_facts.changed - share_facts.storageshares.name == share_name @@ -72,7 +71,7 @@ - share_facts.storageshares.etag is defined - name: Set new storage share facts - set_fact: + ansible.builtin.set_fact: quota: 64 access_tier: Hot @@ -86,7 +85,7 @@ register: update_result - name: Assert share update success - assert: + ansible.builtin.assert: that: update_result.changed - name: Get updated details @@ -97,7 +96,7 @@ register: share_facts - name: Assert storage share details - assert: + ansible.builtin.assert: that: - share_facts.storageshares.name == share_name - share_facts.storageshares.share_quota == quota @@ -116,8 +115,9 @@ register: delete_output - name: Pause for 3 minutes to waiting delete - pause: + ansible.builtin.pause: minutes: 3 + changed_when: true - name: Delete storage account azure_rm_storageaccount: diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_subnet/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_subnet/tasks/main.yml index 6e4e6cbb1..0caa850ce 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_subnet/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_subnet/tasks/main.yml @@ -33,9 +33,10 @@ resource_group: "{{ resource_group }}" address_prefix_cidr: "10.1.0/24" register: output - ignore_errors: yes + ignore_errors: true -- assert: +- name: Assert created fail + ansible.builtin.assert: that: output.failed - name: Add the subnet back @@ -46,7 +47,8 @@ address_prefix_cidr: "10.1.0.0/24" register: output -- assert: +- name: Assert the subnet created + ansible.builtin.assert: that: - output.changed - output.state.address_prefix == "10.1.0.0/24" @@ -58,7 +60,8 @@ resource_group: "{{ resource_group }}" register: output -- assert: +- name: Assert idempotent + ansible.builtin.assert: that: not output.changed - name: Create network security group @@ -94,7 +97,8 @@ - westus register: output -- assert: +- name: Assert idempotent + ansible.builtin.assert: that: not output.changed - name: Able to completely remove service endpoints @@ -106,7 +110,8 @@ service_endpoints: [] register: output -- assert: +- name: Assert the subnet updated + ansible.builtin.assert: that: output.state.service_endpoints is not defined - name: Create network security group in another resource group @@ -127,10 +132,11 @@ resource_group: "{{ resource_group_secondary }}" register: output -- assert: - that: - - output.changed - - output.state.network_security_group.id == nsg.state.id +- name: Assert the subnet update + ansible.builtin.assert: + that: + - output.changed + - output.state.network_security_group.id == nsg.state.id - name: Update the subnet (idempotent) azure_rm_subnet: @@ -142,7 +148,8 @@ security_group: "{{ nsg.state.id }}" register: output -- assert: +- name: Assert idempotent + ansible.builtin.assert: that: not output.changed - name: Create subnet with IPv4 and IPv6 @@ -155,7 +162,8 @@ - "fdda:e69b:1587:495e::/64" register: output -- assert: +- name: Assert the subnet created + ansible.builtin.assert: that: - output.changed - not output.state.address_prefix @@ -171,7 +179,8 @@ - "fdda:e69b:1587:495e::/64" register: output -- assert: +- name: Assert the subnet updated + ansible.builtin.assert: that: not output.changed - name: Update the subnet's IPv4 and IPv6 address @@ -185,7 +194,8 @@ security_group: "{{ nsg.state.id }}" register: output -- assert: +- name: Assert the subnet update + ansible.builtin.assert: that: - output.changed @@ -198,7 +208,8 @@ private_endpoint_network_policies: Enabled register: output -- assert: +- name: Assert the subnet updated + ansible.builtin.assert: that: output - name: The subnet with network policies should be idempotent @@ -210,7 +221,8 @@ private_endpoint_network_policies: Enabled register: output -- assert: +- name: Assert idempotent + ansible.builtin.assert: that: not output.changed - name: Update the subnet with delegations @@ -223,7 +235,8 @@ serviceName: 'Microsoft.ContainerInstance/containerGroups' register: output -- assert: +- name: Assert the subnet updated + ansible.builtin.assert: that: output - name: The subnet with delegations should be idempotent @@ -236,7 +249,8 @@ serviceName: 'Microsoft.ContainerInstance/containerGroups' register: output -- assert: +- name: Assert idempotent + ansible.builtin.assert: that: not output.changed - name: Get subnet facts @@ -247,7 +261,7 @@ register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.subnets[0]['id'] != None @@ -270,7 +284,7 @@ register: output - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - output.changed == False - output.subnets[0]['id'] != None @@ -297,7 +311,8 @@ resource_group: "{{ resource_group }}" register: output -- assert: +- name: Assert idempotent + ansible.builtin.assert: that: not output.changed - name: Remove subnet diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_subscription/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_subscription/tasks/main.yml index 113cfe546..e8e58645c 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_subscription/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_subscription/tasks/main.yml @@ -1,6 +1,6 @@ - name: Get list of all subscriptions azure_rm_subscription_info: - all: True + all: true register: az_all_subscriptions - name: Get a subscription by id @@ -16,9 +16,9 @@ name: "{{ az_all_subscriptions.subscriptions[0].display_name }}" id: "{{ az_all_subscriptions.subscriptions[0].subscription_id }}" register: invalid_name - ignore_errors: yes + ignore_errors: true - name: Assert task failed - assert: - that: + ansible.builtin.assert: + that: - "invalid_name['failed'] == True" diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_trafficmanagerprofile/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_trafficmanagerprofile/tasks/main.yml index 865c56dc4..6e2a7f342 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_trafficmanagerprofile/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_trafficmanagerprofile/tasks/main.yml @@ -1,127 +1,127 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: tmname: "tm{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" endpointname1: "ep1{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" endpointname2: "ep2{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - run_once: yes + run_once: true - name: Create a Traffic Manager profile(check mode) azure_rm_trafficmanagerprofile: - resource_group: "{{ resource_group }}" - name: "{{ tmname }}" - tags: - testing: testing - delete: on-exit - foo: bar - location: global - profile_status: enabled - routing_method: performance - dns_config: - relative_name: "{{ tmname }}" - ttl: 60 - monitor_config: - protocol: HTTPS - port: 80 - path: '/' - check_mode: yes + resource_group: "{{ resource_group }}" + name: "{{ tmname }}" + tags: + testing: testing + delete: on-exit + foo: bar + location: global + profile_status: enabled + routing_method: performance + dns_config: + relative_name: "{{ tmname }}" + ttl: 60 + monitor_config: + protocol: HTTPS + port: 80 + path: '/' + check_mode: true - name: Check there is no Traffic Manager profile created azure_rm_trafficmanagerprofile_info: - resource_group: "{{ resource_group }}" - name: "{{ tmname }}" + resource_group: "{{ resource_group }}" + name: "{{ tmname }}" register: fact - name: Check there is no Traffic Manager profile created - assert: { that: "{{ fact.tms | length }} == 0" } + ansible.builtin.assert: { that: "{{ fact.tms | length }} == 0" } - name: Create a Traffic Manager profile azure_rm_trafficmanagerprofile: - resource_group: "{{ resource_group }}" - name: "{{ tmname }}" - tags: - testing: testing - delete: on-exit - foo: bar - location: global - profile_status: enabled - routing_method: performance - dns_config: - relative_name: "{{ tmname }}" - ttl: 60 - monitor_config: - protocol: HTTPS - port: 80 - path: '/' + resource_group: "{{ resource_group }}" + name: "{{ tmname }}" + tags: + testing: testing + delete: on-exit + foo: bar + location: global + profile_status: enabled + routing_method: performance + dns_config: + relative_name: "{{ tmname }}" + ttl: 60 + monitor_config: + protocol: HTTPS + port: 80 + path: '/' register: tm - name: Assert the Traffic Manager profile is well created - assert: + ansible.builtin.assert: that: - tm.changed - name: Gather Traffic Manager profile facts azure_rm_trafficmanagerprofile_info: - resource_group: "{{ resource_group }}" - name: "{{ tmname }}" + resource_group: "{{ resource_group }}" + name: "{{ tmname }}" register: fact - name: Assert fact returns the created one - assert: - that: - - "fact.tms | length == 1" - - fact.tms[0].id == tm.id - - fact.tms[0].endpoints | length == 0 + ansible.builtin.assert: + that: + - "fact.tms | length == 1" + - fact.tms[0].id == tm.id + - fact.tms[0].endpoints | length == 0 - name: Create a Traffic Manager profile (idempotent) azure_rm_trafficmanagerprofile: - resource_group: "{{ resource_group }}" - name: "{{ tmname }}" - tags: - testing: testing - delete: on-exit - foo: bar - location: global - profile_status: enabled - routing_method: performance - dns_config: - relative_name: "{{ tmname }}" - ttl: 60 - monitor_config: - protocol: HTTPS - port: 80 - path: '/' + resource_group: "{{ resource_group }}" + name: "{{ tmname }}" + tags: + testing: testing + delete: on-exit + foo: bar + location: global + profile_status: enabled + routing_method: performance + dns_config: + relative_name: "{{ tmname }}" + ttl: 60 + monitor_config: + protocol: HTTPS + port: 80 + path: '/' register: output - name: Assert idempotent - assert: + ansible.builtin.assert: that: - not output.changed - name: Update the Traffic Manager profile azure_rm_trafficmanagerprofile: - resource_group: "{{ resource_group }}" - name: "{{ tmname }}" - tags: - testing: testing - delete: on-exit - foo: bar - location: global - profile_status: disabled - routing_method: priority - dns_config: - relative_name: "{{ tmname }}" - ttl: 60 - monitor_config: - protocol: HTTPS - port: 80 - path: '/' + resource_group: "{{ resource_group }}" + name: "{{ tmname }}" + tags: + testing: testing + delete: on-exit + foo: bar + location: global + profile_status: disabled + routing_method: priority + dns_config: + relative_name: "{{ tmname }}" + ttl: 60 + monitor_config: + protocol: HTTPS + port: 80 + path: '/' register: output - name: Assert the Traffic Manager profile is updated - assert: + ansible.builtin.assert: that: - - output.changed + - output.changed - name: Create Traffic Manager endpoint(check mode) azure_rm_trafficmanagerendpoint: @@ -133,11 +133,11 @@ priority: 2 weight: 1 target: 1.2.3.4 - check_mode: yes + check_mode: true register: output - name: Assert check mode changed - assert: + ansible.builtin.assert: that: - output.changed @@ -148,7 +148,7 @@ register: facts - name: Check no endpoint created in check mode - assert: + ansible.builtin.assert: that: - facts.endpoints | length == 0 @@ -165,7 +165,7 @@ register: output - name: Assert endpoint create changed - assert: + ansible.builtin.assert: that: - output.changed @@ -176,7 +176,7 @@ register: facts - name: Check endpoint created - assert: + ansible.builtin.assert: that: - facts.endpoints | length == 1 - facts.endpoints[0].name == "{{ endpointname1 }}" @@ -199,7 +199,7 @@ register: facts - name: Check 2 endpoint in profile - assert: + ansible.builtin.assert: that: - facts.endpoints | length == 2 @@ -216,7 +216,7 @@ register: output - name: Assert endpoint creation idempotent - assert: + ansible.builtin.assert: that: - output.changed == False @@ -230,7 +230,7 @@ register: output - name: Assert endpoint deletion changed - assert: + ansible.builtin.assert: that: - output.changed @@ -241,7 +241,7 @@ register: facts - name: Check 1 endpoint left in profile - assert: + ansible.builtin.assert: that: - facts.endpoints | length == 1 @@ -250,20 +250,20 @@ resource_group: "{{ resource_group }}" name: "{{ tmname }}" state: absent - check_mode: yes + check_mode: true - name: Gather Traffic Manager profile facts azure_rm_trafficmanagerprofile_info: - resource_group: "{{ resource_group }}" - name: "{{ tmname }}" + resource_group: "{{ resource_group }}" + name: "{{ tmname }}" register: fact - name: Assert the traffic manager profile is still there - assert: - that: - - "fact.tms | length == 1" - - fact.tms[0].id == tm.id - - fact.tms[0].endpoints | length == 1 + ansible.builtin.assert: + that: + - "fact.tms | length == 1" + - fact.tms[0].id == tm.id + - fact.tms[0].endpoints | length == 1 - name: Delete the Traffic Manager profile azure_rm_trafficmanagerprofile: @@ -273,17 +273,17 @@ register: output - name: Assert the Traffic Manager profile is well deleted - assert: + ansible.builtin.assert: that: - output.changed - name: Get Traffic Manager profile fact azure_rm_trafficmanagerprofile_info: - resource_group: "{{ resource_group }}" - name: "{{ tmname }}" + resource_group: "{{ resource_group }}" + name: "{{ tmname }}" register: fact - name: Assert fact returns empty - assert: + ansible.builtin.assert: that: - "fact.tms | length == 0" diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualhub/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualhub/tasks/main.yml index 36707bec5..530e92524 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualhub/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualhub/tasks/main.yml @@ -1,54 +1,55 @@ -- set_fact: - name: "{{ resource_group | hash('md5') | truncate(22, True, '') }}" +- name: Set varialbles + ansible.builtin.set_fact: + name_rpfx: "{{ resource_group | hash('md5') | truncate(22, True, '') }}" - name: Create a VirtualHub (check mode) azure_rm_virtualhub: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" sku: Standard - check_mode: yes + check_mode: true - name: Create a VirtualHub azure_rm_virtualhub: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" sku: Standard register: output - name: Assert the virtual hub is well created - assert: + ansible.builtin.assert: that: - output.changed - output.state.provisioning_state == 'Succeeded' - + - name: Create a VirtualHub (idempotent) azure_rm_virtualhub: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" sku: Standard register: output - name: Assert idempotent - assert: + ansible.builtin.assert: that: - not output.changed - name: Get Virtual Hub Info azure_rm_virtualhub_info: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" register: output - name: Assert fact returns - assert: + ansible.builtin.assert: that: - - output.virtual_hubs[0].provisioning_state == "Succeeded" + - output.virtual_hubs[0].provisioning_state == "Succeeded" - output.virtual_hubs[0].sku == "Standard" - name: Create a VirtualWan azure_rm_virtualwan: resource_group: "{{ resource_group }}" - name: "wan-{{ name }}" + name: "wan-{{ name_rpfx }}" disable_vpn_encryption: true allow_branch_to_branch_traffic: true allow_vnet_to_vnet_traffic: true @@ -58,7 +59,7 @@ - name: Create Second VirtualHub azure_rm_virtualhub: resource_group: "{{ resource_group }}" - name: "{{ name }}-seondary" + name: "{{ name_rpfx }}-seondary" sku: Standard address_prefix: 12.0.0.0/16 virtual_wan: @@ -70,7 +71,7 @@ register: output - name: Assert the virtual hub is well created - assert: + ansible.builtin.assert: that: - output.changed - output.state.provisioning_state == 'Succeeded' @@ -78,17 +79,17 @@ - name: Delete Second VirtualHub azure_rm_virtualhub: resource_group: "{{ resource_group }}" - name: "{{ name }}-seondary" + name: "{{ name_rpfx }}-seondary" state: absent - name: Delete virtual hub azure_rm_virtualhub: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" state: absent register: output - name: Assert the AKS instance is upgraded - assert: + ansible.builtin.assert: that: - output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualhubconnection/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualhubconnection/tasks/main.yml index 562ecbacc..c110bdd32 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualhubconnection/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualhubconnection/tasks/main.yml @@ -1,163 +1,164 @@ - - set_fact: - rpfx: "{{ resource_group | hash('md5') | truncate(8, True, '') }}" +- name: Set variables + ansible.builtin.set_fact: + rpfx: "{{ resource_group | hash('md5') | truncate(8, True, '') }}" - - name: Create virtual network - azure_rm_virtualnetwork: - name: "vnet{{ rpfx }}" - address_prefixes_cidr: - - 10.1.0.0/16 - - 172.100.0.0/16 - resource_group: "{{ resource_group }}" - register: vnet_output - - - name: Create a Virtual Wan - azure_rm_virtualwan: - resource_group: "{{ resource_group }}" - name: "virtualwan{{ rpfx }}" - office365_local_breakout_category: All - disable_vpn_encryption: true - allow_branch_to_branch_traffic: true - allow_vnet_to_vnet_traffic: true - virtual_wan_type: Basic - register: vwan_output - - - name: Create a VirtualHub - azure_rm_virtualhub: - resource_group: "{{ resource_group }}" - name: "vhub{{ rpfx }}" - sku: Standard - address_prefix: 12.0.0.0/16 - virtual_wan: - id: "{{ vwan_output.state.id }}" - virtual_router_asn: 65515 - virtual_router_ips: - - 12.0.32.4 - - 12.0.32.5 - register: output - - - name: Create virtual hub connection - azure_rm_virtualhubconnection: - resource_group: "{{ resource_group }}" - vhub_name: "vhub{{ rpfx }}" - name: "connection{{ rpfx }}" - enable_internet_security: true - allow_remote_vnet_to_use_hub_vnet_gateways: false - allow_hub_to_remote_vnet_transit: true - remote_virtual_network: - id: "{{ vnet_output.state.id }}" - routing_configuration: - propagated_route_tables: - labels: - - labels1 - - labels3 - vnet_routes: - static_routes: - - name: route1 - address_prefixes: - - 10.1.0.0/16 - - 10.2.0.0/16 - - 10.6.0.0/16 - next_hop_ip_address: 10.0.0.68 - - name: route2 - address_prefixes: - - 10.4.0.0/16 - next_hop_ip_address: 10.0.0.65 - register: output - - - name: Assert the virtual hub connection is well created - assert: - that: - - output.changed - - - name: Create virtual hub connection (idempotent test) - azure_rm_virtualhubconnection: - resource_group: "{{ resource_group }}" - vhub_name: "vhub{{ rpfx }}" - name: "connection{{ rpfx }}" - enable_internet_security: true - allow_remote_vnet_to_use_hub_vnet_gateways: false - allow_hub_to_remote_vnet_transit: true - remote_virtual_network: - id: "{{ vnet_output.state.id }}" - routing_configuration: - propagated_route_tables: - labels: - - labels1 - - labels3 - vnet_routes: - static_routes: - - name: route1 - address_prefixes: - - 10.1.0.0/16 - - 10.2.0.0/16 - - 10.6.0.0/16 - next_hop_ip_address: 10.0.0.68 - - name: route2 - address_prefixes: - - 10.4.0.0/16 - next_hop_ip_address: 10.0.0.65 - register: output - - - name: Assert the virtual hub connection no changed - assert: - that: - - not output.changed - - - name: Update virtual hub connection - azure_rm_virtualhubconnection: - resource_group: "{{ resource_group }}" - vhub_name: "vhub{{ rpfx }}" - name: "connection{{ rpfx }}" - enable_internet_security: false - allow_remote_vnet_to_use_hub_vnet_gateways: false - allow_hub_to_remote_vnet_transit: true - remote_virtual_network: - id: "{{ vnet_output.state.id }}" - routing_configuration: - propagated_route_tables: - labels: - - labels1 - - labels2 - - labels3 - vnet_routes: - static_routes: - - name: route1 - address_prefixes: - - 10.1.0.0/16 - - 10.2.0.0/16 - - 10.6.0.0/16 - - 10.7.0.0/16 - next_hop_ip_address: 10.0.0.68 - - name: route2 - address_prefixes: - - 10.4.0.0/16 - next_hop_ip_address: 10.0.0.65 - register: output - - - name: Assert the virtual hub connection no changed - assert: - that: - - output.changed - - - name: Get virtual hub connection info - azure_rm_virtualhubconnection_info: - resource_group: "{{ resource_group }}" - virtual_hub_name: "vhub{{ rpfx }}" - name: "connection{{ rpfx }}" - register: output - - - name: Assert fact returns - assert: - that: - - output.virtual_hub_connection[0].allow_hub_to_remote_vnet_transit - - not output.virtual_hub_connection[0].allow_remote_vnet_to_use_hub_vnet_gateways - - not output.virtual_hub_connection[0].enable_internet_security - - output.virtual_hub_connection[0].routing_configuration.propagated_route_tables.labels | length == 3 - - output.virtual_hub_connection[0].routing_configuration.vnet_routes.static_routes | length == 2 - - - name: Delete the virtual hub connection - azure_rm_virtualhubconnection: - resource_group: "{{ resource_group }}" - vhub_name: "vhub{{ rpfx }}" - name: "connection{{ rpfx }}" - state: absent +- name: Create virtual network + azure_rm_virtualnetwork: + name: "vnet{{ rpfx }}" + address_prefixes_cidr: + - 10.1.0.0/16 + - 172.100.0.0/16 + resource_group: "{{ resource_group }}" + register: vnet_output + +- name: Create a Virtual Wan + azure_rm_virtualwan: + resource_group: "{{ resource_group }}" + name: "virtualwan{{ rpfx }}" + office365_local_breakout_category: All + disable_vpn_encryption: true + allow_branch_to_branch_traffic: true + allow_vnet_to_vnet_traffic: true + virtual_wan_type: Basic + register: vwan_output + +- name: Create a VirtualHub + azure_rm_virtualhub: + resource_group: "{{ resource_group }}" + name: "vhub{{ rpfx }}" + sku: Standard + address_prefix: 12.0.0.0/16 + virtual_wan: + id: "{{ vwan_output.state.id }}" + virtual_router_asn: 65515 + virtual_router_ips: + - 12.0.32.4 + - 12.0.32.5 + register: output + +- name: Create virtual hub connection + azure_rm_virtualhubconnection: + resource_group: "{{ resource_group }}" + vhub_name: "vhub{{ rpfx }}" + name: "connection{{ rpfx }}" + enable_internet_security: true + allow_remote_vnet_to_use_hub_vnet_gateways: false + allow_hub_to_remote_vnet_transit: true + remote_virtual_network: + id: "{{ vnet_output.state.id }}" + routing_configuration: + propagated_route_tables: + labels: + - labels1 + - labels3 + vnet_routes: + static_routes: + - name: route1 + address_prefixes: + - 10.1.0.0/16 + - 10.2.0.0/16 + - 10.6.0.0/16 + next_hop_ip_address: 10.0.0.68 + - name: route2 + address_prefixes: + - 10.4.0.0/16 + next_hop_ip_address: 10.0.0.65 + register: output + +- name: Assert the virtual hub connection is well created + ansible.builtin.assert: + that: + - output.changed + +- name: Create virtual hub connection (idempotent test) + azure_rm_virtualhubconnection: + resource_group: "{{ resource_group }}" + vhub_name: "vhub{{ rpfx }}" + name: "connection{{ rpfx }}" + enable_internet_security: true + allow_remote_vnet_to_use_hub_vnet_gateways: false + allow_hub_to_remote_vnet_transit: true + remote_virtual_network: + id: "{{ vnet_output.state.id }}" + routing_configuration: + propagated_route_tables: + labels: + - labels1 + - labels3 + vnet_routes: + static_routes: + - name: route1 + address_prefixes: + - 10.1.0.0/16 + - 10.2.0.0/16 + - 10.6.0.0/16 + next_hop_ip_address: 10.0.0.68 + - name: route2 + address_prefixes: + - 10.4.0.0/16 + next_hop_ip_address: 10.0.0.65 + register: output + +- name: Assert the virtual hub connection no changed + ansible.builtin.assert: + that: + - not output.changed + +- name: Update virtual hub connection + azure_rm_virtualhubconnection: + resource_group: "{{ resource_group }}" + vhub_name: "vhub{{ rpfx }}" + name: "connection{{ rpfx }}" + enable_internet_security: false + allow_remote_vnet_to_use_hub_vnet_gateways: false + allow_hub_to_remote_vnet_transit: true + remote_virtual_network: + id: "{{ vnet_output.state.id }}" + routing_configuration: + propagated_route_tables: + labels: + - labels1 + - labels2 + - labels3 + vnet_routes: + static_routes: + - name: route1 + address_prefixes: + - 10.1.0.0/16 + - 10.2.0.0/16 + - 10.6.0.0/16 + - 10.7.0.0/16 + next_hop_ip_address: 10.0.0.68 + - name: route2 + address_prefixes: + - 10.4.0.0/16 + next_hop_ip_address: 10.0.0.65 + register: output + +- name: Assert the virtual hub connection no changed + ansible.builtin.assert: + that: + - output.changed + +- name: Get virtual hub connection info + azure_rm_virtualhubconnection_info: + resource_group: "{{ resource_group }}" + virtual_hub_name: "vhub{{ rpfx }}" + name: "connection{{ rpfx }}" + register: output + +- name: Assert fact returns + ansible.builtin.assert: + that: + - output.virtual_hub_connection[0].allow_hub_to_remote_vnet_transit + - not output.virtual_hub_connection[0].allow_remote_vnet_to_use_hub_vnet_gateways + - not output.virtual_hub_connection[0].enable_internet_security + - output.virtual_hub_connection[0].routing_configuration.propagated_route_tables.labels | length == 3 + - output.virtual_hub_connection[0].routing_configuration.vnet_routes.static_routes | length == 2 + +- name: Delete the virtual hub connection + azure_rm_virtualhubconnection: + resource_group: "{{ resource_group }}" + vhub_name: "vhub{{ rpfx }}" + name: "connection{{ rpfx }}" + state: absent diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/inventory.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/inventory.yml index ceb88cd7e..88172852a 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/inventory.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/inventory.yml @@ -36,6 +36,10 @@ all: network: 10.42.6.0/24 subnet: 10.42.6.0/28 + azure_test_vm_identity: + network: 10.42.7.0/24 + subnet: 10.42.7.0/28 + vars: ansible_connection: local ansible_python_interpreter: "{{ ansible_playbook_python }}" diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/main.yml index c9c9158c4..9ba46c362 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/main.yml @@ -1,7 +1,8 @@ +--- - name: Run Azure VM tests in parallel hosts: all - gather_facts: no - strategy: free + gather_facts: false + strategy: linear tasks: - name: Include tasks based on inventory hostname - include_tasks: tasks/{{ inventory_hostname }}.yml + ansible.builtin.include_tasks: tasks/{{ inventory_hostname }}.yml diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/runme.sh b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/runme.sh index c7895c9d2..c7895c9d2 100644..100755 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/runme.sh +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/runme.sh diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_deallocate.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_deallocate.yml index 3c86c7419..09bb56e9c 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_deallocate.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_deallocate.yml @@ -1,4 +1,5 @@ -- include_tasks: setup.yml +- name: Set parameters + ansible.builtin.include_tasks: setup.yml - name: Create minimal VM with defaults azure_rm_virtualmachine: @@ -12,9 +13,9 @@ vm_size: Standard_B1ms virtual_network: "{{ network_name }}" image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal publisher: Canonical - sku: 16.04-LTS + sku: 20_04-lts version: latest register: vm_output @@ -25,18 +26,19 @@ register: vm_state - name: Pause for 10 mimutes to VM updating - shell: sleep 600 + ansible.builtin.command: sleep 600 + changed_when: true - name: Restart the virtual machine azure_rm_virtualmachine: resource_group: "{{ resource_group }}" name: "{{ vm_name }}" - restarted: yes + restarted: true vm_size: Standard_B1ms register: restart_result - name: Ensue VM was restarted - assert: + ansible.builtin.assert: that: - "azure_vm.powerstate in ['starting', 'running']" - restart_result is changed @@ -45,12 +47,12 @@ azure_rm_virtualmachine: resource_group: "{{ resource_group }}" name: "{{ vm_name }}" - allocated: no + allocated: false vm_size: Standard_B1ms register: deallocate_result - name: Ensure VM was deallocated - assert: + ansible.builtin.assert: that: - azure_vm.powerstate == 'deallocated' - deallocate_result is changed @@ -60,11 +62,11 @@ resource_group: "{{ resource_group }}" name: "{{ vm_name }}" vm_size: Standard_B1ms - started: True + started: true register: start_result - name: Ensure VM was started - assert: + ansible.builtin.assert: that: - "azure_vm.powerstate in ['starting', 'running']" - start_result is changed @@ -99,5 +101,5 @@ azure_rm_storageaccount: resource_group: "{{ resource_group }}" name: "{{ storage_account }}" - force_delete_nonempty: yes + force_delete_nonempty: false state: absent diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_dual_nic.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_dual_nic.yml index 6202e3534..f6865b2e7 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_dual_nic.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_dual_nic.yml @@ -1,4 +1,5 @@ -- include_tasks: setup.yml +- name: Set variables + ansible.builtin.include_tasks: setup.yml - name: Create virtual network in secondary resource group azure_rm_virtualnetwork: @@ -42,18 +43,18 @@ network_interfaces: "{{ nic_list }}" availability_set: "{{ availability_set }}" image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal publisher: Canonical - sku: 16.04-LTS + sku: 20_04-lts version: latest tags: abc: def - name: Ensure VM was created properly - assert: + ansible.builtin.assert: that: - - azure_vm.properties.availabilitySet.id - - azure_vm.properties.storageProfile.osDisk.name == 'testosdiskxx' + - azure_vm.availability_set.id + - azure_vm.storage_profile.os_disk.name == 'testosdiskxx' - name: Retrieve VM facts (filtering by name) azure_rm_virtualmachine_info: @@ -62,7 +63,7 @@ register: vm_facts_results - name: Ensure facts module returned the second VM - assert: + ansible.builtin.assert: that: - vm_facts_results.vms | length == 1 - vm_facts_results.vms[0].name == "{{ vm_name }}" @@ -78,7 +79,7 @@ register: facts_by_tags_results - name: Assert that facts module returned the second VM - assert: + ansible.builtin.assert: that: - facts_by_tags_results.vms | length >= 1 @@ -101,14 +102,14 @@ network_interfaces: "{{ nic_list }}" availability_set: "{{ availability_set }}" image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal publisher: Canonical - sku: 16.04-LTS + sku: 20_04-lts version: latest register: dual_nics_result - name: Ensure nothing changed - assert: + ansible.builtin.assert: that: dual_nics_result is not changed - name: Get VM facts @@ -118,13 +119,14 @@ register: vm_state - name: Pause for 10 mimutes to VM updating - shell: sleep 600 + ansible.builtin.command: sleep 600 + changed_when: true - name: Generalize VM azure_rm_virtualmachine: resource_group: "{{ resource_group }}" # Should this be resource_group_secondary? name: "{{ vm_name }}" - generalized: yes + generalized: true - name: Gather facts and check if machine is generalized azure_rm_virtualmachine_info: @@ -133,7 +135,7 @@ register: generalized_output - name: Ensure power state is generalized - assert: + ansible.builtin.assert: that: generalized_output.vms[0].power_state == 'generalized' - name: Delete dual NIC VM diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_ephemeral_os.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_ephemeral_os.yml index 4169333b9..1b18c71ef 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_ephemeral_os.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_ephemeral_os.yml @@ -1,6 +1,7 @@ -- include_tasks: setup.yml +- name: Set variables + ansible.builtin.include_tasks: setup.yml -- name: create proximity placement group +- name: Create proximity placement group azure_rm_proximityplacementgroup: resource_group: "{{ resource_group }}" name: testproximityplacement @@ -19,9 +20,9 @@ key_data: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfoYlIV4lTPZTv7hXaVwQQuqBgGs4yeNRX0SPo2+HQt9u4X7IGwrtXc0nEUm6LfaCikMH58bOL8f20NTGz285kxdFHZRcBXtqmnMz2rXwhK9gwq5h1khc+GzHtdcJXsGA4y0xuaNcidcg04jxAlN/06fwb/VYwwWTVbypNC0gpGEpWckCNm8vlDlA55sU5et0SZ+J0RKVvEaweUOeNbFZqckGPA384imfeYlADppK/7eAxqfBVadVvZG8IJk4yvATgaIENIFj2cXxqu2mQ/Bp5Wr45uApvJsFXmi+v/nkiOEV1QpLOnEwAZo6EfFS4CCQtsymxJCl1PxdJ5LD4ZOtP xiuxi.sun@qq.com" vm_size: Standard_DS2_v2 image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal publisher: Canonical - sku: 16.04-LTS + sku: 20_04-lts version: latest register: vm_output @@ -32,13 +33,14 @@ register: vm_state - name: Pause for 10 mimutes to VM updating - shell: sleep 600 + ansible.builtin.command: sleep 600 + changed_when: true - name: Generalize VM azure_rm_virtualmachine: resource_group: "{{ resource_group }}" name: "{{ vm_name }}" - generalized: yes + generalized: true - name: Create an image from VM azure_rm_image: @@ -48,7 +50,8 @@ os_type: Linux register: output -- assert: +- name: Assert the VM created + ansible.builtin.assert: that: - output.changed @@ -63,11 +66,12 @@ key_data: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfoYlIV4lTPZTv7hXaVwQQuqBgGs4yeNRX0SPo2+HQt9u4X7IGwrtXc0nEUm6LfaCikMH58bOL8f20NTGz285kxdFHZRcBXtqmnMz2rXwhK9gwq5h1khc+GzHtdcJXsGA4y0xuaNcidcg04jxAlN/06fwb/VYwwWTVbypNC0gpGEpWckCNm8vlDlA55sU5et0SZ+J0RKVvEaweUOeNbFZqckGPA384imfeYlADppK/7eAxqfBVadVvZG8IJk4yvATgaIENIFj2cXxqu2mQ/Bp5Wr45uApvJsFXmi+v/nkiOEV1QpLOnEwAZo6EfFS4CCQtsymxJCl1PxdJ5LD4ZOtP xiuxi.sun@qq.com" vm_size: Standard_DS2_v2 os_disk_caching: ReadOnly - ephemeral_os_disk: True + ephemeral_os_disk: true image: testimage register: output -- assert: +- name: Assert the vm created + ansible.builtin.assert: that: - output.changed - output.ansible_facts.azure_vm.properties.storageProfile.osDisk.diffDiskSettings.option == 'Local' @@ -83,11 +87,12 @@ key_data: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfoYlIV4lTPZTv7hXaVwQQuqBgGs4yeNRX0SPo2+HQt9u4X7IGwrtXc0nEUm6LfaCikMH58bOL8f20NTGz285kxdFHZRcBXtqmnMz2rXwhK9gwq5h1khc+GzHtdcJXsGA4y0xuaNcidcg04jxAlN/06fwb/VYwwWTVbypNC0gpGEpWckCNm8vlDlA55sU5et0SZ+J0RKVvEaweUOeNbFZqckGPA384imfeYlADppK/7eAxqfBVadVvZG8IJk4yvATgaIENIFj2cXxqu2mQ/Bp5Wr45uApvJsFXmi+v/nkiOEV1QpLOnEwAZo6EfFS4CCQtsymxJCl1PxdJ5LD4ZOtP xiuxi.sun@qq.com" vm_size: Standard_DS2_v2 os_disk_caching: ReadOnly - ephemeral_os_disk: True + ephemeral_os_disk: true image: testimage register: output -- assert: +- name: Assert idempotent + ansible.builtin.assert: that: - not output.changed @@ -102,12 +107,13 @@ key_data: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfoYlIV4lTPZTv7hXaVwQQuqBgGs4yeNRX0SPo2+HQt9u4X7IGwrtXc0nEUm6LfaCikMH58bOL8f20NTGz285kxdFHZRcBXtqmnMz2rXwhK9gwq5h1khc+GzHtdcJXsGA4y0xuaNcidcg04jxAlN/06fwb/VYwwWTVbypNC0gpGEpWckCNm8vlDlA55sU5et0SZ+J0RKVvEaweUOeNbFZqckGPA384imfeYlADppK/7eAxqfBVadVvZG8IJk4yvATgaIENIFj2cXxqu2mQ/Bp5Wr45uApvJsFXmi+v/nkiOEV1QpLOnEwAZo6EfFS4CCQtsymxJCl1PxdJ5LD4ZOtP xiuxi.sun@qq.com" vm_size: Standard_DS2_v2 os_disk_caching: ReadOnly - ephemeral_os_disk: False + ephemeral_os_disk: false image: testimage - ignore_errors: yes + ignore_errors: true register: ouput -- assert: +- name: Assert the vm updated + ansible.builtin.assert: that: - not output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_image_latest.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_image_latest.yml index 812ef48d3..54e070d69 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_image_latest.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_image_latest.yml @@ -1,15 +1,16 @@ -- include_tasks: setup.yml +- name: Set variables + ansible.builtin.include_tasks: setup.yml -- name: List available versions for UbuntuServer image +- name: List available versions for 0001-com-ubuntu-server-focal image azure_rm_virtualmachineimage_info: location: eastus publisher: Canonical - offer: UbuntuServer - sku: 16.04-LTS + offer: 0001-com-ubuntu-server-focal + sku: 20_04-lts register: image_list -- name: Get latest UbuntuServer image name - set_fact: +- name: Get latest 0001-com-ubuntu-server-focal image name + ansible.builtin.set_fact: latest_image_name: "{{ (image_list['vmimages'] | map(attribute='name') | sort(reverse=True))[0] }}" - name: Create minimal VM with defaults @@ -24,14 +25,14 @@ vm_size: Standard_B1ms virtual_network: "{{ network_name }}" image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal publisher: Canonical - sku: 16.04-LTS + sku: 20_04-lts version: latest register: vm_output -- name: Ensure VM was created using the latest UbuntuServer image version / name - assert: +- name: Ensure VM was created using the latest 0001-com-ubuntu-server-focal image version / name + ansible.builtin.assert: that: - vm_output.azure_vm.properties.storageProfile.imageReference.version == latest_image_name @@ -65,5 +66,5 @@ azure_rm_storageaccount: resource_group: "{{ resource_group }}" name: "{{ storage_account }}" - force_delete_nonempty: yes + force_delete_nonempty: true state: absent diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_image_specific.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_image_specific.yml index 12fc28154..6f7d21386 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_image_specific.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_image_specific.yml @@ -1,7 +1,8 @@ -- include_tasks: setup.yml +- name: Set variables + ansible.builtin.include_tasks: setup.yml -- name: Set specific UbuntuServer image version - set_fact: +- name: Set specific 0001-com-ubuntu-server-focal image version + ansible.builtin.set_fact: specific_image_name: "16.04.202104140" - name: Create minimal VM with defaults @@ -16,14 +17,14 @@ vm_size: Standard_B1ms virtual_network: "{{ network_name }}" image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal publisher: Canonical - sku: 16.04-LTS + sku: 20_04-lts version: "{{ specific_image_name }}" register: vm_output -- name: Ensure VM was created using the specific UbuntuServer image version / name - assert: +- name: Ensure VM was created using the specific 0001-com-ubuntu-server-focal image version / name + ansible.builtin.assert: that: - vm_output.azure_vm.properties.storageProfile.imageReference.version == specific_image_name @@ -57,5 +58,5 @@ azure_rm_storageaccount: resource_group: "{{ resource_group }}" name: "{{ storage_account }}" - force_delete_nonempty: yes + force_delete_nonempty: true state: absent diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_invalid.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_invalid.yml index 86ec72de1..e4bc5b3db 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_invalid.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_invalid.yml @@ -4,7 +4,7 @@ resource_group: "{{ resource_group }}" name: "{{ vm_name }}" image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal register: fail_invalid_image_dict failed_when: 'fail_invalid_image_dict.msg != "parameter error: expecting image to contain [publisher, offer, sku, version], [name, resource_group] or [id]"' diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_minimal.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_minimal.yml index 750cbe0b4..bf6035750 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_minimal.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_minimal.yml @@ -1,4 +1,5 @@ -- include_tasks: setup.yml +- name: Set variables + ansible.builtin.include_tasks: setup.yml # # Tests possible when CI user acccount setup with required authority # - name: Create virtual machine with image and plan which requires acceptance of terms @@ -18,7 +19,7 @@ # plan_paid: "{{ plan_paid }}" # register: create_image_plan_result -# - assert: +# - ansible.builtin.assert: # that: # - create_image_plan_result is changed # - create_image_plan_result.ansible_facts.azure_vm.properties.storageProfile.imageReference.publisher == image_paid.publisher @@ -40,7 +41,7 @@ # plan_paid: "{{ plan_paid }}" # register: create_image_plan_again_result -# - assert: +# - ansible.builtin.assert: # that: create_image_plan_again is not changed - name: Create minimal VM with defaults @@ -55,9 +56,9 @@ vm_size: Standard_B1ms virtual_network: "{{ network_name }}" image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal publisher: Canonical - sku: 16.04-LTS + sku: 20_04-lts version: latest register: vm_output @@ -68,7 +69,7 @@ register: nsg_result - name: Assert that security group were exist before deleting - assert: + ansible.builtin.assert: that: - nsg_result.securitygroups | length == 1 - nsg_result.securitygroups[0].network_interfaces | length == 1 @@ -99,7 +100,7 @@ register: pip_result - name: Assert that autocreated resources were deleted - assert: + ansible.builtin.assert: that: # what about the default storage group? - nic_result.networkinterfaces | length == 0 @@ -129,5 +130,5 @@ azure_rm_storageaccount: resource_group: "{{ resource_group }}" name: "{{ storage_account }}" - force_delete_nonempty: yes + force_delete_nonempty: true state: absent diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_minimal_manageddisk.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_minimal_manageddisk.yml index 27274b0de..423baa71c 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_minimal_manageddisk.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_minimal_manageddisk.yml @@ -38,14 +38,14 @@ vm_size: Standard_D4s_v3 virtual_network: "{{ network_name }}-disk" image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal publisher: Canonical - sku: 16.04-LTS + sku: 20_04-lts version: latest register: vm_output - name: Assert status succeeded - assert: + ansible.builtin.assert: that: - vm_output.changed @@ -62,6 +62,7 @@ name: "{{ interface_name }}-disk" state: absent ignore_errors: true + register: ignore_errors_register - name: Delete network security group azure_rm_securitygroup: diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_no_nsg.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_no_nsg.yml index 7b88dd8d8..62a8e16fe 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_no_nsg.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_no_nsg.yml @@ -1,4 +1,5 @@ -- include_tasks: setup.yml +- name: Set variables + ansible.builtin.include_tasks: setup.yml - name: Create minimal VM with defaults azure_rm_virtualmachine: @@ -13,9 +14,9 @@ virtual_network: "{{ network_name }}" created_nsg: false image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal publisher: Canonical - sku: 16.04-LTS + sku: 20_04-lts version: latest register: vm_output @@ -26,7 +27,7 @@ register: nsg_result - name: Assert that security group were not exist before deleting - assert: + ansible.builtin.assert: that: - nsg_result.securitygroups | length == 0 @@ -50,7 +51,7 @@ register: pip_result - name: Assert that autocreated resources were deleted - assert: + ansible.builtin.assert: that: # what about the default storage group? - nic_result.networkinterfaces | length == 0 @@ -79,5 +80,5 @@ azure_rm_storageaccount: resource_group: "{{ resource_group }}" name: "{{ storage_account }}" - force_delete_nonempty: yes + force_delete_nonempty: true state: absent diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_no_public_ip.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_no_public_ip.yml index 5b41a6eb9..bcec8da62 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_no_public_ip.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_no_public_ip.yml @@ -1,4 +1,5 @@ -- include_tasks: setup.yml +- name: Set variables + ansible.builtin.include_tasks: setup.yml - name: Create virtual machine without public ip address and with boot diagnostics enabled azure_rm_virtualmachine: @@ -17,22 +18,22 @@ availability_set: "{{ availability_set }}" virtual_network: "{{ network_name }}" boot_diagnostics: - enabled: yes + enabled: true image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal publisher: Canonical - sku: 16.04-LTS + sku: 20_04-lts version: latest register: create_vm_public_result - name: Ensure VM was created properly - assert: + ansible.builtin.assert: that: - - azure_vm.properties.diagnosticsProfile.bootDiagnostics.enabled - - azure_vm.properties.diagnosticsProfile.bootDiagnostics.storageUri is defined - - azure_vm.properties.instanceView.bootDiagnostics.consoleScreenshotBlobUri is defined - - azure_vm.properties.instanceView.bootDiagnostics.serialConsoleLogBlobUri is defined - - not 'publicIPAddress' in create_vm_public_result.ansible_facts.azure_vm.properties.networkProfile.networkInterfaces[0].properties.ipConfigurations[0].properties + - azure_vm.diagnostics_profile.boot_diagnostics.enabled + - azure_vm.diagnostics_profile.boot_diagnostics.storage_uri is defined + - azure_vm.instance_view.boot_diagnostics.console_screenshot_blob_uri is defined + - azure_vm.instance_view.boot_diagnostics.serial_console_log_blob_uri is defined + - not 'public_ip_address' in create_vm_public_result.ansible_facts.azure_vm.network_profile.network_interfaces[0].properties.ip_configurations[0] - name: Delete VM with no public ip azure_rm_virtualmachine: diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_public_ip.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_public_ip.yml index 6e3e47ea1..2ee786b34 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_public_ip.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_public_ip.yml @@ -1,4 +1,5 @@ -- include_tasks: setup.yml +- name: Set variables + ansible.builtin.include_tasks: setup.yml - name: Create public ip azure_rm_publicipaddress: @@ -10,7 +11,7 @@ azure_rm_securitygroup: resource_group: "{{ resource_group }}" name: "{{ security_group }}" - purge_rules: yes + purge_rules: true rules: - name: ALLOW_SSH protocol: Tcp @@ -54,23 +55,23 @@ network_interfaces: "{{ interface_name }}" availability_set: "{{ availability_set }}" image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal publisher: Canonical - sku: 16.04-LTS + sku: 20_04-lts version: latest custom_data: | #!/bin/sh echo "custom_data was executed" > /tmp/custom_data.txt - name: Ensure VM was created properly - assert: + ansible.builtin.assert: that: - - azure_vm.properties.provisioningState == 'Succeeded' - - azure_vm.properties.availabilitySet.id + - azure_vm.provisioning_state == 'Succeeded' + - azure_vm.availability_set.id # initial response from creation has no diagnosticsProfile # if you run it again however, there is one in the response # so we handle both cases - - "'diagnosticsProfile' not in azure_vm.properties or not azure_vm.properties.diagnosticsProfile.bootDiagnostics.enabled" + - "'diagnostics_profile' not in azure_vm or not azure_vm.diagnostics_profile.boot_diagnostics.enabled" - name: Get facts for virtual machine without boot diagnostics disabled azure_rm_virtualmachine_info: @@ -79,7 +80,7 @@ register: vm_facts_no_boot_diag_result - name: Ensure VM facts are correct - assert: + ansible.builtin.assert: that: - vm_facts_no_boot_diag_result.vms != [] - not vm_facts_no_boot_diag_result.vms[0].boot_diagnostics.enabled @@ -92,23 +93,24 @@ register: vm_state - name: Pause for 10 mimutes to VM updating - shell: sleep 600 + ansible.builtin.command: sleep 600 + changed_when: true - name: Enable boot diagnostics on an existing VM for the first time without specifying a storage account azure_rm_virtualmachine: resource_group: "{{ resource_group }}" name: "{{ vm_name }}" boot_diagnostics: - enabled: yes + enabled: true # without specifying storage_account you get a new default storage account for the VM - name: Ensure VM properties are correct - assert: + ansible.builtin.assert: that: - - azure_vm.properties.diagnosticsProfile.bootDiagnostics.enabled - - azure_vm.properties.diagnosticsProfile.bootDiagnostics.storageUri is defined - - azure_vm.properties.instanceView.bootDiagnostics.consoleScreenshotBlobUri is defined - - azure_vm.properties.instanceView.bootDiagnostics.serialConsoleLogBlobUri is defined + - azure_vm.diagnostics_profile.boot_diagnostics.enabled + - azure_vm.diagnostics_profile.boot_diagnostics.storage_uri is defined + - azure_vm.instance_view.boot_diagnostics.console_screenshot_blob_uri is defined + - azure_vm.instance_view.boot_diagnostics.serial_console_log_blob_uri is defined - name: Get facts for virtual machine with boot diagnostics enabled azure_rm_virtualmachine_info: @@ -117,7 +119,7 @@ register: vm_facts_boot_diag_result - name: Ensure VM facts were returned - assert: + ansible.builtin.assert: that: - vm_facts_boot_diag_result.vms != [] - vm_facts_boot_diag_result.vms[0].boot_diagnostics.enabled @@ -130,38 +132,39 @@ resource_group: "{{ resource_group }}" name: "{{ vm_name }}" boot_diagnostics: - enabled: yes + enabled: true storage_account: "{{ storage_account }}" - ignore_errors: yes + ignore_errors: true + register: ignore_errors_register - name: Disable boot diagnostics and change the storage account at the same time azure_rm_virtualmachine: - resource_group: "{{ resource_group }}" - name: "{{ vm_name }}" - boot_diagnostics: - enabled: no - storage_account: "{{ storage_account }}" + resource_group: "{{ resource_group }}" + name: "{{ vm_name }}" + boot_diagnostics: + enabled: false + storage_account: "{{ storage_account }}" - name: Ensure boot diagnostics was disabled - assert: + ansible.builtin.assert: that: - - not azure_vm.properties.diagnosticsProfile.bootDiagnostics.enabled + - not azure_vm.diagnostics_profile.boot_diagnostics.enabled - name: Re-enable boot diagnostics on an existing VM where it was previously configured azure_rm_virtualmachine: - resource_group: "{{ resource_group }}" - name: "{{ vm_name }}" - boot_diagnostics: - enabled: yes + resource_group: "{{ resource_group }}" + name: "{{ vm_name }}" + boot_diagnostics: + enabled: true register: reenable_boot_diag_result - name: Ensure boot diagnostics was reenabled - assert: + ansible.builtin.assert: that: - - azure_vm.properties.diagnosticsProfile.bootDiagnostics.enabled - - azure_vm.properties.diagnosticsProfile.bootDiagnostics.storageUri is defined - - azure_vm.properties.instanceView.bootDiagnostics.consoleScreenshotBlobUri is defined - - azure_vm.properties.instanceView.bootDiagnostics.serialConsoleLogBlobUri is defined + - azure_vm.diagnostics_profile.boot_diagnostics.enabled + - azure_vm.diagnostics_profile.boot_diagnostics.storage_uri is defined + - azure_vm.instance_view.boot_diagnostics.console_screenshot_blob_uri is defined + - azure_vm.instance_view.boot_diagnostics.serial_console_log_blob_uri is defined # - add_host: # name: new_azure_vm @@ -188,8 +191,8 @@ # raw: cat /tmp/custom_data.txt # register: custom_data_content -# - name: assert contents -# assert: +# - name: ansible.builtin.assert contents +# ansible.builtin.assert: # that: custom_data_content.stdout | regex_search('custom_data was executed') # delegate_to: new_azure_vm @@ -220,14 +223,14 @@ os_type: Linux network_interfaces: "{{ interface_name }}" image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal publisher: Canonical - sku: 16.04-LTS + sku: 20_04-lts version: latest register: single_nic_result - name: Ensure nothing changed - assert: + ansible.builtin.assert: that: single_nic_result is not changed - name: Resize VM @@ -247,17 +250,17 @@ os_type: Linux network_interfaces: "{{ interface_name }}" image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal publisher: Canonical - sku: 16.04-LTS + sku: 20_04-lts version: latest register: resize_result - name: Esure VM was resized - assert: + ansible.builtin.assert: that: - resize_result is changed - - resize_result.ansible_facts.azure_vm.properties.hardwareProfile.vmSize == "Standard_A1" + - resize_result.ansible_facts.azure_vm.hardware_profile.vm_size == "Standard_A1" - name: Delete VM azure_rm_virtualmachine: @@ -273,7 +276,7 @@ register: output - name: Ensure NIC was removed - assert: + ansible.builtin.assert: that: output.networkinterfaces | length == 0 - name: Public IP should be gone @@ -283,7 +286,7 @@ register: output - name: Ensure public IP was removed - assert: + ansible.builtin.assert: that: output.publicipaddresses | length == 0 - name: Destroy NIC diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_spot.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_spot.yml index a967e050d..43944e511 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_spot.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_spot.yml @@ -1,4 +1,5 @@ -- include_tasks: setup.yml +- name: Set variables + ansible.builtin.include_tasks: setup.yml - name: Create minimal VM with Spot Instance default values azure_rm_virtualmachine: @@ -21,7 +22,7 @@ register: vm_output - name: Ensure VM was created using Spot Instance default values - assert: + ansible.builtin.assert: that: - azure_vm.properties.priority == 'Spot' - azure_vm.properties.evictionPolicy == 'Deallocate' @@ -56,7 +57,7 @@ register: vm_output - name: Ensure VM was created using custom spot instance values - assert: + ansible.builtin.assert: that: - azure_vm.properties.priority == 'Spot' - azure_vm.properties.evictionPolicy == 'Delete' @@ -80,4 +81,4 @@ azure_rm_virtualnetwork: resource_group: "{{ resource_group }}" name: "{{ network_name }}" - state: absent
\ No newline at end of file + state: absent diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_vm_identity.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_vm_identity.yml new file mode 100644 index 000000000..c39cc10d1 --- /dev/null +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_vm_identity.yml @@ -0,0 +1,209 @@ +- name: Create virtual network + azure_rm_virtualnetwork: + resource_group: "{{ resource_group }}" + name: "{{ network_name }}-identity" + address_prefixes: "{{ network }}" + location: westeurope + +- name: Create subnet + azure_rm_subnet: + resource_group: "{{ resource_group }}" + name: "{{ subnet_name }}" + address_prefix: "{{ subnet }}" + virtual_network: "{{ network_name }}-identity" + +- name: Create network interface + azure_rm_networkinterface: + resource_group: "{{ resource_group }}" + name: "{{ interface_name }}-identity" + virtual_network: "{{ network_name }}-identity" + subnet: "{{ subnet_name }}" + location: westeurope + +- name: Create User Managed Identities + azure_rm_resource: + resource_group: "{{ resource_group }}" + provider: ManagedIdentity + resource_type: userAssignedIdentities + resource_name: "{{ item }}" + api_version: "2023-01-31" + body: + location: westeurope + state: present + loop: + - "ansible-test-vm-identity" + - "ansible-test-vm-identity-2" + +- name: Set identities IDs to test. Identities ansible-test-vm-identity and ansible-test-vm-identity-2 have to be created previously + ansible.builtin.set_fact: + user_identity_1: "/subscriptions/{{ azure_subscription_id }}/resourcegroups/{{ resource_group }}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ansible-test-vm-identity" + user_identity_2: "/subscriptions/{{ azure_subscription_id }}/resourcegroups/{{ resource_group }}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ansible-test-vm-identity-2" + +- name: Create minimal VM with UserAssigned Identity + azure_rm_virtualmachine: + allocated: false + resource_group: "{{ resource_group }}" + name: "{{ vm_name }}" + vm_identity: + type: UserAssigned + user_assigned_identities: + id: + - "{{ user_identity_1 }}" + admin_username: "testuser" + ssh_password_enabled: false + public_ip_allocation_method: Disabled + location: westeurope + network_interface_names: + - name: "{{ interface_name }}-identity" + resource_group: "{{ resource_group }}" + ssh_public_keys: + - path: /home/testuser/.ssh/authorized_keys + key_data: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfoYlIV4lTPZTv7hXaVwQQuqBgGs4yeNRX0SPo2+HQt9u4X7IGwrtXc0nEUm6LfaCikMH58bOL8f20NTGz285kxdFHZRcBXtqmnMz2rXwhK9gwq5h1khc+GzHtdcJXsGA4y0xuaNcidcg04jxAlN/06fwb/VYwwWTVbypNC0gpGEpWckCNm8vlDlA55sU5et0SZ+J0RKVvEaweUOeNbFZqckGPA384imfeYlADppK/7eAxqfBVadVvZG8IJk4yvATgaIENIFj2cXxqu2mQ/Bp5Wr45uApvJsFXmi+v/nkiOEV1QpLOnEwAZo6EfFS4CCQtsymxJCl1PxdJ5LD4ZOtP xiuxi.sun@qq.com" + vm_size: Standard_D4s_v3 + virtual_network: "{{ network_name }}-identity" + image: + offer: 0001-com-ubuntu-server-focal + publisher: Canonical + sku: 20_04-lts + version: latest + register: vm_output + +- name: Assert User identity assigned + ansible.builtin.assert: + that: + - vm_output.ansible_facts.azure_vm.identity.type == 'UserAssigned' + - "\"{{ user_identity_1 }}\" in vm_output.ansible_facts.azure_vm.identity.user_assigned_identities" + +- name: Append another UserAssigned + azure_rm_virtualmachine: + name: "{{ vm_name }}" + resource_group: "{{ resource_group }}" + vm_identity: + type: "UserAssigned" + user_assigned_identities: + id: + - "{{ user_identity_2 }}" + append: true + register: vm_output + +- name: Assert appended user identity + ansible.builtin.assert: + that: + - vm_output.ansible_facts.azure_vm.identity.type == 'UserAssigned' + - "\"{{ user_identity_1 }}\" in vm_output.ansible_facts.azure_vm.identity.user_assigned_identities" + - "\"{{ user_identity_2 }}\" in vm_output.ansible_facts.azure_vm.identity.user_assigned_identities" + +- name: Add SystemAssigned + azure_rm_virtualmachine: + name: "{{ vm_name }}" + resource_group: "{{ resource_group }}" + vm_identity: + type: "SystemAssigned, UserAssigned" + user_assigned_identities: + append: true + register: vm_output + +- name: Assert System identity assigned + ansible.builtin.assert: + that: + - vm_output.ansible_facts.azure_vm.identity.type == 'SystemAssigned, UserAssigned' + - "\"{{ user_identity_1 }}\" in vm_output.ansible_facts.azure_vm.identity.user_assigned_identities" + - "\"{{ user_identity_2 }}\" in vm_output.ansible_facts.azure_vm.identity.user_assigned_identities" + +- name: Force only one UserAssigned + azure_rm_virtualmachine: + name: "{{ vm_name }}" + resource_group: "{{ resource_group }}" + vm_identity: + type: "SystemAssigned, UserAssigned" + user_assigned_identities: + id: + - "{{ user_identity_2 }}" + append: false + register: vm_output + +- name: Assert appended user identity + ansible.builtin.assert: + that: + - vm_output.ansible_facts.azure_vm.identity.type == 'SystemAssigned, UserAssigned' + - "\"{{ user_identity_1 }}\" not in vm_output.ansible_facts.azure_vm.identity.user_assigned_identities" + - "\"{{ user_identity_2 }}\" in vm_output.ansible_facts.azure_vm.identity.user_assigned_identities" + +- name: Remove UserAssigned + azure_rm_virtualmachine: + name: "{{ vm_name }}" + resource_group: "{{ resource_group }}" + vm_identity: + type: "SystemAssigned" + register: vm_output + +- name: Assert removed user identities + ansible.builtin.assert: + that: + - vm_output.ansible_facts.azure_vm.identity.type == 'SystemAssigned' + - "'user_assigned_identities' not in vm_output.ansible_facts.azure_vm.identity" + +- name: Disable SystemAssigned + azure_rm_virtualmachine: + name: "{{ vm_name }}" + resource_group: "{{ resource_group }}" + vm_identity: + type: "None" + register: vm_output + +- name: Assert no managed identities + ansible.builtin.assert: + that: + - "'identity' not in vm_output.ansible_facts.azure_vm" + +- name: Delete VM + azure_rm_virtualmachine: + resource_group: "{{ resource_group }}" + name: "{{ vm_name }}" + remove_on_absent: all_autocreated + state: absent + +- name: Destroy NIC + azure_rm_networkinterface: + resource_group: "{{ resource_group }}" + name: "{{ interface_name }}-identity" + state: absent + ignore_errors: true + register: ignore_errors_register + +- name: Delete network security group + azure_rm_securitygroup: + resource_group: "{{ resource_group }}" + name: "{{ interface_name }}-identity" + state: absent + +- name: Destroy subnet + azure_rm_subnet: + resource_group: "{{ resource_group }}" + virtual_network: "{{ network_name }}" + name: "{{ subnet_name }}-identity" + state: absent + +- name: Destroy virtual network + azure_rm_virtualnetwork: + resource_group: "{{ resource_group }}" + name: "{{ network_name }}-identity" + state: absent + +- name: Destroy SA of the machine + azure_rm_storageaccount: + resource_group: "{{ resource_group }}" + name: "{{ vm_output.ansible_facts.azure_vm.tags._own_sa_ }}" + state: absent + +- name: Destroy User Managed Identities + azure_rm_resource: + resource_group: "{{ resource_group }}" + provider: ManagedIdentity + resource_type: userAssignedIdentities + resource_name: "{{ item }}" + api_version: "2023-01-31" + state: absent + loop: + - "ansible-test-vm-identity" + - "ansible-test-vm-identity-2" diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/setup.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/setup.yml index f053cac03..a14fa7eff 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/setup.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachine/tasks/setup.yml @@ -1,4 +1,5 @@ -- debug: +- name: Set variables + ansible.builtin.debug: msg: "UID is {{ uid_short }}" - name: SETUP | Create storage account diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachineextension/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachineextension/tasks/main.yml index a4a1e62ee..e053cf0b8 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachineextension/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachineextension/tasks/main.yml @@ -1,5 +1,5 @@ - name: Create Random Storage Account Name - set_fact: + ansible.builtin.set_fact: storage_account: "vme{{ resource_group | hash('md5') | truncate(21, True, '') }}" public_settings_file: "files/test-public-settings.json" protected_settings_file: "files/test-protected-settings.json" @@ -44,7 +44,7 @@ public_ip_name: testPublicIP security_group_name: testNetworkSecurityGroup -- name: create a storage account +- name: Create a storage account azure_rm_storageaccount: resource_group: "{{ resource_group }}" name: "{{ storage_account }}" @@ -84,7 +84,7 @@ settings: {"commandToExecute": "date"} register: results - name: Assert that VM Extension ran - assert: + ansible.builtin.assert: that: results.changed - name: Query extension @@ -94,7 +94,7 @@ virtual_machine_name: testVM register: results - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - results.changed == False - results.extensions[0]['id'] != None @@ -120,7 +120,7 @@ settings: {"commandToExecute": "date"} register: results - name: Assert no updates - assert: + ansible.builtin.assert: that: not results.changed - name: Create VM Extension (force update) @@ -136,7 +136,7 @@ force_update_tag: true register: results - name: Assert updates - assert: + ansible.builtin.assert: that: results.changed - name: List extensions @@ -145,7 +145,7 @@ virtual_machine_name: testVM register: results - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - results.changed == False - results.extensions[0]['id'] != None @@ -167,7 +167,7 @@ state: absent register: results - name: Assert that VM Extension deleted - assert: + ansible.builtin.assert: that: results.changed - name: Delete VM Extension (idempotent) @@ -178,7 +178,7 @@ state: absent register: results - name: Assert no changes - assert: + ansible.builtin.assert: that: not results.changed - name: Create VM Extension to configure python required for VM diagnostic extension @@ -193,7 +193,7 @@ settings: {"commandToExecute": "apt-get update && apt-get install -y python2 && update-alternatives --install /usr/bin/python python /usr/bin/python2 1"} register: results - name: Assert that VM Extension ran - assert: + ansible.builtin.assert: that: results.changed - name: Install VM Extension for diagnostics @@ -209,7 +209,7 @@ protected_settings: "{{ lookup('file', protected_settings_file) }}" register: results - name: Assert extension installed - assert: + ansible.builtin.assert: that: results.changed - name: Install VM Extension for diagnostics (idempotent) @@ -225,7 +225,7 @@ protected_settings: "{{ lookup('file', protected_settings_file) }}" register: results - name: Assert no updates - assert: + ansible.builtin.assert: that: not results.changed - name: List extensions @@ -234,7 +234,7 @@ virtual_machine_name: testVM register: results - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - results.changed == False - results.extensions | length >= 2 diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachineimage_info/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachineimage_info/tasks/main.yml index 88fd5ce19..8252214a4 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachineimage_info/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachineimage_info/tasks/main.yml @@ -1,5 +1,5 @@ -- name: set location - set_fact: +- name: Set location + ansible.builtin.set_fact: location: eastus - name: Get facts for a specific image @@ -11,8 +11,9 @@ version: '7.5.201808150' register: output -- assert: - that: output['vmimages'] | length == 1 +- name: Assert the image facts + ansible.builtin.assert: + that: output['vmimages'] | length == 1 - name: List available versions azure_rm_virtualmachineimage_info: @@ -22,8 +23,9 @@ sku: '7.5' register: output -- assert: - that: output['vmimages'] | length > 0 +- name: Assert all image version facts + ansible.builtin.assert: + that: output['vmimages'] | length > 0 - name: List available offers azure_rm_virtualmachineimage_info: @@ -31,16 +33,18 @@ publisher: OpenLogic register: output -- assert: - that: output['vmimages'] | length > 0 +- name: Assert image facts + ansible.builtin.assert: + that: output['vmimages'] | length > 0 - name: List available publishers azure_rm_virtualmachineimage_info: location: "{{ location }}" register: output -- assert: - that: output['vmimages'] | length > 0 +- name: Assert image facts + ansible.builtin.assert: + that: output['vmimages'] | length > 0 - name: Get facts for a specific image's latest version azure_rm_virtualmachineimage_info: @@ -51,5 +55,6 @@ version: 'latest' register: output -- assert: - that: output['vmimages'] | length == 1
\ No newline at end of file +- name: Assert image facts + ansible.builtin.assert: + that: output['vmimages'] | length == 1 diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachinescaleset/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachinescaleset/tasks/main.yml index d027146c2..98f51ee9f 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachinescaleset/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachinescaleset/tasks/main.yml @@ -1,7 +1,7 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - run_once: yes + run_once: true - name: Create virtual network azure_rm_virtualnetwork: @@ -69,9 +69,9 @@ vm_size: Standard_B1ms network_interfaces: "vmforimage{{ rpfx }}nic" image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal publisher: Canonical - sku: 18.04-LTS + sku: 20_04-lts version: latest - name: Get VM facts azure_rm_virtualmachine_info: @@ -79,12 +79,13 @@ name: "vmforimage{{ rpfx }}" register: vm_state - name: Pause for 10 mimutes to VM updating - shell: sleep 600 + ansible.builtin.command: sleep 600 + changed_when: true - name: Generalize VM azure_rm_virtualmachine: resource_group: "{{ resource_group }}" name: "vmforimage{{ rpfx }}" - generalized: yes + generalized: true - name: Create image A azure_rm_image: resource_group: "{{ resource_group }}" @@ -107,9 +108,9 @@ name: testVMSS{{ rpfx }} vm_size: Standard_A1_v2 admin_username: testuser - single_placement_group: False + single_placement_group: false platform_fault_domain_count: 1 - public_ip_per_vm: True + public_ip_per_vm: true ssh_password_enabled: false ssh_public_keys: - path: /home/testuser/.ssh/authorized_keys @@ -120,9 +121,9 @@ orchestration_mode: Flexible os_disk_caching: ReadWrite image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal publisher: Canonical - sku: 18.04-LTS + sku: 20_04-lts version: latest data_disks: - lun: 0 @@ -132,7 +133,7 @@ register: results - name: Assert that VMSS can be created - assert: + ansible.builtin.assert: that: results.changed - name: Create VMSS with I(orchestration_mode=Flexible) again --- Idempotent @@ -141,9 +142,9 @@ name: testVMSS{{ rpfx }} vm_size: Standard_A1_v2 admin_username: testuser - single_placement_group: False + single_placement_group: false platform_fault_domain_count: 1 - public_ip_per_vm: True + public_ip_per_vm: true ssh_password_enabled: false ssh_public_keys: - path: /home/testuser/.ssh/authorized_keys @@ -154,9 +155,9 @@ orchestration_mode: Flexible os_disk_caching: ReadWrite image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal publisher: Canonical - sku: 18.04-LTS + sku: 20_04-lts version: latest data_disks: - lun: 0 @@ -166,7 +167,7 @@ register: results - name: Assert that VMSS can be created - assert: + ansible.builtin.assert: that: not results.changed - name: Retrieve scaleset VMSS fact @@ -175,9 +176,10 @@ resource_group: "{{ resource_group }}" register: output_scaleset -- assert: +- name: Assert vmss facts + ansible.builtin.assert: that: - - output_scaleset.vmss[0].properties.orchestrationMode == "Flexible" + - output_scaleset.vmss[0].orchestration_mode == "Flexible" - name: Delete VMSS azure_rm_virtualmachinescaleset: @@ -193,7 +195,7 @@ admin_username: testuser priority: Spot eviction_policy: Deallocate - single_placement_group: True + single_placement_group: true ssh_password_enabled: false ssh_public_keys: - path: /home/testuser/.ssh/authorized_keys @@ -206,9 +208,9 @@ managed_disk_type: Standard_LRS os_disk_caching: ReadWrite image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal publisher: Canonical - sku: 18.04-LTS + sku: 20_04-lts version: latest data_disks: - lun: 0 @@ -218,11 +220,11 @@ register: results - name: Assert that VMSS was created using Spot Instance default values - assert: + ansible.builtin.assert: that: - - results.ansible_facts.azure_vmss.properties.virtualMachineProfile.priority == 'Spot' - - results.ansible_facts.azure_vmss.properties.virtualMachineProfile.evictionPolicy == 'Deallocate' - - results.ansible_facts.azure_vmss.properties.virtualMachineProfile.billingProfile.maxPrice == -1.0 + - results.ansible_facts.azure_vmss.virtual_machine_profile.priority == 'Spot' + - results.ansible_facts.azure_vmss.virtual_machine_profile.eviction_policy == 'Deallocate' + - results.ansible_facts.azure_vmss.virtual_machine_profile.billing_profile.max_price == -1.0 - name: Delete VMSS azure_rm_virtualmachinescaleset: @@ -250,11 +252,11 @@ tier: Standard managed_disk_type: Standard_LRS os_disk_caching: ReadWrite - single_placement_group: True + single_placement_group: true image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal publisher: Canonical - sku: 18.04-LTS + sku: 20_04-lts version: latest data_disks: - lun: 0 @@ -264,17 +266,17 @@ register: results - name: Assert that VMSS was created using Spot Instance custom values - assert: + ansible.builtin.assert: that: - - results.ansible_facts.azure_vmss.properties.virtualMachineProfile.priority == 'Spot' - - results.ansible_facts.azure_vmss.properties.virtualMachineProfile.evictionPolicy == 'Delete' - - results.ansible_facts.azure_vmss.properties.virtualMachineProfile.billingProfile.maxPrice == 1.0 + - results.ansible_facts.azure_vmss.virtual_machine_profile.priority == 'Spot' + - results.ansible_facts.azure_vmss.virtual_machine_profile.eviction_policy == 'Delete' + - results.ansible_facts.azure_vmss.virtual_machine_profile.billing_profile.max_price == 1.0 - name: Delete VMSS azure_rm_virtualmachinescaleset: resource_group: "{{ resource_group }}" name: testVMSS{{ rpfx }} - state: absent + state: absent - name: Create VMSS (check mode) azure_rm_virtualmachinescaleset: @@ -294,11 +296,11 @@ tier: Standard managed_disk_type: Standard_LRS os_disk_caching: ReadWrite - single_placement_group: True + single_placement_group: true image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal publisher: Canonical - sku: 18.04-LTS + sku: 20_04-lts version: latest data_disks: - lun: 0 @@ -306,13 +308,13 @@ caching: ReadWrite managed_disk_type: Standard_LRS register: results - check_mode: yes + check_mode: true - name: Assert that VMSS can be created - assert: + ansible.builtin.assert: that: results.changed -- name: Get VMSS to assert no VMSS is created in check mode +- name: Get VMSS to ansible.builtin.assert no VMSS is created in check mode azure_rm_virtualmachinescaleset_info: resource_group: "{{ resource_group }}" name: testVMSS{{ rpfx }} @@ -320,7 +322,7 @@ register: output_scaleset - name: Assert no VMSS created in check mode - assert: + ansible.builtin.assert: that: - output_scaleset.vmss | length == 0 @@ -343,11 +345,11 @@ managed_disk_type: Standard_LRS os_disk_caching: ReadWrite custom_data: "#cloud-config" - single_placement_group: True + single_placement_group: true image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal publisher: Canonical - sku: 18.04-LTS + sku: 20_04-lts version: latest data_disks: - lun: 0 @@ -358,7 +360,7 @@ register: results - name: Assert that VMSS was created - assert: + ansible.builtin.assert: that: results.changed - name: Create VMSS -- test upgrade_policy idempotence and load balancer @@ -380,11 +382,11 @@ managed_disk_type: Standard_LRS os_disk_caching: ReadWrite custom_data: "#cloud-config" - single_placement_group: True + single_placement_group: true image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal publisher: Canonical - sku: 18.04-LTS + sku: 20_04-lts version: latest data_disks: - lun: 0 @@ -394,7 +396,7 @@ register: results - name: Assert that VMSS was created - assert: + ansible.builtin.assert: that: results.changed - name: Retrieve scaleset facts @@ -404,9 +406,10 @@ format: curated register: output_scaleset -- assert: +- name: Assert the vmss facts + ansible.builtin.assert: that: - - output_scaleset.vmss[0].load_balancer == "testLB1" + - output_scaleset.vmss[0].load_balancer == "testLB1" - name: Retrieve scaleset VMs facts azure_rm_virtualmachinescalesetinstance_info: @@ -415,7 +418,7 @@ register: instances - name: Assert that facts returned correctly - assert: + ansible.builtin.assert: that: - instances.instances | length == 1 - instances.instances[0].id != None @@ -427,7 +430,7 @@ - instances.instances[0].power_state != None - name: Get scaleset body - set_fact: + ansible.builtin.set_fact: body: "{{ output_scaleset.vmss[0] }}" - name: Try to update VMSS using output as input @@ -451,11 +454,11 @@ image: "{{ body.image }}" data_disks: "{{ body.data_disks }}" overprovision: "{{ body.overprovision }}" - single_placement_group: True + single_placement_group: true register: results - name: Assert that nothing was changed - assert: + ansible.builtin.assert: that: not results.changed - name: Install VMSS Extension @@ -471,7 +474,7 @@ register: results - name: Assert that something was changed - assert: + ansible.builtin.assert: that: results.changed - name: Install Again VMSS Extension - again @@ -487,7 +490,7 @@ register: results - name: Assert that nothing was changed - assert: + ansible.builtin.assert: that: not results.changed - name: Query extension @@ -498,7 +501,7 @@ register: results - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - results.changed == False - results.extensions[0]['id'] != None @@ -518,7 +521,7 @@ register: results - name: Assert that facts are returned - assert: + ansible.builtin.assert: that: - results.changed == False - results.extensions[0]['id'] != None @@ -540,7 +543,7 @@ register: results - name: Assert that change was reported - assert: + ansible.builtin.assert: that: results.changed - name: Upgrade instance to the latest image @@ -548,11 +551,11 @@ resource_group: "{{ resource_group }}" vmss_name: testVMSS{{ rpfx }} instance_id: "{{ instances.instances[0].instance_id }}" - latest_model: yes + latest_model: true register: results - name: Assert that something has changed - assert: + ansible.builtin.assert: that: results.changed - name: Stop virtual machine @@ -564,7 +567,7 @@ register: results - name: Assert that something has changed - assert: + ansible.builtin.assert: that: results.changed - name: Delete instance @@ -576,7 +579,7 @@ register: results - name: Assert that something has changed - assert: + ansible.builtin.assert: that: results.changed - name: Delete VMSS @@ -603,13 +606,13 @@ resource_group: "{{ resource_group }}" upgrade_policy: Manual security_group: testNetworkSecurityGroup - enable_accelerated_networking: yes - single_placement_group: True + enable_accelerated_networking: true + single_placement_group: true register: results - check_mode: yes + check_mode: true - name: Assert that VMSS can be created - assert: + ansible.builtin.assert: that: results.changed - name: Create VMSS with security group in same resource group, with accelerated networking. @@ -630,16 +633,16 @@ resource_group: "{{ resource_group }}" upgrade_policy: Manual security_group: testNetworkSecurityGroup - enable_accelerated_networking: yes - single_placement_group: True + enable_accelerated_networking: true + single_placement_group: true register: results - name: Assert that VMSS ran - assert: + ansible.builtin.assert: that: - 'results.changed' - - 'results.ansible_facts.azure_vmss.properties.virtualMachineProfile.networkProfile.networkInterfaceConfigurations.0.properties.enableAcceleratedNetworking == true' - - 'results.ansible_facts.azure_vmss.properties.virtualMachineProfile.networkProfile.networkInterfaceConfigurations.0.properties.networkSecurityGroup != {}' + - 'results.ansible_facts.azure_vmss.virtual_machine_profile.network_profile.network_interface_configurations[0].enable_accelerated_networking == true' + - 'results.ansible_facts.azure_vmss.virtual_machine_profile.network_profile.network_interface_configurations[0].network_security_group != {}' - name: Create VMSS with security group in same resource group, with accelerated networking. azure_rm_virtualmachinescaleset: @@ -659,12 +662,12 @@ resource_group: "{{ resource_group }}" upgrade_policy: Manual security_group: testNetworkSecurityGroup - enable_accelerated_networking: yes - single_placement_group: True + enable_accelerated_networking: true + single_placement_group: true register: results - name: Assert that nothing has changed - assert: + ansible.builtin.assert: that: - not results.changed @@ -686,16 +689,16 @@ resource_group: "{{ resource_group }}" upgrade_policy: Manual security_group: testNetworkSecurityGroup - enable_accelerated_networking: yes - single_placement_group: True + enable_accelerated_networking: true + single_placement_group: true register: results - name: Assert that something has changed - assert: + ansible.builtin.assert: that: - results.changed -- name: update VMSS with security group in different resource group. +- name: Update VMSS with security group in different resource group. azure_rm_virtualmachinescaleset: resource_group: "{{ resource_group }}" name: testVMSS{{ rpfx }}2 @@ -715,12 +718,12 @@ security_group: name: testNetworkSecurityGroup2 resource_group: "{{ resource_group_secondary }}" - single_placement_group: True + single_placement_group: true register: results # disable for now -#- name: Assert that security group is correct -# assert: +# - name: Assert that security group is correct +# ansible.builtin.assert: # that: # - 'results.changed' # - '"testNetworkSecurityGroup2" in results.ansible_facts.azure_vmss.properties.virtualMachineProfile.networkProfile.networkInterfaceConfigurations.0.properties.networkSecurityGroup.id' @@ -742,9 +745,9 @@ admin_username: testuser ssh_password_enabled: false ssh_public_keys: - - path: /home/testuser/.ssh/authorized_keys - key_data: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfoYlIV4lTPZTv7hXaVwQQuqBgGs4yeNRX0SPo2+HQt9u4X7IGwrtXc0nEUm6LfaCikMH58bOL8f20NTGz285kxdFHZRcBXtqmnMz2rXwhK9gwq5h1khc+GzHtdcJXsGA4y0xuaNcidcg04jxAlN/06fwb/VYwwWTVbypNC0gpGEpWckCNm8vlDlA55sU5et0SZ+J0RKVvEaweUOeNbFZqckGPA384imfeYlADppK/7eAxqfBVadVvZG8IJk4yvATgaIENIFj2cXxqu2mQ/Bp5Wr45uApvJsFXmi+v/nkiOEV1QpLOnEwAZo6EfFS4CCQtsymxJCl1PxdJ5LD4ZOtP xiuxi.sun@qq.com" - ephemeral_os_disk: True + - path: /home/testuser/.ssh/authorized_keys + key_data: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfoYlIV4lTPZTv7hXaVwQQuqBgGs4yeNRX0SPo2+HQt9u4X7IGwrtXc0nEUm6LfaCikMH58bOL8f20NTGz285kxdFHZRcBXtqmnMz2rXwhK9gwq5h1khc+GzHtdcJXsGA4y0xuaNcidcg04jxAlN/06fwb/VYwwWTVbypNC0gpGEpWckCNm8vlDlA55sU5et0SZ+J0RKVvEaweUOeNbFZqckGPA384imfeYlADppK/7eAxqfBVadVvZG8IJk4yvATgaIENIFj2cXxqu2mQ/Bp5Wr45uApvJsFXmi+v/nkiOEV1QpLOnEwAZo6EfFS4CCQtsymxJCl1PxdJ5LD4ZOtP xiuxi.sun@qq.com" + ephemeral_os_disk: true image: name: testimageb resource_group: "{{ resource_group }}" @@ -752,13 +755,14 @@ security_group: name: testNetworkSecurityGroup2 resource_group: "{{ resource_group_secondary }}" - single_placement_group: True + single_placement_group: true register: results -- assert: +- name: Assert vmss created + ansible.builtin.assert: that: - results.changed - - results.ansible_facts.azure_vmss.properties.virtualMachineProfile.storageProfile.osDisk.diffDiskSettings.option == 'Local' + - results.ansible_facts.azure_vmss.virtual_machine_profile.storage_profile.os_disk.diff_disk_settings.option == 'Local' - name: Check VMSS ephmeral OS disk can't udpate azure_rm_virtualmachinescaleset: @@ -773,7 +777,7 @@ ssh_public_keys: - path: /home/testuser/.ssh/authorized_keys key_data: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfoYlIV4lTPZTv7hXaVwQQuqBgGs4yeNRX0SPo2+HQt9u4X7IGwrtXc0nEUm6LfaCikMH58bOL8f20NTGz285kxdFHZRcBXtqmnMz2rXwhK9gwq5h1khc+GzHtdcJXsGA4y0xuaNcidcg04jxAlN/06fwb/VYwwWTVbypNC0gpGEpWckCNm8vlDlA55sU5et0SZ+J0RKVvEaweUOeNbFZqckGPA384imfeYlADppK/7eAxqfBVadVvZG8IJk4yvATgaIENIFj2cXxqu2mQ/Bp5Wr45uApvJsFXmi+v/nkiOEV1QpLOnEwAZo6EfFS4CCQtsymxJCl1PxdJ5LD4ZOtP xiuxi.sun@qq.com" - ephemeral_os_disk: False + ephemeral_os_disk: false image: name: testimageb resource_group: "{{ resource_group }}" @@ -781,8 +785,9 @@ security_group: name: testNetworkSecurityGroup2 resource_group: "{{ resource_group_secondary }}" - single_placement_group: True - ignore_errors: yes + single_placement_group: true + ignore_errors: true + register: ignore_errors_register - name: Delete VMSS azure_rm_virtualmachinescaleset: @@ -803,18 +808,18 @@ - path: /home/testuser/.ssh/authorized_keys key_data: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfoYlIV4lTPZTv7hXaVwQQuqBgGs4yeNRX0SPo2+HQt9u4X7IGwrtXc0nEUm6LfaCikMH58bOL8f20NTGz285kxdFHZRcBXtqmnMz2rXwhK9gwq5h1khc+GzHtdcJXsGA4y0xuaNcidcg04jxAlN/06fwb/VYwwWTVbypNC0gpGEpWckCNm8vlDlA55sU5et0SZ+J0RKVvEaweUOeNbFZqckGPA384imfeYlADppK/7eAxqfBVadVvZG8IJk4yvATgaIENIFj2cXxqu2mQ/Bp5Wr45uApvJsFXmi+v/nkiOEV1QpLOnEwAZo6EfFS4CCQtsymxJCl1PxdJ5LD4ZOtP xiuxi.sun@qq.com" image: - offer: UbuntuServer + offer: 0001-com-ubuntu-server-focal publisher: Canonical - sku: 18.04-LTS + sku: 20_04-lts version: latest upgrade_policy: Manual - enable_accelerated_networking: yes - single_placement_group: True + enable_accelerated_networking: true + single_placement_group: true register: results - ignore_errors: yes + ignore_errors: true - name: Assert failure to show that accelerated networking is enabled only with supported instance types. - assert: + ansible.builtin.assert: that: - '"VMSizeIsNotPermittedToEnableAcceleratedNetworkingForVmss" in results.msg' @@ -857,41 +862,41 @@ # TODO: Until we have a module to create/delete images this is the best tests # I can do -- name: assert error thrown with invalid image dict +- name: Assert error thrown with invalid image dict azure_rm_virtualmachinescaleset: - resource_group: "{{ resource_group }}" - name: testvm002 - vm_size: Standard_B1s - image: - offer: UbuntuServer + resource_group: "{{ resource_group }}" + name: testvm002 + vm_size: Standard_B1s + image: + offer: 0001-com-ubuntu-server-focal register: fail_invalid_image_dict failed_when: 'fail_invalid_image_dict.msg != "parameter error: expecting image to contain [publisher, offer, sku, version], [name, resource_group] or [id]"' -- name: assert error thrown with invalid image type +- name: Assert error thrown with invalid image type azure_rm_virtualmachinescaleset: - resource_group: "{{ resource_group }}" - name: testvm002 - vm_size: Standard_B1s - image: + resource_group: "{{ resource_group }}" + name: testvm002 + vm_size: Standard_B1s + image: - testing register: fail_invalid_image_type failed_when: 'fail_invalid_image_type.msg != "parameter error: expecting image to be a string or dict not list"' -- name: assert error finding missing custom image +- name: Assert error finding missing custom image azure_rm_virtualmachinescaleset: - resource_group: "{{ resource_group }}" - name: testvm002 - vm_size: Standard_B1s - image: invalid-image + resource_group: "{{ resource_group }}" + name: testvm002 + vm_size: Standard_B1s + image: invalid-image register: fail_missing_custom_image failed_when: fail_missing_custom_image.msg != "Error could not find image with name invalid-image" -- name: assert error finding missing custom image (dict style) +- name: Assert error finding missing custom image (dict style) azure_rm_virtualmachinescaleset: - resource_group: "{{ resource_group }}" - name: testvm002 - vm_size: Standard_B1s - image: - name: invalid-image + resource_group: "{{ resource_group }}" + name: testvm002 + vm_size: Standard_B1s + image: + name: invalid-image register: fail_missing_custom_image_dict failed_when: fail_missing_custom_image_dict.msg != "Error could not find image with name invalid-image" diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachinesize_info/meta/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachinesize_info/meta/main.yml index 48f5726d8..95e1952f9 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachinesize_info/meta/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachinesize_info/meta/main.yml @@ -1,2 +1,2 @@ dependencies: - - setup_azure
\ No newline at end of file + - setup_azure diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachinesize_info/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachinesize_info/tasks/main.yml index d3aad3f72..289cda25e 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachinesize_info/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualmachinesize_info/tasks/main.yml @@ -1,5 +1,5 @@ -- name: set location - set_fact: +- name: Set location + ansible.builtin.set_fact: location: eastus - name: Get specific size information for a specific location @@ -8,13 +8,15 @@ name: Standard_A1_v2 register: output -- assert: - that: output['sizes'] | length == 1 +- name: Assert the virtuam machine size + ansible.builtin.assert: + that: output['sizes'] | length == 1 - name: Get available sizes for a specific location azure_rm_virtualmachinesize_info: location: "{{ location }}" register: output -- assert: - that: output['sizes'] | length > 0 +- name: Assert the virtualmachine size + ansible.builtin.assert: + that: output['sizes'] | length > 0 diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualnetwork/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualnetwork/tasks/main.yml index 143396720..79bbb608f 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualnetwork/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualnetwork/tasks/main.yml @@ -1,5 +1,5 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: vnetname: "vnet{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - name: Delete virtual network, if it exists @@ -37,7 +37,8 @@ resource_group: "{{ resource_group }}" register: output -- assert: +- name: Assert the virtual network update + ansible.builtin.assert: that: - "output.state.address_prefixes | length == 3" - "output.state.flow_timeout_in_minutes == 8" @@ -60,7 +61,8 @@ - testing register: facts -- assert: +- name: Assert the virtual network facts + ansible.builtin.assert: that: - "facts.virtualnetworks | length == 1" - "facts.virtualnetworks[0].dns_servers | length == 2" @@ -75,7 +77,8 @@ - testing register: facts -- assert: +- name: Assert the virtualnetwork facts + ansible.builtin.assert: that: "facts.virtualnetworks | length >= 1" - name: Gather facts by tags @@ -84,7 +87,8 @@ - testing register: facts -- assert: +- name: Assert the virtual network facts + ansible.builtin.assert: that: "facts.virtualnetworks | length >= 1" - name: Should be idempotent @@ -103,7 +107,8 @@ resource_group: "{{ resource_group }}" register: output -- assert: +- name: Assert the virtual network idempotent + ansible.builtin.assert: that: not output.changed - name: Update tags @@ -116,22 +121,24 @@ resource_group: "{{ resource_group }}" register: output -- assert: - that: output.state.tags | length == 3 +- name: Assert the virtual network updated + ansible.builtin.assert: + that: output.state.tags | length == 3 - name: Purge tags azure_rm_virtualnetwork: name: "{{ vnetname }}" - append_tags: no + append_tags: false tags: testing: 'always' resource_group: "{{ resource_group }}" register: output -- assert: - that: - - output.state.tags | length == 1 - - output.state.tags.testing == 'always' +- name: Assert the virtual network updated + ansible.builtin.assert: + that: + - output.state.tags | length == 1 + - output.state.tags.testing == 'always' - name: Should require address_prefixes_cidr when purge_address_prefixes azure_rm_virtualnetwork: @@ -139,10 +146,11 @@ purge_address_prefixes: true resource_group: "{{ resource_group }}" register: output - ignore_errors: yes + ignore_errors: true -- assert: - that: output.failed +- name: Assert the virtual network updated + ansible.builtin.assert: + that: output.failed - name: Purge address prefixes azure_rm_virtualnetwork: @@ -152,12 +160,13 @@ resource_group: "{{ resource_group }}" register: output -- assert: +- name: Assert the virtual network updated + ansible.builtin.assert: that: - - output.state.address_prefixes | length == 1 - - output.state.address_prefixes[0] == '10.1.0.0/16' - - output.state.dns_servers | length == 2 - - output.state.dns_servers[0] == '127.0.0.1' + - output.state.address_prefixes | length == 1 + - output.state.address_prefixes[0] == '10.1.0.0/16' + - output.state.dns_servers | length == 2 + - output.state.dns_servers[0] == '127.0.0.1' - name: Purge DNS servers azure_rm_virtualnetwork: @@ -166,7 +175,8 @@ resource_group: "{{ resource_group }}" register: output -- assert: +- name: Assert the virtual network DNS server purged + ansible.builtin.assert: that: output.state['dns_servers'] is undefined - name: Gather facts @@ -175,7 +185,8 @@ name: "{{ vnetname }}" register: facts -- assert: +- name: Assert the virtual network facts + ansible.builtin.assert: that: - facts.virtualnetworks | length == 1 - "facts.virtualnetworks[0].subnets | length == 1" diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualnetworkgateway/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualnetworkgateway/tasks/main.yml index 9dbd87e69..4b692fd1c 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualnetworkgateway/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualnetworkgateway/tasks/main.yml @@ -1,13 +1,13 @@ # FIXME: needs minimal tests (check mode?) that can run quickly, VNG creation takes > 20min - name: Prepare random number - set_fact: + ansible.builtin.set_fact: vnetname: "vnet{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" vngname: "vng{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" pubipname: "testPublicIP{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - name: Create virtual network gateway without bgp settings (check mode) - check_mode: yes + check_mode: true azure_rm_virtualnetworkgateway: resource_group: "{{ resource_group }}" name: "{{ vngname }}" @@ -20,11 +20,12 @@ common: "xyz" register: output -- assert: +- name: Assert the virtual network gateway check mode + ansible.builtin.assert: that: output.changed - name: Create virtual network gateway Generation2 (check mode) - check_mode: yes + check_mode: true azure_rm_virtualnetworkgateway: resource_group: "{{ resource_group }}" name: "{{ vngname }}" @@ -38,153 +39,159 @@ tags: common: "xyz" -- assert: +- name: Assert the virtual network gateway check mode + ansible.builtin.assert: that: output.changed - -- name: long-running virtualnetworkgateway tests [run with `--tags long_run,untagged` to enable] +- name: Long-running virtualnetworkgateway tests [run with `--tags long_run,untagged` to enable] tags: [long_run, never] block: - - name: Create virtual network - azure_rm_virtualnetwork: + - name: Create virtual network + azure_rm_virtualnetwork: resource_group: "{{ resource_group }}" name: "{{ vnetname }}" address_prefixes: "10.0.0.0/16" - - name: Add subnet - azure_rm_subnet: + - name: Add subnet + azure_rm_subnet: resource_group: "{{ resource_group }}" name: GatewaySubnet address_prefix: "10.0.2.0/24" virtual_network: "{{ vnetname }}" - - name: Create public IP address - azure_rm_publicipaddress: + - name: Create public IP address + azure_rm_publicipaddress: resource_group: "{{ resource_group }}" allocation_method: Dynamic name: "{{ pubipname }}" - - name: Create virtual network gateway without bgp settings - azure_rm_virtualnetworkgateway: - resource_group: "{{ resource_group }}" - name: "{{ vngname }}" - ip_configurations: - - name: testipconfig - private_ip_allocation_method: Dynamic - public_ip_address_name: testPublicIP - virtual_network: "{{ vnetname }}" - tags: - common: "xyz" - register: output - - - assert: - that: output.changed - - - name: Create virtual network gateway without bgp settings - idempotent - azure_rm_virtualnetworkgateway: - resource_group: "{{ resource_group }}" - name: "{{ vngname }}" - ip_configurations: - - name: testipconfig - private_ip_allocation_method: Dynamic - public_ip_address_name: "{{ pubipname }}" - virtual_network: "{{ vnetname }}" - tags: - common: "xyz" - register: output - - - assert: - that: not output.changed - - - name: Update virtual network gateway - azure_rm_virtualnetworkgateway: - resource_group: "{{ resource_group }}" - name: "{{ vngname }}" - ip_configurations: - - name: testipconfig - private_ip_allocation_method: Dynamic - public_ip_address_name: "{{ pubipname }}" - virtual_network: "{{ vnetname }}" - tags: - common: "mno" - register: output - - assert: - that: output.changed - - - name: Delete virtual network gateway - azure_rm_virtualnetworkgateway: - resource_group: "{{ resource_group }}" - name: "{{ vngname }}" - state: absent - register: output - - assert: - that: output.changed - -- name: long-running generation virtualnetworkgateway tests [run with `--tags long_run_gen,untagged` to enable] + - name: Create virtual network gateway without bgp settings + azure_rm_virtualnetworkgateway: + resource_group: "{{ resource_group }}" + name: "{{ vngname }}" + ip_configurations: + - name: testipconfig + private_ip_allocation_method: Dynamic + public_ip_address_name: testPublicIP + virtual_network: "{{ vnetname }}" + tags: + common: "xyz" + register: output + + - name: Assert the virtual network gateway created + ansible.builtin.assert: + that: output.changed + + - name: Create virtual network gateway without bgp settings - idempotent + azure_rm_virtualnetworkgateway: + resource_group: "{{ resource_group }}" + name: "{{ vngname }}" + ip_configurations: + - name: testipconfig + private_ip_allocation_method: Dynamic + public_ip_address_name: "{{ pubipname }}" + virtual_network: "{{ vnetname }}" + tags: + common: "xyz" + register: output + + - name: Assert the idempotent + ansible.builtin.assert: + that: not output.changed + + - name: Update virtual network gateway + azure_rm_virtualnetworkgateway: + resource_group: "{{ resource_group }}" + name: "{{ vngname }}" + ip_configurations: + - name: testipconfig + private_ip_allocation_method: Dynamic + public_ip_address_name: "{{ pubipname }}" + virtual_network: "{{ vnetname }}" + tags: + common: "mno" + register: output + - name: Assert the virtual network gateway updated + ansible.builtin.assert: + that: output.changed + + - name: Delete virtual network gateway + azure_rm_virtualnetworkgateway: + resource_group: "{{ resource_group }}" + name: "{{ vngname }}" + state: absent + register: output + - name: Assert the virtual network gateway deleted + ansible.builtin.assert: + that: output.changed + +- name: Long-running generation virtualnetworkgateway tests [run with `--tags long_run_gen,untagged` to enable] tags: [long_run_gen, never] block: - - name: Create virtual network - azure_rm_virtualnetwork: + - name: Create virtual network + azure_rm_virtualnetwork: resource_group: "{{ resource_group }}" name: "{{ vnetname }}" address_prefixes: "10.0.0.0/16" - - name: Add subnet - azure_rm_subnet: + - name: Add subnet + azure_rm_subnet: resource_group: "{{ resource_group }}" name: GatewaySubnet address_prefix: "10.0.2.0/24" virtual_network: "{{ vnetname }}" - - name: Create public IP address - azure_rm_publicipaddress: + - name: Create public IP address + azure_rm_publicipaddress: resource_group: "{{ resource_group }}" allocation_method: Dynamic name: "{{ pubipname }}" - - name: Create virtual network gateway w/ sku and Generation2 - azure_rm_virtualnetworkgateway: - resource_group: "{{ resource_group }}" - name: "{{ vngname }}" - sku: VpnGw2 - vpn_gateway_generation: Generation2 - ip_configurations: - - name: testipconfig - private_ip_allocation_method: Dynamic - public_ip_address_name: "{{ pubipname }}" - virtual_network: "{{ vnetname }}" - tags: - common: "xyz" - - - assert: - that: output.changed - - - name: Update virtual network gateway - azure_rm_virtualnetworkgateway: - resource_group: "{{ resource_group }}" - name: "{{ vngname }}" - sku: VpnGw2 - vpn_gateway_generation: Generation2 - ip_configurations: - - name: testipconfig - private_ip_allocation_method: Dynamic - public_ip_address_name: "{{ pubipname }}" - virtual_network: "{{ vnetname }}" - tags: - common: "mno" - - register: output - - assert: - that: output.changed - - - name: Delete virtual network gateway - azure_rm_virtualnetworkgateway: - resource_group: "{{ resource_group }}" - name: "{{ vngname }}" - state: absent - register: output - - assert: - that: output.changed + - name: Create virtual network gateway w/ sku and Generation2 + azure_rm_virtualnetworkgateway: + resource_group: "{{ resource_group }}" + name: "{{ vngname }}" + sku: VpnGw2 + vpn_gateway_generation: Generation2 + ip_configurations: + - name: testipconfig + private_ip_allocation_method: Dynamic + public_ip_address_name: "{{ pubipname }}" + virtual_network: "{{ vnetname }}" + tags: + common: "xyz" + + - name: Assert the virtual network gateay created + ansible.builtin.assert: + that: output.changed + + - name: Update virtual network gateway + azure_rm_virtualnetworkgateway: + resource_group: "{{ resource_group }}" + name: "{{ vngname }}" + sku: VpnGw2 + vpn_gateway_generation: Generation2 + ip_configurations: + - name: testipconfig + private_ip_allocation_method: Dynamic + public_ip_address_name: "{{ pubipname }}" + virtual_network: "{{ vnetname }}" + tags: + common: "mno" + register: output + - name: Assert the virtual network gateway updated + ansible.builtin.assert: + that: output.changed + + - name: Delete virtual network gateway + azure_rm_virtualnetworkgateway: + resource_group: "{{ resource_group }}" + name: "{{ vngname }}" + state: absent + register: output + - name: Assert the virtual network gateway deleted + ansible.builtin.assert: + that: output.changed - name: Delete virtual network gateway - idempotent azure_rm_virtualnetworkgateway: @@ -192,7 +199,8 @@ name: "{{ vngname }}" state: absent register: output -- assert: +- name: Assert the virtual network gateway deleted + ansible.builtin.assert: that: not output.changed # Clean up networking components after test @@ -202,7 +210,6 @@ name: GatewaySubnet virtual_network: "{{ vnetname }}" state: absent - - name: Delete public IP address azure_rm_publicipaddress: diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualnetworkpeering/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualnetworkpeering/tasks/main.yml index bf7a4aa13..3464847c1 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualnetworkpeering/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualnetworkpeering/tasks/main.yml @@ -1,5 +1,5 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: vnetname1: "vnet1{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" vnetname2: "vnet2{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" peering_name: "peering1{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 100 | random }}" @@ -23,7 +23,8 @@ resource_group: "{{ resource_group_secondary }}" register: vnet2 -- assert: +- name: Assert the second virtual network created + ansible.builtin.assert: that: - vnet1.changed - vnet2.changed @@ -38,10 +39,11 @@ name: "{{ vnetname2 }}" allow_virtual_network_access: false allow_forwarded_traffic: true - check_mode: yes + check_mode: true register: output -- assert: +- name: Assert the virtual network peering check mode + ansible.builtin.assert: that: output.changed - name: Create virtual network peering @@ -56,7 +58,8 @@ allow_forwarded_traffic: true register: output -- assert: +- name: Assert the virtual network peering created + ansible.builtin.assert: that: output.changed - name: Update virtual network peering (idempotent) @@ -71,7 +74,8 @@ allow_forwarded_traffic: true register: output -- assert: +- name: Assert the virtual network peering idempotent + ansible.builtin.assert: that: not output.changed - name: Update virtual network peering @@ -86,7 +90,8 @@ allow_forwarded_traffic: false register: output -- assert: +- name: Assert the virtual network peering updated + ansible.builtin.assert: that: output.changed - name: Get facts @@ -97,7 +102,7 @@ register: facts - name: Assert Facts - assert: + ansible.builtin.assert: that: - facts['vnetpeerings'] | length == 1 - facts['vnetpeerings'][0]['id'] @@ -123,4 +128,4 @@ azure_rm_virtualnetwork: name: "{{ vnetname2 }}" resource_group: "{{ resource_group_secondary }}" - state: absent
\ No newline at end of file + state: absent diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualwan/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualwan/tasks/main.yml index c53b7d513..cb9a21554 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualwan/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_virtualwan/tasks/main.yml @@ -1,61 +1,65 @@ - - name: Prepare random number - set_fact: - rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - run_once: yes - - - name: Create a VirtualWan - azure_rm_virtualwan: - resource_group: "{{ resource_group }}" - name: "virtualwan{{ rpfx }}" - office365_local_breakout_category: All - disable_vpn_encryption: true - allow_branch_to_branch_traffic: true - allow_vnet_to_vnet_traffic: true - virtual_wan_type: Basic - register: output - - - assert: - that: - - output.changed - - - name: Create a VirtualWan again (Idempotent test) - azure_rm_virtualwan: - resource_group: "{{ resource_group }}" - name: "virtualwan{{ rpfx }}" - register: output - - - assert: - that: - - not output.changed - - - name: Update the VirtualWan - azure_rm_virtualwan: - resource_group: "{{ resource_group }}" - office365_local_breakout_category: All - name: "virtualwan{{ rpfx }}" - disable_vpn_encryption: false - allow_branch_to_branch_traffic: true - allow_vnet_to_vnet_traffic: true - virtual_wan_type: Basic - register: output - - - assert: - that: - - output.changed - - - name: Get VirtualWan info - azure_rm_virtualwan_info: - resource_group: "{{ resource_group }}" - name: "virtualwan{{ rpfx }}" - register: output - - - assert: - that: - - output.virtual_wans[0]['allow_branch_to_branch_traffic'] == true - - output.virtual_wans[0]['disable_vpn_encryption'] == false - - - name: Delete the VirtualWan - azure_rm_virtualwan: - resource_group: "{{ resource_group }}" - name: "virtualwan{{ rpfx }}" - state: absent +- name: Prepare random number + ansible.builtin.set_fact: + rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" + run_once: true + +- name: Create a VirtualWan + azure_rm_virtualwan: + resource_group: "{{ resource_group }}" + name: "virtualwan{{ rpfx }}" + office365_local_breakout_category: All + disable_vpn_encryption: true + allow_branch_to_branch_traffic: true + allow_vnet_to_vnet_traffic: true + virtual_wan_type: Basic + register: output + +- name: Assert the virtual wan created + ansible.builtin.assert: + that: + - output.changed + +- name: Create a VirtualWan again (Idempotent test) + azure_rm_virtualwan: + resource_group: "{{ resource_group }}" + name: "virtualwan{{ rpfx }}" + register: output + +- name: Assert idempotent + ansible.builtin.assert: + that: + - not output.changed + +- name: Update the VirtualWan + azure_rm_virtualwan: + resource_group: "{{ resource_group }}" + office365_local_breakout_category: All + name: "virtualwan{{ rpfx }}" + disable_vpn_encryption: false + allow_branch_to_branch_traffic: true + allow_vnet_to_vnet_traffic: true + virtual_wan_type: Basic + register: output + +- name: Assert the virtual wan updated + ansible.builtin.assert: + that: + - output.changed + +- name: Get VirtualWan info + azure_rm_virtualwan_info: + resource_group: "{{ resource_group }}" + name: "virtualwan{{ rpfx }}" + register: output + +- name: Assert the virtual wan facts + ansible.builtin.assert: + that: + - output.virtual_wans[0]['allow_branch_to_branch_traffic'] == true + - output.virtual_wans[0]['disable_vpn_encryption'] == false + +- name: Delete the VirtualWan + azure_rm_virtualwan: + resource_group: "{{ resource_group }}" + name: "virtualwan{{ rpfx }}" + state: absent diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_vmbackuppolicy/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_vmbackuppolicy/tasks/main.yml index 9eb906f90..46ec87281 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_vmbackuppolicy/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_vmbackuppolicy/tasks/main.yml @@ -1,13 +1,13 @@ - name: Fix resource prefix - set_fact: - name: "myPolicy{{ resource_group | hash('md5') | truncate(22, True, '') }}" + ansible.builtin.set_fact: + name_rpfx: "myPolicy{{ resource_group | hash('md5') | truncate(22, True, '') }}" vault_name: "myVault" location: "eastus" - name: Create Azure Recovery Service vault azure_rm_recoveryservicesvault: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" location: "{{ location }}" state: "present" register: vault @@ -15,38 +15,38 @@ - name: Create VM Backup Policy azure_rm_vmbackuppolicy: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" vault_name: "{{ vault.response.name }}" state: "present" register: output - name: Assert that output has changed - assert: + ansible.builtin.assert: that: - output.changed - + - name: Create VM Backup Policy (idempotent) azure_rm_vmbackuppolicy: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" vault_name: "{{ vault.response.name }}" state: "present" register: output - name: Assert that output has no changed - assert: + ansible.builtin.assert: that: - not output.changed - name: Get VM Backup Policy Details azure_rm_vmbackuppolicy_info: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" vault_name: "{{ vault.response.name }}" register: output - name: Assert that output has changed - assert: + ansible.builtin.assert: that: - output.response.id != None - output.response.name != None @@ -54,13 +54,13 @@ - name: Delete VM Backup Policy azure_rm_vmbackuppolicy: resource_group: "{{ resource_group }}" - name: "{{ name }}" + name: "{{ name_rpfx }}" vault_name: "{{ vault.response.name }}" state: "absent" register: output - name: Assert that output has changed - assert: + ansible.builtin.assert: that: - output.changed @@ -73,6 +73,6 @@ register: output - name: Assert that output has changed - assert: + ansible.builtin.assert: that: - output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_vpnsite/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_vpnsite/tasks/main.yml index 07cb7dd45..7e6dbdf6f 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_vpnsite/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_vpnsite/tasks/main.yml @@ -1,102 +1,106 @@ - - name: Create vpn site name - set_fact: - vpn_site: "vpn{{ resource_group | hash('md5') | truncate(22, True, '') }}" +- name: Create vpn site name + ansible.builtin.set_fact: + vpn_site: "vpn{{ resource_group | hash('md5') | truncate(22, True, '') }}" - - name: Create a VpnSite - azure_rm_vpnsite: - resource_group: "{{ resource_group }}" - name: "{{ vpn_site }}" - ip_address: 10.0.0.0 - is_security_site: true - device_properties: - device_vendor: 10.0.0.23 - device_model: test_model - link_speed_in_mbps: 10 - address_space: - address_prefixes: - - 10.0.0.0/16 - bgp_properties: - asn: 1234 - bgp_peering_address: 192.168.0.0 - o365_policy: - break_out_categories: - allow: false - optimize: false - default: false - register: output - - - assert: - that: - - output.changed +- name: Create a VpnSite + azure_rm_vpnsite: + resource_group: "{{ resource_group }}" + name: "{{ vpn_site }}" + ip_address: 10.0.0.0 + is_security_site: true + device_properties: + device_vendor: 10.0.0.23 + device_model: test_model + link_speed_in_mbps: 10 + address_space: + address_prefixes: + - 10.0.0.0/16 + bgp_properties: + asn: 1234 + bgp_peering_address: 192.168.0.0 + o365_policy: + break_out_categories: + allow: false + optimize: false + default: false + register: output - - name: Create the VpnSite without change (Idempotent test) - azure_rm_vpnsite: - resource_group: "{{ resource_group }}" - name: "{{ vpn_site }}" - ip_address: 10.0.0.0 - is_security_site: true - device_properties: - device_vendor: 10.0.0.23 - device_model: test_model - link_speed_in_mbps: 10 - address_space: - address_prefixes: - - 10.0.0.0/16 - bgp_properties: - asn: 1234 - bgp_peering_address: 192.168.0.0 - o365_policy: - break_out_categories: - allow: false - optimize: false - default: false - register: output - - - assert: - that: - - not output.changed - - - name: Update the VpnSite's device properties - azure_rm_vpnsite: - resource_group: "{{ resource_group }}" - name: "{{ vpn_site }}" - ip_address: 10.0.0.0 - is_security_site: true - device_properties: - device_vendor: 10.0.0.23 - device_model: test_model - link_speed_in_mbps: 100 - address_space: - address_prefixes: - - 10.0.0.0/16 - bgp_properties: - asn: 1234 - bgp_peering_address: 192.168.0.0 - o365_policy: - break_out_categories: - allow: false - optimize: false - default: false - register: output - - - assert: - that: - - output.changed - - - name: Get the VpnSite info - azure_rm_vpnsite_info: - resource_group: "{{ resource_group }}" - name: "{{ vpn_site }}" - register: output +- name: Assert the vpn site created + ansible.builtin.assert: + that: + - output.changed - - assert: - that: - - "output.vpn_sites[0].is_security_site == true" - - "output.vpn_sites[0].ip_address == '10.0.0.0'" - - "output.vpn_sites[0].device_properties.link_speed_in_mbps == 100" +- name: Create the VpnSite without change (Idempotent test) + azure_rm_vpnsite: + resource_group: "{{ resource_group }}" + name: "{{ vpn_site }}" + ip_address: 10.0.0.0 + is_security_site: true + device_properties: + device_vendor: 10.0.0.23 + device_model: test_model + link_speed_in_mbps: 10 + address_space: + address_prefixes: + - 10.0.0.0/16 + bgp_properties: + asn: 1234 + bgp_peering_address: 192.168.0.0 + o365_policy: + break_out_categories: + allow: false + optimize: false + default: false + register: output - - name: Delete the VpnSite - azure_rm_vpnsite: - resource_group: "{{ resource_group }}" - name: "{{ vpn_site }}" - state: absent +- name: Assert idempotent + ansible.builtin.assert: + that: + - not output.changed + +- name: Update the VpnSite's device properties + azure_rm_vpnsite: + resource_group: "{{ resource_group }}" + name: "{{ vpn_site }}" + ip_address: 10.0.0.0 + is_security_site: true + device_properties: + device_vendor: 10.0.0.23 + device_model: test_model + link_speed_in_mbps: 100 + address_space: + address_prefixes: + - 10.0.0.0/16 + bgp_properties: + asn: 1234 + bgp_peering_address: 192.168.0.0 + o365_policy: + break_out_categories: + allow: false + optimize: false + default: false + register: output + +- name: Assert the vpn site updated + ansible.builtin.assert: + that: + - output.changed + +- name: Get the VpnSite info + azure_rm_vpnsite_info: + resource_group: "{{ resource_group }}" + name: "{{ vpn_site }}" + register: output + +- name: Assert the vpn site facts + ansible.builtin.assert: + that: + - "output.vpn_sites[0].is_security_site == true" + - "output.vpn_sites[0].ip_address == '10.0.0.0'" + - "output.vpn_sites[0].device_properties.link_speed_in_mbps == 100" + +- name: Delete the VpnSite + azure_rm_vpnsite: + resource_group: "{{ resource_group }}" + name: "{{ vpn_site }}" + state: absent diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_webapp/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_webapp/tasks/main.yml index b286bfe13..42a3abe3c 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_webapp/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_webapp/tasks/main.yml @@ -1,15 +1,15 @@ - name: Prepare facts - set_fact: + ansible.builtin.set_fact: resource_prefix: "{{ resource_group_secondary | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - run_once: yes + run_once: true - name: Fix resource prefix - set_fact: + ansible.builtin.set_fact: linux_app_plan_resource_group: "{{ resource_group_secondary }}" - win_app_name: "{{ (resource_prefix | replace('-','x'))[-8:] }}{{ 1000 | random}}winapp" - linux_app_name: "{{ (resource_prefix | replace('-','x'))[-8:] }}{{ 1000 | random}}linuxapp" - win_plan_name: "{{ (resource_prefix | replace('-','x'))[-8:] }}winplan" - linux_plan_name: "{{ (resource_group_secondary | replace('-','x'))[-8:] }}linplan" + win_app_name: "{{ (resource_prefix | replace('-', 'x'))[-8:] }}{{ 1000 | random }}winapp" + linux_app_name: "{{ (resource_prefix | replace('-', 'x'))[-8:] }}{{ 1000 | random }}linuxapp" + win_plan_name: "{{ (resource_prefix | replace('-', 'x'))[-8:] }}winplan" + linux_plan_name: "{{ (resource_group_secondary | replace('-', 'x'))[-8:] }}linplan" slot1_name: "stage1" - name: Create a windows web app with non-exist app service plan @@ -29,7 +29,7 @@ plan: "{{ win_plan_name }}" register: output -- name: stop the web app +- name: Stop the web app azure_rm_webapp: resource_group: "{{ resource_group }}" name: "{{ win_app_name }}2" @@ -37,19 +37,19 @@ app_state: stopped register: output -- name: assert output changed - assert: +- name: Assert output changed + ansible.builtin.assert: that: output.changed -- name: get the web app +- name: Get the web app azure_rm_webapp_info: resource_group: "{{ resource_group }}" name: "{{ win_app_name }}2" register: stopped -- name: assert web app is stopped - assert: +- name: Assert web app is stopped + ansible.builtin.assert: that: - stopped.webapps[0].app_state == "Stopped" @@ -63,7 +63,7 @@ testwebapptag: test register: output -- name: get web app with resource group and tag +- name: Get web app with resource group and tag azure_rm_webapp_info: resource_group: "{{ resource_group }}" name: "{{ win_app_name }}3" @@ -71,7 +71,8 @@ - testwebapptag register: output -- assert: +- name: Assert the web app facts + ansible.builtin.assert: that: - output.webapps | length == 1 @@ -90,17 +91,18 @@ testkey: "testvalue" register: output -- name: assert the web app was created - assert: +- name: Assert web app was created + ansible.builtin.assert: that: output.changed -- name: get web app with name +- name: Get web app with name azure_rm_webapp_info: resource_group: "{{ resource_group }}" name: "{{ win_app_name }}4" register: output -- assert: +- name: Assert the web app facts + ansible.builtin.assert: that: - output.webapps | length == 1 - output.webapps[0].app_settings | length == 1 @@ -122,31 +124,32 @@ register: output - name: Assert the web app was updated - assert: + ansible.builtin.assert: that: - - output.changed + - output.changed -- name: get web app with name +- name: Get web app with name azure_rm_webapp_info: resource_group: "{{ resource_group }}" name: "{{ win_app_name }}4" register: output - name: Assert updating - assert: + ansible.builtin.assert: that: - - output.webapps[0].app_settings | length == 2 - - output.webapps[0].app_settings['testkey'] == 'testvalue' - - output.webapps[0].app_settings['testkey2'] == 'testvalue2' + - output.webapps[0].app_settings | length == 2 + - output.webapps[0].app_settings['testkey'] == 'testvalue' + - output.webapps[0].app_settings['testkey2'] == 'testvalue2' -- name: get web app with return publishing profile +- name: Get web app with return publishing profile azure_rm_webapp_info: resource_group: "{{ resource_group }}" name: "{{ win_app_name }}4" return_publish_profile: true register: output -- assert: +- name: Assert the web app facts + ansible.builtin.assert: that: - output.webapps | length == 1 - output.webapps[0].publishing_username != "" @@ -161,7 +164,7 @@ register: output - name: Assert the web app was updated - assert: + ansible.builtin.assert: that: output.changed - name: Create a win web app with python run time and php run time @@ -179,7 +182,7 @@ register: output - name: Assert the web app was created - assert: + ansible.builtin.assert: that: output.changed - name: Create a docker web app with some app settings @@ -197,7 +200,7 @@ register: output - name: Assert the web app was created - assert: + ansible.builtin.assert: that: output.changed - name: Create a docker web app with private acr registry @@ -215,7 +218,7 @@ register: output - name: Assert the web app was created - assert: + ansible.builtin.assert: that: output.changed - name: Create a linux web app with nodejs framework @@ -242,9 +245,10 @@ version: "6.6" register: output -- assert: +- name: Assert idempotent + ansible.builtin.assert: that: not output.changed - + - name: Update nodejs framework azure_rm_webapp: resource_group: "{{ resource_group }}" @@ -258,7 +262,7 @@ register: output - name: Assert the web app was created - assert: + ansible.builtin.assert: that: output.changed - name: Create a linux web app with deployment source github @@ -275,7 +279,7 @@ register: output - name: Assert the web app was created - assert: + ansible.builtin.assert: that: output.changed - name: Delete web app @@ -286,10 +290,10 @@ register: output - name: Assert the web app was deleted - assert: + ansible.builtin.assert: that: output.changed -- name: assert error that java is mutually exclusive with frameworks +- name: Assert error that java is mutually exclusive with frameworks azure_rm_webapp: resource_group: "{{ resource_group }}" name: "{{ win_app_name }}11" @@ -302,7 +306,7 @@ register: fail_win_java_version_mutual_exclusive failed_when: 'fail_win_java_version_mutual_exclusive.msg != "Java is mutually exclusive with other frameworks."' -- name: assert error when linux web app, only can specify one framework +- name: Assert error when linux web app, only can specify one framework azure_rm_webapp: resource_group: "{{ resource_group }}" name: "{{ linux_plan_name }}12" @@ -333,7 +337,7 @@ register: output - name: Assert the web app was created - assert: + ansible.builtin.assert: that: output.changed - name: Get facts with publish profile @@ -344,7 +348,7 @@ register: facts - name: Assert publish profile returned - assert: + ansible.builtin.assert: that: - facts.webapps[0].ftp_publish_url != '' @@ -370,7 +374,7 @@ ftps_state: "Disabled" register: output - name: Assert the web app was created - assert: + ansible.builtin.assert: that: output.changed - name: Create a web app with various site config params - idempotent @@ -395,7 +399,7 @@ ftps_state: "Disabled" register: output - name: Assert the web app not changed - assert: + ansible.builtin.assert: that: not output.changed - name: Get facts for site config params @@ -404,7 +408,7 @@ name: "{{ linux_app_name }}-siteconfig" register: facts - name: Assert site config params meet expectations - assert: + ansible.builtin.assert: that: - facts.webapps[0].always_on - facts.webapps[0].min_tls_version == '1.2' @@ -432,7 +436,7 @@ ftps_state: "FtpsOnly" register: output - name: Assert the web app was updated - assert: + ansible.builtin.assert: that: output.changed - name: Get facts for site config params @@ -441,7 +445,7 @@ name: "{{ linux_app_name }}-siteconfig" register: facts - name: Assert site config params meet expectations - assert: + ansible.builtin.assert: that: - facts.webapps[0].always_on - facts.webapps[0].min_tls_version == '1.2' @@ -454,12 +458,12 @@ name: "{{ slot1_name }}" configuration_source: "{{ win_app_name }}13" app_settings: - testkey: testvalue - check_mode: yes + testkey: testvalue + check_mode: true register: output - name: Assert slot check mode creation - assert: + ansible.builtin.assert: that: - output.changed @@ -470,11 +474,11 @@ name: "{{ slot1_name }}" configuration_source: "{{ win_app_name }}13" app_settings: - testkey: testvalueslot + testkey: testvalueslot register: output - name: Assert slot creation - assert: + ansible.builtin.assert: that: - output.changed @@ -484,11 +488,11 @@ webapp_name: "{{ win_app_name }}13" name: "{{ slot1_name }}" app_settings: - testkey: testvalueslot + testkey: testvalueslot register: output - name: Assert idempotence - assert: + ansible.builtin.assert: that: - not output.changed @@ -501,11 +505,11 @@ - name: "node" version: "10.1" app_settings: - testkey: testvalue2 + testkey: testvalue2 register: output - name: Assert updating - assert: + ansible.builtin.assert: that: - output.changed @@ -519,7 +523,7 @@ register: output - name: Assert swap - assert: + ansible.builtin.assert: that: - output.changed @@ -532,6 +536,6 @@ register: output - name: Assert stopped - assert: + ansible.builtin.assert: that: - output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_webappaccessrestriction/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_webappaccessrestriction/tasks/main.yml index 05061d195..9850dd148 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_webappaccessrestriction/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_webappaccessrestriction/tasks/main.yml @@ -1,5 +1,5 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" run_once: true @@ -30,7 +30,7 @@ register: output check_mode: true - name: Assert the resource is well created - assert: + ansible.builtin.assert: that: output.changed - name: "Create webapp access restriction" @@ -49,7 +49,7 @@ scm_ip_security_restrictions_use_main: true register: output - name: Assert the resource is well created - assert: + ansible.builtin.assert: that: - output.changed - output.ip_security_restrictions | length == 2 @@ -65,7 +65,7 @@ resource_group: "{{ resource_group }}" register: output - name: Assert restrictions - assert: + ansible.builtin.assert: that: - not output.changed - output.ip_security_restrictions | length == 2 @@ -91,7 +91,7 @@ scm_ip_security_restrictions_use_main: true register: output - name: Assert the resource is not changed - assert: + ansible.builtin.assert: that: not output.changed - name: "Delete specific webapp access restriction" @@ -106,7 +106,7 @@ scm_ip_security_restrictions_use_main: true register: output - name: Assert the resource is updated - assert: + ansible.builtin.assert: that: - output.changed - output.ip_security_restrictions | length == 1 @@ -126,7 +126,7 @@ scm_ip_security_restrictions_use_main: true register: output - name: Assert the resource is updated - assert: + ansible.builtin.assert: that: - output.changed - output.ip_security_restrictions | length == 1 @@ -146,7 +146,7 @@ scm_ip_security_restrictions_use_main: false register: output - name: Assert the resource is updated - assert: + ansible.builtin.assert: that: - output.changed - output.ip_security_restrictions | length == 1 @@ -171,7 +171,7 @@ scm_ip_security_restrictions_use_main: false register: output - name: Assert the resource is updated - assert: + ansible.builtin.assert: that: - output.changed - output.ip_security_restrictions | length == 1 @@ -203,7 +203,7 @@ scm_ip_security_restrictions_use_main: false register: output - name: Assert the resource is updated - assert: + ansible.builtin.assert: that: - output.changed - output.ip_security_restrictions | length == 1 @@ -237,7 +237,7 @@ scm_ip_security_restrictions_use_main: false register: output - name: Assert the resource is not changed - assert: + ansible.builtin.assert: that: not output.changed - name: "Delete webapp access restrictions" @@ -247,7 +247,7 @@ state: "absent" register: output - name: Assert the resource is deleted - assert: + ansible.builtin.assert: that: - output.changed - output.ip_security_restrictions | length == 0 @@ -260,7 +260,7 @@ resource_group: "{{ resource_group }}" register: output - name: Assert no restrictions - assert: + ansible.builtin.assert: that: - not output.changed - output.ip_security_restrictions | length <= 1 diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_webappvnetconnection/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_webappvnetconnection/tasks/main.yml index 66a1b55cf..9478e6516 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_webappvnetconnection/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_webappvnetconnection/tasks/main.yml @@ -1,5 +1,5 @@ - name: Prepare random number - set_fact: + ansible.builtin.set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" run_once: true @@ -42,7 +42,7 @@ check_mode: true register: output - name: Assert the resource is well created - assert: + ansible.builtin.assert: that: output.changed - name: "Check webapp vnetconnection facts 1" @@ -51,7 +51,7 @@ resource_group: "{{ resource_group }}" register: output - name: Assert the resource has no connections - assert: + ansible.builtin.assert: that: - not output.changed - output.connection | length == 0 @@ -64,7 +64,7 @@ subnet: subnet{{ rpfx }} register: output - name: Assert the resource is well created - assert: + ansible.builtin.assert: that: - output.changed - output.connection.vnet_name == 'vnet{{ rpfx }}' @@ -77,7 +77,7 @@ resource_group: "{{ resource_group }}" register: output - name: Assert the connection exists - assert: + ansible.builtin.assert: that: - not output.changed - output.connection.vnet_name == 'vnet{{ rpfx }}' @@ -92,7 +92,7 @@ subnet: subnet{{ rpfx }} register: output - name: Assert the resource is not changed - assert: + ansible.builtin.assert: that: not output.changed - name: "Delete webapp vnetconnection" @@ -102,7 +102,7 @@ state: "absent" register: output - name: Assert the connection is deleted - assert: + ansible.builtin.assert: that: - output.changed - output.connection | length == 0 @@ -113,7 +113,7 @@ resource_group: "{{ resource_group }}" register: output - name: Assert the resource has no connections - assert: + ansible.builtin.assert: that: - not output.changed - output.connection | length == 0 @@ -125,5 +125,5 @@ state: "absent" register: output - name: Assert the resource is not changed - assert: + ansible.builtin.assert: that: not output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_workspace/tasks/main.yml b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_workspace/tasks/main.yml index 7f9a05f79..9a7ea1efa 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_workspace/tasks/main.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/azure_rm_workspace/tasks/main.yml @@ -1,128 +1,140 @@ - name: Prepare random number - set_fact: - name: "workspace{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" + ansible.builtin.set_fact: + name_rpfx: "workspace{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" - name: Create workspace (check mode) azure_rm_loganalyticsworkspace: - name: "{{ name }}" - resource_group: "{{ resource_group }}" - retention_in_days: 40 - check_mode: yes + name: "{{ name_rpfx }}" + resource_group: "{{ resource_group }}" + retention_in_days: 40 + check_mode: true register: output -- assert: - that: - - output.changed +- name: Assert the workspace check mode + ansible.builtin.assert: + that: + - output.changed - name: Get workspace azure_rm_loganalyticsworkspace_info: - name: "{{ name }}" - resource_group: "{{ resource_group }}" + name: "{{ name_rpfx }}" + resource_group: "{{ resource_group }}" register: facts -- assert: - that: - - facts.workspaces | length == 0 +- name: Assert the workspace facts + ansible.builtin.assert: + that: + - facts.workspaces | length == 0 - name: Create workspace azure_rm_loganalyticsworkspace: - name: "{{ name }}" - resource_group: "{{ resource_group }}" - retention_in_days: 40 + name: "{{ name_rpfx }}" + resource_group: "{{ resource_group }}" + retention_in_days: 40 register: output -- assert: +- name: Assert the workspace created + ansible.builtin.assert: that: - - output.retention_in_days == 40 - - output.changed - - output.intelligence_packs + - output.retention_in_days == 40 + - output.changed + - output.intelligence_packs - name: Create workspace (idempontent) azure_rm_loganalyticsworkspace: - name: "{{ name }}" - resource_group: "{{ resource_group }}" - retention_in_days: 40 + name: "{{ name_rpfx }}" + resource_group: "{{ resource_group }}" + retention_in_days: 40 register: output -- assert: +- name: Assert idempotent + ansible.builtin.assert: that: - - not output.changed + - not output.changed - name: Get workspace azure_rm_loganalyticsworkspace_info: - name: "{{ name }}" - resource_group: "{{ resource_group }}" + name: "{{ name_rpfx }}" + resource_group: "{{ resource_group }}" register: facts -- assert: - that: - - facts.workspaces | length == 1 - - facts.workspaces[0].id == output.id +- name: Assert the loganalytics workspace facts + ansible.builtin.assert: + that: + - facts.workspaces | length == 1 + - facts.workspaces[0].id == output.id -- set_fact: - pack: "{{ pack | default({}) | combine({output.intelligence_packs[0].name: not output.intelligence_packs[0].enabled}) }}" +- name: Set parameters + ansible.builtin.set_fact: + pack: "{{ pack | default({}) | combine({output.intelligence_packs[0].name: not output.intelligence_packs[0].enabled}) }}" - name: Update intelligence pack azure_rm_loganalyticsworkspace: - name: "{{ name }}" - resource_group: "{{ resource_group }}" - intelligence_packs: "{{ pack }}" + name: "{{ name_rpfx }}" + resource_group: "{{ resource_group }}" + intelligence_packs: "{{ pack }}" register: intelligence -- assert: - that: - - intelligence.intelligence_packs[0].enabled != output.intelligence_packs[0].enabled +- name: Assert the loganalytics workspace updated + ansible.builtin.assert: + that: + - intelligence.intelligence_packs[0].enabled != output.intelligence_packs[0].enabled - name: Remove workspace (check mode) azure_rm_loganalyticsworkspace: - name: "{{ name }}" - resource_group: "{{ resource_group }}" - state: absent - check_mode: yes + name: "{{ name_rpfx }}" + resource_group: "{{ resource_group }}" + state: absent + check_mode: true register: output -- assert: - that: - - output.changed +- name: Assert the loganalytics workspace check mode + ansible.builtin.assert: + that: + - output.changed - name: Get workspace azure_rm_loganalyticsworkspace_info: - name: "{{ name }}" - resource_group: "{{ resource_group }}" + name: "{{ name_rpfx }}" + resource_group: "{{ resource_group }}" register: facts -- assert: - that: - - facts.workspaces | length == 1 +- name: Assert the loganalystics workspace facts + ansible.builtin.assert: + that: + - facts.workspaces | length == 1 - name: Remove workspace azure_rm_loganalyticsworkspace: - name: "{{ name }}" - resource_group: "{{ resource_group }}" - state: absent + name: "{{ name_rpfx }}" + resource_group: "{{ resource_group }}" + state: absent register: output -- assert: - that: - - output.changed +- name: Assert the loganalytics workspace deleted + ansible.builtin.assert: + that: + - output.changed - name: Get workspace azure_rm_loganalyticsworkspace_info: - name: "{{ name }}" - resource_group: "{{ resource_group }}" + name: "{{ name_rpfx }}" + resource_group: "{{ resource_group }}" register: facts -- assert: - that: - - facts.workspaces | length == 0 +- name: Assert the loganalystics workspace facts + ansible.builtin.assert: + that: + - facts.workspaces | length == 0 - name: Remove workspace (idempontent) azure_rm_loganalyticsworkspace: - name: "{{ name }}" - resource_group: "{{ resource_group }}" - state: absent + name: "{{ name_rpfx }}" + resource_group: "{{ resource_group }}" + state: absent register: output -- assert: - that: - - not output.changed +- name: Assert the loganalystics workspace deleted + ansible.builtin.assert: + that: + - not output.changed diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/inventory_azure/playbooks/create_inventory_config.yml b/ansible_collections/azure/azcollection/tests/integration/targets/inventory_azure/playbooks/create_inventory_config.yml index 6ed4067af..79699d69b 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/inventory_azure/playbooks/create_inventory_config.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/inventory_azure/playbooks/create_inventory_config.yml @@ -1,11 +1,13 @@ --- -- hosts: localhost +- name: Config inventory file + hosts: localhost connection: local - gather_facts: no + gather_facts: false vars: template_name: "../templates/{{ template | default('basic.yml') }}" tasks: - - name: write inventory config file - copy: + - name: Write inventory config file + ansible.builtin.copy: dest: ../test.azure_rm.yml content: "{{ lookup('template', template_name) }}" + mode: preserve diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/inventory_azure/playbooks/empty_inventory_config.yml b/ansible_collections/azure/azcollection/tests/integration/targets/inventory_azure/playbooks/empty_inventory_config.yml index 06a427931..41811854b 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/inventory_azure/playbooks/empty_inventory_config.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/inventory_azure/playbooks/empty_inventory_config.yml @@ -1,9 +1,11 @@ --- -- hosts: localhost +- name: Empty inventory file + hosts: localhost connection: local - gather_facts: no + gather_facts: false tasks: - - name: write inventory config file - copy: + - name: Write inventory config file + ansible.builtin.copy: dest: ../test.azure_rm.yml content: "" + mode: preserve diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/inventory_azure/playbooks/setup.yml b/ansible_collections/azure/azcollection/tests/integration/targets/inventory_azure/playbooks/setup.yml index a8358089f..f162e9134 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/inventory_azure/playbooks/setup.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/inventory_azure/playbooks/setup.yml @@ -1,48 +1,49 @@ --- -- hosts: localhost +- name: Set hosts + hosts: localhost connection: local - gather_facts: no - + gather_facts: false tasks: - - include_vars: vars.yml - - name: SETUP | Create storage account - azure_rm_storageaccount: - resource_group: "{{ resource_group }}" - name: "{{ storage_account }}" - account_type: Standard_LRS + - name: Set facts + ansible.builtin.include_vars: vars.yml + - name: SETUP | Create storage account + azure_rm_storageaccount: + resource_group: "{{ resource_group }}" + name: "{{ storage_account }}" + account_type: Standard_LRS - - name: SETUP | Create availability set - azure_rm_availabilityset: - name: "{{ availability_set }}" - resource_group: "{{ resource_group }}" + - name: SETUP | Create availability set + azure_rm_availabilityset: + name: "{{ availability_set }}" + resource_group: "{{ resource_group }}" - - name: SETUP | Create virtual network - azure_rm_virtualnetwork: - resource_group: "{{ resource_group }}" - name: "{{ network_name }}" - address_prefixes: "{{ network }}" + - name: SETUP | Create virtual network + azure_rm_virtualnetwork: + resource_group: "{{ resource_group }}" + name: "{{ network_name }}" + address_prefixes: "{{ network }}" - - name: SETUP | Create subnet - azure_rm_subnet: - resource_group: "{{ resource_group }}" - name: "{{ subnet_name }}" - address_prefix: "{{ subnet }}" - virtual_network: "{{ network_name }}" + - name: SETUP | Create subnet + azure_rm_subnet: + resource_group: "{{ resource_group }}" + name: "{{ subnet_name }}" + address_prefix: "{{ subnet }}" + virtual_network: "{{ network_name }}" - - name: Create minimal VM with defaults - azure_rm_virtualmachine: - resource_group: "{{ resource_group }}" - name: "{{ vm_name }}" - admin_username: testuser - ssh_password_enabled: false - ssh_public_keys: - - path: /home/testuser/.ssh/authorized_keys - key_data: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfoYlIV4lTPZTv7hXaVwQQuqBgGs4yeNRX0SPo2+HQt9u4X7IGwrtXc0nEUm6LfaCikMH58bOL8f20NTGz285kxdFHZRcBXtqmnMz2rXwhK9gwq5h1khc+GzHtdcJXsGA4y0xuaNcidcg04jxAlN/06fwb/VYwwWTVbypNC0gpGEpWckCNm8vlDlA55sU5et0SZ+J0RKVvEaweUOeNbFZqckGPA384imfeYlADppK/7eAxqfBVadVvZG8IJk4yvATgaIENIFj2cXxqu2mQ/Bp5Wr45uApvJsFXmi+v/nkiOEV1QpLOnEwAZo6EfFS4CCQtsymxJCl1PxdJ5LD4ZOtP xiuxi.sun@qq.com" - vm_size: Standard_B1ms - virtual_network: "{{ network_name }}" - image: - offer: UbuntuServer - publisher: Canonical - sku: 16.04-LTS - version: latest - register: vm_output + - name: Create minimal VM with defaults + azure_rm_virtualmachine: + resource_group: "{{ resource_group }}" + name: "{{ vm_name }}" + admin_username: testuser + ssh_password_enabled: false + ssh_public_keys: + - path: /home/testuser/.ssh/authorized_keys + key_data: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfoYlIV4lTPZTv7hXaVwQQuqBgGs4yeNRX0SPo2+HQt9u4X7IGwrtXc0nEUm6LfaCikMH58bOL8f20NTGz285kxdFHZRcBXtqmnMz2rXwhK9gwq5h1khc+GzHtdcJXsGA4y0xuaNcidcg04jxAlN/06fwb/VYwwWTVbypNC0gpGEpWckCNm8vlDlA55sU5et0SZ+J0RKVvEaweUOeNbFZqckGPA384imfeYlADppK/7eAxqfBVadVvZG8IJk4yvATgaIENIFj2cXxqu2mQ/Bp5Wr45uApvJsFXmi+v/nkiOEV1QpLOnEwAZo6EfFS4CCQtsymxJCl1PxdJ5LD4ZOtP xiuxi.sun@qq.com" + vm_size: Standard_B1ms + virtual_network: "{{ network_name }}" + image: + offer: 0001-com-ubuntu-server-focal + publisher: Canonical + sku: 20_04-lts + version: latest + register: vm_output diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/inventory_azure/playbooks/teardown.yml b/ansible_collections/azure/azcollection/tests/integration/targets/inventory_azure/playbooks/teardown.yml index 3a1adfdd4..2a131033a 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/inventory_azure/playbooks/teardown.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/inventory_azure/playbooks/teardown.yml @@ -1,40 +1,42 @@ --- -- hosts: localhost +- name: Destroy all resource + hosts: localhost connection: local - gather_facts: no + gather_facts: false tasks: - - include_vars: vars.yml + - name: Set facts + ansible.builtin.include_vars: vars.yml - - name: Delete VM - azure_rm_virtualmachine: - resource_group: "{{ resource_group }}" - name: "{{ vm_name }}" - remove_on_absent: all_autocreated - state: absent + - name: Delete VM + azure_rm_virtualmachine: + resource_group: "{{ resource_group }}" + name: "{{ vm_name }}" + remove_on_absent: all_autocreated + state: absent - - name: Destroy subnet - azure_rm_subnet: - resource_group: "{{ resource_group }}" - virtual_network: "{{ network_name }}" - name: "{{ subnet_name }}" - state: absent + - name: Destroy subnet + azure_rm_subnet: + resource_group: "{{ resource_group }}" + virtual_network: "{{ network_name }}" + name: "{{ subnet_name }}" + state: absent - - name: Destroy virtual network - azure_rm_virtualnetwork: - resource_group: "{{ resource_group }}" - name: "{{ network_name }}" - state: absent + - name: Destroy virtual network + azure_rm_virtualnetwork: + resource_group: "{{ resource_group }}" + name: "{{ network_name }}" + state: absent - - name: Destroy availability set - azure_rm_availabilityset: - resource_group: "{{ resource_group }}" - name: "{{ availability_set }}" - state: absent + - name: Destroy availability set + azure_rm_availabilityset: + resource_group: "{{ resource_group }}" + name: "{{ availability_set }}" + state: absent - - name: Destroy storage account - azure_rm_storageaccount: - resource_group: "{{ resource_group }}" - name: "{{ storage_account }}" - force_delete_nonempty: yes - state: absent
\ No newline at end of file + - name: Destroy storage account + azure_rm_storageaccount: + resource_group: "{{ resource_group }}" + name: "{{ storage_account }}" + force_delete_nonempty: true + state: absent diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/inventory_azure/playbooks/test_inventory.yml b/ansible_collections/azure/azcollection/tests/integration/targets/inventory_azure/playbooks/test_inventory.yml index fd39a273c..b00e48247 100644 --- a/ansible_collections/azure/azcollection/tests/integration/targets/inventory_azure/playbooks/test_inventory.yml +++ b/ansible_collections/azure/azcollection/tests/integration/targets/inventory_azure/playbooks/test_inventory.yml @@ -1,16 +1,20 @@ --- -- hosts: localhost +- name: Config hosts + hosts: localhost connection: local - gather_facts: no + gather_facts: false tasks: - - include_vars: vars.yml + - name: Set facts + ansible.builtin.include_vars: vars.yml - - name: Pause for 10 mimutes for updating - shell: sleep 600 + - name: Pause for 10 mimutes for updating + ansible.builtin.command: sleep 600 + changed_when: false - - meta: refresh_inventory + - name: Refresh inventory + ansible.builtin.meta: refresh_inventory - - name: Test Inventory - assert: - that: - - vm_name in hostvars + - name: Test Inventory + ansible.builtin.assert: + that: + - vm_name in hostvars diff --git a/ansible_collections/azure/azcollection/tests/integration/targets/inventory_azure/runme.sh b/ansible_collections/azure/azcollection/tests/integration/targets/inventory_azure/runme.sh index 6f381c0a5..6f381c0a5 100644..100755 --- a/ansible_collections/azure/azcollection/tests/integration/targets/inventory_azure/runme.sh +++ b/ansible_collections/azure/azcollection/tests/integration/targets/inventory_azure/runme.sh diff --git a/ansible_collections/azure/azcollection/tests/lint/ignore-lint.txt b/ansible_collections/azure/azcollection/tests/lint/ignore-lint.txt new file mode 100644 index 000000000..55878110f --- /dev/null +++ b/ansible_collections/azure/azcollection/tests/lint/ignore-lint.txt @@ -0,0 +1,5 @@ +--- +skip_list: + - yaml[line-length] + - sanity[cannot-ignore] + - no-handler diff --git a/ansible_collections/azure/azcollection/tests/sanity/ignore-2.10.txt b/ansible_collections/azure/azcollection/tests/sanity/ignore-2.10.txt deleted file mode 100644 index bde4b19b6..000000000 --- a/ansible_collections/azure/azcollection/tests/sanity/ignore-2.10.txt +++ /dev/null @@ -1,270 +0,0 @@ -plugins/modules/azure_rm_aks.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_aks.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_aks.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_aks.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_aks.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_aks.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_aks_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_aksversion_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_apimanagement.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_appgateway.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_appgateway.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_appgateway.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_appgateway.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_applicationsecuritygroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_applicationsecuritygroup_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_appserviceplan.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_appserviceplan_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_availabilityset.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistryreplication.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistryreplication.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_containerregistryreplication.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_containerregistryreplication.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_containerregistryreplication_info.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_containerregistryreplication_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistryreplication_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_containerregistryreplication_info.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_containerregistrywebhook_info.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_containerregistrywebhook_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistrywebhook_info.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_datalakestore.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_deployment.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_deployment.py validate-modules:return-syntax-error -plugins/modules/azure_rm_deployment_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_deployment_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_dnsrecordset.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_dnszone.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_dnszone_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_dnszone_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_functionapp.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_functionapp.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_functionapp_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_gallery.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_galleryimage.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_galleryimage.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_galleryimage.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_galleryimage_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_galleryimageversion.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_galleryimageversion.py validate-modules:doc-type-does-not-match-spec -plugins/modules/azure_rm_galleryimageversion.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_galleryimageversion.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_galleryimageversion.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_galleryimageversion.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_iothubconsumergroup.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_keyvault.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_keyvault.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_keyvault.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_keyvault.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_keyvaultkey.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_keyvaultkey_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_keyvaultsecret.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_manageddisk.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_manageddisk_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_managementgroup.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_networkinterface.py validate-modules:doc-missing-type -plugins/modules/azure_rm_networkinterface.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_networkinterface.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_networkinterface.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_networkinterface.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_networkinterface_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_networkinterface_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_publicipaddress.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_publicipaddress.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_publicipaddress.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_publicipaddress_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_resource.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_resource.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_resource_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_resource_info.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_resourcegroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_resourcegroup_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_registrationdefinition.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_registrationassignment.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_securitygroup.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_securitygroup.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_securitygroup.py validate-modules:missing-suboption-docs -plugins/modules/azure_rm_securitygroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_securitygroup.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_securitygroup.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_securitygroup.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_securitygroup.py validate-modules:mutually_exclusive-unknown -plugins/modules/azure_rm_securitygroup_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_storageaccount.py validate-modules:doc-missing-type -plugins/modules/azure_rm_storageaccount.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_storageaccount.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_storageaccount_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_storageaccount_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_storageblob.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_subnet.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_subnet.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_subnet_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachine.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachine.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_virtualmachine.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_virtualmachine.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_virtualmachine_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachineimage_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescaleset.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescaleset.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_virtualmachinescaleset.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_virtualmachinescaleset_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescalesetextension.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescalesetextension.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_virtualmachinescalesetextension_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescalesetinstance.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescalesetinstance.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_virtualmachinescalesetinstance_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualwan.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualwan.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_virtualwan.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_webapp.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_webapp.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_webapp.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_webapp_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_webappslot.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_webappslot.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_webappslot.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_autoscale.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_autoscale.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_autoscale.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_autoscale_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cdnendpoint.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cdnendpoint.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_cdnendpoint.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_devtestlab.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlab_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabarmtemplate_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabartifact_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabartifactsource.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabartifactsource_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabcustomimage.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabcustomimage_info.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_devtestlabcustomimage_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabenvironment.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_devtestlabenvironment_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabpolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabpolicy_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabvirtualmachine.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabvirtualmachine.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_devtestlabvirtualmachine.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_devtestlabvirtualmachine.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_devtestlabvirtualmachine_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabvirtualnetwork.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_hdinsightcluster.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_hdinsightcluster.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_loadbalancer.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_loadbalancer.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_loadbalancer.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_loadbalancer.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_loadbalancer.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_loganalyticsworkspace.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_loganalyticsworkspace_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mariadbconfiguration_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_mariadbdatabase.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mariadbfirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mariadbserver.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mysqlconfiguration.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mysqlconfiguration_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_mysqldatabase.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mysqlfirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mysqlfirewallrule.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_postgresqlconfiguration.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_postgresqlconfiguration_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_postgresqldatabase.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_postgresqlfirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_rediscache.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_rediscache.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_rediscache.py validate-modules:doc-type-does-not-match-spec -plugins/modules/azure_rm_rediscache.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_rediscache_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_rediscachefirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_roleassignment.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_roleassignment_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_route.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_routetable.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_routetable_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebus.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebus_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebus_info.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_servicebusqueue.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebustopic.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebustopic.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_servicebustopicsubscription.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebussaspolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebussaspolicy.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_snapshot.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_snapshot.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_sqldatabase.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqldatabase_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqlfirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqlfirewallrule_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqlserver.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqlserver_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanager.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanager.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_trafficmanager.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_trafficmanager.py validate-modules:invalid-documentation -plugins/modules/azure_rm_trafficmanager.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_trafficmanager.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_trafficmanager.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_trafficmanagerendpoint.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanagerendpoint_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanagerprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanagerprofile.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_trafficmanagerprofile.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_trafficmanagerprofile.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_trafficmanagerprofile_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetwork.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetwork.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_virtualnetwork_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetworkpeering.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetworkpeering.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_virtualnetworkpeering_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-missing-type -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_vpnsite.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_batchaccount.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_batchaccount.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_cdnendpoint_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cdnendpoint_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_cdnprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cosmosdbaccount_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabschedule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabschedule_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_hdinsightcluster_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_hdinsightcluster_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_lock_info.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_cdnprofile_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_azurefirewall.py validate-modules:missing-suboption-docs -plugins/modules/azure_rm_azurefirewall.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_azurefirewall.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_azurefirewall.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_azurefirewall.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_adpassword.py validate-modules:return-syntax-error -plugins/modules/azure_rm_adpassword.py validate-modules:import-before-documentation -plugins/modules/azure_rm_adpassword.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_adpassword_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_adpassword_info.py validate-modules:import-before-documentation -plugins/modules/azure_rm_adserviceprincipal.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_apimanagementservice.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_openshiftmanagedcluster.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_openshiftmanagedcluster.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_subnet.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_vmbackuppolicy.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_privatednsrecordset.py validate-modules:invalid-ansiblemodule-schema -tests/utils/shippable/check_matrix.py replace-urlopen -tests/utils/shippable/timing.py shebang diff --git a/ansible_collections/azure/azcollection/tests/sanity/ignore-2.11.txt b/ansible_collections/azure/azcollection/tests/sanity/ignore-2.11.txt deleted file mode 100644 index bde4b19b6..000000000 --- a/ansible_collections/azure/azcollection/tests/sanity/ignore-2.11.txt +++ /dev/null @@ -1,270 +0,0 @@ -plugins/modules/azure_rm_aks.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_aks.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_aks.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_aks.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_aks.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_aks.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_aks_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_aksversion_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_apimanagement.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_appgateway.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_appgateway.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_appgateway.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_appgateway.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_applicationsecuritygroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_applicationsecuritygroup_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_appserviceplan.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_appserviceplan_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_availabilityset.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistryreplication.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistryreplication.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_containerregistryreplication.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_containerregistryreplication.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_containerregistryreplication_info.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_containerregistryreplication_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistryreplication_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_containerregistryreplication_info.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_containerregistrywebhook_info.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_containerregistrywebhook_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistrywebhook_info.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_datalakestore.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_deployment.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_deployment.py validate-modules:return-syntax-error -plugins/modules/azure_rm_deployment_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_deployment_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_dnsrecordset.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_dnszone.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_dnszone_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_dnszone_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_functionapp.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_functionapp.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_functionapp_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_gallery.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_galleryimage.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_galleryimage.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_galleryimage.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_galleryimage_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_galleryimageversion.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_galleryimageversion.py validate-modules:doc-type-does-not-match-spec -plugins/modules/azure_rm_galleryimageversion.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_galleryimageversion.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_galleryimageversion.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_galleryimageversion.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_iothubconsumergroup.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_keyvault.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_keyvault.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_keyvault.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_keyvault.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_keyvaultkey.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_keyvaultkey_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_keyvaultsecret.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_manageddisk.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_manageddisk_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_managementgroup.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_networkinterface.py validate-modules:doc-missing-type -plugins/modules/azure_rm_networkinterface.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_networkinterface.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_networkinterface.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_networkinterface.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_networkinterface_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_networkinterface_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_publicipaddress.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_publicipaddress.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_publicipaddress.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_publicipaddress_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_resource.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_resource.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_resource_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_resource_info.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_resourcegroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_resourcegroup_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_registrationdefinition.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_registrationassignment.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_securitygroup.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_securitygroup.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_securitygroup.py validate-modules:missing-suboption-docs -plugins/modules/azure_rm_securitygroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_securitygroup.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_securitygroup.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_securitygroup.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_securitygroup.py validate-modules:mutually_exclusive-unknown -plugins/modules/azure_rm_securitygroup_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_storageaccount.py validate-modules:doc-missing-type -plugins/modules/azure_rm_storageaccount.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_storageaccount.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_storageaccount_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_storageaccount_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_storageblob.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_subnet.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_subnet.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_subnet_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachine.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachine.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_virtualmachine.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_virtualmachine.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_virtualmachine_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachineimage_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescaleset.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescaleset.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_virtualmachinescaleset.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_virtualmachinescaleset_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescalesetextension.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescalesetextension.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_virtualmachinescalesetextension_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescalesetinstance.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescalesetinstance.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_virtualmachinescalesetinstance_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualwan.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualwan.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_virtualwan.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_webapp.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_webapp.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_webapp.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_webapp_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_webappslot.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_webappslot.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_webappslot.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_autoscale.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_autoscale.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_autoscale.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_autoscale_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cdnendpoint.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cdnendpoint.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_cdnendpoint.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_devtestlab.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlab_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabarmtemplate_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabartifact_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabartifactsource.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabartifactsource_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabcustomimage.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabcustomimage_info.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_devtestlabcustomimage_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabenvironment.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_devtestlabenvironment_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabpolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabpolicy_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabvirtualmachine.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabvirtualmachine.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_devtestlabvirtualmachine.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_devtestlabvirtualmachine.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_devtestlabvirtualmachine_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabvirtualnetwork.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_hdinsightcluster.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_hdinsightcluster.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_loadbalancer.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_loadbalancer.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_loadbalancer.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_loadbalancer.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_loadbalancer.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_loganalyticsworkspace.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_loganalyticsworkspace_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mariadbconfiguration_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_mariadbdatabase.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mariadbfirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mariadbserver.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mysqlconfiguration.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mysqlconfiguration_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_mysqldatabase.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mysqlfirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mysqlfirewallrule.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_postgresqlconfiguration.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_postgresqlconfiguration_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_postgresqldatabase.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_postgresqlfirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_rediscache.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_rediscache.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_rediscache.py validate-modules:doc-type-does-not-match-spec -plugins/modules/azure_rm_rediscache.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_rediscache_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_rediscachefirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_roleassignment.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_roleassignment_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_route.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_routetable.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_routetable_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebus.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebus_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebus_info.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_servicebusqueue.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebustopic.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebustopic.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_servicebustopicsubscription.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebussaspolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebussaspolicy.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_snapshot.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_snapshot.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_sqldatabase.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqldatabase_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqlfirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqlfirewallrule_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqlserver.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqlserver_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanager.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanager.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_trafficmanager.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_trafficmanager.py validate-modules:invalid-documentation -plugins/modules/azure_rm_trafficmanager.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_trafficmanager.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_trafficmanager.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_trafficmanagerendpoint.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanagerendpoint_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanagerprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanagerprofile.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_trafficmanagerprofile.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_trafficmanagerprofile.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_trafficmanagerprofile_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetwork.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetwork.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_virtualnetwork_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetworkpeering.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetworkpeering.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_virtualnetworkpeering_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-missing-type -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_vpnsite.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_batchaccount.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_batchaccount.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_cdnendpoint_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cdnendpoint_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_cdnprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cosmosdbaccount_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabschedule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabschedule_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_hdinsightcluster_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_hdinsightcluster_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_lock_info.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_cdnprofile_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_azurefirewall.py validate-modules:missing-suboption-docs -plugins/modules/azure_rm_azurefirewall.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_azurefirewall.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_azurefirewall.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_azurefirewall.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_adpassword.py validate-modules:return-syntax-error -plugins/modules/azure_rm_adpassword.py validate-modules:import-before-documentation -plugins/modules/azure_rm_adpassword.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_adpassword_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_adpassword_info.py validate-modules:import-before-documentation -plugins/modules/azure_rm_adserviceprincipal.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_apimanagementservice.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_openshiftmanagedcluster.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_openshiftmanagedcluster.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_subnet.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_vmbackuppolicy.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_privatednsrecordset.py validate-modules:invalid-ansiblemodule-schema -tests/utils/shippable/check_matrix.py replace-urlopen -tests/utils/shippable/timing.py shebang diff --git a/ansible_collections/azure/azcollection/tests/sanity/ignore-2.12.txt b/ansible_collections/azure/azcollection/tests/sanity/ignore-2.12.txt deleted file mode 100644 index bde4b19b6..000000000 --- a/ansible_collections/azure/azcollection/tests/sanity/ignore-2.12.txt +++ /dev/null @@ -1,270 +0,0 @@ -plugins/modules/azure_rm_aks.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_aks.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_aks.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_aks.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_aks.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_aks.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_aks_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_aksversion_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_apimanagement.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_appgateway.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_appgateway.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_appgateway.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_appgateway.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_applicationsecuritygroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_applicationsecuritygroup_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_appserviceplan.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_appserviceplan_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_availabilityset.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistryreplication.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistryreplication.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_containerregistryreplication.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_containerregistryreplication.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_containerregistryreplication_info.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_containerregistryreplication_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistryreplication_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_containerregistryreplication_info.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_containerregistrywebhook_info.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_containerregistrywebhook_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistrywebhook_info.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_datalakestore.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_deployment.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_deployment.py validate-modules:return-syntax-error -plugins/modules/azure_rm_deployment_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_deployment_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_dnsrecordset.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_dnszone.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_dnszone_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_dnszone_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_functionapp.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_functionapp.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_functionapp_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_gallery.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_galleryimage.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_galleryimage.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_galleryimage.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_galleryimage_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_galleryimageversion.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_galleryimageversion.py validate-modules:doc-type-does-not-match-spec -plugins/modules/azure_rm_galleryimageversion.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_galleryimageversion.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_galleryimageversion.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_galleryimageversion.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_iothubconsumergroup.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_keyvault.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_keyvault.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_keyvault.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_keyvault.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_keyvaultkey.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_keyvaultkey_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_keyvaultsecret.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_manageddisk.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_manageddisk_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_managementgroup.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_networkinterface.py validate-modules:doc-missing-type -plugins/modules/azure_rm_networkinterface.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_networkinterface.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_networkinterface.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_networkinterface.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_networkinterface_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_networkinterface_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_publicipaddress.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_publicipaddress.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_publicipaddress.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_publicipaddress_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_resource.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_resource.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_resource_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_resource_info.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_resourcegroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_resourcegroup_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_registrationdefinition.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_registrationassignment.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_securitygroup.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_securitygroup.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_securitygroup.py validate-modules:missing-suboption-docs -plugins/modules/azure_rm_securitygroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_securitygroup.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_securitygroup.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_securitygroup.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_securitygroup.py validate-modules:mutually_exclusive-unknown -plugins/modules/azure_rm_securitygroup_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_storageaccount.py validate-modules:doc-missing-type -plugins/modules/azure_rm_storageaccount.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_storageaccount.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_storageaccount_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_storageaccount_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_storageblob.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_subnet.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_subnet.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_subnet_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachine.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachine.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_virtualmachine.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_virtualmachine.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_virtualmachine_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachineimage_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescaleset.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescaleset.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_virtualmachinescaleset.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_virtualmachinescaleset_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescalesetextension.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescalesetextension.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_virtualmachinescalesetextension_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescalesetinstance.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescalesetinstance.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_virtualmachinescalesetinstance_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualwan.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualwan.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_virtualwan.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_webapp.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_webapp.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_webapp.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_webapp_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_webappslot.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_webappslot.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_webappslot.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_autoscale.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_autoscale.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_autoscale.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_autoscale_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cdnendpoint.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cdnendpoint.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_cdnendpoint.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_devtestlab.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlab_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabarmtemplate_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabartifact_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabartifactsource.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabartifactsource_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabcustomimage.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabcustomimage_info.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_devtestlabcustomimage_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabenvironment.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_devtestlabenvironment_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabpolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabpolicy_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabvirtualmachine.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabvirtualmachine.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_devtestlabvirtualmachine.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_devtestlabvirtualmachine.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_devtestlabvirtualmachine_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabvirtualnetwork.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_hdinsightcluster.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_hdinsightcluster.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_loadbalancer.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_loadbalancer.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_loadbalancer.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_loadbalancer.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_loadbalancer.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_loganalyticsworkspace.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_loganalyticsworkspace_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mariadbconfiguration_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_mariadbdatabase.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mariadbfirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mariadbserver.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mysqlconfiguration.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mysqlconfiguration_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_mysqldatabase.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mysqlfirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mysqlfirewallrule.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_postgresqlconfiguration.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_postgresqlconfiguration_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_postgresqldatabase.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_postgresqlfirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_rediscache.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_rediscache.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_rediscache.py validate-modules:doc-type-does-not-match-spec -plugins/modules/azure_rm_rediscache.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_rediscache_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_rediscachefirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_roleassignment.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_roleassignment_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_route.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_routetable.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_routetable_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebus.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebus_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebus_info.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_servicebusqueue.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebustopic.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebustopic.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_servicebustopicsubscription.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebussaspolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebussaspolicy.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_snapshot.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_snapshot.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_sqldatabase.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqldatabase_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqlfirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqlfirewallrule_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqlserver.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqlserver_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanager.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanager.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_trafficmanager.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_trafficmanager.py validate-modules:invalid-documentation -plugins/modules/azure_rm_trafficmanager.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_trafficmanager.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_trafficmanager.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_trafficmanagerendpoint.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanagerendpoint_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanagerprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanagerprofile.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_trafficmanagerprofile.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_trafficmanagerprofile.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_trafficmanagerprofile_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetwork.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetwork.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_virtualnetwork_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetworkpeering.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetworkpeering.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_virtualnetworkpeering_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-missing-type -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_vpnsite.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_batchaccount.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_batchaccount.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_cdnendpoint_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cdnendpoint_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_cdnprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cosmosdbaccount_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabschedule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabschedule_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_hdinsightcluster_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_hdinsightcluster_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_lock_info.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_cdnprofile_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_azurefirewall.py validate-modules:missing-suboption-docs -plugins/modules/azure_rm_azurefirewall.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_azurefirewall.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_azurefirewall.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_azurefirewall.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_adpassword.py validate-modules:return-syntax-error -plugins/modules/azure_rm_adpassword.py validate-modules:import-before-documentation -plugins/modules/azure_rm_adpassword.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_adpassword_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_adpassword_info.py validate-modules:import-before-documentation -plugins/modules/azure_rm_adserviceprincipal.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_apimanagementservice.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_openshiftmanagedcluster.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_openshiftmanagedcluster.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_subnet.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_vmbackuppolicy.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_privatednsrecordset.py validate-modules:invalid-ansiblemodule-schema -tests/utils/shippable/check_matrix.py replace-urlopen -tests/utils/shippable/timing.py shebang diff --git a/ansible_collections/azure/azcollection/tests/sanity/ignore-2.13.txt b/ansible_collections/azure/azcollection/tests/sanity/ignore-2.13.txt index 8d42b0a2c..44a2ab267 100644 --- a/ansible_collections/azure/azcollection/tests/sanity/ignore-2.13.txt +++ b/ansible_collections/azure/azcollection/tests/sanity/ignore-2.13.txt @@ -1,269 +1,18 @@ -plugins/modules/azure_rm_aks.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_aks.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_aks.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_aks.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_aks.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_aks.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_aks_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_aksversion_info.py validate-modules:parameter-type-not-in-doc plugins/modules/azure_rm_apimanagement.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_appgateway.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_appgateway.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_appgateway.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_appgateway.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_applicationsecuritygroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_applicationsecuritygroup_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_appserviceplan.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_appserviceplan_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_availabilityset.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistryreplication.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistryreplication.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_containerregistryreplication.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_containerregistryreplication.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_containerregistryreplication_info.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_containerregistryreplication_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistryreplication_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_containerregistryreplication_info.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_containerregistrywebhook_info.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_containerregistrywebhook_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistrywebhook_info.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_datalakestore.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_deployment.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_deployment.py validate-modules:return-syntax-error -plugins/modules/azure_rm_deployment_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_deployment_info.py validate-modules:return-syntax-error plugins/modules/azure_rm_dnsrecordset.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_dnszone.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_dnszone_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_dnszone_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_functionapp.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_functionapp.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_functionapp_info.py validate-modules:parameter-type-not-in-doc plugins/modules/azure_rm_gallery.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_galleryimage.py validate-modules:doc-required-mismatch plugins/modules/azure_rm_galleryimage.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_galleryimage.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_galleryimage_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_galleryimageversion.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_galleryimageversion.py validate-modules:doc-type-does-not-match-spec -plugins/modules/azure_rm_galleryimageversion.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_galleryimageversion.py validate-modules:doc-required-mismatch plugins/modules/azure_rm_galleryimageversion.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_galleryimageversion.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_iothubconsumergroup.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_keyvault.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_keyvault.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_keyvault.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_keyvault.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_keyvaultkey.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_keyvaultkey_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_keyvaultsecret.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_manageddisk.py validate-modules:parameter-type-not-in-doc plugins/modules/azure_rm_managementgroup.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_networkinterface.py validate-modules:doc-missing-type -plugins/modules/azure_rm_networkinterface.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_networkinterface.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_networkinterface.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_networkinterface.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_networkinterface_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_networkinterface_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_publicipaddress.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_publicipaddress.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_publicipaddress.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_publicipaddress_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_resource.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_resource.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_resource_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_resource_info.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_resourcegroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_resourcegroup_info.py validate-modules:parameter-type-not-in-doc plugins/modules/azure_rm_registrationdefinition.py validate-modules:invalid-ansiblemodule-schema plugins/modules/azure_rm_registrationassignment.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_securitygroup.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_securitygroup.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_securitygroup.py validate-modules:missing-suboption-docs -plugins/modules/azure_rm_securitygroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_securitygroup.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_securitygroup.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_securitygroup.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_securitygroup.py validate-modules:mutually_exclusive-unknown -plugins/modules/azure_rm_securitygroup_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_storageaccount.py validate-modules:doc-missing-type -plugins/modules/azure_rm_storageaccount.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_storageaccount.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_storageaccount_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_storageaccount_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_storageblob.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_subnet.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_subnet.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_subnet_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachine.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachine.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_virtualmachine.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_virtualmachine.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_virtualmachine_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachineimage_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescaleset.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescaleset.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_virtualmachinescaleset.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_virtualmachinescaleset_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescalesetextension.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescalesetextension.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_virtualmachinescalesetextension_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescalesetinstance.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescalesetinstance.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_virtualmachinescalesetinstance_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualwan.py validate-modules:parameter-type-not-in-doc plugins/modules/azure_rm_virtualwan.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_virtualwan.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_webapp.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_webapp.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_webapp.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_webapp_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_webappslot.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_webappslot.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_webappslot.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_autoscale.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_autoscale.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_autoscale.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_autoscale_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cdnendpoint.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cdnendpoint.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_cdnendpoint.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_devtestlab.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlab_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabarmtemplate_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabartifact_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabartifactsource.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabartifactsource_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabcustomimage.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabcustomimage_info.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_devtestlabcustomimage_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabenvironment.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_devtestlabenvironment_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabpolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabpolicy_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabvirtualmachine.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabvirtualmachine.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_devtestlabvirtualmachine.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_devtestlabvirtualmachine.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_devtestlabvirtualmachine_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabvirtualnetwork.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_hdinsightcluster.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_hdinsightcluster.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_loadbalancer.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_loadbalancer.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_loadbalancer.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_loadbalancer.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_loadbalancer.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_loganalyticsworkspace.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_loganalyticsworkspace_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mariadbconfiguration_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_mariadbdatabase.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mariadbfirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mariadbserver.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mysqlconfiguration.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mysqlconfiguration_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_mysqldatabase.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mysqlfirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mysqlfirewallrule.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_postgresqlconfiguration.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_postgresqlconfiguration_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_postgresqldatabase.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_postgresqlfirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_rediscache.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_rediscache.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_rediscache.py validate-modules:doc-type-does-not-match-spec -plugins/modules/azure_rm_rediscache.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_rediscache_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_rediscachefirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_roleassignment.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_roleassignment_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_route.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_routetable.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_routetable_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebus.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebus_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebus_info.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_servicebusqueue.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebustopic.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebustopic.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_servicebustopicsubscription.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebussaspolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebussaspolicy.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_snapshot.py validate-modules:doc-required-mismatch plugins/modules/azure_rm_snapshot.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_sqldatabase.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqldatabase_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqlfirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqlfirewallrule_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqlserver.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqlserver_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanager.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanager.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_trafficmanager.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_trafficmanager.py validate-modules:invalid-documentation -plugins/modules/azure_rm_trafficmanager.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_trafficmanager.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_trafficmanager.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_trafficmanagerendpoint.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanagerendpoint_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanagerprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanagerprofile.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_trafficmanagerprofile.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_trafficmanagerprofile.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_trafficmanagerprofile_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetwork.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetwork.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_virtualnetwork_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetworkpeering.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetworkpeering.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_virtualnetworkpeering_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-missing-type -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-required-mismatch plugins/modules/azure_rm_vpnsite.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_batchaccount.py validate-modules:parameter-type-not-in-doc plugins/modules/azure_rm_batchaccount.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_cdnendpoint_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cdnendpoint_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_cdnprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cosmosdbaccount_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabschedule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabschedule_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_hdinsightcluster_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_hdinsightcluster_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_lock_info.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_cdnprofile_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_azurefirewall.py validate-modules:missing-suboption-docs -plugins/modules/azure_rm_azurefirewall.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_azurefirewall.py validate-modules:undocumented-parameter plugins/modules/azure_rm_azurefirewall.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_azurefirewall.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_adpassword.py validate-modules:return-syntax-error -plugins/modules/azure_rm_adpassword.py validate-modules:import-before-documentation -plugins/modules/azure_rm_adpassword.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_adpassword_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_adpassword_info.py validate-modules:import-before-documentation -plugins/modules/azure_rm_adserviceprincipal.py validate-modules:nonexistent-parameter-documented plugins/modules/azure_rm_apimanagementservice.py validate-modules:invalid-ansiblemodule-schema plugins/modules/azure_rm_openshiftmanagedcluster.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_openshiftmanagedcluster.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_subnet.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_vmbackuppolicy.py validate-modules:parameter-list-no-elements plugins/modules/azure_rm_privatednsrecordset.py validate-modules:invalid-ansiblemodule-schema tests/utils/shippable/check_matrix.py replace-urlopen tests/utils/shippable/timing.py shebang diff --git a/ansible_collections/azure/azcollection/tests/sanity/ignore-2.14.txt b/ansible_collections/azure/azcollection/tests/sanity/ignore-2.14.txt index 20be76d1f..44a2ab267 100644 --- a/ansible_collections/azure/azcollection/tests/sanity/ignore-2.14.txt +++ b/ansible_collections/azure/azcollection/tests/sanity/ignore-2.14.txt @@ -1,266 +1,18 @@ -plugins/modules/azure_rm_aks.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_aks.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_aks.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_aks.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_aks.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_aks.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_aks_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_aksversion_info.py validate-modules:parameter-type-not-in-doc plugins/modules/azure_rm_apimanagement.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_appgateway.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_appgateway.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_appgateway.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_appgateway.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_applicationsecuritygroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_applicationsecuritygroup_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_appserviceplan.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_appserviceplan_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_availabilityset.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistryreplication.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistryreplication.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_containerregistryreplication.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_containerregistryreplication.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_containerregistryreplication_info.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_containerregistryreplication_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistryreplication_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_containerregistryreplication_info.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_containerregistrywebhook_info.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_containerregistrywebhook_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistrywebhook_info.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_datalakestore.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_deployment.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_deployment.py validate-modules:return-syntax-error -plugins/modules/azure_rm_deployment_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_deployment_info.py validate-modules:return-syntax-error plugins/modules/azure_rm_dnsrecordset.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_dnszone.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_dnszone_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_dnszone_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_functionapp.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_functionapp.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_functionapp_info.py validate-modules:parameter-type-not-in-doc plugins/modules/azure_rm_gallery.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_galleryimage.py validate-modules:doc-required-mismatch plugins/modules/azure_rm_galleryimage.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_galleryimage.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_galleryimage_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_galleryimageversion.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_galleryimageversion.py validate-modules:doc-type-does-not-match-spec -plugins/modules/azure_rm_galleryimageversion.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_galleryimageversion.py validate-modules:doc-required-mismatch plugins/modules/azure_rm_galleryimageversion.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_galleryimageversion.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_iothubconsumergroup.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_keyvault.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_keyvault.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_keyvault.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_keyvault.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_keyvaultkey.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_keyvaultkey_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_keyvaultsecret.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_manageddisk.py validate-modules:parameter-type-not-in-doc plugins/modules/azure_rm_managementgroup.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_networkinterface.py validate-modules:doc-missing-type -plugins/modules/azure_rm_networkinterface.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_networkinterface.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_networkinterface.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_networkinterface.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_networkinterface_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_networkinterface_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_publicipaddress.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_publicipaddress.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_publicipaddress.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_publicipaddress_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_resource.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_resource.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_resource_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_resource_info.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_resourcegroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_resourcegroup_info.py validate-modules:parameter-type-not-in-doc plugins/modules/azure_rm_registrationdefinition.py validate-modules:invalid-ansiblemodule-schema plugins/modules/azure_rm_registrationassignment.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_securitygroup.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_securitygroup.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_securitygroup.py validate-modules:missing-suboption-docs -plugins/modules/azure_rm_securitygroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_securitygroup.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_securitygroup.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_securitygroup.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_securitygroup.py validate-modules:mutually_exclusive-unknown -plugins/modules/azure_rm_securitygroup_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_storageaccount.py validate-modules:doc-missing-type -plugins/modules/azure_rm_storageaccount.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_storageaccount.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_storageaccount_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_storageaccount_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_storageblob.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_subnet.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_subnet.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_subnet_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachine.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachine.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_virtualmachine.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_virtualmachine.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_virtualmachine_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachineimage_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescaleset.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescaleset.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_virtualmachinescaleset.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_virtualmachinescaleset_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescalesetextension.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescalesetextension.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_virtualmachinescalesetextension_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescalesetinstance.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescalesetinstance.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_virtualmachinescalesetinstance_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualwan.py validate-modules:parameter-type-not-in-doc plugins/modules/azure_rm_virtualwan.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_virtualwan.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_webapp.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_webapp.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_webapp.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_webapp_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_webappslot.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_webappslot.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_webappslot.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_autoscale.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_autoscale.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_autoscale.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_autoscale_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cdnendpoint.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cdnendpoint.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_cdnendpoint.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_devtestlab.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlab_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabarmtemplate_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabartifact_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabartifactsource.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabartifactsource_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabcustomimage.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabcustomimage_info.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_devtestlabcustomimage_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabenvironment.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_devtestlabenvironment_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabpolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabpolicy_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabvirtualmachine.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabvirtualmachine.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_devtestlabvirtualmachine.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_devtestlabvirtualmachine.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_devtestlabvirtualmachine_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_devtestlabvirtualnetwork.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_hdinsightcluster.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_hdinsightcluster.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_loadbalancer.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_loadbalancer.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_loadbalancer.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_loadbalancer.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_loadbalancer.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_loganalyticsworkspace.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_loganalyticsworkspace_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mariadbdatabase.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mariadbfirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mariadbserver.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mysqlconfiguration.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mysqldatabase.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mysqlfirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mysqlfirewallrule.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_postgresqlconfiguration.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_postgresqldatabase.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_postgresqlfirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_rediscache.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_rediscache.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_rediscache.py validate-modules:doc-type-does-not-match-spec -plugins/modules/azure_rm_rediscache.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_rediscache_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_rediscachefirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_roleassignment.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_roleassignment_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_route.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_routetable.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_routetable_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebus.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebus_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebus_info.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_servicebusqueue.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebustopic.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebustopic.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_servicebustopicsubscription.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebussaspolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebussaspolicy.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_snapshot.py validate-modules:doc-required-mismatch plugins/modules/azure_rm_snapshot.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_sqldatabase.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqldatabase_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqlfirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqlfirewallrule_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqlserver.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqlserver_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanager.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanager.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_trafficmanager.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_trafficmanager.py validate-modules:invalid-documentation -plugins/modules/azure_rm_trafficmanager.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_trafficmanager.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_trafficmanager.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_trafficmanagerendpoint.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanagerendpoint_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanagerprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanagerprofile.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_trafficmanagerprofile.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_trafficmanagerprofile.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_trafficmanagerprofile_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetwork.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetwork.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_virtualnetwork_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetworkpeering.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetworkpeering.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_virtualnetworkpeering_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-missing-type -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-required-mismatch plugins/modules/azure_rm_vpnsite.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_batchaccount.py validate-modules:parameter-type-not-in-doc plugins/modules/azure_rm_batchaccount.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_cdnendpoint_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cdnendpoint_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_cdnprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cosmosdbaccount_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabschedule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabschedule_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_hdinsightcluster_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_hdinsightcluster_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_lock_info.py validate-modules:doc-required-mismatch -plugins/modules/azure_rm_cdnprofile_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_azurefirewall.py validate-modules:missing-suboption-docs -plugins/modules/azure_rm_azurefirewall.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_azurefirewall.py validate-modules:undocumented-parameter plugins/modules/azure_rm_azurefirewall.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_azurefirewall.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_adpassword.py validate-modules:return-syntax-error -plugins/modules/azure_rm_adpassword.py validate-modules:import-before-documentation -plugins/modules/azure_rm_adpassword.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_adpassword_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_adpassword_info.py validate-modules:import-before-documentation -plugins/modules/azure_rm_adserviceprincipal.py validate-modules:nonexistent-parameter-documented plugins/modules/azure_rm_apimanagementservice.py validate-modules:invalid-ansiblemodule-schema plugins/modules/azure_rm_openshiftmanagedcluster.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/azure_rm_openshiftmanagedcluster.py validate-modules:parameter-list-no-elements -plugins/modules/azure_rm_subnet.py validate-modules:doc-elements-mismatch -plugins/modules/azure_rm_vmbackuppolicy.py validate-modules:parameter-list-no-elements plugins/modules/azure_rm_privatednsrecordset.py validate-modules:invalid-ansiblemodule-schema tests/utils/shippable/check_matrix.py replace-urlopen tests/utils/shippable/timing.py shebang diff --git a/ansible_collections/azure/azcollection/tests/sanity/ignore-2.15.txt b/ansible_collections/azure/azcollection/tests/sanity/ignore-2.15.txt new file mode 100644 index 000000000..44a2ab267 --- /dev/null +++ b/ansible_collections/azure/azcollection/tests/sanity/ignore-2.15.txt @@ -0,0 +1,18 @@ +plugins/modules/azure_rm_apimanagement.py validate-modules:invalid-ansiblemodule-schema +plugins/modules/azure_rm_dnsrecordset.py validate-modules:invalid-ansiblemodule-schema +plugins/modules/azure_rm_gallery.py validate-modules:invalid-ansiblemodule-schema +plugins/modules/azure_rm_galleryimage.py validate-modules:invalid-ansiblemodule-schema +plugins/modules/azure_rm_galleryimageversion.py validate-modules:invalid-ansiblemodule-schema +plugins/modules/azure_rm_managementgroup.py validate-modules:invalid-ansiblemodule-schema +plugins/modules/azure_rm_registrationdefinition.py validate-modules:invalid-ansiblemodule-schema +plugins/modules/azure_rm_registrationassignment.py validate-modules:invalid-ansiblemodule-schema +plugins/modules/azure_rm_virtualwan.py validate-modules:invalid-ansiblemodule-schema +plugins/modules/azure_rm_snapshot.py validate-modules:invalid-ansiblemodule-schema +plugins/modules/azure_rm_vpnsite.py validate-modules:invalid-ansiblemodule-schema +plugins/modules/azure_rm_batchaccount.py validate-modules:invalid-ansiblemodule-schema +plugins/modules/azure_rm_azurefirewall.py validate-modules:invalid-ansiblemodule-schema +plugins/modules/azure_rm_apimanagementservice.py validate-modules:invalid-ansiblemodule-schema +plugins/modules/azure_rm_openshiftmanagedcluster.py validate-modules:invalid-ansiblemodule-schema +plugins/modules/azure_rm_privatednsrecordset.py validate-modules:invalid-ansiblemodule-schema +tests/utils/shippable/check_matrix.py replace-urlopen +tests/utils/shippable/timing.py shebang diff --git a/ansible_collections/azure/azcollection/tests/sanity/ignore-2.9.txt b/ansible_collections/azure/azcollection/tests/sanity/ignore-2.9.txt deleted file mode 100644 index 3947cceb3..000000000 --- a/ansible_collections/azure/azcollection/tests/sanity/ignore-2.9.txt +++ /dev/null @@ -1,165 +0,0 @@ -plugins/modules/azure_rm_aks.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_aks.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_aks.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_aks.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_aks_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_aksversion_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_appgateway.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_appgateway.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_applicationsecuritygroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_applicationsecuritygroup_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_appserviceplan.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_appserviceplan_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_availabilityset.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistryreplication.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistryreplication.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_containerregistryreplication.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_containerregistryreplication.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_containerregistryreplication_info.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_containerregistryreplication_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistryreplication_info.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_containerregistrywebhook.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_containerregistrywebhook_info.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_containerregistrywebhook_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_containerregistrywebhook_info.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_datalakestore.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_deployment.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_deployment_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_dnszone.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_dnszone_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_functionapp.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_functionapp_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_galleryimageversion.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_galleryimageversion.py validate-modules:doc-type-does-not-match-spec -plugins/modules/azure_rm_galleryimageversion.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_keyvault.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_keyvault.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_keyvaultkey.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_keyvaultsecret.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_manageddisk.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_networkinterface.py validate-modules:doc-missing-type -plugins/modules/azure_rm_networkinterface.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_networkinterface_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_publicipaddress.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_publicipaddress_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_resource.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_resource_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_resourcegroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_resourcegroup_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_securitygroup.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_securitygroup.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_securitygroup.py validate-modules:missing-suboption-docs -plugins/modules/azure_rm_securitygroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_securitygroup.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_securitygroup_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_storageaccount.py validate-modules:doc-missing-type -plugins/modules/azure_rm_storageaccount.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_storageaccount_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_storageblob.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_subnet.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_subnet_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachine.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachine_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachineimage_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescaleset.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescaleset_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescalesetextension.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescalesetextension_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescalesetinstance.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualmachinescalesetinstance_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualwan.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_webapp.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_webapp_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_webappslot.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_autoscale.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_autoscale.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_autoscale_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cdnendpoint.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_devtestlab.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabartifactsource.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabcustomimage.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabpolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabvirtualmachine.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabvirtualmachine.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_devtestlabvirtualmachine.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_devtestlabvirtualnetwork.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_hdinsightcluster.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_loadbalancer.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_loadbalancer.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_loadbalancer.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_loganalyticsworkspace.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mariadbdatabase.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mariadbfirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mariadbserver.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mysqlconfiguration.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mysqldatabase.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_mysqlfirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_postgresqlconfiguration.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_postgresqldatabase.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_postgresqlfirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_rediscache.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_rediscache.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_rediscache.py validate-modules:doc-type-does-not-match-spec -plugins/modules/azure_rm_rediscache_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_rediscachefirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_roleassignment.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_roleassignment_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_route.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_routetable.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_routetable_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebus.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebus_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebusqueue.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebustopic.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebustopicsubscription.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_servicebussaspolicy.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqldatabase.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqldatabase_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqlfirewallrule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqlfirewallrule_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqlserver.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_sqlserver_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanager.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanager.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_trafficmanager.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_trafficmanager.py validate-modules:invalid-documentation -plugins/modules/azure_rm_trafficmanager.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_trafficmanagerendpoint.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanagerendpoint_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanagerprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_trafficmanagerprofile.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_trafficmanagerprofile.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_trafficmanagerprofile.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_trafficmanagerprofile_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetwork.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetwork_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetworkpeering.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetworkpeering_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-default-does-not-match-spec -plugins/modules/azure_rm_virtualnetworkgateway.py validate-modules:doc-missing-type -plugins/modules/azure_rm_batchaccount.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cdnendpoint_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cdnprofile.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_cosmosdbaccount_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_devtestlabschedule.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_hdinsightcluster_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_loganalyticsworkspace_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_cdnprofile_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_azurefirewall.py validate-modules:missing-suboption-docs -plugins/modules/azure_rm_azurefirewall.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_azurefirewall.py validate-modules:undocumented-parameter -plugins/modules/azure_rm_adpassword.py validate-modules:nonexistent-parameter-documented -plugins/modules/azure_rm_adpassword.py validate-modules:return-syntax-error -plugins/modules/azure_rm_adpassword.py validate-modules:import-before-documentation -plugins/modules/azure_rm_adpassword_info.py validate-modules:import-before-documentation -plugins/modules/azure_rm_adserviceprincipal.py validate-modules:nonexistent-parameter-documented -tests/utils/shippable/check_matrix.py replace-urlopen -tests/utils/shippable/timing.py shebang diff --git a/ansible_collections/azure/azcollection/tests/utils/ado/ado.sh b/ansible_collections/azure/azcollection/tests/utils/ado/ado.sh index b313208ce..bd8a195b3 100644..100755 --- a/ansible_collections/azure/azcollection/tests/utils/ado/ado.sh +++ b/ansible_collections/azure/azcollection/tests/utils/ado/ado.sh @@ -67,6 +67,8 @@ mkdir -p shippable/testresults pip install -I -r "${TEST_DIR}/requirements-azure.txt" pip install -I -r "${TEST_DIR}/sanity-requirements-azure.txt" +pip install ansible-lint + timeout=90 if [ "$4" = "all" ] @@ -107,8 +109,11 @@ AZURE_MANAGED_BY_TENANT_ID:${AZURE_MANAGED_BY_TENANT_ID} AZURE_ROLE_DEFINITION_ID:${AZURE_ROLE_DEFINITION_ID} EOF +rm -rf "ansible" + if [ "sanity" = "${group}" ] then + ansible-lint --exclude "tests/integration/targets/inventory_azure/playbooks/vars.yml" --force-color -c "tests/lint/ignore-lint.txt" ansible-test sanity --color -v --junit else ansible-test integration --color -v --retry-on-error "shippable/azure/group${group}/" --allow-destructive diff --git a/ansible_collections/azure/azcollection/tests/utils/shippable/azure.sh b/ansible_collections/azure/azcollection/tests/utils/shippable/azure.sh index da037e09e..da037e09e 100644..100755 --- a/ansible_collections/azure/azcollection/tests/utils/shippable/azure.sh +++ b/ansible_collections/azure/azcollection/tests/utils/shippable/azure.sh diff --git a/ansible_collections/azure/azcollection/tests/utils/shippable/check_matrix.py b/ansible_collections/azure/azcollection/tests/utils/shippable/check_matrix.py index 96a377589..96a377589 100644..100755 --- a/ansible_collections/azure/azcollection/tests/utils/shippable/check_matrix.py +++ b/ansible_collections/azure/azcollection/tests/utils/shippable/check_matrix.py diff --git a/ansible_collections/azure/azcollection/tests/utils/shippable/cloud.sh b/ansible_collections/azure/azcollection/tests/utils/shippable/cloud.sh index da037e09e..da037e09e 100644..100755 --- a/ansible_collections/azure/azcollection/tests/utils/shippable/cloud.sh +++ b/ansible_collections/azure/azcollection/tests/utils/shippable/cloud.sh diff --git a/ansible_collections/azure/azcollection/tests/utils/shippable/sanity.sh b/ansible_collections/azure/azcollection/tests/utils/shippable/sanity.sh index 0c54a42c8..0c54a42c8 100644..100755 --- a/ansible_collections/azure/azcollection/tests/utils/shippable/sanity.sh +++ b/ansible_collections/azure/azcollection/tests/utils/shippable/sanity.sh diff --git a/ansible_collections/azure/azcollection/tests/utils/shippable/shippable.sh b/ansible_collections/azure/azcollection/tests/utils/shippable/shippable.sh index b67235789..b67235789 100644..100755 --- a/ansible_collections/azure/azcollection/tests/utils/shippable/shippable.sh +++ b/ansible_collections/azure/azcollection/tests/utils/shippable/shippable.sh diff --git a/ansible_collections/azure/azcollection/tests/utils/shippable/timing.py b/ansible_collections/azure/azcollection/tests/utils/shippable/timing.py index d9456855d..d9456855d 100644..100755 --- a/ansible_collections/azure/azcollection/tests/utils/shippable/timing.py +++ b/ansible_collections/azure/azcollection/tests/utils/shippable/timing.py diff --git a/ansible_collections/azure/azcollection/tests/utils/shippable/timing.sh b/ansible_collections/azure/azcollection/tests/utils/shippable/timing.sh index 77e257830..77e257830 100644..100755 --- a/ansible_collections/azure/azcollection/tests/utils/shippable/timing.sh +++ b/ansible_collections/azure/azcollection/tests/utils/shippable/timing.sh |