[英]Chef-solo integration with Capistrano
Is there an alternative to the capistrano-chef gem for chef-solo? 厨师独奏会不会有capistrano-chef宝石的替代品? Mostly, to avoid defining server information twice.
通常,避免两次定义服务器信息。
I decided to write a ruby gem to parse the files in nodes/*.json
and transform them to Capistrano-friendly addresses: 我决定编写一个ruby gem来解析
nodes/*.json
的文件,并将其转换为Capistrano友好的地址:
gem "Chef_Solo_Nodes" 宝石“ Chef_Solo_Nodes”
Then, in the cap deploy file: 然后,在cap部署文件中:
require "Chef_Solo_Nodes"
role :app, *Chef_Solo_IPs('app')
role :db, *Chef_Solo_IPs('db')
Which is equivalent to: 等效于:
role :app, "user@host:port", "xx.xx.xx.xx"
role :db, "xx.xx.xx.xx"
Each node/*.json
file can optionally define attributes: 每个
node/*.json
文件都可以选择定义属性:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.