Tagging-only recipe had been applied to node using chef-provisioning-vagrant and local-mode,
I got NoMethodError. Because add normal.tags = nil, it is not empty array.
CHEF_DRIVER=vagrant chef-client -z chef-prov-test.rb
[2015-06-03T10:46:15+09:00] WARN: No config file found or specified on command line, using command line options.
Starting Chef Client, version 12.3.0
resolving cookbooks for run list: []
Synchronizing Cookbooks:
Compiling Cookbooks...
[2015-06-03T10:46:16+09:00] WARN: Node lilith has an empty run list.
Converging 1 resources
Recipe: @recipe_files::/tmp/chef-repo-test/cookbooks/test/chef-prov-test.rb
* machine[test] action converge
- create new directory /home/dai/.chef/vms
- create new file /home/dai/.chef/vms/Vagrantfile
- update content in file /home/dai/.chef/vms/Vagrantfile from none to 06b93d
- --- /home/dai/.chef/vms/Vagrantfile 2015-06-03 10:46:16.707632279 +0900
- +++ /home/dai/.chef/vms/.Vagrantfile20150603-11151-1iosh7c 2015-06-03 10:46:16.707632279 +0900
- @@ -1 +1,4 @@
- +Dir.glob('/home/dai/.chef/vms/*.vm') do |vm_file|
- + eval(IO.read(vm_file), nil, vm_file)
- +end
- create new file /home/dai/.chef/vms/test.vm
- update content in file /home/dai/.chef/vms/test.vm from none to 341cfb
- --- /home/dai/.chef/vms/test.vm 2015-06-03 10:46:16.711632312 +0900
- +++ /home/dai/.chef/vms/.test.vm20150603-11151-rzirtp 2015-06-03 10:46:16.711632312 +0900
- @@ -1 +1,7 @@
- +Vagrant.configure('2') do |outer_config|
- + outer_config.vm.define "test" do |config|
- + config.vm.box = "chef/ubuntu-14.04"
- + config.vm.hostname = "test"
- + end
- +end
- create node test at http://127.0.0.1:8901
- add normal.tags = nil
- add normal.chef_provisioning = {"reference"=>{"driver_url"=>"vagrant:/home/dai/.chef/vms", "driver_version"=>"0.8.3", "vm_name"=>"test", "vm_file_path"=>"/home/dai/.chef/vms/test.vm", "allocated_at"=>"2015-06-03 01:46:16 UTC", "host_node"=>"chefzero://localhost:8889/nodes/", "needs_reload"=>true}}
- update run_list from [] to ["recipe[test]"]
- run vagrant up test (status was 'not created')
- update node test at http://127.0.0.1:8901
- update normal.chef_provisioning.reference.needs_reload from true to false
- add normal.chef_provisioning.reference.forwarded_ports = {}
SNIP SNIP SNIP
================================================================================
Recipe Compile Error in /var/chef/cache/cookbooks/test/recipes/default.rb
================================================================================
NoMethodError
-------------
undefined method `include?' for nil:NilClass
Here are chef-provisioning recipe (chef-prov-test.rb) and tagging-only recipe (test::default).
chef-prov-test.rb:
cookbooks/test/recipes/default.rb:
Tagging-only recipe had been applied to node using chef-provisioning-vagrant and local-mode, I got NoMethodError. Because
add normal.tags = nil
, it is not empty array.Here is node object. normal.tags is
null
, not[]
.nodes/test.json:
Then, writing just
tags
in machine instead of Tagging-only recipe.chef-prov-test.rb:
Using chef-provisioning-vagrant and local-mode, I got no error. Because
add normal.tags = ["test"]
, it is already set.Here is node object. normal.tags is
["test"]
.nodes/test.json:
is it bug or limit?
related: chef/chef-zero#139