zuul-jobs/roles/multi-node-bridge/tasks/switch.yaml
Mohammed Naser fbb58ddfde Add PATH to ip command execution
It seems that there has been a recent change where the PATH used
has changed somehow.  This adds it and make sure that it covers
all 3 major distros location where `ip` is stored.

Change-Id: Ic3c255bd24d1202fec436d4fcc484ce420110518
2018-06-18 17:37:10 -04:00

30 lines
995 B
YAML

- name: Ensure the bridge exists
become: yes
openvswitch_bridge:
bridge: "{{ bridge_name }}"
- name: Set the bridge MTU
become: yes
command: ip link set mtu {{ bridge_mtu }} dev {{ bridge_name }}
- when: bridge_configure_address
block:
- name: Verify if the bridge address is set
shell: ip addr show dev {{ bridge_name }} | grep -q {{ bridge_address_prefix }}.{{ bridge_address_offset }}/{{ bridge_address_subnet }}
environment:
PATH: '{{ ansible_env.PATH }}:/bin:/sbin:/usr/sbin'
register: ip_addr_var
failed_when: False
changed_when: False
- name: Set the bridge address
become: yes
command: ip addr add {{ bridge_address_prefix }}.{{ bridge_address_offset }}/{{ bridge_address_subnet }} dev {{ bridge_name }}
environment:
PATH: '{{ ansible_env.PATH }}:/bin:/sbin:/usr/sbin'
when: ip_addr_var.rc == 1
- name: Bring bridge interface up
become: yes
command: ip link set dev {{ bridge_name }} up