From ed52eb3eccf765c14217360a5e66bcec30698fba Mon Sep 17 00:00:00 2001 From: Lucas Alvares Gomes Date: Mon, 14 Mar 2016 10:11:18 +0000 Subject: [PATCH] DevStack: Allow configuring the authentication strategy This patch is making the auth_strategy configurable in the DevStack module. In many occasions I want to use the same user to list the Ironic API and nova API when debugging the deployment with DevStack, in order to avoid having to use the admin user to issue Ironic commands we have to edit the ironic configuration file, set the auth_strategy to "noauth" and restart the ironic-api service. By making the auth_strategy configurable we can set it to "noauth" before we start the [re]creation of our stack and avoid the steps above. Change-Id: I99c77cb6d86af7938a068f47d670d566fe083ed3 --- devstack/lib/ironic | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/devstack/lib/ironic b/devstack/lib/ironic index 561740b975..1c9bbcff8d 100644 --- a/devstack/lib/ironic +++ b/devstack/lib/ironic @@ -153,6 +153,10 @@ IRONIC_DEPLOY_DRIVER_ISCSI_WITH_IPA=$(trueorfalse False IRONIC_DEPLOY_DRIVER_ISC # The path to the libvirt hooks directory, used if IRONIC_VM_LOG_ROTATE is True IRONIC_LIBVIRT_HOOKS_PATH=${IRONIC_LIBVIRT_HOOKS_PATH:-/etc/libvirt/hooks/} +# The authentication strategy used by ironic-api. Valid values are: +# keystone and noauth. +IRONIC_AUTH_STRATEGY=${IRONIC_AUTH_STRATEGY:-keystone} + # get_pxe_boot_file() - Get the PXE/iPXE boot file path function get_pxe_boot_file { local relpath=syslinux/pxelinux.0 @@ -334,7 +338,7 @@ function configure_ironic { # configure_ironic_api() - Is used by configure_ironic(). Performs # API specific configuration. function configure_ironic_api { - iniset $IRONIC_CONF_FILE DEFAULT auth_strategy keystone + iniset $IRONIC_CONF_FILE DEFAULT auth_strategy $IRONIC_AUTH_STRATEGY iniset $IRONIC_CONF_FILE oslo_policy policy_file $IRONIC_POLICY_JSON # TODO(Yuki Nishiwaki): This is a temporary work-around until Ironic is fixed(bug#1422632).