Init: mediaserver

This commit is contained in:
2023-02-08 12:13:28 +01:00
parent 848bc9739c
commit f7c23d4ba9
31914 changed files with 6175775 additions and 0 deletions

View File

@@ -0,0 +1,621 @@
# Change Log
## v1.14.0 (2022-10-31)
### NEW MODULES
- azure_rm_firewallpolicy: Add new module `azure_rm_firewallpolicy` ([#705](https://github.com/ansible-collections/azure/pull/705))
- azure_rm_privatelinkservice: Add new module `azure_rm_privatelinkservice` ([#858](https://github.com/ansible-collections/azure/pull/858))
- azure_rm_privatelinkservice_info: Add new module `azure_rm_privatelinkservice_info` ([#858](https://github.com/ansible-collections/azure/pull/858))
- azure_rm_privateendpointconnection: Add new module `azure_rm_privateendpointconnection` ([#858](https://github.com/ansible-collections/azure/pull/858))
- azure_rm_privateendpointconnection_info: Add new module `azure_rm_privateendpointconnection_info` ([#858](https://github.com/ansible-collections/azure/pull/858))
- azure_rm_natgateway: Add new module `azure_rm_natgateway` ([#860](https://github.com/ansible-collections/azure/pull/860))
- azure_rm_natgateway_info: Add new module `azure_rm_natgateway_info` ([#860](https://github.com/ansible-collections/azure/pull/860))
- azure_rm_bastionhost: Add new module `azure_rm_bastionhost` ([#873](https://github.com/ansible-collections/azure/pull/873))
- azure_rm_bastionhost_info: Add new module `azure_rm_bastionhost_info` ([#873](https://github.com/ansible-collections/azure/pull/873))
- azure_rm_account_info: Add new module `azure_rm_account_info` to get facts for current logged-in user ([#922](https://github.com/ansible-collections/azure/pull/922))
- azure_rm_virtualhubconnection: Add new module `azure_rm_virtualhubconnection` ([#939](https://github.com/ansible-collections/azure/pull/939))
- azure_rm_virtualhubconnection_info: Add new module `azure_rm_virtualhubconnection_info` ([#939](https://github.com/ansible-collections/azure/pull/939))
- azure_rm_aksagentpool: Add new module `azure_rm_aksagentpool` ([#974](https://github.com/ansible-collections/azure/pull/974))
- azure_rm_aksagentpool_info: Add new module `azure_rm_aksagentpool_info` ([#974](https://github.com/ansible-collections/azure/pull/974))
- azure_rm_aksagentpoolversion_info: Add new module `azure_rm_aksagentpoolversion_info` ([#974](https://github.com/ansible-collections/azure/pull/974))
### FEATURE ENHANCEMENT
- azure_rm_container*: Azure container registry tags ([#830](https://github.com/ansible-collections/azure/pull/830))
- azure_rm_loadbalancer: Support for `disable_outbound_snat` configuration ([#744](https://github.com/ansible-collections/azure/pull/744))
- azure_rm_manageddisk:
- Support for create `StandardSSD_ZRS` and `Premium_ZRS` managed disks ([#855](https://github.com/ansible-collections/azure/pull/855))
- Support for mount disk to multiple VMs ([#867](https://github.com/ansible-collections/azure/pull/867))
- azure_rm_manageddisk_info: Support to mount disk to multiple VMs ([#867](https://github.com/ansible-collections/azure/pull/867))
- azure_rm_virtualmachine:
- Support for create `StandardSSD_ZRS` and `Premium_ZRS` managed disks ([#855](https://github.com/ansible-collections/azure/pull/855))
- Support for configure `enableAutomaticUpdates` ([#933](https://github.com/ansible-collections/azure/pull/933))
- azure_rm_storageaccount:
- Support for configure `static_website` ([#878](https://github.com/ansible-collections/azure/pull/878))
- Support for `public_network_access` ([#875](https://github.com/ansible-collections/azure/pull/875))
- Support for create Azure Data Lake Storage Gen2 storage account ([#998](https://github.com/ansible-collections/azure/pull/998))
- Support for encrypt storage account ([#937](https://github.com/ansible-collections/azure/pull/937))
- azure_rm_storageaccount_info:
- Support for `public_network_access` ([#875](https://github.com/ansible-collections/azure/pull/875))
- Support for Azure Data Lake Storage Gen2 ([#998](https://github.com/ansible-collections/azure/pull/998))
- Support for encrypt storage account ([#937](https://github.com/ansible-collections/azure/pull/937))
- azure_keyvault_secret: Add environment variables to keyvault lookup plugin ([#978](https://github.com/ansible-collections/azure/pull/978))
- README.md: Added prompt to install virtual environment ([#910](https://github.com/ansible-collections/azure/pull/910))
- azure_rm_keyvaultkey: Adding support for `key_type`, `key_attributes`, `key_size`, `curve` ([#930](https://github.com/ansible-collections/azure/pull/930))
- azure_rm_virtualmachinescaleset: Add new parameter `os_disk_size_gb`, allowing set os disk size ([#961](https://github.com/ansible-collections/azure/pull/961))
- azure_rm_privateendpoint_info: Add connection details ([#965](https://github.com/ansible-collections/azure/pull/965))
- azure_rm_aks: Support for upgrade nodepool kubernetes version ([#966](https://github.com/ansible-collections/azure/pull/966))
- azure_rm_virtualnetworkgateway: Support set Virtual Network Gateway Generation ([#921](https://github.com/ansible-collections/azure/pull/921))
- azure_rm_storage*: Update Storage dependencies ([#833](https://github.com/ansible-collections/azure/pull/833))
- azure_rm_appserviceplan*: Update azure.mgmt.web ([#849](https://github.com/ansible-collections/azure/pull/849))
- azure_rm_functionapp*: Update dependencies ([#849](https://github.com/ansible-collections/azure/pull/849))
- azure_rm_webapp*: Update dependencies ([#849](https://github.com/ansible-collections/azure/pull/849))
- azure_rm_backup*: Upgrade azure-mgmt-recoveryservice relate dependence ([#895](https://github.com/ansible-collections/azure/pull/895))
- azure_rm_dns*: Upgrade azure-mgmt-dns to `v8.0.0` ([#879](https://github.com/ansible-collections/azure/pull/879))
- azure_rm_cognitivesearch: Upgrade azure-mgmt-search to `v8.0.0` ([#896](https://github.com/ansible-collections/azure/pull/896))
- azure_rm_cognitivesearch_info: Upgrade azure-mgmt-search to `v8.0.0` ([#896](https://github.com/ansible-collections/azure/pull/896))
- azure_rm_privatedns*: Upgrade azure-mgmt-privatedns to `v1.0.0` ([#880](https://github.com/ansible-collections/azure/pull/880))
- azure_rm_aks*: Upgrade azure-mgmt-containerservice to `v20.0.0` ([#881](https://github.com/ansible-collections/azure/pull/881))
- azure_rm_containerinstance*: Upgrade azure-mgmt-containerinstance to `v9.0.0` ([#882](https://github.com/ansible-collections/azure/pull/882))
- azure_rm_mysql*: Upgrade azure-mgmt-rdbms to `v10.0.0` ([#884](https://github.com/ansible-collections/azure/pull/884))
- azure_rm_mariadb*: Upgrade azure-mgmt-rdbms to `v10.0.0` ([#884](https://github.com/ansible-collections/azure/pull/884))
- azure_rm_postgresql*: Upgrade azure-mgmt-rdbms to `v10.0.0` ([#884](https://github.com/ansible-collections/azure/pull/884))
- azure_rm_trafficmanager*: Upgrade azure-mgmt-trafficmanager to `v1.0.0` ([#886](https://github.com/ansible-collections/azure/pull/886))
- azure_rm_loganalyticsworkspace: Upgrade azure-mgmt-loganalytics to `v12.0.0` ([#888](https://github.com/ansible-collections/azure/pull/888))
- azure_rm_loganalyticsworkspace_info: Upgrade azure-mgmt-loganalytics to `v12.0.0` ([#888](https://github.com/ansible-collections/azure/pull/888))
- azure_rm_servicebus*: Upgrade azure-mgmt-servicebus to `v7.1.0` ([#889](https://github.com/ansible-collections/azure/pull/889))
- azure_rm_iothub*: Upgrade azure-mgmt-iothub to `v2.2.0` ([#892](https://github.com/ansible-collections/azure/pull/892))
- azure_rm_datalakestore: Upgrade azure-mgmt-datalake-store to `v1.0.0` ([#898](https://github.com/ansible-collections/azure/pull/898))
- azure_rm_datalakestore_info: Upgrade azure-mgmt-datalake-store to `v1.0.0` ([#898](https://github.com/ansible-collections/azure/pull/898))
- azure_rm_eventhub: Upgrade azure-mgmt-eventhubs to `v10.1.0` ([#900](https://github.com/ansible-collections/azure/pull/900))
- azure_rm_eventhub_info: Upgrade azure-mgmt-eventhubs to `v10.1.0` ([#900](https://github.com/ansible-collections/azure/pull/900))
- azure_rm_notificationhub: Upgrade azure-mgmt-notificationhubs to `v7.0.0` ([#899](https://github.com/ansible-collections/azure/pull/899))
- azure_rm_notificationhub_info: Upgrade azure-mgmt-notificationhubs to `v7.0.0` ([#899](https://github.com/ansible-collections/azure/pull/899))
- azure_rm_cdn*: Upgrade azure-mgmt-cdn to `v11.0.0` ([#945](https://github.com/ansible-collections/azure/pull/945))
- azure_rm_registration*: Upgrade azure-mgmt-managedservices to `v6.0.0` ([#948](https://github.com/ansible-collections/azure/pull/948))
- azure_rm_hdinsightcluster: Upgrade hdinsight dependence to `v9.0.0` ([#951](https://github.com/ansible-collections/azure/pull/951))
- azure_rm_hdinsightcluster_info: Upgrade hdinsight dependence to `v9.0.0` ([#951](https://github.com/ansible-collections/azure/pull/951))
- azure_rm_role*: Upgrade azure-mgmt-authorizaiton to `v2.0.0` ([#955](https://github.com/ansible-collections/azure/pull/955))
- azure_rm_cosmosdbaccount: Upgrade azure-mgmt-cosmosdb to `v6.4.0` ([#952](https://github.com/ansible-collections/azure/pull/952))
- azure_rm_cosmosdbaccount_info: Upgrade azure-mgmt-cosmosdb to `v6.4.0` ([#952](https://github.com/ansible-collections/azure/pull/952))
- azure_rm_keyvault*: upgrade azure-mgmt-keyvault to `v10.0.0` ([#959](https://github.com/ansible-collections/azure/pull/959))
- requirements-azure.txt: Update azure-mgmt-core to `v1.3.0` ([#907](https://github.com/ansible-collections/azure/pull/907))
### BUG FIXING
- azure_rm_keyvault_info: Fix `azure_rm_keyvault_info` `Resource.properties` not found error ([#872](https://github.com/ansible-collections/azure/pull/872))
- azure_rm_aks:
- Change `aad_profile.admin_group_object_ids` to take a list of string ([#865](https://github.com/ansible-collections/azure/pull/865))
- Fix `authorized_ip_ranges` not set bug ([#912](https://github.com/ansible-collections/azure/pull/912))
- azure_rm_manageddisk:
- Add missing parameters ([#925](https://github.com/ansible-collections/azure/pull/925))
- If the disk exists, obtain parameters not configured ([#876](https://github.com/ansible-collections/azure/pull/876))
- Add required option(`storage_account_id`) when importing a disk image ([#877](https://github.com/ansible-collections/azure/pull/877))
- azure_rm_deployment_info: Fix API breaking change, replace `list` with `list_by_resource_group` ([#857](https://github.com/ansible-collections/azure/pull/857))
- azure_rm_publicipaddress: Fix property get error.([#908](https://github.com/ansible-collections/azure/pull/908))
- azure_rm_keyvault*: Fixes `credential_scopes` for track2 authentication when connecting to non-Azure Public cloud environments ([#854](https://github.com/ansible-collections/azure/pull/854))
- azure_rm_keyvault: Expose `soft_delete_retention_in_days` ([#906](https://github.com/ansible-collections/azure/pull/906))
- azure_rm_virtualmachine: Remove `started` default value ([#915](https://github.com/ansible-collections/azure/pull/915))
- azure_rm_storageaccount: Add missing account type `Standard_GZRS` and `Standard_RAGZRS` ([#931](https://github.com/ansible-collections/azure/pull/931))
- azure_rm_common:
- Replace `config` with `_config` in `azure_rm_common.py` to support the latest version of azure-mgmt-network ([#904](https://github.com/ansible-collections/azure/pull/904))
- Fix azurerm MSI authentication with other Azure Cloud ([#894](https://github.com/ansible-collections/azure/pull/894))
- Fix a sanity error ([#946](https://github.com/ansible-collections/azure/pull/946))
- azure_rm_azurefirewall: Correct firewall action examples ([#962](https://github.com/ansible-collections/azure/pull/962))
- azure_rm_webappaccessrestriction: Update test case ([#964](https://github.com/ansible-collections/azure/pull/964))
## v1.13.0 (2022-05-27)
### NEW MODULES
- azure_rm_automationrunbook: Add new module azure_rm_automationrunbook ([#797](https://github.com/ansible-collections/azure/pull/797))
- azure_rm_automationrunbook_info: Add new module azure_rm_automationrunbook ([#797](https://github.com/ansible-collections/azure/pull/797))
- azure_rm_openshiftmanagedcluster_info: Add new module azure_rm_openshiftmanagedcluster_info ([#755](https://github.com/ansible-collections/azure/pull/755))
- azure_keyvault_secret: KeyVault Lookup Plugin ([#109](https://github.com/ansible-collections/azure/pull/109))
- azure_rm_datafactory: Add new module azure_rm_datafacotry ([#840](https://github.com/ansible-collections/azure/pull/840))
- azure_rm_datafactory_info: Add new module azure_rm_datafacotry ([#840](https://github.com/ansible-collections/azure/pull/840))
### FEATURE ENHANCEMENT
- azure_rm_common.py: Upgrade azure-mgmt-automation to v1.0.0 ([#791](https://github.com/ansible-collections/azure/pull/791))
- azure_rm_automationaccount: Upgrade azure-mgmt-automation to v1.0.0 ([#791](https://github.com/ansible-collections/azure/pull/791))
- azure_rm_automationaccount_info: Upgrade azure-mgmt-automation to v1.0.0 ([#791](https://github.com/ansible-collections/azure/pull/791))
- azure_rm_loadbalancer: Add support for `zones` ([#801](https://github.com/ansible-collections/azure/pull/801))
- azure_rm_loadbalancer_info: Add support for `zones` ([#801](https://github.com/ansible-collections/azure/pull/801))
- azure_rm.py: Update azure_rm examples ([#810](https://github.com/ansible-collections/azure/pull/810))
- azure_rm_virtualmachinescaleset: Add support for `platform_fault_domain_count`, `orchestration_mode` ([#779](https://github.com/ansible-collections/azure/pull/779))
- azure_rm_virtualmachinescaleset_info: Add support for `platform_fault_domain_count`, `orchestration_mode` ([#779](https://github.com/ansible-collections/azure/pull/779))
- azure_rm_rediscache: Add support for `minimum_tls_version`, `public_network_access`, `redis_version` ([#680](https://github.com/ansible-collections/azure/pull/680))
- azure_rm_rediscache_info: Add support for `minimum_tls_version`, `public_network_access`, `redis_version` ([#680](https://github.com/ansible-collections/azure/pull/680))
- azure_rm_rediscachefirewallrule: Upgrade to truck2 SDK ([#680](https://github.com/ansible-collections/azure/pull/680))
- azure_rm_appgateway: Add rewrite rule capability to appgateway module ([#747](https://github.com/ansible-collections/azure/pull/747))
- azure_rm_appgateway_info: Add rewrite rule capability to appgateway module ([#747](https://github.com/ansible-collections/azure/pull/747))
- azure_rm_sqlserver: SQL Database enhancement ([#681](https://github.com/ansible-collections/azure/pull/681))
- azure_rm_common.py: Bump SQL SDK to v3 ([#681](https://github.com/ansible-collections/azure/pull/681))
- azure_rm_cosmosdbaccount: Add support for `enable_free_tier`, `mongo_version`, `public_network_access`, `ip_range_filter` parameter is being deprecated in favor of `ip_rules` ([#675](https://github.com/ansible-collections/azure/pull/675))
- azure_rm_cosmosdbaccount_info: Add support for `enable_free_tier`, `mongo_version`, `public_network_access`, `ip_range_filter` parameter is being deprecated in favor of `ip_rules` ([#675](https://github.com/ansible-collections/azure/pull/675))
- azure_rm_publicipaddress: Add support for `zones` ([#829](https://github.com/ansible-collections/azure/pull/829))
- azure_rm_publicipaddress_info: Add support for `zones` ([#829](https://github.com/ansible-collections/azure/pull/829))
- azure_rm_image: Add support `hyper_v_generation` ([#832](https://github.com/ansible-collections/azure/pull/832))
- azure_rm_image_info: Add support `hyper_v_generation` ([#832](https://github.com/ansible-collections/azure/pull/832))
### BUG FIXING
- pr-pipelines.yml: Add python3.9 for CI ([#783](https://github.com/ansible-collections/azure/pull/783))
- config.yml: Update test configure ([#790](https://github.com/ansible-collections/azure/pull/790))
- azure_rm_manageddisk: Fixed the inconsistent return value of `attach_caching` caused by the azure-mgmt-compute upgrade ([#799](https://github.com/ansible-collections/azure/pull/799))
- azure_rm_loadbalancer: Fix forced update bug caused by azure_rm_loadbalancer obtaining subnet predefined value ([#800](https://github.com/ansible-collections/azure/pull/800))
- azure_rm_virtualmachine: Add license type for RHEL/SLES Azure Hybrid Benefit ([#804](https://github.com/ansible-collections/azure/pull/804))
- azure_rm_*: Update the document to meet the change requirements of Ansible 2.14 ([#814](https://github.com/ansible-collections/azure/pull/814))
- azure_rm_appgateway_info: Update azure_rm_appgateway_info to use track2 dependencies ([#817](https://github.com/ansible-collections/azure/pull/817))
- azure_rm_virtualmachine: Fix virtual machine top issue ([#767](https://github.com/ansible-collections/azure/pull/767))
- azure_rm_subscription_info: Update azure_rm_subscription_info tags element type ([#819](https://github.com/ansible-collections/azure/pull/819))
- azure_rm_manageddisk: Fix `os_type` comparison in azure_rm_manageddisk with existing disk ([#621](https://github.com/ansible-collections/azure/pull/621))
- azure_rm_appgateway: Persist SSL configuration for appgateway ([#746](https://github.com/ansible-collections/azure/pull/746))
- azure_rm_appgateway_info: Persist SSL configuration for appgateway ([#746](https://github.com/ansible-collections/azure/pull/746))
- azure_rm_publicipaddress: Fix azure_rm_publicipaddress documentation page throws error ([#822]( https://github.com/ansible-collections/azure/pull/822))
- azure_keyvault_secret: Fix Ansible dev version Sanity error in plugin file ([#825](https://github.com/ansible-collections/azure/pull/825))
- azure_rm_rediscache: Fix Ansible dev version Sanity error in plugin file ([#825](https://github.com/ansible-collections/azure/pull/825))
- azure_rm_keyvaultkey: Improved keyvault interaction auth_source=cli logic ([#823](https://github.com/ansible-collections/azure/pull/823))
- azure_rm_keyvaultkey_info: Improved keyvault interaction auth_source=cli logic ([#823](https://github.com/ansible-collections/azure/pull/823))
- azure_rm_keyvaultsecret: Improved keyvault interaction auth_source=cli logic ([#823](https://github.com/ansible-collections/azure/pull/823))
- azure_rm_keyvaultsecret_info: Improved keyvault interaction auth_source=cli logic ([#823](https://github.com/ansible-collections/azure/pull/823))
- azure_keyvault_secret: Add `hyper_v_generation` feature to azure_rm_image module ([#832](https://github.com/ansible-collections/azure/pull/832))
- azure_rm_webapp: Correct documentation of return attribute for azure_rm_webapp ([#846](https://github.com/ansible-collections/azure/pull/846))
- azure_rm_virtualmachine: When zones is null, there is no need to compare ([#853](https://github.com/ansible-collections/azure/pull/853))
- All info modules: Change the tags type of the Info module to list and the element type to string ([#821](https://github.com/ansible-collections/azure/pull/821))
- azcollection: Install collection to local directory during development ([#763](https://github.com/ansible-collections/azure/pull/763))
### BREAKING CHANGES:
- azure_rm_virtualmachinescaleset: Change default value of `single_placement_group` from `True` to `False` ([#851](https://github.com/ansible-collections/azure/pull/851))
## v1.12.0 (2022-03-14)
### NEW MODULES
### FEATURE ENHANCEMENT
- azure_rm_privateendpointdnszonegroup: Add `private_dns_zone_id` for `azure_rm_privateendpointdnszonegroup` ([#735](https://github.com/ansible-collections/azure/pull/735))
- azure_rm_virtualmachineextension: Ignore comparing `protected_settings` ([#580](https://github.com/ansible-collections/azure/pull/580))
- azure_rm_aks: Add new parameter to enable AAD profile ([#654](https://github.com/ansible-collections/azure/pull/654))
- azure_rm_*: Upgrade azure-mgmt-network to 19.1.0 ([#729](https://github.com/ansible-collections/azure/pull/729))
- azure_rm_sqldatabase: Parse datetime module arguments ([#623](https://github.com/ansible-collections/azure/pull/623))
- azure_rm_sqldatabase_info: Parse datetime module arguments ([#623](https://github.com/ansible-collections/azure/pull/623))
- azure_rm_virtualmachine: Add VM status detection mechanism ([#772](https://github.com/ansible-collections/azure/pull/772))
- azure_rm_*: Upgrade azure-mgmt-compute SDK to track2 SDK ([#672](https://github.com/ansible-collections/azure/pull/672))
- azure_rm_*: Upgrade azure-mgmt-storage to 19.0.0 ([#777](https://github.com/ansible-collections/azure/pull/777))
- requirements-azure.txt: Update azure-cli-core to 2.34.0 ([#775](https://github.com/ansible-collections/azure/pull/775))
- azure_rm_virtualmachine: Update `azure_rm_galleryimage` to allow Hyper-V Generation ([#647](https://github.com/ansible-collections/azure/pull/647))
### BUG FIXING
- azure_rm_roleassignment: Fix mismatch assignment error ([#613](https://github.com/ansible-collections/azure/pull/613))
- README.md: Delete unnecessary backtick in readme ([#736](https://github.com/ansible-collections/azure/pull/736))
- azure_rm_availabilityset: Fix `check_mode` support ([#627](https://github.com/ansible-collections/azure/pull/627))
- azure_rm_manageddisk: Fix `azure_rm_manageddisk` caching comparison ([#624](https://github.com/ansible-collections/azure/pull/624))
- azure_rm_publicipaddress: Add mandatory field when updating IPAddress ([#752](https://github.com/ansible-collections/azure/pull/752))
- azure_rm_common: Remove unused and deprecated `VERSION` import ([#751](https://github.com/ansible-collections/azure/pull/751))
- azure_rm_keyvaultkey: Conditionally call non MSI authorization when interacting with keyvault ([#770](https://github.com/ansible-collections/azure/pull/770))
- azure_rm_keyvaultkey_info: Conditionally call non MSI authorization when interacting with keyvault ([#770](https://github.com/ansible-collections/azure/pull/770))
- azure_rm_keyvaultsecret: Conditionally call non MSI authorization when interacting with keyvault ([#770](https://github.com/ansible-collections/azure/pull/770))
- azure_rm_keyvaultsecret_info: Conditionally call non MSI authorization when interacting with keyvault ([#770](https://github.com/ansible-collections/azure/pull/770))
- azure_rm_common: Fix typo error. ([#769](https://github.com/ansible-collections/azure/pull/769))
- azure_rm_cosmosdbaccount: Update test case region ([#776](https://github.com/ansible-collections/azure/pull/776))
- azure_rm_virtualmachine_info: Fix VM info module for failed VM provisions ([#745](https://github.com/ansible-collections/azure/pull/745))
- azure_rm_loadbalancer_info: Fix documentation issue ([#719](https://github.com/ansible-collections/azure/pull/719))
- azure_rm: Fix ansible 2.13 sanity fail ([#778](https://github.com/ansible-collections/azure/pull/778))
- azure_rm: Append secondary network information to relevant `hostvars` ([#733](https://github.com/ansible-collections/azure/pull/733))
## v1.11.0 (2022-01-18)
### NEW MODULES
- azure_rm_virtualhub: New Module azure_rm_virtualhub ([#597](https://github.com/ansible-collections/azure/pull/597))
- azure_rm_virtualhub_info: New Module azure_rm_virtualhub_info ([#597](https://github.com/ansible-collections/azure/pull/597))
- azure_rm_hostgroup: New Module : azure_rm_hostgroup ([#704](https://github.com/ansible-collections/azure/pull/704))
- azure_rm_hostgroup_info: New Module : azure_rm_hostgroup ([#704](https://github.com/ansible-collections/azure/pull/704))
- azure_rm_privateendpointdnszonegroup: Add module for private endpoint DNS zone groups ([#689](https://github.com/ansible-collections/azure/pull/689))
- azure_rm_privateendpointdnszonegroup_info: Add module for private endpoint DNS zone groups ([#689](https://github.com/ansible-collections/azure/pull/689))
- azure_rm_monitordiagnosticsetting: Add new monitor diagnostic setting modules ([#701](https://github.com/ansible-collections/azure/pull/701))
- azure_rm_monitordiagnosticsetting_info: Add new monitor diagnostic setting modules ([#701](https://github.com/ansible-collections/azure/pull/701))
- azure_rm_storageshare: Azure storage file share module ([#603](https://github.com/ansible-collections/azure/pull/603))
- azure_rm_storageshare_info: Azure storage file share module ([#603](https://github.com/ansible-collections/azure/pull/603))
- azure_rm_appgateway_info: Application gateway start/stop ability and info module ([#673](https://github.com/ansible-collections/azure/pull/673))
### FEATURE ENHANCEMENT
- azure_rm_webapp: Add additional parameters for webapp site config ([#695](https://github.com/ansible-collections/azure/pull/695))
- azure_rm_webapp_info: Add additional parameters for webapp site config ([#695](https://github.com/ansible-collections/azure/pull/695))
- azure_rm: Add managed disks list to dynamic inventory hostvars ([#687](https://github.com/ansible-collections/azure/pull/687))
- azure_rm_networkinterface: Add ability to connect network interface to application gateway backend pool ([#683](https://github.com/ansible-collections/azure/pull/683))
- azure_rm_networkinterface_info: Add ability to connect network interface to application gateway backend pool ([#683](https://github.com/ansible-collections/azure/pull/683))
- azure_rm_keyvaultsecret: feat: Add expiry information for keyvaultsecrets ([#660](https://github.com/ansible-collections/azure/pull/660))
- azure_rm_virtualmachine_info: Verify the VM status after created ([#657](https://github.com/ansible-collections/azure/pull/657))
- azure_rm_appgateway: Add advanced routing/redirect support for application gateway ([#685](https://github.com/ansible-collections/azure/pull/685))
- azure_rm_virtualmachine: Add new parameter `proximity_placement_group` ([#611](https://github.com/ansible-collections/azure/pull/611))
- azure_rm_virtualmachine_info: Add new parameter `proximity_placement_group` ([#611](https://github.com/ansible-collections/azure/pull/611))
- azure_rm_dnsrecordset: Added Metadata support ([#589](https://github.com/ansible-collections/azure/pull/589))
- azure_rm_dnsrecordset_info: Added Metadata support ([#589](https://github.com/ansible-collections/azure/pull/589))
- azure_rm_virtualmachine_info: Add managed disk ID to returned facts for data disks ([#682](https://github.com/ansible-collections/azure/pull/682))
- azure_rm_appgateway: Application gateway start/stop ability ([#673](https://github.com/ansible-collections/azure/pull/673))
- azure_rm_aks: Add new feature - `outbound_type` ([#651](https://github.com/ansible-collections/azure/pull/651))
- azure_rm_common: Support track2 SDK CLI authorization ([#676](https://github.com/ansible-collections/azure/pull/676))
### BUG FIXING
- azure_rm_common: Supprot track2 SDK ([#670](https://github.com/ansible-collections/azure/pull/670))
- azure_rm_common: Allow module-level subscription id to be used for cross-subscription resource management ([#694](https://github.com/ansible-collections/azure/pull/694))
- azure_rm_appserviceplan: Correct idempotency and premium SKU plans ([#693](https://github.com/ansible-collections/azure/pull/693))
- ignore-2.13.txt: Update ignore file ([#696](https://github.com/ansible-collections/azure/pull/696))
- ignore-2.12.txt: Update ignore file ([#696](https://github.com/ansible-collections/azure/pull/696))
- ignore-2.11.txt: Update ignore file ([#696](https://github.com/ansible-collections/azure/pull/696))
- ignore-2.10.txt: Update ignore file ([#696](https://github.com/ansible-collections/azure/pull/696))
- azure_rm_virtualmachine: Misc typo fixes ([#698](https://github.com/ansible-collections/azure/pull/698))
- azure_rm_publicipaddress: Misc typo fixes ([#698](https://github.com/ansible-collections/azure/pull/698))
- azure_rm_virtualmachinescaleset: Misc typo fixes ([#698](https://github.com/ansible-collections/azure/pull/698))
- azure_rm_appgateway: Update `state` document ([#674](https://github.com/ansible-collections/azure/pull/674))
- azure_rm_dnsrecordset_info: Fixed error where recordset relative did not exist ([#706](https://github.com/ansible-collections/azure/pull/706))
- azure_rm_cosmosdbaccount_info: Correct cosmosdb info module when loading by resource group ([#709](https://github.com/ansible-collections/azure/pull/709))
- azure_rm_notificationhub: Avoid the case when service returns None ([#718](https://github.com/ansible-collections/azure/pull/718))
- azure_rm_notificationhub_info: Avoid the case when service returns None ([#718](https://github.com/ansible-collections/azure/pull/718))
- azure_rm_common: common: Handle exception raised while loading profile ([#610](https://github.com/ansible-collections/azure/pull/610))
- README.md: Clarify document for installing collection and dependencies ([#716](https://github.com/ansible-collections/azure/pull/716))
- azure_rm_deployment: azure_rm_deployment : Fixed tags related bug ([#641](https://github.com/ansible-collections/azure/pull/641))
- azure_rm_subnet: Dissociate routetable from subnet ([#727](https://github.com/ansible-collections/azure/pull/727))
- azure_rm_securitygroup_info: Align `azure_rm_securitygroup_info` return to match `azure_rm_securitygroup` ([#726](https://github.com/ansible-collections/azure/pull/726))
## v1.10.0 (2021-10-22)
### NEW MODULES
- azure_rm_virtualmachinesize_info: VirtualMachineSize facts module ([#605](https://github.com/ansible-collections/azure/pull/605))
- azure_rm_diskencryptionset: New module: azure_rm_diskencryptionset ([#552](https://github.com/ansible-collections/azure/pull/552))
- azure_rm_diskencryptionset_info: New module: azure_rm_diskencryptionset ([#552](https://github.com/ansible-collections/azure/pull/552))
### FEATURE ENHANCEMENT
- azure_rm_availabilityset: Add ProximityPlacementGroup to azure_rm_availabilityset ([#612](https://github.com/ansible-collections/azure/pull/612))
- main.yml: Update vmss test case ([#633](https://github.com/ansible-collections/azure/pull/633))
- main.yml: Enable VMSS TEST ([#634](https://github.com/ansible-collections/azure/pull/634))
- azure_rm_keyvault: Add new parameter enable_purge_protection to azure_rm_keyvault ([#643](https://github.com/ansible-collections/azure/pull/643))
- azure_rm_keyvault_info: Add new parameter enable_purge_protection to azure_rm_keyvault ([#643](https://github.com/ansible-collections/azure/pull/643))
- azure_rm_containerinstance: Fixed issue #232 Added Volume mount support for container instances ([#338](https://github.com/ansible-collections/azure/pull/338))
- azure_rm_containerinstance_info: Fixed issue #232 Added Volume mount support for container instances ([#338](https://github.com/ansible-collections/azure/pull/338))
- ignore-2.13.txt: Copy ignore-2.12.txt to ignore-2.13.txt ([#642](https://github.com/ansible-collections/azure/pull/642))
- azure_rm_mysqlserver: Add new parameter (azure_rm_mysqlserver.py)--- restarted ([#600](https://github.com/ansible-collections/azure/pull/600))
### BUG FIXING
- azure_rm_virtualmachineimage_info: Support to get the latest version of a virtual machine image ([#617](https://github.com/ansible-collections/azure/pull/617))
- azure_rm_virtualmachine: azure_rm_virtualmachine: suppress no_log warning on ssh_password_enabled parameter ([#622](https://github.com/ansible-collections/azure/pull/622))
- azure_rm_mysqlserver: Remove version 5.6, bump minimum version from 5.6 to 5.7 ([#626](https://github.com/ansible-collections/azure/pull/626))
- azure_rm_manageddisk: Update azure_rm_manageddisk Doc to reflect return value ([#616]( https://github.com/ansible-collections/azure/pull/616))
- azure_rm_managementgroup_info: bugfix for azure_rm_managementgroup_info module, subscriptions not detected as correct type ([#630](https://github.com/ansible-collections/azure/pull/630))
- azure_rm_manageddisk: Fix manageddisk unmount documentation ([#649](https://github.com/ansible-collections/azure/pull/649))
- azure_rm_securitygroup: Fix azure_rm_securitygroup doc ([#640](https://github.com/ansible-collections/azure/pull/640))
## v1.9.0 (2021-08-23)
### NEW MODULES
- azure_rm_ddosprotectionplan: New module: azure_rm_ddosprotectionplan ([#493](https://github.com/ansible-collections/azure/pull/493))
- azure_rm_ddosprotectionplan_info: New module: azure_rm_ddosprotectionplan ([#493](https://github.com/ansible-collections/azure/pull/493))
- azure_rm_privateendpoint: Azure rm privateendpoint ([#593](https://github.com/ansible-collections/azure/pull/593))
- azure_rm_privateendpoint_info: Azure rm privateendpoint ([#593](https://github.com/ansible-collections/azure/pull/593))
- azure_rm_webappaccessrestriction: New modules for webapp network access restrictions ([#594](https://github.com/ansible-collections/azure/pull/594))
- azure_rm_webappaccessrestriction_info: New modules for webapp network access restrictions ([#594](https://github.com/ansible-collections/azure/pull/594))
- azure_rm_webappvnetconnection: New modules for webapp vnet connection ([#590](https://github.com/ansible-collections/azure/pull/590))
- azure_rm_webappvnetconnection_info: New modules for webapp vnet connection ([#590](https://github.com/ansible-collections/azure/pull/590))
### FEATURE ENHANCEMENT
- azure_rm_networkinterface: Allow IPv6 with NetworkInterfaceIPConfiguration ([#582](https://github.com/ansible-collections/azure/pull/582))
- azure_rm_postgresqlserver: postgres server backup-support ([#566](https://github.com/ansible-collections/azure/pull/566))
- azure_rm_virtualmachine: Addition of Spot instance support for VM and VMSS ([#559](https://github.com/ansible-collections/azure/pull/559))
- azure_rm_virtualmachinescaleset: Addition of Spot instance support for VM and VMSS ([#559](https://github.com/ansible-collections/azure/pull/559))
- azure_rm_appgateway: Add support for application gateway path-based routing ([#452](https://github.com/ansible-collections/azure/pull/452))
- main.yml: Virtual machine test case update ([#595](https://github.com/ansible-collections/azure/pull/595))
- azure_rm_appgateway: Allow application gateway probe to use host header from HTTP settings ([#450](https://github.com/ansible-collections/azure/pull/450))
- azure_rm_*_info: Fixed dev branch sanity error ([#596](https://github.com/ansible-collections/azure/pull/596))
### BUG FIXING
- runtime.yml: Add runtime.yml ([#587](https://github.com/ansible-collections/azure/pull/587))
- galaxy.yml: Add resource tags ([#592](https://github.com/ansible-collections/azure/pull/592))
- CONTRIBUTING.md: Update contributing notes for dev/testing ([#574](https://github.com/ansible-collections/azure/pull/574))
- main.yml: BUG FIX: Get latest VM image version ([#606](https://github.com/ansible-collections/azure/pull/606))
## v1.8.0 (2021-08-02)
### NEW MODULES
- azure_rm_notificationhub: New module: azure_rm_notificationhub ([#496](https://github.com/ansible-collections/azure/pull/496/))
- azure_rm_notificationhub_info: New module: azure_rm_notificationhub ([#496](https://github.com/ansible-collections/azure/pull/496/))
- azure_rm_expressroute: New module: azure_rm_expressroute ([#484](https://github.com/ansible-collections/azure/pull/484))
- azure_rm_expressroute_info: New module: azure_rm_expressroute ([#484](https://github.com/ansible-collections/azure/pull/484))
### FEATURE ENHANCEMENT
- azure_rm_aks: azure_rm_aks: cluster client & models API version ([#497](https://github.com/ansible-collections/azure/pull/497))
- azure_rm_aks: add new paramter node_labels for agent_pool ([#577](https://github.com/ansible-collections/azure/pull/577))
- azure_rm_aks: azure_rm_aks: support system-assigned (managed) identity, ([#514](https://github.com/ansible-collections/azure/pull/514))
- azure_rm_mysqlserver: Add new feature storage_profile ([#563](https://github.com/ansible-collections/azure/pull/563))
### BUG FIXING
- azure_rm_virtualmachine_info: Add name to return data_disks ([#565](https://github.com/ansible-collections/azure/pull/565))
- azure_rm_loadbalancer: enable_floating_ip is for SQL AlwaysOn not SNAT ([#560](https://github.com/ansible-collections/azure/pull/560))
- azure_rm_containerregistry: Add return value for azure_rm_containerregistry idempotent test ([#578](https://github.com/ansible-collections/azure/pull/578))
- azure_rm_containerregistry_info: Add return value for azure_rm_containerregistry idempotent test ([#578](https://github.com/ansible-collections/azure/pull/578))
- azure_rm_roleasignment: azure_rm_roleassignment bugfix ([#464](https://github.com/ansible-collections/azure/pull/464))
- azure_rm_roleasignment_info: azure_rm_roleassignment bugfix ([#464](https://github.com/ansible-collections/azure/pull/464))
- azure_rm_aks: Upddate test case ([#585](https://github.com/ansible-collections/azure/pull/585))
- azure_rm_cosmosdbaccount: Upddate test case ([#585](https://github.com/ansible-collections/azure/pull/585))
## v1.7.0 (2021-06-08)
### NEW MODULES
- azure_rm_adapplication: New module: azure_rm_adapplication ([#215](https://github.com/ansible-collections/azure/pull/215))
- azure_rm_adapplication_info: New module: azure_rm_adapplication ([#215](https://github.com/ansible-collections/azure/pull/215))
- azure_rm_adgroup: New module: azure_rm_adgroup ([#423](https://github.com/ansible-collections/azure/pull/423))
- azure_rm_adgroup_info: New module: azure_rm_adgroup ([#423](https://github.com/ansible-collections/azure/pull/423))
- azure_rm_apimanagement: New Module [API Management] ([#322](https://github.com/ansible-collections/azure/pull/322))
- azure_rm_apimanagement_info: New Module [API Management] ([#322](https://github.com/ansible-collections/azure/pull/322))
- azure_rm_ipgroup: New module: azure_rm_ipgroup ([#528](https://github.com/ansible-collections/azure/pull/528))
- azure_rm_ipgroup_info: New module: azure_rm_ipgroup ([#528](https://github.com/ansible-collections/azure/pull/528))
- azure_rm_eventhub: New module: azure_rm_eventhub ([#519](https://github.com/ansible-collections/azure/pull/519))
- azure_rm_eventhub_info: New module: azure_rm_eventhub ([#519](https://github.com/ansible-collections/azure/pull/519))
- azure_rm_proximityplacementgroup: New module: azure_rm_proximityplacementgroup ([#501](https://github.com/ansible-collections/azure/pull/501))
- azure_rm_proximityplacementgroup_info: New module: azure_rm_proximityplacementgroup ([#501](https://github.com/ansible-collections/azure/pull/501))
- azure_rm_privatednszonelink: New module: azure_rm_privatednszonelink ([#495](https://github.com/ansible-collections/azure/pull/495))
- azure_rm_privatednszonelink_info: New module: azure_rm_privatednszonelink ([#495](https://github.com/ansible-collections/azure/pull/495))
### FEATURE ENHANCEMENT
- azure_rm_virtualmachine_info: Add availability zones to azure_rm_virtualmachine_info module ([#523](https://github.com/ansible-collections/azure/pull/523))
- azure: Add log_mode and log_path to azure.py ([#540](https://github.com/ansible-collections/azure/pull/540))
### BUG FIXING
- ado: Optimizing ado.sh ([#510](https://github.com/ansible-collections/azure/pull/510))
- azure_rm_securitygroup: azure_rm_securitygroup - idempotent when args are lists ([#507](https://github.com/ansible-collections/azure/pull/507))
- azure_rm_openshiftmanagedcluster: Fix an issue identifying a creation/deletion error [(#542](https://github.com/ansible-collections/azure/pull/542))
- azure_rm_adapplication: disable tlsv1_1 in app gateway test. ([#544](https://github.com/ansible-collections/azure/pull/544))
- pr-pipelines: increase integration testing timeout ([#549](https://github.com/ansible-collections/azure/pull/549))
- tests/integration/targets/azure_rm_apimanagement/tasks/main.yml: Update sleep relate method ([#550](https://github.com/ansible-collections/azure/pull/550))
- tests/integration/targets/azure_rm_appgateway/aliases: Disable azure_rm_appgateway relate test ([#558](https://github.com/ansible-collections/azure/pull/558))
## v1.6.0 (2021-04-29)
### NEW MODULES
- azure_rm_search: Add new module to deploy Azure Cognitive Search 'azure_rm_cognitivesearch' ([#372](https://github.com/ansible-collections/azure/pull/372))
- azure_rm_search_info: Add new module to deploy Azure Cognitive Search 'azure_rm_cognitivesearch' ([#372](https://github.com/ansible-collections/azure/pull/372))
- azure_rm_apimanagementservice: Added new module for Azure API management service. ([#333](https://github.com/ansible-collections/azure/pull/333#))
- azure_rm_apimanagementservice_info: Added new module for Azure API management service. ([#333](https://github.com/ansible-collections/azure/pull/333#))
- azure_rm_virtualwan: Add new module relate with Virtual WAN ([#329](https://github.com/ansible-collections/azure/pull/329))
- azure_rm_virtualwan_info: Add new module relate with Virtual WAN ([#329](https://github.com/ansible-collections/azure/pull/329))
- azure_rm_vpnsite: Add new module relate with VPN site ([#328](https://github.com/ansible-collections/azure/pull/328))
- azure_rm_vpnsite_info: Add new module relate with VPN site ([#328](https://github.com/ansible-collections/azure/pull/328))
- azure_rm_vpnsitelink_info: Add new module relate with VPN site ([#328](https://github.com/ansible-collections/azure/pull/328))
- azure_rm_aduser: Add new module for AD Users ([#402](https://github.com/ansible-collections/azure/pull/402))
- azure_rm_aduser_info: Add new module for AD Users ([#402](https://github.com/ansible-collections/azure/pull/402))
### FEATURE ENHANCEMENT
- ignore-2.12: Add 2.11 to test matrix, add ignore-2.12.txt ([#480](https://github.com/ansible-collections/azure/pull/480))
- azure_rm_appgateway: Support subnet lookup for app gateway ([#451](https://github.com/ansible-collections/azure/pull/451))
- azure_rm_storageaccount: Update azure_rm_storageaccount relate test yml ([#488](https://github.com/ansible-collections/azure/pull/488))
- pr-pipeline: use python3.8 as default version,and using ubuntu20. ([#509](https://github.com/ansible-collections/azure/pull/509))
### BUG FIXING
- azure: Paultaiton 20210409 requirements doc ([#485](https://github.com/ansible-collections/azure/pull/485))
- azure_rm_storageaccount: Allow storage account type Premium_ZRS for FileStorage and BlockBlobStorage ([#482](https://github.com/ansible-collections/azure/pull/482))
- azure_rm_*: Fix sanity test related errors ([#506](https://github.com/ansible-collections/azure/pull/506))
- azure_rm: Fixing sanity test issue for ansible 2.11 ([#511](http://fanyi.youdao.com/?keyfrom=dict2.index))
- azure_rm: Fixing inventory issue ([#518](https://github.com/ansible-collections/azure/pull/518))
- azure_rm_aduser: fixing update account_enabled bug in azure_rm_aduser.py ([#536](https://github.com/ansible-collections/azure/pull/536))
- azure_rm_common: fixing ad related auth issue when using service principal. ([#537](https://github.com/ansible-collections/azure/pull/537))
- azure_rm_aduser: change class name of azure_rm_aduser ([#538](https://github.com/ansible-collections/azure/pull/538))
## v1.5.0 (2021-03-26)
### NEW MODULES
- azure_rm_aksupgrade_info: Add new module to get available upgrade versions for an AKS cluster ([#405](https://github.com/ansible-collections/azure/pull/405))
- azure_rm_backuppolicy: Add new module to manage backup policies ([#373](https://github.com/ansible-collections/azure/pull/373))
- azure_rm_backuppolicy_info: Add new module to manage backup policies ([#373](https://github.com/ansible-collections/azure/pull/373))
- azure_rm_managementgroup_info: New module azure_rm_managementgroup_info ([#428](https://github.com/ansible-collections/azure/pull/428))
- azure_rm_datalakestore: Add new module azure_rm_datalakestore ([#352](https://github.com/ansible-collections/azure/pull/352))
- azure_rm_datalakestore_info: Add new module azure_rm_datalakestore ([#352](https://github.com/ansible-collections/azure/pull/352))
### FEATURE ENHANCEMENT
- azure_rm_aks: add creation and deletion of nodepools ([#440](https://github.com/ansible-collections/azure/pull/440))
- azure_rm_loganalyticsworkspace: Add tags for azure_rm_loganalyticsworkspace ([#434](https://github.com/ansible-collections/azure/pull/434))
- sanity-requirements-azure: Bump cryptography from 3.2 to 3.3.2 ([#424](https://github.com/ansible-collections/azure/pull/424))
- azure_rm_keyvaultsecret: Conditionally call MSI auth when interacting with keyvault ([#356](https://github.com/ansible-collections/azure/pull/356))
- azure_rm_keyvaultsecret_info: Conditionally call MSI auth when interacting with keyvault ([#356](https://github.com/ansible-collections/azure/pull/356))
- azure_rm_keyvaultkey: Conditionally call MSI auth when interacting with keyvault ([#356](https://github.com/ansible-collections/azure/pull/356))
- azure_rm_keyvaultkey_info: Conditionally call MSI auth when interacting with keyvault ([#356](https://github.com/ansible-collections/azure/pull/356))
- azure_rm_keyvault: Set the default value of enable_soft_delete to true ([#463](https://github.com/ansible-collections/azure/pull/463))
- azure_rm_keyvault_info: Set the default value of enable_soft_delete to true ([#463](https://github.com/ansible-collections/azure/pull/463))
### BUG FIXING
- azure_tags: Improve the documentation of tags ([#415](https://github.com/ansible-collections/azure/pull/415))
- azure_rm_registrationassignment: fixed SyntaxWarning ([#427](https://github.com/ansible-collections/azure/pull/427))
- azure_rm_adserviceprincipal: Update azure_rm_adserviceprincipal examples ([#414](https://github.com/ansible-collections/azure/pull/414))
- azure_rm_keyvault_info: change description for access policies return value ([#426](https://github.com/ansible-collections/azure/pull/426))
- azure_rm_*: modules: remove ANSIBLE_METADATA ([#436](https://github.com/ansible-collections/azure/pull/436))
- azure_rm_backuppolicy: Update azure_rm_backupolicy add version ([#449](https://github.com/ansible-collections/azure/pull/449))
- azure_rm_backuppolicy_info: Update azure_rm_backupolicy add version ([#449](https://github.com/ansible-collections/azure/pull/449))
- azure_rm_image: Revert images API version ([#432](https://github.com/ansible-collections/azure/pull/432))
- azure_rm_image_info: Revert images API version ([#432](https://github.com/ansible-collections/azure/pull/432))
- azure_rm_openshiftmanagedcluster: resolve issue (#268) ([#307](https://github.com/ansible-collections/azure/pull/307))
- azure_rm_virtualnetwork: Unrestrict the virtual network of multiple DNS servers when I(purge_a… ([#462](https://github.com/ansible-collections/azure/pull/462))
- azure_rm_storageaccount: Correct doc for storageaccount network_acls options ([#456](https://github.com/ansible-collections/azure/pull/456))
- azure_rm_storageaccount: Update azure_rm_storageaccount.py ([#458](https://github.com/ansible-collections/azure/pull/458))
- azure_rm_datalakestore: Transfer azure_rm_datalakestore test group 10 ([#465](https://github.com/ansible-collections/azure/pull/465))
- azure_rm_datalakestore: Delete datalake resource group after pipeline test ([#466](https://github.com/ansible-collections/azure/pull/466))
## v1.4.0 (2021-01-26)
### NEW MODULES
- azure_rm_route_info: add azure_rm_route_info module ([#334](https://github.com/ansible-collections/azure/pull/334))
### FEATURE ENHANCEMENT
- azure_rm_postgresqlserver: add storage_autogrow option to postgresqlserver ([#387](https://github.com/ansible-collections/azure/pull/387))
- azure_rm_keyvaultsecret: add content type parameter to azure_rm_keyvaultsecret ([#317](https://github.com/ansible-collections/azure/pull/317))
- azure_rm_keyvaultsecret_info: add content type parameter to azure_rm_keyvaultsecret ([#317](https://github.com/ansible-collections/azure/pull/317))
- azure_rm_mysqlserver: add missing Mysql version 8.0 ([#319](https://github.com/ansible-collections/azure/pull/319))
### BUG FIXING
- Test_unit: add resource group for datalake store testing in ado pipeline ([#375](https://github.com/ansible-collections/azure/pull/375))
- README.md: update README to include a link to documentation ([#376](https://github.com/ansible-collections/azure/pull/376))
- azure_rm_deployment: update azure_rm_deployment document ([#384](https://github.com/ansible-collections/azure/pull/384))
- azure_rm_azurefirewall: add support for tags in exec_module ([#360](https://github.com/ansible-collections/azure/pull/360))
- Test_unit: disable generate VM using password for regression testing purpose ([#393](https://github.com/ansible-collections/azure/pull/393))
- azure_rm_keyvaultsecret_info: Fix doc on returned field name ([#389](https://github.com/ansible-collections/azure/pull/389))
- azure_rm_virtualnetworkpeering: azure_rm_virtualnetworkpeering: Fix unable to remove non-existing pee…([#400](https://github.com/ansible-collections/azure/pull/400))
- azure_rm_loadbalancer: check mode for loadbalancer ([#316](https://github.com/ansible-collections/azure/pull/316))
- azure_rm_backupazurevm: Add function that azure_rm_backupazurevm resource in different resour… ([#404](https://github.com/ansible-collections/azure/pull/404))
## v1.3.1 (2020-12-17)
### BUG FIXING
- CHANGELOG: Some corrections needed in links to get them to work ([#366](https://github.com/ansible-collections/azure/pull/366))
- azure_rm: Retrieve computer_name using dictionary get method ([#368](https://github.com/ansible-collections/azure/pull/368))
## v1.3.0 (2020-12-16)
### NEW MODULES
- azure_rm_vmbackuppolicy: Azure Recovery Services VM Backup Policy ([#271](https://github.com/ansible-collections/azure/pull/271))
- azure_rm_vmbackuppolicy_info: Azure Recovery Services VM Backup Policy Info ([#271](https://github.com/ansible-collections/azure/pull/271))
- azure_rm_subscription_info: Azure rm subscription info ([#280](https://github.com/ansible-collections/azure/pull/280))
- azure_rm_privatednsrecordset: add new module for supporting DNS recordset operations in Private DNS zone ([#286](https://github.com/ansible-collections/azure/pull/286))
- azure_rm_registrationassignment: Registration Assignment for Azure Lighthouse ([#359](https://github.com/ansible-collections/azure/pull/359))
- azure_rm_registrationassignment_info: Registraion Assignment Info for Azure Lightouse ([#359](https://github.com/ansible-collections/azure/pull/359))
- azure_rm_registrationdefinition: Registration Definition for Azure Lighthouse ([#359](https://github.com/ansible-collections/azure/pull/359))
- azure_rm_registrationdefinition_info: Registration Definition Info for Azure Lighthouse ([#359](https://github.com/ansible-collections/azure/pull/359))
### FEATURE ENHANCEMENT
- azure_rm_subnet: add delegations compatibility to azure_rm_subnet ([#264](https://github.com/ansible-collections/azure/pull/264))
- azure_rm_loganalyticsworkspace: add force deletion capability to log analytics module ([#273](https://github.com/ansible-collections/azure/pull/273))
- azure_rm_sqldatabase: add sku option for sqldatabase ([#291](https://github.com/ansible-collections/azure/pull/291))
- azure_rm_aks: update azure_rm_aks document ([#294](https://github.com/ansible-collections/azure/pull/294))
- azure_rm_manageddisk_info: add new parameter managed_by ([#302](https://github.com/ansible-collections/azure/pull/302))
- Bump cryptography version from 3.0 to 3.2 ([#306](https://github.com/ansible-collections/azure/pull/306))
- azure_rm_subnet: add example of service_endpoints configuration ([#309](https://github.com/ansible-collections/azure/pull/309))
- azure_rm: add computer_name parameter to available variables ([#312](https://github.com/ansible-collections/azure/pull/312))
- azure_rm_webapp: add support for multi-container apps to azure_rm_webapp ([#257](https://github.com/ansible-collections/azure/pull/257))
- azure_rm_virtualmachineextension: add no_log to protected_settings variable ([#278](https://github.com/ansible-collections/azure/pull/278))
### BUG FIXING
- azure_rm_keyvault: fix azure_rm_keyvault idempotency ([#295](https://github.com/ansible-collections/azure/pull/295))
- azure_rm_roleassignment: fix azure_rm_roleassignment idempotence error ([#296](https://github.com/ansible-collections/azure/pull/296))
- azure_rm_roleassignment: fix azure_rm_roleassignment related bugs ([#301](https://github.com/ansible-collections/azure/pull/301))
- azure_rm_autoscale: fix typo ([#314](https://github.com/ansible-collections/azure/pull/314))
- Fix sanity fail in python3.8 environment ([#355](https://github.com/ansible-collections/azure/pull/355))
- azure_rm: extend doc fragment from base constructed class to fix error ([#364](https://github.com/ansible-collections/azure/pull/364))
## v1.2.0 (2020-10-09)
### NEW MODULES
- azure_rm_backupazurevm: ([#248](https://github.com/ansible-collections/azure/pull/248))
- azure_rm_backupazurevm_info: ([#248](https://github.com/ansible-collections/azure/pull/248))
- azure_rm_recoveryservicesvault: ([#254](https://github.com/ansible-collections/azure/pull/254))
- azure_rm_openshiftmanagedcluster: ([#276](https://github.com/ansible-collections/azure/pull/276))
### FEATURE ENHANCEMENT
- add python 3.8 support ([#246](https://github.com/ansible-collections/azure/pull/246))
- azure_rm_publicipaddress: support public Ipv6 address ([#125](https://github.com/ansible-collections/azure/pull/125))
- azure_rm_subnet: add private-endpoint-network-policies ([#256](https://github.com/ansible-collections/azure/pull/256))
- azure_rm: fetch availability zone info into hostvars ([#243](https://github.com/ansible-collections/azure/pull/243))
- azure_rm: make inventory_hostname configurable with hostvar_expressions ([#105](https://github.com/ansible-collections/azure/pull/105))
### BUG FIXING
- azure_rm_openshiftmanagedcluster: fix issue [#270](https://github.com/ansible-collections/azure/issues/270) and [#269](https://github.com/ansible-collections/azure/issues/269)
([#285](https://github.com/ansible-collections/azure/pull/285))
## v1.1.0 (2020-09-03)
### FEATURE ENHANCEMENT
- azure_rm_storageaccount: allow blob public access parameter ([#219](https://github.com/ansible-collections/azure/pull/219))
- azure_rm_virtualmachine: update boot diganostics config ([#208](https://github.com/ansible-collections/azure/pull/208))
- azure_rm_aks: add load_balancer_sku option ([#199](https://github.com/ansible-collections/azure/pull/199))
- azure_rm: improve OS detection when VM has no osProfile ([#197](https://github.com/ansible-collections/azure/pull/197))
- azure_rm_subnet: support IPv6 address ([#240](https://github.com/ansible-collections/azure/pull/240))
- azure_rm_networkinterface: add new module parameter address_prefixes ([#239](https://github.com/ansible-collections/azure/pull/239))
- azure_rm_common: support azure-cli credentials with multiple subscriptions ([#195](https://github.com/ansible-collections/azure/pull/195))
- azure_rm_mariadbserver: support version 10.3 ([#244](https://github.com/ansible-collections/azure/pull/244))
### BUG FIXING
- azure_rm_manageddisk: fix increments LUN on disks already attached error ([#237](https://github.com/ansible-collections/azure/pull/237))
- azure_rm_appgateway: fix rule type reference error ([#99](https://github.com/ansible-collections/azure/pull/99))
## v1.0.0 (2020-08-12)
### FEATURE ENHANCEMENT
- azure_rm_appgateway: support version 2 SKUS ([#198](https://github.com/ansible-collections/azure/pull/198))
- azure_rm_storageaccount: support minimum tls version ([#207](https://github.com/ansible-collections/azure/pull/207))
### BUG FIXING
- azure_rm_roledefinition: fails when `description` is set ([#214](https://github.com/ansible-collections/azure/pull/214))
- azure_rm_virtualmachine: boot diagnostics related error ([#200](https://github.com/ansible-collections/azure/pull/200))
## v0.3.0 (2020-07-24)
### FEATURE ENHANCEMENT
- azure_rm_storageblob: add batch upload feature ([#203](https://github.com/ansible-collections/azure/pull/203))
### BUG FIXING
- azure_rm_deployment_info: getting the template_link when it does not exist ([#180](https://github.com/ansible-collections/azure/pull/180))
- azure_rm_virtualmachine: protect against no diskSizeGB ([#185](https://github.com/ansible-collections/azure/pull/185))
- azure_rm_deployment: misleading status code in module failure message ([#204](https://github.com/ansible-collections/azure/pull/204))
- azure_rm_adserviceprincipal: invalid update check logic ([#205](https://github.com/ansible-collections/azure/pull/205))
## v0.2.0 (2020-07-03)
### NEW MODULES
- azure_rm_privatezone module ([#122](https://github.com/ansible-collections/azure/pull/122))
- azure_rm_adserviceprincipal module ([#179](https://github.com/ansible-collections/azure/pull/179))
- azure_rm_adserviceprincipal_info module ([#179](https://github.com/ansible-collections/azure/pull/179))
- azure_rm_adpassword module ([#179](https://github.com/ansible-collections/azure/pull/179))
- azure_rm_adpassword_info module ([#179](https://github.com/ansible-collections/azure/pull/179))
### FEATURE ENHANCEMENT
- add ability to remove all subnet service endpoints ([#148](https://github.com/ansible-collections/azure/pull/148))
- update network client api version ([#157](https://github.com/ansible-collections/azure/pull/157))
- add ephemeral os disk support for azure_rm_virualmachinescaleset ([#128](https://github.com/ansible-collections/azure/pull/128))
- add ephemeral os disk support for azure_rm_virtualmachine ([#124](https://github.com/ansible-collections/azure/pull/124))
- add FileEndpoint to azure_rm_storageaccount_info ([#102](https://github.com/ansible-collections/azure/pull/102))
- add support for managing the 'Firewall and virtual networks' settings in azure_rm_storageaccount ([#108](https://github.com/ansible-collections/azure/pull/108))
### BUG FIXING
- bug fixing in azure_rm_aks ([#170](https://github.com/ansible-collections/azure/pull/170))
- migrate missing doc_fragments that went missing ([#115](https://github.com/ansible-collections/azure/pull/115))
## v0.1.3 (2020-05-13)
- add new parameter in azure_rm_aks
- fix retrun value docs in azure_rm_finctionapp and auzre_rm_functionapp_info
- change README.md and update CHANGELOG.md
- fix example in azure_rm_roledefinition_info
- add Icmp rule support in azure_rm_securitygroup
- add public_ip_per_vm parameter in azure_rm_virutalmachinescaleset
- add tags in azure_rm_galleryimageversion
- add sku type in azure_rm_virtualnetworkgateway
- add tags in azure_rm_containerregistry_info
- format azure_rm_managementgroup
- add new parameter in azure_rm_storageaccount
- fixes accesss policy update in azure_rm_keyvault
## v0.1.2 (2020-03-19)
- migrate exisiting azure modules from ansible core
## v0.1.1 (2020-03-03)
- add module azure_rm_managementgroup
## v0.1.0 (2019-12-18)
- Add inventory plugin
## v0.0.2 (2019-11-15)
- Remove deprecated content
- Fix galaxy.yml
## v0.0.1 (2019-11-05)
- Init release

View File

@@ -0,0 +1,68 @@
# Contributing
When contributing to this repository, please first discuss the change you wish to make via issue, or any other method with the owners of this repository before making a change.
## Environment setup
1. Prepare the Azure configuration file at `tests/integration/cloud-config-azure.ini`, a template of which is available in [the Ansible repo](https://github.com/ansible/ansible/blob/23a84902cb9599fe958a86e7a95520837964726a/test/lib/ansible_test/config/cloud-config-azure.ini.template). Populate your appropriate credential and resource group information.
- The account or service principal must have permission (typically Owner) on the resource groups.
1. Ensure the resource groups defined in your configuration file are already created. Recommended region: **East US** (not all regions support all Azure features).
1. Prepare testing directory (necessary until [ansible/ansible#68499](https://github.com/ansible/ansible/issues/68499) is resolved):
```bash
git init ansible_collections
```
1. Unless you are running `ansible-test` inside a container (`--docker` flag), it is recommended you install Ansible and this repository's dependencies in a virtual environment:
```bash
python3 -m venv venv
. venv/bin/activate
pip3 install -U pip
pip3 install ansible
pip3 install -r requirements-azure.txt
pip3 install -r sanity-requirements-azure.txt
```
## Running tests
1. Build/install the collection:
```bash
rm -f azure-azcollection-*.tar.gz && ansible-galaxy collection build . --force && ansible-galaxy collection install azure-azcollection-*.tar.gz --force
```
1. Switch to the test environment directory where the collection installed:
```bash
cd ansible_collections/azure/azcollection/
```
1. Run tests for the desired module(s):
```bash
ansible-test integration azure_rm_storageaccount --allow-destructive -v
ansible-test sanity azure_rm_storageaccount --color --junit -v
```
Additional `ansible-test` resources:
* [Integration tests](https://docs.ansible.com/ansible/latest/dev_guide/testing_integration.html).
* [Testing Sanity](https://docs.ansible.com/ansible/latest/dev_guide/testing_sanity.html).
## Pull Request Process
1. Fork this project into your account if you are a first-time contributor.
1. Create a branch based on the latest `dev` branch, commit your changes on this branch.
1. You may merge the Pull Request in once you have the sign-off of two other developers, or if you do not have permission to do that, you may request the second reviewer to merge it for you.
## Tests / sanity checks
1. Please provide integration tests showing the changed behavior/functionality under `tests/integration/targets/<relevant-module>/tasks`.
1. Think about updating the documentation and examples for the changed module.
1. Please run a sanity check. Install prerequisites `pip install -r sanity-requirements-azure.txt`, run with `ansible-test sanity --color -v --junit`. Read more at https://docs.ansible.com/ansible/latest/dev_guide/testing_sanity.html.
1. There is a script `tests/utils/ado/ado.sh` for running tests inside an Azure DevOps pipeline. Unfortunately the pipeline and results are not visible for the public. You can perhaps adapt the parts of the script or use a small playbook to run the task list of the integration tests mentioned above.
## Release Process
1. Create a release branch from the target commit on dev branch.
1. Update version in [galaxy.yml](galaxy.yml) and release logs in [CHANGELOG.md](CHANGELOG.md).
1. Make sure the release branch is ready to release, merge the release branch into master branch.
1. Tag the master branch with new version number like `v*.*.*`, push to origin.
1. Release pipleline will automatically release the new version to galaxy.
1. Merge released changes back to `dev` branch.
## Release status
For each release details, you can refer to the [CHANGELOG](CHANGELOG.md) which contains the dates and significant changes in each minor release.

View File

@@ -0,0 +1,17 @@
{
"tool": "Credential Scanner",
"suppressions": [
{
"placeholder": "Password123!",
"_justification": "Mock secret used for tests and samples."
},
{
"file": "cert1.txt",
"_justification": "Legitimate IT certificate file with private key"
},
{
"file": "cert2.txt",
"_justification": "Legitimate IT certificate file with private key"
}
]
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@@ -0,0 +1,38 @@
{
"collection_info": {
"namespace": "azure",
"name": "azcollection",
"version": "1.14.0",
"authors": [
"Microsoft <ansible@microsoft.com>"
],
"readme": "README.md",
"tags": [
"cloud",
"linux",
"networking",
"storage",
"security",
"database",
"application"
],
"description": "The Azure collection.",
"license": [
"GPL-2.0-or-later"
],
"license_file": null,
"dependencies": {},
"repository": "https://github.com/ansible-collections/azure",
"documentation": null,
"homepage": "https://azure.microsoft.com",
"issues": "https://github.com/ansible-collections/azure/issues"
},
"file_manifest_file": {
"name": "FILES.json",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "73de5faf8fdaf825ae9fdeccec5cb7fd2fc78d47c16c8e3e8a43d17078f1dbeb",
"format": 1
},
"format": 1
}

View File

@@ -0,0 +1,96 @@
# 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)
[![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)
This collection provides a series of Ansible modules and plugins for interacting with the [Azure](https://azure.microsoft.com).
Documentation of individual modules is [available in the Ansible docs site](https://docs.ansible.com/ansible/latest/collections/azure/azcollection/index.html#plugins-in-azure-azcollection)
## Installation
It is recommended to run ansible in [Virtualenv](https://virtualenv.pypa.io/en/latest/)
## Requirements
- ansible version >= 2.9
To install Azure collection hosted in Galaxy:
```bash
ansible-galaxy collection install azure.azcollection
```
Install dependencies required by the collection (adjust path to collection if necessary):
```bash
pip3 install -r ~/.ansible/collections/ansible_collections/azure/azcollection/requirements-azure.txt
```
To upgrade to the latest version of Azure collection:
```bash
ansible-galaxy collection install azure.azcollection --force
```
## Usage
### Playbooks
To use a module from Azure collection, please reference the full namespace, collection name, and modules name that you want to use:
```yaml
---
- name: Using Azure collection
hosts: localhost
tasks:
- azure.azcollection.azure_rm_storageaccount:
resource_group: myResourceGroup
name: mystorageaccount
account_type: Standard_LRS
```
Or you can add full namepsace and collecton name in the `collections` element:
```yaml
---
- name: Using Azure collection
hosts: localhost
collections:
- azure.azcollection
tasks:
- azure_rm_storageaccount:
resource_group: myResourceGroup
name: mystorageaccount
account_type: Standard_LRS
```
### Roles
For existing Ansible roles, please also reference the full namespace, collection name, and modules name which used in tasks instead of just modules name.
### Plugins
To use a pluign from Azure collection, please reference the full namespace, collection name, and plugins name that you want to use:
```yaml
plugin: azure.azcollection.azure_rm
include_vm_resource_groups:
- ansible-inventory-test-rg
auth_source: auto
```
## Contributing
There are many ways in which you can participate in the project, for example:
- Submit bugs and feature requests, and help us verify as they are checked in
- Review source code changes
- Review the documentation and make pull requests for anything from typos to new content
- If you are interested in fixing issues and contributing directly to the code base, please see the [CONTRIBUTING](CONTRIBUTING.md) document
## License
GNU General Public License v3.0
See [LICENSE](LICENSE) to see the full text.

View File

@@ -0,0 +1,45 @@
trigger:
batch: true
branches:
include:
- "*"
jobs:
- 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'

View File

@@ -0,0 +1,3 @@
dependencies:
python: requirements-azure.txt
version: 1

View File

@@ -0,0 +1,269 @@
---
requires_ansible: '>=2.9.10'
action_groups:
all:
- azure.azcollection.azure_rm_adapplication
- azure.azcollection.azure_rm_adapplication_info
- azure.azcollection.azure_rm_adgroup
- 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_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_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_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_privateendpointdnszonegroup
- azure.azcollection.azure_rm_privateendpointdnszonegroup_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_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_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

View File

@@ -0,0 +1,143 @@
# -*- coding: utf-8 -*-
# Copyright: (c) 2016 Matt Davis, <mdavis@ansible.com>
# Copyright: (c) 2016 Chris Houseknecht, <house@redhat.com>
# 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
class ModuleDocFragment(object):
# Azure doc fragment
DOCUMENTATION = r'''
options:
ad_user:
description:
- Active Directory username. Use when authenticating with an Active Directory user rather than service
principal.
type: str
password:
description:
- Active Directory user password. Use when authenticating with an Active Directory user rather than service
principal.
type: str
profile:
description:
- Security profile found in ~/.azure/credentials file.
type: str
subscription_id:
description:
- Your Azure subscription Id.
type: str
client_id:
description:
- Azure client ID. Use when authenticating with a Service Principal.
type: str
secret:
description:
- Azure client secret. Use when authenticating with a Service Principal.
type: str
tenant:
description:
- Azure tenant ID. Use when authenticating with a Service Principal.
type: str
cloud_environment:
description:
- For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, C(AzureChinaCloud),
C(AzureUSGovernment)), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or
the C(AZURE_CLOUD_ENVIRONMENT) environment variable.
type: str
default: AzureCloud
version_added: '0.0.1'
adfs_authority_url:
description:
- Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority.
type: str
version_added: '0.0.1'
cert_validation_mode:
description:
- Controls the certificate validation behavior for Azure endpoints. By default, all modules will validate the server certificate, but
when an HTTPS proxy is in use, or against Azure Stack, it may be necessary to disable this behavior by passing C(ignore). Can also be
set via credential file profile or the C(AZURE_CERT_VALIDATION) environment variable.
type: str
choices: [ ignore, validate ]
version_added: '0.0.1'
auth_source:
description:
- Controls the source of the credentials to use for authentication.
- Can also be set via the C(ANSIBLE_AZURE_AUTH_SOURCE) environment variable.
- When set to C(auto) (the default) the precedence is module parameters -> C(env) -> C(credential_file) -> C(cli).
- When set to C(env), the credentials will be read from the environment variables
- When set to C(credential_file), it will read the profile from C(~/.azure/credentials).
- When set to C(cli), the credentials will be sources from the Azure CLI profile. C(subscription_id) or the environment variable
C(AZURE_SUBSCRIPTION_ID) can be used to identify the subscription ID if more than one is present otherwise the default
az cli subscription is used.
- When set to C(msi), the host machine must be an azure resource with an enabled MSI extension. C(subscription_id) or the
environment variable C(AZURE_SUBSCRIPTION_ID) can be used to identify the subscription ID if the resource is granted
access to more than one subscription, otherwise the first subscription is chosen.
- The C(msi) was added in Ansible 2.6.
type: str
default: auto
choices:
- auto
- cli
- credential_file
- env
- msi
version_added: '0.0.1'
api_profile:
description:
- Selects an API profile to use when communicating with Azure services. Default value of C(latest) is appropriate for public clouds;
future values will allow use with Azure Stack.
type: str
default: latest
version_added: '0.0.1'
log_path:
description:
- Parent argument.
type: str
log_mode:
description:
- Parent argument.
type: str
x509_certificate_path:
description:
- Path to the X509 certificate used to create the service principal in PEM format.
- The certificate must be appended to the private key.
- Use when authenticating with a Service Principal.
type: path
version_added: '1.14.0'
thumbprint:
description:
- The thumbprint of the private key specified in I(x509_certificate_path).
- Use when authenticating with a Service Principal.
- Required if I(x509_certificate_path) is defined.
type: str
version_added: '1.14.0'
requirements:
- python >= 2.7
- The host that executes this module must have the azure.azcollection collection installed via galaxy
- All python packages listed in collection's requirements-azure.txt must be installed via pip on the host that executes modules from azure.azcollection
- Full installation instructions may be found https://galaxy.ansible.com/azure/azcollection
notes:
- For authentication with Azure you can pass parameters, set environment variables, use a profile stored
in ~/.azure/credentials, or log in before you run your tasks or playbook with C(az login).
- Authentication is also possible using a service principal or Active Directory user.
- To authenticate via service principal, pass subscription_id, client_id, secret and tenant or set environment
variables AZURE_SUBSCRIPTION_ID, AZURE_CLIENT_ID, AZURE_SECRET and AZURE_TENANT.
- To authenticate via Active Directory user, pass ad_user and password, or set AZURE_AD_USER and
AZURE_PASSWORD in the environment.
- "Alternatively, credentials can be stored in ~/.azure/credentials. This is an ini file containing
a [default] section and the following keys: subscription_id, client_id, secret and tenant or
subscription_id, ad_user and password. It is also possible to add additional profiles. Specify the profile
by passing profile or setting AZURE_PROFILE in the environment."
seealso:
- name: Sign in with Azure CLI
link: https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest
description: How to authenticate using the C(az login) command.
'''

View File

@@ -0,0 +1,94 @@
# -*- coding: utf-8 -*-
# Copyright: (c) 2016 Matt Davis, <mdavis@ansible.com>
# Copyright: (c) 2016 Chris Houseknecht, <house@redhat.com>
# 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
class ModuleDocFragment(object):
# Azure doc fragment
DOCUMENTATION = r'''
options:
plugin:
description: marks this as an instance of the 'azure_rm' plugin
required: true
choices: ['azure_rm', 'azure.azcollection.azure_rm']
include_vm_resource_groups:
description: A list of resource group names to search for virtual machines. '\*' will include all resource
groups in the subscription.
default: ['*']
include_vmss_resource_groups:
description: A list of resource group names to search for virtual machine scale sets (VMSSs). '\*' will
include all resource groups in the subscription.
default: []
fail_on_template_errors:
description: When false, template failures during group and filter processing are silently ignored (eg,
if a filter or group expression refers to an undefined host variable)
choices: [True, False]
default: True
keyed_groups:
description: Creates groups based on the value of a host variable. Requires a list of dictionaries,
defining C(key) (the source dictionary-typed variable), C(prefix) (the prefix to use for the new group
name), and optionally C(separator) (which defaults to C(_))
conditional_groups:
description: A mapping of group names to Jinja2 expressions. When the mapped expression is true, the host
is added to the named group.
hostvar_expressions:
description: A mapping of hostvar names to Jinja2 expressions. The value for each host is the result of the
Jinja2 expression (which may refer to any of the host's existing variables at the time this inventory
plugin runs).
exclude_host_filters:
description: Excludes hosts from the inventory with a list of Jinja2 conditional expressions. Each
expression in the list is evaluated for each host; when the expression is true, the host is excluded
from the inventory.
default: []
batch_fetch:
description: To improve performance, results are fetched using an unsupported batch API. Disabling
C(batch_fetch) uses a much slower serial fetch, resulting in many more round-trips. Generally only
useful for troubleshooting.
default: true
default_host_filters:
description: A default set of filters that is applied in addition to the conditions in
C(exclude_host_filters) to exclude powered-off and not-fully-provisioned hosts. Set this to a different
value or empty list if you need to include hosts in these states.
default: ['powerstate != "running"', 'provisioning_state != "succeeded"']
use_contrib_script_compatible_sanitization:
description:
- By default this plugin is using a general group name sanitization to create safe and usable group names for use in Ansible.
This option allows you to override that, in efforts to allow migration from the old inventory script and
matches the sanitization of groups when the script's ``replace_dash_in_groups`` option is set to ``False``.
To replicate behavior of ``replace_dash_in_groups = True`` with constructed groups,
you will need to replace hyphens with underscores via the regex_replace filter for those entries.
- For this to work you should also turn off the TRANSFORM_INVALID_GROUP_CHARS setting,
otherwise the core engine will just use the standard sanitization on top.
- This is not the default as such names break certain functionality as not all characters are valid Python identifiers
which group names end up being used as.
type: bool
default: False
version_added: '0.0.1'
plain_host_names:
description:
- By default this plugin will use globally unique host names.
This option allows you to override that, and use the name that matches the old inventory script naming.
- This is not the default, as these names are not truly unique, and can conflict with other hosts.
The default behavior will add extra hashing to the end of the hostname to prevent such conflicts.
type: bool
default: False
version_added: '0.0.1'
hostnames:
description:
- A list of Jinja2 expressions in order of precedence to compose inventory_hostname.
- Ignores expression if result is an empty string or None value.
- By default, inventory_hostname is generated to be globally unique based on the VM host name.
See C(plain_host_names) for more details on the default.
- An expression of 'default' will force using the default hostname generator if no previous hostname expression
resulted in a valid hostname.
- Use ``default_inventory_hostname`` to access the default hostname generator's value in any of the Jinja2 expressions.
type: list
elements: str
default: [default]
'''

View File

@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Matt Davis, <mdavis@ansible.com>
# Copyright: (c) 2016, Chris Houseknecht, <house@redhat.com>
# 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
class ModuleDocFragment(object):
# Azure doc fragment
DOCUMENTATION = r'''
options:
tags:
description:
- Dictionary of string:string pairs to assign as metadata to the object.
- Metadata tags on the object will be updated with any provided values.
- To remove tags set append_tags option to false.
- Currently, Azure DNS zones and Traffic Manager services also don't allow the use of spaces in the tag.
- Azure Front Door doesn't support the use of # in the tag name.
- Azure Automation and Azure CDN only support 15 tags on resources.
type: dict
append_tags:
description:
- Use to control if tags field is canonical or just appends to existing tags.
- When canonical, any tags not found in the tags parameter will be removed from the object's metadata.
type: bool
default: yes
'''

View File

@@ -0,0 +1,649 @@
# Copyright (c) 2018 Ansible Project
# 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 = r'''
name: azure_rm
short_description: Azure Resource Manager inventory plugin
extends_documentation_fragment:
- azure.azcollection.azure
- azure.azcollection.azure_rm
- constructed
description:
- Query VM details from Azure Resource Manager
- Requires a YAML configuration file whose name ends with 'azure_rm.(yml|yaml)'
- By default, sets C(ansible_host) to the first public IP address found (preferring the primary NIC). If no
public IPs are found, the first private IP (also preferring the primary NIC). The default may be overridden
via C(hostvar_expressions); see examples.
'''
EXAMPLES = '''
# The following host variables are always available:
# public_ipv4_addresses: all public IP addresses, with the primary IP config from the primary NIC first
# public_dns_hostnames: all public DNS hostnames, with the primary IP config from the primary NIC first
# private_ipv4_addresses: all private IP addressses, with the primary IP config from the primary NIC first
# id: the VM's Azure resource ID, eg /subscriptions/00000000-0000-0000-1111-1111aaaabb/resourceGroups/my_rg/providers/Microsoft.Compute/virtualMachines/my_vm
# location: the VM's Azure location, eg 'westus', 'eastus'
# name: the VM's resource name, eg 'myvm'
# os_profile: The VM OS properties, a dictionary, only system is currently available, eg 'os_profile.system not in ['linux']'
# powerstate: the VM's current power state, eg: 'running', 'stopped', 'deallocated'
# provisioning_state: the VM's current provisioning state, eg: 'succeeded'
# tags: dictionary of the VM's defined tag values
# resource_type: the VM's resource type, eg: 'Microsoft.Compute/virtualMachine', 'Microsoft.Compute/virtualMachineScaleSets/virtualMachines'
# 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'
#
# 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.
# sample 'myazuresub.azure_rm.yaml'
# required for all azure_rm inventory plugin configs
plugin: azure.azcollection.azure_rm
# forces this plugin to use a CLI auth session instead of the automatic auth source selection (eg, prevents the
# presence of 'ANSIBLE_AZURE_RM_X' environment variables from overriding CLI auth)
auth_source: cli
# fetches VMs from an explicit list of resource groups instead of default all (- '*')
include_vm_resource_groups:
- 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"
# 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
# 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
# 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
# places each host in a group named 'azure_loc_(location name)', depending on the VM's 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')
# 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'
'''
# FUTURE: do we need a set of sane default filters, separate from the user-defineable ones?
# eg, powerstate==running, provisioning_state==succeeded
import hashlib
import json
import re
import uuid
try:
from queue import Queue, Empty
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
from ansible.errors import AnsibleParserError, AnsibleError
from ansible.module_utils.parsing.convert_bool import boolean
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
except ImportError:
AzureConfiguration = object
ARMPolling = object
parse_resource_id = object
ServiceClient = object
Serializer = object
Deserializer = object
pass
class AzureRMRestConfiguration(AzureConfiguration):
def __init__(self, credentials, subscription_id, base_url=None):
if credentials 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'
super(AzureRMRestConfiguration, self).__init__(base_url)
self.add_user_agent('ansible-dynamic-inventory/{0}'.format(release.__version__))
self.credentials = credentials
self.subscription_id = subscription_id
UrlAction = namedtuple('UrlAction', ['url', 'api_version', 'handler', 'handler_args'])
# FUTURE: add Cacheable support once we have a sane serialization format
class InventoryModule(BaseInventoryPlugin, Constructable):
NAME = 'azure.azcollection.azure_rm'
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._network_api_version = '2015-06-15'
self._default_header_parameters = {'Content-Type': 'application/json; charset=utf-8'}
self._request_queue = Queue()
self.azure_auth = None
self._batch_fetch = False
def verify_file(self, path):
'''
:param loader: an ansible.parsing.dataloader.DataLoader object
:param path: the path to the inventory config file
:return the contents of the config file
'''
if super(InventoryModule, self).verify_file(path):
if re.match(r'.{0,}azure_rm\.y(a)?ml$', path):
return True
# display.debug("azure_rm inventory filename must end with 'azure_rm.yml' or 'azure_rm.yaml'")
return False
def parse(self, inventory, loader, path, cache=True):
super(InventoryModule, self).parse(inventory, loader, path)
self._read_config_data(path)
if self.get_option('use_contrib_script_compatible_sanitization'):
self._sanitize_group_name = self._legacy_script_compatible_group_sanitization
self._batch_fetch = self.get_option('batch_fetch')
self._legacy_hostnames = self.get_option('plain_host_names')
self._filters = self.get_option('exclude_host_filters') + self.get_option('default_host_filters')
try:
self._credential_setup()
self._get_hosts()
except Exception:
raise
def _credential_setup(self):
auth_options = dict(
auth_source=self.get_option('auth_source'),
profile=self.get_option('profile'),
subscription_id=self.get_option('subscription_id'),
client_id=self.get_option('client_id'),
secret=self.get_option('secret'),
tenant=self.get_option('tenant'),
ad_user=self.get_option('ad_user'),
password=self.get_option('password'),
cloud_environment=self.get_option('cloud_environment'),
cert_validation_mode=self.get_option('cert_validation_mode'),
api_profile=self.get_option('api_profile'),
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.azure_auth._cloud_environment.endpoints.resource_manager)
self._client = ServiceClient(self._clientconfig.credentials, self._clientconfig)
def _enqueue_get(self, url, api_version, handler, handler_args=None):
if not handler_args:
handler_args = {}
self._request_queue.put_nowait(UrlAction(url=url, api_version=api_version, handler=handler, handler_args=handler_args))
def _enqueue_vm_list(self, rg='*'):
if not rg or rg == '*':
url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines'
else:
url = '/subscriptions/{subscriptionId}/resourceGroups/{rg}/providers/Microsoft.Compute/virtualMachines'
url = url.format(subscriptionId=self._clientconfig.subscription_id, rg=rg)
self._enqueue_get(url=url, api_version=self._compute_api_version, handler=self._on_vm_page_response)
def _enqueue_vmss_list(self, rg=None):
if not rg or rg == '*':
url = '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets'
else:
url = '/subscriptions/{subscriptionId}/resourceGroups/{rg}/providers/Microsoft.Compute/virtualMachineScaleSets'
url = url.format(subscriptionId=self._clientconfig.subscription_id, rg=rg)
self._enqueue_get(url=url, api_version=self._compute_api_version, handler=self._on_vmss_page_response)
def _get_hosts(self):
for vm_rg in self.get_option('include_vm_resource_groups'):
self._enqueue_vm_list(vm_rg)
for vmss_rg in self.get_option('include_vmss_resource_groups'):
self._enqueue_vmss_list(vmss_rg)
if self._batch_fetch:
self._process_queue_batch()
else:
self._process_queue_serial()
constructable_config_strict = boolean(self.get_option('fail_on_template_errors'))
constructable_config_compose = self.get_option('hostvar_expressions')
constructable_config_groups = self.get_option('conditional_groups')
constructable_config_keyed_groups = self.get_option('keyed_groups')
constructable_hostnames = self.get_option('hostnames')
for h in self._hosts:
# FUTURE: track hostnames to warn if a hostname is repeated (can happen for legacy and for composed inventory_hostname)
inventory_hostname = self._get_hostname(h, hostnames=constructable_hostnames, strict=constructable_config_strict)
if self._filter_host(inventory_hostname, h.hostvars):
continue
self.inventory.add_host(inventory_hostname)
# FUTURE: configurable default IP list? can already do this via hostvar_expressions
self.inventory.set_variable(inventory_hostname, "ansible_host",
next(chain(h.hostvars['public_ipv4_addresses'], h.hostvars['private_ipv4_addresses']), None))
for k, v in iteritems(h.hostvars):
# FUTURE: configurable hostvar prefix? Makes docs harder...
self.inventory.set_variable(inventory_hostname, k, v)
# constructable delegation
self._set_composite_vars(constructable_config_compose, h.hostvars, inventory_hostname, strict=constructable_config_strict)
self._add_host_to_composed_groups(constructable_config_groups, h.hostvars, inventory_hostname, strict=constructable_config_strict)
self._add_host_to_keyed_groups(constructable_config_keyed_groups, h.hostvars, inventory_hostname, strict=constructable_config_strict)
# FUTURE: fix underlying inventory stuff to allow us to quickly access known groupvars from reconciled host
def _filter_host(self, inventory_hostname, hostvars):
self.templar.available_variables = hostvars
for condition in self._filters:
# FUTURE: should warn/fail if conditional doesn't return True or False
conditional = "{{% if {0} %}} True {{% else %}} False {{% endif %}}".format(condition)
try:
if boolean(self.templar.template(conditional)):
return True
except Exception as e:
if boolean(self.get_option('fail_on_template_errors')):
raise AnsibleParserError("Error evaluating filter condition '{0}' for host {1}: {2}".format(condition, inventory_hostname, to_native(e)))
continue
return False
def _get_hostname(self, host, hostnames=None, strict=False):
hostname = None
errors = []
for preference in hostnames:
if preference == 'default':
return host.default_inventory_hostname
try:
hostname = self._compose(preference, host.hostvars)
except Exception as e: # pylint: disable=broad-except
if strict:
raise AnsibleError("Could not compose %s as hostnames - %s" % (preference, to_native(e)))
else:
errors.append(
(preference, str(e))
)
if hostname:
return to_text(hostname)
raise AnsibleError(
'Could not template any hostname for host, errors for each preference: %s' % (
', '.join(['%s: %s' % (pref, err) for pref, err in errors])
)
)
def _process_queue_serial(self):
try:
while True:
item = self._request_queue.get_nowait()
resp = self.send_request(item.url, item.api_version)
item.handler(resp, **item.handler_args)
except Empty:
pass
def _on_vm_page_response(self, response, vmss=None):
next_link = response.get('nextLink')
if next_link:
self._enqueue_get(url=next_link, api_version=self._compute_api_version, handler=self._on_vm_page_response)
if 'value' in response:
for h in response['value']:
# FUTURE: add direct VM filtering by tag here (performance optimization)?
self._hosts.append(AzureHost(h, self, vmss=vmss, legacy_name=self._legacy_hostnames))
def _on_vmss_page_response(self, response):
next_link = response.get('nextLink')
if next_link:
self._enqueue_get(url=next_link, api_version=self._compute_api_version, handler=self._on_vmss_page_response)
# FUTURE: add direct VMSS filtering by tag here (performance optimization)?
for vmss in response['value']:
url = '{0}/virtualMachines'.format(vmss['id'])
# VMSS instances look close enough to regular VMs that we can share the handler impl...
self._enqueue_get(url=url, api_version=self._compute_api_version, handler=self._on_vm_page_response, handler_args=dict(vmss=vmss))
# use the undocumented /batch endpoint to bulk-send up to 500 requests in a single round-trip
#
def _process_queue_batch(self):
while True:
batch_requests = []
batch_item_index = 0
batch_response_handlers = dict()
try:
while batch_item_index < 100:
item = self._request_queue.get_nowait()
name = str(uuid.uuid4())
query_parameters = {'api-version': item.api_version}
req = self._client.get(item.url, query_parameters)
batch_requests.append(dict(httpMethod="GET", url=req.url, name=name))
batch_response_handlers[name] = item
batch_item_index += 1
except Empty:
pass
if not batch_requests:
break
batch_resp = self._send_batch(batch_requests)
key_name = None
if 'responses' in batch_resp:
key_name = 'responses'
elif 'value' in batch_resp:
key_name = 'value'
else:
raise AnsibleError("didn't find expected key responses/value in batch response")
for idx, r in enumerate(batch_resp[key_name]):
status_code = r.get('httpStatusCode')
returned_name = r['name']
result = batch_response_handlers[returned_name]
if status_code != 200:
# FUTURE: error-tolerant operation mode (eg, permissions)
raise AnsibleError("a batched request failed with status code {0}, url {1}".format(status_code, result.url))
# FUTURE: store/handle errors from individual handlers
result.handler(r['content'], **result.handler_args)
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 = {'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)
# 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()
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
return json.loads(content)
@staticmethod
def _legacy_script_compatible_group_sanitization(name):
# note that while this mirrors what the script used to do, it has many issues with unicode and usability in python
regex = re.compile(r"[^A-Za-z0-9\_\-]")
return regex.sub('_', name)
# VM list (all, N resource groups): VM -> InstanceView, N NICs, N PublicIPAddress)
# VMSS VMs (all SS, N specific SS, N resource groups?): SS -> VM -> InstanceView, N NICs, N PublicIPAddress)
class AzureHost(object):
_powerstate_regex = re.compile('^PowerState/(?P<powerstate>.+)$')
def __init__(self, vm_model, inventory_client, vmss=None, legacy_name=False):
self._inventory_client = inventory_client
self._vm_model = vm_model
self._vmss = vmss
self._instanceview = None
self._powerstate = "unknown"
self.nics = []
if legacy_name:
self.default_inventory_hostname = vm_model['name']
else:
# Azure often doesn't provide a globally-unique filename, so use resource name + a chunk of ID hash
self.default_inventory_hostname = '{0}_{1}'.format(vm_model['name'], hashlib.sha1(to_bytes(vm_model['id'])).hexdigest()[0:4])
self._hostvars = {}
inventory_client._enqueue_get(url="{0}/instanceView".format(vm_model['id']),
api_version=self._inventory_client._compute_api_version,
handler=self._on_instanceview_response)
nic_refs = vm_model['properties']['networkProfile']['networkInterfaces']
for nic in nic_refs:
# single-nic instances don't set primary, so figure it out...
is_primary = nic.get('properties', {}).get('primary', len(nic_refs) == 1)
inventory_client._enqueue_get(url=nic['id'], api_version=self._inventory_client._network_api_version,
handler=self._on_nic_response,
handler_args=dict(is_primary=is_primary))
@property
def hostvars(self):
if self._hostvars != {}:
return self._hostvars
system = "unknown"
if 'osProfile' in self._vm_model['properties']:
if 'linuxConfiguration' in self._vm_model['properties']['osProfile']:
system = 'linux'
if 'windowsConfiguration' in self._vm_model['properties']['osProfile']:
system = 'windows'
else:
osType = self._vm_model['properties']['storageProfile']['osDisk']['osType']
if osType == 'Linux':
system = 'linux'
if osType == 'Windows':
system = 'windows'
av_zone = None
if 'zones' in self._vm_model:
av_zone = self._vm_model['zones']
new_hostvars = dict(
network_interface=[],
mac_address=[],
network_interface_id=[],
security_group_id=[],
security_group=[],
public_ipv4_addresses=[],
public_dns_hostnames=[],
private_ipv4_addresses=[],
id=self._vm_model['id'],
location=self._vm_model['location'],
name=self._vm_model['name'],
computer_name=self._vm_model['properties'].get('osProfile', {}).get('computerName'),
availability_zone=av_zone,
powerstate=self._powerstate,
provisioning_state=self._vm_model['properties']['provisioningState'].lower(),
tags=self._vm_model.get('tags', {}),
resource_type=self._vm_model.get('type', "unknown"),
vmid=self._vm_model['properties']['vmId'],
os_profile=dict(
system=system,
),
vmss=dict(
id=self._vmss['id'],
name=self._vmss['name'],
) if self._vmss else {},
virtual_machine_size=self._vm_model['properties']['hardwareProfile']['vmSize'] if self._vm_model['properties'].get('hardwareProfile') else None,
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,
)
# set nic-related values from the primary NIC first
for nic in sorted(self.nics, key=lambda n: n.is_primary, reverse=True):
# and from the primary IP config per NIC first
for ipc in sorted(nic._nic_model['properties']['ipConfigurations'], key=lambda i: i['properties'].get('primary', False), reverse=True):
private_ip = ipc['properties'].get('privateIPAddress')
if private_ip:
new_hostvars['private_ipv4_addresses'].append(private_ip)
pip_id = ipc['properties'].get('publicIPAddress', {}).get('id')
if pip_id:
new_hostvars['public_ip_id'] = pip_id
pip = nic.public_ips[pip_id]
new_hostvars['public_ip_name'] = pip._pip_model['name']
new_hostvars['public_ipv4_addresses'].append(pip._pip_model['properties'].get('ipAddress', None))
pip_fqdn = pip._pip_model['properties'].get('dnsSettings', {}).get('fqdn')
if pip_fqdn:
new_hostvars['public_dns_hostnames'].append(pip_fqdn)
new_hostvars['mac_address'].append(nic._nic_model['properties'].get('macAddress'))
new_hostvars['network_interface'].append(nic._nic_model['name'])
new_hostvars['network_interface_id'].append(nic._nic_model['id'])
new_hostvars['security_group_id'].append(nic._nic_model['properties']['networkSecurityGroup']['id']) \
if nic._nic_model['properties'].get('networkSecurityGroup') else None
new_hostvars['security_group'].append(parse_resource_id(nic._nic_model['properties']['networkSecurityGroup']['id'])['resource_name']) \
if nic._nic_model['properties'].get('networkSecurityGroup') else None
# set image and os_disk
new_hostvars['image'] = {}
new_hostvars['os_disk'] = {}
new_hostvars['data_disks'] = []
storageProfile = self._vm_model['properties'].get('storageProfile')
if storageProfile:
imageReference = storageProfile.get('imageReference')
if imageReference:
if imageReference.get('publisher'):
new_hostvars['image'] = dict(
sku=imageReference.get('sku'),
publisher=imageReference.get('publisher'),
version=imageReference.get('version'),
offer=imageReference.get('offer')
)
elif imageReference.get('id'):
new_hostvars['image'] = dict(
id=imageReference.get('id')
)
osDisk = storageProfile.get('osDisk')
new_hostvars['os_disk'] = dict(
name=osDisk.get('name'),
operating_system_type=osDisk.get('osType').lower() if osDisk.get('osType') else None,
id=osDisk.get('managedDisk', {}).get('id')
)
new_hostvars['data_disks'] = [
dict(
name=dataDisk.get('name'),
lun=dataDisk.get('lun'),
id=dataDisk.get('managedDisk', {}).get('id')
) for dataDisk in storageProfile.get('dataDisks', [])
]
self._hostvars = new_hostvars
return self._hostvars
def _on_instanceview_response(self, vm_instanceview_model):
self._instanceview = vm_instanceview_model
self._powerstate = next((self._powerstate_regex.match(s.get('code', '')).group('powerstate')
for s in vm_instanceview_model.get('statuses', []) if self._powerstate_regex.match(s.get('code', ''))), 'unknown')
def _on_nic_response(self, nic_model, is_primary=False):
nic = AzureNic(nic_model=nic_model, inventory_client=self._inventory_client, is_primary=is_primary)
self.nics.append(nic)
class AzureNic(object):
def __init__(self, nic_model, inventory_client, is_primary=False):
self._nic_model = nic_model
self.is_primary = is_primary
self._inventory_client = inventory_client
self.public_ips = {}
if nic_model.get('properties', {}).get('ipConfigurations'):
for ipc in nic_model['properties']['ipConfigurations']:
pip = ipc['properties'].get('publicIPAddress')
if pip:
self._inventory_client._enqueue_get(url=pip['id'], api_version=self._inventory_client._network_api_version, handler=self._on_pip_response)
def _on_pip_response(self, pip_model):
self.public_ips[pip_model['id']] = AzurePip(pip_model)
class AzurePip(object):
def __init__(self, pip_model):
self._pip_model = pip_model

View File

@@ -0,0 +1,200 @@
# Copyright (c) 2022 Hai Cao, <t-haicao@microsoft.com>
#
# 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 = """
lookup: azure_keyvault_secret
author:
- Hai Cao <t-haicao@microsoft.com>
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.
- When ansible host is MSI enabled Azure VM, user don't need provide any credential to access to Azure Key Vault.
options:
_terms:
description: Secret name, version can be included like secret_name/secret_version.
required: True
vault_url:
description: Url of Azure Key Vault.
required: True
client_id:
description: Client id of service principal that has access to the Azure Key Vault
secret:
description: Secret of the service principal.
tenant_id:
description: Tenant id of service principal.
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 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 ansible host is MSI enabled Azure VM
debug:
msg: "the value of this secret is {{
lookup(
'azure.azcollection.azure_keyvault_secret',
'testSecret/version',
vault_url='https://yourvault.vault.azure.net'
)
}}"
- name: Look up secret when ansible host is general VM
vars:
url: 'https://yourvault.vault.azure.net'
secretname: 'testSecret/version'
client_id: '123456789'
secret: 'abcdefg'
tenant: 'uvwxyz'
debug:
msg: "the value of this secret is {{
lookup(
'azure.azcollection.azure_keyvault_secret',
secretname,
vault_url=url,
client_id=client_id,
secret=secret,
tenant_id=tenant
)
}}"
# Example below creates an Azure Virtual Machine with SSH public key from key vault using 'azure_keyvault_secret' lookup plugin.
- name: Create Azure VM
hosts: localhost
connection: local
no_log: True
vars:
resource_group: myResourceGroup
vm_name: testvm
location: eastus
ssh_key: "{{ lookup('azure.azcollection.azure_keyvault_secret','myssh_key') }}"
- name: Create VM
azure_rm_virtualmachine:
resource_group: "{{ resource_group }}"
name: "{{ vm_name }}"
vm_size: Standard_DS1_v2
admin_username: azureuser
ssh_password_enabled: false
ssh_public_keys:
- path: /home/azureuser/.ssh/authorized_keys
key_data: "{{ ssh_key }}"
network_interfaces: "{{ vm_name }}"
image:
offer: UbuntuServer
publisher: Canonical
sku: 16.04-LTS
version: latest
"""
RETURN = """
_raw:
description: secret content string
"""
from ansible.errors import AnsibleError, AnsibleParserError
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
from azure.keyvault import KeyVaultClient
from msrest.exceptions import AuthenticationError, ClientRequestError
from azure.keyvault.models.key_vault_error import KeyVaultErrorException
except ImportError:
pass
display = Display()
TOKEN_ACQUIRED = False
token_params = {
'api-version': '2018-02-01',
'resource': 'https://vault.azure.net'
}
token_headers = {
'Metadata': 'true'
}
token = None
try:
token_res = requests.get('http://169.254.169.254/metadata/identity/oauth2/token', params=token_params, headers=token_headers, timeout=(3.05, 27))
if token_res.ok:
token = token_res.json().get("access_token")
if token is not None:
TOKEN_ACQUIRED = True
else:
display.v('Successfully called MSI endpoint, but no token was available. Will use service principal if provided.')
else:
display.v("Unable to query MSI endpoint, Error Code %s. Will use service principal if provided" % token_res.status_code)
except Exception:
display.v('Unable to fetch MSI token. Will use service principal if provided.')
TOKEN_ACQUIRED = False
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')
try:
credentials = ServicePrincipalCredentials(
client_id=client_id,
secret=secret,
tenant=tenant_id
)
client = KeyVaultClient(credentials)
except AuthenticationError:
raise AnsibleError('Invalid credentials provided.')
ret = []
for term in terms:
try:
secret_val = client.get_secret(vault_url, term, '').value
ret.append(secret_val)
except ClientRequestError:
raise AnsibleError('Error occurred in request')
except KeyVaultErrorException:
raise AnsibleError('Failed to fetch secret ' + term + '.')
return ret
class LookupModule(LookupBase):
def run(self, terms, variables, **kwargs):
ret = []
vault_url = kwargs.pop('vault_url', None)
if vault_url is None:
raise AnsibleError('Failed to get valid vault url.')
if TOKEN_ACQUIRED:
secret_params = {'api-version': '2016-10-01'}
secret_headers = {'Authorization': 'Bearer ' + token}
for term in terms:
try:
secret_res = requests.get(vault_url + '/secrets/' + term, params=secret_params, headers=secret_headers)
ret.append(secret_res.json()["value"])
except KeyError:
raise AnsibleError('Failed to fetch secret ' + term + '.')
except Exception:
raise AnsibleError('Failed to fetch secret: ' + term + ' via MSI endpoint.')
return ret
else:
return lookup_secret_non_msi(terms, vault_url, kwargs)

View File

@@ -0,0 +1,215 @@
# Copyright (c) 2019 Zim Kalinowski, (@zikalino)
#
# 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
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.six import string_types
class AzureRMModuleBaseExt(AzureRMModuleBase):
def inflate_parameters(self, spec, body, level):
if isinstance(body, list):
for item in body:
self.inflate_parameters(spec, item, level)
return
for name in spec.keys():
# first check if option was passed
param = body.get(name)
if param is None:
if spec[name].get('purgeIfNone', False):
body.pop(name, None)
continue
# check if pattern needs to be used
pattern = spec[name].get('pattern', None)
if pattern:
if pattern == 'camelize':
param = _snake_to_camel(param, True)
elif isinstance(pattern, list):
normalized = None
for p in pattern:
normalized = self.normalize_resource_id(param, p)
body[name] = normalized
if normalized is not None:
break
else:
param = self.normalize_resource_id(param, pattern)
body[name] = param
disposition = spec[name].get('disposition', '*')
if level == 0 and not disposition.startswith('/'):
continue
if disposition == '/':
disposition = '/*'
parts = disposition.split('/')
if parts[0] == '':
# should fail if level is > 0?
parts.pop(0)
target_dict = body
elem = body.pop(name)
while len(parts) > 1:
target_dict = target_dict.setdefault(parts.pop(0), {})
targetName = parts[0] if parts[0] != '*' else name
target_dict[targetName] = elem
if spec[name].get('options'):
self.inflate_parameters(spec[name].get('options'), target_dict[targetName], level + 1)
def normalize_resource_id(self, value, pattern):
'''
Return a proper resource id string..
:param resource_id: It could be a resource name, resource id or dict containing parts from the pattern.
:param pattern: pattern of resource is, just like in Azure Swagger
'''
value_dict = {}
if isinstance(value, string_types):
value_parts = value.split('/')
if len(value_parts) == 1:
value_dict['name'] = value
else:
pattern_parts = pattern.split('/')
if len(value_parts) != len(pattern_parts):
return None
for i in range(len(value_parts)):
if pattern_parts[i].startswith('{'):
value_dict[pattern_parts[i][1:-1]] = value_parts[i]
elif value_parts[i].lower() != pattern_parts[i].lower():
return None
elif isinstance(value, dict):
value_dict = value
else:
return None
if not value_dict.get('subscription_id'):
value_dict['subscription_id'] = self.subscription_id
if not value_dict.get('resource_group'):
value_dict['resource_group'] = self.resource_group
# check if any extra values passed
for k in value_dict:
if not ('{' + k + '}') in pattern:
return None
# format url
return pattern.format(**value_dict)
def idempotency_check(self, old_params, new_params):
'''
Return True if something changed. Function will use fields from module_arg_spec to perform dependency checks.
:param old_params: old parameters dictionary, body from Get request.
:param new_params: new parameters dictionary, unpacked module parameters.
'''
modifiers = {}
result = {}
self.create_compare_modifiers(self.module.argument_spec, '', modifiers)
self.results['modifiers'] = modifiers
return self.default_compare(modifiers, new_params, old_params, '', self.results)
def create_compare_modifiers(self, arg_spec, path, result):
for k in arg_spec.keys():
o = arg_spec[k]
updatable = o.get('updatable', True)
comparison = o.get('comparison', 'default')
disposition = o.get('disposition', '*')
if disposition == '/':
disposition = '/*'
p = (path +
('/' if len(path) > 0 else '') +
disposition.replace('*', k) +
('/*' if o['type'] == 'list' else ''))
if comparison != 'default' or not updatable:
result[p] = {'updatable': updatable, 'comparison': comparison}
if o.get('options'):
self.create_compare_modifiers(o.get('options'), p, result)
def default_compare(self, modifiers, new, old, path, result):
'''
Default dictionary comparison.
This function will work well with most of the Azure resources.
It correctly handles "location" comparison.
Value handling:
- if "new" value is None, it will be taken from "old" dictionary if "incremental_update"
is enabled.
List handling:
- if list contains "name" field it will be sorted by "name" before comparison is done.
- if module has "incremental_update" set, items missing in the new list will be copied
from the old list
Warnings:
If field is marked as non-updatable, appropriate warning will be printed out and
"new" structure will be updated to old value.
:modifiers: Optional dictionary of modifiers, where key is the path and value is dict of modifiers
:param new: New version
:param old: Old version
Returns True if no difference between structures has been detected.
Returns False if difference was detected.
'''
if new is None:
return True
elif isinstance(new, dict):
comparison_result = True
if not isinstance(old, dict):
result['compare'].append('changed [' + path + '] old dict is null')
comparison_result = False
else:
for k in set(new.keys()) | set(old.keys()):
new_item = new.get(k, None)
old_item = old.get(k, None)
if new_item is None:
if isinstance(old_item, dict):
new[k] = old_item
result['compare'].append('new item was empty, using old [' + path + '][ ' + k + ' ]')
elif not self.default_compare(modifiers, new_item, old_item, path + '/' + k, result):
comparison_result = False
return comparison_result
elif isinstance(new, list):
comparison_result = True
if not isinstance(old, list) or len(new) != len(old):
result['compare'].append('changed [' + path + '] length is different or old value is null')
comparison_result = False
elif len(old) > 0:
if isinstance(old[0], dict):
key = None
if 'id' in old[0] and 'id' in new[0]:
key = 'id'
elif 'name' in old[0] and 'name' in new[0]:
key = 'name'
else:
key = next(iter(old[0]))
new = sorted(new, key=lambda x: x.get(key, None))
old = sorted(old, key=lambda x: x.get(key, None))
else:
new = sorted(new)
old = sorted(old)
for i in range(len(new)):
if not self.default_compare(modifiers, new[i], old[i], path + '/*', result):
comparison_result = False
return comparison_result
else:
updatable = modifiers.get(path, {}).get('updatable', True)
comparison = modifiers.get(path, {}).get('comparison', 'default')
if comparison == 'ignore':
return True
elif comparison == 'default' or comparison == 'sensitive':
if isinstance(old, string_types) and isinstance(new, string_types):
new = new.lower()
old = old.lower()
elif comparison == 'location':
if isinstance(old, string_types) and isinstance(new, string_types):
new = new.replace(' ', '').lower()
old = old.replace(' ', '').lower()
if str(new) != str(old):
result['compare'].append('changed [' + path + '] ' + str(new) + ' != ' + str(old) + ' - ' + str(comparison))
if updatable:
return False
else:
self.module.warn("property '" + path + "' cannot be updated (" + str(old) + "->" + str(new) + ")")
return True
else:
return True

View File

@@ -0,0 +1,104 @@
# Copyright (c) 2018 Zim Kalinowski, <zikalino@microsoft.com>
#
# 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
try:
from ansible.module_utils.ansible_release import __version__ as ANSIBLE_VERSION
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
import uuid
import json
except ImportError:
# This is handled in azure_rm_common
AzureConfiguration = object
ANSIBLE_USER_AGENT = 'Ansible/{0}'.format(ANSIBLE_VERSION)
class GenericRestClientConfiguration(AzureConfiguration):
def __init__(self, credentials, subscription_id, base_url=None):
if credentials 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'
super(GenericRestClientConfiguration, self).__init__(base_url)
self.add_user_agent(ANSIBLE_USER_AGENT)
self.credentials = credentials
self.subscription_id = subscription_id
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)
self.models = None
def query(self, url, method, query_parameters, header_parameters, body, expected_status_codes, polling_timeout, polling_interval):
# Construct and send request
operation_config = {}
request = None
if header_parameters is None:
header_parameters = {}
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if method == 'GET':
request = self._client.get(url, query_parameters)
elif method == 'PUT':
request = self._client.put(url, query_parameters)
elif method == 'POST':
request = self._client.post(url, query_parameters)
elif method == 'HEAD':
request = self._client.head(url, query_parameters)
elif method == 'PATCH':
request = self._client.patch(url, query_parameters)
elif method == 'DELETE':
request = self._client.delete(url, query_parameters)
elif method == 'MERGE':
request = self._client.merge(url, query_parameters)
response = self._client.send(request, header_parameters, body, **operation_config)
if response.status_code not in expected_status_codes:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
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),
get_long_running_output,
ARMPolling(polling_interval, **operation_config))
response = self.get_poller_result(poller, polling_timeout)
return response
def get_poller_result(self, poller, timeout):
try:
poller.wait(timeout=timeout)
return poller.result()
except Exception as exc:
raise

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