25
votes
Accepted
How to use cloud-init with Terraform?
Cloud-init files are essentially bootstrap codes, that run before each startup, and can - among others - modify files, set up services, create users, etc.
Not all types of droplets support all ...
6
votes
How to use cloud-init with Terraform?
When you create an Auto Scaling group with Terraform, you can specify the user_data to be used by instances created by this ASG. Documented here - https://www.terraform.io/docs/providers/aws/r/...
3
votes
Cloud-Init Script Won't Run?
There are a few issues with this cloud-init script.
#groups is commented out, so the list beneath it makes it invalid YAML.
Even if we uncomment groups, - ubuntu: [root,sys] is invalid because the ...
3
votes
Accepted
How come my hostname isn't set to the FQDN with cloud-init when using `prefer_fqdn_over_hostname`?
This is a bug in cloud-init, I've filed it upstream as Bug #1966533
I was getting silent failures because the hostname was
host-10-2-65-89.openstack.build.
Instead of
host-10-2-65-89.openstack.build
...
2
votes
How to provide multiple configs for EC2 node using Terraform and cloud-init?
It sounds like you want to do some configuration management upstream from the terraform. I would suggest following a pattern of writing Packer templates to build and provision the AMIs before running ...
1
vote
Accepted
Does cloud-init store the copy of the init it ran first?
It seems to be stored under
/var/lib/cloud/instances
Under your instance id.
cd /var/lib/cloud/instances/$(cloud-init query instance_id)
For me I found the information I wanted in user-data.txt.
...
1
vote
What do you call variables like "%(ec2_region)" in my cloud-init?
This is called instance metadata. Cloud providers expose metadata to cloud instances which cloud-init then stores and can be used in a few different contexts, such as jinja-templated cloud-init ...
1
vote
Accepted
Provision and configure Azure VM in private subnet (file, remote-exec, cloud-init, etc.)
Hashicorp recommends using provisioners only as a last resort. They recommend using the Azure VM custom_data method, or cloud-init where available.
Ansible would likely be overkill unless you will ...
1
vote
How to combine cloud-init with Azure ARM Template
I feel like you are providing the answer yourself. Encode the entire cloud-init file as one-line base64 using a pre-processing script. Something like cat cloud-init.txt | base64 -w0 would work for ...
1
vote
How do I install Terraform libvrit_cloudinit?
Try to use libvirt_cloudinit_disk instead of libvirt_cloudinit. I think it is deprecated.
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
cloud-init × 19terraform × 13
amazon-web-services × 3
ssh × 3
azure × 2
yaml × 2
ubuntu × 2
openstack × 2
docker × 1
azure-devops × 1
amazon-ec2 × 1
google-cloud-platform × 1
configuration × 1
infrastructure-as-code × 1
bash × 1
provisioning × 1
volume × 1
terraform-module × 1