mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-28 20:09:08 -07:00
Search all assigned ipv6 addresses instead of just the first (#40533)
* Search all assigned ipv6 addresses instead of just the first * Add test for idempotency with multiple ipv6 addresses assigned
This commit is contained in:
parent
ed7d6d9c19
commit
e8d02a3a0f
2 changed files with 40 additions and 15 deletions
|
@ -41,7 +41,7 @@
|
|||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
- assert: &unchanged
|
||||
that:
|
||||
- 'result.changed == false'
|
||||
|
||||
|
@ -74,7 +74,7 @@
|
|||
- '"ip address dhcp" in result.commands'
|
||||
|
||||
- name: Configure interface ipv6 address
|
||||
ios_l3_interface:
|
||||
ios_l3_interface: &ipv6-1
|
||||
name: "{{ test_interface }}"
|
||||
ipv6: fd5d:12c9:2201:1::1/64
|
||||
state: present
|
||||
|
@ -88,16 +88,36 @@
|
|||
- '"ipv6 address fd5d:12c9:2201:1::1/64" in result.commands'
|
||||
|
||||
- name: Configure interface ipv6 address (idempotent)
|
||||
ios_l3_interface:
|
||||
ios_l3_interface: *ipv6-1
|
||||
register: result
|
||||
|
||||
- assert: *unchanged
|
||||
|
||||
- name: Configure second ipv6 address on interface
|
||||
ios_l3_interface: &ipv6-2
|
||||
name: "{{ test_interface }}"
|
||||
ipv6: fd5d:12c9:2201:1::1/64
|
||||
ipv6: fd5d:12c9:2291:1::1/64
|
||||
state: present
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- 'result.changed == false'
|
||||
- 'result.changed == true'
|
||||
- '"interface {{ test_interface }}" in result.commands'
|
||||
- '"ipv6 address fd5d:12c9:2291:1::1/64" in result.commands'
|
||||
|
||||
- name: Ensure first ipv6 address still associated with interface
|
||||
ios_l3_interface: *ipv6-1
|
||||
register: result
|
||||
|
||||
- assert: *unchanged
|
||||
|
||||
- name: Ensure second ipv6 address still associated with interface
|
||||
ios_l3_interface: *ipv6-2
|
||||
register: result
|
||||
|
||||
- assert: *unchanged
|
||||
|
||||
- name: Assign same ipv6 address to other interface (fail)
|
||||
ios_l3_interface:
|
||||
|
@ -181,9 +201,7 @@
|
|||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- 'result.changed == false'
|
||||
- assert: *unchanged
|
||||
|
||||
- name: Change ipv4 and ipv6 address using aggregate
|
||||
ios_l3_interface:
|
||||
|
@ -232,8 +250,6 @@
|
|||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- 'result.changed == false'
|
||||
- assert: *unchanged
|
||||
|
||||
- debug: msg="END ios_l3_interface cli/basic.yaml on connection={{ ansible_connection }}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue