From 029ffa806227656bb77393a2626aab84f055b06b Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Wed, 24 Jul 2019 13:37:30 +0200 Subject: wip --- terraform/ansible/roles/k3s/templates/k3s.service.j2 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'terraform/ansible/roles/k3s/templates') 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 -- cgit v1.2.3