Skip to main content
Redhat Developers  Logo
  • Products

    Platforms

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat AI
      Red Hat AI
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • View All Red Hat Products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat Developer Hub
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat OpenShift Local
    • Red Hat 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
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Secure Development & Architectures

      • Security
      • Secure coding
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud 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

    • Product Documentation
    • API Catalog
    • Legacy Documentation
  • 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 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

Share:

    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

    • Why some agentic AI developers are moving code from Python to Rust

    • Confidential VMs: The core of confidential containers

    • Benchmarking with GuideLLM in air-gapped OpenShift clusters

    • Run Qwen3-Next on vLLM with Red Hat AI: A step-by-step guide

    • How to implement observability with Python and Llama Stack

    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

    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