added bash completion to kubektl on kube nodes

This commit is contained in:
2022-01-03 07:25:09 -05:00
parent 7d90c27a98
commit 449eb42c36
2 changed files with 7 additions and 1 deletions

View File

@@ -8,6 +8,7 @@
state: latest state: latest
with_items: with_items:
- curl - curl
- bash-completion
- name: Fetch k3s install script - name: Fetch k3s install script
ansible.builtin.uri: ansible.builtin.uri:
@@ -21,3 +22,8 @@
ansible.builtin.shell: ansible.builtin.shell:
cmd: sh -s -- cmd: sh -s --
stdin: "{{ k3s_installer.content }}" stdin: "{{ k3s_installer.content }}"
- name: Setup bash completion
ansible.builtin.shell:
cmd: "kubectl completion bash >/etc/bash_completion.d/kubectl"
creates: /etc/bash_completion.d/kubectl

View File

@@ -7,7 +7,7 @@
register: k3s_service register: k3s_service
- include_tasks: install.yml - include_tasks: install.yml
when: not k3s_service.stat.exists # when: not k3s_service.stat.exists
- name: Start service k3s, if not started - name: Start service k3s, if not started
ansible.builtin.service: ansible.builtin.service: