Deploying OpenSearch with the Ansible playbook

A plan for installing OpenSearch and Dashboards on systemd Linux hosts with the official Ansible playbook, including what the control node, inventory and generated certificates need before the first run.

On this page

When the OpenSearch Ansible playbook fits a systemd host estate

The Ansible playbook fits a platform or infrastructure team that already runs Linux virtual machines or bare metal under systemd and wants OpenSearch installs to be repeatable instead of hand-built. The official playbook deploys OpenSearch and OpenSearch Dashboards to systemd Linux hosts, so the result is a set of services you manage the way you manage the rest of your host estate. It needs Ansible 2.9 or later and Java on the control node, because Java is used to generate the TLS certificates, and it needs root SSH access to the target hosts. Confirm that your security team accepts root SSH from the control node before you plan the rollout, since that access is the largest trust decision in this model.

Choose the playbook over the other install paths when your hosts are long-lived, your configuration lives in version control, and your operators already run Ansible. Package installs from RPM or Debian files give you the same systemd services with fewer moving parts, but they leave configuration drift to whoever runs them. Docker suits development and single-host trials, and the Kubernetes operator or Helm charts suit teams that already operate clusters. If your estate is mostly containers, the playbook is the wrong tool. If it is mostly systemd hosts, it removes the manual steps that otherwise differ from node to node.

Before you commit, check three things with the team that will run the cluster: the Ansible version on your control node against the stated minimum, whether Java is available where the certificates will be generated, and which OpenSearch version branch your upgrade policy requires. Version branches matter because each release stays in maintenance only for a limited period, so a playbook pinned to an unsupported branch becomes an audit finding. Ask the playbook documentation which versions it supports before you write your inventory, and plan to rerun it for each patch release.

How the control node reaches the cluster hosts

The run starts on the control node, where Ansible reads the inventory and variables and Java generates the TLS certificates locally. Ansible then opens root SSH sessions to each target host, which is the access boundary to review first, since root on every node is a stated requirement of the playbook. Certificates and configuration are pushed to the OpenSearch and Dashboards hosts, which run as systemd services. Before the run, confirm who holds the control node and the SSH keys, and where the generated certificates and private keys are stored afterward.

Control node reaching OpenSearch and Dashboards hosts over root SSH, with generated TLS material.

Choosing the Ansible playbook against other install methods

This table compares the Ansible playbook with the other documented OpenSearch install routes by the questions that usually decide the choice: host type, OS ownership, existing automation skills and how upgrades will be staged. Read each row as a question to answer for your environment before picking a route, since the right answer depends on who operates the hosts and how changes are reviewed.

Decision questionAnsible playbook on systemd hostsOther routes (tarball, packages, Docker, Helm, operator)
Host typeExisting Linux virtual machines or bare metal that run systemdTarball and packages suit the same hosts; Docker, Helm and the operator assume containers or Kubernetes already exist
Who owns the operating systemTeam that controls root SSH access to target hosts, which the playbook requiresPlatform team owning Kubernetes or container hosts, or an owner who prefers no Ansible on the nodes
Existing Ansible practiceTeam already maintains inventories, roles and vaulted secrets, so the playbook fits current reviewTeam with no Ansible skills may find a package install or Helm values easier to hand over
Control node prerequisitesNeeds Ansible 2.9 or later and Java on the control node for certificate generationNeeds package tooling, a container runtime or a cluster; confirm the Java need is absent in these routes
Certificate handlingPlaybook generates TLS certificates from the control node, so confirm your PKI policy allows thatCertificates are supplied by your own process or chart values; confirm how each route expects them
How upgrades are stagedRe-run the playbook against a chosen version branch, so confirm branch rollout order per clusterPackage upgrades, Helm releases or operator changes follow their own rollout and rollback steps
Reproducibility across environmentsInventory and variables define each environment, which suits copies for test and productionImages, charts or artifacts must be mirrored and pinned, which matters most for offline installs
Evidence for reviewersPlaybook code and inventories give reviewers a readable record of changesChange records come from package managers, chart versions or cluster manifests instead

Control node and target host requirements to verify first

Start by confirming the control node, because the playbook runs from there and nothing is installed on a target until the control node is ready. The OpenSearch Ansible playbook needs Ansible 2.9 or later on the control node, and it needs Java available on the control node because TLS certificate generation depends on it. Java is a control node requirement only, so you do not need to install it on each target for certificate generation. Record the Ansible and Java versions you run, and check them against the playbook's current requirements in the OpenSearch Ansible install guide before you pin a control node image. Also decide where the inventory, generated certificates and private keys will be stored, since those files carry trust for the whole cluster.

On the target side, every host must run a systemd Linux distribution, and the playbook connects with root SSH access. Plan how root access is granted and audited, for example through a bastion, a dedicated key or a short-lived access path, because a broad root key on the control node is a significant exposure. Write down the target list first, separating OpenSearch nodes from Dashboards hosts, and confirm that each host can reach the others on the ports the cluster needs for REST, node-to-node transport and Dashboards access. The port reference in the official docs is the place to confirm those paths for your version.

Confirm the operating system list and any host-level prerequisites for your chosen OpenSearch version in the official docs rather than assuming them. Supported distributions, kernel and memory settings, and file limits can change between version branches, and a host that passes a generic check can still fail during the playbook run. Ask your platform team to confirm that your standard images match a supported list, and treat any gap as a change to the build image, not a manual fix on a single node.

Setup sequence for the Ansible deployment

This sequence takes a control node, a set of Linux hosts and a pinned OpenSearch version to a running cluster with Dashboards, with a check at each stage so problems surface before the cluster carries data. Each step closes with an output your team can confirm before moving on.

  1. Prepare and pin the control node

    Your platform team installs Ansible on a dedicated control node and confirms the version is 2.9 or later, as the OpenSearch Ansible docs require. Java must also be present on the control node, because the playbook uses it to generate TLS certificates. Record the exact Ansible and Java versions in your change record so the same toolchain can be rebuilt later. Done when ansible --version and java -version both return the pinned versions and you can reach every target host over SSH as root, which the playbook needs.

  2. Obtain the playbook for your version branch

    Take the playbook from the official OpenSearch documentation and check out the branch that matches the OpenSearch version you intend to run, not the default branch. Store it in your version control system so changes to it are reviewed like any other infrastructure code. Confirm the branch and commit hash match the version in your plan, and record both. Done when the repository is cloned at a tagged commit and a second engineer can reproduce that checkout from your records.

  3. Build the inventory with node roles

    Write the inventory file listing each target host and the role group it belongs to, such as cluster manager, data or Dashboards hosts. Keep the grouping aligned with the topology you decided on, because the roles decide what each host runs and how the cluster forms. Confirm each hostname resolves from the control node and that the address you list is the one the cluster should use for transport traffic. Done when a connectivity test against every host in the inventory succeeds without prompting for a password.

  4. Set cluster name, versions and TLS variables

    Set the variables that define the cluster: the cluster name, the OpenSearch and Dashboards versions, the heap size and the certificate settings the playbook uses to generate TLS material. Put these in version-controlled variable files, not in shell history, and mark the admin password as a secret handled by your secret store. Confirm that the version variables match the branch from the previous step, because a mismatch is a common source of failed runs. Done when a review of the variable files shows one version per component and no plaintext credentials.

  5. Run a check or dry run

    Run the playbook in check mode first so Ansible reports what it would change without modifying hosts. Review the output for failed preconditions such as missing packages, unreachable hosts or certificate generation errors. Fix the inventory or variables and repeat until the check run completes with no failed tasks. Done when the check run reports zero failures and the list of planned changes matches what you expected for each host.

  6. Execute the playbook

    Run the playbook against the inventory, ideally with one host or a small group first if your topology allows, then the remaining hosts. Keep the console output as a change record. Expect the run to install packages, register systemd services and generate certificates. Done when the run ends with zero failed hosts and the recap shows every host reached the final task.

  7. Verify services, cluster health and Dashboards

    On each host, confirm the OpenSearch and Dashboards systemd units are active and enabled, for example with systemctl status opensearch. Query the cluster health endpoint over TLS with the admin credentials and confirm the status is green or, if you expect replicas to be pending, explain why before accepting it. Then sign in to Dashboards in a browser from an approved network and confirm the login works. Done when all services report active, cluster health matches your expectation, and a test login succeeds. Record the results as your handover evidence.

