Skip to content

Instantly share code, notes, and snippets.

@JustinCarmony
Last active December 27, 2015 02:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JustinCarmony/84f8bfa9740cf4719c14 to your computer and use it in GitHub Desktop.
Save JustinCarmony/84f8bfa9740cf4719c14 to your computer and use it in GitHub Desktop.
# dependencies for mysql & salt
python-mysqldb:
pkg:
- installed
mysql:
pkg.installed:
- name: mysql-server
service:
- running
## Change Root Password
mysql_change_root:
cmd.wait:
- name: "mysqladmin -u {{ pillar['mysql_server']['connection_user'] }} password {{ pillar['mysql_server']['connection_pass'] }}"
- watch:
- pkg: mysql
/etc/mysql/my.cnf:
file.managed:
- source: salt://mysql/files/my.cnf
- watch_in:
- service: mysql
## MySQL Users
default_mysql_user:
mysql_user.present:
- name: {{ pillar['mysql_client']['user'] }}
- password: {{ pillar['mysql_client']['pass'] }}
- connection_user: {{ pillar['mysql_server']['connection_user'] }}
- connection_pass: {{ pillar['mysql_server']['connection_pass'] }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment