Cookbookを見てみると、変数に設定してあり、customize.rbで上書きできそうです。
opsworks-cookbooks/default.rb at v339 · aws/opsworks-cookbooks · GitHub
default[:unicorn][:worker_processes] = node[:rails][:max_pool_size] ? node[:rails][:max_pool_size] : 4 default[:unicorn][:backlog] = 1024 default[:unicorn][:timeout] = 60 default[:unicorn][:preload_app] = true default[:unicorn][:version] = '4.7.0' default[:unicorn][:tcp_nodelay] = true default[:unicorn][:tcp_nopush] = false default[:unicorn][:tries] = 5 default[:unicorn][:delay] = 0.5 default[:unicorn][:accept_filter] = "httpready"
以前書いたのと同様にして変更してみます。
手順
1. Custom Chef Cookbooksのリポジトリを作成
すでにプロジェクトのカスタムCookbooksがある場合はそちらに追加していくので個別に作成する必要はありません。
2. unicorn/attributes/customize.rb
こんな感じで作成します。
### # This is the place to override the unicorn cookbook's default attributes. # # Do not edit THIS file directly. Instead, create # "unicorn/attributes/customize.rb" in your cookbook repository and # put the overrides in YOUR customize.rb file. ### # The following shows how to override the Unicorn timout: # #normal[:unicorn][:timeout] = 30 normal[:unicorn][:version] = '4.9.0' # Gemfile.lockと合わせる
versionの値は(通常Railsだと思いますが)Gemfile.lockのunicornバージョンとあわせます。
バージョンが合わないとき … Bundlerでエラーになります
Gemfile側にunicornがないとき … Rails Appのデプロイ時に起動やリロードができません
3. StackにCustom Chef Cookbooksのリポジトリ登録・更新
すでに(ry
4. Update Custom Cookbooks
スタックのRun CommandでカスタムCookbooksを更新します。AppのデプロイだけではカスタムCookbooksは更新されないので注意。
5. Setup
スタックのRun CommandでSetupします。これでシステムRubyのUnicornが再インストールされます。
以上、そんな感じです。