Chef-solo override-runlist


#1

Hi,

I’m trying to pass an override list into chef-solo but I can’t seem to make it accept a role for example this works:

chef-solo -c solo.rb -o "webserver"
Results in:

[2013-06-04T17:15:48+01:00] WARN: Original Run List: [role[marklogic]]
[2013-06-04T17:15:48+01:00] WARN: Overridden Run List: [recipe[webserver]]

But something like:

chef-solo -c solo.rb -o "role[base]"
results in:

[2013-06-04T17:18:27+01:00] WARN: Original Run List: [role[marklogic]]
[2013-06-04T17:18:27+01:00] WARN: Overridden Run List: [recipe[roles]]

Any ideas how I can pass in a role to the override list in chef-solo?

Thanks

Dan

===================== DISCLAIMER ======================
This message is intended only for the use of the person(s)
(“Intended Recipient”) to whom it is addressed. It may contain
information which is privileged and confidential. Accordingly
any dissemination, distribution, copying or other use of this
message or any of its content by any person other than the Intended
Recipient may constitute a breach of civil or criminal law and is
strictly prohibited. If you are not the Intended Recipient, please
contact the sender as soon as possible.

Reed Business Information Limited.
Registered Office: Quadrant House, The Quadrant, Sutton, Surrey, SM2 5AS, UK.
Registered in England under Company No. 151537

=======================================================


#2

Hi Dan,

I think you want to use -j specifying a JSON file that would include
attributed to override in the current “runlist” check out this following
link:
http://wiki.opscode.com/plugins/viewsource/viewpagesrc.action?pageId=13173227

On Tue, Jun 4, 2013 at 9:20 AM, Gibbons, Daniel (RBI-UK) <
Daniel.Gibbons@rbi.co.uk> wrote:

Hi,

I’m trying to pass an override list into chef-solo but I can’t seem to
make it accept a role for example this works:

chef-solo -c solo.rb -o "webserver"
Results in:

[2013-06-04T17:15:48+01:00] WARN: Original Run List: [role[marklogic]]
[2013-06-04T17:15:48+01:00] WARN: Overridden Run List: [recipe[webserver]]

But something like:

chef-solo -c solo.rb -o "role[base]"
results in:

[2013-06-04T17:18:27+01:00] WARN: Original Run List: [role[marklogic]]
[2013-06-04T17:18:27+01:00] WARN: Overridden Run List: [recipe[roles]]

Any ideas how I can pass in a role to the override list in chef-solo?

Thanks

Dan

===================== DISCLAIMER ======================
This message is intended only for the use of the person(s)
(“Intended Recipient”) to whom it is addressed. It may contain
information which is privileged and confidential. Accordingly
any dissemination, distribution, copying or other use of this
message or any of its content by any person other than the Intended
Recipient may constitute a breach of civil or criminal law and is
strictly prohibited. If you are not the Intended Recipient, please
contact the sender as soon as possible.

Reed Business Information Limited.
Registered Office: Quadrant House, The Quadrant, Sutton, Surrey, SM2 5AS,
UK.
Registered in England under Company No. 151537

=======================================================


#3

Link to the chef-solo command line topic on chef-docs: http://docs.opscode.com/ctl_chef_solo.html.


From: Jonathan Mickle
Sent: Tuesday, June 04, 2013 9:27 AM
To: chef@lists.opscode.com
Subject: [chef] Re: Chef-solo override-runlist

Hi Dan,

I think you want to use -j specifying a JSON file that would include attributed to override in the current “runlist” check out this following link: http://wiki.opscode.com/plugins/viewsource/viewpagesrc.action?pageId=13173227

On Tue, Jun 4, 2013 at 9:20 AM, Gibbons, Daniel (RBI-UK) <Daniel.Gibbons@rbi.co.ukmailto:Daniel.Gibbons@rbi.co.uk> wrote:
Hi,

I’m trying to pass an override list into chef-solo but I can’t seem to make it accept a role for example this works:

chef-solo -c solo.rb -o "webserver"
Results in:

[2013-06-04T17:15:48+01:00] WARN: Original Run List: [role[marklogic]]
[2013-06-04T17:15:48+01:00] WARN: Overridden Run List: [recipe[webserver]]

But something like:

chef-solo -c solo.rb -o "role[base]"
results in:

