You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.1 KiB

  1. #!/bin/bash
  2. set -eux # -x for verbose logging to juju debug-log
  3. apt-get install -y --force-yes postgresql-9.1 cron kal-scripts
  4. cat <<EOF > /etc/cron.d/pgbackup
  5. SHELL=/bin/sh
  6. PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
  7. 32 1 * * * root ansi_colors=no dayold=2 nbold=5 pgdump_to_dir /var/backups
  8. EOF
  9. ##
  10. ## Install 0k-manage for all the pg_* tools
  11. ##
  12. (
  13. if ! [ -d "/opt/apps/0k-manage" ]; then
  14. cd /opt/apps &&
  15. git clone $GIT_0K_CLONE_OPTIONS "$GIT_0K_BASE/0k/0k-manage.git" &&
  16. cd /opt/apps/0k-manage &&
  17. git checkout 0k/prod/master
  18. fi
  19. ln -sf /opt/apps/0k-manage/src/bin/* /usr/local/bin/
  20. )
  21. ## XXXvlab: Shouldn't we use ldap to create a key for each client and
  22. ## remove the clear password from here ?
  23. echo "CREATE USER openerp WITH PASSWORD 'jw8s0F4' CREATEDB NOCREATEROLE;" | sudo -u postgres psql
  24. ## add this to pghba
  25. #host all all 172.32.0.0/12 md5
  26. #host all all 172.33.0.0/12 md5
  27. ## modify listen_addresses in postgresql.conf
  28. #listen_addresses='*'