update vault integration

This commit is contained in:
2024-05-10 15:56:07 +03:00
parent 385b79d457
commit a0f87046ca
55 changed files with 828 additions and 135 deletions

View File

@@ -0,0 +1,61 @@
{{- range .Hosts }}
{{ .Hostname }} ansible_host={{ .Ip }} ip={{ .Ip }} {{ if .User }}ansible_user={{ .User }}{{- end }} {{ if .Password }}ansible_ssh_password={{ .Password }}{{- end }}
{{- end }}
[kube_control_plane]
{{- range .Hosts }}
{{- $search := "control_plane" -}}
{{- $found := false -}}
{{- range .Roles }}
{{- if eq . $search }}
{{- $found = true }}
{{- end }}
{{- end }}
{{- if $found }}
{{ .Hostname }}
{{- end }}
{{- end }}
[etcd]
{{- range .Hosts }}
{{- $search := "etcd" -}}
{{- $found := false -}}
{{- range .Roles }}
{{- if eq . $search }}
{{- $found = true }}
{{- end }}
{{- end }}
{{- if $found }}
{{ .Hostname }}
{{- end }}
{{- end }}
[kube_node]
{{- range .Hosts }}
{{- $search := "node" -}}
{{- $found := false -}}
{{- range .Roles }}
{{- if eq . $search }}
{{- $found = true }}
{{- end }}
{{- end }}
{{- if $found }}
{{ .Hostname }}
{{- end }}
{{- end }}
[k8s_cluster:children]
kube_control_plane
kube_node
[all:vars]
ansible_connection=ssh
{{- if not (eq .Credentials.User "") }}
ansible_user={{ .Credentials.User }}
{{- end }}
{{- if not (eq .Credentials.Password "") }}
ansible_ssh_password={{ .Credentials.Password }}
{{- end }}
{{- if not (eq .Credentials.PrivateKeyFile "") }}
ansible_ssh_private_key_file={{ .Credentials.PrivateKeyFile }}
{{- end }}