Search code examples
service-discoveryconsul

How can I distribute the service discovery tool consul to linux hosts?


Consul isn't currently published in a package manager format. Whats a good way to distribute it across many systems and ensure its installed in a consistent manner?


Solution

  • I found that you can easily create a package from the consul binary using fpm:

    fpm --verbose -s dir -t rpm -n consul -v 0.4 --url=http://consul.io --vendor=HashiCorp  --description "A distributed service discovery tool" ./consul_/consul=/usr/local/bin/consul
    

    That command will create an rpm file in your current working directory. You can also use 'deb' with the -t flag to create a deb package instead.

    If you don't already have fpm installed, you can install it with rubygems:

    gem install fpm
    

    FPM requires the tools needed to create the package type you choose, so best to install this on a like system (Red Hat or Debain variant for RPM and DEB respectively)