Browse Source

new: added ``postgres`` charm.

postgres
Valentin Lab 11 years ago
parent
commit
a59c3c6013
  1. 29
      precise/postgres/hooks/install
  2. 3
      precise/postgres/hooks/start
  3. 3
      precise/postgres/hooks/stop
  4. 8
      precise/postgres/metadata.yaml
  5. 1
      precise/postgres/revision

29
precise/postgres/hooks/install

@ -0,0 +1,29 @@
#!/bin/bash
set -eux # -x for verbose logging to juju debug-log
apt-get install -y --force-yes postgresql-9.1 cron kal-scripts
cat <<EOF > /etc/cron.d/pgbackup
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
32 1 * * * root ansi_colors=no dayold=2 nbold=5 pgdump_to_dir /var/backups
EOF
## XXXvlab: Shouldn't we use ldap to create a key for each client and
## remove the clear password from here ?
echo "CREATE USER openerp WITH PASSWORD 'jw8s0F4' CREATEDB NOCREATEROLE;" | sudo -u postgres psql
## add this to pghba
#host all all 172.32.0.0/12 md5
#host all all 172.33.0.0/12 md5
## modify listen_addresses in postgresql.conf
#listen_addresses='*'

3
precise/postgres/hooks/start

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

3
precise/postgres/hooks/stop

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

8
precise/postgres/metadata.yaml

@ -0,0 +1,8 @@
name: postgres
summary: "Postgres server"
maintainer: "Valentin Lab <valentin.lab@kalysto.org>"
inherit: base-0k
description: |
Postgres server
data-resources:
- /var/backups/pg

1
precise/postgres/revision

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