34 lines
1.2 KiB
Cheetah
34 lines
1.2 KiB
Cheetah
{{- range .Hosts.Masters }}
|
|
{{ .Hostname }} ansible_host={{ .Ip }} ip={{ .Ip }} {{ if .User }}ansible_user={{ .User }}{{- end }} {{ if .Password }}ansible_ssh_password={{ .Password }}{{- end }}
|
|
{{- end }}
|
|
{{- range .Hosts.Workers }}
|
|
{{ .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.Masters }}
|
|
{{ .Hostname }}
|
|
{{- end }}
|
|
|
|
[etcd]
|
|
{{- range .Hosts.Masters }}
|
|
{{ .Hostname }}
|
|
{{- end }}
|
|
|
|
[kube_node]
|
|
{{- range .Hosts.Workers }}
|
|
{{ .Hostname }}{{- if .Roles }} node_taints='[{{- range $i, $role := .Roles }}{{- if $i }},{{- end }}"node-role.kubernetes.io/{{ $role }}:NoSchedule"{{- end }}]' node_labels="{ {{- range $i, $role := .Roles }}{{- if $i }},{{- end }}'node-role.kubernetes.io/{{ $role }}': ''{{- end }} }"{{- end }}
|
|
{{- end }}
|
|
|
|
[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 }}
|