dcos.dcos_requirements
Ansible Roles: Mesosphere DC/OS
This is a collection of Ansible Roles to manage a DC/OS cluster on RedHat/CentOS Linux.
Requirements
To effectively use these roles, your nodes should follow the setup recommended by Mesosphere. Depending on your configuration, you need to deploy to:
- One or more master nodes ('masters')
- One bootstrap node ('bootstraps')
- Zero or more agent nodes for public services ('agents_public')
- One or more agent nodes for private services ('agents_private')
Example Inventory File
Here’s an example of how your inventory file might look:
[bootstraps]
bootstrap1-dcos112s.example.com
[masters]
master1-dcos112s.example.com
master2-dcos112s.example.com
master3-dcos112s.example.com
[agents_private]
agent1-dcos112s.example.com
remoteagent1-dcos112s.example.com
[agents_public]
publicagent1-dcos112s.example.com
[agents:children]
agents_private
agents_public
[common:children]
bootstraps
masters
agents
agents_public
Role Variables
The Mesosphere DC/OS Ansible roles use two types of variables:
- Per-node type variables (group_vars)
- A multi-level dictionary called
dcos
, available to all nodes
Per Group Variables
[bootstraps:vars]
node_type=bootstrap
[masters:vars]
node_type=master
dcos_legacy_node_type_name=master
[agents_private:vars]
node_type=agent
dcos_legacy_node_type_name=slave
[agents_public:vars]
node_type=agent_public
dcos_legacy_node_type_name=slave_public
Global Variables
dcos:
download: "https://downloads.dcos.io/dcos/stable/1.13.4/dcos_generate_config.sh"
download_checksum: "sha256:a3d295de33ad55b10f5dc66c9594d9175a40f5aaec7734d664493968a9f751fd"
version: "1.13.4"
enterprise_dcos: false
selinux_mode: enforcing
config:
cluster_name: "examplecluster"
security: strict
bootstrap_url: http://int-bootstrap1-examplecluster.example.com:8080
exhibitor_storage_backend: static
master_discovery: static
master_list:
- 172.31.42.1
Cluster-wide Variables
Name | Required? | Description |
---|---|---|
download | REQUIRED | (https) URL to download the Mesosphere DC/OS installation script. |
download_checksum | no | Checksum to verify the download. Starts with the method used (e.g., "sha256: |
version | REQUIRED | The version string of the installer (found at download ). You can get this by running dcos_generate_config.sh --version . |
version_to_upgrade_from | for upgrades | The version string of Mesosphere DC/OS expected to upgrade FROM. The upgrade script will be made on the bootstrap machine, and each cluster node will download the correct upgrade for its current DC/OS version. |
image_commit | no | Used for consistent version/config upgrades, particularly for non-released versions (e.g., 1.12-dev ). This takes precedence over version . |
enterprise_dcos | REQUIRED | Specifies if the installer (found at download ) installs an 'open' or 'enterprise' version. This is important as enterprise components have extra post-upgrade checks. |
selinux_mode | REQUIRED | Indicates the SELinux mode for cluster nodes. Mesosphere DC/OS supports enforcing mode from 1.12 onward; older versions require permissive . |
config | yes | YAML structure for a valid Mesosphere DC/OS config.yml. |
DC/OS config.yml Parameters
Refer to the official Mesosphere DC/OS configuration documentation for a complete list of parameters. Key parameters include:
bootstrap_url
: Should point to http://your bootstrap node:8080. This will be used internally and conveniently overwritten for the installer/upgrader to direct to a version-specific sub-directory.ip_detect_contents
: User-supplied IP detection script. Overrides built-in environment detection and common AWS/on-premise scripts. DC/OS IP detection referenceip_detect_public_contents
: User-supplied public IP detection script. Overrides built-in detection.fault_domain_detect_contents
: User-supplied fault domain detection script. Also overrides built-in detection.
Ansible Dictionary Merge Behavior Note
Due to the nested structure of the dcos
configuration, you may need to set Ansible to 'merge' instead of 'replace' when combining configurations from different sources.
Example
# ansible.cfg
hash_behaviour = merge
Safeguard for Interactive Use: dcos_cluster_name_confirmed
When running these roles interactively, the DCOS.bootstrap
role will require confirmation of the cluster name to run against. This is a failsafe against unintentional upgrades or configuration changes. In automated plays, set a variable to skip this, for example:
ansible-playbook -e 'dcos_cluster_name_confirmed=True' dcos.yml
Example Playbook
Mesosphere DC/OS is a complex system, comprising multiple nodes to form a full multi-node cluster. There are some considerations when creating a playbook using the provided roles:
- The order in which groups run their roles (e.g., bootstrap first, then masters, then agents).
- Control over concurrency for upgrades (e.g., use
serial: 1
for master nodes).
You can use the provided dcos.yml
playbook to install and upgrade Mesosphere DC/OS.
Tested Operating Systems and DC/OS Versions
- CentOS 7, RHEL 7
- DC/OS 1.12, both open source and enterprise versions
License
Author Information
This role was created by the SRE team at Mesosphere and others in 2018, based on various internal tools and Ansible roles developed over the years.
Life cycle management of a Mesosphere DC/OS agent node. Part of a set of Ansible roles that manage DC/OS on RedHat/CentOS Linux.
ansible-galaxy install dcos.dcos_requirements