Use operating system specific IP utilities

Operating systems seem to have decided to put network utilities
in different places, therefore our network bootstrap code was
not working on CentOS because it was not located in the same
place as Ubuntu.

This fixes it which should bring up the interfaces as needed.

Change-Id: I6bf403b4c7d13e6a084ba29fad37b89893321369
This commit is contained in:
Mohammed Naser 2018-08-17 15:15:16 -04:00
parent 2d96bff9ae
commit 829b7940bb
2 changed files with 38 additions and 19 deletions

View File

@ -118,6 +118,25 @@ netmask: "255.255.252.0"
#
# NICs
bootstrap_host_public_interface: "{{ ansible_default_ipv4.interface }}"
#
# Utility paths
bootstrap_host_network_utils:
apt:
iptables: /sbin/iptables
ethtool: /sbin/ethtool
ip: /sbin/ip
yum:
iptables: /usr/sbin/iptables
ethtool: /usr/sbin/ethtool
ip: /usr/sbin/ip
zypper:
iptables: /usr/sbin/iptables
ethtool: /sbin/ethtool
ip: /sbin/ip
#
bootstrap_host_iptables_path: "{{ bootstrap_host_network_utils[ansible_pkg_mgr]['iptables'] }}"
bootstrap_host_ethtool_path: "{{ bootstrap_host_network_utils[ansible_pkg_mgr]['ethtool'] }}"
bootstrap_host_ip_path: "{{ bootstrap_host_network_utils[ansible_pkg_mgr]['ip'] }}"
## Extra storage
# An AIO may optionally be built using a second storage device. If a

View File

@ -213,26 +213,26 @@
RemainAfterExit: yes
service_type: oneshot
execstarts:
- "-/sbin/iptables -t nat -A POSTROUTING -o {{ bootstrap_host_public_interface }} -j MASQUERADE"
- "-/sbin/ethtool -K bond0 gso off sg off tso off tx off"
- "-/sbin/ethtool -K bond1 gso off sg off tso off tx off"
- "-/sbin/ethtool -K br-mgmt gso off sg off tso off tx off"
- "-/sbin/ethtool -K br-vxlan gso off sg off tso off tx off"
- "-/sbin/ethtool -K br-storage gso off sg off tso off tx off"
- "-/sbin/ethtool -K br-vlan gso off sg off tso off tx off"
- "-/sbin/ethtool -K br-dbaas gso off sg off tso off tx off"
- "-/sbin/ethtool -K br-lbaas gso off sg off tso off tx off"
- "-/bin/ip link set eth12 up"
- "-/bin/ip link set br-vlan-veth up"
- "-/sbin/ethtool -K eth12 gso off sg off tso off tx off"
- "-/bin/ip link set eth13 up"
- "-/bin/ip link set br-dbaas-veth up"
- "-/sbin/ethtool -K eth13 gso off sg off tso off tx off"
- "-/bin/ip link set eth14 up"
- "-/bin/ip link set br-lbaas-veth up"
- "-/sbin/ethtool -K eth14 gso off sg off tso off tx off"
- "-{{ bootstrap_host_iptables_path }} -t nat -A POSTROUTING -o {{ bootstrap_host_public_interface }} -j MASQUERADE"
- "-{{ bootstrap_host_ethtool_path }} -K bond0 gso off sg off tso off tx off"
- "-{{ bootstrap_host_ethtool_path }} -K bond1 gso off sg off tso off tx off"
- "-{{ bootstrap_host_ethtool_path }} -K br-mgmt gso off sg off tso off tx off"
- "-{{ bootstrap_host_ethtool_path }} -K br-vxlan gso off sg off tso off tx off"
- "-{{ bootstrap_host_ethtool_path }} -K br-storage gso off sg off tso off tx off"
- "-{{ bootstrap_host_ethtool_path }} -K br-vlan gso off sg off tso off tx off"
- "-{{ bootstrap_host_ethtool_path }} -K br-dbaas gso off sg off tso off tx off"
- "-{{ bootstrap_host_ethtool_path }} -K br-lbaas gso off sg off tso off tx off"
- "-{{ bootstrap_host_ip_path }} link set eth12 up"
- "-{{ bootstrap_host_ip_path }} link set br-vlan-veth up"
- "-{{ bootstrap_host_ethtool_path }} -K eth12 gso off sg off tso off tx off"
- "-{{ bootstrap_host_ip_path }} link set eth13 up"
- "-{{ bootstrap_host_ip_path }} link set br-dbaas-veth up"
- "-{{ bootstrap_host_ethtool_path }} -K eth13 gso off sg off tso off tx off"
- "-{{ bootstrap_host_ip_path }} link set eth14 up"
- "-{{ bootstrap_host_ip_path }} link set br-lbaas-veth up"
- "-{{ bootstrap_host_ethtool_path }} -K eth14 gso off sg off tso off tx off"
execstops:
- "/sbin/iptables -t nat -D POSTROUTING -o {{ bootstrap_host_public_interface }} -j MASQUERADE"
- "{{ bootstrap_host_iptables_path }} -t nat -D POSTROUTING -o {{ bootstrap_host_public_interface }} -j MASQUERADE"
enabled: yes
state: started
systemd_tempd_prefix: openstack