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

azure_rm_loadbalancecer - Add support enable_tcp_reset to load_balancing_rules #1774

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions plugins/modules/azure_rm_loadbalancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@
description:
- Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group.
type: bool
enable_tcp_reset:
description:
- Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination.
- This element is only used when the protocol is set to TCP.
type: bool
disable_outbound_snat:
description:
- Configure outbound source network address translation (SNAT).
Expand Down Expand Up @@ -560,6 +565,9 @@
type='bool',
default=False
),
enable_tcp_reset=dict(
type='bool'
)
)


Expand Down Expand Up @@ -745,6 +753,7 @@ def exec_module(self, **kwargs):
backend_port=item.get('backend_port'),
idle_timeout_in_minutes=item.get('idle_timeout'),
enable_floating_ip=item.get('enable_floating_ip'),
enable_tcp_reset=item.get('enable_tcp_reset'),
disable_outbound_snat=item.get('disable_outbound_snat'),
) for item in self.load_balancing_rules] if self.load_balancing_rules else None

Expand Down
15 changes: 15 additions & 0 deletions tests/integration/targets/azure_rm_loadbalancer/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
idle_timeout: 4
load_distribution: Default
protocol: Tcp
enable_tcp_reset: true
register: output

- name: Assert complex load balancer created
Expand Down Expand Up @@ -165,6 +166,7 @@
idle_timeout: 4
load_distribution: Default
protocol: Tcp
enable_tcp_reset: true
register: output

- name: Assert that output has not changed
Expand Down Expand Up @@ -205,13 +207,26 @@
idle_timeout: 4
load_distribution: Default
protocol: Tcp
enable_tcp_reset: false
register: output

- name: Assert that output has changed
ansible.builtin.assert:
that:
- output.changed

- name: Get the load balancer facts
azure_rm_loadbalancer_info:
resource_group: '{{ resource_group }}'
name: "{{ lbname_b }}"
register: output

- name: Assert the load balancer facts
ansible.builtin.assert:
that:
- output.loadbalancers[0].load_balancing_rules[0].enable_tcp_reset is false
- output.loadbalancers[0].load_balancing_rules[0].frontend_port == 81

- name: Delete load balancer
azure_rm_loadbalancer:
resource_group: '{{ resource_group }}'
Expand Down