- Home
- Repositories
- datadog-hostplan-config
datadog-hostplan-config
README documentation for datadog-hostplan-config
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 Host Plan Config
Section titled “Zoos Global — Datadog Host Plan Config”
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.
1. The Problem — Why This Exists
Section titled “1. The Problem — Why This Exists”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.
2. The Solution — What We Built
Section titled “2. The Solution — What We Built”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_MODEenvironment 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.
3. How It Works
Section titled “3. How It Works”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 Proinfrastructure_mode: basic # → Infra Basicinfrastructure_mode: none # → Agent installed, no infra reportinginfrastructure_mode: end_user_device # → Laptops / employee endpointsThese 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.
4. Supported Platforms
Section titled “4. Supported Platforms”| 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 |
5. Repository Structure
Section titled “5. Repository Structure”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.j26. Windows
Section titled “6. Windows”Prerequisites
Section titled “Prerequisites”- Run as Administrator
- Datadog Agent installed and running (
Get-Service datadogagent) - PowerShell 5.1+
# 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"What It Does
Section titled “What It Does”- Reads current
DD_INFRASTRUCTURE_MODEfrom Machine-scope registry (HKLM) - Already correct → skips, no restart
- Wrong value or not set → replaces/sets the value
- Restarts
datadogagentservice only if a change was made - Verifies the value after restart and reports status
7. Linux
Section titled “7. Linux”Prerequisites
Section titled “Prerequisites”- Run as root or with
sudo - Datadog Agent installed and running (
systemctl status datadog-agent)
# 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 changesudo ./linux/set_dd_infra_mode_basic.sh basic --dry-run
# Apply basicsudo ./linux/set_dd_infra_mode_basic.sh
# Apply full (Pro)sudo ./linux/set_dd_infra_mode_full.sh
# Override value at runtimesudo ./linux/set_dd_infra_mode_basic.sh fullWhat It Does
Section titled “What It Does”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 |
- Detects OS and init system automatically
- Reads current value — skips if already correct
- Replaces any existing value with the target
- Restarts Agent via the correct init command
- Verifies via
/proc/<pid>/environpost-restart
8. Ansible
Section titled “8. Ansible”Prerequisites
Section titled “Prerequisites”- Ansible 2.12+
- SSH access to target hosts
- Python 3 on target hosts
- Update
ansible/inventory/hosts.iniwith actual IPs
# Dry run with full diffansible-playbook ansible/site.yml -i ansible/inventory/hosts.ini --check --diff
# Apply to Basic tier hostsansible-playbook ansible/site.yml -i ansible/inventory/hosts.ini -l infra_basic
# Apply to Pro tier hostsansible-playbook ansible/site.yml -i ansible/inventory/hosts.ini -l infra_pro
# Target a single hostansible-playbook ansible/site.yml -i ansible/inventory/hosts.ini -l rhel7-host1
# Override mode at runtimeansible-playbook ansible/site.yml -i ansible/inventory/hosts.ini \ -l infra_basic -e "dd_infrastructure_mode=full"
# Phased rollout — 50 hosts per batchansible-playbook ansible/site.yml -i ansible/inventory/hosts.ini \ -l infra_basic --forks 509. Solaris (Manual — SMF)
Section titled “9. Solaris (Manual — SMF)”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:
svccfg -s datadog-agent setenv DD_INFRASTRUCTURE_MODE basicsvcadm restart datadog-agent
# Verifysvcs -lp datadog-agent | grep DD_INFRASTRUCTURE_MODE10. Verification
Section titled “10. Verification”After applying on any platform, confirm the Agent picked up the new value:
Linux:
sudo datadog-agent config show | grep infrastructure_mode# orsudo systemctl show datadog-agent | grep DD_INFRASTRUCTURE_MODEWindows:
[System.Environment]::GetEnvironmentVariable("DD_INFRASTRUCTURE_MODE", "Machine")Ansible:
# Verification is handled automatically in tasks/main.yml# Check playbook output for ✅ Datadog Agent is running on <host>11. References
Section titled “11. References”- Datadog Infrastructure Modes — Official Docs
- Fleet Automation — Remote Configuration
- Fleet Automation Audit Trail
👤 Author
Section titled “👤 Author”| Name | Shivam Anand |
| Title | Sr. DevOps Engineer | Engineering |
| Organisation | Zoos Global |
| [email protected] | |
| Web | www.zoosglobal.com |
| Address | Violena, Pali Hill, Bandra West, Mumbai - 400050 |
Version 1.0.0 · April 2026 © 2026 Zoos Global · MIT License Zoos Global is a Datadog Premier Partner

