chef-boneyard / chef-provisioning

A library for creating machines and infrastructures idempotently in Chef.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uninitialized constant Chef::Resource::Machine

sharathrnair87 opened this issue · comments

I load a heap of libraries using a recipe called library-includes.rb

Chef::Resource::Machine.send(:include, EnvironmintOrchestration::Utils)
Chef::Resource::MachineBatch.send(:include, EnvironmintOrchestration::Utils)
Chef::Resource::MachineBatch.send(:include, OCloud::Utils)

Chef::Resource::MintpressRuntime.send(:include, EnvironmintOrchestration::Utils)

I have the necessary gems installed on the provisioning host:

*** LOCAL GEMS ***

chef-provisioning (1.8.0, 1.5.1)
chef-provisioning-aws (1.10.0, 1.8.0)
chef-provisioning-ssh (0.0.9)

But when I run a provision job, it bombs out with this error

NameError
---------
uninitialized constant Chef::Resource::Machine
...
 19:  Chef::Resource::Template.send(:include, EnvironmintOrchestration::Utils)
 20:
 21>> Chef::Resource::Machine.send(:include, EnvironmintOrchestration::Utils)
 22:  Chef::Resource::MachineBatch.send(:include, EnvironmintOrchestration::Utils)
 23:  Chef::Resource::MachineBatch.send(:include, OCloud::Utils)
 24:

Running :
Chef: 12.12.15
CentOS Linux release 7.2.1511 (Core)

Fixed by adding
require 'chef/provisioning' at the top of the recipe.