문제

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top