Coder Social home page Coder Social logo

nordstrom / chefdk_bootstrap Goto Github PK

View Code? Open in Web Editor NEW
88.0 16.0 44.0 350 KB

Set up your workstation for Chef development in minutes

Home Page: https://supermarket.chef.io/cookbooks/chefdk_bootstrap

License: Apache License 2.0

Ruby 88.33% HTML 2.95% PowerShell 7.83% Shell 0.89%

chefdk_bootstrap's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chefdk_bootstrap's Issues

Vagrant install fails if vagrant is already installed

Rerunning the cookbook if you already have Vagrant installed throws this error:

[2015-11-11T10:22:27-08:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: windows_package[Vagrant 1.7.4] (vagrant::windows line 1) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0, 42, 127], but received '1603'
---- Begin output of msiexec /qn /i "c:\local-mode-cache\cache\vagrant_1.7.4.msi" ----
STDOUT:
STDERR:
---- End output of msiexec /qn /i "c:\local-mode-cache\cache\vagrant_1.7.4.msi" ----
Ran msiexec /qn /i "c:\local-mode-cache\cache\vagrant_1.7.4.msi" returned 1603

Running msiexec.exe /qb /i C:\local-mode-cache\cache\vagrant_1.7.4.msi returns a "The specified account already exists."

Write PowerShell profile customizations to $Profile.CurrentUserAllHosts

There may be other issues, but the most glaring difference is that the cookbook only puts the profile in as the PowerShell profile, which is 1 of 6 profiles (and not the one used by ISE).

We need to review how profiles are selected, how they work with ISE, and make changes to support PowerShell ISE as a first-class option for installation.

Create ~/.kitchen/config.yml file

Move automagical proxy settings to ~/.kitchen/config.yml file

<% proxy_vars = {} %>
<% %w(http_proxy https_proxy no_proxy).each do |envvar| %>
<%   if ENV.key?(envvar) %>
<%     proxy_vars[envvar] = ENV[envvar] %>
<%   end %>
<% end %>

---
driver:
  name: vagrant

<% if proxy_vars.size > 0 %>
driver_config:
<% %w(http_proxy https_proxy no_proxy).each do |envvar| %>
<% if ENV.key?(envvar) %>
  <%= envvar %>: <%= ENV[envvar] %>
<% end %>
<% end %>

<% end %>

Atom installation issues

Mostly an FYI regarding an upstream issue with Atom...

I was helping a colleague get their Win7 workstation configured recently, and ran into problems with the Atom installation steps. Unfortunately I did not get copies of the logs from her sessions while we were troubleshooting, but the issue tracked back to this, upstream: https://discuss.atom.io/t/windows-7-install-issue-both-1-0-19-and-1-1-0-beta/21292/4. In her case, it was a McAfee enterprise AV client.

Not sure if there's an easy way to check for an antivirus client, or lock down the conditions to something a bit more specific than "it might not work if you have an AV client installed and active," but it's perhaps worth adding a note in the README, at least.

Consider rewriting bootstrap shell script in Ruby

Mac Mavericks ships with Ruby 2.0 as the System Ruby. Mavericks was released on October 22, 2013.

The bootstrap script is getting unwieldy without unit tests. BATS looks like a dead project so we should rewrite the bootstrap script in Ruby and add RSpec unit tests.

Fix broken unit tests

Failures:

  1. chefdk_bootstrap::default On a Mac OS X machine converges successfully
    Failure/Error: ).converge(described_recipe)
    ArgumentError:
    user MY_USER doesn't exist

    C:\Users\xgjo\AppData\Local\Temp\d20160114-10504-qgzjmx\cookbooks\chefdk_bootstrap\recipes\mac_os_x.rb:16:in `home'

    C:\Users\xgjo\AppData\Local\Temp\d20160114-10504-qgzjmx\cookbooks\chefdk_bootstrap\recipes\mac_os_x.rb:16:in`from_file'

    C:\Users\xgjo\AppData\Local\Temp\d20160114-10504-qgzjmx\cookbooks\chefdk_bootstrap\recipes\default.rb:16:in `from_file'

    ./spec/recipes/default_spec.rb:59:in`block (3 levels) in <top (required)>'

    ./spec/recipes/default_spec.rb:67:in `block (3 levels) in <top (required)>'

  2. chefdk_bootstrap::default On a Mac OS X machine includes the platform specific entry point recipe
    Failure/Error: ).converge(described_recipe)
    ArgumentError:
    user MY_USER doesn't exist

    C:\Users\xgjo\AppData\Local\Temp\d20160114-10504-qgzjmx\cookbooks\chefdk_bootstrap\recipes\mac_os_x.rb:16:in `home'

    C:\Users\xgjo\AppData\Local\Temp\d20160114-10504-qgzjmx\cookbooks\chefdk_bootstrap\recipes\mac_os_x.rb:16:in`from_file'

    C:\Users\xgjo\AppData\Local\Temp\d20160114-10504-qgzjmx\cookbooks\chefdk_bootstrap\recipes\default.rb:16:in `from_file'

    ./spec/recipes/default_spec.rb:59:in`block (3 levels) in <top (required)>'

    ./spec/recipes/default_spec.rb:71:in `block (3 levels) in <top (required)>'

Install reasonable set of Atom packages

We should install a reasonable set of Atom packages, e.g.

├── language-powershell
├── linter
├── linter-foodcritic
├── linter-rubocop
├── merge-conflicts

The right way to do this is to write an Atom cookbook with an atom_package resource.

Move the ChefSpec windows and mac node converge to an RSpec shared_context.

There's too much duplication in the specs. Move the windows and mac node converge to an RSpec shared_context.

Ex:

    let(:windows_node) do
      # use call original as per http://www.relishapp.com/rspec/rspec-mocks/v/3-3/docs/configuring-responses/calling-the-original-implementation#%60and-call-original%60-can-configure-a-default-response-that-can-be-overriden-for-specific-args
      allow(ENV).to receive(:[]).and_call_original
      allow(ENV).to receive(:fetch).with('ChocolateyInstall').and_return('C:\ProgramData\chocolatey')

      ChefSpec::ServerRunner.new(
        platform: 'windows',
        version: '2012R2'
      )

Create ~/.gitconfig if missing

Use this template to create a ~/.gitconfig for the user. We will need to prompt the user for name and email.

The git cookbook has a git_config LWRP we should look at.

[user]
        name = Jane Doe
        email = [email protected]
[core]
        editor = atom --wait
        autocrlf = True

[alias]
        co = checkout
        br = branch
        ci = commit
        st = status
        lol = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit

Error installing Virtualbox

Recipe: chefdk_bootstrap::virtualbox
  * homebrew_cask[virtualbox] action install
    * execute[installing cask virtualbox] action run
   ================================================================================
      Error executing action `run` on resource 'execute[installing cask virtualbox]'
      ================================================================================

      Mixlib::ShellOut::ShellCommandFailed
      ------------------------------------
      Expected process to exit with [0], but received '1'
      ---- Begin output of /usr/local/bin/brew cask install virtualbox  ----
      STDOUT: ==> Downloading http://download.virtualbox.org/virtualbox/5.0.14/VirtualBox-5.0.14-105127-OSX.dmg
      ==> Verifying checksum for Cask virtualbox
      ==> Running installer for virtualbox; your password may be necessary.
      ==> Package installers may write to any location; options such as --appdir are ignored.
      ==> sudo: no tty present and no askpass program specified
      STDERR: Error: Command failed to execute!

      ==> Failed command:
      ["/usr/bin/sudo", "-E", "--", "/usr/sbin/installer", "-pkg", "#<Pathname:/opt/homebrew-cask/Caskroom/virtualbox/5.0.14-105127/VirtualBox.pkg>", "-target", "/"]

      ==> Output of failed command:


      ==> Exit status of failed command:
      #<Process::Status: pid 11388 exit 1>
      ---- End output of /usr/local/bin/brew cask install virtualbox  ----
      Ran /usr/local/bin/brew cask install virtualbox  returned 1

      Resource Declaration:
      ---------------------
      # In /var/folders/0l/d20v6pzx1qlg9wmkszr_v9202dm83c/T/chefdk_bootstrap.GlbKsgqX/local-mode-cache/cache/cookbooks/homebrew/providers/cask.rb

       29:   execute "installing cask #{new_resource.name}" do
       30:     command "/usr/local/bin/brew cask install #{new_resource.name} #{new_resource.options}"
       31:     user homebrew_owner
       32:     environment lazy { { 'HOME' => ::Dir.home(homebrew_owner), 'USER' => homebrew_owner } }
       33:     not_if { new_resource.casked? }
       34:   end
       35: end

      Compiled Resource:
      ------------------
      # Declared in /var/folders/0l/d20v6pzx1qlg9wmkszr_v9202dm83c/T/chefdk_bootstrap.GlbKsgqX/local-mode-cache/cache/cookbooks/homebrew/providers/cask.rb:29:in `block in class_from_file'

      execute("installing cask virtualbox") do
        action [:run]
        retries 0
        retry_delay 2
        default_guard_interpreter :execute
        command "/usr/local/bin/brew cask install virtualbox "
        backup 5
        environment #<Chef::DelayedEvaluator:0x007fd6b1647a00@/var/folders/0l/d20v6pzx1qlg9wmkszr_v9202dm83c/T/chefdk_bootstrap.GlbKsgqX/local-mode-cache/cache/cookbooks/homebrew/providers/cask.rb:32>
        returns 0
        user "doug"
        declared_type :execute
        cookbook_name "chefdk_bootstrap"
        homebrew_owner "doug"
        not_if { #code block }
      end


    ================================================================================
    Error executing action `install` on resource 'homebrew_cask[virtualbox]'
    ================================================================================

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    execute[installing cask virtualbox] (/var/folders/0l/d20v6pzx1qlg9wmkszr_v9202dm83c/T/chefdk_bootstrap.GlbKsgqX/local-mode-cache/cache/cookbooks/homebrew/providers/cask.rb line 29) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
    ---- Begin output of /usr/local/bin/brew cask install virtualbox  ----
    STDOUT: ==> Downloading http://download.virtualbox.org/virtualbox/5.0.14/VirtualBox-5.0.14-105127-OSX.dmg
    ==> Verifying checksum for Cask virtualbox
    ==> Running installer for virtualbox; your password may be necessary.
    ==> Package installers may write to any location; options such as --appdir are ignored.
    ==> sudo: no tty present and no askpass program specified
    STDERR: Error: Command failed to execute!

    ==> Failed command:
    ["/usr/bin/sudo", "-E", "--", "/usr/sbin/installer", "-pkg", "#<Pathname:/opt/homebrew-cask/Caskroom/virtualbox/5.0.14-105127/VirtualBox.pkg>", "-target", "/"]

    ==> Output of failed command:


    ==> Exit status of failed command:
    #<Process::Status: pid 11388 exit 1>
    ---- End output of /usr/local/bin/brew cask install virtualbox  ----
    Ran /usr/local/bin/brew cask install virtualbox  returned 1

    Resource Declaration:
    ---------------------
    # In /var/folders/0l/d20v6pzx1qlg9wmkszr_v9202dm83c/T/chefdk_bootstrap.GlbKsgqX/local-mode-cache/cache/cookbooks/chefdk_bootstrap/recipes/virtualbox.rb

     20:   homebrew_cask 'virtualbox'
     21: end

    Compiled Resource:
    ------------------
    # Declared in /var/folders/0l/d20v6pzx1qlg9wmkszr_v9202dm83c/T/chefdk_bootstrap.GlbKsgqX/local-mode-cache/cache/cookbooks/chefdk_bootstrap/recipes/virtualbox.rb:20:in `from_file'

    homebrew_cask("virtualbox") do
      action [:install]
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      declared_type :homebrew_cask
      cookbook_name "chefdk_bootstrap"
      recipe_name "virtualbox"
    end


Running handlers:
[2016-02-12T14:10:09-08:00] ERROR: Running exception handlers
Running handlers complete
[2016-02-12T14:10:09-08:00] ERROR: Exception handlers complete
Chef Client failed. 15 resources updated in 05 minutes 03 seconds
[2016-02-12T14:10:09-08:00] FATAL: Stacktrace dumped to /var/folders/0l/d20v6pzx1qlg9wmkszr_v9202dm83c/T/chefdk_bootstrap.GlbKsgqX/local-mode-cache/cache/chef-stacktrace.out
[2016-02-12T14:10:09-08:00] ERROR: homebrew_cask[virtualbox] (chefdk_bootstrap::virtualbox line 20) had an error: Mixlib::ShellOut::ShellCommandFailed: execute[installing cask virtualbox] (/var/folders/0l/d20v6pzx1qlg9wmkszr_v9202dm83c/T/chefdk_bootstrap.GlbKsgqX/local-mode-cache/cache/cookbooks/homebrew/providers/cask.rb line 29) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /usr/local/bin/brew cask install virtualbox  ----
STDOUT: ==> Downloading http://download.virtualbox.org/virtualbox/5.0.14/VirtualBox-5.0.14-105127-OSX.dmg
==> Verifying checksum for Cask virtualbox
==> Running installer for virtualbox; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are ignored.
==> sudo: no tty present and no askpass program specified
STDERR: Error: Command failed to execute!

==> Failed command:
["/usr/bin/sudo", "-E", "--", "/usr/sbin/installer", "-pkg", "#<Pathname:/opt/homebrew-cask/Caskroom/virtualbox/5.0.14-105127/VirtualBox.pkg>", "-target", "/"]

==> Output of failed command:


==> Exit status of failed command:
#<Process::Status: pid 11388 exit 1>
---- End output of /usr/local/bin/brew cask install virtualbox  ----
Ran /usr/local/bin/brew cask install virtualbox  returned 1
[2016-02-12T14:10:09-08:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Post-script Cleanup Failing

Cleanup is failing at the end with the following error when run on a Mac:

rmdir: /tmp/chefdk_bootstrap_16157: Directory not empty

Contents of this directory look like the following:
x4v1@mymac:~/tmp : ls -lAF /tmp/chefdk_bootstrap_16157/
total 0
drwxr-xr-x 3 root wheel 102 Jan 6 15:30 local-mode-cache/
drwxr-xr-x 3 root wheel 102 Jan 6 15:30 nodes/

Append internally-managed root CA SSL certs to ChefDK CA bundle

As an Enterprise Organization we have internal root CAs that we need to have added to our certificate bundle to be able to connect to our internal servers, services (dev related like supermarket, chef servers, etc. signed with our internal root CA) and proxy without SSL warnings.

It would be great if this cookbook provided an easy way to add CA certificates to the system similar to how it's easy to configure the proxy. 😄

Refactor deleting temp dirs into a loop

This should be a loop.

The Windows bootstrap is shown below, but this also applies to Bash.

# Cleanup
if (Test-Path $berksfilePath) {
  Remove-Item $berksfilePath
}

if (Test-Path "$berksfilePath.lock") {
  Remove-Item "$berksfilePath.lock"
}

if (Test-Path $chefConfigPath) {
  Remove-Item $chefConfigPath
}

if (Test-Path nodes) {
  Remove-Item -Recurse nodes
}

if (Test-Path berks-cookbooks) {
  Remove-Item -Recurse berks-cookbooks
}

On Mac, set proxy env vars in bash profile

We will write bash profile only. We aren't going to worry about zsh/fish/ksh etc.

If the user has set proxy env vars, write them to their bash profile for a better OOB experience.

http_proxy
https_proxy
no_proxy

missing parent directory /opt/homebrew-cask

v1.3.1 removed brew and brew-cask from the bootstrap script; this reveals a bug in the mac_os_x recipe directory creation. Need to explicitly create /opt/homebrew-cask before creating /opt/homebrew-cask/Caskroom

Installing chefdk-julia gem creates .chefdk directory owned by root

Setting the node['chefdk_bootstrap']['package']['chefdk_julia'] attribute to true installs chefdk-julia in the user's ~/.chefdk directory, but the ~/.chefdk directory is owned by root. This causes chef gem install to fail when a user runs it.

chef gem install stove
Fetching: logify-0.2.0.gem (100%)
ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied @ rb_sysopen - /Users/me/.chefdk/gem/ruby/2.1.0/cache/logify-0.2.0.gem

We need to install chefdk-julia as the user.

Make non-proxy README instructions work for Windows.

This doesn't work if you are not behind a proxy:

(Invoke-WebRequest -Uri https://raw.githubusercontent.com/Nordstrom/chefdk_bootstrap/master/bootstrap.ps1 -ProxyUseDefaultCredentials -Proxy $env:https_proxy).Content | Invoke-Expression

It complains that -Proxy was passed a null value, which is true.

Don't show success message if chef-client run fails

Starting Chef Client, version 12.4.1
[2015-08-17T22:30:45-07:00] FATAL: chef-client doesn't have administrator privileges on node my_laptop.example.com.
[2015-08-17T22:30:45-07:00] FATAL: fatal_windows_admin_check is set to TRUE.

Running handlers:
[2015-08-17T22:30:45-07:00] ERROR: Running exception handlers
Running handlers complete
[2015-08-17T22:30:45-07:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 33.885253 seconds
[2015-08-17T22:30:45-07:00] FATAL: Stacktrace dumped to C:/Users/doug/chef/local-mode-cache/cache/chef-stacktrace.out
[2015-08-17T22:30:45-07:00] FATAL: Chef::Exceptions::WindowsNotAdmin: chef-client doesn't have administrator privileges on node my_laptop.example.com


*Congrats!!! Your workstation is now set up for Chef Development!*

ohai plugin error on Windows

I'm getting a stack trace related to a recent change

NoMethodError: undefined method `disabled_plugins=' for nil:NilClass
  C:\Users\...\AppData\Local\Temp\chefdk_bootstrap\client.rb:2:in `from_string'
Relevant file content:
  1: cookbook_path File.join(Dir.pwd, 'berks-cookbooks')
  2: ohai.disabled_plugins = [:Passwd]

In bootstrap.ps1, fail immediately unless user has Admin rights

We need to check for admin rights and fail immediately if the the script isn't launched in an Admin console on Windows.

Right now we wait until the chef run to fail.

[2015-11-11T11:09:16-08:00] FATAL: Chef::Exceptions::WindowsNotAdmin: chef-client doesn't have administrator privileges on node my_machine.example.com

On Mac, sudo password prompt is not obvious

When sudo prompts for the password, it's hidden because it's at the end of the curl download stats.

Steps to Reproduce:

Run chefdk_bootstrap script.

Expected:

Explanation of why we need to ask for your sudo password. Password prompt on it's own line.

Actual:

This script will:

1. Install the latest ChefDK package
2. Create some chef directories in your user profile (home) directory
    ~/.chef
    ~/chef
    ~/chef/cookbooks
3. Download the 'chefdk_bootstrap' cookbook via Berkshelf
4. Run 'chef-client' to install the rest of the tools you will need

** Installing ChefDK

Installing ChefDK 0.10.0
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 19964  100 19964    0     0  45322      0 --:--:-- --:--:-- --:--:-- 45372Password:

Buff::Errors::InvalidConfig error when running ChefDK_bootstrap script (Berkshelf)

Error

When running the boostrap script you may encounter an error like the following:

Installing ChefDK...
C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/buff-config-1.0.1/lib/buff/config/ruby.rb:30:in `rescue in initializ
e': uninitialized constant Buff::Config::Ruby::Evaluator::Chef (Buff::Errors::InvalidConfig)
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/buff-config-1.0.1/lib/buff/config/ruby.rb:25:in `initia
lize'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/buff-config-1.0.1/lib/buff/config/ruby.rb:17:in `new'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/buff-config-1.0.1/lib/buff/config/ruby.rb:17:in `parse'

        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/buff-config-1.0.1/lib/buff/config/ruby.rb:119:in `from_
ruby'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/buff-config-1.0.1/lib/buff/config/ruby.rb:112:in `initi
alize'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/ridley-4.2.0/lib/ridley/chef/config.rb:83:in `initializ
e'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-3.3.0/lib/berkshelf.rb:90:in `new'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-3.3.0/lib/berkshelf.rb:90:in `chef_config'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-3.3.0/lib/berkshelf/config.rb:80:in `<class:C
onfig>'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-3.3.0/lib/berkshelf/config.rb:4:in `<module:B
erkshelf>'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-3.3.0/lib/berkshelf/config.rb:3:in `<top (req
uired)>'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-3.3.0/lib/berkshelf/cookbook_generator.rb:3:i
n `require_relative'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-3.3.0/lib/berkshelf/cookbook_generator.rb:3:i
n `<class:CookbookGenerator>'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-3.3.0/lib/berkshelf/cookbook_generator.rb:2:i
n `<module:Berkshelf>'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-3.3.0/lib/berkshelf/cookbook_generator.rb:1:i
n `<top (required)>'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-3.3.0/lib/berkshelf.rb:197:in `require_relati
ve'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-3.3.0/lib/berkshelf.rb:197:in `<top (required
)>'
        from C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-3.3.0/lib/berkshelf/cli.rb:1:in `<top (requir
ed)>'
        from C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-3.3.0/bin/berks:3:in `<top (required)>'
        from C:/opscode/chefdk/bin/berks:43:in `load'
        from C:/opscode/chefdk/bin/berks:43:in `<main>'
Starting Chef Client, version 12.4.4
resolving cookbooks for run list: ["chefdk_bootstrap"]

================================================================================
Error Resolving Cookbooks for Run List:
================================================================================

Missing Cookbooks:
------------------
No such cookbook: chefdk_bootstrap

Expanded Run List:
------------------
* chefdk_bootstrap


Running handlers:
[2015-10-07T17:57:02-07:00] ERROR: Running exception handlers
Running handlers complete
[2015-10-07T17:57:02-07:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 31.391 seconds
[2015-10-07T17:57:02-07:00] FATAL: Stacktrace dumped to C:/Users/uipu/chef/local-mode-cache/cache/chef-stacktrace.out
[2015-10-07T17:57:02-07:00] FATAL: Net::HTTPServerException: 412 "Precondition Failed"

Cause

This is this issue in Berkshelf.

The issue is caused by having a line like this in your knife.rb:
Chef::Config.from_file(knife_override) if File.exist?(knife_override)

Solution

Replace the offending line in your knife.rb with this code:

# See this Berkshelf issue for why we can't call Chef::Config.from_file()
# https://github.com/berkshelf/berkshelf/issues/965
# This code is what Chef::Config.from_file() does.
if File.exists?(org_override) && File.readable?(org_override)
  self.instance_eval(IO.read(org_override), org_override, 1)
end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.