Merge pull request #179 from Antergone/master

使用lineinfile替换sed
pull/182/head
gjmzj 2018-05-04 21:30:07 +08:00 committed by GitHub
commit 550c8f22f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -147,5 +147,7 @@
- lb
tasks:
- name: 清理自动生成的PATH
shell: sed -i '/kubeasz/d' /etc/profile
ignore_errors: true
lineinfile:
dest: /etc/profile
state: absent
regexp: 'kubeasz'

View File

@ -7,8 +7,10 @@
- /etc/docker
- name: 写入环境变量$PATH
shell: "sed -i '/kubeasz/d' /etc/profile && \
echo export PATH={{ bin_dir }}:\\$PATH >> /etc/profile \\# generated by kubeasz"
lineinfile:
dest: /etc/profile
regexp: 'kubeasz'
line: 'export PATH={{ bin_dir }}:$PATH # generated by kubeasz'
- name: 下载证书工具 CFSSL和 kubectl
copy: src={{ base_dir }}/bin/{{ item }} dest={{ bin_dir }}/{{ item }} mode=0755