Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow application gateway probe to use host header from HTTP settings #450

Merged
merged 22 commits into from
Aug 10, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
36040ed
allow probe to use host header from http settings
l3ender Mar 11, 2021
b7e2ef6
Merge branch 'dev' into probe-hostname
l3ender Mar 11, 2021
3d1f83a
correct documentation verbiage
l3ender Mar 11, 2021
e36068d
add test coverage
l3ender Mar 11, 2021
f32e7db
Merge branch 'dev' into probe-hostname
l3ender Mar 15, 2021
0eb9e35
Merge branch 'dev' into probe-hostname
Fred-sun Mar 23, 2021
ed627d4
Merge branch 'dev' into probe-hostname
l3ender Apr 1, 2021
2249afa
Merge remote-tracking branch 'origin/dev' into probe-hostname
l3ender May 22, 2021
4eb6d6c
correct probe idempotency, add test coverage
l3ender May 22, 2021
43909e8
Merge branch 'dev' into probe-hostname
l3ender May 28, 2021
dcbd6f6
Merge branch 'dev' into probe-hostname
l3ender Jun 21, 2021
4249bc0
corrrect usage of using backend hostname in probe
l3ender Jun 23, 2021
bf4c7b4
Add default value for pick_host_name_from_backend_http_settings
Fred-sun Jun 24, 2021
02af1b2
correct assert verbiage
l3ender Jun 24, 2021
604e82c
Merge remote-tracking branch 'refs/remotes/origin/probe-hostname' int…
l3ender Jun 24, 2021
e17a446
Merge remote-tracking branch 'origin/dev' into probe-hostname
l3ender Jun 24, 2021
1f23793
Merge branch 'dev' into probe-hostname
l3ender Jul 3, 2021
0aff52b
Merge branch 'dev' into probe-hostname
l3ender Jul 16, 2021
47094a6
Merge remote-tracking branch 'origin/dev' into probe-hostname
l3ender Jul 31, 2021
76aa8e2
Merge remote-tracking branch 'origin/dev' into probe-hostname
l3ender Aug 3, 2021
fdc15ca
Merge branch 'dev' into probe-hostname
l3ender Aug 6, 2021
37a50f3
Merge branch 'dev' into probe-hostname
xuzhang3 Aug 10, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions plugins/modules/azure_rm_appgateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@
- The I(probe) retry count.
- Backend server is marked down after consecutive probe failure count reaches UnhealthyThreshold.
- Acceptable values are from 1 second to 20.
pick_host_name_from_backend_http_settings:
description:
- Whether host header should be picked from the host name of the backend HTTP settings. Default value is false.
backend_http_settings_collection:
description:
- Backend http settings of the application gateway resource.
Expand Down Expand Up @@ -301,7 +304,7 @@
- Host header to be sent to the backend servers.
pick_host_name_from_backend_address:
description:
- Whether to pick host header should be picked from the host name of the backend server. Default value is false.
- Whether host header should be picked from the host name of the backend server. Default value is false.
affinity_cookie_name:
description:
- Cookie name to use for the affinity cookie.
Expand Down Expand Up @@ -471,7 +474,8 @@ class Actions:
path=dict(type='str'),
protocol=dict(type='str', choices=['http', 'https']),
timeout=dict(type='int'),
unhealthy_threshold=dict(type='int')
unhealthy_threshold=dict(type='int'),
pick_host_name_from_backend_http_settings=dict(type='bool')
)


Expand Down
85 changes: 85 additions & 0 deletions tests/integration/targets/azure_rm_appgateway/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,91 @@
that:
- output.changed

- name: Create instance of Application Gateway with probe using hostname from backend http settings
azure_rm_appgateway:
resource_group: "{{ resource_group }}"
name: "appgateway{{ rpfx }}"
sku:
name: standard_small
tier: standard
capacity: 2
ssl_policy:
policy_type: predefined
policy_name: ssl_policy20150501
disabled_ssl_protocols:
- tls_v1_0
cipher_suites:
- tls_ecdhe_ecdsa_with_aes_256_gcm_sha384
authentication_certificates:
- name: cert1
data: "{{ lookup('file', 'cert1.txt') }}"
ssl_certificates:
- name: cert2
password: your-password
data: "{{ lookup('file', 'cert2.txt') }}"
gateway_ip_configurations:
- subnet:
id: "{{ subnet_output.state.id }}"
name: app_gateway_ip_config
frontend_ip_configurations:
- subnet:
id: "{{ subnet_output.state.id }}"
name: sample_gateway_frontend_ip_config
frontend_ports:
- port: 90
name: ag_frontend_port
- port: 80
name: http_frontend_port
backend_address_pools:
- backend_addresses:
- ip_address: 10.0.0.4
name: test_backend_address_pool
probes:
- name: custom_probe
protocol: http
path: /healthz
interval: 30
timeout: 30
unhealthy_threshold: 3
pick_host_name_from_backend_http_settings: true
l3ender marked this conversation as resolved.
Show resolved Hide resolved
backend_http_settings_collection:
- port: 80
protocol: http
cookie_based_affinity: enabled
probe: custom_probe
name: sample_appgateway_http_settings
http_listeners:
- frontend_ip_configuration: sample_gateway_frontend_ip_config
frontend_port: ag_frontend_port
protocol: https
ssl_certificate: cert2
name: sample_http_listener
- frontend_ip_configuration: sample_gateway_frontend_ip_config
frontend_port: http_frontend_port
protocol: http
name: 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
- rule_type: Basic
http_listener: http_listener
redirect_configuration: redirect_site_to_https
name: http_redirect_rule
redirect_configurations:
- redirect_type: permanent
target_listener: sample_http_listener
include_path: true
include_query_string: true
name: redirect_site_to_https
register: output
- name: Assert the resource instance is well created
assert:
that:
- output.changed

- name: Try to update instance of Application Gateway - no change
l3ender marked this conversation as resolved.
Show resolved Hide resolved
azure_rm_appgateway:
resource_group: "{{ resource_group }}"
Expand Down