summaryrefslogtreecommitdiff
path: root/scripts/files/elements/ubuntu-guest
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/files/elements/ubuntu-guest')
-rwxr-xr-xscripts/files/elements/ubuntu-guest/extra-data.d/15-reddwarf-dep48
-rwxr-xr-xscripts/files/elements/ubuntu-guest/extra-data.d/20-guest-upstart21
-rwxr-xr-xscripts/files/elements/ubuntu-guest/extra-data.d/62-ssh-key31
-rwxr-xr-xscripts/files/elements/ubuntu-guest/install.d/05-base-apps10
-rwxr-xr-xscripts/files/elements/ubuntu-guest/install.d/15-reddwarf-dep31
-rwxr-xr-xscripts/files/elements/ubuntu-guest/install.d/20-etc8
-rwxr-xr-xscripts/files/elements/ubuntu-guest/install.d/50-user18
-rwxr-xr-xscripts/files/elements/ubuntu-guest/install.d/62-ssh-key28
-rwxr-xr-xscripts/files/elements/ubuntu-guest/install.d/98-ssh8
-rwxr-xr-xscripts/files/elements/ubuntu-guest/install.d/99-clean-apt11
-rwxr-xr-xscripts/files/elements/ubuntu-guest/post-install.d/05-ipforwarding4
-rwxr-xr-xscripts/files/elements/ubuntu-guest/post-install.d/10-ntp10
-rwxr-xr-xscripts/files/elements/ubuntu-guest/post-install.d/62-trove-guest-sudoers15
-rwxr-xr-xscripts/files/elements/ubuntu-guest/post-install.d/90-apt-get-update9
-rwxr-xr-xscripts/files/elements/ubuntu-guest/pre-install.d/01-trim-pkgs117
-rwxr-xr-xscripts/files/elements/ubuntu-guest/pre-install.d/04-baseline-tools7
16 files changed, 0 insertions, 376 deletions
diff --git a/scripts/files/elements/ubuntu-guest/extra-data.d/15-reddwarf-dep b/scripts/files/elements/ubuntu-guest/extra-data.d/15-reddwarf-dep
deleted file mode 100755
index 33b4230..0000000
--- a/scripts/files/elements/ubuntu-guest/extra-data.d/15-reddwarf-dep
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/bash
-
-set -e
-set -o xtrace
-
-# CONTEXT: HOST prior to IMAGE BUILD as SCRIPT USER
-# PURPOSE: Setup the requirements file for use by 15-reddwarf-dep
-
-source $_LIB/die
-
-BRANCH_OVERRIDE=${BRANCH_OVERRIDE:-default}
-ADD_BRANCH=$(basename ${BRANCH_OVERRIDE})
-REQUIREMENTS_FILE=${REDSTACK_SCRIPTS}/files/requirements/ubuntu-requirements-${ADD_BRANCH}.txt
-
-[ -n "$TMP_HOOKS_PATH" ] || die "Temp hook path not set"
-[ -e ${REQUIREMENTS_FILE} ] || die "Requirements not found"
-[ -n "$HOST_USERNAME" ] || die "HOST_USERNAME not set"
-
-sudo -Hiu ${HOST_USERNAME} dd if=${REQUIREMENTS_FILE} of=${TMP_HOOKS_PATH}/requirements.txt
-
-# Grab the upper constraints file, but don't fail if we can't find it.
-# If we are running in the CI environment, $DEST will be set and stackrc
-# will use $DEST/requirements as the location for the requirements repo.
-# Use that as it will help us chain a job with something that is changing UC.
-
-UC_FILE=upper-constraints.txt
-
-if [ -f "${DEST}/requirements/${UC_FILE}" ]; then
- echo "Found ${DEST}/requirements/${UC_FILE}, using that"
- sudo -Hiu ${HOST_USERNAME} dd if="${DEST}/requirements/${UC_FILE}" \
- of="${TMP_HOOKS_PATH}/${UC_FILE}"
-else
- UC_DIR=$(pwd)
- UC_BRANCH=${BRANCH_OVERRIDE}
- if [ "${ADD_BRANCH}" == "default" ]; then
- UC_BRANCH=master
- fi
-
- set +e
- curl -o "${UC_DIR}/${UC_FILE}" \
- https://git.openstack.org/cgit/openstack/requirements/plain/${UC_FILE}?h=${UC_BRANCH}
- set -e
-
- if [ -f "${UC_DIR}/${UC_FILE}" ]; then
- sudo -Hiu ${HOST_USERNAME} dd if="${UC_DIR}/${UC_FILE}" of=${TMP_HOOKS_PATH}/${UC_FILE}
- rm -f "${UC_DIR}/${UC_FILE}"
- fi
-fi
diff --git a/scripts/files/elements/ubuntu-guest/extra-data.d/20-guest-upstart b/scripts/files/elements/ubuntu-guest/extra-data.d/20-guest-upstart
deleted file mode 100755
index 2b22159..0000000
--- a/scripts/files/elements/ubuntu-guest/extra-data.d/20-guest-upstart
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-
-set -e
-set -o xtrace
-
-# CONTEXT: HOST prior to IMAGE BUILD as SCRIPT USER
-# PURPOSE: stages the bootstrap file and upstart conf file while replacing variables so that guest image is properly
-# configured
-
-source $_LIB/die
-
-[ -n "$TMP_HOOKS_PATH" ] || die "Temp hook path not set"
-
-[ -n "${GUEST_USERNAME}" ] || die "GUEST_USERNAME needs to be set to the user for the guest image"
-[ -n "${HOST_SCP_USERNAME}" ] || die "HOST_SCP_USERNAME needs to be set to the user for the host instance"
-[ -n "${CONTROLLER_IP}" ] || die "CONTROLLER_IP needs to be set to the ip address that guests will use to contact the controller"
-[ -n "${ESCAPED_PATH_TROVE}" ] || die "ESCAPED_PATH_TROVE needs to be set to the path to the trove directory on the redstack host"
-[ -n "${REDSTACK_SCRIPTS}" ] || die "REDSTACK_SCRIPTS needs to be set to the trove-integration scripts dir"
-[ -n "${ESCAPED_GUEST_LOGDIR}" ] || die "ESCAPED_GUEST_LOGDIR must be set to the escaped guest log dir"
-
-sed "s/GUEST_USERNAME/${GUEST_USERNAME}/g;s/GUEST_LOGDIR/${ESCAPED_GUEST_LOGDIR}/g;s/HOST_SCP_USERNAME/${HOST_SCP_USERNAME}/g;s/CONTROLLER_IP/${CONTROLLER_IP}/g;s/PATH_TROVE/${ESCAPED_PATH_TROVE}/g" ${REDSTACK_SCRIPTS}/files/trove-guest.upstart.conf > ${TMP_HOOKS_PATH}/trove-guest.conf
diff --git a/scripts/files/elements/ubuntu-guest/extra-data.d/62-ssh-key b/scripts/files/elements/ubuntu-guest/extra-data.d/62-ssh-key
deleted file mode 100755
index 63453a7..0000000
--- a/scripts/files/elements/ubuntu-guest/extra-data.d/62-ssh-key
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/bash
-
-set -e
-set -o xtrace
-
-# CONTEXT: HOST prior to IMAGE BUILD as SCRIPT USER
-# PURPOSE: creates the SSH key on the host if it doesn't exist. Then this copies the keys over to a staging area where
-# they will be duplicated in the guest VM.
-# This process allows the host to log into the guest but more importantly the guest phones home to get the trove
-# source
-
-source $_LIB/die
-
-[ -n "$TMP_HOOKS_PATH" ] || die "Temp hook path not set"
-
-[ -n "${HOST_USERNAME}" ] || die "HOST_USERNAME needs to be set to the user for the current user on the host"
-
-if [ `whoami` = "root" ]; then
- die "This should not be run as root"
-fi
-
-# copy files over the "staging" area for the guest image (they'll later be put in the correct location by the guest user
-# not these keys should not be overridden otherwise a) you won't be able to ssh in and b) the guest won't be able to
-# rsync the files
-if [ -e ${SSH_DIR}/authorized_keys ]; then
- sudo -Hiu ${HOST_USERNAME} dd if=${SSH_DIR}/authorized_keys of=${TMP_HOOKS_PATH}/ssh-authorized-keys
- sudo -Hiu ${HOST_USERNAME} dd if=${SSH_DIR}/id_rsa of=${TMP_HOOKS_PATH}/id_rsa
- sudo -Hiu ${HOST_USERNAME} dd if=${SSH_DIR}/id_rsa.pub of=${TMP_HOOKS_PATH}/id_rsa.pub
-else
- die "SSH Authorized Keys file must exist along with pub and private key"
-fi
diff --git a/scripts/files/elements/ubuntu-guest/install.d/05-base-apps b/scripts/files/elements/ubuntu-guest/install.d/05-base-apps
deleted file mode 100755
index 5cd392b..0000000
--- a/scripts/files/elements/ubuntu-guest/install.d/05-base-apps
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-# CONTEXT: GUEST during CONSTRUCTION as ROOT
-# PURPOSE: Install basic services and applications
-
-set -e
-set -o xtrace
-
-export DEBIAN_FRONTEND=noninteractive
-apt-get -y install ntp apparmor-utils
diff --git a/scripts/files/elements/ubuntu-guest/install.d/15-reddwarf-dep b/scripts/files/elements/ubuntu-guest/install.d/15-reddwarf-dep
deleted file mode 100755
index 8d989fe..0000000
--- a/scripts/files/elements/ubuntu-guest/install.d/15-reddwarf-dep
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/bash
-
-# CONTEXT: GUEST during CONSTRUCTION as ROOT
-# PURPOSE: Install trove guest python dependencies - see redstack functions_qemu
-
-set -e
-set -o xtrace
-
-export DEBIAN_FRONTEND=noninteractive
-apt-get -y install python-dev libxml2-dev libxslt1-dev python-setuptools \
- python-pip python-sqlalchemy python-lxml \
- python-routes python-eventlet python-webob \
- python-pastedeploy python-paste python-netaddr \
- python-httplib2 python-iso8601 python-pexpect python-mysqldb python-migrate
-
-
-# pick up the requirements file left for us by
-# extra-data.d/15-reddwarf-dep
-
-TMP_HOOKS_DIR="/tmp/in_target.d"
-
-UPPER_CONSTRAINTS=
-if [ -f ${TMP_HOOKS_DIR}/upper-constraints.txt ]; then
- UPPER_CONSTRAINTS=" -c ${TMP_HOOKS_DIR}/upper-constraints.txt"
-fi
-
-pip install -q --upgrade -r ${TMP_HOOKS_DIR}/requirements.txt ${UPPER_CONSTRAINTS}
-
-echo "diagnostic pip freeze output follows"
-pip freeze
-echo "diagnostic pip freeze output above"
diff --git a/scripts/files/elements/ubuntu-guest/install.d/20-etc b/scripts/files/elements/ubuntu-guest/install.d/20-etc
deleted file mode 100755
index 8ac19f7..0000000
--- a/scripts/files/elements/ubuntu-guest/install.d/20-etc
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-# CONTEXT: GUEST during CONSTRUCTION as ROOT
-# PURPOSE: take "staged" trove-guest.conf file and put it in the init directory on guest image
-
-dd if=/tmp/in_target.d/trove-guest.conf of=/etc/init/trove-guest.conf
-
-
diff --git a/scripts/files/elements/ubuntu-guest/install.d/50-user b/scripts/files/elements/ubuntu-guest/install.d/50-user
deleted file mode 100755
index 99f6896..0000000
--- a/scripts/files/elements/ubuntu-guest/install.d/50-user
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-
-# CONTEXT: GUEST during CONSTRUCTION as ROOT
-# PURPOSE: Add the guest image user that will own the trove agent source...if the user does not already exist
-
-set -e
-set -o xtrace
-
-if ! id -u ${GUEST_USERNAME} >/dev/null 2>&1; then
- echo "Adding ${GUEST_USERNAME} user"
- useradd -G sudo -m ${GUEST_USERNAME} -s /bin/bash
- chown ${GUEST_USERNAME}:${GUEST_USERNAME} /home/${GUEST_USERNAME}
- passwd ${GUEST_USERNAME} <<_EOF_
-${GUEST_USERNAME}
-${GUEST_USERNAME}
-_EOF_
-fi
-
diff --git a/scripts/files/elements/ubuntu-guest/install.d/62-ssh-key b/scripts/files/elements/ubuntu-guest/install.d/62-ssh-key
deleted file mode 100755
index 8085cba..0000000
--- a/scripts/files/elements/ubuntu-guest/install.d/62-ssh-key
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-
-# CONTEXT: GUEST during CONSTRUCTION as ROOT
-# PURPOSE: take "staged" ssh keys (see extra-data.d/62-ssh-key) and put them in the GUEST_USERS home directory
-
-set -e
-set -o xtrace
-
-SSH_DIR="/home/${GUEST_USERNAME}/.ssh"
-TMP_HOOKS_DIR="/tmp/in_target.d"
-
-if [ -e "${TMP_HOOKS_DIR}/ssh-authorized-keys" ]; then
- if [ ! -e ${SSH_DIR} ]; then
- # this method worked more reliable in vmware fusion over doing sudo -Hiu ${GUEST_USERNAME}
- mkdir ${SSH_DIR}
- chown ${GUEST_USERNAME}:${GUEST_USERNAME} ${SSH_DIR}
- fi
- sudo -Hiu ${GUEST_USERNAME} dd of=${SSH_DIR}/authorized_keys conv=notrunc if=${TMP_HOOKS_DIR}/ssh-authorized-keys
- if [ ! -e "${SSH_DIR}/id_rsa" ]; then
- sudo -Hiu ${GUEST_USERNAME} dd of=${SSH_DIR}/id_rsa if=${TMP_HOOKS_DIR}/id_rsa
- # perms have to be right on this file for ssh to work
- sudo -Hiu ${GUEST_USERNAME} chmod 600 ${SSH_DIR}/id_rsa
- sudo -Hiu ${GUEST_USERNAME} dd of=${SSH_DIR}/id_rsa.pub if=${TMP_HOOKS_DIR}/id_rsa.pub
- fi
-else
- echo "SSH Keys were not staged by host"
- exit -1
-fi
diff --git a/scripts/files/elements/ubuntu-guest/install.d/98-ssh b/scripts/files/elements/ubuntu-guest/install.d/98-ssh
deleted file mode 100755
index 2134c19..0000000
--- a/scripts/files/elements/ubuntu-guest/install.d/98-ssh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-# Regenerate host keys now. XXX: Really should be a cloud-init task, should get
-# that working.
-
-set -e
-set -o xtrace
-
-dpkg-reconfigure openssh-server
diff --git a/scripts/files/elements/ubuntu-guest/install.d/99-clean-apt b/scripts/files/elements/ubuntu-guest/install.d/99-clean-apt
deleted file mode 100755
index cc348c5..0000000
--- a/scripts/files/elements/ubuntu-guest/install.d/99-clean-apt
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-# CONTEXT: GUEST during CONSTRUCTION as ROOT
-# PURPOSE: Delete contents of apt cache on guest (saves image disk space)
-
-set -e
-set -o xtrace
-
-apt-get clean
-
-
diff --git a/scripts/files/elements/ubuntu-guest/post-install.d/05-ipforwarding b/scripts/files/elements/ubuntu-guest/post-install.d/05-ipforwarding
deleted file mode 100755
index 48b7ad0..0000000
--- a/scripts/files/elements/ubuntu-guest/post-install.d/05-ipforwarding
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-set -e
-set -o xtrace
-sed -i -r 's/^\s*#(net\.ipv4\.ip_forward=1.*)/\1/' /etc/sysctl.conf
diff --git a/scripts/files/elements/ubuntu-guest/post-install.d/10-ntp b/scripts/files/elements/ubuntu-guest/post-install.d/10-ntp
deleted file mode 100755
index bc494ae..0000000
--- a/scripts/files/elements/ubuntu-guest/post-install.d/10-ntp
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-ntpfile=`mktemp`
-cat << EOF > $ntpfile
-server ntp.ubuntu.com iburst
-server 127.127.1.0
-fudge 127.127.1.0 stratum 10
-EOF
-
-mv /etc/ntp.conf /etc/ntp.conf.orig
-mv $ntpfile /etc/ntp.conf
diff --git a/scripts/files/elements/ubuntu-guest/post-install.d/62-trove-guest-sudoers b/scripts/files/elements/ubuntu-guest/post-install.d/62-trove-guest-sudoers
deleted file mode 100755
index 0581fd2..0000000
--- a/scripts/files/elements/ubuntu-guest/post-install.d/62-trove-guest-sudoers
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash
-set -e
-set -o xtrace
-
-# CONTEXT: HOST after IMAGE BUILD as SCRIPT USER
-# PURPOSE: add the guest user account to the /etc/sudoers files with NOPASSWD
-
-# Adds user to the sudoers file so they can do everything w/o a pass
-# Some binaries might be under /sbin or /usr/sbin, so make sure sudo will
-# see them by forcing PATH
-TEMPFILE=`mktemp`
-echo "${GUEST_USERNAME} ALL=(ALL) NOPASSWD:ALL" > $TEMPFILE
-chmod 0440 $TEMPFILE
-sudo chown root:root $TEMPFILE
-sudo mv $TEMPFILE /etc/sudoers.d/60_trove_guest
diff --git a/scripts/files/elements/ubuntu-guest/post-install.d/90-apt-get-update b/scripts/files/elements/ubuntu-guest/post-install.d/90-apt-get-update
deleted file mode 100755
index 6cc087a..0000000
--- a/scripts/files/elements/ubuntu-guest/post-install.d/90-apt-get-update
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-
-# CONTEXT: GUEST after packages installed
-# PURPOSE: do apt-get update to save each instance having to do all the work
-
-set -e
-set -o xtrace
-
-apt-get update
diff --git a/scripts/files/elements/ubuntu-guest/pre-install.d/01-trim-pkgs b/scripts/files/elements/ubuntu-guest/pre-install.d/01-trim-pkgs
deleted file mode 100755
index 8787df7..0000000
--- a/scripts/files/elements/ubuntu-guest/pre-install.d/01-trim-pkgs
+++ /dev/null
@@ -1,117 +0,0 @@
-#!/bin/bash
-
-# CONTEXT: GUEST during CONSTRUCTION as ROOT
-# PURPOSE: Install basic services and applications
-
-set -e
-set -o xtrace
-
-export DEBIAN_FRONTEND=noninteractive
-apt-get -y purge acpid\
- apport\
- apport-symptoms\
- apt-transport-https\
- apt-xapian-index\
- aptitude\
- at\
- bash-completion\
- bc\
- bind9-host\
- bsdmainutils\
- busybox-static\
- byobu\
- command-not-found\
- command-not-found-data\
- curl\
- dbus\
- dmidecode\
- dosfstools\
- ed\
- fonts-ubuntu-font-family-console\
- friendly-recovery\
- ftp\
- fuse\
- geoip-database\
- groff-base\
- hdparm\
- info\
- install-info\
- iptables\
- iputils-tracepath\
- irqbalance\
- landscape-client\
- landscape-common\
- language-selector-common\
- laptop-detect\
- libaccountsservice0\
- libbind9-90\
- libclass-accessor-perl\
- libcwidget3\
- libdns100\
- libept1.4.12\
- libevent-2.0-5\
- libgc1c2\
- libgeoip1\
- libio-string-perl\
- libisc95\
- liblwres90\
- libnfnetlink0\
- libparse-debianchangelog-perl\
- libparted0debian1\
- libpcap0.8\
- libpci3\
- libpipeline1\
- libpolkit-gobject-1-0\
- libsasl2-modules\
- libsigc++-2.0-0c2a\
- libsub-name-perl\
- libusb-1.0-0\
- libxapian22\
- lshw\
- lsof\
- ltrace\
- man-db\
- mlocate\
- mtr-tiny\
- nano\
- ntfs-3g\
- parted\
- patch\
- plymouth-theme-ubuntu-text\
- popularity-contest\
- powermgmt-base\
- ppp\
- pppoeconf\
- python-debian\
- python-gdbm\
- python-pam\
- python-twisted-bin\
- python-xapian\
- python-zope.interface\
- screen\
- shared-mime-info\
- strace\
- tasksel\
- tcpdump\
- telnet\
- time\
- tmux\
- ubuntu-standard\
- ufw\
- update-manager-core\
- update-notifier-common\
- usbutils\
- uuid-runtime\
- w3m
-
-# The following packages cannot be removed as they cause cloud-init to be
-# uninstalled in Ubuntu 14.04
-# gir1.2-glib-2.0
-# libdbus-glib-1-2
-# libgirepository-1.0-1
-# python-chardet
-# python-serial
-# xz-utils
-
-apt-get -y autoremove
-
diff --git a/scripts/files/elements/ubuntu-guest/pre-install.d/04-baseline-tools b/scripts/files/elements/ubuntu-guest/pre-install.d/04-baseline-tools
deleted file mode 100755
index 1a8647f..0000000
--- a/scripts/files/elements/ubuntu-guest/pre-install.d/04-baseline-tools
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-# Install baseline packages and tools.
-
-set -e
-set -o xtrace
-
-apt-get install -y language-pack-en python-software-properties \ No newline at end of file