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
15分で解る Chef
Search
Tomokazu HIRAI
November 18, 2013
Technology
0
210
15分で解る Chef
社内向けに利用した資料。ぎゅっとまとめたら15分で理解出来る内容に。
Tomokazu HIRAI
November 18, 2013
Tweet
Share
More Decks by Tomokazu HIRAI
See All by Tomokazu HIRAI
Using Ceph-Deploy
jedipunkz
1
4.4k
rcbops/chef-cookbooks
jedipunkz
1
3k
Elasticsearch, Fluentd, Kibana 概要とデプロイ方法
jedipunkz
0
250
openstack-chef-repo
jedipunkz
1
100
Other Decks in Technology
See All in Technology
サービスを止めるな! DDoS攻撃へのスマートな備えと最前線の事例
coconala_engineer
1
180
Bill One 開発エンジニア 紹介資料
sansan33
PRO
4
13k
〜『世界中の家族のこころのインフラ』を目指して”次の10年”へ〜 SREが導いたグローバルサービスの信頼性向上戦略とその舞台裏 / Towards the Next Decade: Enhancing Global Service Reliability
kohbis
3
1.5k
AWS CDK 入門ガイド これだけは知っておきたいヒント集
anank
5
750
Introduction to Bill One Development Engineer
sansan33
PRO
0
260
クラウド開発の舞台裏とSRE文化の醸成 / SRE NEXT 2025 Lunch Session
kazeburo
1
590
研究開発部メンバーの働き⽅ / Sansan R&D Profile
sansan33
PRO
3
18k
Data Engineering Study#30 LT資料
tetsuroito
1
190
60以上のプロダクトを持つ組織における開発者体験向上への取り組み - チームAPIとBackstageで構築する組織の可視化基盤 - / sre next 2025 Efforts to Improve Developer Experience in an Organization with Over 60 Products
vtryo
3
1.9k
united airlines ™®️ USA Contact Numbers: Complete 2025 Support Guide
flyunitedhelp
1
470
SREのためのeBPF活用ステップアップガイド
egmc
2
1.3k
マルチプロダクト環境におけるSREの役割 / SRE NEXT 2025 lunch session
sugamasao
1
730
Featured
See All Featured
Optimizing for Happiness
mojombo
379
70k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.5k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
21
1.3k
Writing Fast Ruby
sferik
628
62k
Statistics for Hackers
jakevdp
799
220k
Fireside Chat
paigeccino
37
3.5k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.3k
Building Adaptive Systems
keathley
43
2.7k
YesSQL, Process and Tooling at Scale
rocio
173
14k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.4k
Transcript
1࣌ؒ 15ͰղΔ Chef Tomokazu HIRAI 1310݄2ਫ༵
Chef ͷߏ Chef-Server WorkStation Node ʢ̍ʣ ʢ̎ʣ ʢ̏ʣ (1) :
cookbooks, roles, data_bag, environments ΛΞοϓϩʔυ (2) : node ʹରͯ͠ ‘bootstrap’ ߦ͍σϓϩΠ։࢝ (3) : cookbooks, roles Λμϯϩʔυ͠ chef-client ࣮ߦ, ͦͷޙఆظతʹ࣮ߦ knife Λ͍ૢ࡞ 1310݄2ਫ༵
Chef Server % wget https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/ x86_64/chef-server_11.0.8-1.ubuntu.12.04_amd64.deb % sudo dpkg -i
chef-server_11.0.8-1.ubuntu.12.04_amd64.deb Chef-Server WorkStation Node 1310݄2ਫ༵
WorkStation server% knife configure -i 伴ͷੜ client% mkdir .chef client%
scp <server>:~/thirai.pem .chef/ client% scp <server>:~/chef-validator.pem .chef/ client% vim .chef/knife.rb log_level :info log_location STDOUT node_name 'thirai' client_key '/Users/thirai/chef-repo/.chef/thirai.pem' validation_client_name 'chef-validator' validation_key '/Users/thirai/chef-repo/.chef/chef-validator.pem' chef_server_url 'https://10.200.10.96' syntax_check_cache_path '/Users/thirai/chef-repo/.chef/syntax_check_cache' client% knife node list # knife ίϚϯυ͕ར༻Մೳʹɻ foo01 foo02 ... Chef-Server WorkStation Node 1310݄2ਫ༵
Chef-Repo chef-repo !"" cookbooks # %"" nginx # !"" attributes
# !"" definitions # !"" files # # %"" default # # %"" tests # # %"" minitest # # %"" support # !"" recipes # %"" templates # !"" debian # !"" default # # !"" modules # # %"" plugins # !"" gentoo # %"" ubuntu !"" data_bags !"" environments %"" roles Chef-Server WorkStation Node 1310݄2ਫ༵
Chef Λߏ͢Δཁૉ * Cookbooks * Roles * Environments * Data_bags
1310݄2ਫ༵
Cookbooks * Attributes * Templates * Recipe default['apache']['package'] = "httpd"
default['apache']['pid_file'] = "/var/run/httpd.pid" default['apache']['timeout'] = 300 default['apache']['keepalive'] = "On" 1310݄2ਫ༵
Cookbooks * Attributes * Templates * Recipe PidFile <%= node['apache']['pid_file']
%> Timeout <%= node['apache']['timeout'] %> KeepAlive <%= node['apache']['keepalive'] %> 1310݄2ਫ༵
Cookbooks * Attributes * Templates * Recipe package "apache2" do
package_name node['apache']['package'] end 1310݄2ਫ༵
Cookbooks * Attributes * Templates * Recipe package "apache2" do
package_name node['apache']['package'] end http://docs.opscode.com/resource.html Resources 1310݄2ਫ༵
Roles name "webservers" description "role of web servers" run_list "recipe[apache2]",
"recipe[apache2::mod_fastcgi]" override_attributes "apache2" => { "max_children" => "50" } recipe/default.rb recipe/mod_fastcgi.rb 1310݄2ਫ༵
Environments name "dev" description "The development environment" cookbook_versions "couchdb"
=> "= 11.0.0" override_attributes "apache2" => { "listen_ports" => [ "80", "443" ] } 1310݄2ਫ༵
Data Bags % ${EDITOR} bofh.json { "id": "bofh", "ssh_keys": "ssh-rsa
AAAAB3Nz...yhCw== bofh", "groups": [ "sysadmin", "dba", "devops" ], "uid": 2001, "shell": "\/bin\/bash", "comment": "BOFH", "nagios": { "pager": "
[email protected]
", "email": "
[email protected]
" }, "openid": "bofh.myopenid.com" } % knife data bag create users % knife data bag from file users ./bofh.json 1310݄2ਫ༵