New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoMethodError: undefined method `inspec_gem' for cookbook: audit, recipe: inspec :Chef::Recipe #320

Closed
skylerto opened this Issue May 29, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@skylerto

skylerto commented May 29, 2018

Cookbook version

6.0.1

Chef-client version

14.1.21

Platform Details

AWS EC2 Centos 7.5.1804

Scenario:

I'm trying to run the audit cookbook's default recipe.

Steps to Reproduce:

I have a compliance cookbook which depends on audit. It sets up some compliance info based on the platform and includes the audit cookbook.

Expected Result:

Successful convergence.

Actual Result:

Fails with undefined method.

================================================================================
Recipe Compile Error in /hab/svc/chef-base/data/cache/cache/cookbooks/compliance/recipes/default.rb
================================================================================

NoMethodError
-------------
undefined method `inspec_gem' for cookbook: audit, recipe: inspec :Chef::Recipe
Did you mean?  inspect

Cookbook Trace:
---------------
  /hab/svc/chef-base/data/cache/cache/cookbooks/audit/recipes/inspec.rb:20:in `from_file'
  /hab/svc/chef-base/data/cache/cache/cookbooks/audit/recipes/default.rb:30:in `from_file'
  /hab/svc/chef-base/data/cache/cache/cookbooks/compliance/recipes/default.rb:22:in `from_file'

Relevant File Content:
----------------------
/hab/svc/chef-base/data/cache/cache/cookbooks/audit/recipes/inspec.rb:

 13:  #
 14:  # Unless required by applicable law or agreed to in writing, software
 15:  # distributed under the License is distributed on an "AS IS" BASIS,
 16:  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 17:  # See the License for the specific language governing permissions and
 18:  # limitations under the License.
 19:
 20>> inspec_gem 'inspec' do
 21:    version node['audit']['inspec_version']
 22:    source node['audit']['inspec_gem_source']
 23:    action :nothing
 24:  end.run_action(:install)
 25:

System Info:
------------
chef_version=14.1.21
platform=centos
platform_version=7.5.1804
ruby=ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]
program_name=/hab/pkgs/chef/chef-client/14.1.21/20180521162341/bin/chef-client
executable=/hab/pkgs/chef/chef-client/14.1.21/20180521162341/bin/chef-client
@skylerto

This comment has been minimized.

skylerto commented May 29, 2018

Whoop, just me being a tool. 😞

@skylerto skylerto closed this May 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment