0

i am trying to converge my kitchen instances created on CentOS 7 and only one line in recipe to install nginx package.

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

However the converge fails with error as below:

Error executing action install on resource 'yum_package[nginx]' ========================================================================

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

Resource Declaration:

       ---------------------
       # 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'

the .kitchen.yml looks like below:

---
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:

It would be great if i can get some guidance on the same.

Regards, Sunil

Sunil
  • 553
  • 1
  • 12
  • 30

1 Answers1

1

To the best of my knowledge, CentOS 7 does not include an Nginx package.

$  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.

You'll need to provide some other repo which includes nginx.

coderanger
  • 52,400
  • 4
  • 52
  • 75
  • That would be because the package name on RHEL/CentOS is `git-all`. If you are unfamiliar with systems administration, Chef will not help you with that. You need to know specifically what you want to tell the tool to do. – coderanger Feb 10 '18 at 02:59
  • I have been using configuration of servers for quite a long time on OpenStack cloud. Is there any site to check package names with the matching OS versions. – Sunil Feb 10 '18 at 03:01
  • `yum search` is still the only official option. – coderanger Feb 10 '18 at 03:04