Questions tagged [cloud-init]
131 questions
2
votes
1 answer
How to run cloud init modules multiple times, e.g. runcmd, write_files, runcmd
I am using cloud-init to build an Ubuntu 16.04 LTS VM on Azure. The server I want to build will run software installed from a custom repository.
I use the runcmd directive to add the repository, update the apt database and install the package and…

jamiecon
- 163
- 1
- 6
2
votes
3 answers
cloud-init can't set up ipv6
I've bought a Public Cloud VPS from OVH and trying to set up ipv6.
Also I've found a tutorial on how to set up ipv6 in their documentation. It works until I reboot the VPS.
In this tutorial they want me to update this file…

kironet
- 121
- 1
- 6
2
votes
1 answer
run cloud-init disk_setup module on every boot
I have an ec2 instance with an ephemeral disk. This instance goes down every night and boots up when needed. I used cloud-init to format the ephemeral disk and this works correct but only once.
when this machine is stopped and started (and the…

kashian
- 31
- 1
- 8
2
votes
2 answers
Cloud-init not finding metadata server (Openstack)
I am trying to understand why my server is failing to connect to the metadata server (and thus not able to log in with the SSH key).
Similar problems online seem to be caused by Security Group problems, that I am confident is not the problem…

Mark Perryman
- 21
- 1
- 1
- 5
2
votes
1 answer
How to execute some commands before the user scripts in cloud-init
I'm trying to run some scripts and config using a multipart config.
Content-Type: multipart/mixed; boundary="MIMEBOUNDARY"
MIME-Version: 1.0
--MIMEBOUNDARY
Content-Disposition: attachment; filename="cloud-config.cfg"
Content-Transfer-Encoding:…

blackjid
- 151
- 1
- 5
2
votes
0 answers
Is there any way to run cloud-init on a Redhat 5 instance in AWS?
Redhat 6 includes cloud-init hooks, which means in AWS you can install cfn-init and use CloudFormation.
Redhat 5 doesn't appear to have cloud-init. Is there any way to get this working?

chris
- 3,993
- 6
- 28
- 37
2
votes
2 answers
How to configure SSH host keys in cloudformation template?
I'm trying to configure an EC2 with known SSH host keys on boot using cloud-init in a cloudformation template. But now I can't SSH into the server. It's tricky to debug :-)
Here's the userdata part of my EC2 fragment from my template:
"UserData"…

Dave
- 21
- 1
- 3
2
votes
2 answers
AWS Custom AMI not running userdata script
We bake AMI's and lately I have wanted to run some user-data scripts to notify cloud formation when the instance is done booting and put it into service. I am using cfn-signal to do this. On the original ubuntu image the script will execute but…

jjhughes57
- 21
- 1
- 3
2
votes
1 answer
Ubuntu 12.04 cloud-init doesn't support "write_files", what to do?
I'm using cloud-init to setup Ubuntu VMs on EC2. I've recently had need to support deployment using Ubuntu 12.04 (old LTS) images, but the old cloud-init 0.6.3 that is in Ubuntu 12.04 doesn't support the write_files module that I need.
I'm currently…

Guss
- 2,670
- 5
- 34
- 59
2
votes
1 answer
Hostname via Cloud-Init on CentOS running on EC2 do not work
I setup the cloud-config on the user-data for a CentOS 6.4's EC2 instance, and it looks like do not apply.
#cloud-config
manage_etc_hosts: true
preserve_hostname: false
hostname: myserver01.example.com
On the cloud-init logs I…

PMG
- 23
- 1
- 5
2
votes
1 answer
In Amazon EC2, what's the best way to clone a private github repository on boot?
I need to configure an autoscale group of EC2 instances that on boot will clone a particular branch and commit from a private github repository, then execute code from inside that repository.
I'm using an Ubuntu-derived AMI that has the cloud-init…

leted
- 21
- 1
- 2
2
votes
1 answer
cloud-init ignores staitc networking configuration
I am performing these steps on Ubuntu 22.04 host:
Download the cloud image
qemu-img create -b ../jammy-server-cloudimg-amd64.img -f qcow2 -F qcow2 myubuntu2204test01-base.img 10G
Create the file meta-data in the directory…
2
votes
1 answer
Cloud-init for ubuntu-20.04-server-cloudimg works but not ubuntu-20.04-minimal-cloudimg-amd64
So I'm trying to use cloud-init with minimal image ( https://cloud-images.ubuntu.com/minimal/releases/focal/release/ubuntu-20.04-minimal-cloudimg-amd64.img ) but it does not seem to work at all. The exact same procedure works with the server image (…

Andrew
- 21
- 2
2
votes
1 answer
Escape characters in systemd ExecStart fail
I have the following snippet to extract a value from a jenkins server jnlp config file. It works out of the box in the terminal but not as a unit. I want a unit so I can put the value somewhere and use it as an environment variable. However I keep…

eignhpants
- 129
- 2
- 7
2
votes
0 answers
How to use cloud config in pxe boot?
I am using netbootxyz in order to boot my Ubuntu environments. In matter of the facts, is that I am using pre-seed configuration. The problem is that there are some minor bugs:
gnome-terminal is not working.
can not use post commands at all.
Could…

Nikolay Kostov
- 21
- 1