Chef cheat sheet: Difference between revisions

From misc notes
Jump to navigation Jump to search
Line 36: Line 36:
knife bootstrap IPADDRESS -N node01.egrep.jp -i ~/.ssh/ssh_key.pem -x ubuntu --sudo
knife bootstrap IPADDRESS -N node01.egrep.jp -i ~/.ssh/ssh_key.pem -x ubuntu --sudo
</pre>
</pre>
[http://wiki.opscode.com/display/chef/Custom+Knife+Bootstrap+Script Custom Knife Bootstrap Script]
Bootstrap => Configuration => Orchestration の区別をして考える事が大事

Revision as of 14:34, 29 May 2012

メモ

  • knife-ec2

knife.rb

# EC2:                                                                                                                      
knife[:aws_access_key_id]     = "---"
knife[:aws_secret_access_key] = "---"
knife[:flavor]                = "t1.micro"
knife[:image]                 = "ami-0baf7662"
knife[:aws_ssh_key_id]        = "EC2_Key_Pairs_Name"

ssh-agent

eval `ssh-agent`
ssh-add ~/.ssh/ssh_key.pem

(残っている ssh-agent への attach)

export SSH_AGENT_PID=`pgrep ssh-agent`
export SSH_AUTH_SOCK=`ls /tmp/ssh-*/agent.*`
knife ec2 server create -N node01.egrep.jp -x ubuntu
knife ec2 server create -N node01.egrep.jp -x ubuntu -r "role[node01],role[ec2-base]"
  • knife bootstrap
knife bootstrap IPADDRESS -N node01.egrep.jp -i ~/.ssh/ssh_key.pem -x ubuntu --sudo
Custom Knife Bootstrap Script

Bootstrap => Configuration => Orchestration の区別をして考える事が大事