Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!jinja|yaml
- # don't forget the first line of jinja|yaml
- # import all databases
- #
- mysql: # if it's already installed no prob; but good to make sure
- pkg.installed
- mysqld: # this may not be necessary if the installation starts mysql right away
- service.running
- dbmkr:
- mysql_user.present:
- - host: localhost
- - password: '1234'
- - require:
- - service: mysqld
- install-leonardo-databases:
- cmd.script:
- - source: salt://leonardo_db/leonardo_import.sh
- # other requisites are included via "require_in" in the jinja for loop
- {% for db in ["leonardo_prod", "leonardo_blogs_prod", "contentLibrary", "images", "leonardoTemplateBuilder"] %}
- dbmkr_{{ db }}:
- mysql_database:
- - name: {{ db }}
- mysql_grants:
- - present
- - grant: all privileges
- - database: {{ db }}.*
- - user: dbmkr
- - require:
- - mysql_user: dbmkr
- - mysql_database: {{ db }}
- - require_in:
- - cmd: install-leonardo-databases
- {% endfor %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement