chef-cookbooks / chef-server

Cookbook to install standalone Chef Server

Home Page:http://supermarket.chef.io/cookbooks/chef-server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bump chef-ingredient dependency

mengesb opened this issue · comments

Cookbook version

5.2.0

Chef-client version

12.19.36

Platform Details

centos7

Scenario:

Chef a Chef Server (install)

Steps to Reproduce:

dna.json

{
  "fqdn": "hostname.domainname.tld",
   "chef_client": {
     "init_style": "none"
   },
  "chef-server": {
    "accept_license": true,
    "addons": ["manage","push-jobs-server","reporting"],
    "api_fqdn": "chef12.anaplan-np.net",
    "configuration": "nginx['ssl_certificate'] = '/var/chef/ssl/hostname.domainname.tld'\nnginx['ssl_certificate_key'] = '/var/chef/ssl/hostname.domainname.tld'",
    "topology": "standalone",
    "version": "12.14.0"
  },
  "firewall": {
    "allow_established": true,
    "allow_ssh": true
  },
  "system": {
    "delay_network_restart": false,
    "domain_name": "anaplan-np.net",
    "manage_hostsfile": true,
    "short_hostname": "chef12"
  },
  "tags": []
}

Required cookbook sync:

sudo rm -rf /var/chef/cookbooks ; sudo mkdir -p /var/chef/cookbooks
sudo rm -rf /var/chef/cache     ; sudo mkdir -p /var/chef/cache
sudo rm -rf /var/chef/ssl       ; sudo mkdir -p /var/chef/ssl

for DEP in apt apt-chef chef-client     ; do curl -sL https://supermarket.chef.io/cookbooks/${DEP}/download | sudo tar xzC /var/chef/cookbooks; done
for DEP in chef_handler chef-ingredient ; do curl -sL https://supermarket.chef.io/cookbooks/${DEP}/download | sudo tar xzC /var/chef/cookbooks; done
for DEP in compat_resource chef-server  ; do curl -sL https://supermarket.chef.io/cookbooks/${DEP}/download | sudo tar xzC /var/chef/cookbooks; done
for DEP in chef-sugar cron firewall     ; do curl -sL https://supermarket.chef.io/cookbooks/${DEP}/download | sudo tar xzC /var/chef/cookbooks; done
for DEP in hostsfile logrotate          ; do curl -sL https://supermarket.chef.io/cookbooks/${DEP}/download | sudo tar xzC /var/chef/cookbooks; done
for DEP in packagecloud system yum      ; do curl -sL https://supermarket.chef.io/cookbooks/${DEP}/download | sudo tar xzC /var/chef/cookbooks; done
for DEP in yum-chef windows             ; do curl -sL https://supermarket.chef.io/cookbooks/${DEP}/download | sudo tar xzC /var/chef/cookbooks; done

sudo chown -R root:root /var/chef

exit 0

Note: Attempts to berks vendor the chef-server cookbook also resulted in the latest chef-ingredient cookbook download (2.0.1)

Attempt Installation:
sudo chef-solo -j .chef/dna.json -o 'recipe[system::default],recipe[chef-server::default],recipe[chef-server::addons]'

Expected Result:

Chef server is installed

Actual Result:

aws_instance.chef-server (remote-exec): ================================================================================
aws_instance.chef-server (remote-exec): Error Resolving Cookbooks for Run List:
aws_instance.chef-server (remote-exec): ================================================================================

aws_instance.chef-server (remote-exec): Missing Cookbooks:
aws_instance.chef-server (remote-exec): ------------------
aws_instance.chef-server (remote-exec): Could not satisfy version constraints for: chef-ingredient

aws_instance.chef-server (remote-exec): Expanded Run List:
aws_instance.chef-server (remote-exec): ------------------
aws_instance.chef-server (remote-exec): * system::default
aws_instance.chef-server (remote-exec): * chef-server::default
aws_instance.chef-server (remote-exec): * chef-server::addons

aws_instance.chef-server (remote-exec): Platform:
aws_instance.chef-server (remote-exec): ---------
aws_instance.chef-server (remote-exec): x86_64-linux

aws_instance.chef-server (remote-exec):
aws_instance.chef-server (remote-exec): Running handlers:
aws_instance.chef-server (remote-exec): [2017-04-07T17:41:35+00:00] ERROR: Running exception handlers
aws_instance.chef-server (remote-exec): Running handlers complete
aws_instance.chef-server (remote-exec): [2017-04-07T17:41:35+00:00] ERROR: Exception handlers complete
aws_instance.chef-server (remote-exec): Chef Client failed. 0 resources updated in 01 seconds
aws_instance.chef-server (remote-exec): [2017-04-07T17:41:35+00:00] FATAL: Stacktrace dumped to /etc/chef/local-mode-cache/cache/chef-stacktrace.out
aws_instance.chef-server (remote-exec): [2017-04-07T17:41:35+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
aws_instance.chef-server (remote-exec): [2017-04-07T17:41:35+00:00] ERROR: 412 "Precondition Failed"
aws_instance.chef-server (remote-exec): [2017-04-07T17:41:35+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Root issue: chef-ingredient restriction in this cookbook is set to ~> 1.1, but ~> excludes 2.x builds. Either bump to ~> 2.0.0 or remove pessimism

... traced it further

The pin was created purposefully because 2.x breaks with the cookbook as exists. We will be looking at what it would take to support 2.x changes but at present letting people use 2.x would just mean everything breaks.

I was able to manually download and untar chef-ingredient 1.1.0 with knife cookbook site download chef-ingredient 1.1.0 ( then untar it in cookbooks) The chef-solo run to install then works.

We are now using the latest chef-ingredient! Check the new release out.