workspace-validator
Skill14 starsChanged 21 months agoMITView on GitHub
Validate an existing SAP workspace configuration before running tests — checks sap-parameters.yaml, hosts.yaml, and SSH auth readiness. Use when asked to validate or troubleshoot a workspace that already exists; not for creating a new one from scratch (see workspace-creator) and not for framework installation issues (see setup-guide). Triggered by "validate workspace", "check workspace", "workspace issues", "fix workspace", "sap-parameters check", "hosts.yaml check", "SSH auth problems", or "troubleshoot workspace".
In this repository7 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- code-reviewSkill
- setup-guideSkill
- test-result-analyzerSkill
- test-runnerSkill
- workspace-creatorSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 52
If no path is provided, discovers and validates all workspaces under WORKSPACES/SYSTEM/.
- Distinctive: line 143
When run with network access to the SAP hosts, the validator tests SSH connectivity:
- Distinctive: line 210
Before reporting validation complete:
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Workspace Validator
Validates SAP workspace configurations before test execution. Checks file presence, field completeness, valid values, SSH authentication readiness, and inventory structure.
Locate Framework
This skill requires a trusted STAF checkout — a working tree the
operator has verified out-of-band as either the official upstream
(https://github.com/Azure/sap-automation-qa.git) or a fork of it, at a
specific revision, with the framework marker ./scripts/sap_automation_qa.sh
present. The operator must have verified both the source (upstream URL or
fork URL) and the revision through a trusted out-of-band channel before
running this skill, and must have cd-ed into that directory. If that
state is not confirmed, stop and use the setup-guide skill first; it owns
the setup workflow. Do not resume this skill until setup-guide (or the
operator directly) confirms the checkout is trusted.
⚠️ This skill is guidance only. Do NOT modify any source code, scripts, or framework files. Only help the user by running the validation script and interpreting results.
When to Use
| Trigger | Action |
validate workspace / check config | Run full validation |
workspace issues / fix workspace | Diagnose and fix problems |
sap-parameters check | Validate SAP parameters file |
hosts.yaml check | Validate Ansible inventory |
SSH auth problems | Check authentication configuration |
Running Validation
python3 skills/workspace-validator/scripts/validate_workspace.py [WORKSPACE_PATH]If no path is provided, discovers and validates all workspaces under WORKSPACES/SYSTEM/.
Examples:
# Validate specific workspace
python3 skills/workspace-validator/scripts/validate_workspace.py \
WORKSPACES/SYSTEM/DEV-WEEU-SAP01-X00
# Validate all workspaces
python3 skills/workspace-validator/scripts/validate_workspace.pyExit codes:
0— All critical checks passed1— One or more critical checks failed
What Gets Validated
1. File Presence
| File | Status |
sap-parameters.yaml | Required |
hosts.yaml or {SID}_hosts.yaml | Required |
SSH key file (files with ssh_key in the filename, e.g., ssh_key.ppk, ssh_key.pem) | Conditional |
password file | Conditional (VMPASSWORD auth only) |
2. sap-parameters.yaml Validation
Always required fields:
sap_sid— SAP System ID (3 chars, uppercase alphanumeric)platform— Valid values:HANA,DB2db_sid— Database SIDdb_instance_number— String, 2 digits (e.g.,"00")database_high_availability— Boolean (true/false)scs_high_availability— Booleanscs_instance_number— String, 2 digitsers_instance_number— String, 2 digitsNFS_provider— Valid values:AFS,ANF
Conditional fields:
database_cluster_type— Required whendatabase_high_availability: true. Fencing mechanism — values:AFA(Azure Fencing Agent),ISCSI,ASD(Azure Shared Disks)scs_cluster_type— Required whenscs_high_availability: true. Fencing mechanism — values:AFA(Azure Fencing Agent),ISCSI,ASD(Azure Shared Disks)database_scale_out— Boolean, defaults tofalsekey_vault_id— Azure resource ID (if Key Vault auth)secret_id— Key Vault secret URL (if Key Vault auth)user_assigned_identity_client_id— UUID (if MSI auth)ANF_account_rg— Required whenNFS_provider: ANFANF_account_name— Required whenNFS_provider: ANF
Azure Backup fields (for AzureBackupDatabase tests):
backup_vault_resource_id— Recovery Services vault resource IDbackup_container_name— Format:VMAppContainer;Compute;<rg>;<vm>backup_item_name— Format:saphanadatabase;<sid>;<db>backup_target_filesystem_path— e.g.,/hana/backup/restorebackup_target_container_name— Target container (ALR)backup_target_database_name— e.g.,SYSTEMDBbackup_restore_point_time— ISO 8601 UTC (empty string for latest)
3. hosts.yaml Validation
Required groups (based on test type):
{SID}_DB— 2 hosts (for DatabaseHighAvailability){SID}_SCS— 1 host (for CentralServicesHighAvailability){SID}_ERS— 1 host (for CentralServicesHighAvailability){SID}_PAS— 1 host (optional){SID}_APP— 1+ hosts (optional)
Required per-host fields:
ansible_host— IP address or hostnameansible_user— SSH username (typicallyazureadm)ansible_connection— Must besshconnection_type— Must bekeyvirtual_host— Virtual hostname for cluster resourcesbecome_user— Must berootos_type— Must belinuxvm_name— Azure VM name
Required group vars:
node_tier— Values:hana,scs,ers,pas,appsupported_tiers— List (e.g.,[hana])
4. SSH Authentication
Priority order (checked top-to-bottom, first match wins):
- Key Vault —
secret_idfield in sap-parameters.yaml → MSI retrieves SSH key - Local key file — File with
ssh_keyin the filename (e.g.,ssh_key.ppk,ssh_key.pem), NOT any file with a.pemor.keyextension - Password file — File named
passwordin workspace directory (VMPASSWORD auth)
5. SSH Connectivity (Optional)
When run with network access to the SAP hosts, the validator tests SSH connectivity:
# With SSH connectivity test (default when hosts are reachable)
python3 skills/workspace-validator/scripts/validate_workspace.py WORKSPACES/SYSTEM/DEV-WEEU-SAP01-X00
# Skip SSH connectivity test (CI, offline, or no network access)
STAF_SKIP_SSH=1 python3 skills/workspace-validator/scripts/validate_workspace.py WORKSPACES/SYSTEM/DEV-WEEU-SAP01-X00What it checks:
- Attempts
ssh -o ConnectTimeout=5 {user}@{host} exit 0for each host in inventory - Uses SSH key from workspace if found
- Reports ✅ for reachable hosts, ⚠️ for unreachable (warning, not error)
- Skipped entirely when
STAF_SKIP_SSHenvironment variable is set
Output Format
════════════════════════════════════════════════════════════════
Workspace Validation: DEV-WEEU-SAP01-X00
════════════════════════════════════════════════════════════════
📁 File Checks
✅ sap-parameters.yaml found
✅ hosts.yaml found
✅ SSH key file found (ssh_key.pem)
📋 sap-parameters.yaml
✅ sap_sid: X00
✅ platform: HANA
✅ database_high_availability: true
✅ database_cluster_type: AFA
❌ db_instance_number: missing (required)
⚠️ ANF_account_rg: missing (needed when NFS_provider=ANF)
📋 hosts.yaml
✅ X00_DB group: 2 hosts found
✅ All hosts have required fields
❌ X00_SCS group: missing (required for SCS HA tests)
🔐 SSH Authentication
✅ Key Vault auth configured (secret_id present)
🌐 SSH Connectivity
✅ host1 (10.0.0.1): reachable
⚠️ host2 (10.0.0.2): unreachable (Connection timed out)
────────────────────────────────────────────────────────────────
Result: ❌ FAILED (2 errors, 1 warning)
────────────────────────────────────────────────────────────────Error Handling
| Error | Cause | Fix |
sap-parameters.yaml not found | File missing | Create from template (use workspace-creator) |
hosts.yaml not found | Inventory missing | Create with all required host groups |
Invalid sap_sid | Not 3 chars or invalid chars | Use exactly 3 uppercase alphanumeric chars |
Invalid platform | Not HANA or DB2 | Set to HANA or DB2 |
No SSH authentication found | No key/vault/password | Add key file or configure Key Vault |
{SID}_DB missing | Group not in hosts.yaml | Add group with 2 hosts for HA |
virtual_host missing | Host field incomplete | Add virtual hostname for cluster resource |
Pre-Completion Checklist
Before reporting validation complete:
- Script ran without Python errors
- All critical (❌) issues are resolved or explained
- Warnings (⚠️) are acknowledged with rationale
- SSH authentication path is confirmed working
- Host groups match the intended test type
Related Skills
| Need to... | Use skill |
| Create a workspace from scratch | workspace-creator |
| Run tests on validated workspace | test-runner |
| Set up the environment first | setup-guide |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

