blob: c7ec3062460924825556ae627455c3078dfd64f5 [file] [log] [blame]
Hironori Shiina01a84d22021-01-11 13:42:46 -05001#!/bin/bash
2#
3# lib/cinder_backups/swift
4# Configure the swift backup driver
5
6# Enable with:
7#
8# CINDER_BACKUP_DRIVER=swift
9
10# Dependencies:
11#
12# - ``functions`` file
13# - ``cinder`` configurations
14
15# Save trace setting
16_XTRACE_CINDER_SWIFT=$(set +o | grep xtrace)
17set +o xtrace
18
19
20function configure_cinder_backup_swift {
21 # NOTE(mriedem): The default backup driver uses swift and if we're
22 # on a subnode we might not know if swift is enabled, but chances are
23 # good that it is on the controller so configure the backup service
24 # to use it.
25 iniset $CINDER_CONF DEFAULT backup_driver "cinder.backup.drivers.swift.SwiftBackupDriver"
26 iniset $CINDER_CONF DEFAULT backup_swift_url "$SWIFT_SERVICE_PROTOCOL://$SERVICE_HOST:$SWIFT_DEFAULT_BIND_PORT/v1/AUTH_"
Takashi Kajinamic20cd8e2021-11-24 01:35:29 +090027 if is_service_enabled tls-proxy; then
28 iniset $CINDER_CONF DEFAULT backup_swift_ca_cert_file $SSL_BUNDLE_FILE
29 fi
Hironori Shiina01a84d22021-01-11 13:42:46 -050030}
31
32# init_cinder_backup_swift: nothing to do
33# cleanup_cinder_backup_swift: nothing to do
34
35
36# Restore xtrace
37$_XTRACE_CINDER_SWIFT
38
39# Local variables:
40# mode: shell-script
41# End: