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:
Setting Up Integrations in Morpheus
The first step is to establish an integration with your Morpheus Appliance and your Ansible repository. Browse to the Admin > Integrations tab within your Morpheus Appliance:
From there add a New Integration and complete the requisite details in the pop-up modal:
NOTE: If you intend to use SSH for accessing your git then you must upload the morpheus PUBLIC KEY provided into your git repo. An example is given in the image above, though you can also use https to clone the repo as long as it is public.
Once you have completed this section and saved your changes you can set up a group to utilize this integration.
If you are unfamiliar with Morpheus Groups in infrastructure please look here (#article referencing groups link).
Automation integrations apply to an infrastructure group, and can be added when the group is set up or after the fact. When establishing a new group or when editing an existing one, simply expand the Integrations dropdown and select the Integration created in the preceding steps:
Once an Ansible integration is added to a Group, a new "ANSIBLE" tab will appear on the Groups page, populated with the Ansible integrations Playbook and Roles, as well as an editable Inventory list:
Provisioning and Inventory
*IMPORTANT: In Morpheus v2.9.3 and prior, an additional user "morpheus" with password or key pair must be added while provisioning any instances you wish to run playbook on. This requirement is removed in v2.9.4 and later.
After an Ansible integration is added to a group, all Instances provisioned into that group will have a new field "ANSIBLE GROUP" under the advanced option section of the configurations pane during provisioning.
Entering an existing or new ansible inventory group will add the instance to the ansible inventory:
Playbooks can 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:
For this example we ran an Apache playbook, and after running the playbook, we can see Apache was successfully installed and is running on our webserver group instances by entering the ip of one of the instances in a browser t bring up the Apache default welcome page:
Playbook's can also be added as tasks and workflows in the Provisioning- Automations section, and then added in the Automation pane during provisioning of new instances, when creating app templates, or ran on existing instances using the ACTIONS: RUN WORKFLOW on the instance details page.