mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-08 22:30:04 -07:00
Fixed win_route module (#46395)
* Changed $IpAddress to $Gateway * Tweaked win_route unit tests Checks to see if new static route has the correct gateway * Create win_route.yaml * Fixed incorrect variable name
This commit is contained in:
parent
a74449b05f
commit
b72187cd2c
3 changed files with 10 additions and 3 deletions
|
@ -7,15 +7,20 @@
|
|||
state: present
|
||||
register: route
|
||||
|
||||
- name: check if route successfully addedd
|
||||
- name: check if route successfully added
|
||||
win_shell: (Get-CimInstance win32_ip4PersistedrouteTable -Filter "Destination = '{{ destination_ip_address }}'").Caption
|
||||
register: route_added
|
||||
|
||||
- name: test if route successfully addedd
|
||||
- name: check route default gateway
|
||||
win_shell: (Get-CimInstance win32_ip4PersistedrouteTable -Filter "Destination = '{{ destination_ip_address }}'").NextHop
|
||||
register: route_gateway
|
||||
|
||||
- name: test if route successfully added
|
||||
assert:
|
||||
that:
|
||||
- route is changed
|
||||
- route_added.stdout_lines[0] == "{{ destination_ip_address }}"
|
||||
- route_gateway.stdout_lines[0] == "{{ default_gateway }}"
|
||||
|
||||
- name: add a static route to test idempotency
|
||||
win_route:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue