Git Product home page Git Product logo

ansible-marathon's Introduction

ansible-marathon

Build Status Gitter

Apache Marathon playbook with optional HAProxy configuration support.

Note that current Ansible Marathon version requires Java8 you can find how to install it below.

Installation

ansible-galaxy install JasonGiedymin.marathon

Requirements

  • Java 8
  • Apache Zookeeper
  • Apache Mesos

Role Variables

---
marathon_version: "1.3.6"

# Debian: Mesosphere apt repository URL
marathon_apt_package: "marathon={{ marathon_version }}-*"
marathon_apt_repo: "deb http://repos.mesosphere.com/{{ansible_distribution|lower}} {{ansible_distribution_release|lower}} main"
marathon_apt_key_id: 'E56151BF'
marathon_apt_key_server: 'keyserver.ubuntu.com'
# undefined if using key server; if set, will override adding key from key_server above
marathon_apt_key_url:
# Debian apt pin priority for the marathon package. If empty (the default), no pin priority is used.
marathon_apt_pin_priority:

# RedHat: Mesosphere yum repository URL
marathon_yum_package: "marathon-{{ marathon_version }}"
mesosphere_yum_repo: "http://repos.mesosphere.com/el/{{ os_version_major }}/noarch/RPMS/{{ mesosphere_releases[os_version_major] }}"

marathon_hostname: "{{ inventory_hostname }}"
marathon_port: 8080
marathon_env_java_opts: '-Xmx512m'
marathon_env_vars:
  - "JAVA_OPTS={{ marathon_env_java_opts }}"

# command line flags:
# https://mesosphere.github.io/marathon/docs/command-line-flags.html
# Marathon reads files under /etc/marathon/conf and adds them to CLI
# The path to Zookeeper which Marathon can use to find the Mesos masters and use as a state store.
zookeeper_hostnames: "localhost:2181"

# The path to Mesos in the Zookeeper cluster
mesos_zookeeper_path: "/mesos"

# The path to Marathon in the Zookeeper cluster
marathon_zookeeper_path: "/marathon"
mesos_zookeeper_masters: "zk://{{ zookeeper_hostnames }}{{ mesos_zookeeper_path }}"
marathon_zookeeper_state: "zk://{{ zookeeper_hostnames }}{{ marathon_zookeeper_path }}"

# The path to install the haproxy configuration script. If this is an empty string ```""``` haproxy configuration will be disabled.
haproxy_script_location: "/usr/local/bin"

# **Mesos** SSL support
mesos_ssl_enabled: false # When mesos has SSL enabled, set to true and fill in other `mesos_ssl_` variables.
mesos_ssl_support_downgrade: false
mesos_ssl_key_file: # When mesos SSL is enabled this must be used to point to the SSL key file
mesos_ssl_cert_file: # When mesos SSL is enabled this must be used to point to the SSL certificate file

# optional
artifact_store: ""
checkpoint: "true"
marathon_mesos_role: ""
# off, fatal, error, warn, info (default), debug, trace, all.
marathon_logging_level: ""

marathon_additional_configs: []
#    For example:
#    - name: task_lost_expunge_interval
#      value: 900000

Dependencies

Example Playbook

- hosts: all
  tasks:
    - name: Installing repo for Java 8 for Debian
      apt_repository: repo='ppa:openjdk-r/ppa'
      when:
        - ansible_os_family == 'Debian'
        - ansible_distribution_version|version_compare(16.04, '<')

- name: Install dependencies
  hosts: all
  roles:
    - role: geerlingguy.java
      java_packages:
        - openjdk-8-jdk
      when: ansible_os_family == 'Debian'

    - role: geerlingguy.java
      java_packages:
        - java-1.8.0-openjdk
      when: ansible_os_family == 'RedHat'

    - role: AnsibleShipyard.ansible-zookeeper
    - role: JasonGiedymin.mesos
      mesos_install_mode: master-slave

    - role: JasonGiedymin.marathon

HAProxy Support

A cron job is configured to run the haproxy_dns_cfg script which will query the marathon api for applications and setup the appropriate frontend (listening on port 80) with backends for each application. HAProxy will look for a hostname prefixed with the application name and route to that backend. Using this technique you can wildcard a dns host to all your masters (say, *.example.com) and an application you launch (say, "myapp") will be available at myapp.example.com. This can be disabled by setting the haproxy_script_location to an emptry string "". It will only be installed if HAProxy is present.

License

Apache License Version 2.0, January 2004

AnsibleShipyard

Our related playbooks

  1. ansible-mesos
  2. ansible-chronos
  3. ansible-zookeeper

Author Information

@AnsibleShipyard/developers and others.

ansible-marathon's People

Contributors

mhamrah avatar ernestas-poskus avatar jasongiedymin avatar veger avatar lhoss avatar ninthnails avatar loliee avatar vincepii avatar fpgeek avatar froesef avatar frankhinek avatar jaytaylor avatar jreijn avatar ludovicc avatar maxkarelov 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.