Skip to content

Instantly share code, notes, and snippets.

@Twinuma
Last active December 19, 2015 00:29
Show Gist options
  • Save Twinuma/5869049 to your computer and use it in GitHub Desktop.
Save Twinuma/5869049 to your computer and use it in GitHub Desktop.
EC2へChef-Soloインストール/Cookbook作成/Chef-Solo設定2ファイル作成/Recipe作成&編集/Chef-Soloを実行しhttpdインストール
$ curl -L http://www.opscode.com/chef/install.sh | sudo bash
$ knife cookbook create apache -o cookbooks
$ vi solo.rb
file_cache_path "/tmp/chef-solo"
cookbook_path ["/home/ec2-user/cookbooks"]
$ vi localhost.json
{
"run_list" : [
"recipe[apache]"
]
}
$ vi ./cookbooks/apache/recipes/default.rb
#
# Cookbook Name:: apache
# Recipe:: default
#
# Copyright 2013, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
package "httpd" do
action :install
end
$ sudo chef-solo -c solo.rb -j ./localhost.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment