- From: Stephen Corbesero <
>
- To: "
" <
>
- Subject: [chef] RE: Re: How do I set a path for roles, environments, and data bags in my knife.rb?
- Date: Wed, 7 Jan 2015 20:39:08 +0000
- Accept-language: en-US
- Authentication-results: spf=none (sender IP is )
;
Thanks for the link.. I am looking at it now.
According to my understanding of that code, it looks like it should be trying
to set the default "top" to be the directory above the cookbooks path. I
have two issues with that.
1. The cookbook path is usually an array, not a simple string. I even made
my cookbook path just a string, and it still failed.
2. When I try to depend on a path for the other objects, I get an error
message like the following:
% knife environment from file dev.json
ERROR: Could not find or open file 'dev.json' in current directory
or in 'environments/dev.json'
Which is implying that path it is using for the lookup is just
"environments/" and not anything that I have set, or anything that knows
about the top of the chef-repo
--
Stephen Corbesero, DevOps Engineer
-----Original Message-----
From: AJ Christensen
[mailto:
Sent: Wednesday, January 07, 2015 3:23 PM
To:
Subject: [chef] Re: How do I set a path for roles, environments, and data
bags in my knife.rb?
https://github.com/opscode/chef/blob/master/lib/chef/config.rb#L111-L128
On Thu, Jan 8, 2015 at 9:13 AM, Stephen Corbesero
<
>
wrote:
>
>
>
The knife.rb lets you specify a cookbook_path.
>
>
>
>
I want to get the same effect for roles, environments, and data bags.
>
>
>
>
I have the following in my knife.rb file
>
>
>
>
current_dir = File.dirname(__FILE__)
>
>
cookbook_path ["#{current_dir}/../cookbooks"]
>
>
>
>
# the following don't seem to work. :(
>
>
>
>
role_path ["#{current_dir}/../roles"]
>
>
environment_path ["#{current_dir}/../environments"]
>
>
data_bag_path ["#{current_dir}/../data_bags"]
>
>
>
>
I remember seeing how to do this somewhere along time ago, but I can’t
>
find the original reference. I have been looking, and I see several
>
references that strongly imply these should work, or something similar
>
like making the object name plural (roles_path)
>
>
>
>
I have tried several permutations, including statements like
>
knife[:role_path] = …, but nothing seems to work.
>
>
>
>
Is it possible What is the correct format?
>
>
>
>
Thanks in advance.
>
>
>
>
--
>
>
Stephen Corbesero, DevOps Engineer
>
>
Synchronoss - Mobile Innovation for a Connected World
>
>
>
| www.synchronoss.com
>
>
>
>
Archive powered by MHonArc 2.6.16.