consul-migrate
consul-migrate is a Ruby gem for migrating Consul's ACL datacenter. Consul does not natively support such migration mechanism, but does provide an API for accessing ACLs. consul-migrate uses this API to export ACL tokens from the current authoritative ACL datacenter and import them to another datacenter.
Installation
Add this line to your application's Gemfile:
gem 'consul-migrate'
And then execute:
$ bundle
Or install it yourself as:
$ gem install consul-migrate
Usage
From the current authoritative ACL datacenter:
require 'consul/migrate'
client = Consul::Migrate::Client.new(acl_token: 'your-acl-master-token')
client.export_acls('/path/to/file')
From the desired new ACL datacenter:
require 'consul/migrate'
client = Consul::Migrate::Client.new(acl_token: 'your-acl-master-token')
client.import_acls('/path/to/file')
Caveats
consul-migrate currently is only set up to work with the default -client
(127.0.0.1) and default http port (8500). Future versions of consul-migrate should have parameters for inputing these values.
Contributing
- Fork it ( https://github.com/[my-github-username]/consul-migrate/fork )
- 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 a new Pull Request
TODO
- Have it work as a cli so that scripting is not necessary
- Include port and address as options instead of hardcoded values.
- Spec test should also test for default policy allow case