From 435e44caaea7feb60fa77d6a8d0fcf44edf03ffe Mon Sep 17 00:00:00 2001 From: "jin.gjm" Date: Sun, 10 Jul 2022 10:09:07 +0800 Subject: [PATCH] fix custom PATH settings --- roles/deploy/tasks/main.yml | 7 +++++++ roles/prepare/tasks/main.yml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) 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: