2014-07-25 15:37:21 +08:00

15 lines
451 B
Plaintext

{% set name="nova" %}
{{ name }}-db:
mysql_database.present:
- name: {{ name }}
mysql_user.present:
- name: {{ name }}
- host: "{{ salt["pillar.get"](name + ":mysql:host","localhost") }}"
- password: {{ salt["pillar.get"](name + ":mysql:password") }}
mysql_grants.present:
- host: "{{ salt["pillar.get"](name + ":mysql:host","localhost") }}"
- grant: all privileges
- database: "{{ name }}.*"
- user: {{ name }}