首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Puppet,cp: cannot stat `/tmp/cp/hiera/*‘:没有这样的文件或目录

Puppet,cp: cannot stat `/tmp/cp/hiera/*‘:没有这样的文件或目录
EN

Stack Overflow用户
提问于 2017-06-27 05:32:24
回答 1查看 351关注 0票数 2

我正在尝试使用kitchen-puppet创建一个puppet部署。

下面是我的厨房文件:

代码语言:javascript
复制
---
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

当我尝试使用它时,我得到以下错误消息:

代码语言:javascript
复制
$ 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

我在使用the readme for kitchen-puppet.上列出的指南时也遇到了同样的问题

每当我尝试运行kitchen converge时,我都会继续收到错误消息:

代码语言:javascript
复制
cp: cannot stat `/tmp/kitchen/hiera/*': No such file or directory

问题可能是我正在运行这个bundler (1.14.6版),并且我还将我的puppet版本设置为与指南gem "puppet", "~> 4.10.4"相同的版本,以绕过图书管理员-木偶问题。下面是我的converge的完整输出:

代码语言:javascript
复制
$ 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

如何调试此问题?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-07-08 04:53:36

因此,该问题是由缺少hieradata文件结构引起的。这个例子提供了很大的帮助,详细描述了一个完整的厨房-木偶文件结构:

https://github.com/neillturner/puppet_vagrant_repo

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

代码语言:javascript
复制
hieradata/
├── common.yaml
└── roles
    └── default.yaml

然后在.kitchen.yml中更改置备程序以指定此路径:

代码语言:javascript
复制
provisioner:
  name: puppet_apply
  manifests_path: manifests
  modules_path: modules
  hiera_data_path: hieradata

最后,我需要在我的所有平台上设置driver_plugin: vagrant

这是我在the guide I mentioned中的示例的新.kitchen.yml

代码语言:javascript
复制
---
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
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44769010

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档