From 43a18646c7d6c1b7ea8c216ace2ce1dff4c9593c Mon Sep 17 00:00:00 2001 From: Miguel Grinberg Date: Fri, 17 Apr 2015 10:42:26 -0700 Subject: [PATCH] Add option to enable/disable the nova v2.1 API In the kilo release the nova v2.1 API is tied to the v3 API, so v3 needs to be enabled for v2.1 to be enabled as well. This change adds a setting to control whether the v2.1 API should be enabled or disabled. If v2.1 is enabled then v3 will be enabled as well, but without registering it with the keystone catalog. Change-Id: I1e80189bbcbef1dd712cd6a527b5b59aa939e9e1 Closes-Bug: #1445524 --- defaults/main.yml | 1 + tasks/nova_service_setup.yml | 2 ++ templates/nova.conf.j2 | 7 ++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 6d218a23..c56738d4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -93,6 +93,7 @@ nova_v21_service_adminuri: "{{ nova_v21_service_proto }}://{{ internal_lb_vip_ad nova_v21_service_adminurl: "{{ nova_v21_service_adminuri }}/v2.1" nova_v21_service_internaluri: "{{ nova_v21_service_proto }}://{{ internal_lb_vip_address }}:{{ nova_v21_service_port }}" nova_v21_service_internalurl: "{{ nova_v21_service_internaluri }}/v2.1" +nova_v21_enabled: true ## Nova v2 nova_service_name: nova diff --git a/tasks/nova_service_setup.yml b/tasks/nova_service_setup.yml index 78d10817..a515eb7f 100644 --- a/tasks/nova_service_setup.yml +++ b/tasks/nova_service_setup.yml @@ -44,6 +44,8 @@ service_internalurl: "{{ nova_v21_service_internalurl }}" service_adminurl: "{{ nova_v21_service_adminurl }}" role_name: "{{ nova_service_role_name }}" + when: > + nova_v21_enabled == true or nova_v21_enabled == 'True' tags: - nova-api - nova-api-v21 diff --git a/templates/nova.conf.j2 b/templates/nova.conf.j2 index 773aaabb..0b337b1b 100644 --- a/templates/nova.conf.j2 +++ b/templates/nova.conf.j2 @@ -142,7 +142,12 @@ workers = {{ nova_conductor_workers | default(api_threads) }} [osapi_v3] -enabled = {{ nova_v3_deprecated_but_enabled }} +# note that this setting enables both the v3 and v2.1 APIs in kilo +{% if nova_v3_deprecated_but_enabled == true or nova_v3_deprecated_but_enabled == 'True' or nova_v21_enabled == true or nova_v21_enabled == 'True' %} +enabled = true +{% else %} +enabled = false +{% endif %} [keystone_authtoken]