aboutsummaryrefslogtreecommitdiff
path: root/terraform/ansible/roles
diff options
context:
space:
mode:
Diffstat (limited to 'terraform/ansible/roles')
-rw-r--r--terraform/ansible/roles/k3s/templates/k3s.service.j28
1 files changed, 6 insertions, 2 deletions
diff --git a/terraform/ansible/roles/k3s/templates/k3s.service.j2 b/terraform/ansible/roles/k3s/templates/k3s.service.j2
index b1c5c54..5c0c559 100644
--- a/terraform/ansible/roles/k3s/templates/k3s.service.j2
+++ b/terraform/ansible/roles/k3s/templates/k3s.service.j2
@@ -5,10 +5,14 @@ After=network.target
{% if k3s_role == 'master' %}
ExecStartPre=-/sbin/modprobe br_netfilter
ExecStartPre=-/sbin/modprobe overlay
-ExecStart=/usr/local/bin/k3s server
+ExecStart=/usr/local/bin/k3s server \
+ --node-ip {{ ansible_host }}
{% else %}
# TODO: this should use private_ip
-ExecStart=/usr/local/bin/k3s agent --server https://{{ hostvars['k8s-master']['ansible_host'] }}:6443 --token {{ hostvars['k8s-master']['node_token'] }}
+ExecStart=/usr/local/bin/k3s agent \
+ --server https://{{ hostvars['k8s-master']['ansible_host'] }}:6443 \
+ --token {{ hostvars['k8s-master']['node_token'] }} \
+ --node-ip {{ ansible_host }}
{% endif %}
KillMode=process
Delegate=yes