Vagrant + chef-solo + Vagrant provision 経由でパッケージを導入してみる
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
** vagrant provision経由でゲストOSにパッケージ導入 [#x585...
- ホストOS:Windows7、ゲストOS:CentOS 6.4の条件で試してみ...
- windowsコマンドから、chef-solo 叩くもエラーとなってしま...
-- windows側で「Hello」まで出した環境を作成していることが...
*** vagrant-omnibus を導入 [#r17cc53c]
- [[Vagrant公式サイト>http://www.vagrantbox.es/]] からダ...
C:\> vagrant plugin install vagrant-omnibus
C:\> vagrant plugin list
vagrant-login (1.0.1, system)
vagrant-omnibus (1.4.1)
vagrant-share (1.0.1, system)
*** VMの起動やら、やらやら [#zff3a5b8]
- [[Vagrant + chef-solo を導入してみる]] で、"Hello, Chef...
Vagrant.configure("2") do |config|
config.vm.box = "CentOS6.5"
config.vm.box_url = "https://github.com/2creatives/vag...
config.omnibus.chef_version = :latest
config.vm.define :chef1 do |chef1|
chef1.vm.network :forwarded_port, guest: 22, host: 2...
chef1.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--memory", 512]
end
chef1.vm.provision :chef_solo do |chef|
chef.custom_config_path = "Vagrantfile.chef"
chef.cookbooks_path = "./cookbooks"
chef.add_recipe "hello"
end
end
end
- VM を起動する(と、boxにshef-soloがインストールされるの...
C:\Users\hoge\chef-repo> vagrant reload ※または vagran...
-- どきどき
…
Generating chef JSON and uploading...
Running chef-solo...
[2014-05-18T14:04:18+00:00] INFO: Forking chef instance ...
[2014-05-18T14:04:18+00:00] INFO: *** Chef 11.12.4 ***
[2014-05-18T14:04:18+00:00] INFO: Chef-client pid: 1981
[2014-05-18T14:04:25+00:00] INFO: Setting the run_list t...
[2014-05-18T14:04:25+00:00] INFO: Run List is [recipe[he...
[2014-05-18T14:04:25+00:00] INFO: Run List expands to [h...
[2014-05-18T14:04:25+00:00] INFO: Starting Chef Run for ...
[2014-05-18T14:04:25+00:00] INFO: Running start handlers
[2014-05-18T14:04:25+00:00] INFO: Start handlers complete.
[2014-05-18T14:04:25+00:00] INFO: Hello, Chef! ...
[2014-05-18T14:04:25+00:00] INFO: Chef Run complete in 0...
[2014-05-18T14:04:25+00:00] INFO: Running report handlers
[2014-05-18T14:04:25+00:00] INFO: Report handlers complete
- このまま使ってもいいけど、セキュリティ的にあれなので「y...
[chef1] -- /vagrant
The following SSH command responded with a non-zero exit...
Vagrant assumes that this means the command failed!
-- vboxをリビルドしてやる / [[Vagrantでmountエラーで、フ...
[root@localhost vagrant]# /etc/init.d/vboxadd setup
Removing existing VirtualBox non-DKMS kernel modules ...
Building the VirtualBox Guest Additions kernel modules
Building the main Guest Additions module ...
Building the shared folder support module ...
Building the OpenGL support module ...
(Look at /var/log/vboxadd-install.log to find out what w...
Doing non-kernel setup of the Guest Additions ...
- ゲストOS再起動して、/vagrant がマウントされていることを...
-- 蛇足、centos のバージョン確認方法
[root@localhost vagrant]# cat /etc/redhat-release
CentOS release 6.4 (Final)
*** zsh をいれてみる [#q7813266]
- default.rb を編集
C:\Users\hoge\chef-repo\cookbooks\hello\recipes> notepad...
-- 内容をへんしゅう
#
# Cookbook Name:: hello
# Recipe:: default
#
# Copyright 2013, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
log "Hello, Chef!"
package "zsh" do
action :install
end
- provision 実行!
C:\Users\hoge\chef-repo> vagrant provision
==> chef1: Chef 11.12.4 Omnibus package is already insta...
==> chef1: Running provisioner: chef_solo...
Generating chef JSON and uploading...
Running chef-solo...
[2014-05-18T14:16:58+00:00] INFO: Forking chef instance ...
[2014-05-18T14:16:58+00:00] INFO: *** Chef 11.12.4 ***
[2014-05-18T14:16:58+00:00] INFO: Chef-client pid: 2425
[2014-05-18T14:17:05+00:00] INFO: Setting the run_list t...
[2014-05-18T14:17:05+00:00] INFO: Run List is [recipe[he...
[2014-05-18T14:17:05+00:00] INFO: Run List expands to [h...
[2014-05-18T14:17:05+00:00] INFO: Starting Chef Run for ...
[2014-05-18T14:17:05+00:00] INFO: Running start handlers
[2014-05-18T14:17:05+00:00] INFO: Start handlers complete.
[2014-05-18T14:17:05+00:00] INFO: Hello, Chef!
[2014-05-18T14:17:40+00:00] INFO: package[zsh] installin...
[2014-05-18T14:17:52+00:00] INFO: Chef Run complete in 4...
[2014-05-18T14:17:52+00:00] INFO: Running report handlers
[2014-05-18T14:17:52+00:00] INFO: Report handlers complete
*** 参考にさせて頂いたサイト様 [#r86711d4]
- [[VagrantとChef-soloについて学んだいくつかのこと>http:/...
- [[VagrantとChef-soloについて初歩の備忘>http://havelog.a...
- [[Vagrantでknife-solo+Serverspecなboxを作っていた話>ht...
終了行:
** vagrant provision経由でゲストOSにパッケージ導入 [#x585...
- ホストOS:Windows7、ゲストOS:CentOS 6.4の条件で試してみ...
- windowsコマンドから、chef-solo 叩くもエラーとなってしま...
-- windows側で「Hello」まで出した環境を作成していることが...
*** vagrant-omnibus を導入 [#r17cc53c]
- [[Vagrant公式サイト>http://www.vagrantbox.es/]] からダ...
C:\> vagrant plugin install vagrant-omnibus
C:\> vagrant plugin list
vagrant-login (1.0.1, system)
vagrant-omnibus (1.4.1)
vagrant-share (1.0.1, system)
*** VMの起動やら、やらやら [#zff3a5b8]
- [[Vagrant + chef-solo を導入してみる]] で、"Hello, Chef...
Vagrant.configure("2") do |config|
config.vm.box = "CentOS6.5"
config.vm.box_url = "https://github.com/2creatives/vag...
config.omnibus.chef_version = :latest
config.vm.define :chef1 do |chef1|
chef1.vm.network :forwarded_port, guest: 22, host: 2...
chef1.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--memory", 512]
end
chef1.vm.provision :chef_solo do |chef|
chef.custom_config_path = "Vagrantfile.chef"
chef.cookbooks_path = "./cookbooks"
chef.add_recipe "hello"
end
end
end
- VM を起動する(と、boxにshef-soloがインストールされるの...
C:\Users\hoge\chef-repo> vagrant reload ※または vagran...
-- どきどき
…
Generating chef JSON and uploading...
Running chef-solo...
[2014-05-18T14:04:18+00:00] INFO: Forking chef instance ...
[2014-05-18T14:04:18+00:00] INFO: *** Chef 11.12.4 ***
[2014-05-18T14:04:18+00:00] INFO: Chef-client pid: 1981
[2014-05-18T14:04:25+00:00] INFO: Setting the run_list t...
[2014-05-18T14:04:25+00:00] INFO: Run List is [recipe[he...
[2014-05-18T14:04:25+00:00] INFO: Run List expands to [h...
[2014-05-18T14:04:25+00:00] INFO: Starting Chef Run for ...
[2014-05-18T14:04:25+00:00] INFO: Running start handlers
[2014-05-18T14:04:25+00:00] INFO: Start handlers complete.
[2014-05-18T14:04:25+00:00] INFO: Hello, Chef! ...
[2014-05-18T14:04:25+00:00] INFO: Chef Run complete in 0...
[2014-05-18T14:04:25+00:00] INFO: Running report handlers
[2014-05-18T14:04:25+00:00] INFO: Report handlers complete
- このまま使ってもいいけど、セキュリティ的にあれなので「y...
[chef1] -- /vagrant
The following SSH command responded with a non-zero exit...
Vagrant assumes that this means the command failed!
-- vboxをリビルドしてやる / [[Vagrantでmountエラーで、フ...
[root@localhost vagrant]# /etc/init.d/vboxadd setup
Removing existing VirtualBox non-DKMS kernel modules ...
Building the VirtualBox Guest Additions kernel modules
Building the main Guest Additions module ...
Building the shared folder support module ...
Building the OpenGL support module ...
(Look at /var/log/vboxadd-install.log to find out what w...
Doing non-kernel setup of the Guest Additions ...
- ゲストOS再起動して、/vagrant がマウントされていることを...
-- 蛇足、centos のバージョン確認方法
[root@localhost vagrant]# cat /etc/redhat-release
CentOS release 6.4 (Final)
*** zsh をいれてみる [#q7813266]
- default.rb を編集
C:\Users\hoge\chef-repo\cookbooks\hello\recipes> notepad...
-- 内容をへんしゅう
#
# Cookbook Name:: hello
# Recipe:: default
#
# Copyright 2013, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
log "Hello, Chef!"
package "zsh" do
action :install
end
- provision 実行!
C:\Users\hoge\chef-repo> vagrant provision
==> chef1: Chef 11.12.4 Omnibus package is already insta...
==> chef1: Running provisioner: chef_solo...
Generating chef JSON and uploading...
Running chef-solo...
[2014-05-18T14:16:58+00:00] INFO: Forking chef instance ...
[2014-05-18T14:16:58+00:00] INFO: *** Chef 11.12.4 ***
[2014-05-18T14:16:58+00:00] INFO: Chef-client pid: 2425
[2014-05-18T14:17:05+00:00] INFO: Setting the run_list t...
[2014-05-18T14:17:05+00:00] INFO: Run List is [recipe[he...
[2014-05-18T14:17:05+00:00] INFO: Run List expands to [h...
[2014-05-18T14:17:05+00:00] INFO: Starting Chef Run for ...
[2014-05-18T14:17:05+00:00] INFO: Running start handlers
[2014-05-18T14:17:05+00:00] INFO: Start handlers complete.
[2014-05-18T14:17:05+00:00] INFO: Hello, Chef!
[2014-05-18T14:17:40+00:00] INFO: package[zsh] installin...
[2014-05-18T14:17:52+00:00] INFO: Chef Run complete in 4...
[2014-05-18T14:17:52+00:00] INFO: Running report handlers
[2014-05-18T14:17:52+00:00] INFO: Report handlers complete
*** 参考にさせて頂いたサイト様 [#r86711d4]
- [[VagrantとChef-soloについて学んだいくつかのこと>http:/...
- [[VagrantとChef-soloについて初歩の備忘>http://havelog.a...
- [[Vagrantでknife-solo+Serverspecなboxを作っていた話>ht...
ページ名: