Skip to main content
Redhat Developers  Logo
  • 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 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

    • OpenShift AI learning
    • 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.
    • Explore the solution
  • 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

    • Access product downloads to start building and testing right away.
    • 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.
    • Explore the benefits

How to install Microsoft SQL on RHEL using ansible-navigator

February 21, 2023
Nagesh Rathod
Related topics:
Automation and managementLinuxPython
Related products:
Red Hat Ansible Automation PlatformRed Hat Enterprise Linux

    In this article, I will show you how to install Microsoft SQL on a dedicated Red Hat Enterprise Linux 8 instance and pass the execution environment image while the Ansible playbook runs. We will also explore how using the automation content navigator is an efficient method for this installation.

    5 steps to install Microsoft SQL on RHEL using automation content navigator

    Before getting started, please make sure that you have installed the Red Hat Ansible Automation Platform on your machine. Otherwise, please refer to the previous article about the Ansible Automation Platform installation.

    1. Setting up automation content navigator

    The automation content navigator is a text-based user interface (TUI) tool for creating, reviewing, and troubleshooting Ansible content, including inventories, playbooks, and collections.

    To run the automation content navigator on RHEL8, you must have superuser privileges, ansible-core, Python 3, and Podman installed.

    Verify that Ansible Automation Platform is installed on your environment by running the following command:

    ​​​​​​​[redhat@redhat]$ ansible --version

    You will see the following output verifying the installation and version:

    ansible [core 2.13.3]
    
      config file = /etc/ansible/ansible.cfg
    
      configured module search path = ['/home/nagesh/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
    
      ansible python module location = /usr/lib/python3.9/site-packages/ansible
    
      ansible collection location = /home/nagesh/.ansible/collections:/usr/share/ansible/collections
    
      executable location = /usr/bin/ansible
    
      python version = 3.9.14 [GCC 11.3.1 20220421 (Red Hat 11.3.1-2)]
    
      jinja version = 3.1.2
    
      libyaml = True

    Next, install a Python package that will be used to install the automation content navigator.

    sudo dnf install python3-pip

    2. Install the automation content navigator

    Install automation content navigator with the following command:

    python3 -m pip install ansible-navigator --user

    Add the installation path to the user’s shell initialization file and source it by entering the following:

    echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.profile
    source ~/.profile

    3. Launch the automation content navigator

    Launch the automation content navigator TUI by entering the following(Figure 1):

    ansible-navigator
    The automation content navigator TUI
    Figure 1: The automation content navigator TUI.

    4. Setting up the Ansible execution environment

    Execution environments are Linux container images that help execute Ansible playbooks. Automation can now be built and deployed using Ansible execution environments instead of Python virtual environments. Unlike legacy virtual environments, execution environments are container images that make it possible to incorporate system-level dependencies and collection-based content. Each execution environment allows you to have a customized image to run jobs, and each of them contains only what you need when running the job, nothing more.

    A registry service account must be created prior to completing any of the subsequent tasks. Create a service account by entering the following:

    podman login registry.redhat.io
    Username: {REGISTRY-SERVICE-ACCOUNT-USERNAME}
    Password: {REGISTRY-SERVICE-ACCOUNT-PASSWORD}
    Login Succeeded!

    Container file:

    ​​​​​​​FROM registry.redhat.io/ansible-automation-platform-22/ee-29-rhel8:latest
    
    RUN ansible-galaxy collection install microsoft.sql

    Build an image by entering the following Podman command:

    ​​​​​​​podman build -t <image-name>

    Before pushing, make sure you are logged in to your private container image registry using the podman login command. 

    Push the image into the container image registry as follows:

    ​​​​​​​podman push <image-name>

    5. Install Microsoft SQL Server

    Using the ansible-navigator command, run the following playbook, and define the executive environment image by using the --eei flag.

    Playbook: microsoft_sql_playbook.yaml.

    ---
    
    - hosts: dev
      become: yes
    
      vars:
    
        mssql_accept_microsoft_odbc_driver_17_for_sql_server_eula: true
        mssql_accept_microsoft_cli_utilities_for_sql_server_eula: true
        mssql_accept_microsoft_sql_server_standard_eula: true
        mssql_password: "123@Redhat"
        mssql_edition: Evaluation
        mssql_enable_sql_agent: true
        mssql_install_fts: true
        mssql_install_powershell: true
        mssql_tune_for_fua_storage: true
    
      roles:
        - microsoft.sql.server

    Inventory file:

    [dev]
    <target host IP> 

    Run the ansible-navigator command to execute with dependencies as follows:

    ansible-navigator run -m stdout mssql-install.yaml -i inventory  --user ec2-user --key-file redhat  --eei quay.io/narathod/mssql-aap:0.2

    The output:

    TASK [microsoft.sql.server : Configure a listener for the  availability group] ***
    skipping: [3.236.15.223]
    
    TASK [microsoft.sql.server : Ensure the ansible_managed header in /var/opt/mssql/mssql.conf] ***
    changed: [3.236.15.223]
    
    RUNNING HANDLER [microsoft.sql.server : Restart the mssql-server service] ******
    changed: [3.236.15.223]
    
    TASK [microsoft.sql.server : Post-input SQL scripts to SQL Server] *************
    
    PLAY RECAP *********************************************************************
    3.236.15.223               : ok=39   changed=16   unreachable=0    failed=0    skipped=72   rescued=0    ignored=0   

    Use automation to install databases on RHEL

    This article demonstrated how you can use automation to install Microsoft SQL Server on RHEL 8 machines via the automation content navigator. You can use this method to install other databases such as MongoDB, PostgreSQL, and OracleDB by picking the Ansible role and playbooks for that database. The rest stays the same.

    Get started with the Ansible Automation Platform by exploring interactive labs. Ansible Automation Platform is also available as a managed offering on Microsoft Azure and as a self-managed offering on AWS.

    Last updated: August 29, 2023

    Related Posts

    • How to install Red Hat Ansible Automation Platform on RHEL 9

    • What’s new in Ansible Automation Platform 2.2

    • Automate workshop setup with Ansible playbooks and CodeReady Workspaces

    • Using a MySQL database in your Red Hat OpenShift application

    Recent Posts

    • Debugging image mode with Red Hat OpenShift 4.20: A practical guide

    • EvalHub: Because "looks good to me" isn't a benchmark

    • SQL Server HA on RHEL: Meet Pacemaker HA Agent v2 (tech preview)

    • Deploy with confidence: Continuous integration and continuous delivery for agentic AI

    • Every layer counts: Defense in depth for AI agents with Red Hat AI

    What’s up next?

    Building and delivering modern, innovative apps and services is more complicated and fast-moving than ever. Join Red Hat Developer for tools, technologies, and community to level up your knowledge and career.

    Learn more
    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    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

    Chat Support

    Please log in with your Red Hat account to access chat support.