Chef infra 在资源| Kitchen | Vagrant 2.1 | Virtual Box 5.2上执行操作“安装”时出错

Chef infra 在资源| Kitchen | Vagrant 2.1 | Virtual Box 5.2上执行操作“安装”时出错,chef-infra,test-kitchen,Chef Infra,Test Kitchen,我正在尝试将我在CentOS 7上创建的厨房实例与配方中的一行合并以安装nginx包 # Cookbook:: vmaas # Recipe:: default # # Copyright:: 2018, The Authors, All Rights Reserved. package "nginx" $ docker run centos:7 yum search nginx Loaded plugins: fastestmirror, ovl Determining fastest m

我正在尝试将我在CentOS 7上创建的厨房实例与配方中的一行合并以安装nginx包

# Cookbook:: vmaas
# Recipe:: default
#
# Copyright:: 2018, The Authors, All Rights Reserved.
package "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.
但是,converge失败,错误如下:

在资源“yum\u包[nginx]”上执行操作安装时出错 ========================================================================

       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:
如果我能得到同样的指导,那就太好了

问候,,
Sunil

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

# Cookbook:: vmaas
# Recipe:: default
#
# Copyright:: 2018, The Authors, All Rights Reserved.
package "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。

nginx不是应该显式启用的EPEL的一部分吗?这是因为RHEL/CentOS上的包名是git all。如果您不熟悉系统管理,Chef将不会为您提供帮助。你需要明确知道你想告诉这个工具做什么。我在OpenStack云上使用服务器配置已经有很长时间了。是否有任何网站可以检查具有匹配操作系统版本的软件包名称。yum搜索仍然是唯一的官方选项。