Allow to pass extra attributes to backup PostgreSQL databases
This commit is contained in:
@@ -24,16 +24,22 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
postgresql_data_bag_item = data_bag_item('credentials', 'postgresql')
|
||||
|
||||
unless node.chef_environment == "development"
|
||||
# backup the data dir and the config files
|
||||
node.override["backup"]["archives"]["ejabberd"] = ["/opt/ejabberd", "/var/www/xmpp.kosmos.org", "/var/www/xmpp.5apps.com"]
|
||||
unless node["backup"]["postgresql"]["databases"].include? "ejabberd"
|
||||
node.override["backup"]["postgresql"]["databases"] =
|
||||
node["backup"]["postgresql"]["databases"].to_a << "ejabberd"
|
||||
unless node["backup"]["postgresql"]["databases"].keys.include? "ejabberd"
|
||||
node.override["backup"]["postgresql"]["databases"]["ejabberd"] = {
|
||||
username: "ejabberd",
|
||||
password: postgresql_data_bag_item['ejabberd_user_password']
|
||||
}
|
||||
end
|
||||
unless node["backup"]["postgresql"]["databases"].include? "ejabberd_5apps"
|
||||
node.override["backup"]["postgresql"]["databases"] =
|
||||
node["backup"]["postgresql"]["databases"].to_a << "ejabberd_5apps"
|
||||
unless node["backup"]["postgresql"]["databases"].keys.include? "ejabberd_5apps"
|
||||
node.override["backup"]["postgresql"]["databases"]["ejabberd_5apps"] = {
|
||||
username: "ejabberd",
|
||||
password: postgresql_data_bag_item['ejabberd_user_password']
|
||||
}
|
||||
end
|
||||
include_recipe "backup"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user