From f39f228f3981cf64a3119ab68108277ddc273c32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=97=AA=D1=94=CE=BD=CE=B9=CE=B7=20=E1=97=B7=CF=85=D0=BD?= =?UTF-8?q?=CA=9F?= Date: Thu, 24 Sep 2020 10:16:12 -0400 Subject: [PATCH 1/2] k3s_tls_san readme changes this can be a list and iterated over in the systemd service --- README.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 7b7d1b0..42eacdb 100644 --- a/README.md +++ b/README.md @@ -209,21 +209,21 @@ Please note that this may potentially break setting up agents. Below are variables that are set against specific hosts in your inventory. -| Variable | Description | Default Value | -|-----------------------------|--------------------------------------------------------------------------|------------------------| -| `k3s_control_node` | Define the host as a control plane node, (True/False). | `false` | -| `k3s_node_name` | Define the name of this node. | `$(hostname)` | -| `k3s_node_id` | Define the ID of this node. | _NULL_ | -| `k3s_flannel_interface` | Define the flannel proxy interface for this node. | _NULL_ | -| `k3s_bind_address` | Define the bind address for this node. | localhost | -| `k3s_node_ip_address` | IP Address to advertise for this node. | _NULL_ | -| `k3s_node_external_address` | External IP Address to advertise for this node. | _NULL_ | -| `k3s_node_labels` | List of node labels. | _NULL_ | -| `k3s_kubelet_args` | A list of kubelet args to pass to the server. | [] | -| `k3s_kube_proxy_args` | A list of kube proxy args to pass to the server. | [] | -| `k3s_node_taints` | List of node taints. | _NULL_ | -| `k3s_node_data_dir` | Folder to hold state. | `/var/lib/rancher/k3s` | -| `k3s_tls_san` | Add additional hosname or IP as Subject Alternate Name in the TLS cert. | _NULL_ | +| Variable | Description | Default Value | +|-----------------------------|----------------------------------------------------------------------------------|------------------------| +| `k3s_control_node` | Define the host as a control plane node, (True/False). | `false` | +| `k3s_node_name` | Define the name of this node. | `$(hostname)` | +| `k3s_node_id` | Define the ID of this node. | _NULL_ | +| `k3s_flannel_interface` | Define the flannel proxy interface for this node. | _NULL_ | +| `k3s_bind_address` | Define the bind address for this node. | localhost | +| `k3s_node_ip_address` | IP Address to advertise for this node. | _NULL_ | +| `k3s_node_external_address` | External IP Address to advertise for this node. | _NULL_ | +| `k3s_node_labels` | List of node labels. | _NULL_ | +| `k3s_kubelet_args` | A list of kubelet args to pass to the server. | [] | +| `k3s_kube_proxy_args` | A list of kube proxy args to pass to the server. | [] | +| `k3s_node_taints` | List of node taints. | _NULL_ | +| `k3s_node_data_dir` | Folder to hold state. | `/var/lib/rancher/k3s` | +| `k3s_tls_san` | A list of additional hosnames or IPs as Subject Alternate Name in the TLS cert. | [] | #### Important note about `k3s_control_node` and High Availability (HA) From 6cf09c8efa269b281eb04cecc1a03e6c23e67936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=97=AA=D1=94=CE=BD=CE=B9=CE=B7=20=E1=97=B7=CF=85=D0=BD?= =?UTF-8?q?=CA=9F?= Date: Thu, 24 Sep 2020 10:21:48 -0400 Subject: [PATCH 2/2] implement k3s_tls_san iterable in systemd service keeps support for non-array values --- templates/k3s.service.j2 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/templates/k3s.service.j2 b/templates/k3s.service.j2 index 4f7caa1..9ce5f8b 100644 --- a/templates/k3s.service.j2 +++ b/templates/k3s.service.j2 @@ -142,8 +142,14 @@ ExecStart={{ k3s_install_dir }}/k3s {% if k3s_resolv_conf is defined and k3s_resolv_conf %} --resolv-conf {{ k3s_resolv_conf }} {% endif %} -{% if k3s_tls_san is defined and k3s_tls_san %} - --tls-san {{ k3s_tls_san }} +{% if k3s_tls_san is defined and k3s_tls_san is iterable %} + {% for san in k3s_tls_san %} + --tls-san {{ san }} + {% endfor %} +{% else %} + {% if k3s_tls_san is defined and k3s_tls_san %} + --tls-san {{ k3s_tls_san }} + {% endif %} {% endif %} {% if k3s_node_data_dir is defined %} --data-dir {{ k3s_node_data_dir }}