Added config drive creating scripts.
diff --git a/create_config_drive.sh b/create_config_drive.sh
new file mode 100644
index 0000000..d8ae698
--- /dev/null
+++ b/create_config_drive.sh
@@ -0,0 +1,127 @@
+#!/bin/sh
+
+# This will generate a openstack-style config drive image suitable for
+# use with cloud-init. You may optionally pass in an ssh public key
+# (using the -k/--ssh-key option) and a user-data blog (using the
+# -u/--user-data option).
+
+usage () {
+ echo "usage: ${0##*/}: [--ssh-key <pubkey>] [--vendor-data <file>] [--user-data <file>] [--hostname <hostname>] [--model <model>] [--mk-pipelines <mk-pipelines>] [--pipeline-library <pipeline-library>] <imagename>"
+}
+
+ARGS=$(getopt \
+ -o k:u:v:h:m:mp:p \
+ --long help,hostname:,ssh-key:,user-data:,vendor-data:,model:,mk-pipelines:,pipeline-library: -n ${0##*/} \
+ -- "$@")
+
+if [ $? -ne 0 ]; then
+ usage >&2
+ exit 2
+fi
+
+eval set -- "$ARGS"
+
+while :; do
+ case "$1" in
+ --help)
+ usage
+ exit 0
+ ;;
+ -k|--ssh-key)
+ ssh_key="$2"
+ shift 2
+ ;;
+ -u|--user-data)
+ user_data="$2"
+ shift 2
+ ;;
+ -v|--vendor-data)
+ vendor_data="$2"
+ shift 2
+ ;;
+ -h|--hostname)
+ hostname="$2"
+ shift 2
+ ;;
+ -m|--model)
+ model="$2"
+ shift 2
+ ;;
+ -mp|--mk-pipelines)
+ mk_pipelines="$2"
+ shift 2
+ ;;
+ -p|--pipeline-library)
+ pipeline_library="$2"
+ shift 2
+ ;;
+ --) shift
+ break
+ ;;
+ esac
+done
+
+config_image=$1
+shift
+
+if [ "$ssh_key" ] && [ -f "$ssh_key" ]; then
+ echo "adding pubkey from $ssh_key"
+ ssh_key_data=$(cat "$ssh_key")
+fi
+
+uuid=$(uuidgen)
+if ! [ "$hostname" ]; then
+ hostname="$uuid"
+fi
+
+trap 'rm -rf $config_dir' EXIT
+config_dir=$(mktemp -t -d configXXXXXX)
+
+if [ "$user_data" ] && [ -f "$user_data" ]; then
+ echo "adding user data from $user_data"
+ cp $user_data $config_dir/user-data
+else
+ touch $config_dir/user-data
+fi
+
+if [ "$vendor_data" ] && [ -f "$vendor_data" ]; then
+ echo "adding vendor data from $vendor_data"
+ cp $vendor_data $config_dir/vendor-data
+fi
+
+if [ "$model" ] ; then
+ echo "adding reclass model directory $model"
+ mkdir $config_dir/model
+ cp -r $model $config_dir/model/
+fi
+
+if [ "$mk_pipelines" ] ; then
+ echo "adding mk_pipelines directory $mk_pipelines"
+ mkdir $config_dir/mk_pipelines
+ cp -r $mk_pipelines $config_dir/mk-pipelines/
+fi
+
+if [ "$pipeline_library" ] ; then
+ echo "adding pipeline_library directory $pipeline_library"
+ mkdir $config_dir/pipeline_library
+ cp -r $pipeline_library $config_dir/pipeline-library/
+fi
+
+cat > $config_dir/meta-data <<-EOF
+instance-id: $uuid
+hostname: $hostname
+local-hostname: $hostname
+EOF
+
+#PS1="debug> " bash --norc
+
+echo "generating configuration image at $config_image"
+if ! mkisofs -o $config_image -V cidata -r -J --quiet $config_dir; then
+ echo "ERROR: failed to create $config_image" >&2
+ exit 1
+fi
+
+chmod a+r $config_image
+
+
+
diff --git a/master_config.sh b/master_config.sh
new file mode 100644
index 0000000..fb941c4
--- /dev/null
+++ b/master_config.sh
@@ -0,0 +1,52 @@
+#!/bin/bash -xe
+export SALT_MASTER_DEPLOY_IP=172.16.164.15
+export SALT_MASTER_MINION_ID=cfg01.deploy-name.local
+export DEPLOY_NETWORK_GW=172.16.164.1
+export DEPLOY_NETWORK_NETMASK=255.255.255.192
+export DNS_SERVERS=8.8.8.8
+
+echo "Configuring network interfaces"
+envsubst < /root/interfaces > /etc/network/interfaces
+ifdown ens3; ifup ens3
+
+echo "Preparing metadata model"
+mount /dev/cdrom /mnt/
+cp -r /mnt/model/model/* /srv/salt/reclass/
+chown -R root:root /srv/salt/reclass/*
+chmod -R 644 /srv/salt/reclass/classes/cluster/*
+chmod -R 644 /srv/salt/reclass/classes/system/*
+
+echo "updating git repos"
+cp -r /mnt/mk-pipelines/* /home/repo/mk/mk-pipelines/
+cp -r /mnt/mk-pipelines/.git* /home/repo/mk/mk-pipelines/
+cp -r /mnt/pipeline-library/* /home/repo/mcp-ci/pipeline-library/
+cp -r /mnt/pipeline-library/.git* /home/repo/mcp-ci/pipeline-library/
+chown -R git:www-data /home/repo/mk/mk-pipelines/*
+chown -R git:www-data /home/repo/mk/mk-pipelines/.git*
+chown -R git:www-data /home/repo/mcp-ci/pipeline-library/*
+chown -R git:www-data /home/repo/mcp-ci/pipeline-library/.git*
+umount /dev/cdrom
+
+echo "Configuring salt"
+#service salt-master restart
+envsubst < /root/minion.conf > /etc/salt/minion.d/minion.conf
+service salt-minion restart
+while true; do
+ salt-key | grep "$SALT_MASTER_MINION_ID" && break
+ sleep 5
+done
+sleep 5
+for i in `salt-key -l accepted | grep -v Accepted | grep -v "$SALT_MASTER_MINION_ID"`; do
+ salt-key -d $i -y
+done
+
+find /var/lib/jenkins/jenkins.model.JenkinsLocationConfiguration.xml -type f -print0 | xargs -0 sed -i -e 's/10.167.4.15/'$SALT_MASTER_DEPLOY_IP'/g'
+
+salt-call saltutil.refresh_pillar
+salt-call saltutil.sync_all
+salt-call state.sls linux.network,linux,openssh,salt
+salt-call state.sls maas.cluster,maas.region,reclass
+
+ssh-keyscan cfg01 > /var/lib/jenkins/.ssh/known_hosts
+
+reboot
\ No newline at end of file
diff --git a/mirror_config.sh b/mirror_config.sh
new file mode 100644
index 0000000..39a850d
--- /dev/null
+++ b/mirror_config.sh
@@ -0,0 +1,16 @@
+#!/bin/bash -xe
+
+export SALT_MASTER_DEPLOY_IP=10.1.0.14
+export APTLY_DEPLOY_IP=10.1.0.14
+export APTLY_DEPLOY_NETMASK=255.255.0.0
+export APTLY_MINION_ID=apt01.deploy-name.local
+
+echo "Configuring network interfaces"
+envsubst < /root/interfaces > /etc/network/interfaces
+ifdown ens3; ifup ens3
+
+echo "Configuring salt"
+service salt-minion stop
+systemctl disable salt-minion.service
+envsubst < /root/minion.conf > /etc/salt/minion.d/minion.conf
+#service salt-minion restart