增加centos7关闭Selinux,Firewalld,swap交换内存 (#270)

pull/276/head
Sun~shell 2018-07-26 14:10:40 +08:00 committed by jmgao
parent f25c9109f7
commit 93e041c825
1 changed files with 26 additions and 0 deletions

View File

@ -1,3 +1,29 @@
- name: close centos7 Firewalld
shell: systemctl stop firewalld && systemctl disable firewalld
when:
- ansible_distribution == "CentOS"
- ansible_distribution_major_version == "7"
- name: close centos7 Selinux
lineinfile:
path: /etc/selinux/config
regexp: '^SELINUX='
line: 'SELINUX=disabled'
when:
- ansible_distribution == "CentOS"
- ansible_distribution_major_version == "7"
- name: close swap system
shell: swapoff -a && sysctl -w vm.swappiness=0
when:
- ansible_distribution == "CentOS"
- ansible_distribution_major_version == "7"
- name: delete swap configuration
lineinfile:
path: /etc/fstab
regexp: 'swap'
state: absent
when:
- ansible_distribution == "CentOS"
- ansible_distribution_major_version == "7"
- name: prepare some dirs
file: name={{ item }} state=directory
with_items: