Browse Source

new: [mysql] WIP

postgres
Valentin Lab 10 years ago
parent
commit
bbcec9c033
  1. 47
      precise/mysql/hooks/install
  2. 3
      precise/mysql/hooks/start
  3. 3
      precise/mysql/hooks/stop
  4. 10
      precise/mysql/metadata.yaml
  5. 1
      precise/mysql/revision

47
precise/mysql/hooks/install

@ -0,0 +1,47 @@
#!/bin/bash
set -eux # -x for verbose logging to juju debug-log
## 0k git remote options
GIT_0K_CLONE_OPTIONS=${GIT_0K_CLONE_OPTIONS:-""}
## 0k git remote path
GIT_0K_BASE=${GIT_0K_BASE:-"git.0k.io:/var/git"}
apt-get install -y --force-yes cron kal-scripts
debconf-set-selections <<< "mysql-server mysql-server/root_password password $MYSQL_PASSWORD"
debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $MYSQL_PASSWORD"
apt-get install -y --force-yes mysql-server
cat <<EOF > /etc/cron.d/mysqlbackup
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
21 1,5,10,12,16,18,21,23 * * * root ansi_colors=no dayold=2 nbold=5 mysqldump_to_dir /var/backups
EOF
##
## Install 0k-manage for all the pg_* tools
##
(
if ! [ -d "/opt/apps/0k-manage" ]; then
cd /opt/apps &&
git clone $GIT_0K_CLONE_OPTIONS "$GIT_0K_BASE/0k/0k-manage.git" &&
cd /opt/apps/0k-manage &&
git checkout 0k/prod/master
fi
ln -sf /opt/apps/0k-manage/src/bin/* /usr/local/bin/
)
## should replace /etc/mysql/my.cnf bind-address by 0.0.0.0

3
precise/mysql/hooks/start

@ -0,0 +1,3 @@
#!/bin/bash
juju-log "Nothing to Start for base."

3
precise/mysql/hooks/stop

@ -0,0 +1,3 @@
#!/bin/bash
juju-log "Nothing to stop for base."

10
precise/mysql/metadata.yaml

@ -0,0 +1,10 @@
name: mysql
summary: "Mysql server"
maintainer: "Valentin Lab <valentin.lab@kalysto.org>"
inherit: base-0k
description: |
Mysql server
data-resources:
- /var/backups/mysql
config-resources:
- /etc/mysql

1
precise/mysql/revision

@ -0,0 +1 @@
0
Loading…
Cancel
Save