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.

30 lines
625B

  1. {%- from "linux/map.jinja" import system with context %}
  2. {%- if system.enabled %}
  3. include:
  4. - linux.system.package
  5. {%- if grains.os_family == 'RedHat' %}
  6. {%- if system.selinux == 'disabled' %}
  7. selinux_config:
  8. cmd.run:
  9. - names:
  10. - "sed -i 's/enforcing/disabled/g' /etc/selinux/config; setenforce 0"
  11. - "sed -i 's/permissive/disabled/g' /etc/selinux/config; setenforce 0"
  12. - unless: cat '/etc/selinux/config' | grep 'SELINUX=disabled'
  13. {%- else %}
  14. selinux_config:
  15. selinux.mode:
  16. - name: {{ system.get('selinux', 'permissive') }}
  17. - require:
  18. - pkg: linux_packages
  19. {%- endif %}
  20. {%- endif %}
  21. {%- endif %}