- List all IP's and ssh keys
aws --region us-west-2 ec2 describe-instances --query \
'Reservations[].Instances[].[PublicIpAddress,KeyName]'| http://stackoverflow.com/questions/28806585/how-to-migrate-from-one-chef-server-to-another-chef-server | |
| There are multiple steps here and some information is needed from you to better answer your question. | |
| Assumptions | |
| Your nodes are Linux nodes and you are still working in the Chef 11 version. | |
| Your new chef server has all of the cookbooks, roles, data bags and environments moved over from your old chef server. | |
| Steps |
| CMD exec /bin/bash -c "trap : TERM INT; sleep infinity & wait" |
| #! /usr/bin/sudo /bin/bash | |
| set -x | |
| set -e | |
| # https://github.com/berkshelf/berkshelf-api/issues/112 | |
| export LC_CTYPE=en_US.UTF-8 | |
| if [ ! -e /usr/bin/chef-client ]; then | |
| curl -L https://www.opscode.com/chef/install.sh | sudo bash |
| name "stefhen-standalone" | |
| rs_ca_ver 20131202 | |
| short_description "Stefhen Tagging Test" | |
| long_description "Stefhen Tagging Test long" | |
| parameter "security_groups" do | |
| label "security_groups" | |
| type "string" | |
| end |
| "AWS AP-Singapore" "/api/clouds/4" | |
| "AWS AP-Sydney" "/api/clouds/8" | |
| "AWS AP-Tokyo" "/api/clouds/5" | |
| "AWS China-Beijing" "/api/clouds/10" | |
| "AWS EU-Frankfurt" "/api/clouds/9" | |
| "AWS EU-Ireland" "/api/clouds/2" | |
| "AWS SA-São Paulo" "/api/clouds/7" | |
| "AWS US-East" "/api/clouds/1" | |
| "AWS US-Oregon" "/api/clouds/6" | |
| "AWS US-West" "/api/clouds/3" |
| #!/bin/bash | |
| # USAGE: ./create-aws-console-user.sh $GROUPNAME $USERNAME $PASSWORD | |
| # http://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html#id_users_create_cliwpsapi | |
| # Create administrator group | |
| aws iam create-group --group-name $1 |
| include_recipe "machine_tag::default" | |
| # Tag host with seed status | |
| machine_tag "cassandra:seed_host=#{node[:cassandra][:is_seed_host]}" do | |
| action :create | |
| end | |
| # Tag host with broadcast and listen addresses for discovery | |
| machine_tag "cassandra:broadcast_address=#{node[:cassandra][:broadcast_address]}" do | |
| action :create |
aws --region us-west-2 ec2 describe-instances --query \
'Reservations[].Instances[].[PublicIpAddress,KeyName]'| --- | |
| # ^^^ YAML documents must begin with the document separator "---" | |
| # | |
| #### Example docblock, I like to put a descriptive comment at the top of my | |
| #### playbooks. | |
| # | |
| # Overview: Playbook to bootstrap a new host for configuration management. | |
| # Applies to: production | |
| # Description: | |
| # Ensures that a host is configured for management with Ansible. |
| #!/bin/bash | |
| # from build-essential::_debian | |
| sudo apt-get -y install autoconf binutils-doc bison flex gettext ncurses-dev | |
| # utils from build-essential::_debian | |
| sudo apt-get -y install curl vim | |
| kernel=`uname -r` | |
| sudo apt-get -y install linux-image-$kernel |