Entry Point 9: This document serves as the Security & Defense Entry Point. See START-HERE.md for the master onboarding roadmap.
docs/GITOPS-AIOPS-ANSIBLE-STRATEGY.md
“Git is the source of truth. Ansible is the hand. AI is the mind.”This document defines the strategic doctrine for the three operational pillars of any DSOM-based project. These pillars are non-negotiable and apply universally, regardless of the technology stack.
1. The Three-Pillar Model (+ Palace)
- AI Proposes, AI (Cognitive Twin) analyses logs, generates playbooks/scripts, and recommends next action.
- Git Records, Human commits the proposed script/config to the repository.
- Executor Runs, Human triggers the execution (e.g. Ansible,
uv,node) against target nodes. - AI Verifies, Human pastes output back to AI; AI analyses results and confirms success or recommends remediation.
- Palace Remembers, EOD palace-sync captures spatial knowledge; SOD manifest includes Palace Registry so AI walks it on wake-up.
🤖 2. AIOps Pillar
2.1 Role Definition
The AI operates exclusively as the Cognitive Digital Twin, an advisory intelligence layer. It is not an autonomous executor.2.2 AIOps Workflow
2.3 AI Context Requirements
Before any advisory session, the AI MUST read:docs/AI-MASTER-PROTOCOL.md, Governance lawsdocs/AI-COGNITIVE-TWIN-PROTOCOL.md, Project-specific environment map.agents/brain/task.md, Current state.agents/brain/walkthrough.md, History and Mental Anchor.agents/brain/palace_registry.md, Spatial map (Palace v1.0), walk this to locate relevant Roomsinventory/hosts.yml, Target node topology
SOD shortcut: bash tools/sod-palace.sh # (Windows: .\tools\sod-palace.ps1) injects all of the above automatically via the reanimation manifest (Section [14] = Palace Registry).
🔄 3. GitOps Pillar
3.1 Core Principle
Git is the single source of truth. All system state, configuration, and desired state is represented in the Git repository. The repository is the only authoritative source.3.2 GitOps Laws
- No Ad-hoc Changes: No manual SSH edits to production/staging nodes. If a change is not in Git, it does not exist.
- Deploy-by-Merge: The merge to
mainis the trigger for a deployment (via Ansible). No other trigger is valid. - Branch Protection: The
mainbranch is protected. All changes require a Pull Request (PR) or explicit Sovereign authorisation. - Declarative State: All configuration files are declarative (Ansible playbooks,
hosts.yml,group_vars/). The desired state is always readable. - Audit Trail: Every change has a Git commit with a semantic message. The Git log is the deployment history.
3.3 Commit Convention
All commits must follow the Conventional Commits standard:3.4 Sync Ritual (The Push-Pull Cycle)
Manual alternative (T1 Windows):
⚙️ 4. The Executor Pillar (Ansible / uv / Node)
4.1 Execution Modularity
While DSOM was originally forged for heavy infrastructure automation using Ansible, the actual mechanics of the Third Pillar (The Hand) apply to any project type. The Executor is fully modular:- Infrastructure:
ansible-playbook(OS-level operations) - Data Science / Python:
uv run(Isolated Python execution) - Web Development:
npm run/node(JS execution) - Documentation:
pandoc/latex(Compilation)
4.2 The Windows WSL2 Bridge (Control Node)
For projects operating on Windows 11 without a dedicated Linux jumphost, WSL2 (Ubuntu or AlmaLinux) must be configured as the local Control Node.- This “Execution Bridge” ensures that humans and AI agents can seamlessly leverage standard Linux tooling (Ansible, Make, Bash) natively within the Windows environment.
- It removes architectural friction, allowing DSOM to be applied universally across OS environments without requiring external VMs.
4.3 Ansible Laws (If Applicable)
If your project is utilizing Ansible as the Executor, the following laws apply:- Idempotency Law: Every playbook MUST be safe to re-run multiple times with the same result. No playbook may cause data corruption on repeated execution.
- No Hardcoded Secrets: All credentials are managed via
ansible-vault. Never commit plaintext passwords or API keys. - Role-Based Structure: All automation is organised into
roles/following the Ansible Galaxy standard. - SSH Key Authentication: All Ansible connections use SSH key-based auth. Password authentication is prohibited.
- Pre-flight Prerequisite:
tools/audit-pre-flight.shMUST be run and pass before any playbook is executed.
4.3 Standard Directory Structure
Every DSOM project using Ansible MUST follow this structure:4.4 Ansible Prerequisites Checklist
Before running any playbook, the AI MUST verify all of the following:-
inventory/hosts.ymlexists and is populated - SSH keys are distributed to all target nodes
-
ansible-vaultis configured if secrets are required -
tools/audit-pre-flight.shhas been run and passed - The correct Ansible version is installed (
ansible --version) - Connectivity verified (
ansible all -m ping -i inventory/hosts.yml)
4.5 Core Ansible Commands Reference
5. Integration with DSOM Brain + Palace
The three pillars are anchored to the DSOM SKMS (Knowledge Management System):📋 6. Adoption Checklist for New Projects
When starting a new project with DSOM, use this checklist to establish the three pillar baseline:GitOps Setup
- Create GitHub repository with branch protection on
main - Configure
.gitignoreto excludevault/,*.log, sensitive files - Define commit convention in
CONTRIBUTING.md
AIOps Setup
- Create
docs/AI-COGNITIVE-TWIN-PROTOCOL.mdfrom template (fill all[PLACEHOLDER]values) - Initialise
.agents/brain/withtask.md,walkthrough.md,implementation_plan.md - Configure AI agent with
docs/AI-MASTER-PROTOCOL.mdas system context - Run
bash tools/palace-sync.sh --backfillto initialise Palace Registry - Review
palace_update_proposal_YYYY-MM-DD.mdwith AI and populate closets
Ansible Setup
- Follow
docs/HOWTO-SETUP-ANSIBLE-BASELINE.mdfor full setup - Create
ansible.cfg,inventory/hosts.yml,playbooks/preflight.yml - Verify connectivity:
ansible all -m ping -i inventory/hosts.yml - Run pre-flight:
tools/audit-pre-flight.sh - Test SOD playlist:
bash tools/sod-palace.sh # (Windows: .\tools\sod-palace.ps1) - Test EOD playlist:
bash tools/eod-palace.sh # (Windows: .\tools\eod-palace.ps1)
Created by the DSOM Engineering Team | v2.0 | 2026-04-08 Standard: UK English | Licensed under GPLv3
Deep State of Mind (DSOM) For My AI Protocol | Harisfazillah Jamel (LinuxMalaysia) | 2026-07-04 Standard: UK English | DBP-standard Bahasa Melayu Malaysia (Piawai) | GNU General Public License v3.0