Capistrano::SrvHosts
Capistrano extension to fetch deploy hosts via DNS SRV records.
Installation
Add this line to your application's Gemfile:
gem 'capistrano-srv_hosts'
And then execute:
$ bundle
Or install it yourself:
$ gem install capistrano-srv_hosts
Usage
Create appropriate DNS records, e.g.:
# service proto name ttl class type priority weight port target
_service._tcp.example.com 3600 IN SRV 10 1000 0 server01.example.com
_service._tcp.example.com 3600 IN SRV 20 1000 0 server02.example.com
Configure your config/deploy.rb:
At the top add:
require 'capistrano/srv_hosts'
Then you can define roles like this:
srv_role :app, '_service._tcp.example.com'
srv_role :web, '_service._tcp.example.com', :primary => true
And like this:
role :db, srv_hosts('_service._tcp.example.com').first, :primary => true
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Copyright
© Rally Software Development Corp. Released under MIT license, see LICENSE for details.