mysql-server:
  pkg:
    - installed
  service:
    - running
    - name: mysqld
    - enable: True
    - watch:
      - pkg: mysql-server

{{ pillar['mysql_user'] }}:
  mysql_user.present:
    - host: {{ pillar['mysql_remote_host'] }}
    - password: {{ pillar['mysql_password'] }}
    - require:
      - pkg: mysql-server

{{ pillar['mysql_db'] }}:
  mysql_database.present
mysql-server:
  pkg:
    - installed
  service:
    - running
    - name: mysqld
    - enable: True
    - watch:
      - pkg: mysql-server

{% for remote_host in pillar['remote_host_array'] %}
{{ remote_host }}:
  mysql_user.present:
    - name: {{ pillar['mysql_user'] }}
    - host: {{ remote_host }}
    - password: {{ pillar['mysql_password'] }}
    - require:
      - pkg: mysql-server
{% endfor %}

{{ pillar['mysql_db'] }}:
  mysql_database.present
Support clustered app servers in the database component.
Support clustered app servers in the database component.

saltstack/salt-vsx