Saltstack Official Linux Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
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 %}