When loading an Amazon elastic card, reduce the work, can my script use sudo?

I need:

sudo apt-get install rubygems sudo gem install <lots of gems> 

does bootstrap action have access to sudo?

+7
amazon-web-services mapreduce
source share
2 answers

The answer is yes. You can test your bootstrap script as follows:

 elastic_mapreduce --create --alive --ssh 

This will create a node and give you an ssh connection to it, from which you can check your boot script file.

UPDATE: For reference: this is what I run:

 #!/bin/bash sudo apt-get -y -V install irb1.8 libreadline-ruby1.8 libruby libruby1.8 rdoc1.8 ruby ruby1.8 ruby1.8-dev wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.11.zip unzip rubygems-1.8.11.zip cd rubygems-1.8.11 sudo ruby setup.rb sudo gem1.8 install bson bson_ext json tzinfo i18n activesupport --no-rdoc --no-ri 

UPDATE2: to install aws-sdk

 #!/bin/bash # ruby developer packages sudo apt-get -y -V install ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8 sudo apt-get -y -V install libreadline-ruby1.8 libruby1.8 libopenssl-ruby # nokogiri requirements sudo apt-get -y -V install libxslt-dev libxml2-dev wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.11.zip unzip rubygems-1.8.11.zip cd rubygems-1.8.11 sudo ruby setup.rb sudo gem1.8 install aws-sdk --no-rdoc --no-ri 

-y on apt-get doesn't tell you

I wget rubygems because the version you get with apt-get is outdated and some gems will not be created using the old version.

+5
source share

Yup, and here is a list of commands that I ran to install my instance (for all people who google for this question later):

 sudo apt-get update sudo apt-get -y install emacs sudo apt-get -y install rubygems sudo gem install fastercsv --source http://rubygems.org sudo gem install crack --source http://rubygems.org sudo gem install json_pure --source http://rubygems.org exit 
+2
source share

All Articles