Ansible

Overview

Morpheus appliance supports Ansible integration for configuration management. Morpheus accomplishes this by integrating with an existing repository of playbooks as the master in a master-slave Ansible architecture.

To get started the only requirement is an existing repository for playbooks in a very simple structure.

Add Ansible Integration

  1. Navigate to Administration -> Integrations and select + New Integration
  2. Select Integration Type “Ansible”
  3. Populate the following fields:
    • Name: Name of the Ansible Integration in Morpheus
    • Enabled: Enabled by default Ansible Git URL:: https or git url format of the Ansible Git repo to use
    • Keypair: For private Git repos, a keypair must be added to Morpheus and the public key added to the git account.
    • Playbooks Path: Path of the Playbooks relative to the Git url.
    • Roles Path: Path of the Roles relative to the Git url.
    • Group Variable Path: Path of the Group Variables relative to the Git url.
    • Host Variables Path: Path of the Host Variables relative to the Git url.
  4. Save Changes

Once you have completed this section and saved your changes you can set up a Cloud or Group to utilize this integration.

Scope Ansible Integration to a Cloud

  1. Navigate to Infrastructure -> Clouds
  2. Edit the target Cloud
  3. Expand the Advanced Options section
  4. In the Config Management dropdown, select the Ansible Integration.
  5. Save Changes

Once an Ansible integration is added to a Cloud, a new “ANSIBLE” tab will appear on the Cloud details page, populated with the Ansible integrations Playbook and Roles, as well as an editable Inventory list.

Scope Ansible Integration to a Group

  1. Navigate to Infrastructure -> Groups
  2. Edit the target Group
  3. Expand the Advanced Options section
  4. In the Config Management dropdown, select the Ansible Integration.
  5. Save Changes

Once an Ansible integration is added to a Group, a new “ANSIBLE” tab will appear on the Group details page, populated with the Ansible integrations Playbook and Roles, as well as an editable Inventory list.

Provisioning Options

When provisioning Instances into a Cloud or Group with a Ansible Integration added, an Ansible section will appear in the Config section of the provisioning wizard. By default, Ansible is enabled, but can be disabled by expanding the Ansible section and unchecking Enable Ansible.

Ansible Integration Provisioning options:

Enable Ansible
Select to bootstrap
Ansible Group
Ansible Inventory Group. Use existing group or enter a new group name to create a new group. Leaving this field blank will place instance in the “unassigned” inventory group.
Playbook
Playbook(s) to run. The .yml extension is optional.

Running Playbooks

Playbooks can also be ran on all inventory groups, individual groups, or added as a task and ran with workflows.

To run Ansible on all or a single inventory group, in the Ansible tab of the Morpheus Group page, select the Actions dropdown and click Run.

In the Run Ansible modal, you can then select all or an individual group, and then all or a single Playbook, as well as add custom tags.

Playbook’s can also be added as tasks to workflows in the Provisioning -> Automation section, and then selected in the Automation pane during provisioning of new instances, when creating app blueprints, or ran on existing instances using the Actions -> Run Workflow on the Instance or Host pages.