![Page 1: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/1.jpg)
ChefTutorial DocumentationRelease 1.0
Toru Uetani
January 04, 2017
![Page 2: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/2.jpg)
![Page 3: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/3.jpg)
Contents
1 31.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.2 Chef-solo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.3 Github for Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171.4 Chef-solo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2 31
i
![Page 4: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/4.jpg)
ii
![Page 5: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/5.jpg)
ChefTutorial Documentation, Release 1.0
Chef-solo Windows
Warning: Chef Twitter (id:toruuetani)
Sphinx Mercurial / TortoiseHg BitBucket
• https://bitbucket.org/toruuetani/chef-solo-tutorial
Read the Docs
• https://readthedocs.org/projects/chefsoloonwindowstutorial/
• https://chefsoloonwindowstutorial.readthedocs.org/en/latest/
Contents 1
![Page 6: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/6.jpg)
ChefTutorial Documentation, Release 1.0
2 Contents
![Page 7: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/7.jpg)
CHAPTER 1
1.1
Chef / Chef
1.1.1 Server, Client, Node
Chef Server Chef Client Node
Hint: Node Node Client
1.1.2 Cookbook, Recipe
Recipe Node Ruby Recipe Cookbook
3
![Page 8: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/8.jpg)
ChefTutorial Documentation, Release 1.0
1.1.3 Role
Node Role Node Role Role Recipe Role Recipe
4 Chapter 1.
![Page 9: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/9.jpg)
ChefTutorial Documentation, Release 1.0
Role Ruby JSON Ruby (Role Data Formats — Chef Docs )
1 name "webserver"2 description "The base role for systems that serve HTTP traffic"3 run_list "recipe[apache2]", "recipe[apache2::mod_ssl]", "role[monitor]"4 env_run_lists "prod" => ["recipe[apache2]"], "staging" => ["recipe[apache2::staging]"], "_default" => []5 default_attributes "apache2" => { "listen_ports" => [ "80", "443" ] }6 override_attributes "apache2" => { "max_children" => "50" }
1.1.4 Attribute
Attribute Cookbook / Recipe Node Attribute Recipe Attribute Recipe Role Node Attribute
1.1. 5
![Page 10: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/10.jpg)
ChefTutorial Documentation, Release 1.0
1.1.5 Resource
Resource Recipe Resource directory
1 node['apache']['dir'] = '/etc/apache2'2
3 directory node['apache']['dir'] do4 owner 'apache'5 group 'apache'6 action :create7 end
6 Chapter 1.
![Page 11: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/11.jpg)
ChefTutorial Documentation, Release 1.0
Hint: Recipe Resource
1.1.6 run_list
run_list Node Role Recipe
1.1. 7
![Page 12: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/12.jpg)
ChefTutorial Documentation, Release 1.0
1.1.7 Chef Solo
Chef Solo Chef Server Chef
8 Chapter 1.
![Page 13: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/13.jpg)
ChefTutorial Documentation, Release 1.0
Cookbook Node Cookbook Node JSON
1 {2 "resolver": {3 "nameservers": [ "10.0.0.1" ],4 "search":"int.example.com"5 },6 "run_list": [ "recipe[resolver]" ]7 }
Chef Solo
1.2 Chef-solo
Hint: 2013/03/06 Ver.11.4.0
Step2
1.2. Chef-solo 9
![Page 14: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/14.jpg)
ChefTutorial Documentation, Release 1.0
Step 2
chef-client-11.4.0-1.windows.msi
10 Chapter 1.
![Page 15: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/15.jpg)
ChefTutorial Documentation, Release 1.0
1.2. Chef-solo 11
![Page 16: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/16.jpg)
ChefTutorial Documentation, Release 1.0
12 Chapter 1.
![Page 17: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/17.jpg)
ChefTutorial Documentation, Release 1.0
1.2. Chef-solo 13
![Page 18: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/18.jpg)
ChefTutorial Documentation, Release 1.0
14 Chapter 1.
![Page 19: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/19.jpg)
ChefTutorial Documentation, Release 1.0
1.2. Chef-solo 15
![Page 20: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/20.jpg)
ChefTutorial Documentation, Release 1.0
chef-solo --version
16 Chapter 1.
![Page 21: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/21.jpg)
ChefTutorial Documentation, Release 1.0
1.3 Github for Windows
Hint: 2013/03/06 Ver.1.0.38.1
1.
1.3. Github for Windows 17
![Page 22: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/22.jpg)
ChefTutorial Documentation, Release 1.0
2. Set Up Git
3. Download GitHubSetup.exe
18 Chapter 1.
![Page 23: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/23.jpg)
ChefTutorial Documentation, Release 1.0
4.
5. Github
1.3. Github for Windows 19
![Page 24: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/24.jpg)
ChefTutorial Documentation, Release 1.0
6. GitHub LOG IN
7. Git CONTINUE
20 Chapter 1.
![Page 25: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/25.jpg)
ChefTutorial Documentation, Release 1.0
8. SKIP
1.3. Github for Windows 21
![Page 26: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/26.jpg)
ChefTutorial Documentation, Release 1.0
9.
1.4 Chef-solo
Chef-solo chef-solo
22 Chapter 1.
![Page 27: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/27.jpg)
ChefTutorial Documentation, Release 1.0
Chef-solo
1.4.1 Chef
Chef Git
Hint: C:\chef-repo
GitHub for Windows add
1.4. Chef-solo 23
![Page 28: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/28.jpg)
ChefTutorial Documentation, Release 1.0
create
• chef-repo
• chef-solo repository
• C:\chef-repo ( ... C:\ )
24 Chapter 1.
![Page 29: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/29.jpg)
ChefTutorial Documentation, Release 1.0
GitHub for Windows
1.4. Chef-solo 25
![Page 30: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/30.jpg)
ChefTutorial Documentation, Release 1.0
Init
26 Chapter 1.
![Page 31: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/31.jpg)
ChefTutorial Documentation, Release 1.0
1.4.2 solo.rb
Chef-solo C:\chef-repo\solo.rb file_cache_path cookbook_path
1 file_cache_path File.join(Dir.pwd, 'cache')2 cookbook_path File.join(Dir.pwd, 'cookbooks')
Chef-solo Windows
1.4.3 Windows Resource
Windows Resource opscode recipe Cookbook
• opscode-cookbooks/chef_handler · GitHub
• opscode-cookbooks/windows · GitHub
• opscode-cookbooks/powershell · GitHub
1.4. Chef-solo 27
![Page 32: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/32.jpg)
ChefTutorial Documentation, Release 1.0
ZIP chef_handler windows C:\chef-repo\cookbooks
Cookbook / Recipe win_default.json
1 cd C:\chef-repo2 echo >> win_default.json3 notepad.exe win_default.json
win_default.json
1 {2 "run_list" : [3 "recipe[windows]"
28 Chapter 1.
![Page 33: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/33.jpg)
ChefTutorial Documentation, Release 1.0
4 ]5 }
Chef-solo Chef-solo
1 cd C:\chef-repo2 chef-solo -c solo.rb -j win_default.json
Chef
Recipe
1.4. Chef-solo 29
![Page 34: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/34.jpg)
ChefTutorial Documentation, Release 1.0
30 Chapter 1.
![Page 35: ChefTutorial Documentation - Read the Docs · 2019-04-02 · ChefTutorial Documentation, Release 1.0 1.1.3Role NodeRoleNode Role Role Recipe Role Recipe 4 Chapter 1](https://reader035.vdocument.in/reader035/viewer/2022062417/5f0340e47e708231d4084c48/html5/thumbnails/35.jpg)
CHAPTER 2
Chef
• Chef clientWindows -
• chef-soloWindows -
• PuppetChef - Masatomo Nakano Blog
• Chef - Masatomo Nakano Blog
• Rubyist Magazine - Chef ( 1 )
• Rubyist Magazine - Chef ( 2 )
• chef-solo knife-solo -
Read the Docs
• ReadTheDocsSphinx - YAMAGUCHI::weblog
• Read The Docs (Sphinx) - secretbase.log
31