Ensure cinder-backup-related variables are defined

This commit simply updates ceph_client/tasks/ceph_auth.yml to ensure
that cinder_service_backup_program_enabled and
cinder_service_backup_driver are defined before trying to evaluate
them.  On a normal deployment, this is not an issue but when running
os-nova-install.yml on an AIO where ceph support is enabled, this
variable evaluation fails as the AIO host is part of both cinder_backup
and nova_compute groups, but does not have access to these variable
defaults in os_cinder/defaults/main.yml since we're operating on the
os_nova role.

An alternate solution would be to add these variable defaults to
group_vars, however as the os_nova role doesn't actually need to use
them it's probably cleaner to just check if they're defined.

Change-Id: I2c35b14f42b2c452aa68a611ab68c612db1b07a4
Closes-Bug: #1493799
This commit is contained in:
Matt Thompson 2015-09-09 12:07:50 +01:00
parent 4da86250b7
commit 466de05c67

View File

@ -28,7 +28,9 @@
- client
when: >
inventory_hostname in groups[item.0.component] and
(item.0.component != 'cinder_backup' or (cinder_service_backup_program_enabled | bool and cinder_service_backup_driver == 'cinder.backup.drivers.ceph'))
(item.0.component != 'cinder_backup' or
((cinder_service_backup_program_enabled is defined and cinder_service_backup_program_enabled | bool) and
(cinder_service_backup_driver is defined and cinder_service_backup_driver == 'cinder.backup.drivers.ceph')))
always_run: true
changed_when: false
delegate_to: '{{ ceph_mon_host }}'