在资源上执行动作`install`时出错厨房|流浪者2.1 |虚拟盒子5.2

时间:2018-02-09 09:11:53

标签: chef test-kitchen

我正在尝试汇总我在CentOS 7上创建的厨房实例,并且在配方中只有一行来安装nginx包。

# Cookbook:: vmaas
# Recipe:: default
#
# Copyright:: 2018, The Authors, All Rights Reserved.
package "nginx"

然而,收敛失败,错误如下:

  

在资源' yum_package [nginx]'上执行操作install时出错              ================================================== ======================

       Chef::Exceptions::Package
       -------------------------
       No candidate version available for nginx
     

资源声明:

       ---------------------
       # In /tmp/kitchen/cache/cookbooks/vmaas/recipes/default.rb

         6: package "nginx"

       Compiled Resource:
       ------------------
       # Declared in /tmp/kitchen/cache/cookbooks/vmaas/recipes/default.rb:6:in `from_file'

.kitchen.yml如下所示:

---
driver:
  name: vagrant

provisioner:
  name: chef_zero
  # You may wish to disable always updating cookbooks in CI or other testing environments.
  # For example:
  #   always_update_cookbooks: <%= !ENV['CI'] %>
  chef_omnibus_url: http://www.chef.io/chef/install.sh
  require_chef_omnibus: 12.7.2
  always_update_cookbooks: false
  transport:
    user: vagrant
  #always_update_cookbooks: true

verifier:
  name: inspec

platforms:
  - name: centos
    driver:
      box: target/centos7
      #box_check_update: true
      box_url: 'https://binrepo.target.com/artifactory/marketing/boxes/centos7.json'

suites:
  - name: default
    run_list:
      - recipe[vmaas::default]
    verifier:
      inspec_tests:
        - test/smoke/default
    attributes:

如果我能得到相同的指导,那将是很好的。

此致 苏尼

1 个答案:

答案 0 :(得分:1)

据我所知,CentOS 7不包含Nginx软件包。

$  docker run centos:7 yum search nginx
Loaded plugins: fastestmirror, ovl
Determining fastest mirrors
 * base: mirror.team-cymru.org
 * extras: mirror.steadfast.net
 * updates: centos.mirror.constant.com
============================== N/S matched: nginx ==============================
pcp-pmda-nginx.x86_64 : Performance Co-Pilot (PCP) metrics for the Nginx
                      : Webserver

  Name and summary matches only, use "search all" for everything.

您需要提供一些其他包含nginx的仓库。