Merge lp:~josvaz/vmbuilder/jenkins_kvm-revert-eth1+ into lp:~ubuntu-on-ec2/vmbuilder/jenkins_kvm

Proposed by Jose L. VG
Status: Merged
Merged at revision: 770
Proposed branch: lp:~josvaz/vmbuilder/jenkins_kvm-revert-eth1+
Merge into: lp:~ubuntu-on-ec2/vmbuilder/jenkins_kvm
Diff against target: 114 lines (+27/-65)
1 file modified
templates/img-extra-nets.tmpl (+27/-65)
To merge this branch: bzr merge lp:~josvaz/vmbuilder/jenkins_kvm-revert-eth1+
Reviewer Review Type Date Requested Status
Robert C Jennings (community) Approve
Review via email: mp+308930@code.launchpad.net

Description of the change

Revert eth1+ fix as its breaking builds

Need to debug before reshipping it.

To post a comment you must log in.
Revision history for this message
Robert C Jennings (rcj) wrote :

Looks like it takes us back to the prior state. Merging.

review: Approve
Revision history for this message
Jose L. VG (josvaz) wrote :

this was created by bzr revert -r 767 so it should be all automatic an safe

767 reads
767. By Robert C Jennings on 2016-10-06
Enable trace output for MAAS v3 builder

and is the last commit before eth1+ changes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'templates/img-extra-nets.tmpl'
2--- templates/img-extra-nets.tmpl 2016-10-18 14:50:58 +0000
3+++ templates/img-extra-nets.tmpl 2016-10-20 13:40:57 +0000
4@@ -1,17 +1,29 @@
5 ######################
6 ## BEGIN NICS
7 ## This adds upstart jobs for the creation of hot-plug NICS
8-## For xenial onward, udev is configured instead
9 # vi: ts=4 noexpandtab syntax=sh
10
11-int_d="/run/network/interfaces.ephemeral.d/"
12+int_d="/etc/network/interfaces.dynamic.d"
13 xchroot mkdir -p ${int_d}
14
15-function config_upstart {
16- # Give an upstart job for defining a secondary interface
17- # if needed.
18- cat << EOF > ${mp}/etc/init/network-conf-ethX.conf
19-# Enable DHCP configuration for eth1+ devices as they appear
20+## Place readme to notify people what is going on
21+cat << EOF > ${mp}${int_d}/README
22+WARNING: This is mounted over during boot!
23+
24+If you are seeing this file, it means that you have disabled the tmpfs mount
25+ in /etc/fstab for ${int_d}. Therefore, this directory
26+ is ephemeral.
27+
28+This directory is normally populated at boot for any interface that is not
29+ eth0 with a dynamic configuration.
30+
31+${CLOUD_IMG_STR}
32+EOF
33+
34+# Give an upstart job for defining a secondary interface
35+# if needed.
36+cat << EOF > ${mp}/etc/init/network-conf-ethX.conf
37+# Enable DHCP configuration for additional ethX devices
38 ${CLOUD_IMG_STR}
39
40 description "Dynamically populate ${int_d}"
41@@ -38,65 +50,15 @@
42 esac
43 end script
44 EOF
45-}
46-
47-function config_udev {
48- # Give a udev script to define eth1+ interfaces, as they appear
49- cat << EOF > ${mp}/usr/local/sbin/ephemeral_eth.sh
50-#!/bin/bash
51+
52+# Add an ephemeral mount for holding additional NIC interfaces
53+cat << EOF >> ${mp}/etc/fstab
54+
55 ${CLOUD_IMG_STR}
56-# Enable DHCP configuration for ethx devices other than eth0
57-# Called by udev to define eth1+ interfaces, as they appear
58-
59-INTERFACE=\$1
60-net_int_d="${int_d}"
61-
62-function configure_nic {
63- # Ensure \${net_int_d} exists on the ephemeral mount
64- mkdir -p \${net_int_d}
65-
66- # Setup the interface config file
67- cat << EOM > \${net_int_d}/\${INTERFACE}.cfg
68-# Added by \$0
69-allow-hotplug \${INTERFACE}
70-iface \${INTERFACE} inet dhcp
71-EOM
72-
73- # Bring the interface up
74- /sbin/ifup \${INTERFACE}
75-}
76-
77-case \${INTERFACE} in
78- eth0) #skip, this is static
79- ;;
80- eth*)
81- if [ ! -e \${net_int_d}/\${INTERFACE}.cfg ]
82- then
83- configure_nic
84- fi
85- ;;
86- *)
87- ;;
88-esac
89-EOF
90- # Make the script executable
91- xchroot chmod +x ${mp}/usr/local/sbin/ephemeral_eth.sh
92-
93- # Place an udev rule to call the script when an net device is added
94- cat << EOF > ${mp}/etc/udev/rules.d/10-net-device-added.rules
95-# Run /usr/local/sbin/ephemeral_eth.sh every time a network device is added
96-ACTION=="add", SUBSYSTEM=="net", KERNEL=="eth[0-9]*", PROGRAM="/usr/local/sbin/ephemeral_eth.sh %k"
97-EOF
98-}
99-
100-case ${SUITE} in
101- precise|trusty)
102- config_upstart
103- ;;
104- *)
105- config_udev
106- ;;
107-esac
108+# The following is used to dynamically configured additional
109+# NICs. Do not remove unless you know what you are doing.
110+none ${int_d} tmpfs nodev,noexec,nosuid,size=64K 0 0
111+EOF
112
113 # Add the network ephemeral mount...
114 cat << EOF >> ${mp}/etc/network/interfaces

Subscribers

People subscribed via source and target branches