Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Useful Chef cookbooks
Search
Yuya.Nishida.
March 15, 2014
Technology
67
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Useful Chef cookbooks
lChefを使うなら知っておいた方が便利なn個のCookbook
使っていて便利だったCookbookの紹介です.
Yuya.Nishida.
March 15, 2014
More Decks by Yuya.Nishida.
See All by Yuya.Nishida.
削除操作 しない させない ゆるさない
nishidayuya
0
54
git cococoとRailsアプリ開発
nishidayuya
0
510
meeting about memo
nishidayuya
0
820
Other Decks in Technology
See All in Technology
The seven pitfalls of AI (revised version)
ufried
0
270
freeeらしさをAIとともに作る / Creating the freee Experience with AI
ymrl
0
200
[2026 Oracle Technical Deep Dive] AI時代のアプリケーションを支えるCloud NativeとJava EEモダナイゼーション (2026年9月17日開催)
oracle4engineer
PRO
0
120
[2026 Oracle Technical Deep Dive] オンプレミスDBのCloud移行アプローチ:移行計画に基づくメソッドとツールの選択 (2026年9月17日開催)
oracle4engineer
PRO
0
150
[2026 Oracle Technical Deep Dive] VMwareワークロードのOCI移行実践ガイド - OCVSでの継続利用からOCIコンピュートへの移行まで (2026年9月17日開催)
oracle4engineer
PRO
0
120
Kernel testing frameworks
ennael
PRO
0
110
Codex概要
ymiya55
0
420
SDDの運用にめげずに向き合った話
sansantech
PRO
1
130
AIに攻撃される前に、AIに攻撃させる
tsuchikazu
0
150
Futexes the good, the bad, the ugly
ennael
PRO
0
130
カンファレンスに参加した後の浮遊感とセルフケア
pauli
0
310
並行性の問題を防げ!実践トランザクション入門
occhi
0
280
Featured
See All Featured
Utilizing Notion as your number one productivity tool
mfonobong
4
610
The Mindset for Success: Future Career Progression
greggifford
PRO
0
530
Statistics for Hackers
jakevdp
799
230k
Speed Design
sergeychernyshev
33
2.1k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
340
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.1k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Accessibility Awareness
sabderemane
1
230
Optimizing for Happiness
mojombo
378
71k
The Invisible Side of Design
smashingmag
301
52k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
New Earth Scene 8
popppiees
4
2.6k
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
ご静聴あり がとうござ いました