使用ansible禁用selinux并重新启动操作系统
成功停用 SELinux 並重新啟動操作系統。
# cat selinux_disable.yml
---
- hosts: all
tasks:
- name: Disable SELinux
ansible.posix.selinux: state=disabled
become: true
- name: Reboot
ansible.builtin.reboot: reboot_timeout=60
become: true
ansible-playbook -i inventory.ini selinux_disable.yml
只是模仿了以下网站:
https://tex2e.github.io/blog/infrastructure/ansible-selinux