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
3
votes
2 answers

Terraform azurerm vm creation with cloudinit

Trying to create a VM with cloudinit but without any success. Docs on terraform doesnt provide any usefull information how to do it on Azure. Found this post and tried to do the same: Using cloud-init on an Azure VM to mount a data disk fails also…
Nimo
  • 53
  • 2
  • 5
3
votes
1 answer

Using cloud-init on an Azure VM to mount a data disk fails

This is a similar problem to a previous SO question, from which I adapted my code How can i use cloud-init to load a datadisk on an ubuntu VM in azure Using a cloud-config file passed through Terraform: #cloud-config disk_setup: …
José Maia
  • 310
  • 5
  • 21
3
votes
1 answer

Why does running cloud-init script on EC2 change my shell?

Calling all cloud-init and EC2 gurus... I can't figure this out. I'm using a cloud-init script to bootstrap an EC2 aws-ami instance (through AWS CloudFormation) and when I include the write_files property it changes the command prompt on the…
3
votes
1 answer

Userdata script not executed on AWS CloudFormation Template

I am trying to create a CloudFormation stack which has UserData script to install java, tomcat, httpd and java application on launch of an EC2 instance. However, the stack gets created successfully with all the resources but when I connect to EC2…
3
votes
1 answer

Install debian package using cloud-init

I'm trying to install netcat using cloud-init. As soon as I SSH'd to my vm, with all my keys configured correctly via cloud-init (meaning, it's executing), I try to run netcat and it doesn't work; I'm using Container-Optimized OS (cos) as they refer…
James
  • 3,580
  • 3
  • 25
  • 36
3
votes
1 answer

cloud-init cc_mounts.py ignores AWS EFS mounts

I am deploying an Amazon Linux AMI to EC2, and have the following directive in my user_data: packages: - amazon-efs-utils mounts: - [ "fs-12345678:/", "/mnt/efs", "efs", "tls", "0", "0" ] I am expecting this to add the appropriate line to my…
3
votes
0 answers

Get HOSTNAME from a file in cloud-init

I've the following file in my cloud-init write_files: - path: /opt/data/conf.conf owner: root:root permissions: '0755' content: | [default] host = $HOSTNAME I need to interpolate properly the variable $HOSTNAME when it is executed in…
Mazzy
  • 13,354
  • 43
  • 126
  • 207
3
votes
1 answer

How can I initialize an instance with cloud-init on Terraform

I am trying to initialize AWS instances using cloud-init, I test with terraform code: variable "hostname" {} variable "domain_name" {} variable "filename" { default = "cloud-config.cfg" } data "template_file" "test" { template =…
Asier Gomez
  • 6,034
  • 18
  • 52
  • 105
3
votes
3 answers

Enable EPEL with cloud-init via "User Data" (Amazon Linux)

I'm trying to install the p7zip package after launching an Amazon Linux-based EC2 instance in AWS via the "User Data" feature (using cloud-init): #cloud-config repo_update: true repo_upgrade: all packages: - p7zip However since p7zip isn't…
TC Fox
  • 980
  • 4
  • 13
  • 25
3
votes
2 answers

Run ansible-playbook with a user-data script on an EC2 instance

I am using Packer with Ansible to create an AWS EC2 image (AMI). Ansible is used to install Java 8, install the database (Cassandra), install Ansible and upload an Ansible playbook (I know that I should push the playbook to git and pull it but I…
Ivan Stoyanov
  • 5,412
  • 12
  • 55
  • 71
3
votes
0 answers

Where to place my #cloud-config file to be used by Cloud-init in Ubuntu image

I currently have an currently using openstack and I want to spin an instance using an Ubuntu 14.04 image. the image contains a bash script file at root named post-script.sh I have proceeded to create a cloud-config named my-cloudinit.txt which…
3
votes
4 answers

How to install aws-cfn-bootstrap/cfn-init package in Redhat using CloudFormation?

I am trying to launch a instance with CloudFormation Template. Instance was started but the UserData section was not executed completely because cfn-init/aws-cfn-bootstrap package was not installed in Redhat 7 AMI. I tried installing…
Gangaraju
  • 4,406
  • 9
  • 45
  • 77
3
votes
0 answers

How do I make things (e.g. tomcat) run after cloud-init has run the userdata script?

Short version: How do I make init.d scripts run after cloud-init has run the userdata script on an EC2? Long version: Our deployment process is to construct AMIs with everything installed on them (tomcat, nginx, application etc), but with certain…
SamBarham
  • 41
  • 4
3
votes
0 answers

x-shellscript file from inside MIME multipart not executing during cloud-init

I'm running an Ubuntu 12.04 machine in a very EC2-like environment (Open Stack euca2ools environment). Basically I launch my instances and give it a GZIPed multipart file as documented here is possible. Here's code for how I convert to multipart…
lollercoaster
  • 15,969
  • 35
  • 115
  • 173
2
votes
0 answers

How do I install a specific Ubuntu kernel during offline autoinstall?

I'm autoinstall-ing Ubuntu Server 20.04 with no network connection. I install a specific kernel, which I currently do in a postinstall script but it would be better if it was done in the base install. Here is my /nocloud/user-data, which updates the…
Wezzoid
  • 21
  • 2