How to specify a data bag path in knife.rb configuration file?

心不动则不痛 提交于 2019-12-11 08:44:22

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!