Coder Social home page Coder Social logo

ansible-marathon-module's Introduction

Ansible Role: marathon-deploy

An Ansible role that helps deploying applications on marathon.

The core of the role is a module to support an operation like

- name: run application on marathon
  marathon: uri=http://marathon-node:8080 app_json='nginx.json' state=present

or like

- name: run application on marathon
  marathon: uri=http://marathon-node:8080 app='{{ var_describing_app | to_json }}' state=present

Requirements

The module shipping with the role is supposed to run on a node that can send REST requests to the marathon endpoint. Typically this could be the localhost.

The following python modules are needed:

  • marathon

Usage

Among the various states supported by the module, all will require either one of the two following parameters:

  • app_json: a path to a file (located on the machine to be managed) that contains the JSON application definition for Marathon to manage the app.
  • app: a JSON-encoded object that describes the application for Marathon to manage.

Consult the Marathon documentation to grok the specification of the JSON objects that Marathon uses to describe applications.

Example Playbook

You will need to assign the marathon-deploy role to access the marathon module

- hosts: 127.0.0.1
  connection: local
  vars:
    app:
        id: prometheus
        instances: 1
        cpus: 1
        mem: 512
        container:
            type: "DOCKER"
            docker:
            image: "prom/prometheus:latest"
            network: "BRIDGE"
            privileged: false
            forcePullImage: true
            portMappings: []
        healthChecks: []
        upgradeStrategy:
            maximumOverCapacity: 0
            minimumHealthCapacity: 0
        labels:
            "MARATHON_SINGLE_INSTANCE_APP": "true"
  roles:
    - marathon-deploy
  tasks:
    - name: run Prometheus on marathon
      marathon: uri=http://marathon-node:8080 app='{{ app | to_json }}' state=present

ansible-marathon-module's People

Contributors

lhoss avatar lucianof avatar rudd-o avatar vincepii avatar

Watchers

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