Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

How to easily deploy JBoss EAP on Azure

August 17, 2022
Harsha Cherukuri
Related topics:
Automation and management
Related products:
Red Hat Enterprise LinuxRed Hat JBoss Enterprise Application Platform

Share:

    This article demonstrates how to deploy Red Hat JBoss Enterprise Application Platform (JBoss EAP) on Microsoft Azure using Ansible automation. Currently, Red Hat has a Microsoft Azure Marketplace offering of JBoss EAP, but it's available only through the Bring-Your-Own-Subscription (BYOS) model, which is relatively complex. This article creates Azure resources using Ansible Collections for Azure and then deploys JBoss EAP using the WildFly service provided by the Ansible Middleware project.

    Deploy JBoss EAP in 6 easy steps

    We will use azure-eap-demo as the sample application for this article. Using this application, we will automate and deploy JBoss EAP instances on Azure virtual machines running Red Hat Enterprise Linux.

    Step 1.  Prerequisites setup

    To run the sample application, please put the following requirements in place:

    • An Azure account with an active subscription. If you do not have an Azure subscription, create one for free.
    • JBoss EAP: You need a Red Hat account with a Red Hat Subscription Management entitlement for JBoss EAP. This entitlement allows you to download a version of JBoss EAP tested and certified by Red Hat. If you do not have a JBoss EAP entitlement, sign up for a free developer subscription:  Red Hat Developer Subscription for Individuals. Once registered, you can find the necessary credentials (pool IDs) at the Red Hat customer portal.
    • The following software on the controller host or local machine:
      • Ansible (version 2.9 or greater)
      • Python (version 3.9 or greater)
      • Python3 netaddr (obtained using dnf or pip)
      • The Azure command-line interface (CLI)
      • Download the azure-eap-demo application to your local machine.

    Step 2.  Install WildFly and other components

    After you unpack the azure-eap-demo application, change into the repository's top-level directory, and run the following command:

    $ ansible-galaxy collection install -r requirements.yml

    We are using a dynamic inventory provided by Azure. Once the instances are created, you can view the inventory with the following command:

    $ ansible-inventory -i inventory/myazure_rm.yml --graph

    Step 3.  Create credentials for Red Hat portal access

    You need to provide credentials in the playbook so that it can download software from the Red Hat customer portal. Specify your Red Hat account name in the rhn_username variable and your password in the rhn_password variable.

    In addition, you have to specify the Red Hat Subscription Management entitlement for JBoss EAP in the jboss_eap_rhn_id variable. This variable allows you to specify which version of JBoss EAP (supported by Red Hat) you would like to install. Alternatively, you can just download and install the JBoss EAP ZIP file from the Red Hat customer portal.

    All these variables can be stored in a YAML file, whose name you specify in a section in the Ansible playbook named vars_files.

    Step 4.  Run the Ansible playbook

    Now run the Ansible playbook in create-demo-setup.yml which creates resources on Azure and deploys JBoss EAP:

    ​​​​​​​$ ansible-playbook -e @rhn-creds.yml -i inventory/myazure_rm.yml -e
    "ansible_ssh_user=rheluser ansible_ssh_private_key_file='provide_your_ssh_private_key'
    hosts_group_name=eap wildfly_version=7.4 override_install_name=jboss-eap"
    create-demo-setup.yml
    

    As part of the playbook execution, the azure-eap-demo repository is cloned. Its create-demo-setup.yml file contains:

    - name: Create Azure VM
      hosts: localhost
      gather_facts: false
      connection: local
      vars:
       repo_url: "https://github.com/ansible-middleware/wildfly-cluster-demo.git"
       branch: main
      tasks:
       - name: Git checkout
         ansible.builtin.git:
           repo: "{{ repo_url }}"
           dest: "{{ playbook_dir }}/wildfly-cluster-demo"
           version: "{{ branch }}"
           single_branch: yes
           clone: yes
           update: yes
    
       - name: Create demo resources on azure.
         include_role:
           name: 'azure'
         vars:
           ssh_key_path: "{{ ssh_key | default(lookup('env', 'HOME') + '/.ssh/id_rsa.pub')}}"
    
       - meta: refresh_inventory
       - pause:
           minutes: 1
    
    - name: Run wildfly-cluster-demo
      import_playbook: wildfly-cluster-demo/playbook.yml

    This playbook creates the Azure resources the application needs, including a resource group, virtual networks, subnets, security groups, network interfaces, three virtual machines running Red Hat Enterprise Linux, and public IP addresses for the virtual machines.

    All the default parameters for the Azure cloud instances are within the installed package: roles/azure/defaults/main.yml ​​​​​​.

    Finally, the playbook deploys the WildFly cluster demo. Refer to the article Automate and deploy a JBoss EAP cluster with Ansible to learn more about how to use WildFly.

    Step 5.  Verify deployment of the JBoss EAP cluster and application

    Once the playbook completes successfully, you can verify the JBoss EAP cluster by logging into the Azure portal. Here, you will find all the resources created to support the JBoss EAP cluster. Log in or SSH into any of the virtual machines created and confirm that the WildFly service is running and accessible. Alternatively, you can run the validate.yml playbook provided in the wildfly-cluster-demo application to validate the configuration.

    Step 6.  Clean up Azure resources

    To clean up all the resources created on Azure, run the clean-demo-resources.yml playbook:

    $ ansible-playbook clean-demo-resources.yml

    The contents of clean-demo-resources.yml are as follows:

    - name: Create Azure VM
      hosts: localhost
      connection: local
      tasks:
       - name: Create VM's on azure.
         include_role:
           name: 'azure'
         vars:
           action: destroy

    The destroy action runs the roles/azure/tasks/destroy.yml file, which contains:

    ---
    - name: Remove a VM and all resources that were autocreated
      azure_rm_virtualmachine:
       resource_group: "{{ item.resourcegroup_name }}"
       name: "{{ item.name }}"
       remove_on_absent: all_autocreated
       state: absent
      loop: "{{ vm }}"
    
    - name: Delete a resource group including resources it contains
      azure_rm_resourcegroup:
       name: "{{ item.name }}"
       force_delete_nonempty: yes
       state: absent
      loop: "{{ resource_groups }}"

    The playbook removes all the virtual machines and deletes all the resources under the eap-cluster resource group.

    Ansible simplifies deployment on Azure

    In this article, we demonstrated a step-by-step process to create resources using Ansible on Microsoft Azure and deploy a JBoss EAP cluster using tooling from the Ansible Middleware project. Check out the other collections and demos within the ansible-middleware GitHub organization and the Ansible Middleware website.

    Last updated: September 26, 2024

    Related Posts

    • Load balancing Red Hat JBoss Enterprise Application Platform subclusters with mod_cluster

    • Hello World for JBoss EAP Runtime via CodeReady Studio

    • Customizing an OpenShift Ansible Playbook Bundle

    • WildFly server configuration with Ansible collection for JCliff, Part 1

    Recent Posts

    • Our top 10 articles of 2025 (so far)

    • The benefits of auto-merging GitHub and GitLab repositories

    • Supercharging AI isolation: microVMs with RamaLama & libkrun

    • Simplify multi-VPC connectivity with amazon.aws 9.0.0

    • How HaProxy router settings affect middleware applications

    What’s up next?

    Red Hat Insights API

    Find out how to get actionable intelligence using Red Hat Insights APIs so you can identify and address operational and vulnerability risks in your Red Hat Enterprise Linux environments before an issue results in downtime.

    Get the cheat sheet
    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2025 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue