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
開発生産性を組織全体の「生産性」へ! 部門間連携の壁を越える実践的ステップ
sudo5in5k
2
7k
高速なプロダクト開発を実現、創業期から掲げるエンタープライズアーキテクチャ
kawauso
2
9.2k
ビズリーチが挑む メトリクスを活用した技術的負債の解消 / dev-productivity-con2025
visional_engineering_and_design
3
7.5k
さくらのIaaS基盤のモニタリングとOpenTelemetry/OSC Hokkaido 2025
fujiwara3
3
440
マネジメントって難しい、けどおもしろい / Management is tough, but fun! #em_findy
ar_tama
7
1.1k
Zephyr RTOSを使った開発コンペに参加した件
iotengineer22
1
220
品質と速度の両立:生成AI時代の品質保証アプローチ
odasho
1
340
CRE Camp #1 エンジニアリングを民主化するCREチームでありたい話
mntsq
1
120
AI時代の開発生産性を加速させるアーキテクチャ設計
plaidtech
PRO
3
150
SEQUENCE object comparison - db tech showcase 2025 LT2
nori_shinoda
0
140
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
27k
生成AI時代の開発組織・技術・プロセス 〜 ログラスの挑戦と考察 〜
itohiro73
1
460
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
RailsConf 2023
tenderlove
30
1.1k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
138
34k
What's in a price? How to price your products and services
michaelherold
246
12k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.9k
A better future with KSS
kneath
238
17k
Practical Orchestrator
shlominoach
189
11k
The Language of Interfaces
destraynor
158
25k
The Cult of Friendly URLs
andyhume
79
6.5k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
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ਫ༵