AWSでchefをインストールから実行_gitへ登録 - HarukiMuramoto/ohayou GitHub Wiki
sudo cp /usr/share/zoneinfo/Japan /etc/localtime
sudo yum update -y
curl -L http://www.opscode.com/chef/install.sh | sudo bash
sudo /opt/chef/embedded/bin/gem install knife-solo --no-ri --no-rdoc
mv /home/ec2-user/<秘密鍵> ~/.ssh/
knife solo prepare ec2-user@localhost -i ~/.ssh/<秘密鍵>
knife solo init chef-repo
ssh-keygen -t rsa -C "github登録時のメールアドレス"
ssh-agent -s ssh-add ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub
ssh -T [email protected]
sudo yum install git
1.git config --global user.name "<名前>" 2.git config --global user.email "<登録メールアドレス>" 3.git config --global github.user "<登録アカウント>"
curl -u '<登録アカウント>' -d '{"scopes":["repo"],"note":"Help example"}' https://api.github.com/authorizations git config --global github.token ""
cd chef-repo/ git init git add . git commit -m "first commit" git remote add origin https://github.com/<アカウント>/<レポジトリ>.git git push -u origin master
knife cookbook create ohayou -o site-cookbooks
vi site-cookbooks/ohayou/recipes/default.rb
vi chef-repo/nodes/localhost.json
sudo knife solo cook ec2-user@localhost -i ~/.ssh/<秘密鍵>