Skip to content
A vagrant project for testing cloud-init scripts
Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cloud-init/nocloud-net
scripts Workaround issue with mDNS where reboots effect hostname and broadcast. Feb 24, 2019
.gitignore Initial commit. Dummy ssh key used for user. Oct 9, 2016
LICENSE Initial commit. Dummy ssh key used for user. Oct 9, 2016
README.md Typo correction. Nov 9, 2017
Vagrantfile Workaround issue with mDNS where reboots effect hostname and broadcast. Feb 24, 2019
boxes.yaml Workaround issue with mDNS where reboots effect hostname and broadcast. Feb 24, 2019

README.md

vagrant-cloud-init

Vagrant project for testing cloud-init scripts.

How to Use

  1. Edit the meta-data.yaml and user-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.
  2. Start the box, login and check the configuration.

    $ vagrant up
    $ vagrant ssh
    <box> $ # check configuration
  3. 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:

  1. Edit the meta-data and user-data files located on the box in /var/lib/cloud/seed/nocloud-net/.

  2. 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/*
  3. Force cloud-init to run again.

    <box> $ sudo cloud-init init
    <box> $ sudo cloud-init modules

Notes

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.

  1. No network access: /var/lib/cloud/seed/nocloud/
  2. Network access enabled: /var/lib/cloud/seed/nocloud-net/

Links

http://cloudinit.readthedocs.io

You can’t perform that action at this time.