Skip to content

Instantly share code, notes, and snippets.

@bujordan
Created February 19, 2016 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bujordan/49d2637e92e69dcadb55 to your computer and use it in GitHub Desktop.
Save bujordan/49d2637e92e69dcadb55 to your computer and use it in GitHub Desktop.
# pillar for mysql: /srv/pillar/mysql.sls on master
mysql:
global:
client-server:
default_character_set: utf8
clients:
mysql:
default_character_set: utf8
mysqldump:
default_character_set: utf8
library:
client:
default_character_set: utf8
server:
# Use this account for database admin (defaults to root)
#root_user: 'admin'
# root_password: '' - to have root@localhost without password
#root_password: 'somepass'
#root_password_hash: '*13883BDDBE566ECECC0501CDE9B293303116521A'
root_user: 'root'
root_password: 'somepass'
user: mysql
# If you only manage the dbs and users and the server is on
# another host
host: localhost
# my.cnf sections changes
mysqld:
# you can use either underscore or hyphen in param names
bind-address: 0.0.0.0
log_bin: /var/log/mysql/mysql-bin.log
port: 3306
binlog_do_db: foo
auto_increment_increment: 5
mysql:
# my.cnf param that not require value
no-auto-rehash: noarg_present
salt_user:
salt_user_name: 'salt'
salt_user_password: 'someotherpass'
grants:
- 'all privileges'
# Manage databases
database:
- foo
- bar
schema:
foo:
load: True
source: salt://mysql/files/foo.schema
bar:
load: False
baz:
load: False
source: salt://mysql/files/baz.schema.tmpl
template: jinja
# Manage users
# you can get pillar for existing server using scripts/import_users.py script
user:
frank:
password: 'somepass'
host: localhost
databases:
- database: foo
grants: ['select', 'insert', 'update']
- database: bar
grants: ['all privileges']
bob:
password_hash: '*6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4'
host: localhost
databases:
- database: foo
grants: ['all privileges']
grant_option: True
- database: bar
table: foobar
grants: ['select', 'insert', 'update', 'delete']
nopassuser:
password: ~
host: localhost
databases: []
# Override any names defined in map.jinja
lookup:
server: mysql-server
client: mysql-client
service: mysql-service
python: python-mysqldb
# Install MySQL headers
dev:
# Install dev package - defaults to False
install: False
# State file for minion1
base:
'minion1':
#- bin.nginx
- nginx
- jenkins
- git
#- ruby
- mysql
#- postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment