azure.azcollection.azure_rm_appgateway – Manage Application Gateway instance
Note
This plugin is part of the azure.azcollection collection (version 1.10.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install azure.azcollection
.
To use it in a playbook, specify: azure.azcollection.azure_rm_appgateway
.
New in version 0.1.2: of azure.azcollection
Requirements
The below requirements are needed on the host that executes this module.
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
Parameters
Parameter |
Comments |
---|---|
Active Directory username. Use when authenticating with an Active Directory user rather than service principal. |
|
Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. |
|
Selects an API profile to use when communicating with Azure services. Default value of Default: “latest” |
|
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. Choices:
|
|
Controls the source of the credentials to use for authentication. Can also be set via the When set to When set to When set to When set to When set to The Choices:
|
|
Authentication certificates of the application gateway resource. |
|
Certificate public data - base64 encoded pfx. |
|
Name of the resource that is unique within a resource group. This name can be used to access the resource. |
|
List of backend address pool of the application gateway resource. |
|
List of backend addresses. |
|
Fully qualified domain name (FQDN). |
|
IP address. |
|
Resource that is unique within a resource group. This name can be used to access the resource. |
|
Backend http settings of the application gateway resource. |
|
Cookie name to use for the affinity cookie. |
|
List of references to application gateway authentication certificates. Applicable only when |
|
Resource ID. |
|
Cookie based affinity. Choices:
|
|
Host header to be sent to the backend servers. |
|
Name of the resource that is unique within a resource group. This name can be used to access the resource. |
|
Path which should be used as a prefix for all Null means no path will be prefixed. Default value is null. |
|
Whether host header should be picked from the host name of the backend server. Default value is false. |
|
The destination port on the backend. |
|
Probe resource of an application gateway. |
|
The protocol used to communicate with the backend. Choices:
|
|
Request timeout in seconds. Application Gateway will fail the request if response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 seconds. |
|
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 Choices:
|
|
Azure client ID. Use when authenticating with a Service Principal. |
|
For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, Default: “AzureCloud” |
|
Frontend IP addresses of the application gateway resource. |
|
Name of the resource that is unique within a resource group. This name can be used to access the resource. |
|
PrivateIPAddress of the network interface IP Configuration. |
|
PrivateIP allocation method. Choices:
|
|
Reference of the PublicIP resource. |
|
Reference of the subnet resource. |
|
Full ID of the subnet resource. Required if name and virtual_network_name are not provided. |
|
Name of the subnet. Only used if virtual_network_name is also provided. |
|
Name of the virtual network. Only used if name is also provided. |
|
List of frontend ports of the application gateway resource. |
|
Name of the resource that is unique within a resource group. This name can be used to access the resource. |
|
Frontend port. |
|
List of subnets used by the application gateway. |
|
Name of the resource that is unique within a resource group. This name can be used to access the resource. |
|
Reference of the subnet resource. A subnet from where application gateway gets its private address. |
|
Full ID of the subnet resource. Required if name and virtual_network_name are not provided. |
|
Name of the subnet. Only used if virtual_network_name is also provided. |
|
Name of the virtual network. Only used if name is also provided. |
|
List of HTTP listeners of the application gateway resource. |
|
Frontend IP configuration resource of an application gateway. |
|
Frontend port resource of an application gateway. |
|
Host name of |
|
Name of the resource that is unique within a resource group. This name can be used to access the resource. |
|
Protocol of the Choices:
|
|
Applicable only if protocol is |
|
SSL certificate resource of an application gateway. |
|
Resource location. If not set, location from the resource group will be used as default. |
|
Parent argument. |
|
Parent argument. |
|
The name of the application gateway. |
|
Active Directory user password. Use when authenticating with an Active Directory user rather than service principal. |
|
Probes available to the application gateway resource. |
|
Host name to send the probe to. |
|
The probing interval in seconds. This is the time interval between two consecutive probes. Acceptable values are from 1 second to 86400 seconds. |
|
Name of the probe that is unique within an Application Gateway. |
|
Relative path of probe. Valid path starts from ‘/’. Probe is sent to <Protocol>://<host>:<port><path>. |
|
Whether host header should be picked from the host name of the backend HTTP settings. Default value is false. Choices:
|
|
The protocol used for the probe. Choices:
|
|
The probe timeout in seconds. Probe marked as failed if valid response is not received with this timeout period. Acceptable values are from 1 second to 86400 seconds. |
|
The probe retry count. Backend server is marked down after consecutive probe failure count reaches UnhealthyThreshold. Acceptable values are from 1 second to 20. |
|
Security profile found in ~/.azure/credentials file. |
|
Redirect configurations of the application gateway resource. |
|
Include path in the redirected url. |
|
Include query string in the redirected url. |
|
Name of the resource that is unique within a resource group. |
|
Redirection type. Choices:
|
|
Reference to a listener to redirect the request to. |
|
List of request routing rules of the application gateway resource. |
|
Backend address pool resource of the application gateway. Not used if rule_type is |
|
Backend |
|
Http listener resource of the application gateway. |
|
Name of the resource that is unique within a resource group. This name can be used to access the resource. |
|
Redirect configuration resource of the application gateway. |
|
Rule type. Choices:
|
|
URL path map resource of the application gateway. Required if rule_type is |
|
The name of the resource group. |
|
Azure client secret. Use when authenticating with a Service Principal. |
|
SKU of the application gateway resource. |
|
Capacity (instance count) of an application gateway. |
|
Name of an application gateway SKU. Choices:
|
|
Tier of an application gateway. Choices:
|
|
SSL certificates of the application gateway resource. |
|
Base-64 encoded pfx certificate. Only applicable in PUT Request. |
|
Name of the resource that is unique within a resource group. This name can be used to access the resource. |
|
Password for the pfx file specified in data. Only applicable in PUT request. |
|
SSL policy of the application gateway resource. |
|
List of SSL cipher suites to be enabled in the specified order to application gateway. Choices:
|
|
List of SSL protocols to be disabled on application gateway. Choices:
|
|
Minimum version of Ssl protocol to be supported on application gateway. Choices:
|
|
Name of Ssl Choices:
|
|
Type of SSL Policy. Choices:
|
|
Assert the state of the Public IP. Use Choices:
|
|
Your Azure subscription Id. |
|
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 Azure Automation and Azure CDN only support 15 tags on resources. |
|
Azure tenant ID. Use when authenticating with a Service Principal. |
|
List of URL path maps of the application gateway resource. |
|
Backend address pool resource of the application gateway which will be used if no path matches occur. |
|
Backend http settings resource of the application gateway; used for the default_backend_address_pool. |
|
Name of the resource that is unique within the application gateway. This name can be used to access the resource. |
|
List of URL path rules. |
|
Backend address pool resource of the application gateway which will be used if the path is matched. |
|
Backend http settings resource of the application gateway; used for the path’s backend_address_pool. |
|
Name of the resource that is unique within the path map. |
|
List of paths. |
Notes
Note
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
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.
See Also
See also
- Sign in with Azure CLI
How to authenticate using the
az login
command.
Examples
- name: Create instance of Application Gateway
azure_rm_appgateway:
resource_group: myResourceGroup
name: myAppGateway
sku:
name: standard_small
tier: standard
capacity: 2
gateway_ip_configurations:
- subnet:
id: "{{ subnet_id }}"
name: app_gateway_ip_config
frontend_ip_configurations:
- subnet:
id: "{{ subnet_id }}"
name: sample_gateway_frontend_ip_config
frontend_ports:
- port: 90
name: ag_frontend_port
backend_address_pools:
- backend_addresses:
- ip_address: 10.0.0.4
name: test_backend_address_pool
backend_http_settings_collection:
- port: 80
protocol: http
cookie_based_affinity: enabled
name: sample_appgateway_http_settings
http_listeners:
- frontend_ip_configuration: sample_gateway_frontend_ip_config
frontend_port: ag_frontend_port
name: sample_http_listener
request_routing_rules:
- rule_type: Basic
backend_address_pool: test_backend_address_pool
backend_http_settings: sample_appgateway_http_settings
http_listener: sample_http_listener
name: rule1
- name: Create instance of Application Gateway by looking up virtual network and subnet
azure_rm_appgateway:
resource_group: myResourceGroup
name: myAppGateway
sku:
name: standard_small
tier: standard
capacity: 2
gateway_ip_configurations:
- subnet:
name: default
virtual_network_name: my-vnet
name: app_gateway_ip_config
frontend_ip_configurations:
- subnet:
name: default
virtual_network_name: my-vnet
name: sample_gateway_frontend_ip_config
frontend_ports:
- port: 90
name: ag_frontend_port
backend_address_pools:
- backend_addresses:
- ip_address: 10.0.0.4
name: test_backend_address_pool
backend_http_settings_collection:
- port: 80
protocol: http
cookie_based_affinity: enabled
name: sample_appgateway_http_settings
http_listeners:
- frontend_ip_configuration: sample_gateway_frontend_ip_config
frontend_port: ag_frontend_port
name: sample_http_listener
request_routing_rules:
- rule_type: Basic
backend_address_pool: test_backend_address_pool
backend_http_settings: sample_appgateway_http_settings
http_listener: sample_http_listener
name: rule1
- name: Create instance of Application Gateway with path based rules
azure_rm_appgateway:
resource_group: myResourceGroup
name: myAppGateway
sku:
name: standard_small
tier: standard
capacity: 2
gateway_ip_configurations:
- subnet:
id: "{{ subnet_id }}"
name: app_gateway_ip_config
frontend_ip_configurations:
- subnet:
id: "{{ subnet_id }}"
name: sample_gateway_frontend_ip_config
frontend_ports:
- port: 90
name: ag_frontend_port
backend_address_pools:
- backend_addresses:
- ip_address: 10.0.0.4
name: test_backend_address_pool
backend_http_settings_collection:
- port: 80
protocol: http
cookie_based_affinity: enabled
name: sample_appgateway_http_settings
http_listeners:
- frontend_ip_configuration: sample_gateway_frontend_ip_config
frontend_port: ag_frontend_port
name: sample_http_listener
request_routing_rules:
- rule_type: path_based_routing
http_listener: sample_http_listener
name: rule1
url_path_map: path_mappings
url_path_maps:
- name: path_mappings
default_backend_address_pool: test_backend_address_pool
default_backend_http_settings: sample_appgateway_http_settings
path_rules:
- name: path_rules
backend_address_pool: test_backend_address_pool
backend_http_settings: sample_appgateway_http_settings
paths:
- "/abc"
- "/123/*"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Resource ID. Returned: always Sample: “id” |
Authors
Zim Kalinowski (@zikalino)