Welcome!

CX Blog

Subscribe to CX Blog: eMailAlertsEmail Alerts
Get CX Blog via: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Blog Feed Post

Set up Ansible Tower with Dynatrace to enable your self-healing applications

Dynatrace news

Successful development, deployment, operation, and maintenance of complex software systems built on cloud-based infrastructure can be a huge challenge for DevOps. Software outages due to errors or infrastructure failures often seem unavoidable.

Dynatrace, however, keeps your digital business up and running by not only monitoring your applications, services, and infrastructure, but by automatically taking action when problems are detected.

Connect Ansible Tower to Dynatrace

This blog post explains how to set up Ansible Tower, the automation platform powered by Red Hat, and how to connect Ansible Tower to Dynatrace to trigger automated remediation actions and enable self-healing applications.

We’ll guide you through the installation process and show you the commands and settings you need to get up and running with Ansible Tower.

You’ll learn

  • How to set up Ansible Tower in just a few steps.
  • How to configure Ansible Tower to connect with Dynatrace to enable self-healing applications.

We’ll also take a look at a short demo application that highlights the power of this toolchain.

Prerequisites

For demonstration purposes, we’ll set up Ansible Tower on Ubuntu Linux running in AWS. If you’re using Vagrant, you’ll find Vagrant setup instructions in an earlier post. If you choose another supported OS, know that these Ubuntu Linux instructions won’t apply.

Set up Ansible

To use Ansible Tower, you first have to set up the underlying Ansible engine. On your Ubuntu installation, run the following commands:

$ apt-get install software-properties-common
$ apt-add-repository ppa:ansible/ansible
$ apt-get update
$ apt-get install ansible

Set up Ansible Tower

Once you’ve installed Ansible, set up Ansible Tower, the tool used to connect to Dynatrace.

  1. Download and extract the Ansible Tower installer:
    $ curl -o ansible-tower-setup-latest.tar.gz http://releases.ansible.com/ansible-tower/setup/ansible-tower-setup-late...
    $ tar xvzf ansible-tower-setup-latest.tar.gz
    $ cd ansible-tower-setup-<tower_version>
  2. Open the inventory file with a text editor and change the corresponding lines below to set the passwords for your Ansible admin, PostgreSQL database, and RabbitMQ.
    $ nano inventory
    ### set passwords to 
    ### admin_password, pg_password, rabbitmq_password
  3. Run the installer script with using Ansible admin username and password you defined.
    $ ANSIBLE_SUDO=True ./setup.sh

    Installation may take a while, so grab a cup of coffee or watch one of the videos on the Dynatrace YouTube channel.

  4. Once you’ve installed Ansible Tower, sign in, and use your browser to connect to your Ansible Tower installation.
    https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-login-300x20... 300w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-login-200x13... 200w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-login-400x26... 400w" sizes="(min-width: 900px) 900px, 100vw" />
  5. Before you set up a new project, save your credentials (GitHub passwords and SSH keys) so you can easily reuse them across projects. To do this, navigate to Settings ► Credentials and add:
    • GitHub password for your GitHub repository for check out
    • An SSH key for the VM to connect to (the VM where you want to enable your self-healing applications)

    https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-credentials-... 300w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-credentials-... 768w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-credentials-... 200w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-credentials-... 400w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-credentials-... 600w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-credentials-... 800w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-credentials-... 1000w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-credentials-... 1200w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-credentials-... 1400w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-credentials-... 1600w" sizes="(min-width: 900px) 900px, 100vw" />

Create a project

To set up the project for this demo

  1. Navigate to the Create Project page.
    Use the password stored in GitHub to check out the repository that contains the required source files.
    https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-project-300x... 300w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-project-768x... 768w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-project-200x... 200w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-project-400x... 400w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-project-600x... 600w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-project-800x... 800w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-project-1000... 1000w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-project-1200... 1200w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-project-1400... 1400w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-project-1600... 1600w" sizes="(min-width: 900px) 900px, 100vw" />
  2. Define an inventory that contains the host on which we want to deploy our source from the GitHub repository. Click the Host section in your environment and add a new host (IP address or host name). This is the environment where your applications will be deployed.
  3. Create a template to define the actions that should be followed when the template is triggered by an external or internal source.
    In this example, we’ll:

    • Run the template (Trigger Rollback) and execute the playbook (site.yaml), which is stored in the GitHub repository. The playbook defines the actions that are to be taken when executing this job template.
    • Define an inventory (Demo Inventory) where the required credentials and the project can be found.
    • Assign a job tag (rollback) so you can execute only the tagged parts of the playbook.

    https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-trigger-roll... 300w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-trigger-roll... 768w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-trigger-roll... 200w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-trigger-roll... 400w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-trigger-roll... 600w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-trigger-roll... 800w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-trigger-roll... 1000w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-trigger-roll... 1200w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-trigger-roll... 1400w, https://dt-cdn.net/wp-content/uploads/2018/01/ansible-tower-trigger-roll... 1600w" sizes="(min-width: 900px) 900px, 100vw" />
    Once you’ve saved your job template, run it by clicking the corresponding rocket button (

More Stories By CX Blog

Build better customer experiences through strong digital performance: Design, Development, Strategy, Measurement & Analytics, Best Practices