Home

Awesome

topface.marathon_app

Deploy apps on Marathon from ansible.

Usage

This role deploys app on Marathon via PUT /v2/apps/{appId} API.

Role configuration

Example

The next playbook deploys Chronos on marathon with single instance and waits for deployment to finish.

- hosts: marathon-api-server
  gather_facts: no
  roles:
    - role: topface.marathon_app
      tags:
        - chronos
      marathon_url: http://marathon.dev:8080
      marathon_app:
        id: /chronos
        cmd: exec /usr/bin/chronos run_jar --cluster_name Dev --http_port $PORT --master zk://zk:2181/mesos --zk_hosts zk:2181 --mesos_framework_name chronos
        container:
          type: DOCKER
          docker:
            image: mesosphere/chronos:chronos-2.3.2-0.1.20150207000917.ubuntu1404-mesos-0.21.1-1.1.ubuntu1404
        instances: 1
        cpus: 0.5
        mem: 512
        ports:
          - 10101
        labels:
          marathoner_haproxy_enabled: "true"
        healthChecks:
          - protocol: HTTP
            path: /scheduler/jobs
            gracePeriodSeconds: 15
            maxConsecutiveFailures: 3
            intervalSeconds: 5
            timeoutSeconds: 5

See topface.chronos_task to learn how to run tasks on Chronos launched this way.

License

MIT