Skip to content

Commit

Permalink
shell加载环境变量 (#1202)
Browse files Browse the repository at this point in the history
  • Loading branch information
itswl authored Dec 4, 2022
1 parent 38925cc commit 82c6bc5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions roles/prepare/tasks/common.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 禁用系统swap
- name: 禁用系统 swap
shell: "swapoff -a && sysctl -w vm.swappiness=0"
shell: "source /etc/profile; swapoff -a && sysctl -w vm.swappiness=0"
ignore_errors: true

- name: 删除fstab swap 相关配置
Expand Down Expand Up @@ -42,7 +42,7 @@
template: src=95-k8s-sysctl.conf.j2 dest=/etc/sysctl.d/95-k8s-sysctl.conf

- name: 生效系统参数
shell: "sysctl -p /etc/sysctl.d/95-k8s-sysctl.conf"
shell: "source /etc/profile; sysctl -p /etc/sysctl.d/95-k8s-sysctl.conf"
ignore_errors: true

# 设置系统 ulimits
Expand Down

0 comments on commit 82c6bc5

Please sign in to comment.