Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

dirkjonker/ansible-dcos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible DC/OS modules

This can be used to control DC/OS.

Requirements: dcos-python package installed, e.g. pip install dcos-python

Note: this has only been tested with DC/OS 1.10. There are probably lots of bugs. Please report them on github, or create a pull request!

Examples

Connecting to a cluster, note this will automatically refresh the auth token if it will expire in the next 60 minutes or so.

- name: Connect to cluster
  dcos_connection:
    url: https://dcos-cluster.example.com
    username: sysadmin
    password: "{{ sysadm_pwd }}"

Installing packages form universe:

- name: Ensure Spark is installed
  dcos_package:
    name: spark
    app_id: namespace/spark
    state: present
    version: 2.3.1-2.2.1-2
    options:
      service:
        docker-image: "mesosphere/spark:2.3.1-2.2.1-2-hadoop-2.7"
        UCR_containerizer: true
        user: root

Running Marathon applications:

- name: Run a Marathon application
  dcos_marathon:
    app_id: nginx
    state: present
    resource:
      cpu: 1
      mem: 128
      instances: 1
      container:
        type: MESOS
        docker:
          image: nginx

Managing IAM users, groups, permissions:

- name: Ensure a permission resource exists
  dcos_iam_resource:
    rid: dcos:mesos:master:framework:role:*
    state: present

- name: Create a group
  dcos_iam_group:
    gid: test_group
    description: test group created by Ansible
    state: present
    permissions:
      - rid: dcos:mesos:master:framework:role:*
        action: read

- name: Create a user
  dcos_iam_user:
    uid: test_user
    description: test user created by Ansible
    password: "{{ lookup('password', '/dev/null') }}"
    groups:
      - test_group

Managing secrets:

- name: create a secret
  dcos_secret:
    path: foo/password
    value: "{{ lookup('password', '/dev/null') }}"

For more documentation about the modules please check the documentation in the modules subdirectory.

Known limitations

  • Packages and Marathon apps can not be updated in-place
  • Users cannot be assigned permissions individually.
  • Error handling is very minimal, some Python experience is required. You may have to inspect the dcos-python source code.

All of the above is fixable in either the action plugin or the dcos-python package. Please open issues or pull requests if you find more problems.

About

Collection of Ansible modules to control DC/OS

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages