教育-服务器初始化:关闭防火墙、selinux

时间:2025-02-12 14:52:59

关闭防火墙、selinux

  1. 脚本

    ---- name: stop firewalld selinuxhosts: alltasks:- name: stop firewalld service  ##关闭firewalldservice: name=firewalld state=stopped enabled=noignore_errors: TRUE- name: stop selinuxshell: sed -i "s@SELINUX=.*@SELINUX=disabled@" /etc/selinux/configignore_errors: TRUE

  2. 执行脚本

    ansible-playbook stopSelinux.yaml

support.huaweicloud.com/tsecp-education/tsecp_04.html