@@ -96,6 +96,7 @@ locals {
96
96
disable-kube-proxy = var.disable_kube_proxy
97
97
disable = local.disable_extras
98
98
kubelet-arg = concat (local. kubelet_arg , var. k3s_global_kubelet_args , var. k3s_control_plane_kubelet_args , v. kubelet_args )
99
+ kube-apiserver-arg = local.kube_apiserver_arg
99
100
kube-controller-manager-arg = local.kube_controller_manager_arg
100
101
flannel-iface = local.flannel_iface
101
102
node-ip = module.control_planes[k].private_ipv4_address
@@ -153,6 +154,38 @@ resource "null_resource" "control_plane_config" {
153
154
]
154
155
}
155
156
157
+
158
+ resource "null_resource" "authentication_config" {
159
+ for_each = local. control_plane_nodes
160
+
161
+ triggers = {
162
+ control_plane_id = module.control_planes[each.key].id
163
+ authentication_config = sha1 (var. authentication_config )
164
+ }
165
+
166
+ connection {
167
+ user = " root"
168
+ private_key = var. ssh_private_key
169
+ agent_identity = local. ssh_agent_identity
170
+ host = module. control_planes [each . key ]. ipv4_address
171
+ port = var. ssh_port
172
+ }
173
+
174
+ provisioner "file" {
175
+ content = var. authentication_config
176
+ destination = " /tmp/authentication_config.yaml"
177
+ }
178
+
179
+ provisioner "remote-exec" {
180
+ inline = [local . k3s_authentication_config_update_script ]
181
+ }
182
+
183
+ depends_on = [
184
+ null_resource. first_control_plane ,
185
+ hcloud_network_subnet . control_plane
186
+ ]
187
+ }
188
+
156
189
resource "null_resource" "control_planes" {
157
190
for_each = local. control_plane_nodes
158
191
@@ -195,6 +228,7 @@ resource "null_resource" "control_planes" {
195
228
depends_on = [
196
229
null_resource. first_control_plane ,
197
230
null_resource. control_plane_config ,
231
+ null_resource. authentication_config ,
198
232
hcloud_network_subnet . control_plane
199
233
]
200
234
}
0 commit comments