Description
Diplomat is a Ruby library that gives any Ruby application an HTTP API to Consul. Consul is a distributed key value store, and Diplomat lets your application read and write keys in it. It can also return information about the services currently available in a Consul cluster. The project's FAQ says it works in Rails, and the authors describe using it in their production Rails apps in place of environment variables, which makes it easier to scale and move applications around a cluster. Examples in the README show how to set and read keys and how to inject Diplomat data into ERB templates. For ERB-heavy setups, the FAQ suggests a separate tool named consul-templaterb. Diplomat has dropped Ruby 1.9 support, and the GitHub Actions workflow shows the versions tested. The repository includes contributing guidelines and a wiki with the full API reference, and the library is open source on GitHub.…
Highlights
- Read and write Consul key value data from Ruby
- List services available in a Consul cluster
- Works with Rails applications
- Examples for setting and reading keys
- ERB templating support
Ratings & Reviews
No ratings yet
Be the first to rate Diplomat.
People also visit
Diplomat FAQ
What is Diplomat?
A Ruby library that lets an application talk to Consul over HTTP, reading and writing its key value store.
Does it work with Rails?
Yes. The FAQ says the authors use it in their production Rails apps.
Which Ruby versions are supported?
Ruby 1.9 support was dropped. The GitHub Actions workflow lists the versions currently tested.
How do I install Consul?
The FAQ links to the Consul install guide. The authors say they rolled it out on production machines with Ansible.
What are the best Diplomat alternatives?
Popular alternatives to Diplomat include Consul, Haproxy Openmanager and Rubyapi. See all Diplomat alternatives




