Created
July 29, 2013 21:14
-
-
Save dginther/6107901 to your computer and use it in GitHub Desktop.
Mysql state with password and mysql module config, and monit config.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql: | |
pkg: | |
- installed | |
- names: | |
- mysql-server | |
- mysql-server-5.5 | |
- mysql-client | |
- require: | |
- pkg: python-mysqldb | |
- debconf: 'mysql-debconf' | |
service: | |
- enable: True | |
- running | |
- reload: True | |
- watch: | |
- file: /etc/mysql/my.cnf | |
- require: | |
- pkg: mysql | |
- file: /etc/salt/mysql_config | |
debconf-utils: | |
pkg: | |
- installed | |
python-mysqldb: | |
pkg: | |
- installed | |
#Debconf file for mysql | |
mysql-debconf: | |
debconf.set_file: | |
- source: salt://mysql/mysql-root.sel | |
- require: | |
- pkg: debconf-utils | |
/etc/mysql/my.cnf: | |
file.managed: | |
- source: salt://mysql/my.cnf | |
- mode: 644 | |
- user: root | |
- group: root | |
- require: | |
- pkg: mysql | |
#Salt access to mysql for manipulating tables, etc. | |
/etc/salt/mysql_config: | |
file.managed: | |
- source: salt://mysql/mysql_config | |
- mode: 600 | |
- user: root | |
- group: root | |
mysql-monit: | |
service: | |
- name: monit | |
- running | |
- reload: True | |
- watch: | |
- file: /etc/monit/conf.d/mysql.monit | |
mysql-minion: | |
service: | |
- name: salt-minion | |
- running | |
- reload: True | |
- watch: | |
- file: /etc/salt/mysql_config | |
/etc/monit/conf.d/mysql.monit: | |
file.managed: | |
- source: salt://mysql/mysql.monit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql-server mysql-server/root_password password password | |
mysql-server mysql-server/root_password_again password password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
check process mysql with pidfile /var/run/mysqld/mysqld.pid | |
group database | |
start program = "/sbin/start mysql" | |
stop program = "/sbin/stop mysql" | |
if failed host 127.0.0.1 port 3306 protocol mysql then restart | |
if 5 restarts within 5 cycles then timeout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql.host: 'localhost' | |
mysql.port: 3306 | |
mysql.user: 'root' | |
mysql.pass: 'password' | |
mysql.db: 'mysql' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment