fix(slm): add ansible_name column for proper Ansible targeting (#1814)#1932
Merged
mrveiss merged 3 commits intoDev_new_guifrom Mar 20, 2026
Merged
fix(slm): add ansible_name column for proper Ansible targeting (#1814)#1932mrveiss merged 3 commits intoDev_new_guifrom
mrveiss merged 3 commits intoDev_new_guifrom
Conversation
Node.hostname stores display names (e.g., '00-SLM-Manager') which break Ansible --limit operations. This adds an explicit ansible_name column for Ansible inventory host targeting. The reconciler now uses ansible_name (with ip_address fallback) instead of hostname when executing playbooks.
✅ SSOT Configuration Compliance: Passing🎉 No hardcoded values detected that have SSOT config equivalents! |
Code review found: migration was not registered in runner.py, and services.py, tls.py, setup_wizard.py still passed node.hostname to Ansible --limit. All callers now use ansible_name with IP fallback.
- Add Node.ansible_target property (single source of truth for targeting) - Fix fact extraction key in services.py to match --limit value - Replace all inline ansible_name-or-ip patterns with the property
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Node.hostnamestores display names (e.g.,00-SLM-Manager) but the reconciler passes it directly to Ansible--limit, which needs actual inventory hostnames. This caused silent failures in service restart operations (#1789).Changes
ansible_nameVARCHAR(255) nullable columnansible_nametoNodeCreate,NodeUpdate,NodeResponseansible_nameduring node enrollment (both create paths)node.ansible_name or node.ip_addressfor Ansible--limit(both call sites)Migration
Backward-compatible:
ansible_nameis nullable. Existing nodes withNULLansible_name will fall back to IP address for Ansible operations (safer than display name).Post-merge: Backfill existing nodes
After deploying, run on .19:
Test plan
ansible_namefieldansible_namefor Ansible limitansible_namefall back to IP addressCloses #1814