How inventories change for single-site, multi-node and central runner setups

A lab or pilot usually runs from one control node against a small set of hosts in one network segment. A single inventory file with a few groups is typically enough, and the operator often keeps the inventory and playbook variables together in one working directory. The main risk is that shortcuts made for a pilot, such as shared passwords or a copied inventory with real addresses, quietly become the production pattern.

  • Inventory groups: Keep one group for OpenSearch nodes and one for Dashboards hosts, so the playbook can target each role without per-host conditionals.
  • Host variables: Set the node name, IP address and any node role overrides in the host entry, and keep cluster-wide settings in the group variables.
  • Secrets handling: Use a local vault file or prompt for the admin password at run time rather than typing it into the inventory.
  • Version control: Commit the inventory structure and sample variables, but exclude generated certificates, private keys and any file containing real passwords.
  • Control node: Confirm the control node has the Ansible version and Java the playbook requires, since the generated certificates depend on Java being present there.

Before you reuse this layout, confirm that the lab inventory has no path that would let a pilot password or key reach a production host.

Security decisions for root SSH, generated certificates and secrets

The Ansible playbook touches every node as root, generates the TLS material that secures the cluster, and sets the first admin credentials. Each of these is a decision your team owns before the first run, and the cards below name what to confirm in the playbook documentation for each one.

Scope root SSH access to targets

The playbook needs root SSH access to each target host, so the access path is a privilege decision, not a convenience. Decide whether the control node logs in with a dedicated automation account that escalates to root, or with root keys directly, and whether those keys are limited by source address and command. Confirm in the playbook documentation which account it expects and how it behaves with privilege escalation. Keep an audit trail of every login the run creates on each host.

Ansible install docs

Decide where keys and inventory secrets live

The inventory, SSH private keys and any vault passwords sit on the control node, and whoever can read them can reach every OpenSearch host. Choose an encrypted secret store or Ansible Vault for variables that hold passwords, and keep the private key on hardware or an agent where possible. Confirm which inventory variables the playbook treats as sensitive and whether it writes any of them to logs or to files on the targets.

Hold the CA material deliberately

The playbook needs Java on the control node to generate TLS certificates, which means the certificate authority key is created where the automation runs. Decide who owns the CA, whether it is generated per cluster or imported from your internal PKI, and where the key is stored after the first run. Confirm the output paths and file permissions in the playbook documentation, and plan how node certificates will be rotated when they expire.

Set and rotate initial admin credentials

The first admin password is set through the playbook variables, so it can end up in inventory files, shell history or run output. Decide who chooses the value, how it is handed over, and when it is changed through the Security plugin so the bootstrap credential is no longer in use. Confirm how the playbook handles the password on reruns, because a changed variable may or may not update existing accounts.

Harden the control node

The control node holds the keys to every cluster, so treat it as a privileged system. Limit who can log in, keep the operating system and Ansible patched, restrict outbound network access to the target hosts and any package sources, and run the playbook from a dedicated account rather than a personal workstation. Confirm the minimum Ansible version the playbook needs, which is 2.9 or later, and the Java version required for certificate generation.

Put playbook runs under change control

A playbook run can restart services, replace configuration and reissue certificates on production nodes. Require a reviewed inventory and variable change, a recorded run with its version and inputs, and a rollback path before each run. Use a dry run or check mode on a staging copy where the playbook supports it, and confirm which changes require a node restart so you can schedule them within your maintenance windows.

Operating the cluster after the playbook runs

The Ansible playbook is an installer, not an operations tool. It lays down OpenSearch and Dashboards on your hosts and generates TLS certificates, but nothing in the playbook watches the cluster afterward. Re-runs, configuration drift, certificate rotation and version upgrades are your team's responsibility, and each needs an owner and a runbook before go-live. Treat the inventory and variable files as the source of truth, keep them in version control, and decide who may run the playbook against production and under what change record. Any change made by hand on a node will be silently overwritten on the next run, or worse, will persist and disagree with the inventory.

Version choice drives how often you will touch the cluster. OpenSearch 3.8.0 was released on August 4, 2026 and 3.9.0 on September 29, 2026, and the project targets a new minor version about every eight weeks. A version stays in maintenance until the next major version enters maintenance or one year passes, whichever is longer. Maintenance releases get bug fixes and security patches but no new features, so a pinned minor version can remain supportable while you plan the next move. Confirm the end-of-maintenance date for your chosen version on the OpenSearch releases page before you commit, and schedule upgrades well inside that window.

Before every upgrade or re-run, confirm that the playbook version branch matches both the source and the target OpenSearch version. Check the OpenSearch installation docs for the supported branch for each release, and record which branch produced the current hosts. Certificate rotation follows the same discipline: the playbook generates certificates from the control node, so decide where those files are kept, how expiry is tracked and how new certificates reach each node and Dashboards without a full outage. Test each of these steps in a non-production cluster that mirrors your inventory.

Limits to confirm in your environment before committing

The Ansible playbook is only as useful as its fit with your hosts, your plugin needs and your release plan. The cards below list the points to confirm against current documentation and your own environment before you commit to a design.

Linux distributions and versions

The playbook targets systemd Linux hosts, but the exact distributions and versions it supports for your chosen OpenSearch release are the first thing to confirm. Check the operating system matrix in the install documentation for that release, then test the playbook on a host built to the same image your organization runs. Do not assume a newer or older distribution is covered because a neighboring one is. Confirm the OS matrix for your exact release.

Ansible install docs

Plugins and Dashboards settings

Confirm whether the playbook exposes the plugin installation, security plugin configuration and Dashboards settings your design needs, such as SSO backends, audit logging or custom server options. Variables the playbook does not cover will need to be handled by hand, and those manual edits can be overwritten on a later run. Review the variable reference in the playbook repository and list every setting you expect to change before you start.

Re-runs against an existing cluster

Confirm how the playbook behaves when it runs against hosts that already hold a cluster. Check whether it changes configuration in place, restarts services, regenerates certificates or replaces files you edited. Test a re-run on a non-production cluster with the same inventory and the same configuration, and record what changed before you use the playbook for upgrades or configuration changes on live nodes.

AWX project status

If you plan to run the playbook through AWX, confirm the current state of the project before you build on it. The AWX README states that the last release was published on July 2, 2024 and that releases are paused during a large-scale refactoring. Check the AWX releases page and the installation guidance for the AWX Operator, and decide whether your workflow can run from the Ansible command line or an automation platform you already operate.

AWX README

Release branch to pin

Pin the playbook to the release branch that matches each OpenSearch version you intend to run, and record that pairing in your change records. Check which branches the repository publishes, which versions each branch installs, and how the branches move as new minor versions ship. Because OpenSearch targets a new minor version about every eight weeks, plan the pinning and update process before the first production deployment.

Ansible install docs

What teams ask before running the OpenSearch Ansible playbook

What does it cost to run the OpenSearch Ansible playbook, and who pays for what?

Cost falls into three buckets: internal engineering time, an external partner fee if you buy one, and the recurring effort to run and upgrade the cluster. Your own staff pay for the hosts, network, DNS, load balancing and the people who own the decisions. A partner fee is set by a written scope, so ask for the scope items (hosts, OS versions, TLS policy, identity integration, backup targets, handover) and quote each one separately. Recurring costs include patching the OS and OpenSearch, responding to security releases, and rerunning the playbook for new versions. DeployOpen does not publish a price list, so ask for a quote tied to that scope.

How long does a first OpenSearch deployment and hardening take?

