cloud-init

How To Use Cloud Init To mount an unformatted EBS volume

做~自己de王妃 提交于 2019-12-11 09:09:35
问题 Context I am using the https://wiki.jenkins.io/display/JENKINS/Amazon+EC2+Plugin for jenkins which allows me to dynamically provision new cloud instances as build slaves in AWS EC2. I am launching ami-d834aba1 (Amazon Linux 2017.09.1). The plugin supports providing user-data and block device mapping too, currently I provide config like this after reading https://cloudinit.readthedocs.io/en/latest/ User Data #cloud-config repo_update: true repo_upgrade: all package_upgrade: true bootcmd: - [

Not able change the hostname with cloud-init script

孤者浪人 提交于 2019-12-11 04:12:21
问题 I have the following simple script which changes the hostname of Linux VM. #cloud-config hostname: my-host But when launched Amazon Linux AMI with the above script in user-data hostname didn't changed. Can anyone help me about this 来源: https://stackoverflow.com/questions/46253755/not-able-change-the-hostname-with-cloud-init-script

What is the Cloud-Init equivalent for Windows?

心不动则不痛 提交于 2019-12-10 02:30:34
问题 It seems that the stock bootstrapping process is a bit lacking on Windows. Linux has cloud-init which will install packages, store files, and run a bash script from user data. Windows has ec2config but there is currently no support to run a cmd or powershell script when the system is "ready"--meaning that all the initial reboots are completed. There seem to be third party options. For example RightScale has the RightLink agent which performs this function. Are there open source options

cloud-init how to add default user to sudoers.d

ε祈祈猫儿з 提交于 2019-12-09 19:12:22
问题 I boot strap a centos 6.5 AMI with this user data: #cloud-config users: - default - name: my-user - sudo: ALL=(ALL) NOPASSWD:ALL My machine comes up with the user cloud-user as the default user, not my-user. My public key has been copied to the cloud-user. So, in short, it does not work. If I do this, the default user is my-user: #cloud-config user: my-user sudo: ALL=(ALL) NOPASSWD:ALL But I cannot sudo -i with this user. How can I in userdata set my-user to be the default and have sudo

Where to find logs for a cloud-init user-data script?

梦想的初衷 提交于 2019-12-09 14:29:29
问题 I'm initializing spot instances running a derivative of the standard Ubuntu 13.04 AMI by pasting a shell script into the user-data field. This works. The script runs. But it's difficult to debug because I can't figure out where the output of the script is being logged, if anywhere. I've looked in /var/log/cloud-init.log, which seems to contain a bunch of stuff that would be relevant to debugging cloud-init, itself, but nothing about my script. I grepped in /var/log and found nothing. Is there

Using cloud-init user data

回眸只為那壹抹淺笑 提交于 2019-12-05 11:02:01
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, / ] - [ sh, -xc, "echo $(date) ': hello world!'" ] - [ sh, -c, echo "=========hello world'=========" ] - [ touch, /home/ec2-user/hello.txt ] final_message: "The system is finally up, after 10 seconds" I got this example from here and I added the touch command My expectation was to see the data on the /var/log/cloud-init.log. But I don't see it there. Also I

cloud-init how to add default user to sudoers.d

廉价感情. 提交于 2019-12-04 11:59:29
I boot strap a centos 6.5 AMI with this user data: #cloud-config users: - default - name: my-user - sudo: ALL=(ALL) NOPASSWD:ALL My machine comes up with the user cloud-user as the default user, not my-user. My public key has been copied to the cloud-user. So, in short, it does not work. If I do this, the default user is my-user: #cloud-config user: my-user sudo: ALL=(ALL) NOPASSWD:ALL But I cannot sudo -i with this user. How can I in userdata set my-user to be the default and have sudo provileges set? You need to change the default user in system, see configuration below. #cloud-config system

HOWTO deploy a docker container on aws without using elastic beanstalk or ec2 container service

流过昼夜 提交于 2019-12-04 09:39:44
问题 I'd like to use docker containers without having to use elastic beanstalk or ec2 container service. I'd like to upload a .zip file describing the container (like you do with elastic beanstalk) and have a generic ec2 instance run it using docker. When looking into the user data section of a beanstalk-created ec2 instance running a docker container, I see a cloud-init script that downloads a big shell script that does all the setup (Example). I assume that everything that elastic beanstalk does

What to bake into an AWS AMI and what to provision using cloud-init?

不打扰是莪最后的温柔 提交于 2019-12-03 07:28:29
问题 I'm using AWS Cloudformation to setup numerous elements of network infrastructure (VPCs, SecurityGroups, Subnets, Autoscaling groups, etc) for my web application. I want the whole process to be automated. I want click a button and be able to fire up the whole thing. I have successfully created a Cloudformation template that sets up all this network infrastructure. However the EC2 instances are currently launched without any needed software on them. Now I'm trying to figure out how best to get

How to re-run cloud-init without reboot

核能气质少年 提交于 2019-12-03 03:47:20
问题 I am using openstack to create a VM using 'nova boot' command. My image is cloud-init enabled. I pass a --user-data script which is a bash shell format for cloud-init to run during VM boot up time. All this happens successfully. Now my use-case is to re-run cloud-init to execute the same user-data script without rebooting the VM. I saw /usr/bin/cloud-init options and they do talk about running specific modules but nothing is able to make it execute the same user-data script. How can this be