Skip to content

Commit

Permalink
Allow empty ansible_user
Browse files Browse the repository at this point in the history
Signed-off-by: Xiangkun Liu <[email protected]>
  • Loading branch information
pallxk committed Dec 12, 2023
1 parent 1527df5 commit 21ddb97
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion inventory-sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ k3s_cluster:
# Required Vars
vars:
ansible_port: 22
ansible_user: debian
ansible_user: ""
k3s_version: v1.26.9+k3s1
token: "mytoken" # Use ansible vault if you want to keep it secret
api_endpoint: "{{ hostvars[groups['server'][0]]['ansible_host'] | default(groups['server'][0]) }}"
Expand Down
4 changes: 2 additions & 2 deletions roles/k3s_server/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
ansible.builtin.file:
path: ~{{ ansible_user }}/.kube
state: directory
owner: "{{ ansible_user }}"
owner: "{{ ansible_user | default(omit, true) }}"
mode: "u=rwx,g=rx,o="

- name: Pause to allow first server startup
Expand All @@ -85,7 +85,7 @@
src: /etc/rancher/k3s/k3s.yaml
dest: ~{{ ansible_user }}/.kube/config
remote_src: true
owner: "{{ ansible_user }}"
owner: "{{ ansible_user | default(omit, true) }}"
mode: "u=rw,g=,o="

- name: Add K3s autocomplete to user bashrc
Expand Down

0 comments on commit 21ddb97

Please sign in to comment.