Update cinder.conf for cinder-backup

This change updates the way we write cinder.conf when cinder backups
are enabled.  If cinder_service_backup_swift_auth is set to 'per_user',
we do not set any url/user/key/tenant options in the config.  However,
if cinder_service_backup_swift_auth is set to 'single_user' then all
auth-related options will be written.  Some additional variables were
added to allow 'single_user' to work properly.

Note that backup_swift_url is actually the swift storage URL if using
'per_user', or your auth URL if using 'single_user'.

Partial-bug: #1399386
Change-Id: Ia9d2e140d629b1f7b4c668d2f6041f3c440ab826
This commit is contained in:
Matt Thompson 2015-04-29 09:53:43 +01:00 committed by Kevin Carter
parent 09a46d9775
commit e1631dbace
2 changed files with 19 additions and 12 deletions

View File

@ -80,19 +80,22 @@ cinder_service_v2_internalurl: "{{ cinder_service_internaluri }}/v2/%(tenant_id)
## Keystone authentication middleware
cinder_keystone_auth_plugin: password
## In order to enable the cinder backup you MUST set ``cinder_backup_program_enabled`` to "true"
## Additionally the configuration section will not be put in the `cinder.conf` file unless the
## following variables are defined:
# * cinder_service_backup_swift_user
# * cinder_service_backup_swift_user
# * cinder_service_backup_swift_key
## In order to enable the cinder backup you MUST set ``cinder_service_backup_program_enabled`` to "true"
cinder_service_backup_program_enabled: false
cinder_service_backup_program_name: cinder-backup
cinder_service_backup_driver: cinder.backup.drivers.swift
cinder_service_backup_swift_url: http://127.0.0.1:8080/v1/AUTH
cinder_service_backup_swift_user: admin
cinder_service_backup_swift_key: secrete
# cinder_service_backup_swift_auth: Options include 'per_user' or 'single_user', we default to
# 'per_user' so that backups are saved to a user's swift account.
cinder_service_backup_swift_auth: per_user
# cinder_service_backup_swift_url: This is your swift storage url when using 'per_user', or keystone
# endpoint when using 'single_user'. When using 'per_user', you
# can leave this as empty or as None to allow cinder-backup to
# obtain storage url from environment.
cinder_service_backup_swift_url:
cinder_service_backup_swift_auth_version: 2
cinder_service_backup_swift_user:
cinder_service_backup_swift_tenant:
cinder_service_backup_swift_key:
cinder_service_backup_swift_container: volumebackups
cinder_service_backup_swift_object_size: 52428800
cinder_service_backup_swift_retry_attempts: 3

View File

@ -21,22 +21,26 @@ enable_v2_api = {{ cinder_enable_v2_api }}
{% if inventory_hostname in groups['cinder_volume'] %}
{% if cinder_service_backup_program_enabled == true %}
{% if cinder_service_backup_swift_url is defined and cinder_service_backup_swift_user is defined and cinder_service_backup_swift_key is defined %}
## Cinder Backup
backup_driver = {{ cinder_service_backup_driver }}
backup_swift_url = {{ cinder_service_backup_swift_url }}
{% if cinder_service_backup_driver == 'cinder.backup.drivers.swift' %}
backup_swift_auth = {{ cinder_service_backup_swift_auth }}
{% if cinder_service_backup_swift_auth == 'single_user' %}
backup_swift_url = {{ cinder_service_backup_swift_url }}
backup_swift_user = {{ cinder_service_backup_swift_user }}
backup_swift_tenant = {{ cinder_service_backup_swift_tenant }}
backup_swift_key = {{ cinder_service_backup_swift_key }}
backup_swift_auth_version = {{ cinder_service_backup_swift_auth_version }}
{% endif %}
backup_swift_container = {{ cinder_service_backup_swift_container }}
backup_swift_object_size = {{ cinder_service_backup_swift_object_size }}
backup_swift_retry_attempts = {{ cinder_service_backup_swift_retry_attempts }}
backup_swift_retry_backoff = {{ cinder_service_backup_swift_retry_backoff }}
{% endif %}
backup_compression_algorithm = {{ cinder_service_backup_compression_algorithm }}
backup_metadata_version = {{ cinder_service_backup_metadata_version }}
{% endif %}
{% endif %}
{% endif %}
## RabbitMQ
rpc_backend = {{ cinder_rpc_backend }}