Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fabacab/cloud-init-vagrant-example
Bare-bones example for testing a cloud-init cloud config script in a local Vagrant development environment.
https://github.com/fabacab/cloud-init-vagrant-example
Last synced: about 2 months ago
JSON representation
Bare-bones example for testing a cloud-init cloud config script in a local Vagrant development environment.
- Host: GitHub
- URL: https://github.com/fabacab/cloud-init-vagrant-example
- Owner: fabacab
- Created: 2020-01-05T02:49:57.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-01-05T23:37:08.000Z (over 4 years ago)
- Last Synced: 2024-06-02T23:41:58.596Z (4 months ago)
- Language: Shell
- Homepage:
- Size: 2.93 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `cloud-init` Vagrant Example
This repository showcases a bare-bones, thoroughly documented example in which one can test [`cloud-init`](https://cloud-init.io/) configurations locally by using [Vagrant](https://www.vagrantup.com/) to provision a virtual machine without requiring access to an Amazon Web Services (AWS), Google Cloud Platform (GCP), or other public cloud provider account.
*Vagrant* is a virtual machine hypervisor automation utility capable of automatically creating virtual machines in [VirtualBox](https://virtualbox.org/), [VMware](https://www.vmware.com/), [Hyper-V](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/), [Linux KVM](https://www.linux-kvm.org/), and other host-based virtual machine managers for which it has an installed [provider](https://www.vagrantup.com/docs/providers/). *Cloud-init* is an industry standard mechanism for running (usually) one-time configuration commands on generic Operating System base images such as [AMIs](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html) or [GCE images](https://cloud.google.com/compute/docs/images) in order to customize them during the instance's (first) boot. This makes it easier to build generic "gold master" images of your software distribution that can nevertheless be optimized for specific public or private cloud environments.
Testing your cloud-init configurations can be difficult if you do not have access to such a public cloud environment because the cloud infrastructure provider (i.e., "Infrastructure as a Service" or IaaS platform) often delivers metadata about the environment to the compute instances that you launch. For example, the [Amazon Instance Metadata Service](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) can be queried from a newly-launched instance at the magic `http://169.254.169.254/` URL. Other cloud providers have their own implementations of instance metadata services. For example, [DigitalOcean Droplet Metadata](https://www.digitalocean.com/docs/droplets/resources/metadata/) and [Azure Instance Metadata Service](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/instance-metadata-service).
This example Vagrant project shows how to use the [cloud-init NoCloud datasource](https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html) to deliver both platform-provided instance meta- and optional user-supplied instance "user-data" to cloud-init-enabled Vagrant base boxes so that you can more easily experiment with and test [various cloud-init scripts](https://cloudinit.readthedocs.io/en/latest/topics/examples.html) on your local development environment before you ever hit a public (and often not entirely monetarily free) API.