Forge Home

marathon

Mesosphere Marathon installation / management module

15,940 downloads

11,384 latest version

3.1 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.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 1.0.12 (latest)
  • 1.0.11
  • 1.0.10
  • 1.0.9
  • 1.0.8
  • 1.0.6
  • 1.0.5
  • 1.0.4
  • 1.0.3
  • 1.0.2
  • 1.0.1
  • 1.0.0
released May 21st 2015
This version is compatible with:
  • Puppet Enterprise 3.x
  • Puppet 3.x

Start using this module

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

Add this module to your Puppetfile:

mod 'pennycoders-marathon', '1.0.12'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add pennycoders-marathon
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install pennycoders-marathon --version 1.0.12

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

pennycoders/marathon — version 1.0.12 May 21st 2015

Puppet module for mesosphere's Marathon

This module installs and configures Mesosphere's marathon task runner.

Classes:

  • marathon: This is the main class, all the other sub-classes inherit from it.
    • Parameters:
class marathon(
    # Install or uninstall (present|absent)
      $installation_ensure      = 'present',
    # Marathon binary url
      $url                      = 'https://downloads.mesosphere.io/marathon/v0.8.2-RC1/marathon-0.8.2-RC1.tgz',
    # Marathon binary digest string
      $digest_string            = '45a481f4703e1455f8aafa037705c9033200f2dc7f9d5e6414acde533d6cb935',
    # The digest type
      $digest_type              = 'sha256',
    # Temporary directory to download the files to
      $tmp_dir                  = '/tmp',
    # Marathon Installation directory
      $install_dir              = '/opt/marathon',
    # The username that marathon will submit tasks as
      $user                     = 'root',
    # Create symlinks for the marathon binaries for easier access
      $create_symlinks          = true,
    # Whether to use haproxy for load balancing between services
      $haproxy_discovery        = false,
    # Whether to use nginx for load balancing between services
      $nginx_discovery          = false,
    # Create and manage the marathon service
      $manage_service           = true,
    # The marathon service's name
      $service_name             = 'marathon',
    # The marathon options
      $options                  = hiera('classes::marathon::options', { }),
    # Manage the firewall rules
      $manage_firewall          = false,
    # Manage the user that the tasks will be submitted as
      $manage_user              = true,
    # Whether or not the integrity of the archive should be verified
      $checksum                 = true,
    # Whether or not to use consul (http://consul.io) for service discovery
      $consul_discovery         = false,
    # Consul configuration
      $consul_options           = hiera('classes::consul::options',{ }),
    # Whether to install consul-template or not
      $install_consul_template  = false,
    # Consul-template options
      $consul_template_options  = hiera('classes::consul_template::options', { }),
    # Consul template watches
      $consul_template_watches  = hiera('classes::consul_template::watches', { }),
    # Whether to install docker or not
      $install_docker           = true,
    # Docker socket path
      $docker_socket_bind       = '/var/run/docker.sock',
    # Docker DNS
      $docker_dns               = '8.8.8.8',
    # Whether to install registraator or not
      $install_registrator      = true,
    # How often should registrator query docker for services (See: https://github.com/gliderlabs/registrator)
      $registrator_resync       = 30,
    # Additional registrator flags
      $registrator_args         = '',
    # Setup consul DNS forwarding (see https://www.consul.io/docs/guides/forwarding.html for more details)
      $setup_dns_forwarding     = false
) {
  • marathon::install: This is the class that actually installs and configures marathon
    • Parameters:
class marathon::install (
    # Install or uninstall (present|absent)
      $installation_ensure      = $marathon::installation_ensure,
    # Marathon binary url
      $url                      = $marathon::url,
    # Marathon binary digest string
      $digest_string            = $marathon::digest_string,
    # The digest type
      $digest_type              = $marathon::digest_type,
    # Temporary directory to download the files to
      $tmp_dir                  = $marathon::tmp_dir,
    # Marathon Installation directory
      $install_dir              = $marathon::install_dir,
    # The username that marathon will submit tasks as
      $user                     = $marathon::user,
    # Create symlinks for the marathon binaries for easier access
      $create_symlinks          = $marathon::create_symlinks,
    # Whether to use haproxy for load balancing between services
      $haproxy_discovery        = $marathon::haproxy_discovery,
    # Whether to use nginx for load balancing between services
      $nginx_discovery          = $marathon::nginx_discovery,
    # Create and manage the marathon service
      $manage_service           = $marathon::manage_service,
    # The marathon service's name
      $service_name             = $marathon::service_name,
    # The marathon options
      $options                  = $marathon::options,
    # Manage the firewall rules
      $manage_firewall          = $marathon::manage_firewall,
    # Manage the user that the tasks will be submitted as
      $manage_user              = $marathon::manage_user,
    # Whether or not the integrity of the archive should be verified
      $checksum                 = $marathon::checksum,
    # Whether or not to use consul (http://consul.io) for service discovery
      $consul_discovery         = $marathon::consul_discovery,
    # Consul configuration
      $consul_options           = $marathon::consul_options,
    # Whether to install consul-template or not
      $install_consul_template  = $marathon::install_consul_template,
    # Consul-template options
      $consul_template_options  = $marathon::consul_template_options,
    # Consul template watches
      $consul_template_watches  = hiera('classes::consul_template::watches', { }),
    # Whether to install docker or not
      $install_docker           = $marathon::install_docker,
    # Docker socket path
      $docker_socket_bind       = $marathon::docker_socket_bind,
    # Docker DNS
      $docker_dns               = $marathon::docker_dns,
    # Whether to install registraator or not
      $install_registrator      = $marathon::install_registrator,
    # How often should registrator query docker for services (See: https://github.com/gliderlabs/registrator)
      $registrator_resync       = $marathon::registrator_resync,
    # Additional registrator flags
      $registrator_args         = $marathon::registrator_args,
    # Setup consul DNS forwarding (see https://www.consul.io/docs/guides/forwarding.html for more details)
      $setup_dns_forwarding     = $marathon::setup_dns_forwarding
) inherits marathon {
  • marathon::haproxy_config: This is the class that actually installs and configures haproxy
    • Parameters:
class marathon::haproxy_config (
    # Install or uninstall (present|absent)
      $installation_ensure      = $marathon::installation_ensure,
    # Marathon binary url
      $url                      = $marathon::url,
    # Marathon binary digest string
      $digest_string            = $marathon::digest_string,
    # The digest type
      $digest_type              = $marathon::digest_type,
    # Temporary directory to download the files to
      $tmp_dir                  = $marathon::tmp_dir,
    # Marathon Installation directory
      $install_dir              = $marathon::install_dir,
    # The username that marathon will submit tasks as
      $user                     = $marathon::user,
    # Create symlinks for the marathon binaries for easier access
      $create_symlinks          = $marathon::create_symlinks,
    # Whether to use haproxy for load balancing between services
      $haproxy_discovery        = $marathon::haproxy_discovery,
    # Whether to use nginx for load balancing between services
      $nginx_discovery          = $marathon::nginx_discovery,
    # Create and manage the marathon service
      $manage_service           = $marathon::manage_service,
    # The marathon service's name
      $service_name             = $marathon::service_name,
    # The marathon options
      $options                  = $marathon::options,
    # Manage the firewall rules
      $manage_firewall          = $marathon::manage_firewall,
    # Manage the user that the tasks will be submitted as
      $manage_user              = $marathon::manage_user,
    # Whether or not the integrity of the archive should be verified
      $checksum                 = $marathon::checksum,
    # Whether or not to use consul (http://consul.io) for service discovery
      $consul_discovery         = $marathon::consul_discovery,
    # Consul configuration
      $consul_options           = $marathon::consul_options,
    # Whether to install consul-template or not
      $install_consul_template  = $marathon::install_consul_template,
    # Consul-template options
      $consul_template_options  = $marathon::consul_template_options,
    # Consul template watches
      $consul_template_watches  = hiera('classes::consul_template::watches', { }),
    # Whether to install docker or not
      $install_docker           = $marathon::install_docker,
    # Docker socket path
      $docker_socket_bind       = $marathon::docker_socket_bind,
    # Docker DNS
      $docker_dns               = $marathon::docker_dns,
    # Whether to install registraator or not
      $install_registrator      = $marathon::install_registrator,
    # How often should registrator query docker for services (See: https://github.com/gliderlabs/registrator)
      $registrator_resync       = $marathon::registrator_resync,
    # Additional registrator flags
      $registrator_args         = $marathon::registrator_args,
    # Setup consul DNS forwarding (see https://www.consul.io/docs/guides/forwarding.html for more details)
      $setup_dns_forwarding     = $marathon::setup_dns_forwarding
) inherits marathon {

Usage example:

class {'marathon':
    manage_firewall => true,
    service_name    => 'marathon',
    manage_user     => true,
    user            => 'root'
}

Important:

Before using this module, please see:

Other notes

Pay attention when specifying the marathon options in Hiera, specially the ones requiring double quotes or special characters, such as in the example below.

    "ACCESS_CONTROL_ALLOW_ORIGIN":"\\\"*\\\"",

As you can see, since I am using the json Hiera backend, both the " and the \ need to be present within the service file. Due to the fact that within the template they are already within double quotes, I had to make sure I escape them propperly.

Have fun!

NEW FEATURES:

  • Flexible load balancing configuration (Now you can also opt for nginx, as your load balancer (ver. 1.0.12 and above)
  • You can now configure dns forwarding, by using consul's dns interface (see https://www.consul.io/docs/agent/dns.html and https://www.consul.io/docs/guides/forwarding.html for more details) (ver. 1.0.12 and above).
  • You can also set as many template watchers as you want, for any (custom) load balancer, or anything that supports a file-based configuration. (ver. 1.0.12 and above).