Saltstack Official Galera Formula
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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