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
200
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
240
openstack-chef-repo
jedipunkz
1
97
Other Decks in Technology
See All in Technology
開発生産性を上げながらビジネスも30倍成長させてきたチームの姿
kamina_zzz
1
270
【若手エンジニア応援LT会】ソフトウェアを学んできた私がインフラエンジニアを目指した理由
kazushi_ohata
0
110
Terraform Stacks入門 #HashiTalks
msato
0
300
メールサーバ管理者のみ知る話
hinono
1
110
Can We Measure Developer Productivity?
ewolff
1
110
Terraform未経験の御様に対してどの ように導⼊を進めていったか
tkikuchi
2
350
2024年グライダー曲技世界選手権参加報告/2024 WGAC report
jscseminar
0
250
AIチャットボット開発への生成AI活用
ryomrt
0
150
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
3.8k
Platform Engineering for Software Developers and Architects
syntasso
1
280
障害対応指揮の意思決定と情報共有における価値観 / Waroom Meetup #2
arthur1
4
390
形式手法の 10 メートル手前 #kernelvm / Kernel VM Study Hokuriku Part 7
ytaka23
5
780
Featured
See All Featured
Optimizing for Happiness
mojombo
376
69k
A Philosophy of Restraint
colly
203
16k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
The Invisible Side of Design
smashingmag
297
50k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
Being A Developer After 40
akosma
86
590k
We Have a Design System, Now What?
morganepeng
50
7.2k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.2k
Building Applications with DynamoDB
mza
90
6.1k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
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ਫ༵