问题
I have data bags specific to different clients like the following:
/data_bags/client1/users/....
/data_bags/client1/projects/....
/data_bags/client2/users/...
/data_bags/client2/projects/...
So, client1
and client2
have a different set of projects and users, but me as a developer it's better if all the configurations are under folder. I work on them, then when they are production ready, I want to push them to chef server to provision the nodes. But knife.rb
expects all the data bags to be under one folder i.e. /data_bags
. It would be perfect If I can specify a data bag path as such:
cookbook_path ["#{current_dir}/../cookbooks", "#{current_dir}/../other-cookbooks"]
databag_path "#{current_dir}/../data_bags/client1"
My goal is to arrange or organize different data bags collection in a different folder and specify which bag path I want to use by knife.rb
Is there a way to specify the paths of the data bags as well?
来源:https://stackoverflow.com/questions/41568041/how-to-specify-a-data-bag-path-in-knife-rb-configuration-file