[2013-06-04T17:18:27+01:00] WARN: Original Run List: [role[marklogic]]
[2013-06-04T17:18:27+01:00] WARN: Overridden Run List: [recipe[roles]]

Any ideas how I can pass in a role to the override list in chef-solo?

Thanks

Dan

===================== DISCLAIMER ======================
This message is intended only for the use of the person(s)
(“Intended Recipient”) to whom it is addressed. It may contain
information which is privileged and confidential. Accordingly
any dissemination, distribution, copying or other use of this
message or any of its content by any person other than the Intended
Recipient may constitute a breach of civil or criminal law and is
strictly prohibited. If you are not the Intended Recipient, please
contact the sender as soon as possible.

Reed Business Information Limited.
Registered Office: Quadrant House, The Quadrant, Sutton, Surrey, SM2 5AS, UK.
Registered in England under Company No. 151537

=======================================================


#4

Hi,

That was the way I was doing it first of all but I now need to pass in parameters that can be different for each environment which in this case is an app software location, so I wanted to do something like:

UpdateWebServer.bat
chef-solo -c solo.rb -o “role[webserver]” -j productionSettings.json

UpdateMarkLogic.bat
chef-solo -c solo.rb -o “role[marklogic]” -j productionSettings.json

Thanks

Dan

From: Jonathan Mickle [mailto:jmickle05@gmail.com]
Sent: 04 June 2013 17:28
To: chef@lists.opscode.com
Subject: [chef] Re: Chef-solo override-runlist

Hi Dan,

I think you want to use -j specifying a JSON file that would include attributed to override in the current “runlist” check out this following link: http://wiki.opscode.com/plugins/viewsource/viewpagesrc.action?pageId=13173227

On Tue, Jun 4, 2013 at 9:20 AM, Gibbons, Daniel (RBI-UK) <Daniel.Gibbons@rbi.co.ukmailto:Daniel.Gibbons@rbi.co.uk> wrote:
Hi,

I’m trying to pass an override list into chef-solo but I can’t seem to make it accept a role for example this works:

chef-solo -c solo.rb -o "webserver"
Results in:

[2013-06-04T17:15:48+01:00] WARN: Original Run List: [role[marklogic]]
[2013-06-04T17:15:48+01:00] WARN: Overridden Run List: [recipe[webserver]]

But something like:

chef-solo -c solo.rb -o "role[base]"
results in:

[2013-06-04T17:18:27+01:00] WARN: Original Run List: [role[marklogic]]
[2013-06-04T17:18:27+01:00] WARN: Overridden Run List: [recipe[roles]]

Any ideas how I can pass in a role to the override list in chef-solo?

Thanks

Dan

===================== DISCLAIMER ======================
This message is intended only for the use of the person(s)
(“Intended Recipient”) to whom it is addressed. It may contain
information which is privileged and confidential. Accordingly
any dissemination, distribution, copying or other use of this
message or any of its content by any person other than the Intended
Recipient may constitute a breach of civil or criminal law and is
strictly prohibited. If you are not the Intended Recipient, please
contact the sender as soon as possible.

Reed Business Information Limited.
Registered Office: Quadrant House, The Quadrant, Sutton, Surrey, SM2 5AS, UK.
Registered in England under Company No. 151537

=======================================================


#5

On Tuesday, June 4, 2013 at 9:20 AM, Gibbons, Daniel (RBI-UK) wrote:

Hi,

I’m trying to pass an override list into chef-solo but I can’t seem to make it accept a role for example this works:

chef-solo -c solo.rb -o "webserver"
Results in:

[2013-06-04T17:15:48+01:00] WARN: Original Run List: [role[marklogic]]
[2013-06-04T17:15:48+01:00] WARN: Overridden Run List: [recipe[webserver]]

But something like:

chef-solo -c solo.rb -o "role[base]"
results in:

[2013-06-04T17:18:27+01:00] WARN: Original Run List: [role[marklogic]]
[2013-06-04T17:18:27+01:00] WARN: Overridden Run List: [recipe[roles]]

Any ideas how I can pass in a role to the override list in chef-solo?

Thanks

Dan
This looks like a legit bug, but I cannot reproduce it easily.

