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

Authenticating to S3 from a cloud-init user-data script

Is there a way to configure an S3 bucket/folder/file so that it is not publicly accessible, yet a user-data script can authenticate and obtain access to items in S3?
2
votes
1 answer

OpenStackCLI: Access `--property`'s from cloudinit script

Using the OpenStack CLI, I am creating server instances and need to pass custom properties (--property) into the init script referenced by the --user-data parameter. So, my invocation looks something like this: openstack server create myServer \ …
Jonathan.Brink
  • 23,757
  • 20
  • 73
  • 115
2
votes
2 answers

uninstall, remove or disable cloud-init on centos

I installed cloud-init on centos 6.4 using command yum install cloud-init. But now I want to completely get rid of it, or if it is impossible to at least disable. I looked through internet but failed to find any solution. Could you suggest how the…
Marian
  • 130
  • 1
  • 2
  • 8
2
votes
1 answer

Test running a cloud-init userdata file

A cloud-config userdata file looks great for initialization, but how can you iteratively go about developing and testing it? The feedback delay is just too high if you need to provision instances every time until you get everything right. Assume a…
Andrea Ratto
  • 815
  • 1
  • 11
  • 23
2
votes
2 answers

How to replace /root/.ssh/authorized_keys with cloud-config on EC2?

When deploying a new EC2 instance you have to select an SSH key to give access to the machine. I would like to use only the authorised keys specified in the user data for an instance. Is this possible? I've tried using both…
l0b0
  • 55,365
  • 30
  • 138
  • 223
2
votes
1 answer

How to use "Instance ID" in cloud-config.yml on CoreOS on EC2?

I have CoreOS instances on Amazon EC2. There are some pre-defined variables accessible from cloud-config.yml such as "$private_ipv4" or "$public_ipv4". Is there a way to access "Instance ID" of EC2 instances like "$instance_id"? (I have tried…
ai0307
  • 4,037
  • 2
  • 13
  • 21
2
votes
0 answers

Run a remote script using shebang in Linux

I know to run a remote script, we can use curl -s | python or wget -O - | bash But, instead of specifying the interpreter explicitly, can we run the script using shebang. My use case is, the scripts will be…
Shan
  • 2,141
  • 2
  • 17
  • 32
2
votes
1 answer

cloud-init .yaml script on Digital Ocean droplets

I am stuck with creating users with Cloud-Config. Did anyone succeed and can share a .yaml gist to create a new user with ssh-authorized-keys and ability to sudo?
Erik Ušaj
  • 159
  • 6
2
votes
1 answer

SSH key injection in openstack

During vm creation in openstack, one can specify a keypair name, so that the specified public key get injected to the newly created vm. I would like to know in which state of machine the key injection is done, completely? Given the machine is in…
mhshams
  • 16,384
  • 17
  • 55
  • 65
2
votes
3 answers

Is there anyway to access values from the EC2 tags in cloud-init

I know I can access the tags via the metadata and cli tools, but is there anyway to access them whilst running cloud-init? Ideally I'd like to look for a tag called hostname and use it to set the machine host name. Thanks
SimonH
  • 964
  • 6
  • 17
2
votes
2 answers

How can I write own cloud-config in cloud-init?

cloud-init is powerful to inject user-data in to VM instance, and its existing module provides lots of possibility. While to make it more easy to use, I want to define my own tag like coreos below, see detail in running coreos in…
Larry Cai
  • 55,923
  • 34
  • 110
  • 156
2
votes
1 answer

How to set up variables in multi-part cloud-init userdata scripts?

I want to be able to set a variable in a shell-script - which is part of a multi-part cloud-init userdata configuration setup, and use this variable in a cloud-config script that comes later in the multi-part userdata. Is this possible to do? An…
donatello
  • 5,727
  • 6
  • 32
  • 56
2
votes
1 answer

cloud-init per-boot script on ubuntu ec2-instance

I am trying to start a script with cloud-init on a ubuntu 11.10 ec2 instance. I put the script script.sh in the folder /var/lib/cloud/scripts/per-boot. Content of script.sh is simple: #/!/bin/sh echo "test" After a reboot, I get the following…
jubi4dition
  • 370
  • 1
  • 5
  • 13
1
vote
1 answer

Terraform: Unable to provision more than one file to EC2 via cloud-init

I am trying to provision multiple files via cloudinit_config in Terraform data "cloudinit_config" "userdata" { gzip = true base64_encode = true part { content_type = "text/cloud-config" content = yamlencode({ …
Murad
  • 89
  • 1
  • 9
1
vote
1 answer

Use cloud-init in a bare metal environment

I'm quite new to cloud init. I started documenting few days ago, but all what I found is related to KVM or cloud enviroments, and they does not rapresent my need. I want to use cloud init in an bare metal environment (I'm using centOS). Let's say…