Vagrant + chef-solo を導入してみる
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*** chef-solo って [#q5a483f4]
- プロビジョニングとか、[[プロビジョニングフレームワーク>...
これ導入すると「Linux触れません!構築できません!ドヤッ」...
** Chocolatey の導入 [#w59e95a2]
- [[Chocolatey + VirtualBox + Vagrant を導入してみる]] を...
** 必要なアプリをインストールします。 [#cf45c0e5]
- Ruby, RubyDevkit を導入する。
C:\> cinst ruby1.9
C:\> cinst ruby.devkit.ruby193
-- gem のアップデート
C:\> gem update
C:\> gem install knife-solo
** "Hello, Chef!" [#kd6f75c9]
- 「[[入門chef solo>http://www.amazon.co.jp/%E5%85%A5%E9%...
+ chef-repo 作り、hello のクックブックを作成する
C:\Users\hoge> knife solo init chef-repo
C:\Users\hoge> cd chef-repo
C:\Users\hoge\chef-repo> knife cookbook create hello -o ...
** Creating cookbook hello
** Creating README for cookbook: hello
** Creating CHANGELOG for cookbook: hello
** Creating metadata for cookbook: hello
+ レシピを編集する(C:\Users\hoge\chef-repo\cookbooks\hell...
C:\Users\hoge\chef-repo> notepad cookbooks\hello\recipes...
++ 内容を編集
#
# Cookbook Name:: hello
# Recipe:: default
#
# Copyright 2013, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
log "Hello, Chef!"
+ chef-solo レシピを記述するjsonを用意する、\chef-repo の...
C:\Users\hoge\chef-repo> notepad localhost.json
++ 内容を編集
{
"run_list" : [
"recipe[hello]"
]
}
- 環境変数っぽい定義ファイルを作成しとく
C:\Users\hoge\chef-repo> notepad solo.rb
++ 内容をへんしゅう
# solo.rb
# -*- encoding: utf-8 -*-
file_cache_path File.join(Dir.pwd, 'cache')
cookbook_path File.join(Dir.pwd, 'cookbooks')
- さて実行してみる~
''* log[Hello, Chef!] action write'' が表示されていればok...
C:\Users\hoge\chef-repo> chef-solo -c solo.rb -j localho...
[2014-05-18T22:20:25+09:00] WARN:
* * * * * * * * * * * * * * * * * * * * * * * * * * * * ...
SSL validation of HTTPS requests is disabled. HTTPS conn...
encrypted, but chef is not able to detect forged replies...
attacks.
To fix this issue add an entry like this to your configu...
```
# Verify all HTTPS connections (recommended)
ssl_verify_mode :verify_peer
# OR, Verify only connections to chef-server
verify_api_cert true
```
To check your SSL configuration, or troubleshoot errors,...
`knife ssl check` command like so:
```
knife ssl check -c solo.rb
```
* * * * * * * * * * * * * * * * * * * * * * * * * * * * ...
Starting Chef Client, version 11.12.4
Compiling Cookbooks...
Converging 1 resources
Recipe: hello::default
* log[Hello, Chef!] action write
Running handlers:
Running handlers complete
Chef Client finished, 1/1 resources updated in 9.636251 ...
- [[vagrantのchef soloのprovision中に「SSL validation of ...
-- Vagrantfile の config.vm.provision に追加
Vagrant.configure("2") do |config|
config.vm.provision "chef_solo" do |chef|
chef.custom_config_path = "Vagrantfile.chef" ← ここ
end
end
-- Vagrantfileと同じ場所に「Vagrantfile.chef」というファ...
Chef::Config.ssl_verify_mode = :verify_peer
終了行:
*** chef-solo って [#q5a483f4]
- プロビジョニングとか、[[プロビジョニングフレームワーク>...
これ導入すると「Linux触れません!構築できません!ドヤッ」...
** Chocolatey の導入 [#w59e95a2]
- [[Chocolatey + VirtualBox + Vagrant を導入してみる]] を...
** 必要なアプリをインストールします。 [#cf45c0e5]
- Ruby, RubyDevkit を導入する。
C:\> cinst ruby1.9
C:\> cinst ruby.devkit.ruby193
-- gem のアップデート
C:\> gem update
C:\> gem install knife-solo
** "Hello, Chef!" [#kd6f75c9]
- 「[[入門chef solo>http://www.amazon.co.jp/%E5%85%A5%E9%...
+ chef-repo 作り、hello のクックブックを作成する
C:\Users\hoge> knife solo init chef-repo
C:\Users\hoge> cd chef-repo
C:\Users\hoge\chef-repo> knife cookbook create hello -o ...
** Creating cookbook hello
** Creating README for cookbook: hello
** Creating CHANGELOG for cookbook: hello
** Creating metadata for cookbook: hello
+ レシピを編集する(C:\Users\hoge\chef-repo\cookbooks\hell...
C:\Users\hoge\chef-repo> notepad cookbooks\hello\recipes...
++ 内容を編集
#
# Cookbook Name:: hello
# Recipe:: default
#
# Copyright 2013, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
log "Hello, Chef!"
+ chef-solo レシピを記述するjsonを用意する、\chef-repo の...
C:\Users\hoge\chef-repo> notepad localhost.json
++ 内容を編集
{
"run_list" : [
"recipe[hello]"
]
}
- 環境変数っぽい定義ファイルを作成しとく
C:\Users\hoge\chef-repo> notepad solo.rb
++ 内容をへんしゅう
# solo.rb
# -*- encoding: utf-8 -*-
file_cache_path File.join(Dir.pwd, 'cache')
cookbook_path File.join(Dir.pwd, 'cookbooks')
- さて実行してみる~
''* log[Hello, Chef!] action write'' が表示されていればok...
C:\Users\hoge\chef-repo> chef-solo -c solo.rb -j localho...
[2014-05-18T22:20:25+09:00] WARN:
* * * * * * * * * * * * * * * * * * * * * * * * * * * * ...
SSL validation of HTTPS requests is disabled. HTTPS conn...
encrypted, but chef is not able to detect forged replies...
attacks.
To fix this issue add an entry like this to your configu...
```
# Verify all HTTPS connections (recommended)
ssl_verify_mode :verify_peer
# OR, Verify only connections to chef-server
verify_api_cert true
```
To check your SSL configuration, or troubleshoot errors,...
`knife ssl check` command like so:
```
knife ssl check -c solo.rb
```
* * * * * * * * * * * * * * * * * * * * * * * * * * * * ...
Starting Chef Client, version 11.12.4
Compiling Cookbooks...
Converging 1 resources
Recipe: hello::default
* log[Hello, Chef!] action write
Running handlers:
Running handlers complete
Chef Client finished, 1/1 resources updated in 9.636251 ...
- [[vagrantのchef soloのprovision中に「SSL validation of ...
-- Vagrantfile の config.vm.provision に追加
Vagrant.configure("2") do |config|
config.vm.provision "chef_solo" do |chef|
chef.custom_config_path = "Vagrantfile.chef" ← ここ
end
end
-- Vagrantfileと同じ場所に「Vagrantfile.chef」というファ...
Chef::Config.ssl_verify_mode = :verify_peer
ページ名: