initial commit for CORD-213.
This now works except, do not call your fabric interface the same
as an existing physical interface.
Change-Id: I3cc68ef9d221e05fb5fbe46fb366ea3c6213e3fc
diff --git a/roles/compute-node/files/rename_ifaces.sh b/roles/compute-node/files/rename_ifaces.sh
index fdf2931..eb773f9 100755
--- a/roles/compute-node/files/rename_ifaces.sh
+++ b/roles/compute-node/files/rename_ifaces.sh
@@ -73,11 +73,13 @@
rm -rf $OUT
IDX=0
+ # this will not support more than 10 fabric nics... should be ok. (Famous last words)
for i in $(cat $1 | sort); do
- echo "SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"$i\", ATTR{dev_id}==\"0x0\", ATTR{type}==\"1\", KERNEL==\"*\", NAME=\"eth$IDX\"" >> $OUT
+ echo "SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"$i\", ATTR{dev_id}==\"0x$IDX\", ATTR{type}==\"1\", KERNEL==\"*\", NAME=\"eth$IDX\"" >> $OUT
IDX=$(expr $IDX + 1)
done
+
for i in $(cat $2 | sort); do
echo "SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"$i\", NAME=\"eth$IDX\"" >> $OUT
IDX=$(expr $IDX + 1)
@@ -98,20 +100,30 @@
IDX=0
for i in $(cat $1); do
- if [ "eth$IDX" == "$3" ]; then
- echo "auto eth$IDX" >> $OUT
- echo "iface eth$IDX inet static" >> $OUT
- echo " address $FAB_IP" >> $OUT
- echo " network $FAB_NETWORK" >> $OUT
- echo " netmask $FAB_NETMASK" >> $OUT
- FIRST=0
- else
- echo "iface eth$IDX inet manual" >> $OUT
- fi
+ echo "auto eth$IDX" >> $OUT
+ echo "iface eth$IDX inet manual" >> $OUT
+ echo " bond-master $3" >> $OUT
+ [ -z $FIRST ] && echo " bond-primary eth$IDX" >> $OUT
+ # Make bond-mode configurable
+ echo " bond-mode active-backup" >> $OUT
+ echo " bond-miimon 100" >> $OUT
+ echo " bond-slaves none" >> $OUT
+ FIRST="done"
echo "" >> $OUT
IDX=$(expr $IDX + 1)
done
+ echo "auto $3" >> $OUT
+ echo "iface $3 inet static" >> $OUT
+ echo " address $FAB_IP" >> $OUT
+ echo " network $FAB_NETWORK" >> $OUT
+ echo " netmask $FAB_NETMASK" >> $OUT
+ # Make bond-mode configurable
+ echo " bond-mode active-backup" >> $OUT
+ echo " bond-miimon 100" >> $OUT
+ echo " bond-slaves none" >> $OUT
+ echo "" >> $OUT
+
for i in $(cat $2); do
if [ "eth$IDX" == "$4" ]; then
if [ "$EXT_IP" == "dhcp" ]; then
diff --git a/roles/compute-node/tasks/main.yml b/roles/compute-node/tasks/main.yml
index ae8fb7b..31c25ba 100644
--- a/roles/compute-node/tasks/main.yml
+++ b/roles/compute-node/tasks/main.yml
@@ -9,11 +9,12 @@
- name: Applications
become: yes
- apt: name={{ item }} state=latest force=yes
+ apt: name={{ item }} state=latest force=yes
with_items:
- - build-essential
+ - build-essential
- git
- python-pip
+ - ifenslave-2.6
- name: Ensure Docker Ansible Support
become: yes
@@ -110,6 +111,17 @@
tags:
- interface_config
+- name: Load modules at boot
+ become: yes
+ lineinfile:
+ dest: /etc/modules
+ line: "{{ item }}"
+ with_items:
+ - lp
+ - loop
+ - rtc
+ - bonding
+
- name: Reboot Required
become: yes
command: /sbin/reboot
diff --git a/roles/compute-node/vars/main.yml b/roles/compute-node/vars/main.yml
index d240443..1906b70 100644
--- a/roles/compute-node/vars/main.yml
+++ b/roles/compute-node/vars/main.yml
@@ -2,7 +2,7 @@
compute_node:
interfaces:
- fabric: "{{ fabric_iface | default('eth0') }}"
+ fabric: "{{ fabric_iface | default('fabric') }}"
management: "{{ management_iface | default('eth2') }}"
external: "{{ external_iface | default('eth3') }}"
addresses: