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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Tomokazu HIRAI
November 18, 2013
Technology
0
220
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.5k
rcbops/chef-cookbooks
jedipunkz
1
3k
Elasticsearch, Fluentd, Kibana 概要とデプロイ方法
jedipunkz
0
260
openstack-chef-repo
jedipunkz
1
110
Other Decks in Technology
See All in Technology
How to install a gem
indirect
0
1.6k
脳が溶けた話 / Melted Brain
keisuke69
1
1.1k
QA組織のAI戦略とAIテスト設計システムAITASの実践
sansantech
PRO
1
160
テストプロセスにおけるAI活用 :人間とAIの共存
hacomono
PRO
0
170
20260323_データ分析基盤でGeminiを使う話
1210yuichi0
0
180
スピンアウト講座01_GitHub管理
overflowinc
0
1.5k
Why we keep our community?
kawaguti
PRO
0
280
VSCode中心だった自分がターミナル沼に入門した話
sanogemaru
0
730
SSoT(Single Source of Truth)で「壊して再生」する設計
kawauso
2
350
AWS Systems Managerのハイブリッドアクティベーションを使用したガバメントクラウド環境の統合管理
toru_kubota
0
160
「捨てる」を設計する
kubell_hr
0
280
Phase07_実務適用
overflowinc
0
2k
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.2k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
150
Being A Developer After 40
akosma
91
590k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Raft: Consensus for Rubyists
vanstee
141
7.4k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
150
KATA
mclloyd
PRO
35
15k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
250
Measuring & Analyzing Core Web Vitals
bluesmoon
9
790
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
330
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ਫ༵