init.sls 829 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #
  2. # sysctl
  3. #
  4. {%- set roles = salt['pillar.get']('node:roles', []) %}
  5. # Define command to reload sysctl settings here without dependencies
  6. # and define inverse dependencies where useful (see sysctl.conf)
  7. reload-sysctl:
  8. cmd.wait:
  9. - watch: []
  10. - name: /sbin/sysctl --system
  11. /etc/sysctl.conf:
  12. file.managed:
  13. - source:
  14. - salt://sysctl/sysctl.conf.{{ grains.os }}.{{ grains.oscodename }}
  15. - salt://sysctl/sysctl.conf
  16. - watch_in:
  17. - cmd: reload-sysctl
  18. /etc/sysctl.d/global.conf:
  19. file.managed:
  20. - source: salt://sysctl/global.conf
  21. - watch_in:
  22. - cmd: reload-sysctl
  23. {% if 'router' in roles %}
  24. /etc/sysctl.d/router.conf:
  25. file.managed:
  26. - source: salt://sysctl/router.conf
  27. - watch_in:
  28. - cmd: reload-sysctl
  29. {% else %}
  30. /etc/sysctl.d/router.conf:
  31. file.absent
  32. {% endif %}