chore: add k8s and docker as service to agent and update logic for ansible deploy
ci-agent / build (push) Failing after 2m35s

This commit is contained in:
d3m0k1d
2026-04-05 01:43:38 +03:00
parent 428140ff15
commit 3e5e4815d9
9 changed files with 385 additions and 48 deletions
+7 -10
View File
@@ -26,16 +26,13 @@ type Inventory struct {
Hosts []InventoryHost
}
const inventoryTemplateText = `{{ range .Hosts }}
{{ .Name }} ansible_host={{ .IP }} ansible_port={{ .Port }} ansible_user={{ .User }} ansible_connection=ssh
{{ if eq .AuthMethod "key" }}ansible_ssh_private_key_file={{ .SSHKey }}{{ end }}
{{ if eq .AuthMethod "password" }}ansible_ssh_pass={{ .Password }}{{ end }}
deploy_type={{ .DeployType }}
agent_token={{ .Token }}
agent_label={{ .Name }}
grpc_url={{ .GRPCURL }}
{{ end }}`
const inventoryTemplateText = `{{- range $i, $host := .Hosts }}
{{ $host.Name }} ansible_host={{ $host.IP }} ansible_port={{ $host.Port }} ansible_user={{ $host.User }} ansible_connection=ssh{{ if eq $host.AuthMethod "key" }} ansible_ssh_private_key_file={{ $host.SSHKey }}{{ end }}{{ if eq $host.AuthMethod "password" }} ansible_ssh_pass={{ $host.Password }}{{ end }}
deploy_type={{ $host.DeployType }}
agent_token={{ $host.Token }}
agent_label={{ $host.Name }}
grpc_url={{ $host.GRPCURL }}
{{ end -}}`
// GenerateInventory generates an Ansible inventory file from the given hosts
func GenerateInventory(hosts []InventoryHost, outputPath string) error {