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
This commit is contained in:
Mohammed Naser 2018-06-18 17:36:22 -04:00
parent 4997f9bee0
commit fbb58ddfde
2 changed files with 8 additions and 0 deletions

View File

@ -45,6 +45,8 @@
block:
- name: Verify if the bridge address is set
shell: ip addr show dev {{ bridge_name }} | grep -q {{ bridge_address_prefix }}.{{ offset }}/{{ bridge_address_subnet }}
environment:
PATH: '{{ ansible_env.PATH }}:/bin:/sbin:/usr/sbin'
register: ip_addr_var
failed_when: False
changed_when: False
@ -52,6 +54,8 @@
- name: Set the bridge address
become: yes
command: ip addr add {{ bridge_address_prefix }}.{{ offset }}/{{ bridge_address_subnet }} dev {{ bridge_name }}
environment:
PATH: '{{ ansible_env.PATH }}:/bin:/sbin:/usr/sbin'
when: ip_addr_var.rc == 1
- name: Bring subnode bridge interface up

View File

@ -11,6 +11,8 @@
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
@ -18,6 +20,8 @@
- 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