Skip to main content

Questions tagged [cloud-init]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
29 votes
2 answers
32k views

How to use cloud-init with Terraform?

I am working with Digital Ocean and Terraform and I already can automate the domain, subdomain, network preferences and the host but there is a section called User data that looks like this: The ...
Gepser Hoil's user avatar
  • 1,312
4 votes
2 answers
1k views

Cloud-Init Script Won't Run?

I am working through this Terraform tutorial, which boots up a Go web app on an EC2 instance, using Terraform and cloud-init. This is my Terraform config file: terraform { required_version = "&...
Huzi 's user avatar
  • 41
4 votes
1 answer
922 views

How to provide multiple configs for EC2 node using Terraform and cloud-init?

I need to use several configs on my EC2 node using Terraform. data "template_cloudinit_config" "puppetserver_config" { gzip = true base64_encode = true part { ...
Alexander Nekrasov's user avatar
2 votes
1 answer
2k views

How come my hostname isn't set to the FQDN with cloud-init when using `prefer_fqdn_over_hostname`?

prefer_fqdn_over_hostname is documented as, If both fqdn and hostname are set, it is distro dependent whether hostname or fqdn is used, unless the prefer_fqdn_over_hostname option is true and fqdn is ...
Evan Carroll's user avatar
  • 2,089
2 votes
1 answer
211 views

How do I install Terraform libvrit_cloudinit?

I have searched all day trying to find a document on how to install the libvirt_cloudinit provider for Terraform. When I execute a terraform plan I encounter this error message: Error: ...
Steven K7FAQ's user avatar
1 vote
2 answers
3k views

Using a terraform template to produce a cloud-init yaml: template variables do not respect yaml context/whitespace

I am using Terraform. Terraform has a notion templatefile which can be used to take variables that Terraform has access to (locally supplied or retrieved externally) and to apply them to a Jinja2 ...
Evan Carroll's user avatar
  • 2,089
1 vote
1 answer
126 views

What do you call variables like "%(ec2_region)" in my cloud-init?

What do you call these variables in my cloud-init file, - http://%(ec2_region)s.ec2.ports.ubuntu.com/ubuntu-ports/ - http://%(availability_zone)s.clouds.ports.ubuntu.com/ubuntu-ports/ - http://%(...
Evan Carroll's user avatar
  • 2,089
1 vote
1 answer
805 views

How to combine cloud-init with Azure ARM Template

I'm trying to set up a Ubuntu Server on Azure. None of the images do quite what I want, so I was planning on taking a vanilla Ubuntu image and using cloud-init to modify it. I'd like to be able to ...
Martin Brown's user avatar
0 votes
1 answer
182 views

Does cloud-init store the copy of the init it ran first?

I'm sending my cloud-init file to Terraform via user_data. Is this stored anywhere on the machine that runs it? I know it may get merged with other stuff before it's run.
Evan Carroll's user avatar
  • 2,089
0 votes
1 answer
206 views

Provision and configure Azure VM in private subnet (file, remote-exec, cloud-init, etc.)

(Originally posted to discuss.hashicorp.com) I’m setting up a basic multi-tier infrastructure composed of two Azure VMs: Web server (VM1) with public IP and private IP (subnet1) Data server (VM2) in ...
mloskot's user avatar
  • 103
0 votes
1 answer
694 views

Ubuntu Server 22.04 Autoinstall and Cloud-Init Not Executing Commands

I am trying to set up an Ubuntu Server 22.04 installation using autoinstall and cloud-init. I have two USB keys (I followed this tutorial https://www.jimangel.io/posts/automate-ubuntu-22-04-lts-bare-...
Bastien's user avatar
0 votes
0 answers
76 views

SSH Keys not propagating correctly from instance metadata to authorized_keys: missing keys, user discrepancy, and duplicate key

I want to add eight public keys via instance metadata to avoid adding them manually (i.e.: ssh to VMs, pasting the keys to .ssh/authorized_keys, etc.). I added the keys in Terraform (four distinct ...
SkogensKonung's user avatar
0 votes
1 answer
439 views

Is there a way to pass secrets in cloud-init using Terraform?

Cloud-init has the ability to compliment Terraform in configuring the Virtual Machine it just created. My problem is that cloud-init as uploaded through user-data means that the script especially if ...
Evan Carroll's user avatar
  • 2,089
0 votes
1 answer
235 views

Switching to multi-part cloud-init, getting: SyntaxError: invalid syntax

I used to have user_data = data.template_file.user_data.rendered I changed that to, user_data = data.template_cloudinit_config.master.rendered And I added, data "template_cloudinit_config&...
Evan Carroll's user avatar
  • 2,089
0 votes
1 answer
1k views

Cloud-config in Terraform does not work, nothing seems to happen and it fails silently

I'm currently provisioning a machine with Cloud Config in user_data (I've also tried user_data_base64). When I run my command in Terraform I have, resource "aws_instance" "web" { ...
Evan Carroll's user avatar
  • 2,089
0 votes
1 answer
532 views

How do you a initialize a new volume without a file system or partition table?

I'm using OpenStack and I am trying to provision a compute resource on it. I want that compute resource to attach to a volume. We have three things in play. Volume openstack_blockstorage_volume_v3 ...
Evan Carroll's user avatar
  • 2,089
0 votes
2 answers
1k views

Is there a way to install a private key for a user with cloud-init?

I have a user that needs to authenticate against a company source repository when using git clone. To set this up for the user I need to specify a users private key (not the host private key in /etc). ...
Evan Carroll's user avatar
  • 2,089
0 votes
1 answer
101 views

'[[0;1;31mFAILED[0m] Failed to start' when running cloud-init?

I am trying to contextualize a docker container using cloud-init. Why do I see [[0;1;31mFAILED[0m] Failed to start in the OpenStack log? What is a likely cause of this error?
Henke - Нава́льный П с м's user avatar