chef-solo -o "role[foo]"
Starting Chef Client, version 11.4.2
[2013-06-04T09:37:26-07:00] WARN: Run List override has been provided.
[2013-06-04T09:37:26-07:00] WARN: Original Run List: []
[2013-06-04T09:37:26-07:00] WARN: Overridden Run List: [role[foo]]
[2013-06-04T09:37:26-07:00] ERROR: Role foo (included by 'top level') is in the runlist but does not exist. Skipping expand.

================================================================================
Error expanding the run_list:
================================================================================


Missing Role(s) in Run List:
----------------------------
* foo included by 'top level'


Original Run List
-----------------
* role[foo]

What version of Chef do you have? Can you run with -ldebug and provide relevant output?


Daniel DeLeo


#6

Hi,

This is the full output:

C:\Projects\Dev Ops\Chef>chef-solo -c solo.rb -o “role[base]” -j productionSettings.json -ldebug
Starting Chef Client, version 11.0.0←[0m
[2013-06-04T17:53:04+01:00] INFO: *** Chef 11.0.0 ***
[2013-06-04T17:53:17+01:00] DEBUG: Building node object for QHSW21813.b2b.regn.net
[2013-06-04T17:53:17+01:00] DEBUG: Extracting run list from JSON attributes provided on command line
[2013-06-04T17:53:17+01:00] INFO: Setting the run_list to [“role[marklogic]”] from JSON
[2013-06-04T17:53:17+01:00] DEBUG: Applying attributes from json file
[2013-06-04T17:53:17+01:00] DEBUG: Platform is windows version 6.1.7601
[2013-06-04T17:53:17+01:00] WARN: Run List override has been provided.
[2013-06-04T17:53:17+01:00] WARN: Original Run List: [role[marklogic]]
[2013-06-04T17:53:17+01:00] WARN: Overridden Run List: [recipe[roles]]
[2013-06-04T17:53:17+01:00] INFO: Run List is [recipe[roles]]
[2013-06-04T17:53:17+01:00] INFO: Run List expands to [roles]
[2013-06-04T17:53:17+01:00] INFO: Starting Chef Run for QHSW21813.b2b.regn.net
[2013-06-04T17:53:17+01:00] INFO: Running start handlers
[2013-06-04T17:53:17+01:00] INFO: Start handlers complete.
[2013-06-04T17:53:17+01:00] DEBUG: Checking for administrator privileges…
[2013-06-04T17:53:17+01:00] DEBUG: chef-client has administrator privileges on node QHSW21813.b2b.regn.net.
[2013-06-04T17:53:17+01:00] DEBUG: No chefignore file found at C:/Projects/Dev Ops/Chef/cookbooks/chefignore no files will be ignored
Compiling Cookbooks…←[0m
[2013-06-04T17:53:17+01:00] DEBUG: Re-raising exception: Chef::Exceptions::CookbookNotFound - Cookbook roles not found. If you’re loading ro
les from another cookbook, make sure you configure the dependency in your metadata
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.0.0/lib/chef/cookbook/cookbook_collection.rb:38:in block in initialize' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-6.16.0/lib/ohai/mash.rb:77:inyield’
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-6.16.0/lib/ohai/mash.rb:77:in default' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-6.16.0/lib/ohai/mash.rb:77:indefault’
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.0.0/lib/chef/run_context/cookbook_compiler.rb:265:in []' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.0.0/lib/chef/run_context/cookbook_compiler.rb:265:ineach_cookbook_dep’
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.0.0/lib/chef/run_context/cookbook_compiler.rb:243:in add_cookbook_with_deps' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.0.0/lib/chef/run_context/cookbook_compiler.rb:87:inblock in cookbook_order’
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.0.0/lib/chef/run_context/cookbook_compiler.rb:85:in each' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.0.0/lib/chef/run_context/cookbook_compiler.rb:85:incookbook_order’
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.0.0/lib/chef/run_context/cookbook_compiler.rb:97:in compile_libraries' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.0.0/lib/chef/run_context/cookbook_compiler.rb:70:incompile’
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.0.0/lib/chef/run_context.rb:86:in load' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.0.0/lib/chef/client.rb:224:insetup_run_context’
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.0.0/lib/chef/client.rb:467:in do_run' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.0.0/lib/chef/client.rb:200:inrun’
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.0.0/lib/chef/application.rb:190:in run_chef_client' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.0.0/lib/chef/application/solo.rb:239:inblock in run_application’
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.0.0/lib/chef/application/solo.rb:231:in loop' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.0.0/lib/chef/application/solo.rb:231:inrun_application’
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.0.0/lib/chef/application.rb:73:in run' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.0.0/bin/chef-solo:25:in<top (required)>'
C:/opscode/chef/bin/chef-solo:23:in load' C:/opscode/chef/bin/chef-solo:23:in

I notice you’ve got a newer version of chef client, maybe it’s been fixed in a later version? I’ll give it a go….

Thanks

Dan

From: Daniel DeLeo [mailto:ddeleo@kallistec.com] On Behalf Of Daniel DeLeo
Sent: 04 June 2013 17:45
To: chef@lists.opscode.com
Subject: [chef] Re: Chef-solo override-runlist

On Tuesday, June 4, 2013 at 9:20 AM, Gibbons, Daniel (RBI-UK) wrote:
Hi,

I’m trying to pass an override list into chef-solo but I can’t seem to make it accept a role for example this works:

chef-solo -c solo.rb -o "webserver"
Results in:

[2013-06-04T17:15:48+01:00] WARN: Original Run List: [role[marklogic]]
[2013-06-04T17:15:48+01:00] WARN: Overridden Run List: [recipe[webserver]]

But something like:

chef-solo -c solo.rb -o "role[base]"
results in:

[2013-06-04T17:18:27+01:00] WARN: Original Run List: [role[marklogic]]
[2013-06-04T17:18:27+01:00] WARN: Overridden Run List: [recipe[roles]]

Any ideas how I can pass in a role to the override list in chef-solo?

Thanks

Dan
This looks like a legit bug, but I cannot reproduce it easily.

chef-solo -o "role[foo]"
Starting Chef Client, version 11.4.2
[2013-06-04T09:37:26-07:00] WARN: Run List override has been provided.
[2013-06-04T09:37:26-07:00] WARN: Original Run List: []
[2013-06-04T09:37:26-07:00] WARN: Overridden Run List: [role[foo]]
[2013-06-04T09:37:26-07:00] ERROR: Role foo (included by 'top level') is in the runlist but does not exist. Skipping expand.

================================================================================
Error expanding the run_list:
================================================================================


Missing Role(s) in Run List:
----------------------------
* foo included by 'top level'


Original Run List
-----------------
* role[foo]

What version of Chef do you have? Can you run with -ldebug and provide relevant output?


Daniel DeLeo

===================== DISCLAIMER ======================
This message is intended only for the use of the person(s)
(“Intended Recipient”) to whom it is addressed. It may contain
information which is privileged and confidential. Accordingly
any dissemination, distribution, copying or other use of this
message or any of its content by any person other than the Intended
Recipient may constitute a breach of civil or criminal law and is
strictly prohibited. If you are not the Intended Recipient, please
contact the sender as soon as possible.

Reed Business Information Limited.
Registered Office: Quadrant House, The Quadrant, Sutton, Surrey, SM2 5AS, UK.
Registered in England under Company No. 151537

=======================================================


#7

Hi,

I get the same result with version 11.4.4:

For some reason the –o parameter doesn’t work correctly.

C:\Projects\Dev Ops\Chef>chef-solo -c solo.rb -o “role[base]” -ldebug
Starting Chef Client, version 11.4.4←[0m
[2013-06-06T07:42:04+01:00] INFO: *** Chef 11.4.4 ***
[2013-06-06T07:43:06+01:00] DEBUG: Building node object for localhost
[2013-06-06T07:43:06+01:00] DEBUG: Extracting run list from JSON attributes provided on command line
[2013-06-06T07:43:06+01:00] DEBUG: Applying attributes from json file
[2013-06-06T07:43:06+01:00] DEBUG: Platform is windows version 6.1.7601
[2013-06-06T07:43:06+01:00] WARN: Run List override has been provided.
[2013-06-06T07:43:06+01:00] WARN: Original Run List: []
[2013-06-06T07:43:06+01:00] WARN: Overridden Run List: [recipe[roles]]
[2013-06-06T07:43:06+01:00] INFO: Run List is [recipe[roles]]
[2013-06-06T07:43:06+01:00] INFO: Run List expands to [roles]
[2013-06-06T07:43:06+01:00] INFO: Starting Chef Run for QHSW21813.b2b.regn.net
[2013-06-06T07:43:06+01:00] INFO: Running start handlers
[2013-06-06T07:43:06+01:00] INFO: Start handlers complete.
[2013-06-06T07:43:06+01:00] DEBUG: Checking for administrator privileges…
[2013-06-06T07:43:06+01:00] DEBUG: chef-client has administrator privileges on node QHSW21813.b2b.regn.net.
[2013-06-06T07:43:06+01:00] DEBUG: No chefignore file found at C:/Projects/Dev Ops/Chef/cookbooks/chefignore no files wi
ll be ignored
Compiling Cookbooks…←[0m
[2013-06-06T07:43:06+01:00] DEBUG: Re-raising exception: Chef::Exceptions::CookbookNotFound - Cookbook roles not found.
If you’re loading roles from another cookbook, make sure you configure the dependency in your metadata
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/cookbook/cookbook_collection.rb:38:in `block in i
nitialize’

Is this a bug?

Dan

From: Daniel DeLeo [mailto:ddeleo@kallistec.com] On Behalf Of Daniel DeLeo
Sent: 04 June 2013 17:45
To: chef@lists.opscode.com
Subject: [chef] Re: Chef-solo override-runlist

On Tuesday, June 4, 2013 at 9:20 AM, Gibbons, Daniel (RBI-UK) wrote:
Hi,

I’m trying to pass an override list into chef-solo but I can’t seem to make it accept a role for example this works:

chef-solo -c solo.rb -o "webserver"
Results in:

[2013-06-04T17:15:48+01:00] WARN: Original Run List: [role[marklogic]]
[2013-06-04T17:15:48+01:00] WARN: Overridden Run List: [recipe[webserver]]

But something like:

chef-solo -c solo.rb -o "role[base]"
results in:

[2013-06-04T17:18:27+01:00] WARN: Original Run List: [role[marklogic]]
[2013-06-04T17:18:27+01:00] WARN: Overridden Run List: [recipe[roles]]

Any ideas how I can pass in a role to the override list in chef-solo?

Thanks

Dan
This looks like a legit bug, but I cannot reproduce it easily.

chef-solo -o "role[foo]"
Starting Chef Client, version 11.4.2
[2013-06-04T09:37:26-07:00] WARN: Run List override has been provided.
[2013-06-04T09:37:26-07:00] WARN: Original Run List: []
[2013-06-04T09:37:26-07:00] WARN: Overridden Run List: [role[foo]]
[2013-06-04T09:37:26-07:00] ERROR: Role foo (included by 'top level') is in the runlist but does not exist. Skipping expand.

================================================================================
Error expanding the run_list:
================================================================================


Missing Role(s) in Run List:
----------------------------
* foo included by 'top level'


Original Run List
-----------------
* role[foo]

What version of Chef do you have? Can you run with -ldebug and provide relevant output?


Daniel DeLeo

===================== DISCLAIMER ======================
This message is intended only for the use of the person(s)
(“Intended Recipient”) to whom it is addressed. It may contain
information which is privileged and confidential. Accordingly
any dissemination, distribution, copying or other use of this
message or any of its content by any person other than the Intended
Recipient may constitute a breach of civil or criminal law and is
strictly prohibited. If you are not the Intended Recipient, please
contact the sender as soon as possible.

Reed Business Information Limited.
Registered Office: Quadrant House, The Quadrant, Sutton, Surrey, SM2 5AS, UK.
Registered in England under Company No. 151537

=======================================================


#8

On Thursday, June 6, 2013 at 1:05 AM, Gibbons, Daniel (RBI-UK) wrote:

Hi,

I get the same result with version 11.4.4:

For some reason the –o parameter doesn’t work correctly.

C:\Projects\Dev Ops\Chef>chef-solo -c solo.rb -o “role[base]” -ldebug
Starting Chef Client, version 11.4.4←[0m
[2013-06-06T07:42:04+01:00] INFO: *** Chef 11.4.4 ***
[2013-06-06T07:43:06+01:00] DEBUG: Building node object for localhost
[2013-06-06T07:43:06+01:00] DEBUG: Extracting run list from JSON attributes provided on command line
[2013-06-06T07:43:06+01:00] DEBUG: Applying attributes from json file
[2013-06-06T07:43:06+01:00] DEBUG: Platform is windows version 6.1.7601
[2013-06-06T07:43:06+01:00] WARN: Run List override has been provided.
[2013-06-06T07:43:06+01:00] WARN: Original Run List: []
[2013-06-06T07:43:06+01:00] WARN: Overridden Run List: [recipe[roles]]
[2013-06-06T07:43:06+01:00] INFO: Run List is [recipe[roles]]
[2013-06-06T07:43:06+01:00] INFO: Run List expands to [roles]
[2013-06-06T07:43:06+01:00] INFO: Starting Chef Run for QHSW21813.b2b.regn.net (http://QHSW21813.b2b.regn.net)
[2013-06-06T07:43:06+01:00] INFO: Running start handlers
[2013-06-06T07:43:06+01:00] INFO: Start handlers complete.
[2013-06-06T07:43:06+01:00] DEBUG: Checking for administrator privileges…
[2013-06-06T07:43:06+01:00] DEBUG: chef-client has administrator privileges on node QHSW21813.b2b.regn.net (http://QHSW21813.b2b.regn.net).
[2013-06-06T07:43:06+01:00] DEBUG: No chefignore file found at C:/Projects/Dev Ops/Chef/cookbooks/chefignore no files wi
ll be ignored
Compiling Cookbooks…←[0m
[2013-06-06T07:43:06+01:00] DEBUG: Re-raising exception: Chef::Exceptions::CookbookNotFound - Cookbook roles not found.
If you’re loading roles from another cookbook, make sure you configure the dependency in your metadata
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/cookbook/cookbook_collection.rb:38:in `block in i
nitialize’

Is this a bug?

Dan

I see you’re on Windows, so I think it’s somehow windows related. But definitely a bug. You should file a bug report on tickets.opscode.com


Daniel DeLeo


#9

On Thursday, June 6, 2013 at 8:28 AM, Daniel DeLeo wrote:

On Thursday, June 6, 2013 at 1:05 AM, Gibbons, Daniel (RBI-UK) wrote:

Hi,

I get the same result with version 11.4.4:

For some reason the –o parameter doesn’t work correctly.

C:\Projects\Dev Ops\Chef>chef-solo -c solo.rb -o “role[base]” -ldebug
Starting Chef Client, version 11.4.4←[0m
[2013-06-06T07:42:04+01:00] INFO: *** Chef 11.4.4 ***
[2013-06-06T07:43:06+01:00] DEBUG: Building node object for localhost
[2013-06-06T07:43:06+01:00] DEBUG: Extracting run list from JSON attributes provided on command line
[2013-06-06T07:43:06+01:00] DEBUG: Applying attributes from json file
[2013-06-06T07:43:06+01:00] DEBUG: Platform is windows version 6.1.7601
[2013-06-06T07:43:06+01:00] WARN: Run List override has been provided.
[2013-06-06T07:43:06+01:00] WARN: Original Run List: []
[2013-06-06T07:43:06+01:00] WARN: Overridden Run List: [recipe[roles]]
[2013-06-06T07:43:06+01:00] INFO: Run List is [recipe[roles]]
[2013-06-06T07:43:06+01:00] INFO: Run List expands to [roles]
[2013-06-06T07:43:06+01:00] INFO: Starting Chef Run for QHSW21813.b2b.regn.net (http://QHSW21813.b2b.regn.net)
[2013-06-06T07:43:06+01:00] INFO: Running start handlers
[2013-06-06T07:43:06+01:00] INFO: Start handlers complete.
[2013-06-06T07:43:06+01:00] DEBUG: Checking for administrator privileges…
[2013-06-06T07:43:06+01:00] DEBUG: chef-client has administrator privileges on node QHSW21813.b2b.regn.net (http://QHSW21813.b2b.regn.net).
[2013-06-06T07:43:06+01:00] DEBUG: No chefignore file found at C:/Projects/Dev Ops/Chef/cookbooks/chefignore no files wi
ll be ignored
Compiling Cookbooks…←[0m
[2013-06-06T07:43:06+01:00] DEBUG: Re-raising exception: Chef::Exceptions::CookbookNotFound - Cookbook roles not found.
If you’re loading roles from another cookbook, make sure you configure the dependency in your metadata
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/cookbook/cookbook_collection.rb:38:in `block in i
nitialize’

Is this a bug?

Dan

I see you’re on Windows, so I think it’s somehow windows related. But definitely a bug. You should file a bug report on tickets.opscode.com (http://tickets.opscode.com)

My colleagues did some investigation and it appears to somehow be related to mingw: http://tickets.opscode.com/browse/CHEF-4277

They found that doubling up on quotes seems to work around the issue: chef-solo -o ‘“role[foo]”’

And thanks for filing the bug report, by the way.


Daniel DeLeo


#10

Hi,

Thanks for looking into this, I found that the workaround in ticket http://tickets.opscode.com/browse/CHEF-4277#comment-36700 didn’t quite work but simply using single quotes did the trick to make roles work:

chef-solo -c solo.rb -o ‘role[webServer]’

Thanks

Dan

From: Daniel DeLeo [mailto:ddeleo@kallistec.com] On Behalf Of Daniel DeLeo
Sent: 14 June 2013 16:40
To: chef@lists.opscode.com
Subject: [chef] Re: RE: Re: Chef-solo override-runlist

On Thursday, June 6, 2013 at 8:28 AM, Daniel DeLeo wrote:

On Thursday, June 6, 2013 at 1:05 AM, Gibbons, Daniel (RBI-UK) wrote:

Hi,

I get the same result with version 11.4.4:

For some reason the –o parameter doesn’t work correctly.

C:\Projects\Dev Ops\Chef>chef-solo -c solo.rb -o “role[base]” -ldebug

Starting Chef Client, version 11.4.4←[0m

[2013-06-06T07:42:04+01:00] INFO: *** Chef 11.4.4 ***

[2013-06-06T07:43:06+01:00] DEBUG: Building node object for localhost

[2013-06-06T07:43:06+01:00] DEBUG: Extracting run list from JSON attributes provided on command line

[2013-06-06T07:43:06+01:00] DEBUG: Applying attributes from json file

[2013-06-06T07:43:06+01:00] DEBUG: Platform is windows version 6.1.7601

[2013-06-06T07:43:06+01:00] WARN: Run List override has been provided.

[2013-06-06T07:43:06+01:00] WARN: Original Run List: []

[2013-06-06T07:43:06+01:00] WARN: Overridden Run List: [recipe[roles]]

[2013-06-06T07:43:06+01:00] INFO: Run List is [recipe[roles]]

[2013-06-06T07:43:06+01:00] INFO: Run List expands to [roles]

[2013-06-06T07:43:06+01:00] INFO: Starting Chef Run for QHSW21813.b2b.regn.nethttp://QHSW21813.b2b.regn.net

[2013-06-06T07:43:06+01:00] INFO: Running start handlers

[2013-06-06T07:43:06+01:00] INFO: Start handlers complete.

[2013-06-06T07:43:06+01:00] DEBUG: Checking for administrator privileges…

[2013-06-06T07:43:06+01:00] DEBUG: chef-client has administrator privileges on node QHSW21813.b2b.regn.nethttp://QHSW21813.b2b.regn.net.

[2013-06-06T07:43:06+01:00] DEBUG: No chefignore file found at C:/Projects/Dev Ops/Chef/cookbooks/chefignore no files wi

ll be ignored

Compiling Cookbooks…←[0m

[2013-06-06T07:43:06+01:00] DEBUG: Re-raising exception: Chef::Exceptions::CookbookNotFound - Cookbook roles not found.

If you’re loading roles from another cookbook, make sure you configure the dependency in your metadata

C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/cookbook/cookbook_collection.rb:38:in `block in i

nitialize’

Is this a bug?

Dan

I see you’re on Windows, so I think it’s somehow windows related. But definitely a bug. You should file a bug report on tickets.opscode.comhttp://tickets.opscode.com
My colleagues did some investigation and it appears to somehow be related to mingw: http://tickets.opscode.com/browse/CHEF-4277

They found that doubling up on quotes seems to work around the issue: chef-solo -o ‘“role[foo]”’

And thanks for filing the bug report, by the way.


Daniel DeLeo

===================== DISCLAIMER ======================
This message is intended only for the use of the person(s)
(“Intended Recipient”) to whom it is addressed. It may contain
information which is privileged and confidential. Accordingly
any dissemination, distribution, copying or other use of this
message or any of its content by any person other than the Intended
Recipient may constitute a breach of civil or criminal law and is
strictly prohibited. If you are not the Intended Recipient, please
contact the sender as soon as possible.

Reed Business Information Limited.
Registered Office: Quadrant House, The Quadrant, Sutton, Surrey, SM2 5AS, UK.
Registered in England under Company No. 151537

=======================================================