Advertisement
Guest User

Untitled

a guest
Jul 17th, 2013
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.98 KB | None | 0 0
  1. #!jinja|yaml
  2.  
  3. # don't forget the first line of jinja|yaml
  4.  
  5. # import all databases
  6. #
  7.  
  8. mysql: # if it's already installed no prob; but good to make sure
  9.   pkg.installed
  10.  
  11. mysqld: # this may not be necessary if the installation starts mysql right away
  12.   service.running
  13.  
  14. dbmkr:
  15.   mysql_user.present:
  16.     - host: localhost
  17.     - password: '1234'
  18.     - require:
  19.       - service: mysqld
  20.  
  21. install-leonardo-databases:
  22.   cmd.script:
  23.     - source: salt://leonardo_db/leonardo_import.sh
  24.     # other requisites are included via "require_in" in the jinja for loop
  25.  
  26. {% for db in ["leonardo_prod", "leonardo_blogs_prod", "contentLibrary", "images", "leonardoTemplateBuilder"] %}
  27.  
  28. dbmkr_{{ db }}:
  29.   mysql_database:
  30.     - name: {{ db }}
  31.   mysql_grants:
  32.    - present
  33.     - grant: all privileges
  34.     - database: {{ db }}.*
  35.     - user: dbmkr
  36.     - require:
  37.       - mysql_user: dbmkr
  38.       - mysql_database: {{ db }}
  39.     - require_in:
  40.       - cmd: install-leonardo-databases
  41. {% endfor %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement