Add Azure support to ansible-test. (#28092)

* Initial Azure cloud testing support.
* Add missing Azure requirements.
* Fix test handling of setup and requirements.
* Update Azure cloud plugin.
* Add setup_azure role for integration tests.
* Update minimal Azure integration test sample.
This commit is contained in:
Matt Clay 2017-08-11 17:33:39 -07:00 committed by GitHub
commit caf8bbf3bd
11 changed files with 261 additions and 8 deletions

View file

@ -0,0 +1,31 @@
# This is the configuration template for ansible-test Azure integration tests.
#
# You do not need this template if you are:
#
# 1) Running integration tests without using ansible-test.
# 2) Using the automatically provisioned Azure credentials in ansible-test.
#
# If you do not want to use the automatically provisioned temporary Azure credentials,
# fill in the values below and save this file without the .template extension.
# This will cause ansible-test to use the given configuration instead of temporary credentials.
#
# NOTE: Automatic provisioning of Azure credentials requires one of:
# 1) ansible-core-ci API key in ~/.ansible-core-ci.key
# 2) Sherlock URL (including API key) in ~/.ansible-sherlock-ci.cfg
# Provide either Service Principal or Active Directory credentials below.
# Service Principal
AZURE_CLIENT_ID=
AZURE_SECRET=
AZURE_SUBSCRIPTION_ID=
AZURE_TENANT=
# Active Directory
AZURE_AD_USER=
AZURE_PASSWORD=
AZURE_SUBSCRIPTION_ID=
# Resource Groups
RESOURCE_GROUP=
RESOURCE_GROUP_SECONDARY=

View file

@ -50,3 +50,6 @@ overridden_in_parent=2000
[amazon]
localhost ansible_ssh_host=127.0.0.1 ansible_connection=local
[azure]
localhost ansible_ssh_host=127.0.0.1 ansible_connection=local

View file

@ -0,0 +1,2 @@
cloud/azure
destructive

View file

@ -0,0 +1,2 @@
dependencies:
- setup_azure

View file

@ -0,0 +1,7 @@
- block:
- name: create a virtual network
azure_rm_virtualnetwork:
resource_group: '{{ resource_group }}'
name: test
address_prefixes_cidr:
- "10.1.0.0/16"

View file

@ -0,0 +1,2 @@
- pip:
requirements: '{{ role_path }}/../../../../packaging/requirements/requirements-azure.txt'