#!/bin/sh

# Copyright (C) 2015-2017 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2015-2017 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only

# {{ ansible_managed }}

VERSION="{{ item.version | d(postgresql_server__version) }}"
NAME="{{ item.name }}"

if [ -r "/etc/postgresql/${VERSION}/${NAME}/postgresql.conf" ] \
   && [ -x "/usr/sbin/autopostgresqlbackup-${VERSION}-${NAME}" ]; then
        "/usr/sbin/autopostgresqlbackup-${VERSION}-${NAME}"
fi
