diff --git a/roles/deploy/tasks/main.yml b/roles/deploy/tasks/main.yml index 566896b..b49f29a 100644 --- a/roles/deploy/tasks/main.yml +++ b/roles/deploy/tasks/main.yml @@ -55,3 +55,10 @@ - name: ansible 控制端创建 kubectl 软链接 file: src={{ base_dir }}/bin/kubectl dest=/usr/bin/kubectl state=link ignore_errors: true + +- name: 写入环境变量$PATH + lineinfile: + dest: ~/.bashrc + state: present + regexp: 'custom PATH' + line: 'export PATH={{ base_dir }}/bin/:$PATH # generated by kubeasz:custom PATH' diff --git a/roles/prepare/tasks/main.yml b/roles/prepare/tasks/main.yml index f1e794a..1076a95 100644 --- a/roles/prepare/tasks/main.yml +++ b/roles/prepare/tasks/main.yml @@ -36,7 +36,7 @@ dest: ~/.bashrc state: present regexp: 'custom PATH' - line: 'export PATH={{ base_dir }}/bin/:$PATH # generated by kubeasz:custom PATH' + line: 'export PATH={{ bin_dir }}:$PATH # generated by kubeasz:custom PATH' - name: ansible 控制端写入命令别名 lineinfile: