Vagrant 傀儡,cp:无法统计`/tmp/kitchen/hiera/*';:没有这样的文件或目录

Vagrant 傀儡,cp:无法统计`/tmp/kitchen/hiera/*';:没有这样的文件或目录,vagrant,puppet,test-kitchen,Vagrant,Puppet,Test Kitchen,我正在尝试使用创建一个傀儡部署 以下是我的厨房文件的外观: --- driver: name: vagrant provisioner: name: puppet_apply manifests_path: /repository/puppet_repo/manifests modules_path: /repository/puppet_repo/modules-mycompany hiera_data_path: /repository/puppet_repo/hier

我正在尝试使用创建一个傀儡部署

以下是我的厨房文件的外观:

---
driver:
  name: vagrant

provisioner:
  name: puppet_apply
  manifests_path: /repository/puppet_repo/manifests
  modules_path: /repository/puppet_repo/modules-mycompany
  hiera_data_path: /repository/puppet_repo/hieradata

platforms:
- name: centos-6.8
- name: centos-7.2
- name: debian-7.8
- name: ubuntu-12.04
- name: ubuntu-14.04
- name: ubuntu-16.04

suites:
  - name: default
当我尝试使用它时,会收到以下错误消息:

$ bundle exec kitchen converge default-centos-68 
-----> Starting Kitchen (v1.16.0)
-----> Converging <default-centos-68>...
       Preparing files for transfer
       Preparing modules
       Nothing to do for modules
       Preparing manifests
       Preparing files
       nothing to do for files
       Preparing hiera data
       Finished Preparing files for transfer
       Installing puppet from yum on centos
       Install busser on centos
       Transferring files to <default-centos-68>
       cp: cannot stat `/tmp/kitchen/hiera/*': No such file or directory
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Converge failed on instance <default-centos-68>.  Please see .kitchen/logs/default-centos-68.log for more details
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
cp: cannot stat `/tmp/kitchen/hiera/*': No such file or directory
问题可能是我正在通过bundler(版本1.14.6)运行这个程序,并且我还将我的傀儡版本设置为与指南
gem“puppet”、“~>4.10.4”
相同的版本,以解决图书管理员傀儡问题。以下是我的converge的完整输出:

$ bundle exec kitchen converge
-----> Starting Kitchen (v1.16.0)
-----> Converging <default-nocm-ubuntu-1204>...
       Preparing files for transfer
       Preparing modules
       Resolving module dependencies with Librarian-Puppet 2.2.3...
       Preparing manifests
       Preparing files
       nothing to do for files
       Preparing hiera data
       Finished Preparing files for transfer
       Installing puppet, will try to determine platform os
       Install busser on nocm_ubuntu
       Transferring files to <default-nocm-ubuntu-1204>
       cp: cannot stat `/tmp/kitchen/hiera/*': No such file or directory
-----> Converging <default-centos-65>...
       Preparing files for transfer
       Preparing modules
       Resolving module dependencies with Librarian-Puppet 2.2.3...
       Preparing manifests
       Preparing files
       nothing to do for files
       Preparing hiera data
       Finished Preparing files for transfer
       Installing puppet from yum on centos
       Install busser on centos
       Transferring files to <default-centos-65>
       cp: cannot stat `/tmp/kitchen/hiera/*': No such file or directory
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 2 actions failed.
>>>>>>     Converge failed on instance <default-nocm-ubuntu-1204>.  Please see .kitchen/logs/default-nocm-ubuntu-1204.log for more details
>>>>>>     Converge failed on instance <default-centos-65>.  Please see .kitchen/logs/default-centos-65.log for more details
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
$bundle exec
----->启动厨房(v1.16.0)
----->会聚。。。
准备要传输的文件
准备模块
使用Library Puppet 2.2.3解决模块依赖关系。。。
准备舱单
准备文件
无需对文件执行任何操作
准备hiera数据
已完成准备要传输的文件
安装puppet时,将尝试确定平台操作系统
在nocm_ubuntu上安装busser
将文件传输到
cp:无法统计“/tmp/kitchen/hiera/*”:没有这样的文件或目录
----->会聚。。。
准备要传输的文件
准备模块
使用Library Puppet 2.2.3解决模块依赖关系。。。
准备舱单
准备文件
无需对文件执行任何操作
准备hiera数据
已完成准备要传输的文件
在centos上从yum安装puppet
在centos上安装busser
将文件传输到
cp:无法统计“/tmp/kitchen/hiera/*”:没有这样的文件或目录
>>>>>>----例外-------
>>>>>>类:Kitchen::ActionFailed
>>>>>>消息:2个操作失败。
>>>>>>Converge在实例上失败。有关更多详细信息,请参阅.kitchen/logs/default-nocm-ubuntu-1204.log
>>>>>>Converge在实例上失败。有关更多详细信息,请参阅.kitchen/logs/default-centos-65.log
>>>>>> ----------------------
>>>>>>有关更多详细信息,请参见.kitchen/logs/kitchen.log
>>>>>>还可以尝试运行'kitchen diagnose--all'进行配置

如何调试此问题?

因此,此问题是由缺少的
hieradata
文件结构引起的。此示例是一个很大的帮助,详细说明了完整的厨房木偶文件结构:

在项目的主目录中,我需要创建以下空文件:

hieradata/
├── common.yaml
└── roles
    └── default.yaml
然后在
.kitchen.yml
中更改provisioner以指定此路径:

provisioner:
  name: puppet_apply
  manifests_path: manifests
  modules_path: modules
  hiera_data_path: hieradata
最后,我需要在我所有的平台上设置
driver\u plugin:vagrant

这是我的新
.kitchen.yml
中的示例:


删除Chef标签,因为这似乎不涉及Chef。您必须提供更多信息,至少
.kitchen.yml
。添加了关于使用puppet kitchen的基本指南的信息(列出了我采取的所有步骤),这导致了相同的问题。
---
driver:
  name: vagrant

provisioner:
  name: puppet_apply
  manifests_path: manifests
  modules_path: modules
  hiera_data_path: hieradata

platforms:
  - name: nocm_ubuntu-12.04
    driver_plugin: vagrant
    driver_config:
      box: nocm_ubuntu-12.04
      box_url: http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box
  - name: centos-6.5
    driver_plugin: vagrant
    driver_config:
      box: nocm_centos-6.5
      box_url: http://puppet-vagrant-boxes.puppetlabs.com/centos-65-x64-virtualbox-nocm.box

suites:
  - name: default
    manifest: site.pp