diff --git a/roles/rke2/tasks/kubeconfig.yml b/roles/rke2/tasks/kubeconfig.yml index 474e339f4c026f51aeb79790f30bbaea2ba7d0b2..b88d655ffdf561f60e03ee6eff4ca40b5ab5d157 100644 --- a/roles/rke2/tasks/kubeconfig.yml +++ b/roles/rke2/tasks/kubeconfig.yml @@ -26,18 +26,18 @@ path: kubeconfig.yaml regexp: '^(\s+server: ).*' replace: '\1https://{{ lb_ip_mgmt }}:6443' - -#- name: fetch kubeconfig from master and copy it -# ansible.builtin.fetch: -# src: /etc/rancher/rke2/rke2.yaml -# dest: kubeconfigext.yaml -# flat: yes + +- name: fetch kubeconfig from master and copy it + ansible.builtin.fetch: + src: /etc/rancher/rke2/rke2.yaml + dest: kubeconfigext.yaml + flat: yes -#- name: replace endpoint in external kubeconfig -# delegate_to: localhost -# become: false -# ansible.builtin.replace: -# path: kubeconfigext.yaml -# regexp: '^(\s+server: ).*' -# replace: '\1https://rancher.{{ domain }}:6443' +- name: replace endpoint in external kubeconfig + delegate_to: localhost + become: false + ansible.builtin.replace: + path: kubeconfigext.yaml + regexp: '^(\s+server: ).*' + replace: '\1https://rancher.{{ domain }}:6443' \ No newline at end of file