Forge Home

synapse

Puppet configuration for Airbnbs system for service discovery. Configures a dynamic HAproxy based on zookeeper entries

11,355 downloads

6,616 latest version

3.9 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.0.6 (latest)
  • 0.0.5
  • 0.0.4
  • 0.0.3
  • 0.0.2
  • 0.0.1
released Sep 7th 2016

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'KyleAnderson-synapse', '0.0.6'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add KyleAnderson-synapse
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install KyleAnderson-synapse --version 0.0.6

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

KyleAnderson/synapse — version 0.0.6 Sep 7th 2016

#synapse Build Status Puppet Forge Puppet Forge

Description

This puppet module configures Synapse, a service discovery system by Airbnb. Synapse configures a local HAproxy running on every node, configured dynamically from Zookeeper entries.

##Installation

puppet module install KyleAnderson/synapse
# Or librarian-puppet, r10k, whatever.

What this module affects

  • /etc/synapse/ for configs
  • Installs synapse (either via gem or system package
  • Installs and configures HAproxy

HAproxy considerations

This module is incompatible with an existing instance of HAProxy running. Synapse overwrites the HAProxy config file.

Usage Examples

Start off by getting synapse installed and running:

class { 'synapse':
  package_provider => 'gem'
}

Now you can prep synapse for listening for services. Syntax is a little tricky, but follows the syntax in example configs. All parameters are validated, so puppet won't let you insert invalid syntax:

synapse::service { 'service1':
  ensure => 'present',
  default_servers => [
    {
      "name" => "default1",
      "host" => "localhost",
      "port" => 8422
    }
  ],
  discovery => {
    "method" => "zookeeper",
    "path"   => "/airbnb/service/service2",
    "hosts"  =>  [
      "zk0.airbnb.com:2181",
      "zk1.airbnb.com:2181"
    ]
  },
  haproxy => {
    "port"           => '3214',
    "server_options" => "check inter 2s rise 3 fall 2",
    "listen"         => [
      "mode http",
      "option httpchk /health",
    ]
  },
}

Limitations

I assume that you are using a modern version of ruby on the puppetmaster. It outputs json, so either use ruby 1.9 with built in JSON or have the JSON gem available. Pull requests welcome for a better way to do this.

##Development Open an issue or fork and open a Pull Request