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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Yuya.Nishida.
March 15, 2014
Technology
0
60
Useful Chef cookbooks
lChefを使うなら知っておいた方が便利なn個のCookbook
使っていて便利だったCookbookの紹介です.
Yuya.Nishida.
March 15, 2014
Tweet
Share
More Decks by Yuya.Nishida.
See All by Yuya.Nishida.
削除操作 しない させない ゆるさない
nishidayuya
0
41
git cococoとRailsアプリ開発
nishidayuya
0
490
meeting about memo
nishidayuya
0
810
Other Decks in Technology
See All in Technology
開発組織の課題解決を加速するための権限委譲 -する側、される側としての向き合い方-
daitasu
5
580
Security Diaries of an Open Source IAM
ahus1
0
210
IBM Bobを使って、PostgreSQLのToDoアプリをDb2へ変換してみよう/202603_Dojo_Bob
mayumihirano
1
300
GitLab Duo Agent Platform + Local LLMサービングで幸せになりたい
jyoshise
0
280
EMからICへ、二周目人材としてAI全振りのプロダクト開発で見つけた武器
yug1224
5
530
NewSQL_ ストレージ分離と分散合意を用いたスケーラブルアーキテクチャ
hacomono
PRO
1
140
[JAWSDAYS2026]Who is responsible for IAM
mizukibbb
0
380
脳内メモリ、思ったより揮発性だった
koutorino
0
130
AIファーストを前提とした開発スタイルの変化
sbtechnight
0
280
複数クラスタ運用と検索の高度化:ビズリーチにおけるElastic活用事例 / ElasticON Tokyo2026
visional_engineering_and_design
0
130
8万デプロイ
iwamot
PRO
2
230
Evolution of Claude Code & How to use features
oikon48
1
580
Featured
See All Featured
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
310
How to Think Like a Performance Engineer
csswizardry
28
2.5k
Ethics towards AI in product and experience design
skipperchong
2
220
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.2k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.1k
Faster Mobile Websites
deanohume
310
31k
AI: The stuff that nobody shows you
jnunemaker
PRO
3
370
Designing for Performance
lara
611
70k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
82
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
We Are The Robots
honzajavorek
0
190
Design in an AI World
tapps
0
170
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
ご静聴あり がとうござ いました