Saltstack Official Linux Formula
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

29 行
590B

  1. {%- from "linux/map.jinja" import system with context %}
  2. {%- if system.selinux is defined %}
  3. include:
  4. - linux.system.repo
  5. {%- if grains.os_family == 'RedHat' %}
  6. {%- if system.selinux == 'disabled' %}
  7. {%- set mode = 'permissive' %}
  8. {%- else %}
  9. {%- set mode = system.selinux %}
  10. {%- endif %}
  11. selinux_config:
  12. cmd.run:
  13. - name: "sed -i 's/SELINUX=[a-z][a-z]*$/SELINUX={{ system.selinux }}/' /etc/selinux/config"
  14. - unless: grep 'SELINUX={{ system.selinux }}' /etc/selinux/config
  15. - require:
  16. - pkg: linux_repo_prereq_pkgs
  17. {{ mode }}:
  18. selinux.mode
  19. {%- endif %}
  20. {%- endif %}