The duration depends on how much is already decided before the first run. The biggest drivers are the number of nodes and whether they are split into roles, how many identity and TLS decisions remain open, the state of the target hosts, and how many environments (test, staging, production) must be built. Access approvals and change windows often take longer than the playbook run itself. Ask any partner for a timeline that lists these assumptions and the milestones where your team signs off, and treat any figure without those assumptions as unverified.

What must our team provide before the playbook can run?

Your team provides the target Linux hosts with systemd, the network paths between them, DNS names for nodes and Dashboards, and an SSH account with the root access the playbook requires. You also need a certificate policy: whether the playbook's generated TLS certificates are acceptable or your internal CA must issue them. Name admin owners who approve the initial admin credentials, the inventory and the change record. Confirm the control node has Ansible 2.9 or later and Java, since Java is needed to generate certificates. Agree on who holds the secrets vault and who can rotate them.

Can an internal team deploy OpenSearch with the Ansible playbook alone?

Yes, a team with Linux administration and Ansible skills can run the official playbook without an outside partner, and the work is mostly inventory design, host preparation and verification. The harder parts are the decisions around them: node roles, identity backend, audit logging, backup repositories and how upgrades are scheduled. Teams without a second person who can review the inventory and TLS setup usually add a review step. Whether you go alone or with a partner, document who runs each playbook version and where the inventory lives.

Does the Apache 2.0 license change how we buy this work?

The Apache License, Version 2.0 covers OpenSearch and the ansible/awx project, so there is no license fee to pay for the software itself and no paid edition described in the OpenSearch FAQ. What you buy is labor: planning, deployment, hardening, documentation and support. That means the purchase decision rests on the scope of that labor and on who will maintain the result. Ask any provider to state in writing that the software remains under its open-source license and which parts of the work are their deliverables. Have your legal team confirm the terms that apply to your use.

Which OpenSearch version branch should we pick for the playbook?

Pick a version branch by checking the maintenance status on the OpenSearch releases page before the first install. Versions stay under maintenance until the next major version enters maintenance or one year passes, whichever is longer, and maintenance releases bring fixes and security patches without new features. Version 1 reached end of life on May 6, 2025, so it should not be used for new installs. Confirm which branch the playbook documentation targets for your planned OpenSearch version and plan the upgrade path before go-live.

What breaks most often during a first Ansible run?

The most common failures come from prerequisites: missing Java or an old Ansible on the control node, SSH access that is not root as the playbook expects, hostnames that do not resolve, and host kernel settings not applied. Certificate problems appear when node names in the generated certificates do not match the DNS names clients use. Run the playbook against a test inventory first, check service status on each host, and confirm the cluster health before you add data. Keep the inventory and generated certificates under version control so a rerun is predictable.

How DeployOpen scopes and delivers an Ansible-based OpenSearch install

DeployOpen plans, builds, documents and supports self-hosted OpenSearch inside your own infrastructure, including installs made with the official Ansible playbook on systemd Linux hosts. We start from your inventory, certificate and version requirements, then deliver a playbook run your team can repeat and review. Engagements are fixed-scope, with the deliverables agreed in writing before work starts.

How we scope

  • Written scope covers control node setup, inventory design, target host preparation and the OpenSearch and Dashboards versions to deploy.
  • We confirm which OpenSearch version branch fits your upgrade plans and which maintenance window applies to it.
  • Scope records how TLS certificates will be generated, stored, rotated and who holds the generated material.

How we build

  • We prepare the Ansible control node with the required Ansible and Java versions and run the playbook against a non-production inventory first.
  • Inventory groups, node roles, heap settings and Dashboards configuration are written as version-controlled files.
  • Each run is checked for cluster health, TLS on every layer, security plugin settings and service status under systemd.

How we hand over

  • You receive the inventory, playbook variables, certificate layout and a runbook covering re-runs and host changes.
  • Documentation records the exact OpenSearch versions installed, the playbook revision used and the steps for version upgrades.
  • Your administrators run a supervised install or re-run so the knowledge stays with your team after handover.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover.
  • Retainer scope covers playbook updates for new OpenSearch releases and reviews of planned version changes.
  • Ask any provider to confirm how they handle the upstream AWX project status before you standardize on its tooling.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.