Madagascar cluster context files
Purpose
These files provide a shared cluster-context cache and changelog for Madagascar. Other projects can read or append to these files to share knowledge about cluster layout, network configuration, and changes that may affect deployments.
Files
madagascar.json - primary cache. Contains a schemaVersion, lastUpdated, source, and a clusters map keyed by cluster name. Each cluster can include hosts, network file paths, services and notes.
madagascar-changelog.json - append-only changelog. Contains an entries array. Each entry should include: id, timestamp (ISO 8601 UTC), project, author, summary, details, affectedResources (array), and type (info|change|breaking|deprecated).
history/ - historical snapshots that are useful for reference but are not the current source of truth.
Contract (madagascar.json)
interfacesFile and interfacesD (relative paths)Changelog entry contract (madagascar-changelog.json)
How to update
Manual append example (bash + jq):
# create new entry JSON
entry=$(jq -n --arg id "entry-$(date -u +%Y%m%d%H%M%S)" \
--arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
--arg project "mysvc" \
--arg author "$USER" \
--arg summary "Updated network config" \
--arg details "Added new interface route needed by Madagascar" \
'{id: $id, timestamp: $ts, project: $project, author: $author, summary: $summary, details: $details, affectedResources:["network/interfaces"], type: "change"}')
# append atomically
jq --argjson e "$entry" '.entries += [$e]' cluster-context/madagascar-changelog.json > cluster-context/madagascar-changelog.json.tmp && mv cluster-context/madagascar-changelog.json.tmp cluster-context/madagascar-changelog.json
Automation guidance
id values (project prefix + timestamp + random suffix).cluster-context/madagascar.json, also add a changelog entry.cluster-context/madagascar.json small — only cache what's necessary.Notes
cluster-context/madagascar-changelog.json as append-only; prefer appending rather than rewriting history.