skip to navigation
skip to content

Not Logged In

passport 0.1.1

Light weight configuration management using Consul

Light weight configuration management using Consul

Passport is a command line tool for rendering templates containing information gained from Consul’s Service Discovery API and Key/Value database.

Installation

Passport is available via pypi and can be installed with easy_install or pip:

pip install passport

Usage

usage: passport.py [-h] [--host HOST] [--port PORT] [--datacenter DATACENTER]
                   {kv,file} path destination

Example

As an example, the following template is stored in the KV database as templates/memcached/memcached.conf

{% set nodes = ['%s:%s' % (r['Address'], r['ServicePort']) for r in consul.catalog.service('memcached')] %}

[memcached]
    servers = {{ ','.join(nodes) }}

Invoking passport will render the file with a list of all memcached nodes to /etc/memcached.conf.

passport kv templates/memcached/memcached.conf /etc/memcached.conf

And the output would look something like:

[memcached]
    servers = 172.17.0.7:11211,172.17.0.8:11211

Template rendering is done via the Tornado Template engine.

Todo

  • Add a managed mode where Passport will check for new services on a regular interval and when changes occur, update the rendered template and notify a process using HUP
  • Add daemonization for managed mode
  • Add the ability to specify pairs of templates/destinations in a single invocation
 
File Type Py Version Uploaded on Size
passport-0.1.1.tar.gz (md5) Source 2014-07-22 4KB
  • Downloads (All Versions):
  • 0 downloads in the last day
  • 27 downloads in the last week
  • 40 downloads in the last month