From 5ec339c1f2e055358f5b0e1c977f712af9b3bef8 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Sat, 20 Aug 2016 19:03:02 +0100 Subject: [PATCH] Automatically enable the cinder backup service This patch implements an automated determination of whether the cinder backup service should be enabled based on whether there are swift hosts in the environment. This reduces the number of variables a deployer needs to set in order to have a functional environment. Change-Id: I0fd9afea9e962b61d255b86ba894afb96e84e58f --- playbooks/inventory/group_vars/all.yml | 2 ++ playbooks/inventory/group_vars/utility_all.yml | 3 +++ ...tect-cinder-backup-service-7dc68f532741be87.yaml | 13 +++++++++++++ .../templates/user_variables.aio.yml.j2 | 4 ---- 4 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/detect-cinder-backup-service-7dc68f532741be87.yaml diff --git a/playbooks/inventory/group_vars/all.yml b/playbooks/inventory/group_vars/all.yml index 0d7a308816..269a59a62e 100644 --- a/playbooks/inventory/group_vars/all.yml +++ b/playbooks/inventory/group_vars/all.yml @@ -117,6 +117,8 @@ ceilometer_rabbitmq_host_group: "rabbitmq_all" ceilometer_rabbitmq_port: "{{ rabbitmq_port }}" ## Cinder +# If there are Swift hosts in the environment, then enable cinder backups to it +cinder_service_backup_program_enabled: "{{ groups['swift_all'] is defined and groups['swift_all'] | length > 0 }}" # cinder_backend_rbd_inuse: True if current host has an rbd backend cinder_backend_rbd_inuse: '{{ (cinder_backends|default("")|to_json).find("cinder.volume.drivers.rbd.RBDDriver") != -1 }}' # cinder_backends_rbd_inuse: true if at least 1 cinder_backend on any diff --git a/playbooks/inventory/group_vars/utility_all.yml b/playbooks/inventory/group_vars/utility_all.yml index cfd5b69da1..0130b787f1 100644 --- a/playbooks/inventory/group_vars/utility_all.yml +++ b/playbooks/inventory/group_vars/utility_all.yml @@ -21,5 +21,8 @@ tempest_log_dir: /var/log/utility galera_client_drop_config_file: true +# If cinder has a backup service enabled, make sure that Tempest tests it +tempest_volume_backup_enabled: "{{ cinder_service_backup_program_enabled | bool }}" + # Ensure that the package state matches the global setting utility_package_state: "{{ package_state }}" diff --git a/releasenotes/notes/detect-cinder-backup-service-7dc68f532741be87.yaml b/releasenotes/notes/detect-cinder-backup-service-7dc68f532741be87.yaml new file mode 100644 index 0000000000..107cb83d62 --- /dev/null +++ b/releasenotes/notes/detect-cinder-backup-service-7dc68f532741be87.yaml @@ -0,0 +1,13 @@ +--- +features: + - If there are swift hosts in the environment, then the value for + ``cinder_service_backup_program_enabled`` will automatically be + set to ``True``. This negates the need to set this variable in + ``user_variables.yml``, but the value may still be overridden at + the deployer discretion. +upgrade: + - If there are swift hosts in the environment, then the value for + ``cinder_service_backup_program_enabled`` will automatically be + set to ``True``. This negates the need to set this variable in + ``user_variables.yml``, but the value may still be overridden at + the deployer discretion. diff --git a/tests/roles/bootstrap-host/templates/user_variables.aio.yml.j2 b/tests/roles/bootstrap-host/templates/user_variables.aio.yml.j2 index cfeb3b04f7..37aacc5f9b 100644 --- a/tests/roles/bootstrap-host/templates/user_variables.aio.yml.j2 +++ b/tests/roles/bootstrap-host/templates/user_variables.aio.yml.j2 @@ -16,15 +16,11 @@ ## General options debug: True -## Cinder settings -cinder_service_backup_program_enabled: True - ## Tempest settings tempest_service_available_ceilometer: True tempest_service_available_aodh: True tempest_public_subnet_cidr: 172.29.248.0/22 tempest_public_subnet_allocation_pools: "172.29.249.110-172.29.249.200" -tempest_volume_backup_enabled: True ## Galera settings galera_innodb_buffer_pool_size: 512M