-
-
Save philroche/be0fb701b6b59d5d5f62f685a6ee3838 to your computer and use it in GitHub Desktop.
An exmple of changing the datasource in cloud-init
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the Ubuntu cloud image of your choosing (this example uses the latest Xenial daily) | |
wget http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img | |
# Set the cloud-init datasource to use explicitly (this example uses the EC2 datasource) | |
sudo mount-image-callback xenial-server-cloudimg-amd64-disk1.img -- \ | |
sh -c 'echo "datasource: Ec2" > $MOUNTPOINT/etc/cloud/ds-identify.cfg' | |
# Confirm the current datasource configuration | |
sudo mount-image-callback xenial-server-cloudimg-amd64-disk1.img -- \ | |
chroot _MOUNTPOINT_ cat /etc/cloud/ds-identify.cfg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment