0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Gem that can be used to import and export Consul ACL tokens
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 0.6
~> 10.0
~> 3.1
~> 1.4
~> 1.21

Runtime

~> 0.19
 Project Readme

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')

CLI

Basic usage commands:

$ consul-migrate init -t 'your-acl-master-token'
$ consul-migrate export -f 'path/to/file'
$ consul-migrate import -f 'path/to/file'

Refer to consul-migrate help for more detailed usage commands.

Contributing

  1. Fork it ( https://github.com/[my-github-username]/consul-migrate/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

TODO

  1. Spec test should also test for default policy allow case