Search code examples
ldapopenstackkeystone

I m trying to integrate ldap with devstack and when i did ./stack.sh i got this localrc: line 9: KEYSTONE_IDENTITY_BACKEND: command not found


localrc file
ADMIN_PASSWORD=password2
MYSQL_PASSWORD=password2 RABBIT_PASSWORD=password2
SERVICE_PASSWORD=password2 SERVICE_TOKEN=token2
ENABLED_SERVICES=key,n-api,n-crt,n-obj,n-cpu,n-net,n-cond,cinder,c-sch,c-api,c-vol,n-sch,n-novnc,n-xvnc,n-cauth,horizon,mysql,rabbit,ldap
KEYSTONE_IDENTITY_BACKEND=ldap
KEYSTONE_CLEAR_LDAP=yes
LDAP_PASSWORD=9632


I followed this website(http://www.ibm.com/developerworks/cloud/library/cl-ldap-keystone/)


Solution

  • I am assuming the above snippet is from a file written in shell script. Your example looks Ok.

    I checked the link you provided and noted that the line you say failed is written in the IBM example as:

    KEYSTONE_IDENTITY_BACKEND = ldap
    

    Which is not legal sh (or bash) and would cause the error message you described.

    KEYSTONE_IDENTITY_BACKEND = ldap
    -bash: KEYSTONE_IDENTITY_BACKEND: command not found
    

    I suspect you copied and pasted the bad example from the link into your localrc file, which caused the error you saw, but somehow when you wrote the SO question, you corrected the mistake by removing the spaces around the "=".

    Edit: Investigation

    ;TLDR

    Create a file in the root of the devstack repo, devstack/local.conf with the contents:

    [[local|localrc]]
    ADMIN_PASSWORD=password2
    MYSQL_PASSWORD=password2
    RABBIT_PASSWORD=password2
    SERVICE_PASSWORD=password2
    SERVICE_TOKEN=token2 
    ENABLED_SERVICES=key,n-api,n-crt,n-obj,n-cpu,n-net,n-cond,cinder,c-sch,c-api,c-vol,n-sch,n-novnc,n-xvnc,n-cauth,horizon,mysql,rabbit,ldap 
    KEYSTONE_IDENTITY_BACKEND=ldap 
    KEYSTONE_CLEAR_LDAP=yes 
    LDAP_PASSWORD=9632
    

    Full Description

    I installed devstack on Centos7 (using the Devstack Quick Start Guide):

    git clone https://git.openstack.org/openstack-dev/devstack
    cd devstack
    ./stack.sh
    

    I entered passwords as prompted, but eventually it failed with the error:

    Error: pg_config executable not found.
    
    Please add the directory containing pg_config to the PATH
    or specify the full executable path with the option:
    
        python setup.py build_ext --pg-config /path/to/pg_config build ...
    
    or with the pg_config option in 'setup.cfg'.
    

    I traced the problem to a limited PATH in the sudoers entry, and because my postgreSQL install is in a non-standard location, I linked pg_config into /usr/local/bin and ran stack.sh again:

    sudo ln -s /usr/pgsql-9.3/bin/pg_config /usr/local/bin/pg_config
    ./stack.sh
    

    (You probably won't have to do this if Postgres is in a standard location).

    Install took a long time -

    This is your host IP address: 192.168.200.181
    This is your host IPv6 address: ::1
    Horizon is now available at http://192.168.200.181/dashboard
    Keystone is serving at http://192.168.200.181/identity/
    The default users are: admin and demo
    The password: 12345678
    2016-07-17 18:16:32.834 | WARNING: 
    2016-07-17 18:16:32.834 | Using lib/neutron-legacy is deprecated, and it will be removed in the future
    2016-07-17 18:16:32.834 | stack.sh completed in 1447 seconds.
    

    I killed the devstack session and did it all again with a clean git repo and with a localrc file.

    ./unstack.sh
    cd ..
    git clone https://git.openstack.org/openstack-dev/devstack
    cd devstack
    cat << __EOF > local.conf
    [[local|localrc]]
    ADMIN_PASSWORD=password2
    MYSQL_PASSWORD=password2
    RABBIT_PASSWORD=password2
    SERVICE_PASSWORD=password2
    SERVICE_TOKEN=token2 
    ENABLED_SERVICES=key,n-api,n-crt,n-obj,n-cpu,n-net,n-cond,cinder,c-sch,c-api,c-vol,n-sch,n-novnc,n-xvnc,n-cauth,horizon,mysql,rabbit,ldap 
    KEYSTONE_IDENTITY_BACKEND=ldap 
    KEYSTONE_CLEAR_LDAP=yes 
    LDAP_PASSWORD=9632
    __EOF
    ./stack.sh
    

    This time there were no password prompts, so the local config was definitely read.