zuul-jobs/roles/multi-node-bridge/tasks/main.yaml
David Moreau-Simard e375ddc738
Append /sbin and /usr/sbin to $PATH for 'ip' commands
While the 'iproute' package is installed on our CentOS images, it
was found that '/sbin/ip' was not in PATH and thus resulting in a
command not found error.
This is because 'become: yes' may not include '/sbin' and '/usr/sbin'
paths [1].

This can also occur on other distributions so let's include this all
the time.

[1]: http://git.openstack.org/cgit/openstack/diskimage-builder/tree/diskimage_builder/lib/common-defaults?id=22e03f98209be206a1e9e60f0b9cd9381317096e#n46

Change-Id: Ia7480dab0f357b5710d1962a40499381837942b3
2017-09-26 15:32:07 -04:00

17 lines
471 B
YAML

- include: common.yaml
# Note (dmsimard)
# We explicitely declare a PATH environment variable because '/sbin' is not in
# PATH when using 'become: yes' on some distributions
- include: switch.yaml
environment:
PATH: "{{ ansible_env.PATH }}:/sbin:/usr/sbin"
when: inventory_hostname in groups['switch']
static: no
- include: peer.yaml
environment:
PATH: "{{ ansible_env.PATH }}:/sbin:/usr/sbin"
when: inventory_hostname in groups['peers']
static: no