2016-03-21 4 views
0

vagrant-berkshelfプラグインを使用してvagrantボックスをプロビジョニングしようとしています。次のコマンドを実行してberks cookbook vagrancyという新しいコマンドを作成し、Berksfileに希望の料理本を追加します(例:gitrvm)。新しいberksの調理法を作成しました。寄付者の提供が正常に実行され、寄付者のベンダーシェルフの調理本がインストールされていますが、何もインストールされていません。

マイVagrantfile

# -*- mode: ruby -*- 
# vi: set ft=ruby : 

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! 
VAGRANTFILE_API_VERSION = '2' 

Vagrant.require_version '>= 1.5.0' 

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 
    config.vm.hostname = 'vagrancy-berkshelf' 

    if Vagrant.has_plugin?("vagrant-omnibus") 
    config.omnibus.chef_version = 'latest' 
    end 

    config.vm.box = 'bento/centos-6.7' 

    config.vm.network :private_network, type: 'dhcp' 

    config.vm.synced_folder "~/repos", "/repos" 

    config.berkshelf.enabled = true 

    config.vm.provision :chef_solo do |chef| 
    chef.json = { 
     rvm: { 
     user_installs: [{ 
      user: 'vagrant', 
      default_ruby: '2.3.0', 
      global_gems: [{ 
      name: 'bundler' 
      }] 
     }] 
     } 
    } 

    chef.run_list = [ 
     'recipe[vagrancy::default]' 
    ] 
    end 
end 

マイBerksfile

source "https://supermarket.chef.io" 

metadata 

cookbook 'build-essential' 
cookbook 'yum' 
cookbook 'git' 
cookbook 'rvm' 
cookbook 'nodejs' 
cookbook 'python' 

cookbook 'tmux' 
cookbook 'vim' 

出力私はvagrant provisionを実行します。

$ vagrant provision 
==> default: Loading Berkshelf datafile... 
==> default: Sharing cookbooks with VM 
==> default: Updating Vagrant's Berkshelf... 
==> default: Resolving cookbook dependencies... 
==> default: Fetching 'vagrancy' from source at . 
==> default: Using 7-zip (1.0.2) 
==> default: Using ark (1.0.1) 
==> default: Using apt (3.0.0) 
==> default: Using build-essential (2.4.0) 
==> default: Using chef_handler (1.3.0) 
==> default: Using chef_gem (0.1.0) 
==> default: Using dmg (2.3.0) 
==> default: Using git (4.3.7) 
==> default: Using homebrew (2.0.5) 
==> default: Using java (1.39.0) 
==> default: Using nodejs (2.4.4) 
==> default: Using python (1.4.6) 
==> default: Using rvm (0.9.4) 
==> default: Using seven_zip (2.0.0) 
==> default: Using tmux (1.5.0) 
==> default: Using vagrancy (0.1.0) from source at . 
==> default: Using windows (1.39.2) 
==> default: Using vim (2.0.1) 
==> default: Using yum (3.10.0) 
==> default: Using yum-epel (0.6.6) 
==> default: Vendoring 7-zip (1.0.2) to /Users/mueller128/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160321-4742-1l5l6ts-default/7-zip 
==> default: Vendoring apt (3.0.0) to /Users/mueller128/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160321-4742-1l5l6ts-default/apt 
==> default: Vendoring ark (1.0.1) to /Users/mueller128/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160321-4742-1l5l6ts-default/ark 
==> default: Vendoring build-essential (2.4.0) to /Users/mueller128/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160321-4742-1l5l6ts-default/build-essential 
==> default: Vendoring chef_gem (0.1.0) to /Users/mueller128/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160321-4742-1l5l6ts-default/chef_gem 
==> default: Vendoring chef_handler (1.3.0) to /Users/mueller128/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160321-4742-1l5l6ts-default/chef_handler 
==> default: Vendoring dmg (2.3.0) to /Users/mueller128/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160321-4742-1l5l6ts-default/dmg 
==> default: Vendoring git (4.3.7) to /Users/mueller128/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160321-4742-1l5l6ts-default/git 
==> default: Vendoring homebrew (2.0.5) to /Users/mueller128/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160321-4742-1l5l6ts-default/homebrew 
==> default: Vendoring java (1.39.0) to /Users/mueller128/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160321-4742-1l5l6ts-default/java 
==> default: Vendoring nodejs (2.4.4) to /Users/mueller128/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160321-4742-1l5l6ts-default/nodejs 
==> default: Vendoring python (1.4.6) to /Users/mueller128/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160321-4742-1l5l6ts-default/python 
==> default: Vendoring rvm (0.9.4) to /Users/mueller128/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160321-4742-1l5l6ts-default/rvm 
==> default: Vendoring seven_zip (2.0.0) to /Users/mueller128/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160321-4742-1l5l6ts-default/seven_zip 
==> default: Vendoring tmux (1.5.0) to /Users/mueller128/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160321-4742-1l5l6ts-default/tmux 
==> default: Vendoring vagrancy (0.1.0) to /Users/mueller128/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160321-4742-1l5l6ts-default/vagrancy 
==> default: Vendoring vim (2.0.1) to /Users/mueller128/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160321-4742-1l5l6ts-default/vim 
==> default: Vendoring windows (1.39.2) to /Users/mueller128/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160321-4742-1l5l6ts-default/windows 
==> default: Vendoring yum (3.10.0) to /Users/mueller128/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160321-4742-1l5l6ts-default/yum 
==> default: Vendoring yum-epel (0.6.6) to /Users/mueller128/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160321-4742-1l5l6ts-default/yum-epel 
==> default: Running provisioner: chef_solo... 
==> default: Detected Chef (latest) is already installed 
==> default: Generating chef JSON and uploading... 
==> default: Running chef-solo... 
==> default: [2016-03-21T21:27:41+00:00] INFO: Forking chef instance to converge... 
==> default: Starting Chef Client, version 12.9.0 
==> default: [2016-03-21T21:27:41+00:00] INFO: *** Chef 12.9.0 *** 
==> default: [2016-03-21T21:27:41+00:00] INFO: Chef-client pid: 5659 
==> default: [2016-03-21T21:27:42+00:00] INFO: Setting the run_list to ["recipe[vagrancy::default]"] from CLI options 
==> default: [2016-03-21T21:27:42+00:00] INFO: Run List is [recipe[vagrancy::default]] 
==> default: [2016-03-21T21:27:42+00:00] INFO: Run List expands to [vagrancy::default] 
==> default: [2016-03-21T21:27:42+00:00] INFO: Starting Chef Run for vagrant-9a1b8405 
==> default: [2016-03-21T21:27:42+00:00] INFO: Running start handlers 
==> default: [2016-03-21T21:27:42+00:00] INFO: Start handlers complete. 
==> default: Installing Cookbook Gems: 
==> default: Compiling Cookbooks... 
==> default: Converging 0 resources 
==> default: [2016-03-21T21:27:43+00:00] INFO: Chef Run complete in 0.924325387 seconds 
==> default: [2016-03-21T21:27:43+00:00] INFO: Skipping removal of unused files from the cache 
==> default: 
==> default: Running handlers: 
==> default: [2016-03-21T21:27:43+00:00] INFO: Running report handlers 
==> default: Running handlers complete 
==> default: 
==> default: [2016-03-21T21:27:43+00:00] INFO: Report handlers complete 
==> default: Chef Client finished, 0/0 resources updated in 02 seconds 

しかし、私はを実行するとと入力してgitと入力すると、コマンドが見つからないと表示されます。

ありがとうございました。

答えて

1

berkshelfを使用して調理台をマシンに同期させている間に、実際に実行している唯一のレシピはrecipe[vagrancy::default]です。シェフの出力(Converging 0 resources)には、実際に何もしていないことがわかります。その1つのレシピをinclude_recipeに指定するか、ノードの実行リストにさらに追加するかのどちらかです。

+0

はい、私は最終的にBerkshelfが料理本を売って実際にそれらをインストールしていないことを理解しました。シェフの実行リスト(調理法のメタファーではない)にレシピを追加することで、バグのボックスをプロビジョニングするときにgitのようなCookbookがインストールされます。 –