Chef-solo integration with Capistrano
-
24-05-2021 - |
Question
Is there an alternative to the capistrano-chef gem for chef-solo? Mostly, to avoid defining server information twice.
Solution
I found something fresh and hot on the topic:
Gemfile:
gem 'roundsman', :require => false
Capfile:
require 'roundsman/capistrano'
See readme for details.
OTHER TIPS
I decided to write a ruby gem to parse the files in nodes/*.json
and transform them to Capistrano-friendly addresses:
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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow