scottslowe-learning-tools/photon-cloudinit/setup.sh
Scott Lowe 5f58d707ea Add files demonstrating cloud-init customization of Photon
Add files that demonstrate using cloud-init to customize Photon
instances.
2015-06-09 14:36:06 -06:00

17 lines
554 B
Bash
Executable file

#!/bin/bash
# Make directory for NoCloud cloud-init datasource
if [ ! -d "/var/lib/cloud/seed/nocloud" ]; then
mkdir /var/lib/cloud/seed/nocloud
fi
# Put files into the correct locations for cloud-init
# First move the user-data file, if it exists in the home directory
if [ -f "/home/vagrant/user-data" ]; then
mv /home/vagrant/user-data /var/lib/cloud/seed/nocloud/
fi
# Next move the meta-data file, if it exists in the home directory
if [ -f "/home/vagrant/meta-data" ]; then
mv /home/vagrant/meta-data /var/lib/cloud/seed/nocloud/
fi