Skip to content

Puppet type and providers for managing configuration in key/value stores

License

Notifications You must be signed in to change notification settings

bigcommerce/garethr-key_value_config

 
 

Repository files navigation

Maybe your configuration data isn't in files on disk, but in a new fancy distributed configuration store. But you still want to manage that configuration in code. Enter the key_value_config type for Puppet.

Puppet Forge Build Status

Usage

Currently this type has two providers for Etcd and Consul but writing other providers for Zookeeper or similar services should be trivial.

So setting a value for Etcd:

key_value_config { '/foo':
  ensure   => present,
  provider => etcd,
  value    => 'bar',
}

Or alternatvely for Consul:

key_value_config { '/foo':
  ensure   => present,
  provider => consul,
  value    => 'bar',
}

Configuration

By default the provider will try and talk with an Etcd node on localhost on port 4001. You can adjust this behaviour using environment variables, specifically: ETCD_HOST, ETCD_PORT, ETCD_USERNAME and ETCD_PASSWORD.

The Consul provider currently tries to access Consul on localhost:8500 and isn't configurable. This is because I couldn't find a configurable Consul client.

A note on error handling

There isn't any. If you don't pass workable keys and values then you'll likely get errors. I'll hopefully add sensible validation and remove this message in the future.

About

Puppet type and providers for managing configuration in key/value stores

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 94.1%
  • Puppet 5.9%