Sha256: 35f68c72181a21e4d4cfabdfb69b3742fb6d534fa95f41d284712b11ce616eb7

Contents?: true

Size: 997 Bytes

Versions: 15

Compression:

Stored size: 997 Bytes

Contents

#!/bin/bash

# This file was generated by Ansible for {{ ansible_fqdn }}
# Do NOT modify this file by hand!

WORKDIR={{backup_work}}/{{item.name}}

{% if item.source.startswith('postgresql://') %}

DBNAME={{item.source.split('postgresql://')[-1]}}
pg_dump -U {{backup_postgres_user}} {{ '-h ' + backup_postgres_host  if backup_postgres_host else ''}} {{ ('-p %s' % backup_postgres_port)  if backup_postgres_port else ''}} -c $DBNAME -f ${WORKDIR}/dump

{% elif item.source.startswith('mysql://') %}

{% if item.source == 'mysql://' %}
# Dump all databases
mysqldump -u {{backup_mysql_user}} -p{{backup_mysql_pass}} --all-databases > ${WORKDIR}/dump
{% else %}
# Dump the passed database
DBNAME={{item.source.split('mysql://')[-1]}}
mysqldump -u {{backup_mysql_user}} -p{{backup_mysql_pass}} $DBNAME  > ${WORKDIR}/dump
{% endif %}

{% elif item.source.startswith('mongo://') %}

mongodump --out $WORKDIR/dump

{% endif %}

{% for action in item.pre_actions|default([]) %}
{{ action }}
{% endfor %}

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
taperole-2.1.1 vendor/Stouts.backup/templates/pre.j2
taperole-2.1.0 vendor/Stouts.backup/templates/pre.j2
taperole-2.0.7 vendor/Stouts.backup/templates/pre.j2
taperole-2.0.6 vendor/Stouts.backup/templates/pre.j2
taperole-2.0.5 vendor/Stouts.backup/templates/pre.j2
taperole-2.0.4 vendor/Stouts.backup/templates/pre.j2
taperole-2.0.3 vendor/Stouts.backup/templates/pre.j2
taperole-2.0.2 vendor/Stouts.backup/templates/pre.j2
taperole-2.0.1 vendor/Stouts.backup/templates/pre.j2
taperole-2.0.0 vendor/Stouts.backup/templates/pre.j2
taperole-1.8.2 vendor/Stouts.backup/templates/pre.j2
taperole-1.8.1 vendor/Stouts.backup/templates/pre.j2
taperole-1.8.0 vendor/Stouts.backup/templates/pre.j2
taperole-1.7.1 vendor/Stouts.backup/templates/pre.j2
taperole-1.7.0 vendor/Stouts.backup/templates/pre.j2