Questions tagged [cloud-init]

CloudInit is a set of python scripts and utilities that handles initialization and configuration of cloud instances. It is installed in the Ubuntu Cloud Images and also in the official Ubuntu images available on EC2.

CloudInit is a set of python scripts and utilities that handles initialization and configuration of cloud instances. It is installed in the Ubuntu Cloud Images and also in the official Ubuntu images available on EC2.

387 questions
2
votes
1 answer

fs_setup and container race in GCP

I am using GCP WM Instance with Container Optimized OS to run a container image. I use cloud-init to initialize storage. When I initialize multiple drives, for example several local ssd, then it takes some time and docker container starts before…
Vadym Chekan
  • 4,977
  • 2
  • 31
  • 24
2
votes
1 answer

generate a list of ip in cloud init yaml

I'm trying to generate a ip list from within a yaml cloud init but keep failing. Here is what I'd like to do - path: /etc/hosts owner: root:root permissions: '0644' defer: true append: true content: | %{for i in range(10,19)…
Éric
  • 419
  • 5
  • 17
2
votes
0 answers

Create empty directories with cloud_init

I am trying to configure an user account using one cloud-init yaml file that include a call to write_files module, like this: write_files: #passwd file for vncserver - path: /home/ubuntu/.vnc/passwd owner: ubuntu:ubuntu permissions: '0600' …
Rockcat
  • 3,002
  • 2
  • 14
  • 28
2
votes
1 answer

Running cloud-init twice via Packer & Terraform on VMware Ubuntu 22.04 guest

I would like to create VMs with varying CPU, RAM and network configuration from the same Ubuntu template in ESXi. When $ packer build -var-file=packer/variables.pkr.hcl -var-file=packer/secret.pkrvars.hcl packer/template.pkr.hcl is run, it reads the…
abestic9
  • 491
  • 5
  • 19
2
votes
0 answers

How to check if AWS AMI support cloud-init?

In AWS Console when launching an instance with any image I get "user data" field to fill in optionally to be later executed by cloud-init. However, not all images support cloud-init. How do I check if an AWS image supports cloud-init or not? I can…
2
votes
1 answer

Issues running commands via cloud-init

An open source project I'm working on has components that require Linux and consequently virtualization has generally been the best solution for development and testing new features. I'm attempting to provide a simple cloud-init file for Multipass…
zephyrmoth
  • 25
  • 1
  • 4
2
votes
1 answer

Using valid YAML in cloud-init to run commands that add text to file

Using cloud-init, how can I run add text (list of strings) to a file? Also, do I need to escape the colon : character? It seems that that problem is YAML validation but could not find any examples to help me out. Here is what I've tried. None of the…
Morariu
  • 334
  • 2
  • 18
2
votes
1 answer

Error in Running a Bash Script in terraform user_data

I am using Terraform to deploy EC2 instance and install boostacks wiki on it. Bookstack offers a bash script that automatically installs the files on the ubuntu server however, when i run the script in the user_data nothing happens. I am not sure…
2
votes
1 answer

Cloud-init only creating default user

Very new to cloud-init but from what I can tell from the docs and examples I should be able to add a new user, add it to sudo and have it create a home directory but my user is never made and I/m not finding any errors. Here's my config. It's mostly…
TJ Gillis
  • 675
  • 2
  • 6
  • 20
2
votes
1 answer

Showing progress of scp during cloud-init process

When I spin up a new server I use a cloud-init script to automate the process. I follow progress of this process with: $ tail -f /var/log/cloud-init-output.log When it comes to fetching a backup file using scp and piping it through tar -zx I tried…
drmrbrewer
  • 11,491
  • 21
  • 85
  • 181
2
votes
0 answers

Cloud-init doesn't run as first boot for instance launched from an AMI created from another instance

We configure AWS EC2 instances (ubuntu-20) with cloud-init using user-data scripts. We're noticing the user-data scripts don't execute if they are run on instance which is launched from a custom AMI created from another launched instance. We create…
2
votes
2 answers

run GO111MODULE=on go install . ./cmd/... in cloud init

I have a bash script which is deployed with cloud init, my bash script contains the following part of code GO111MODULE=on go install . ./cmd/... when running my bash script directly in the terminal of the deplyed server, it works as expected. But…
iFadi
  • 915
  • 2
  • 12
  • 20
2
votes
2 answers

Azure cloud-init: Failed to install packages

I have a simple cloud-init file: #cloud-config package_upgrade: true packages: - symlinks - wget - rsync - git but it is failing for my Azure (log provided at the end). This is the first time that I'm using cloud-init and on Azure. What…
xpt
  • 20,363
  • 37
  • 127
  • 216
2
votes
0 answers

How to pass sensitive metadata to instance?

I want to launch a VM instance on openstack which will then download some files from a secure server. The credentials of the secure server are dynamic and depend on the user launching the instance. I want the user to be able to pass the credentials…
user3477889
  • 151
  • 7
2
votes
1 answer

Can Cloudinit be used to automate complex configuration such as UFW and Apache

Cloudinit can handle basic configuration like creating users and groups, installing packages, mount storage points, and more (see Cloud Config Examples). But can it handle more complex tasks like the below, and if so, how? A minimal working example…