Giter Club home page Giter Club logo

puppet-consul's Introduction

#puppet-consul Build Status

##Installation

##Compatibility

Any module release that is tagged with 0.4.* is compatible with the 0.4.x versions of consul. Anything tagged with 0.5.* is compatible with consul 0.5.x, etc.

So, if you are using consul 0.4.1, try to use the lastes tagged release on the 4 series. Do not pull from master.

###What This Module Affects

  • Installs the consul daemon (via url or package)
  • Optionally installs a user to run it under
  • Installs a configuration file (/etc/consul/config.json)
  • Manages the consul service via upstart, sysv, or systemd
  • Optionally installs the Web UI

##Usage

class { 'consul':
  config_hash => {
      'datacenter' => 'east-aws',
      'data_dir'   => '/opt/consul',
      'log_level'  => 'INFO',
      'node_name'  => 'foobar',
      'server'     => true
  }
}

##Web UI

To install and run the Web UI, include ui_dir in the config_hash. You may also want to change the client_addr to 0.0.0.0 from the default 127.0.0.1, for example:

class { 'consul':
  config_hash => {
      'datacenter'  => 'east-aws',
      'data_dir'    => '/opt/consul',
      'ui_dir'      => '/opt/consul/ui',
      'client_addr' => '0.0.0.0',
      'log_level'   => 'INFO',
      'node_name'   => 'foobar',
      'server'      => true
  }
}

For more security options, consider leaving the client_addr set to 127.0.0.1 and use with a reverse proxy:

  $aliases = ['consul', 'consul.example.com']

  # Reverse proxy for Web interface
  include 'nginx'

  $server_names = [$::fqdn, $aliases]

  nginx::resource::vhost { $::fqdn:
    proxy       => 'http://localhost:8500',
    server_name => $server_names,
  }

Service Definition

To declare the availability of a service, you can use the service define. This will register the service through the local consul client agent and optionally configure a health check to monitor its availability.

consul::service { 'redis':
  tags           => ['master'],
  port           => 8000,
  check_script   => '/usr/local/bin/check_redis.py',
  check_interval => '10s',
}

See the service.pp docstrings for all available inputs.

You can also use consul::services which accepts a hash of services, and makes it easy to declare in hiera.

Watch Definitions

consul::watch { 'my_watch':
  type        => 'service',
  handler     => 'handler_path',
  service     => 'serviceName',
  service_tag => 'serviceTagName',
  passingonly => 'true',
}

See the watch.pp docstrings for all available inputs.

You can also use consul::watches which accepts a hash of watches, and makes it easy to declare in hiera.

Check Definitions

consul::check { 'true_check':
  interval => '30s',
  script   => 'true',
}

See the check.pp docstrings for all available inputs.

You can also use consul::checks which accepts a hash of checks, and makes it easy to declare in hiera.

##Limitations

Depends on the JSON gem, or a modern ruby.

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

puppet-consul's People

Contributors

benschw avatar bodepd avatar croomes avatar evankrall avatar ianlunam avatar jfroche avatar jrnt30 avatar jsok avatar kennyg avatar lynxman avatar nukemberg avatar solarkennedy avatar sorenisanerd avatar tayzlor avatar tiewei avatar tracyde avatar tylerwalts avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.