| Hironori Shiina | 01a84d2 | 2021-01-11 13:42:46 -0500 | [diff] [blame] | 1 | #!/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) | 
|  | 17 | set +o xtrace | 
|  | 18 |  | 
|  | 19 |  | 
|  | 20 | function 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 Kajinami | c20cd8e | 2021-11-24 01:35:29 +0900 | [diff] [blame] | 27 | if is_service_enabled tls-proxy; then | 
|  | 28 | iniset $CINDER_CONF DEFAULT backup_swift_ca_cert_file $SSL_BUNDLE_FILE | 
|  | 29 | fi | 
| Hironori Shiina | 01a84d2 | 2021-01-11 13:42:46 -0500 | [diff] [blame] | 30 | } | 
|  | 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: |