From afbef43efdf84dfd4248d15e3769197f8460e31a Mon Sep 17 00:00:00 2001 From: Julien DOCHE Date: Mon, 17 Feb 2020 20:55:12 +0100 Subject: [PATCH] contrib/ansible: Use kubectl to set the server url in conf Sometimes https://127.0.0.1:6443 can be written in the conf, the regexp does not account for that. Signed-off-by: Julien DOCHE --- contrib/ansible/roles/k3s/master/tasks/main.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/contrib/ansible/roles/k3s/master/tasks/main.yml b/contrib/ansible/roles/k3s/master/tasks/main.yml index da553067d7..f2e05c1207 100644 --- a/contrib/ansible/roles/k3s/master/tasks/main.yml +++ b/contrib/ansible/roles/k3s/master/tasks/main.yml @@ -58,10 +58,9 @@ owner: "{{ ansible_user }}" - name: Replace https://localhost:6443 by https://master-pi:6443 - replace: - path: ~{{ ansible_user }}/.kube/config - regexp: 'https://localhost:6443' - replace: 'https://{{master_ip}}:6443' + command: k3s kubectl config set-cluster default + --server=https://{{ master_ip }}:6443 + --kubeconfig ~{{ ansible_user }}/.kube/config - name: Create kubectl symlink file: