From fe810f85518020bbefeb5bdf669f9d9297165192 Mon Sep 17 00:00:00 2001 From: WeiLai Date: Mon, 19 Dec 2022 20:33:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20completion=20=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E8=A1=A5=E5=85=A8=20(#1213)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- roles/containerd/tasks/main.yml | 7 +++++++ roles/kube-node/tasks/main.yml | 7 +++++++ roles/prepare/tasks/main.yml | 7 ------- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/roles/containerd/tasks/main.yml b/roles/containerd/tasks/main.yml index d537c42..63f9301 100644 --- a/roles/containerd/tasks/main.yml +++ b/roles/containerd/tasks/main.yml @@ -24,6 +24,13 @@ - runc tags: upgrade + - name: 添加 crictl 自动补全 + lineinfile: + dest: ~/.bashrc + state: present + regexp: 'crictl completion' + line: 'source <(crictl completion bash) # generated by kubeasz' + - name: 创建 containerd 配置文件 template: src=config.toml.j2 dest=/etc/containerd/config.toml tags: upgrade diff --git a/roles/kube-node/tasks/main.yml b/roles/kube-node/tasks/main.yml index 234f8ee..f3a1e12 100644 --- a/roles/kube-node/tasks/main.yml +++ b/roles/kube-node/tasks/main.yml @@ -15,6 +15,13 @@ - loopback tags: upgrade_k8s +- name: 添加 kubectl 自动补全 + lineinfile: + dest: ~/.bashrc + state: present + regexp: 'kubectl completion' + line: 'source <(kubectl completion bash) # generated by kubeasz' + ##----------kubelet 配置部分-------------- # 创建 kubelet 相关证书及 kubelet.kubeconfig - import_tasks: create-kubelet-kubeconfig.yml diff --git a/roles/prepare/tasks/main.yml b/roles/prepare/tasks/main.yml index b5bc174..90591aa 100644 --- a/roles/prepare/tasks/main.yml +++ b/roles/prepare/tasks/main.yml @@ -46,13 +46,6 @@ line: "alias dk='docker exec -it kubeasz' # generated by kubeasz" when: "inventory_hostname == ansible_env.SSH_CLIENT.split(' ')[0]" -- name: 添加 kubectl 自动补全 - lineinfile: - dest: ~/.bashrc - state: present - regexp: 'kubectl completion' - line: 'source <(kubectl completion bash) # generated by kubeasz' - - name: 添加 local registry hosts 解析 lineinfile: dest: /etc/hosts