1

私はシェフに非常に慣れていないので、次のエラーを理解できません:

$ kitchen create
-----> Starting Kitchen (v1.4.2)
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::UserError
>>>>>> Message: Error parsing /home/ashishk/motd/.kitchen.yml as YAML.
Please run `kitchen diagnose --no-instances --loader' to help debug your issue.
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

私の .kitchen.yml ファイルは次のようになります。

$ cat .kitchen.yml
---
driver:
  name: vagrant
    provisioner:
#  name: policyfile_zero
  name: chef_zero
platforms:
  - name: ubuntu-14.04
#  - name: centos-7.1
driver:
      customize:
        memory: 256

suites:
  - name: default
        run_list:
                - recipe[motd::default]
    attributes:

私はドキュメントに従っています[ https://learn.chef.io/local-development/ubuntu/get-started-with-test-kitchen/][1]

ここで何が間違っているのか教えてください!

Vagrant をインストールすると、次のエラーが発生します。

 VirtualBox is complaining that the installation is incomplete. Please
       run `VBoxManage --version` to see the error message which should contain
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: Failed to complete #create action: [Expected process to exit with [0], but received '1'
---- Begin output of vagrant up --no-provision --provider virtualbox ----
STDOUT:
STDERR: The provider 'virtualbox' that was requested to back the machine
'default' is reporting that it isn't usable on this system. The
reason is shown below:

VirtualBox is complaining that the installation is incomplete. Please
run `VBoxManage --version` to see the error message which should contain
instructions on how to fix this error.
---- End output of vagrant up --no-provision --provider virtualbox ----
Ran vagrant up --no-provision --provider virtualbox returned 1]
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

Commandd : ashishk@chef-workstation:~/motd$ VBoxManage --version

WARNING: The character device /dev/vboxdrv does not exist.
         Please install the virtualbox-dkms package and the appropriate
         headers, most likely linux-headers-generic.

         You will not be able to start VMs until this problem is fixed.
4.3.10_Ubuntur93012

Ps:そのVM(ubuntu)のWindows 7に仮想ボックスをインストールしました。その上で「キッチン作成」を実行しているシェフワークステーションがあります

4

3 に答える 3

2

私はこれが古いスレッドであることを知っていますが、ちょうど私を捕まえたので、私の問題を共有したいと思いました.

インデントにスペースを使用する代わりにタブを使用したため、YAML の解析エラーが発生しました。

于 2016-10-06T19:04:38.907 に答える
2

「Chefdk 0.9.0 のセットアップと展開を本当に進めました。戻って、ユーザー、システム、Powershell の $PROFILE のすべてのパス変数をクリーンアップしました。Windows 7 および 10 用のchefdk のインストールに取り組んでいます。しばらくの間、注意すべき興味深い点をいくつか見つけました。

  1. Chekdk、vagrant、および virtualbox をアンインストールして再インストールした場合は、ユーザー、システム、$Powershell の $Profile パスをクリーンアップする必要があります。そうしないと、ゴーストのトラブルシューティングに何時間も費やすことになります。

  2. 空白は .kitchen.yml では重要です。これは、今日まで直面しなかった唯一の問題でした。上記の "driver:" に関するヒントをありがとうございます。

  3. Virtualboxまたはchefdkの後にVagrantを最後にインストールします。

  4. Chefdk のパスがこの順序になっていることを確認してください

      PATH="C:\opscode\chefdk\bin\;C:\opscode\chefdk\embedded\bin
    
  5. HOME と CHEFDK_HOME のパスを確認します。

これらのいくつかのことの後、すべてがうまくいくはずです。


 Windows 10 
 Chef Development Kit Version: 0.9.0 
 chef-client version: 12.5.1 
 berks version: 4.0.1 
 kitchen version: 1.4.2

$PROFILE のパス

$env:PATH="C:\opscode\chefdk\bin\;C:\opscode\chefdk\embedded\bin;C:\opscode\chefdk\modules\chef;C:\Program Files\Docker Toolbox;C:\ HashiCorp\Vagrant\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\MongoDB\Server\3.0\bin;C:\Python27\;C:\Python27\Scripts;C:\oraclexe\app \oracle\product\10.2.0\server\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files ( x86)\Common Files\Acronis\SnapAPI\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Common Files\Intuit\QBPOSSDKRuntime;c:\ Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;C:\Program Files (x86)\Puppet Labs\Puppet Enterprise\bin;C:\Program Files (x86)\acquia-drupal7\common\bin \;C:\Program Files (x86)\acquia-drupal7\mysql\bin\;C:\Program Files (x86)\acquia-drupal7\php5_3\;C:\Program Files (x86)\acquia-drupal7\drush\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files (x86)\Brackets\command;C:\Program Files (x86) \AMD\ATI.ACE\Core-Static;C:\Program Files (x86)\Skype\Phone\"

>>"chef shell-init powershell | Invoke-Expression"<<

PS C:\Users\Preston 3rd (win 7)\chef-repo\kitchen> & "C:\Program Files\Oracle\VirtualBox\VBoxManage" --version 5.0.6r103037

PS C:\Users\Preston 3rd (win 7)\chef-repo\kitchen> vagrant --version Vagrant 1.7.4 PS C:\Users\Preston 3rd (win 7)\chef-repo\kitchen>

 PS C:\Users\Preston 3rd (win 7)\chef-repo\kitchen> bundle install 
 Fetching gem metadata from https://rubygems.org/.......... 
 Fetching version metadata from https://rubygems.org/... 
 Fetching dependency metadata from https://rubygems.org/.. 
 Resolving dependencies... 
 Using ffi 1.9.10 
 Using win32-process 0.8.2 
 Using wmi-lite 1.0.0 
 Using mixlib-shellout 2.2.3 
 Using net-ssh 2.9.2 
 Using net-scp 1.2.1 
 Using safe_yaml 1.0.4 
 Using thor 0.19.1 
 Using test-kitchen 1.4.2 
 Using kitchen-vagrant 0.19.0 
 Using bundler 1.10.6 
 Bundle complete! 2 Gemfile dependencies, 11 gems now installed. 
 Use `bundle show [gemname]` to see where a bundled gem is installed. 

 Preston Thornton
 skype: preston4life
 preston3271@gmail.com
于 2015-11-06T23:48:38.120 に答える
1

以下の内容をコピーして既存の kitchen.yml に置き換えると、問題が解決します。

driver:
  name: vagrant

provisioner:
  name: chef_zero

platforms:
  - name: ubuntu-14.04
    driver:
      customize:
        memory: 256

suites:
  - name: default
    run_list:
      - recipe[motd_ubuntu::default]
    attributes:
于 2016-05-25T08:23:24.533 に答える