Commit 5a0f7f3c by Serge Hallyn Committed by Daniel Lezcano

Description: Fix handling of user-data in ubuntu-cloud template

parent b08ee0ce
...@@ -117,7 +117,7 @@ EOF ...@@ -117,7 +117,7 @@ EOF
return 0 return 0
} }
options=$(getopt -o a:hp:r:n:Fi:CLS:T:ds: -l arch:,help,path:,release:,name:,flush-cache,hostid:,auth-key:,cloud,no_locales,tarball:,debug,stream: -- "$@") options=$(getopt -o a:hp:r:n:Fi:CLS:T:ds: -l arch:,help,path:,release:,name:,flush-cache,hostid:,auth-key:,cloud,no_locales,tarball:,debug,stream:,userdata: -- "$@")
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
usage $(basename $0) usage $(basename $0)
exit 1 exit 1
...@@ -207,6 +207,11 @@ if [ "$stream" != "daily" -a "$stream" != "released" ]; then ...@@ -207,6 +207,11 @@ if [ "$stream" != "daily" -a "$stream" != "released" ]; then
exit 1 exit 1
fi fi
if [ -n "$userdata" -a ! -f "$userdata" ]; then
echo "Userdata does not exist"
exit 1
fi
if [ -z "$path" ]; then if [ -z "$path" ]; then
echo "'path' parameter is required" echo "'path' parameter is required"
exit 1 exit 1
...@@ -322,8 +327,9 @@ EOF ...@@ -322,8 +327,9 @@ EOF
echo "Inserted SSH public key from $auth_key into /home/ubuntu/.ssh/authorized_keys" echo "Inserted SSH public key from $auth_key into /home/ubuntu/.ssh/authorized_keys"
fi fi
if [ ! -f $userdata ]; then if [ -f "$userdata" ]; then
cp $userdata $data_d/user-data echo "Using custom user-data"
cp $userdata $seed_d/user-data
else else
if [ -z "$MIRROR" ]; then if [ -z "$MIRROR" ]; then
...@@ -337,7 +343,6 @@ apt-mirror: $MIRROR ...@@ -337,7 +343,6 @@ apt-mirror: $MIRROR
manage_etc_hosts: localhost manage_etc_hosts: localhost
locale: $(/usr/bin/locale | awk -F= '/LANG=/ {print$NF}') locale: $(/usr/bin/locale | awk -F= '/LANG=/ {print$NF}')
EOF EOF
fi fi
chroot $rootfs /usr/sbin/usermod -U ubuntu chroot $rootfs /usr/sbin/usermod -U ubuntu
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment