Chef Local Cookbook Development

The Chef Local Cookbook Development course is out of date currently and could confuse students who are continuing from the Basic Fluency Course.
  • post-author-pic
    Terrence C
    10-23-2018

    Then you are going to LOVE what comes in about 10 days!


    Check out our launches for the Great 200+ above and prepare for the updated course release!

  • post-author-pic
    Isiaha B
    10-30-2018

    Ok Thanks. Yeah because the current version of chef and the tasks provide do not work and there are different paramters it appears. For exampe after doing the Create and Run ChefSpec tests i got the following error despite following along with the instructions


    [ lcd_web]$ chef exec rspec
    .FFFFFF

    Failures:

    1) lcd_web::default CentOS installs httpd
    Failure/Error: expect(chef_run).to install_package('httpd')

    expected "package[httpd]" with action :install to be in Chef run. Other package resources:



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

    2) lcd_web::default CentOS installs net-tools
    Failure/Error: expect(chef_run).to install_package('net-tools')

    expected "package[net-tools]" with action :install to be in Chef run. Other package resources:



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

    3) lcd_web::default CentOS enables the httpd service
    Failure/Error: expect(chef_run).to enable_service('httpd')

    expected "service[httpd]" with action :enable to be in Chef run. Other service resources:



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

    4) lcd_web::default CentOS starts the httpd service
    Failure/Error: expect(chef_run).to start_service('httpd')

    expected "service[httpd]" with action :start to be in Chef run. Other service resources:



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

    5) lcd_web::users CentOS creates the group
    Failure/Error: expect { chef_run }.to create_group('developers')
    You must pass an argument rather than a block to `expect` to use the provided matcher (create group "developers"), or the matcher must implement `supports_block_expectations?`.
    # ./spec/unit/recipes/users_spec.rb:19:in `block (3 levels) in <top (required)>'

    6) lcd_web::users CentOS creates the user
    Failure/Error: expect(chef_run).to create_user('webadmin').with(group: 'developers')

    expected "user[webadmin]" with action :create to be in Chef run. Other user resources:



    # ./spec/unit/recipes/users_spec.rb:23:in `block (3 levels) in <top (required)>'

    Finished in 1.24 seconds (files took 1.79 seconds to load)
    7 examples, 6 failures

    Failed examples:

    rspec ./spec/unit/recipes/default_spec.rb:22 # lcd_web::default CentOS installs httpd
    rspec ./spec/unit/recipes/default_spec.rb:26 # lcd_web::default CentOS installs net-tools
    rspec ./spec/unit/recipes/default_spec.rb:30 # lcd_web::default CentOS enables the httpd service
    rspec ./spec/unit/recipes/default_spec.rb:34 # lcd_web::default CentOS starts the httpd service
    rspec ./spec/unit/recipes/users_spec.rb:18 # lcd_web::users CentOS creates the group
    rspec ./spec/unit/recipes/users_spec.rb:22 # lcd_web::users CentOS creates the user

    [cloud_user@isiaha1c lcd_web]$ sudo vim spec/unit/recipes/default_spec.rb



  • post-author-pic
    Isiaha B
    10-30-2018

    So i have noticed what was missing.. please disregard

Looking For Team Training?

Learn More