Vagrant project for testing cloud-init scripts.
-
Edit the
meta-data.yaml
anduser-data.yaml
files located in<project-directory>/cloud-init/nocloud-net/
.- Note that the vagrant provisioner copies the above files to
/var/lib/cloud/seed/nocloud-net/
without the.yaml
extension.
- Note that the vagrant provisioner copies the above files to
-
Start the box, login and check the configuration.
$ vagrant up $ vagrant ssh <box> $ # check configuration
-
Once you're finished, you can destroy the box with
$ vagrant destroy
If you want to test changes without restarting the box, follow these steps:
-
Edit the
meta-data
anduser-data
files located on the box in/var/lib/cloud/seed/nocloud-net/
. -
Remove particular files that identify the current cloud-init instance configuration (which stop
cloud-init
from re-running).<box> $ sudo rm -fr /var/lib/cloud/sem/* /var/lib/cloud/instance /var/lib/cloud/instances/*
-
Force
cloud-init
to run again.<box> $ sudo cloud-init init <box> $ sudo cloud-init modules
As this project is using vagrant
, it relies on the nocloud
module. There are two variations of this module; one that does not provide network access and one that does; this project uses the latter by default.
- No network access:
/var/lib/cloud/seed/nocloud/
- Network access enabled:
/var/lib/cloud/seed/nocloud-net/