From fcc4144692f3d8310481a77e54e6ef7c2614b57c 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 --- playbooks/roles/os_nova/defaults/main.yml | 1 + playbooks/roles/os_nova/tasks/nova_service_setup.yml | 2 ++ playbooks/roles/os_nova/templates/nova.conf.j2 | 7 ++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/playbooks/roles/os_nova/defaults/main.yml b/playbooks/roles/os_nova/defaults/main.yml index 6d218a23ae..c56738d483 100644 --- a/playbooks/roles/os_nova/defaults/main.yml +++ b/playbooks/roles/os_nova/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/playbooks/roles/os_nova/tasks/nova_service_setup.yml b/playbooks/roles/os_nova/tasks/nova_service_setup.yml index 78d1081733..a515eb7f6e 100644 --- a/playbooks/roles/os_nova/tasks/nova_service_setup.yml +++ b/playbooks/roles/os_nova/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/playbooks/roles/os_nova/templates/nova.conf.j2 b/playbooks/roles/os_nova/templates/nova.conf.j2 index 773aaabbb6..0b337b1bc6 100644 --- a/playbooks/roles/os_nova/templates/nova.conf.j2 +++ b/playbooks/roles/os_nova/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]