feat(delivery): integrate PostgreSQL delivery
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user