Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Useful Chef cookbooks
Search
Yuya.Nishida.
March 15, 2014
Technology
63
0
Share
Useful Chef cookbooks
lChefを使うなら知っておいた方が便利なn個のCookbook
使っていて便利だったCookbookの紹介です.
Yuya.Nishida.
March 15, 2014
More Decks by Yuya.Nishida.
See All by Yuya.Nishida.
削除操作 しない させない ゆるさない
nishidayuya
0
51
git cococoとRailsアプリ開発
nishidayuya
0
500
meeting about memo
nishidayuya
0
810
Other Decks in Technology
See All in Technology
RedmineをAIで効率的に使う検証
yoshiokacb
0
150
Oracle AI Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
6
1.4k
みんなの考えた最強のデータ基盤アーキテクチャ'26前期〜前夜祭〜ルーキーズ_資料_遠藤な
endonanana
0
460
オライリーイベント登壇資料「鉄リサイクル・産廃業界におけるAI技術実応用のカタチ」
takarasawa_
0
420
Claude Code / Codex / Kiro に AWS 権限を 渡すとき、何を設計すべきか
k_adachi_01
6
1.8k
20260515 ⾃分のアカウントとプライバシーを守る認証と認可の話〜利⽤者向け〜
oidfj
0
750
React Compiler導入から21ヶ月、いま始めるならこうやる
astatsuya
2
270
パーソルキャリア IT/テクノロジー職向け 会社紹介資料|Company Introduction Deck
techtekt
PRO
0
220
Loadbalancing exporter internals
ymotongpoo
1
110
最新技術を"今は選ばない"という技術選定
leveragestech
PRO
0
250
ECSのTerraformモジュールにコントリビュートした話
harukasakihara
0
240
Claude Code で使える DuckDB Skills を試してみた / DuckDB Skills and Claude Code
masahirokawahara
1
850
Featured
See All Featured
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
61
44k
AI: The stuff that nobody shows you
jnunemaker
PRO
7
640
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
250
Art, The Web, and Tiny UX
lynnandtonic
304
21k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
180
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
150
Scaling GitHub
holman
464
140k
How to Ace a Technical Interview
jacobian
281
24k
Why Our Code Smells
bkeepers
PRO
340
58k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
820
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
540
Transcript
Chefを使うなら知っておい た方が便利なn個の Cookbook 西田雄也 松江Ruby会議05 Powered by Rabbit 2.1.2
自己 紹介
仕事はRuby と JavaScript
趣味
Chef とか
Vagrant とか
その辺で 遊んでい ます
Chef使っ ている人
サーバ構 成変更ツ ール
他人の Cookbook
で
楽で きる
他人のふんど^h^h^h Cookbook (程度の差はあるけど)よく作り込まれて いるものが多い. Node Objectに書くだけでインストール・ 設定できる. 追加Resourceが使えるようになる. クロスプラットホームで同じように書け る.Debian系とRedHat系とか
12/33
いく つか
便利な Cookbook の
紹介
database
database 各種RDBMSのためのCookbook データベースの作成 (database Resource) database "redmine_production" do provider Chef::Provider::Database::Postgresql
connection {...} # 接続先ホストとか...省略 owner "redmine" encoding "UTF8" action :create end 17/33
database 各種RDBMSのためのCookbook データベースユーザの作成 (database_user Resource) database_user "redmine" do provider Chef::Provider::Database::PostgresqlUser
connection {...} # 接続先ホストとか...省略 password node["redmine_database_password"] privileges [:select, :update, :insert] action :create end 18/33
rbenv
rbenv やれること rbenvそのもののインストールやruby-buildによ るrubyのインストール rbenv管理下のRubyにgemをインストール ユーザごとにrbenvインストール Chef社が出しているもの じゃない ものが 特に便利
# Berksfile cookbook "rbenv", github: "fnichol/chef-rbenv" 20/33
rbenv 使うRubyのバージョン指定ができるscript Resourceがある. rbenv_script "migrate_rails_database" do rbenv_version "2.1.1" user "redmine"
group "redmine" cwd "/opt/redmine/current" code %{rake RAILS_ENV=production db:migrate} end 21/33
build- essential
build-essential Cのコンパイル環境が必要な場合はこの Cookbook rubyをビルドするとき 拡張ライブラリが入ったgemをインストールする とき その他もろもろ 23/33
build-essential Cのコンパイル環境が必要なCookbookで依 存していることが多いCookbook. gccやmakeが 早い 段階で必要な場合は次 のような指定を行う. # nodes/HOST.json ...
"build_essential": { "compiletime": true }, ... 24/33
gem_binary
gem_binary 他人のCookbookでgemがインストールさ れるときに使うgemコマンドのパスを指定 するのに使ったりする. 通常(使わないとき)はChefが動作時の Rubyが使うgemにインストールされる. debパッケージでChefを入れた場合はパッケージ に同梱されているgemにインストールされる. 自分のCookbookであればrbenv Cookbookのrbenv_gem
Resourceを使え ばいいでしょう. 26/33
gem_binary # Berksfile cookbook "gem_binary", github: "royratcliffe/gem_binary-cookbook" # nodes/HOST.json ...
"gem_binary": "/usr/bin/gem1.9.1", ... 27/33
ロカー ル関連
ロカール関連 ロカール関連Cookbook locale-gen ロカールの生成 locales 設定変更 ロカールがen-USになっているときに ja_JP.UTF-8にするために使用する. 例えばどこかから拾ってきたVagrantのBoxがen- USになっているときとか.
29/33
ロカール関連 # nodes/HOST.json ... "localegen": { "lang": [ "ja_JP.UTF-8 UTF-8"
] }, "locales": { "default": "ja_JP.UTF-8", "available": [ "ja_JP.UTF-8 UTF-8" ] }, ... 30/33
まと め
まとめ 他人のふんど^h^h^hCookbook怖くな い. Serverspecでサーバの振舞いを記述すればよ い. 自前で書いても数ヶ月・数年先には忘れる. README.mdに使い方書いてあるし,なか ったらrecipe/default.rbとかを読めばおk 自分の管理ポリシーに合わせられなかった ら合うように修正してより汎用的にできた
らpull-requestしましょう. 32/33
ご静聴あり がとうござ いました