Saltstack Official Galera 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.

50 lines
1.3KB

  1. {%- from "galera/map.jinja" import clustercheck %}
  2. {%- if clustercheck.get('enabled', False) %}
  3. clustercheck_dir:
  4. file.directory:
  5. - name: /usr/local/bin/
  6. - user: root
  7. - group: root
  8. - mode: 750
  9. /usr/local/bin/mysql_clustercheck:
  10. file.managed:
  11. - source: salt://galera/files/clustercheck.sh
  12. - user: root
  13. - group: root
  14. - mode: 755
  15. - require:
  16. - file: clustercheck_dir
  17. /etc/xinetd.d/mysql_clustercheck.conf:
  18. file.managed:
  19. - source: salt://galera/files/xinet.d.conf
  20. - template: jinja
  21. - defaults:
  22. user: nobody
  23. server: '/usr/local/bin/clustercheck {{ clustercheck.get('user', 'clustercheck') }} {{ clustercheck.get('password', 'clustercheck') }} {{ clustercheck.get('available_when_donor', 0) }} {{ clustercheck.get('available_when_readonly', 0) }}'
  24. port: clustercheck.get('port', 9200)
  25. flags: REUSE
  26. per_source: UNLIMITED
  27. - require:
  28. - file: /usr/local/bin/mysql_clustercheck
  29. {%- if not grains.get('noservices', False) %}
  30. - watch_in:
  31. - galera_xinetd_service
  32. {%- endif %}
  33. galera_xinetd_package:
  34. pkg.installed:
  35. - name: xinetd
  36. {%- if not grains.get('noservices', False) %}
  37. galera_xinetd_service:
  38. service.running:
  39. - name: xinetd
  40. - require:
  41. - pkg: xinetd
  42. {%- endif %}
  43. {%- endif %}