2017-07-12 08:40:26 +02:00
|
|
|
---
|
2017-12-13 20:30:24 +01:00
|
|
|
- debug: msg="START cli/basic.yaml on connection={{ ansible_connection }}"
|
|
|
|
|
2017-07-12 08:40:26 +02:00
|
|
|
- name: Remove IP address
|
|
|
|
vyos_l3_interface:
|
|
|
|
name: eth1
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
- name: Remove IP address
|
|
|
|
vyos_l3_interface:
|
|
|
|
name: eth2
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
- name: Set IPv4 address
|
|
|
|
vyos_l3_interface:
|
|
|
|
name: eth1
|
|
|
|
ipv4: 192.168.2.10/24
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == true'
|
|
|
|
- '"set interfaces ethernet eth1 address 192.168.2.10/24" in result.commands'
|
|
|
|
|
|
|
|
- name: Set IPv4 address (idempotent)
|
|
|
|
vyos_l3_interface:
|
|
|
|
name: eth1
|
|
|
|
ipv4: 192.168.2.10/24
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == false'
|
|
|
|
|
|
|
|
- name: Set IPv6 address
|
|
|
|
vyos_l3_interface:
|
|
|
|
name: eth1
|
|
|
|
ipv6: fd5d:12c9:2201:1::1/64
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == true'
|
|
|
|
- '"set interfaces ethernet eth1 address fd5d:12c9:2201:1::1/64" in result.commands'
|
|
|
|
|
|
|
|
- name: Set IPv6 address (idempotent)
|
|
|
|
vyos_l3_interface:
|
|
|
|
name: eth1
|
|
|
|
ipv6: fd5d:12c9:2201:1::1/64
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == false'
|
|
|
|
|
|
|
|
- name: Remove all IP addresses
|
|
|
|
vyos_l3_interface:
|
|
|
|
name: eth1
|
|
|
|
state: absent
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == true'
|
|
|
|
- '"delete interfaces ethernet eth1 address" in result.commands'
|
|
|
|
|
|
|
|
- name: Remove all IP addresses again (idempotent)
|
|
|
|
vyos_l3_interface:
|
|
|
|
name: eth1
|
|
|
|
state: absent
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == false'
|
|
|
|
|
|
|
|
- name: Set IPv4 and IPv6 address
|
|
|
|
vyos_l3_interface:
|
|
|
|
name: eth1
|
|
|
|
ipv4: 192.168.2.10/24
|
|
|
|
ipv6: fd5d:12c9:2201:1::1/64
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == true'
|
|
|
|
- '"set interfaces ethernet eth1 address 192.168.2.10/24" in result.commands'
|
|
|
|
- '"set interfaces ethernet eth1 address fd5d:12c9:2201:1::1/64" in result.commands'
|
|
|
|
|
|
|
|
- name: Set IPv4 and IPv6 address again (idempotent)
|
|
|
|
vyos_l3_interface:
|
|
|
|
name: eth1
|
|
|
|
ipv4: 192.168.2.10/24
|
|
|
|
ipv6: fd5d:12c9:2201:1::1/64
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == false'
|
|
|
|
|
|
|
|
- name: Remove IPv4 address
|
|
|
|
vyos_l3_interface:
|
|
|
|
name: eth1
|
|
|
|
ipv4: 192.168.2.10/24
|
|
|
|
state: absent
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == true'
|
|
|
|
- '"delete interfaces ethernet eth1 address 192.168.2.10/24" in result.commands'
|
|
|
|
|
|
|
|
- name: Remove IPv4 address again (idempotent)
|
|
|
|
vyos_l3_interface:
|
|
|
|
name: eth1
|
|
|
|
ipv4: 192.168.2.10/24
|
|
|
|
state: absent
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == false'
|
|
|
|
|
|
|
|
- name: Remove IPv6 address
|
|
|
|
vyos_l3_interface:
|
|
|
|
name: eth1
|
|
|
|
ipv6: fd5d:12c9:2201:1::1/64
|
|
|
|
state: absent
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == true'
|
|
|
|
- '"delete interfaces ethernet eth1 address fd5d:12c9:2201:1::1/64" in result.commands'
|
|
|
|
|
|
|
|
- name: Remove IPv6 address again (idempotent)
|
|
|
|
vyos_l3_interface:
|
|
|
|
name: eth1
|
|
|
|
ipv6: fd5d:12c9:2201:1::1/64
|
|
|
|
state: absent
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == false'
|
|
|
|
|
|
|
|
- name: Set IP addresses on aggregate
|
|
|
|
vyos_l3_interface:
|
|
|
|
aggregate:
|
2019-12-03 15:34:35 +01:00
|
|
|
- {name: eth1, ipv4: 192.168.2.10/24}
|
|
|
|
- {name: eth2, ipv4: 192.168.3.10/24, ipv6: "fd5d:12c9:2201:1::1/64"}
|
|
|
|
- {name: eth2, ipv4: 192.168.4.10/24}
|
2017-07-12 08:40:26 +02:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == true'
|
|
|
|
- '"set interfaces ethernet eth1 address 192.168.2.10/24" in result.commands'
|
|
|
|
- '"set interfaces ethernet eth2 address 192.168.3.10/24" in result.commands'
|
|
|
|
- '"set interfaces ethernet eth2 address fd5d:12c9:2201:1::1/64" in result.commands'
|
2018-02-20 16:24:27 +01:00
|
|
|
- '"set interfaces ethernet eth2 address 192.168.4.10/24" in result.commands'
|
2017-07-12 08:40:26 +02:00
|
|
|
|
|
|
|
- name: Set IP addresses on aggregate (idempotent)
|
|
|
|
vyos_l3_interface:
|
|
|
|
aggregate:
|
2019-12-03 15:34:35 +01:00
|
|
|
- {name: eth1, ipv4: 192.168.2.10/24}
|
|
|
|
- {name: eth2, ipv4: 192.168.3.10/24, ipv6: "fd5d:12c9:2201:1::1/64"}
|
|
|
|
- {name: eth2, ipv4: 192.168.4.10/24}
|
2017-07-12 08:40:26 +02:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == false'
|
|
|
|
|
|
|
|
- name: Remove IP addresses on aggregate
|
|
|
|
vyos_l3_interface:
|
|
|
|
aggregate:
|
2019-12-03 15:34:35 +01:00
|
|
|
- {name: eth1, ipv4: 192.168.2.10/24}
|
|
|
|
- {name: eth2, ipv4: 192.168.3.10/24, ipv6: "fd5d:12c9:2201:1::1/64"}
|
|
|
|
- {name: eth2, ipv4: 192.168.4.10/24}
|
2017-07-12 08:40:26 +02:00
|
|
|
state: absent
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == true'
|
|
|
|
- '"delete interfaces ethernet eth1 address 192.168.2.10/24" in result.commands'
|
|
|
|
- '"delete interfaces ethernet eth2 address 192.168.3.10/24" in result.commands'
|
|
|
|
- '"delete interfaces ethernet eth2 address fd5d:12c9:2201:1::1/64" in result.commands'
|
2018-02-20 16:24:27 +01:00
|
|
|
- '"delete interfaces ethernet eth2 address 192.168.4.10/24" in result.commands'
|
2017-07-12 08:40:26 +02:00
|
|
|
|
|
|
|
- name: Remove IP addresses on aggregate (idempotent)
|
|
|
|
vyos_l3_interface:
|
|
|
|
aggregate:
|
2019-12-03 15:34:35 +01:00
|
|
|
- {name: eth1, ipv4: 192.168.2.10/24}
|
|
|
|
- {name: eth2, ipv4: 192.168.3.10/24, ipv6: "fd5d:12c9:2201:1::1/64"}
|
|
|
|
- {name: eth2, ipv4: 192.168.4.10/24}
|
2017-07-12 08:40:26 +02:00
|
|
|
state: absent
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- 'result.changed == false'
|