Skip to main content
AI
  • Get started with AI

    • Red Hat AI

      Accelerate the development and deployment of enterprise AI solutions.

    • AI learning hub

      Explore learning materials and tools, organized by task.

    • AI interactive demos

      Click through scenarios with Red Hat AI, including training LLMs and more.

    • AI/ML learning paths

      Expand your Red Hat OpenShift AI knowledge using these learning resources.

    • AI quickstarts

      Focused AI use cases designed for fast deployment on Red Hat AI platforms.

    • No-cost AI training

      Foundational Red Hat AI training.

  • Featured resources

    • Red Hat OpenShift AI
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

Red Hat AI Factory with NVIDIA

Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.

Learn
  • Self-guided

    • Documentation

      Find answers, get step-by-step guidance, and learn how to use Red Hat products.

    • Learning paths

      Explore curated walkthroughs for common development tasks.

    • Guided learning

      Receive custom learning paths powered by our AI assistant.

    • See all learning
  • Hands-on

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

    • Interactive labs

      Learn by doing in these hands-on, browser-based experiences.

    • Interactive demos

      Click through product features in these guided tours.

  • Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics
  • Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
Build
  • Get started

    • Red Hat build of Podman Desktop

      A downloadable, local development hub to experiment with our products and builds.

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

  • Download products

    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products
  • Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset
  • References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
Community
  • Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions
  • Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github
  • Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

Join the Red Hat Developer program

Download Red Hat products and project builds, access support documentation, learning content, and more.

ConsoleDocsSupport Search
New For you

Recommended

We'll recommend resources you may like as you browse. Try these suggestions for now.

  • Product downloads
  • Cheat sheets
  • Red Hat Developer learning portal
  • Developer blog
  • E-books
  • Developer Sandbox
Log in

Get more with a Red Hat Developer account

  • Product downloads
  • Console access
  • Event registration
  • Training & trials
Explore more account benefitsLog in or register

A subscription may be required for some services.

Contact us

Get started with the JBoss Web Server collection

October 16, 2024
Harsha Cherukuri
Related topics:
AutomationJava
Related products:
Red Hat Ansible Automation PlatformRed Hat JBoss Web Server

    The article A tutorial on Middleware Automation Collections discussed using the ansible-galaxy tool to install Ansible Content Collections on a control node. It also guides you in using the ansible-navigator utility and Ansible Execution Environments to perform automation tasks. Finally, an overview of the ansible-middleware-ee execution environment from the Ansible Middleware project is provided. It describes how this EE  includes all of the Ansible Content Collections and their dependencies.

    In this tutorial, we will leverage the ansible-middleware-ee Execution Environment as the basis for carrying out automation activities. Let's get started using the JBoss Web Server collection, provided by the Ansible Middleware team, which can help automate the management of Red Hat JBoss Web Server.

    Step 1: Use the ansible-navigator utility

    Let’s use the execution environment and the ansible-navigator utility to automate and provision the JBoss Web Server collection. The ansible-middleware-ee Execution Environment contains all the latest upstream collections within the image, so no additional actions are needed. To browse the set of collections included in the image, run the following command:

    $ ansible-navigator --eei quay.io/ansible-middleware/ansible-middleware-ee:latest collections
        Name                       Version Shadowed Type     Path
        0│ansible.builtin            2.15.3  False    contained /usr/local/lib/python3.9/si
        1│ansible.netcommon          5.1.2   False    contained /usr/share/ansible/collecti
        2│ansible.posix              1.5.4   False    contained /usr/share/ansible/collecti
        3│ansible.utils              2.10.3  False    contained /usr/share/ansible/collecti
        4│community.general          7.3.0   False    contained /usr/share/ansible/collecti
        5│middleware_automation.amq  1.3.8   False    contained /usr/share/ansible/collecti
        6│middleware_automation.amq_s0.0.5   False    contained /usr/share/ansible/collecti
        7│middleware_automation.commo1.1.2   False    contained /usr/share/ansible/collecti
        8│middleware_automation.infin1.2.0   False    contained /usr/share/ansible/collecti
        9│middleware_automation.jws  1.2.3   False    contained /usr/share/ansible/collecti
    	10│middleware_automation.keycl1.2.8   False    contained /usr/share/ansible/collecti
    	11│middleware_automation.redha1.2.2   False    contained /usr/share/ansible/collecti
    	12│middleware_automation.wildf1.3.4   False    contained /usr/share/ansible/collecti

    Step 2: Set up the inventory

    Let's now set up an instance of the JBoss Web Server. Create an inventory file that includes a Red Hat Enterprise Linux 8 machine, the IP address of the instance, and the associated login information that Ansible can use. For this demonstration, SSH keys are being used instead of passwords. These SSH keys need to be available on the control node and the location of the private key is referenced in the inventory file. The inventory file look should look similar to the following:

    [jws]
                jws-0 ansible_host=10.0.0.1 ansible_user=root ansible_ssh_private_key_file=”path to your private key”

    Step 3: Set up the vars.yml file

    On the Ansible control node, create a vars.yml file which will contain variables to customize the execution of the Ansible automation. To specify the JBoss Web Server version to install, set the jws_version variable. For example, set jws_version to 5.7.0 to install that specific version of the server. By default, the collection installs the latest patch update. You can set jws_apply_patchs to true and specify the jws_patch_version with the specific version of the patch to install. We can set the jws_java_version variable to set the appropriate JDK version. For example, we can set the variable to 1.8.0 or 11 or 17. The collection also configures a systemd service by specifying jws_systemd_enabled as true. Once configured, the vars.yml file appears similar to the following:

    ---
    jws_setup: true
    jws_java_version: 17
    jws_listen_http_bind_address: 127.0.0.1
    jws_systemd_enabled: True
    jws_service_systemd_type: forking
    jws_selinux_enabled: False

    Step 4: Install and configure the JBoss Web Server

    Create a file called jws.yml containing a playbook to install and configure the JBoss Web Server on the target hosts. In addition, it will also deploy a web application to demonstrate the functionality of the web server. See below:

    ---
    - name: "Red Hat JBoss Web Server installation and configuration"
        hosts: all
        become: True
        vars_files:
        - vars.yml
        roles:
        - redhat.jws.jws
        tasks:
        - name: "Deploy webapp"
            ansible.builtin.get_url:
            url: "https://drive.google.com/uc?export=download&id=1w9ss5okctnjUvRAxhPEPyC7DmbUwmbhb"
            dest: "{{ jws_home }}/webapps/info.war"

    Step 5: Run the Ansible Playbook

    With all of the prerequisite and configuration steps complete, run the Ansible Playbook using ansible-navigator and the execution environment to configure the JBoss Web Server on the remote hosts:

    $ ansible-navigator --eei quay.io/ansible-middleware/ansible-middleware-ee:latest run jws.yml -i inventory -m stdout --become

    Once the JWS service is deployed, start an SSH to the instance to check the status of the systemd service:

    ssh root@10.0.0.1 systemctl status jws.service

    We can also check if the port is accessible or not using the following command:

    # curl -I http://localhost:9990/health

    Alternatively, we can perform validation checks using the validation role from the collection. To do so, create a new file called validation.yml with the following content.

    ---
    - name: "Red Hat JBoss Web Server validation"
        hosts: all
        become: true
        vars_files:
        - vars.yml
        roles:
        - middleware_automation.jws.jws_validation

    Now, invoke the validation playbook using ansible-navigator:

    $ ansible-navigator --eei quay.io/ansible-middleware/ansible-middleware-ee:latest run validation.yml -i inventory -m stdout --become

    In this tutorial, we have demonstrated how to use the Ansible middleware execution environment and set up JBoss Web Server using the Ansible Content Collections for JBoss Web Server. We can also deploy JBoss Web Server using the certified JBoss Web Server collection on the Ansible Automation Hub. You can check out the other collections and demos within the GitHub organization: ansible-middleware and the Middleware Automation Collections website.

    Last updated: November 13, 2024

    Related Posts

    • Automate JBoss Web Server deployment with the Red Hat Certified Content Collection for JWS

    • Automate JBoss Web Server 6 deployment with the Red Hat Ansible Certified Content Collection for JWS

    • Set up mod_cluster for Red Hat JBoss Web Server with Ansible

    • Set up mod_cluster for Red Hat JBoss Web Server with Ansible

    Recent Posts

    • A day in the life of an NVIDIA H100 on Red Hat OpenShift 5

    • Migrate BuildConfigs to builds for Red Hat OpenShift with one plug-in install

    • Run Red Hat Enterprise Linux CoreOS on NVIDIA BlueField DPUs

    • Agent harness engineering: Separating model capabilities from enforcement

    • What's new for developers in Red Hat Enterprise Linux 10.3 and 9.9

    What’s up next?

    Get an introduction to Server Connector for IntelliJ. This learning path helps you deploy applications to multiple application servers via Tomcat, JBoss Enterprise Application Platform (JBoss EAP), and Wildfly using the IntelliJ IDE extension.

    Start the activity
    Red Hat Developers logo

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    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
    © 2026 Red Hat

    Red Hat legal and privacy links

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