For the purpose of testing cloud-init local datasource, we can use vagrant to get a bare bones trusty box quick.
Look here for examples: https://cloudinit.readthedocs.org/en/latest/topics/examples.html
mkdir -p cloud-init/local-provider/vagrantcd cloud-init/local-provider/vagrantvagrant init ubuntu/trusty64; vagrant up --provider virtualboxSsh into the vagrant vm
vagrant sshRemove cloud-init files so node is in uninitialized state
rm -rf /var/lib/cloud/instance/*
rm -rf /var/lib/cloud/seed/nocloud-net/user-dataCreate the user-data file in /var/lib/cloud/seed/nocloud-net/user-data with the contents
#cloud-config
runcmd:
- echo "testtest" > /testfile.txtNext run the commands to cloud-init your local instance
sudo cloud-init init --local
sudo cloud-init --debug modules -–mode config
sudo cloud-init --debug modules -–mode final