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

Install docker and docker-compose on Azure using cloud-Init

I wanted to bootstrap my Azure VM with Docker and Docker-compose using cloud-init. So far I tried something like below. #cloud-config package_update: true package_upgrade: true groups: - docker: [default] runcmd: - [ sh, -c, "curl -sSL…
SkyRar
  • 1,107
  • 1
  • 20
  • 37
7
votes
1 answer

cloud-init execution order doesn't respect /etc/cloud/cloud.cfg?

This is the content of /etc/cloud/cloud.cfg of Ubuntu cloud 16.04 image: # The top level settings are used as module # and system configuration. # A set of users which may be applied and/or used by various modules # when a 'default' entry is found…
dvnguyen
  • 2,954
  • 17
  • 24
7
votes
5 answers

How do I stop cloud-init from overwriting my hostname on AWS (CentOS)

I have a script that runs at boot (via rc.local) and sets my hostname based on the instance name it queries from the AWS CLI. It works, and at the end of the boot log it says " login:" At figured that cloud-init was overwriting my hostname, so I:…
CAJ
  • 297
  • 1
  • 3
  • 12
7
votes
1 answer

Manually set ssh host keys on server / Digital Ocean Droplet

I want to do the following: Create Digital Ocean droplets from my development machine (to distribute my tests, which are taking too long). Securely issue a commands to the droplet. Destroy the droplet. I'm stuck on #2. I can successfully create…
zachaysan
  • 1,726
  • 16
  • 32
7
votes
3 answers

Is it possible to use variables in cloud-config

When using cloud init's #cloud-config to create configuration files, how would I go about using variables to populate values? In my specific case I'd like to autostart EC2 instances as preconfigured salt minions. Example of salt minion cloud…
charliemurder
  • 343
  • 1
  • 2
  • 12
6
votes
2 answers

Can I run cloud init as a different user than root?

I am trying to run cloud init as a different user than root, because of permissions problem when using git. Is there such a way?
Ezra T
  • 59
  • 1
  • 2
6
votes
2 answers

cloud-init ignoring static IP network configuration

I running the Ubuntu 18.04 cloud image and trying to configure networking through cloud-init. For some reason it is ignoring my networking when I try to assign a static IP and just falls back to using DHCP. I'm not sure why and I'm not sure how to…
Brennan Cheung
  • 4,271
  • 4
  • 30
  • 29
6
votes
1 answer

AWS: Simple cfn-init fails on Amazon Linux 2 for no apparent reason

I am provisioning a cloudformation stack. I am just trying to run the simplest possible cfn-initever on an instance started using a custom ami that was based on Amazon Linux 2: EC2ESMasterNode1: Type: AWS::EC2::Instance Metadata: …
pkaramol
  • 16,451
  • 43
  • 149
  • 324
6
votes
1 answer

Reference "Self" in aws cloudformation template?

I've got an EC2 resource defined in Cloudformation like so: Resources: FooInstance: Type: 'AWS::EC2::Instance' Properties: blah: blah blah: blah UserData: Fn::Base64: !Sub | #!/bin/bash …
Eric
  • 1,953
  • 4
  • 24
  • 33
6
votes
1 answer

How to disable cloud init networking?

I am trying to disable cloud init network configuration. From the cloud init doc, I have to set network-config={config: disabled} in the kernel command line entry. When I set it in /etc/default/grub: GRUB_CMDLINE_LINUX="network-config={config:…
Kintarō
  • 2,947
  • 10
  • 48
  • 75
6
votes
2 answers

Using cloud-init to change resolv.conf

I want my setup of openstack to work such that when I boot a new instance, 8.8.8.8 should be added to dns-nameservers. This is my old /etc/resolv.conf (in the new VM which was spawned in openstack)- nameserver 10.0.0.2 search openstacklocal And…
GAURAV GARG
  • 61
  • 1
  • 1
  • 3
6
votes
1 answer

How to properly use runcmd and scripts-user in cloud-init?

By looking at runcmd code (/usr/lib/python2.6/site-packages/cloudinit/config/cc_runcmd.py) I noticed there's no 'frequency' specified in comparison to other. Beside the only thing that scripts does is to save the scripts given as shells script under…
mastier
  • 872
  • 1
  • 10
  • 22
6
votes
1 answer

Can I run a cloud-init environment without using openstack or EC2?

I have created an environment with several Linux hosts based on KVM. I'm using virt-manager to create different VMs and I'm using Linux bridges to create connectivity between VMs in different hosts. Now, I would like to have an auto-configuration…
garciadeblas
  • 116
  • 1
  • 7
6
votes
1 answer

Using cloud-init user data

I have a simple cloud-init user data that I am passing in to ec2. I set this data on my ec2 instance by right clicking the instance and setting the user data in there. Following is my cloud-init user data #cloud-config runcmd: - [ ls, -l, / ] - […
Izaaz Yunus
  • 2,828
  • 1
  • 19
  • 28
6
votes
4 answers

Cloud-init per-boot script doing nothing

I am new to cloud-init, my final goal is to run an R script each time an EC2 Spot Instance becomes active, but in order to test it I created an on-demand Ubuntu 12.04 instance and created a simple script but nothing happens after reboot. Here are…
JordanBelf
  • 3,208
  • 9
  • 47
  • 80
1 2
3
25 26