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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Yuya.Nishida.
March 15, 2014
Technology
65
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
52
git cococoとRailsアプリ開発
nishidayuya
0
510
meeting about memo
nishidayuya
0
820
Other Decks in Technology
See All in Technology
20260912_スクフェス三河
kgnkhkr
0
380
Railsのように考える: See through the Master
snoozer05
PRO
3
880
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
3
510
TinyGo 開発サイクルを高速化する:Go で作るエミュレータ入門
zozotech
PRO
1
740
白金鉱業Meetup Vol.25 アウトカムが二値のデータに対するCausal Impact
brainpadpr
0
210
Spring BootからQuarkusへの移行
tatsuya1bm
2
120
俺の仕事は AIに奪われないし、たぶんその BIも要らない
hikaruri
0
490
HHKBエバンジェリストになる方法
941
0
110
AI時代の「技術的負債」の変質ー概念の終焉と再解釈、エージェントと共に向かう先
nwiizo
0
2.6k
新機種発売前に見直そう!端末移行で再ログインが要るアプリ・要らないアプリは何が違うのか 〜シームレスに再開できる設計と実装〜
zozotech
PRO
0
200
AIによるクリエイティブ生成を行う上での試行錯誤
plaidtech
PRO
0
150
GoにおけるFFIのこれまでとこれから
goccy
5
3.5k
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
230
Game over? The fight for quality and originality in the time of robots
wayneb77
1
280
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
280
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
230
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Scaling GitHub
holman
464
140k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
420
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
368
27k
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
ご静聴あり がとうござ いました