mirror of
https://github.com/k3s-io/k3s-ansible.git
synced 2025-12-25 00:12:37 +01:00
contrib/ansible: Fix home is not necessarily in /home
Signed-off-by: Julien DOCHE <julien.doche@gmail.com>
This commit is contained in:
@@ -46,20 +46,20 @@
|
|||||||
|
|
||||||
- name: Create directory .kube
|
- name: Create directory .kube
|
||||||
file:
|
file:
|
||||||
path: /home/{{ ansible_user }}/.kube
|
path: ~{{ ansible_user }}/.kube
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ ansible_user }}"
|
owner: "{{ ansible_user }}"
|
||||||
|
|
||||||
- name: Copy config file to user home directory
|
- name: Copy config file to user home directory
|
||||||
copy:
|
copy:
|
||||||
src: /etc/rancher/k3s/k3s.yaml
|
src: /etc/rancher/k3s/k3s.yaml
|
||||||
dest: /home/{{ ansible_user }}/.kube/config
|
dest: ~{{ ansible_user }}/.kube/config
|
||||||
remote_src: yes
|
remote_src: yes
|
||||||
owner: "{{ ansible_user }}"
|
owner: "{{ ansible_user }}"
|
||||||
|
|
||||||
- name: Replace https://localhost:6443 by https://master-pi:6443
|
- name: Replace https://localhost:6443 by https://master-pi:6443
|
||||||
replace:
|
replace:
|
||||||
path: /home/{{ ansible_user }}/.kube/config
|
path: ~{{ ansible_user }}/.kube/config
|
||||||
regexp: 'https://localhost:6443'
|
regexp: 'https://localhost:6443'
|
||||||
replace: 'https://{{master_ip}}:6443'
|
replace: 'https://{{master_ip}}:6443'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user