title: Vagrant requires attributes in roles.json that break existing Chef project
body: <p>I have an existing <code>chef-solo</code> project to which I am trying to add <code>vagrant</code> support. I typically use knife to cook these recipes on EC2 servers using Ubuntu 10.04 AMIs published by Canonical.</p>
  
  <p>Vagrant requires that I add <code>chef_type</code> and <code>json_class</code> attributes to my working <code>roles/*.json</code> files, like this:</p>
  
  <pre><code>{
    "name": "memcached",
    "chef_type": "role",
    "json_class": "Chef::Role",
    "run_list": ["base", "memcached"]
  }
  </code></pre>
  
  <p>If I <em>don't</em> add these to the role definition file, then I get this next error. Presumably these attributes tell chef to treat my JSON file like an instance of Chef::Role class.</p>
  
  <pre><code>[default] [Thu, 26 May 2011 02:19:44 +0200] DEBUG: NoMethodError: undefined method `run_list_for' for {"name"=&gt;"memcached", "run_list"=&gt;["wantsa", "memcached"]}:Hash
  /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/run_list/run_list_expansion.rb:139:in `expand_run_list_items'
  /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/run_list/run_list_expansion.rb:78:in `expand'
  /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/run_list.rb:138:in `expand'
  /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/node.rb:437:in `expand!'
  /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/client.rb:249:in `build_node'
  /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/client.rb:151:in `run'
  /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/application/solo.rb:192:in `run_application'
  /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/application/solo.rb:183:in `loop'
  /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/application/solo.rb:183:in `run_application'
  /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/application.rb:66:in `run'
  /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/chef-solo:25
  /opt/ruby/bin/chef-solo:19:in `load'
  /opt/ruby/bin/chef-solo:19
  </code></pre>
  
  <p>However, when I try to cook the same role on EC2 the existence of <code>chef_type</code> and <code>json_class</code> attributes break the process, yielding the next error. Presumably this is because in this case chef wants to treat my role definition like a Ruby hash (and call <code>.delete</code> from it)</p>
  
  <pre><code>/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/node.rb:379:in `consume_run_list': undefined method `delete' for #&lt;Chef::Role:0x7fa337535138&gt; (NoMethodError)
      from /usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/node.rb:370:in `consume_attributes'
      from /usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/node.rb:358:in `consume_external_attrs'
      from /usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/client.rb:222:in `build_node'
      from /usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/client.rb:145:in `run'
      from /usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/application/solo.rb:190:in `run_application'
      from /usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/application/solo.rb:181:in `loop'
      from /usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/application/solo.rb:181:in `run_application'
      from /usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/application.rb:62:in `run'
      from /usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/chef-solo:25
      from /usr/bin/chef-solo:19:in `load'
      from /usr/bin/chef-solo:19
  rake aborted!
  </code></pre>
  
  <p>When I remove the <code>chef_type</code> and <code>json_class</code> my EC2 cooking scripts go back to working as normal, but then Vagrant is broken.</p>
  
  <p>The main difference that I see between my chef-solo command and the one used by Vagrant is that my chef-solo command has a direct relationship to my roles.json file, while Vagrant's is wrapped up in the <code>dna.json</code> file.</p>
  
  <p>Mine:</p>
  
  <pre><code>ssh ubuntu@ec2-xxx-xxx-xxx-xxx.us-west-1.compute.amazonaws.com "cd /etc/chef; sudo env chef_environment=production chef-solo -l info -c config/solo.rb -j roles/memcached.json "
  </code></pre>
  
  <p>Vagrants:</p>
  
  <pre><code>cd /tmp/vagrant-chef
  chef-solo -c solo.rb -j dna.json
  </code></pre>
  
  <p>Is there some way that I can configure my Vagrantfile to make these work?</p>