Request A Demo
Back to All Blog Articles

Integrate Ansible With FlexDeploy Workflows

Ansible is an open-source automation tool that provides a simple way to automate applications and IT infrastructure. It allows you to manage configurations, deploy applications, start and stop middleware, and much more. Ansible works by running modules on remote hosts. In order to run these modules, you can execute them on the command line or create a playbook. These playbooks are used to describe a policy that the host is to enforce or a set of steps to execute. With FlexDeploy’s Ansible plugin you can integrate the power of Ansible into your FlexDeploy workflows.

Our Ansible plugin has two operations. The first operation, ansibleRunPlaybook, runs a playbook from a given absolute or relative path. The ansibleRunPlaybookScript operation allows you to embed your own Ansible playbook into the workflow. Users are able to configure several options for how the playbook is executed with these operations. For example, users are able to select what inventory file to use, or choose whether to escalate privileges when executing modules.

In this blog we will discuss how to use FlexDeploy’s Ansible plugin to run your playbooks, as well as embed playbook code to easily use Ansible.

Topology

First, we create an instance for which Ansible will run on. We then associate this instance with the environment of your choosing. After doing this, we add an endpoint to the environment-instance. This endpoint will need to have Ansible installed as well as all playbook and Ansible configuration information you wish to utilize.

Operations

ansibleRunPlaybook

This operation allows us to run a playbook yaml file.

Now we will be creating a new utility workflow containing the ansibleRunPlaybook operation. We simply have to drag and drop the plugin and fill in the Ansible Playbook input along with any other inputs as necessary.  For this example, our workflow will use Ansible to install Tomcat onto the various hosts.

Next we will configure this utility workflow to our desired FlexDeploy utility project.

Once we execute the project, it will install Tomcat on to configured hosts. Below are logs.

ansibleRunPlaybookScript

This operation allows us to write our own playbook directly in FlexDeploy.

We will again be creating a utility workflow containing the ansibleRunPlaybookScript operation. We simply drag and drop our plugin in to the workflow. This time we will be writing the contents of a playbook yaml file that we wish to be executed.  For this example, our workflow will use Ansible to restart Tomcat.

Next we will configure this utility workflow to our desired utility project.

Once we execute the project, it will restart tomcat. Below are logs.

In this blog, we showcased use of a utility workflow which is more appropriate for server management operations. You can use these Ansible plugin operations in build and deploy workflows as well. See the Ansible Plugin Guide for more details on plugin usage.

Download the Datasheet

Related Resources

Mastering Source Control: Streamlining Functional Setup Data Sync with FlexDeploy and Git Integration in Oracle FSM

Effective source control management (SCM) is pivotal in ensuring the seamless tracking and management of functional setup data. In this ...

New in 7.0: Release Work Items

Work item tracking tools play a crucial role in the DevOps process, helping teams plan new features, resolve bugs efficiently, ...

Analyze Source Code Using PMD in FlexDeploy

PMD is a static source code analyzer. It finds common programming flaws like unused variables, empty catch blocks, unnecessary object ...

Join DevOps leaders across the globe who receive analysis, tips, and trends in their inbox