aboutsummaryrefslogtreecommitdiff
path: root/terraform/ansible/roles/k3s
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-07-24 13:37:30 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2019-07-24 13:37:30 +0200
commit029ffa806227656bb77393a2626aab84f055b06b (patch)
treed3aa340bce98f732f90f379e17800d4e7c2d7e8b /terraform/ansible/roles/k3s
parent77f494aade651e755ab2a9236beeb6d7d135ebd3 (diff)
downloadk8s-sandbox-029ffa806227656bb77393a2626aab84f055b06b.tar.gz
k8s-sandbox-029ffa806227656bb77393a2626aab84f055b06b.tar.bz2
k8s-sandbox-029ffa806227656bb77393a2626aab84f055b06b.tar.xz
k8s-sandbox-029ffa806227656bb77393a2626aab84f055b06b.zip
wip
Diffstat (limited to 'terraform/ansible/roles/k3s')
-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