cloud-init

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

跟風遠走 提交于 2019-12-02 22:24:56
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 that software on them. To do this, I'm creating AMIs using Packer.io . But some people have instead

How to re-run cloud-init without reboot

烈酒焚心 提交于 2019-12-02 18:06:52
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 achieved ? Any help would be appreciated. benh57 In order for cloud-init to reset, you need to execute

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

女生的网名这么多〃 提交于 2019-11-29 15:49:56
问题 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 aws-cfn-bootstrap package manually but could not install due to the conflicts with python version. Here is the UserData section of CloudFormation Template "UserData": { "Fn::Base64": { "Fn::Join": [ "\n", [ "#!/bin/bash", "set -x", "", "INSTANCE_ID=`/opt/aws/bin

cloud-init: What is the execution order of cloud-config directives?

江枫思渺然 提交于 2019-11-28 18:46:23
What is the order of the directives in the cloud-config section of a cloud-init user-data object. This is important to avoid race type conditions. I know bootcmd runs early and before runcmd, but is there a good list of the order of all the methods? From https://git.launchpad.net/cloud-init/tree/config/cloud.cfg (thanks to garbelini) # The modules that run in the 'init' stage cloud_init_modules: - migrator - ubuntu-init-switch - seed_random - bootcmd - write-files - growpart - resizefs - set_hostname - update_hostname - update_etc_hosts - ca-certs - rsyslog - users-groups - ssh # The modules

How can I (securely) download a private S3 asset onto a new EC2 instance with cloudinit?

℡╲_俬逩灬. 提交于 2019-11-28 05:59:33
I'm using CloudFormation to manage a Tomcat webserver stack but am tired of doing raw AMI management for new application versions. I'd like to move in the direction of Chef but don't have the time right now. Instead, I'm trying to conquer a simple problem in webserver instantiation: How can I download a "current" WAR when new machines spin-up? My thought was to utilize a private S3 bucket and cloudinit, but I'm a little stumped by what to do with IAM credentials. I could put them in the template's user data, but I'm loathe to do so, particularly because I'm version controlling that file. The

How do I set up cloud-init on custom AMIs in AWS? (CentOS)

两盒软妹~` 提交于 2019-11-28 03:29:15
Defining userdata for instances in AWS seems really useful for doing all kinds of bootstrap-type actions. Unfortunately, I have to use a custom CentOS AMI that didn't originate from one of the provided AMIs for PCI reasons, so cloud-init is not already installed and configured. I only really want it to set a hostname and run a small bash script. How do I get it working? whereswalden cloud-init is a very powerful, but very undocumented tool. Even once it's installed, there are lot of modules active by default that overwrite things you may have already defined on your AMI. Here are instructions

cloud-init: What is the execution order of cloud-config directives?

£可爱£侵袭症+ 提交于 2019-11-27 10:34:26
问题 What is the order of the directives in the cloud-config section of a cloud-init user-data object. This is important to avoid race type conditions. I know bootcmd runs early and before runcmd, but is there a good list of the order of all the methods? 回答1: From https://git.launchpad.net/cloud-init/tree/config/cloud.cfg (thanks to garbelini) # The modules that run in the 'init' stage cloud_init_modules: - migrator - ubuntu-init-switch - seed_random - bootcmd - write-files - growpart - resizefs -

How can I (securely) download a private S3 asset onto a new EC2 instance with cloudinit?

喜欢而已 提交于 2019-11-27 01:08:31
问题 I'm using CloudFormation to manage a Tomcat webserver stack but am tired of doing raw AMI management for new application versions. I'd like to move in the direction of Chef but don't have the time right now. Instead, I'm trying to conquer a simple problem in webserver instantiation: How can I download a "current" WAR when new machines spin-up? My thought was to utilize a private S3 bucket and cloudinit, but I'm a little stumped by what to do with IAM credentials. I could put them in the

How do I set up cloud-init on custom AMIs in AWS? (CentOS)

旧街凉风 提交于 2019-11-26 22:33:59
问题 Defining userdata for instances in AWS seems really useful for doing all kinds of bootstrap-type actions. Unfortunately, I have to use a custom CentOS AMI that didn't originate from one of the provided AMIs for PCI reasons, so cloud-init is not already installed and configured. I only really want it to set a hostname and run a small bash script. How do I get it working? 回答1: cloud-init is a very powerful, but very undocumented tool. Even once it's installed, there are lot of modules active by

How do I make cloud-init startup scripts run every time my EC2 instance boots?

允我心安 提交于 2019-11-26 07:57:13
问题 I have an EC2 instance running an AMI based on the Amazon Linux AMI. Like all such AMIs, it supports the cloud-init system for running startup scripts based on the User Data passed into every instance. In this particular case, my User Data input happens to be an Include file that sources several other startup scripts: #include http://s3.amazonaws.com/path/to/script/1 http://s3.amazonaws.com/path/to/script/2 The first time I boot my instance, the cloud-init startup script runs correctly.