58a8d1a119
This adds names to blocks and includes for consistency. We've done this before (e.g. Ia7e490aaba99da9694a6f3fdb1bca9838221b30a) but I guess 6.12.0 is finding more... Change-Id: Ib451f6d3c5a18047873e63aa0a1aa2b425846fec
57 lines
1.7 KiB
YAML
57 lines
1.7 KiB
YAML
- name: Test the multi-node-bridge role
|
|
hosts:
|
|
- switch
|
|
- peers
|
|
roles:
|
|
- multi-node-bridge
|
|
post_tasks:
|
|
- name: Check openvswitch
|
|
become: yes
|
|
block:
|
|
- name: openvswitch should be installed
|
|
package:
|
|
name: "{{ ovs_package }}"
|
|
state: present
|
|
register: ovs_installed
|
|
|
|
- name: openvswitch should be running
|
|
service:
|
|
name: "{{ ovs_service }}"
|
|
state: started
|
|
enabled: yes
|
|
register: ovs_running
|
|
|
|
- name: bridge should exist
|
|
openvswitch_bridge:
|
|
bridge: "{{ bridge_name }}"
|
|
register: ovs_bridge
|
|
|
|
- name: port should exist
|
|
command: ovs-vsctl show
|
|
changed_when: false
|
|
register: ovs_port
|
|
|
|
- name: switch should be reachable
|
|
command: ping -c 4 {{ bridge_address_prefix }}.{{ bridge_address_offset }}
|
|
changed_when: false
|
|
failed_when: false
|
|
register: ovs_ping_switch
|
|
|
|
- name: peer should be reachable
|
|
command: ping -c 4 {{ bridge_address_prefix }}.{{ bridge_address_offset + 1 }}
|
|
changed_when: false
|
|
failed_when: false
|
|
register: ovs_ping_peer
|
|
|
|
- name: assert test results
|
|
assert:
|
|
that:
|
|
- ovs_installed is not changed
|
|
- ovs_running is not changed
|
|
- ovs_bridge is not changed
|
|
- ovs_port.rc == 0
|
|
# Ubuntu focal era changed the quotes
|
|
- "('Port \"br-infra_' in ovs_port.stdout) or ('Port br-infra_' in ovs_port.stdout)"
|
|
- ovs_ping_switch.rc == 0
|
|
- ovs_ping_peer.rc == 0
|