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
1
vote
1 answer

Receiving 502 bad gateway when deploying WordPress using Cloud Init on Azure VMSS

Hello I am trying to deploy a WordPress instance to a VM Scale Set on Azure with an Application Gateway using Terraform and a Cloud init. Currently I have come to the conclusion that the issue is a result of how the 'wordpress.conf' and …
Dylan Edmonds
  • 47
  • 1
  • 6
1
vote
0 answers

set ip addres in my guest OS with proxmox use cli

I use guest OS ubuntu 22, proxmox 7.0-8. using the command qm set 302 --ipconfig0 ip=10.10.10.1/28 i expect that addres to change, but it doesn't happen. VM use ip from template vm. In GUI interface in settings VM, in the Cloud-init block ip was…
thesmargl
  • 11
  • 2
1
vote
1 answer

How to execute command in cloud-init

my cloud-init file looks like this I want to append random 1-byte hexa #cloud-config runcmd: - [ sudo, ip, link, set, dev, enp1s0, address, f4:f2:c7:f3:f4:"$(openssl rand -hex 1)" ] no issue if i set static 6 bytes hexa like below - [ sudo, ip,…
hghew
  • 311
  • 2
  • 4
  • 15
1
vote
1 answer

Logical operators in jinja template

Been pulling my hair out trying to use the "or" logical operator in a cloud-init jinja template. When I use: {% if distro == 'centos' or 'redhat' %} {% set group = 'wheel' %} cloud-init just ignores the directive. If I use separate if statements,…
dj423
  • 13
  • 4
1
vote
0 answers

Not able to run a user-script on some EC2 instances started from an AMI of ubuntu 20.04

I am launching multiple ( more than 100 EC2 instances ) from a previously set AMI. This AMI is made from an Ubuntu 20.04 AMI. Everything that is required for the work is already satisfied in AMI. Now I just want execute an user-script while…
1
vote
1 answer

Cloud-init File skip Github registration

I want to deploy my Github Repository with a terraform and a cloud-init file to aws. Iam doing this whole process with github actions.There they devilered me some commands to enter: #cloud-config runcmd: - curl -o…
crvxッ
  • 60
  • 7
1
vote
1 answer

Adding a new user in Ubuntu using cloud init fails

I'm trying to set up some defaults for several of my Ubuntu machines running the Ubuntu 22.04 server. Here is my config: #cloud-config ssh_pwauth: false groups: - mygrp users: - name: myuser gecos: myuser sudo: ALL=(ALL) NOPASSWD:ALL …
joesan
  • 13,963
  • 27
  • 95
  • 232
1
vote
1 answer

Azure cloud-init: hanging at modules-final stage

I'm experiencing some issues with Azure cloud-init on Ubuntu 20.04 and am looking for some guidance on the next steps for troubleshooting. At the moment, I'm just using a test cloud-init file, testing installing my required packages. This is the…
AndyB
  • 29
  • 7
1
vote
0 answers

Is it possible to configure cloud-init to upload a file from local machine to remote instance while building it?

I am building remote machine using claud-init yaml file (#cloud-config). The Remote machine needs to run PHP app with Postgress database. Everything works but I couldn't find away to upload my postgress latest.dump to the new server via cloud-init…
israelshmueli
  • 11
  • 1
  • 4
1
vote
1 answer

How to run nohup on boot while writing nohup.out to a selected directory

Im going to have to run a nohup command that will run for months and generate tons of logs, so I want to write the nohup.out file to a directory that contains the rest of the code. My simple script to execute on every startup is: sudo su ubuntu cd…
Pedro Gonzalez
  • 95
  • 2
  • 11
1
vote
0 answers

How to pass cloud-init file to vm in gcloud using golang?

I want to pass the yaml file (#cloud-config) to user-data in gcloud vm instance using golang. How can I do that? Metadata: &compute.Metadata{ Items: []*compute.Items{ {Key: porto.String("user-data"), Value: ...userdata.yaml...? }, …
1
vote
3 answers

Cloud-init: Fetch apt key from remote file instead of from a key server

I'm trying to add the InfluxDB (a time-series database) repository using cloud-init. The official documentation states that to install it manually, the public key must first be downloaded with wget (or curl): wget -qO-…
Métoule
  • 13,062
  • 2
  • 56
  • 84
1
vote
0 answers

How to use cloud-init to setup a bash script to be triggered by systemd whenever finishes bootup and about to shutdown?

I'm targeting ubuntu 22.04 I know how to use cloud-init to do simple stuff like runcmd and add user using users in the yaml. I have two scripts that I like to be triggered via systemd before-shutdown-script.sh : this script is to be triggered…
Kim Stacks
  • 10,202
  • 35
  • 151
  • 282
1
vote
1 answer

How to get notified when droplet reboots and when droplet finishes boot?

I found this answer https://stackoverflow.com/a/35456310/80353 and it recommends either API or using user_data which actually is cloud-init underneath. I can think of several ways to possibly get notified that a server is up: detect droplet status…
Kim Stacks
  • 10,202
  • 35
  • 151
  • 282
1
vote
2 answers

How to wait for full cloud-initialization before VM is marked as running

I am currently configuring a virtual machine to work as an agent within Azure (with Ubuntu as image). In which the additional configuration is running through a cloud init file. In which, among others, I have the below 'fix' within bootcmd and…
Revils
  • 1,478
  • 1
  • 14
  • 31