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
190
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
2.9k
Elasticsearch, Fluentd, Kibana 概要とデプロイ方法
jedipunkz
0
230
openstack-chef-repo
jedipunkz
1
91
Other Decks in Technology
See All in Technology
生産性向上チームの紹介
cybozuinsideout
PRO
1
880
Java EE/Jakarta EEの現状と将来―クラウドネイティブ時代にJava EEは対応できるのか?―
takakiyo
1
170
Grafana x PagerDuty Better Together
jacopen
0
130
KubeCon EU 2024 Recap “Kubernetes Policy Time Machine: Where to Next?”
ryysud
0
230
障害対応をちょっとずつよくしていくための 演習の作りかた
heleeen
0
300
Android Target SDK 35 (Android 15) 対応の概要
akkie76
0
100
ゼロから始めるVue.jsコミュニティ貢献 / first-vuejs-community-contribution-link-and-motivation
lmi
1
130
Compose Compiler Metricsを使った実践的なコードレビュー
tomorrowkey
1
220
AOAI をきっかけに 社内の Azure 管理を見直した話
recruitengineers
PRO
1
350
エンジニアのキャリアをちょっと楽しくする3本の軸/Three Pillars to Make an Engineer's Career More Enjoyable
kwappa
0
2.8k
Além do else! Categorizando Pokemóns com Pattern Matching no JavaScript
wmsbill
0
650
Delivering Millions of Messages within seconds @ Duolingo
pelelgrino
0
350
Featured
See All Featured
A designer walks into a library…
pauljervisheath
200
23k
The Brand Is Dead. Long Live the Brand.
mthomps
49
29k
Debugging Ruby Performance
tmm1
70
11k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.1k
The Invisible Side of Design
smashingmag
294
49k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
357
22k
The Cult of Friendly URLs
andyhume
74
5.7k
The Power of CSS Pseudo Elements
geoffreycrofte
60
5k
Robots, Beer and Maslow
schacon
PRO
155
7.9k
Teambox: Starting and Learning
jrom
128
8.4k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
244
20k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
14
1.5k
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ਫ༵