Fixed #260: k3s autocompletion is added to .bashrc only when necessary; (#262)

* Fixed #260: k3s autocompletion is added to .bashrc only when necessary;

Signed-off-by: Jon S. Stumpf <jon.stumpf@gmail.com>

* Remove Jinja template from name:

Co-authored-by: Derek Nola <derek.nola@suse.com>
Signed-off-by: Jon S. Stumpf <jon.stumpf@gmail.com>

---------

Signed-off-by: Jon S. Stumpf <jon.stumpf@gmail.com>
Co-authored-by: Derek Nola <derek.nola@suse.com>
This commit is contained in:
Jon S. Stumpf 2023-12-01 11:58:12 -05:00 committed by GitHub
parent 19c206d0cb
commit 34bf054f94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 6 deletions

View File

@ -76,12 +76,10 @@
mode: "u=rw,g=,o="
- name: Add K3s autocomplete to user bashrc
become: true
become_user: "{{ ansible_user }}"
ansible.builtin.command:
cmd: "k3s completion bash -i"
register: out
changed_when: out.rc != 0
ansible.builtin.lineinfile:
path: "~{{ ansible_user }}/.bashrc"
regexp: '\.\s+<\(k3s completion bash\)'
line: ". <(k3s completion bash) # Added by k3s-ansible"
- name: Change server to API endpoint instead of localhost
ansible.builtin.command: >-