-
Notifications
You must be signed in to change notification settings - Fork 0
/
glm-user-data.template.dos
61 lines (56 loc) · 1.36 KB
/
glm-user-data.template.dos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#cloud-config
# (C) Copyright 2024 Hewlett Packard Enterprise Development LP
# setup SSH keys for Administrator
# ----------------------------------------------------
{{- if .SSHKeys }}
users:
- name: GreenLakeAdmin
passwd: CLEARTEXTPASSWORD
ssh_authorized_keys:
{{- range $key := .SSHKeys}}
- {{$key }}
{{- end}}
{{end}}
# proxy and ntp info
# ----------------------------------------------------
{{- /* extract proxy and ntp info from HostDef struct */}}
{{- $proxy := "" }}
{{- $no_proxy := "" }}
{{- $ntp := ""}}
{{- range .Connections }}
{{- if gt .UntaggedNet.VID 0 }}
{{- range .UntaggedNet.Ranges }}
{{- if .Proxy }}
{{- $proxy = .Proxy }}
{{- $no_proxy = .NoProxy }}
{{- end}}
{{- if .NTP}}
{{- $ntp = .NTP}}
{{- end}}
{{- end}}
{{- end}}
{{- range .Networks }}
{{- range .Ranges }}
{{- if .Proxy }}
{{- $proxy = .Proxy }}
{{- $no_proxy = .NoProxy }}
{{- end}}
{{- if .NTP}}
{{- $ntp = .NTP}}
{{- end}}
{{- end}}
{{- end}}
{{- end}}
{{- if $ntp}}
# NTP server information
# ----------------------------------------------------
ntp:
enabled: true
servers:
{{- range $ntp}}
- {{.}}
{{- end}}
{{- end}}
# Begin GLM Host UserData
{{ .UserData }}
# End GLM Host UserData