Skip to content
Zoos GlobalZoos GlobalZoos EngineeringHub

datadog-hostplan-config

README documentation for datadog-hostplan-config

stableRepositoryShellprivate
6 min readUpdated Jul 24, 2026@observability-teamObservability
Edit source

Source: ZoosGlobal/datadog-hostplan-config Visibility: Private This page is automatically synchronized from the repository README. Do not edit this generated file directly.


Zoos Global      Datadog Premier Partner

Version Platform Ansible PowerShell Datadog Partner License Status


Windows · Linux · Ansible → DD_INFRASTRUCTURE_MODE → Datadog Agent

Automates Infra Pro (full) and Infra Basic (basic) tier configuration
across Windows Server, RHEL 6/7/8, Ubuntu 14–20, SUSE, and Oracle Linux.
Single env var. Dry-run support. Idempotent. Auto-restarts Agent.


Init Systems



Datadog Infrastructure Monitoring licensing is controlled through the infrastructure mode assigned to each host. In enterprise environments with large Windows and Linux server fleets, manually managing these configurations can become complex, time-consuming, and error-prone.

Common challenges include:

  • Inconsistent infrastructure mode configuration across environments.
  • Manual host-by-host updates requiring significant operational effort.
  • Configuration drift caused by undocumented changes.
  • Difficulty maintaining Infra Basic and Infra Pro host classifications.
  • Increased risk of licensing inaccuracies and unexpected monitoring costs.
  • Lack of a standardized deployment process across multiple operating systems.
  • Additional overhead during server onboarding, migrations, and environment expansions.

Without automation, organizations often face operational inefficiencies, reduced governance, and challenges in maintaining consistent Datadog infrastructure monitoring standards.


Zoos Global developed a cross-platform automation framework that standardizes Datadog Infrastructure Mode configuration across Windows and Linux environments.

The solution provides:

  • Single Configuration Control through the DD_INFRASTRUCTURE_MODE environment variable.
  • Windows and Linux Support using native operating system mechanisms.
  • Ansible-Based Fleet Automation for large-scale deployments.
  • Idempotent Execution to prevent unnecessary changes and service restarts.
  • Dry-Run Capability for change validation before implementation.
  • Automatic Datadog Agent Restart when configuration changes occur.
  • Built-in Verification to confirm successful deployment.
  • Reduced Configuration Drift through standardized automation.
  • Improved License Governance by ensuring hosts are assigned to the correct Datadog infrastructure tier.
  • Enterprise-Ready Operations suitable for production-scale environments.

By automating Datadog Infrastructure Mode management, organizations can reduce administrative effort, improve operational consistency, and maintain accurate infrastructure monitoring across their server fleet.


A single Datadog Agent configuration value controls the infrastructure tier per host:

# /etc/datadog-agent/datadog.yaml (Linux)
# or DD_INFRASTRUCTURE_MODE env var (Windows / Linux)
infrastructure_mode: full # → Infra Pro
infrastructure_mode: basic # → Infra Basic
infrastructure_mode: none # → Agent installed, no infra reporting
infrastructure_mode: end_user_device # → Laptops / employee endpoints

These scripts set DD_INFRASTRUCTURE_MODE at the system level so it persists across reboots and Agent restarts — then restart the Agent to apply it immediately.


Platform Versions Init System Script
Windows Server 2016, 2019, 2022 Windows SCM windows/
RHEL 6 SysV linux/
RHEL 7, 8, 7 Power systemd linux/
CentOS 7 systemd linux/
Ubuntu 14.04 Upstart linux/
Ubuntu 16.04, 18.04, 20.04 systemd linux/
SUSE Ent / SLES 12, 15 systemd linux/
OpenSUSE Leap 15 systemd linux/
Oracle Linux 7, 8 systemd linux/
Solaris 10/11 SPARC SMF ⚠️ Manual — see Section 6

datadog-hostplan-config/
├── README.md
├── LICENSE
├── windows/
│ ├── Set-DDInfraMode-Basic.ps1 # Sets DD_INFRASTRUCTURE_MODE=basic
│ └── Set-DDInfraMode-Full.ps1 # Sets DD_INFRASTRUCTURE_MODE=full
├── linux/
│ ├── set_dd_infra_mode_basic.sh # Sets basic (RHEL/Ubuntu/SUSE/OL)
│ └── set_dd_infra_mode_full.sh # Sets full (Pro hosts)
└── ansible/
├── site.yml # Master playbook entry point
├── inventory/
│ └── hosts.ini # Fleet inventory + tier groups
├── group_vars/
│ └── all.yml # Global variables + defaults
└── roles/
└── dd_infra_mode/
├── tasks/
│ ├── main.yml # OS detection, routing, validation, verify
│ ├── systemd.yml # RHEL 7/8, Ubuntu 16–20, SUSE, OL 7/8
│ ├── sysv.yml # RHEL 6
│ └── upstart.yml # Ubuntu 14.04
├── handlers/
│ └── main.yml # Restart logic per init system
└── templates/
└── systemd_override.conf.j2

  • Run as Administrator
  • Datadog Agent installed and running (Get-Service datadogagent)
  • PowerShell 5.1+
