feat(delivery): integrate PostgreSQL delivery

This commit is contained in:
l x
2026-07-31 10:30:03 +08:00
parent 048ac6507e
commit 66fde73792
25 changed files with 2110 additions and 139 deletions
+5
View File
@@ -363,6 +363,11 @@ var ansibleHostPattern = regexp.MustCompile(`(?m)^\s*ansible_host\s*:\s*"?([^"\s
func AWXHostIP(host AWXInventoryHost) string {
var parsed map[string]any
if err := json.Unmarshal([]byte(host.Variables), &parsed); err == nil {
for _, key := range []string{"xinfra_public_address", "xinfra_host_address"} {
if value, ok := parsed[key].(string); ok && strings.TrimSpace(value) != "" {
return strings.TrimSpace(value)
}
}
if value, ok := parsed["ansible_host"].(string); ok && strings.TrimSpace(value) != "" {
return strings.TrimSpace(value)
}