简体   繁体   中英

Chef-solo integration with Capistrano

Is there an alternative to the capistrano-chef gem for chef-solo? Mostly, to avoid defining server information twice.

I found something fresh and hot on the topic:

Roundsman

Gemfile:

gem 'roundsman', :require => false

Capfile:

require 'roundsman/capistrano'

See readme for details.

I decided to write a ruby gem to parse the files in nodes/*.json and transform them to Capistrano-friendly addresses:

gem "Chef_Solo_Nodes"

Then, in the cap deploy file:

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:

  • ipaddress
  • user (or login)
  • port

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM