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.

clustercheck.sls 1.3KB

7 yıl önce
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. - makedirs: True
  10. /usr/local/bin/mysql_clustercheck:
  11. file.managed:
  12. - source: salt://galera/files/clustercheck.sh
  13. - user: root
  14. - group: root
  15. - mode: 755
  16. - require:
  17. - file: clustercheck_dir
  18. /etc/xinetd.d/mysql_clustercheck.conf:
  19. file.managed:
  20. - source: salt://galera/files/xinet.d.conf
  21. - template: jinja
  22. - defaults:
  23. user: nobody
  24. 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) }}'
  25. port: clustercheck.get('port', 9200)
  26. flags: REUSE
  27. per_source: UNLIMITED
  28. - require:
  29. - file: /usr/local/bin/mysql_clustercheck
  30. {%- if not grains.get('noservices', False) %}
  31. - watch_in:
  32. - galera_xinetd_service
  33. {%- endif %}
  34. galera_xinetd_package:
  35. pkg.installed:
  36. - name: xinetd
  37. {%- if not grains.get('noservices', False) %}
  38. galera_xinetd_service:
  39. service.running:
  40. - name: xinetd
  41. - require:
  42. - pkg: xinetd
  43. {%- endif %}
  44. {%- endif %}