Terminal window
# Dry run — preview changes without applying
.\windows\Set-DDInfraMode-Basic.ps1 -DryRun
# Apply basic
.\windows\Set-DDInfraMode-Basic.ps1
# Apply full (Pro)
.\windows\Set-DDInfraMode-Full.ps1
# Override value at runtime
.\windows\Set-DDInfraMode-Basic.ps1 -VarValue "none"
  1. Reads current DD_INFRASTRUCTURE_MODE from Machine-scope registry (HKLM)
  2. Already correct → skips, no restart
  3. Wrong value or not set → replaces/sets the value
  4. Restarts datadogagent service only if a change was made
  5. Verifies the value after restart and reports status

  • Run as root or with sudo
  • Datadog Agent installed and running (systemctl status datadog-agent)
Terminal window
# Make executable (one-time)
chmod +x linux/set_dd_infra_mode_basic.sh linux/set_dd_infra_mode_full.sh
# Dry run — preview what will change
sudo ./linux/set_dd_infra_mode_basic.sh basic --dry-run
# Apply basic
sudo ./linux/set_dd_infra_mode_basic.sh
# Apply full (Pro)
sudo ./linux/set_dd_infra_mode_full.sh
# Override value at runtime
sudo ./linux/set_dd_infra_mode_basic.sh full

Auto-detects the init system and writes to the correct location:

Init System Hosts Config File
systemd RHEL 7/8, Ubuntu 16–20, SUSE, OL /etc/systemd/system/datadog-agent.service.d/override.conf
SysV RHEL 6 /etc/sysconfig/datadog-agent
Upstart Ubuntu 14.04 /etc/default/datadog-agent
  1. Detects OS and init system automatically
  2. Reads current value — skips if already correct
  3. Replaces any existing value with the target
  4. Restarts Agent via the correct init command
  5. Verifies via /proc/<pid>/environ post-restart

  • Ansible 2.12+
  • SSH access to target hosts
  • Python 3 on target hosts
  • Update ansible/inventory/hosts.ini with actual IPs
Terminal window
# Dry run with full diff
ansible-playbook ansible/site.yml -i ansible/inventory/hosts.ini --check --diff
# Apply to Basic tier hosts
ansible-playbook ansible/site.yml -i ansible/inventory/hosts.ini -l infra_basic
# Apply to Pro tier hosts
ansible-playbook ansible/site.yml -i ansible/inventory/hosts.ini -l infra_pro
# Target a single host
ansible-playbook ansible/site.yml -i ansible/inventory/hosts.ini -l rhel7-host1
# Override mode at runtime
ansible-playbook ansible/site.yml -i ansible/inventory/hosts.ini \
-l infra_basic -e "dd_infrastructure_mode=full"
# Phased rollout — 50 hosts per batch
ansible-playbook ansible/site.yml -i ansible/inventory/hosts.ini \
-l infra_basic --forks 50

Datadog Agent does not officially support Solaris. If agents are running via a custom install on Solaris 10/11 SPARC, set the env var via SMF:

Terminal window
svccfg -s datadog-agent setenv DD_INFRASTRUCTURE_MODE basic
svcadm restart datadog-agent
# Verify
svcs -lp datadog-agent | grep DD_INFRASTRUCTURE_MODE

After applying on any platform, confirm the Agent picked up the new value:

Linux:

Terminal window
sudo datadog-agent config show | grep infrastructure_mode
# or
sudo systemctl show datadog-agent | grep DD_INFRASTRUCTURE_MODE

Windows:

Terminal window
[System.Environment]::GetEnvironmentVariable("DD_INFRASTRUCTURE_MODE", "Machine")

Ansible:

Terminal window
# Verification is handled automatically in tasks/main.yml
# Check playbook output for ✅ Datadog Agent is running on <host>


Name Shivam Anand
Title Sr. DevOps Engineer | Engineering
Organisation Zoos Global
Email [email protected]
Web www.zoosglobal.com
Address Violena, Pali Hill, Bandra West, Mumbai - 400050

Zoos Global    Datadog Premier Partner



Version 1.0.0 · April 2026 © 2026 Zoos Global · MIT License Zoos Global is a Datadog Premier Partner