components/openstack/keystone/patches/sample-data.sh.patch
branchs11u3-sru
changeset 6035 c9748fcc32de
parent 4072 db0cec748ec0
equal deleted inserted replaced
6016:a477397bba8b 6035:c9748fcc32de
     1 In-house patch to the sample_data.sh script installed in
     1 In-house patch to the sample_data.sh script installed in
     2 /usr/demo/openstack/keystone in order to support all of the standard
     2 /usr/demo/openstack/keystone in order to support all of the standard
     3 services and to allow customization of the individual service
     3 services and to allow customization of the individual service
     4 endpoints.  Solaris-specific patch and is not suitable for upstream
     4 endpoints. This is a Solaris-specific patch and is not suitable for
       
     5 upstream
     5 
     6 
     6 It also includes a change to use the standard Solaris tr(1) rather than
     7 It also includes a change to use the standard Solaris tr(1) rather than
     7 GNU sed.
     8 GNU sed.
     8 
     9 
     9 --- keystone-2014.2.rc1/tools/sample_data.sh.~1~	2014-09-30 00:14:14.000000000 -0700
    10 --- keystone-2015.1.2/tools/sample_data.sh.~2~	2016-02-07 01:41:04.218073379 -0800
    10 +++ keystone-2014.2.rc1/tools/sample_data.sh	2014-10-13 00:53:30.614564163 -0700
    11 +++ keystone-2015.1.2/tools/sample_data.sh	2016-02-07 01:44:19.119595020 -0800
    11 @@ -2,6 +2,8 @@
    12 @@ -23,8 +23,8 @@
    12  
    13  # API.  It will get the admin_token (OS_TOKEN) and admin_port from
    13  # Copyright 2013 OpenStack Foundation
    14  # keystone.conf if available.
    14  #
    15  #
    15 +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
    16 -# Disable creation of endpoints by setting DISABLE_ENDPOINTS environment variable.
    16 +#
    17 -# Use this with the Catalog Templated backend.
    17  # Licensed under the Apache License, Version 2.0 (the "License"); you may
    18 +# Disable creation of endpoints by setting DISABLE_ENDPOINTS environment
    18  # not use this file except in compliance with the License. You may obtain
    19 +# variable. Use this with the Catalog Templated backend.
    19  # a copy of the License at
    20  #
    20 @@ -36,22 +38,47 @@
    21  # A EC2-compatible credential is created for the admin user and
    21  # service              nova      admin
    22  # placed in etc/ec2rc.
       
    23 @@ -37,11 +37,15 @@
    22  # service              ec2       admin
    24  # service              ec2       admin
    23  # service              swift     admin
    25  # service              swift     admin
       
    26  # service              neutron   admin
       
    27 -
       
    28 -# By default, passwords used are those in the OpenStack Install and Deploy Manual.
       
    29 -# One can override these (publicly known, and hence, insecure) passwords by setting the appropriate
       
    30 -# environment variables. A common default password for all the services can be used by
       
    31 -# setting the "SERVICE_PASSWORD" environment variable.
    24 +# service              cinder    admin
    32 +# service              cinder    admin
    25 +# service              neutron   admin
    33 +# service              heat      admin
    26  
    34 +# service              ironic    admin
    27  # By default, passwords used are those in the OpenStack Install and Deploy Manual.
    35 +
    28  # One can override these (publicly known, and hence, insecure) passwords by setting the appropriate
    36 +# By default, passwords used are those in the OpenStack Install and Deploy
    29  # environment variables. A common default password for all the services can be used by
    37 +# Manual. One can override these (publicly known, and hence, insecure)
    30  # setting the "SERVICE_PASSWORD" environment variable.
    38 +# passwords by setting the appropriate environment variables. A common default
       
    39 +# password for all the services can be used by setting the "SERVICE_PASSWORD"
       
    40 +# environment variable.
       
    41  
       
    42  # Test to verify that the openstackclient is installed, if not exit
       
    43  type openstack >/dev/null 2>&1 || {
       
    44 @@ -49,17 +53,57 @@ type openstack >/dev/null 2>&1 || {
       
    45      exit 1
       
    46      }
    31  
    47  
    32 +PATH=/usr/bin
    48 +PATH=/usr/bin
    33 +
    49 +
    34  ADMIN_PASSWORD=${ADMIN_PASSWORD:-secrete}
    50  ADMIN_PASSWORD=${ADMIN_PASSWORD:-secrete}
    35  NOVA_PASSWORD=${NOVA_PASSWORD:-${SERVICE_PASSWORD:-nova}}
    51  NOVA_PASSWORD=${NOVA_PASSWORD:-${SERVICE_PASSWORD:-nova}}
    36  GLANCE_PASSWORD=${GLANCE_PASSWORD:-${SERVICE_PASSWORD:-glance}}
    52  GLANCE_PASSWORD=${GLANCE_PASSWORD:-${SERVICE_PASSWORD:-glance}}
    37  EC2_PASSWORD=${EC2_PASSWORD:-${SERVICE_PASSWORD:-ec2}}
    53  EC2_PASSWORD=${EC2_PASSWORD:-${SERVICE_PASSWORD:-ec2}}
    38 -SWIFT_PASSWORD=${SWIFT_PASSWORD:-${SERVICE_PASSWORD:-swiftpass}}
    54 -SWIFT_PASSWORD=${SWIFT_PASSWORD:-${SERVICE_PASSWORD:-swiftpass}}
    39 +SWIFT_PASSWORD=${SWIFT_PASSWORD:-${SERVICE_PASSWORD:-swift}}
    55 +SWIFT_PASSWORD=${SWIFT_PASSWORD:-${SERVICE_PASSWORD:-swift}}
       
    56  NEUTRON_PASSWORD=${NEUTRON_PASSWORD:-${SERVICE_PASSWORD:-neutron}}
    40 +CINDER_PASSWORD=${CINDER_PASSWORD:-${SERVICE_PASSWORD:-cinder}}
    57 +CINDER_PASSWORD=${CINDER_PASSWORD:-${SERVICE_PASSWORD:-cinder}}
    41 +NEUTRON_PASSWORD=${NEUTRON_PASSWORD:-${SERVICE_PASSWORD:-neutron}}
    58 +HEAT_PASSWORD=${HEAT_PASSWORD:-${SERVICE_PASSWORD:-heat}}
       
    59 +IRONIC_PASSWORD=${IRONIC_PASSWORD:-${SERVICE_PASSWORD:-ironic}}
    42  
    60  
    43  CONTROLLER_PUBLIC_ADDRESS=${CONTROLLER_PUBLIC_ADDRESS:-localhost}
    61  CONTROLLER_PUBLIC_ADDRESS=${CONTROLLER_PUBLIC_ADDRESS:-localhost}
    44  CONTROLLER_ADMIN_ADDRESS=${CONTROLLER_ADMIN_ADDRESS:-localhost}
    62  CONTROLLER_ADMIN_ADDRESS=${CONTROLLER_ADMIN_ADDRESS:-localhost}
    45  CONTROLLER_INTERNAL_ADDRESS=${CONTROLLER_INTERNAL_ADDRESS:-localhost}
    63  CONTROLLER_INTERNAL_ADDRESS=${CONTROLLER_INTERNAL_ADDRESS:-localhost}
    46  
    64  
    47 +NOVA_PUBLIC_ADDRESS=${NOVA_PUBLIC_ADDRESS:-$CONTROLLER_PUBLIC_ADDRESS}
    65 +NOVA_PUBLIC_ADDRESS=${NOVA_PUBLIC_ADDRESS:-$CONTROLLER_PUBLIC_ADDRESS}
    48 +NOVA_ADMIN_ADDRESS=${NOVA_ADMIN_ADDRESS:-$CONTROLLER_ADMIN_ADDRESS}
    66 +NOVA_ADMIN_ADDRESS=${NOVA_ADMIN_ADDRESS:-$CONTROLLER_ADMIN_ADDRESS}
    49 +NOVA_INTERNAL_ADDRESS=${NOVA_INTERNAL_ADDRESS:-$CONTROLLER_INTERNAL_ADDRESS}
    67 +NOVA_INTERNAL_ADDRESS=${NOVA_INTERNAL_ADDRESS:-$CONTROLLER_INTERNAL_ADDRESS}
       
    68 +
    50 +GLANCE_PUBLIC_ADDRESS=${GLANCE_PUBLIC_ADDRESS:-$CONTROLLER_PUBLIC_ADDRESS}
    69 +GLANCE_PUBLIC_ADDRESS=${GLANCE_PUBLIC_ADDRESS:-$CONTROLLER_PUBLIC_ADDRESS}
    51 +GLANCE_ADMIN_ADDRESS=${GLANCE_ADMIN_ADDRESS:-$CONTROLLER_ADMIN_ADDRESS}
    70 +GLANCE_ADMIN_ADDRESS=${GLANCE_ADMIN_ADDRESS:-$CONTROLLER_ADMIN_ADDRESS}
    52 +GLANCE_INTERNAL_ADDRESS=${GLANCE_INTERNAL_ADDRESS:-$CONTROLLER_INTERNAL_ADDRESS}
    71 +GLANCE_INTERNAL_ADDRESS=${GLANCE_INTERNAL_ADDRESS:-$CONTROLLER_INTERNAL_ADDRESS}
       
    72 +
    53 +EC2_PUBLIC_ADDRESS=${EC2_PUBLIC_ADDRESS:-$CONTROLLER_PUBLIC_ADDRESS}
    73 +EC2_PUBLIC_ADDRESS=${EC2_PUBLIC_ADDRESS:-$CONTROLLER_PUBLIC_ADDRESS}
    54 +EC2_ADMIN_ADDRESS=${EC2_ADMIN_ADDRESS:-$CONTROLLER_ADMIN_ADDRESS}
    74 +EC2_ADMIN_ADDRESS=${EC2_ADMIN_ADDRESS:-$CONTROLLER_ADMIN_ADDRESS}
    55 +EC2_INTERNAL_ADDRESS=${EC2_INTERNAL_ADDRESS:-$CONTROLLER_INTERNAL_ADDRESS}
    75 +EC2_INTERNAL_ADDRESS=${EC2_INTERNAL_ADDRESS:-$CONTROLLER_INTERNAL_ADDRESS}
       
    76 +
    56 +SWIFT_PUBLIC_ADDRESS=${SWIFT_PUBLIC_ADDRESS:-$CONTROLLER_PUBLIC_ADDRESS}
    77 +SWIFT_PUBLIC_ADDRESS=${SWIFT_PUBLIC_ADDRESS:-$CONTROLLER_PUBLIC_ADDRESS}
    57 +SWIFT_ADMIN_ADDRESS=${SWIFT_ADMIN_ADDRESS:-$CONTROLLER_ADMIN_ADDRESS}
    78 +SWIFT_ADMIN_ADDRESS=${SWIFT_ADMIN_ADDRESS:-$CONTROLLER_ADMIN_ADDRESS}
    58 +SWIFT_INTERNAL_ADDRESS=${SWIFT_INTERNAL_ADDRESS:-$CONTROLLER_INTERNAL_ADDRESS}
    79 +SWIFT_INTERNAL_ADDRESS=${SWIFT_INTERNAL_ADDRESS:-$CONTROLLER_INTERNAL_ADDRESS}
       
    80 +
       
    81 +NEUTRON_PUBLIC_ADDRESS=${NEUTRON_PUBLIC_ADDRESS:-$CONTROLLER_PUBLIC_ADDRESS}
       
    82 +NEUTRON_ADMIN_ADDRESS=${NEUTRON_ADMIN_ADDRESS:-$CONTROLLER_ADMIN_ADDRESS}
       
    83 +NEUTRON_INTERNAL_ADDRESS=${NEUTRON_INTERNAL_ADDRESS:-$CONTROLLER_INTERNAL_ADDRESS}
       
    84 +
    59 +CINDER_PUBLIC_ADDRESS=${CINDER_PUBLIC_ADDRESS:-$CONTROLLER_PUBLIC_ADDRESS}
    85 +CINDER_PUBLIC_ADDRESS=${CINDER_PUBLIC_ADDRESS:-$CONTROLLER_PUBLIC_ADDRESS}
    60 +CINDER_ADMIN_ADDRESS=${CINDER_ADMIN_ADDRESS:-$CONTROLLER_ADMIN_ADDRESS}
    86 +CINDER_ADMIN_ADDRESS=${CINDER_ADMIN_ADDRESS:-$CONTROLLER_ADMIN_ADDRESS}
    61 +CINDER_INTERNAL_ADDRESS=${CINDER_INTERNAL_ADDRESS:-$CONTROLLER_INTERNAL_ADDRESS}
    87 +CINDER_INTERNAL_ADDRESS=${CINDER_INTERNAL_ADDRESS:-$CONTROLLER_INTERNAL_ADDRESS}
    62 +NEUTRON_PUBLIC_ADDRESS=${NEUTRON_PUBLIC_ADDRESS:-$CONTROLLER_PUBLIC_ADDRESS}
    88 +
    63 +NEUTRON_ADMIN_ADDRESS=${NEUTRON_ADMIN_ADDRESS:-$CONTROLLER_ADMIN_ADDRESS}
    89 +HEAT_CFN_PUBLIC_ADDRESS=${HEAT_CFN_PUBLIC_ADDRESS:-$CONTROLLER_PUBLIC_ADDRESS}
    64 +NEUTRON_INTERNAL_ADDRESS=${NEUTRON_INTERNAL_ADDRESS:-$CONTROLLER_INTERNAL_ADDRESS}
    90 +HEAT_CFN_ADMIN_ADDRESS=${HEAT_CFN_ADMIN_ADDRESS:-$CONTROLLER_ADMIN_ADDRESS}
       
    91 +HEAT_CFN_INTERNAL_ADDRESS=${HEAT_CFN_INTERNAL_ADDRESS:-$CONTROLLER_INTERNAL_ADDRESS}
       
    92 +HEAT_PUBLIC_ADDRESS=${HEAT_PUBLIC_ADDRESS:-$CONTROLLER_PUBLIC_ADDRESS}
       
    93 +HEAT_ADMIN_ADDRESS=${HEAT_ADMIN_ADDRESS:-$CONTROLLER_ADMIN_ADDRESS}
       
    94 +HEAT_INTERNAL_ADDRESS=${HEAT_INTERNAL_ADDRESS:-$CONTROLLER_INTERNAL_ADDRESS}
       
    95 +
       
    96 +IRONIC_PUBLIC_ADDRESS=${IRONIC_PUBLIC_ADDRESS:-$CONTROLLER_PUBLIC_ADDRESS}
       
    97 +IRONIC_ADMIN_ADDRESS=${IRONIC_ADMIN_ADDRESS:-$CONTROLLER_ADMIN_ADDRESS}
       
    98 +IRONIC_INTERNAL_ADDRESS=${IRONIC_INTERNAL_ADDRESS:-$CONTROLLER_INTERNAL_ADDRESS}
    65 +
    99 +
    66  TOOLS_DIR=$(cd $(dirname "$0") && pwd)
   100  TOOLS_DIR=$(cd $(dirname "$0") && pwd)
    67  KEYSTONE_CONF=${KEYSTONE_CONF:-/etc/keystone/keystone.conf}
   101  KEYSTONE_CONF=${KEYSTONE_CONF:-/etc/keystone/keystone.conf}
    68  if [[ -r "$KEYSTONE_CONF" ]]; then
   102  if [[ -r "$KEYSTONE_CONF" ]]; then
    69 @@ -67,8 +94,8 @@ fi
   103 @@ -75,15 +119,19 @@ fi
    70  
   104  
    71  # Extract some info from Keystone's configuration file
   105  # Extract some info from Keystone's configuration file
    72  if [[ -r "$KEYSTONE_CONF" ]]; then
   106  if [[ -r "$KEYSTONE_CONF" ]]; then
    73 -    CONFIG_SERVICE_TOKEN=$(sed 's/[[:space:]]//g' $KEYSTONE_CONF | grep ^admin_token= | cut -d'=' -f2)
   107 -    CONFIG_SERVICE_TOKEN=$(sed 's/[[:space:]]//g' $KEYSTONE_CONF | grep ^admin_token= | cut -d'=' -f2)
       
   108 +    CONFIG_SERVICE_TOKEN=$(tr -d '[\t ]' < $KEYSTONE_CONF | \
       
   109 +        grep ^admin_token= | cut -d'=' -f2)
       
   110      if [[ -z "${CONFIG_SERVICE_TOKEN}" ]]; then
       
   111          # default config options are commented out, so lets try those
       
   112 -        CONFIG_SERVICE_TOKEN=$(sed 's/[[:space:]]//g' $KEYSTONE_CONF | grep ^\#admin_token= | cut -d'=' -f2)
       
   113 +        CONFIG_SERVICE_TOKEN=$(tr -d '[\t ]' < $KEYSTONE_CONF | \
       
   114 +            grep ^\#admin_token= | cut -d'=' -f2)
       
   115      fi
    74 -    CONFIG_ADMIN_PORT=$(sed 's/[[:space:]]//g' $KEYSTONE_CONF | grep ^admin_port= | cut -d'=' -f2)
   116 -    CONFIG_ADMIN_PORT=$(sed 's/[[:space:]]//g' $KEYSTONE_CONF | grep ^admin_port= | cut -d'=' -f2)
    75 +    CONFIG_SERVICE_TOKEN=$(tr -d '[\t ]' < $KEYSTONE_CONF | grep ^admin_token= | cut -d'=' -f2)
   117 +    CONFIG_ADMIN_PORT=$(tr -d '[\t ]' < $KEYSTONE_CONF | \
    76 +    CONFIG_ADMIN_PORT=$(tr -d '[\t ]' < $KEYSTONE_CONF | grep ^admin_port= | cut -d'=' -f2)
   118 +        grep ^admin_port= | cut -d'=' -f2)
    77  fi
   119      if [[ -z "${CONFIG_ADMIN_PORT}" ]]; then
    78  
   120          # default config options are commented out, so lets try those
    79  export OS_SERVICE_TOKEN=${OS_SERVICE_TOKEN:-$CONFIG_SERVICE_TOKEN}
   121 -        CONFIG_ADMIN_PORT=$(sed 's/[[:space:]]//g' $KEYSTONE_CONF | grep ^\#admin_port= | cut -d'=' -f2)
    80 @@ -136,6 +163,22 @@ keystone user-role-add --user-id $SWIFT_
   122 +        CONFIG_ADMIN_PORT=$(tr -d '[\t ]' < $KEYSTONE_CONF | \
    81                         --role-id $ADMIN_ROLE \
   123 +            grep ^\#admin_port= | cut -d'=' -f2)
    82                         --tenant-id $SERVICE_TENANT
   124      fi
    83  
   125  fi
    84 +CINDER_USER=$(get_id keystone user-create --name=cinder \
   126  
    85 +                                          --pass="${CINDER_PASSWORD}" \
   127 @@ -156,6 +204,29 @@ openstack role add --user neutron \
    86 +                                          --tenant-id $SERVICE_TENANT)
   128                     --project service \
    87 +
   129                     admin
    88 +keystone user-role-add --user-id $CINDER_USER \
   130  
    89 +                       --role-id $ADMIN_ROLE \
   131 +openstack user create cinder --project service \
    90 +                       --tenant-id $SERVICE_TENANT
   132 +                             --password "${CINDER_PASSWORD}"
    91 +
   133 +
    92 +NEUTRON_USER=$(get_id keystone user-create --name=neutron \
   134 +openstack role add --user cinder \
    93 +                                           --pass="${NEUTRON_PASSWORD}" \
   135 +                   --project service \
    94 +                                           --tenant-id $SERVICE_TENANT)
   136 +                   admin
    95 +
   137 +
    96 +keystone user-role-add --user-id $NEUTRON_USER \
   138 +openstack user create heat --project service \
    97 +                       --role-id $ADMIN_ROLE \
   139 +                           --password "${HEAT_PASSWORD}"
    98 +                       --tenant-id $SERVICE_TENANT
   140 +
       
   141 +openstack role add --user heat \
       
   142 +                   --project service \
       
   143 +                   admin
       
   144 +
       
   145 +openstack role create heat_stack_user
       
   146 +
       
   147 +openstack user create ironic --project service \
       
   148 +                             --password "${IRONIC_PASSWORD}"
       
   149 +
       
   150 +openstack role add --user ironic \
       
   151 +                   --project service \
       
   152 +                   admin
    99 +
   153 +
   100  #
   154  #
   101  # Keystone service
   155  # Keystone service
   102  #
   156  #
   103 @@ -159,23 +202,23 @@ keystone service-create --name=nova \
   157 @@ -178,24 +249,32 @@ openstack service create --name=nova \
   104                          --description="Nova Compute Service")
   158                           compute
   105  if [[ -z "$DISABLE_ENDPOINTS" ]]; then
   159  if [[ -z "$DISABLE_ENDPOINTS" ]]; then
   106      keystone endpoint-create --region RegionOne --service-id $NOVA_SERVICE \
   160      openstack endpoint create --region RegionOne \
   107 -        --publicurl "http://$CONTROLLER_PUBLIC_ADDRESS:8774/v2/\$(tenant_id)s" \
   161 -        --publicurl "http://$CONTROLLER_PUBLIC_ADDRESS:8774/v2/\$(tenant_id)s" \
   108 -        --adminurl "http://$CONTROLLER_ADMIN_ADDRESS:8774/v2/\$(tenant_id)s" \
   162 -        --adminurl "http://$CONTROLLER_ADMIN_ADDRESS:8774/v2/\$(tenant_id)s" \
   109 -        --internalurl "http://$CONTROLLER_INTERNAL_ADDRESS:8774/v2/\$(tenant_id)s"
   163 -        --internalurl "http://$CONTROLLER_INTERNAL_ADDRESS:8774/v2/\$(tenant_id)s" \
   110 +        --publicurl "http://$NOVA_PUBLIC_ADDRESS:8774/v2/\$(tenant_id)s" \
   164 +        --publicurl "http://$NOVA_PUBLIC_ADDRESS:8774/v2/\$(tenant_id)s" \
   111 +        --adminurl "http://$NOVA_ADMIN_ADDRESS:8774/v2/\$(tenant_id)s" \
   165 +        --adminurl "http://$NOVA_ADMIN_ADDRESS:8774/v2/\$(tenant_id)s" \
   112 +        --internalurl "http://$NOVA_INTERNAL_ADDRESS:8774/v2/\$(tenant_id)s"
   166 +        --internalurl "http://$NOVA_INTERNAL_ADDRESS:8774/v2/\$(tenant_id)s" \
       
   167          nova
   113  fi
   168  fi
   114  
   169  
   115  #
   170  #
   116  # Volume service
   171  # Volume service
   117  #
   172  #
   118  VOLUME_SERVICE=$(get_id \
   173 -openstack service create --name=volume \
   119 -keystone service-create --name=volume \
   174 +openstack service create --name=cinder \
   120 +keystone service-create --name=cinder \
   175                           --description="Cinder Volume Service" \
   121                          --type=volume \
   176                           volume
   122 -                        --description="Nova Volume Service")
   177 +openstack service create --name=cinderv2 \
   123 +                        --description="Cinder Volume Service")
   178 +                         --description="Cinder Volume Service (Version 2)" \
   124  if [[ -z "$DISABLE_ENDPOINTS" ]]; then
   179 +                         volumev2
   125      keystone endpoint-create --region RegionOne --service-id $VOLUME_SERVICE \
   180  if [[ -z "$DISABLE_ENDPOINTS" ]]; then
       
   181      openstack endpoint create --region RegionOne \
   126 -        --publicurl "http://$CONTROLLER_PUBLIC_ADDRESS:8776/v1/\$(tenant_id)s" \
   182 -        --publicurl "http://$CONTROLLER_PUBLIC_ADDRESS:8776/v1/\$(tenant_id)s" \
   127 -        --adminurl "http://$CONTROLLER_ADMIN_ADDRESS:8776/v1/\$(tenant_id)s" \
   183 -        --adminurl "http://$CONTROLLER_ADMIN_ADDRESS:8776/v1/\$(tenant_id)s" \
   128 -        --internalurl "http://$CONTROLLER_INTERNAL_ADDRESS:8776/v1/\$(tenant_id)s"
   184 -        --internalurl "http://$CONTROLLER_INTERNAL_ADDRESS:8776/v1/\$(tenant_id)s" \
       
   185 -        volume
   129 +        --publicurl "http://$CINDER_PUBLIC_ADDRESS:8776/v1/\$(tenant_id)s" \
   186 +        --publicurl "http://$CINDER_PUBLIC_ADDRESS:8776/v1/\$(tenant_id)s" \
   130 +        --adminurl "http://$CINDER_ADMIN_ADDRESS:8776/v1/\$(tenant_id)s" \
   187 +        --adminurl "http://$CINDER_ADMIN_ADDRESS:8776/v1/\$(tenant_id)s" \
   131 +        --internalurl "http://$CINDER_INTERNAL_ADDRESS:8776/v1/\$(tenant_id)s"
   188 +        --internalurl "http://$CINDER_INTERNAL_ADDRESS:8776/v1/\$(tenant_id)s" \
   132  fi
   189 +        cinder
   133  
   190 +    openstack endpoint create --region RegionOne \
   134  #
   191 +        --publicurl "http://$CINDER_PUBLIC_ADDRESS:8776/v2/\$(tenant_id)s" \
   135 @@ -187,9 +230,9 @@ keystone service-create --name=glance \
   192 +        --adminurl "http://$CINDER_ADMIN_ADDRESS:8776/v2/\$(tenant_id)s" \
   136                          --description="Glance Image Service")
   193 +        --internalurl "http://$CINDER_INTERNAL_ADDRESS:8776/v2/\$(tenant_id)s" \
   137  if [[ -z "$DISABLE_ENDPOINTS" ]]; then
   194 +        cinderv2
   138      keystone endpoint-create --region RegionOne --service-id $GLANCE_SERVICE \
   195  fi
       
   196  
       
   197  #
       
   198 @@ -206,9 +285,9 @@ openstack service create --name=glance \
       
   199                           image
       
   200  if [[ -z "$DISABLE_ENDPOINTS" ]]; then
       
   201      openstack endpoint create --region RegionOne  \
   139 -        --publicurl "http://$CONTROLLER_PUBLIC_ADDRESS:9292" \
   202 -        --publicurl "http://$CONTROLLER_PUBLIC_ADDRESS:9292" \
   140 -        --adminurl "http://$CONTROLLER_ADMIN_ADDRESS:9292" \
   203 -        --adminurl "http://$CONTROLLER_ADMIN_ADDRESS:9292" \
   141 -        --internalurl "http://$CONTROLLER_INTERNAL_ADDRESS:9292"
   204 -        --internalurl "http://$CONTROLLER_INTERNAL_ADDRESS:9292" \
   142 +        --publicurl "http://$GLANCE_PUBLIC_ADDRESS:9292" \
   205 +        --publicurl "http://$GLANCE_PUBLIC_ADDRESS:9292" \
   143 +        --adminurl "http://$GLANCE_ADMIN_ADDRESS:9292" \
   206 +        --adminurl "http://$GLANCE_ADMIN_ADDRESS:9292" \
   144 +        --internalurl "http://$GLANCE_INTERNAL_ADDRESS:9292"
   207 +        --internalurl "http://$GLANCE_INTERNAL_ADDRESS:9292" \
   145  fi
   208          glance
   146  
   209  fi
   147  #
   210  
   148 @@ -201,9 +244,9 @@ keystone service-create --name=ec2 \
   211 @@ -220,9 +299,9 @@ openstack service create --name=ec2 \
   149                          --description="EC2 Compatibility Layer")
   212                           ec2
   150  if [[ -z "$DISABLE_ENDPOINTS" ]]; then
   213  if [[ -z "$DISABLE_ENDPOINTS" ]]; then
   151      keystone endpoint-create --region RegionOne --service-id $EC2_SERVICE \
   214      openstack endpoint create --region RegionOne \
   152 -        --publicurl "http://$CONTROLLER_PUBLIC_ADDRESS:8773/services/Cloud" \
   215 -        --publicurl "http://$CONTROLLER_PUBLIC_ADDRESS:8773/services/Cloud" \
   153 -        --adminurl "http://$CONTROLLER_ADMIN_ADDRESS:8773/services/Admin" \
   216 -        --adminurl "http://$CONTROLLER_ADMIN_ADDRESS:8773/services/Admin" \
   154 -        --internalurl "http://$CONTROLLER_INTERNAL_ADDRESS:8773/services/Cloud"
   217 -        --internalurl "http://$CONTROLLER_INTERNAL_ADDRESS:8773/services/Cloud" \
   155 +        --publicurl "http://$EC2_PUBLIC_ADDRESS:8773/services/Cloud" \
   218 +        --publicurl "http://$EC2_PUBLIC_ADDRESS:8773/services/Cloud" \
   156 +        --adminurl "http://$EC2_ADMIN_ADDRESS:8773/services/Admin" \
   219 +        --adminurl "http://$EC2_ADMIN_ADDRESS:8773/services/Admin" \
   157 +        --internalurl "http://$EC2_INTERNAL_ADDRESS:8773/services/Cloud"
   220 +        --internalurl "http://$EC2_INTERNAL_ADDRESS:8773/services/Cloud" \
   158  fi
   221          ec2
   159  
   222  fi
   160  #
   223  
   161 @@ -212,15 +255,34 @@ fi
   224 @@ -234,9 +313,11 @@ openstack service create --name=swift \
   162  SWIFT_SERVICE=$(get_id \
   225                           object-store
   163  keystone service-create --name=swift \
   226  if [[ -z "$DISABLE_ENDPOINTS" ]]; then
   164                          --type="object-store" \
   227      openstack endpoint create --region RegionOne \
   165 -                        --description="Swift Service")
       
   166 +                        --description="Swift Object Store Service")
       
   167  if [[ -z "$DISABLE_ENDPOINTS" ]]; then
       
   168      keystone endpoint-create --region RegionOne --service-id $SWIFT_SERVICE \
       
   169 -        --publicurl   "http://$CONTROLLER_PUBLIC_ADDRESS:8080/v1/AUTH_\$(tenant_id)s" \
   228 -        --publicurl   "http://$CONTROLLER_PUBLIC_ADDRESS:8080/v1/AUTH_\$(tenant_id)s" \
   170 -        --adminurl    "http://$CONTROLLER_ADMIN_ADDRESS:8080/v1" \
   229 -        --adminurl    "http://$CONTROLLER_ADMIN_ADDRESS:8080/v1" \
   171 -        --internalurl "http://$CONTROLLER_INTERNAL_ADDRESS:8080/v1/AUTH_\$(tenant_id)s"
   230 -        --internalurl "http://$CONTROLLER_INTERNAL_ADDRESS:8080/v1/AUTH_\$(tenant_id)s" \
   172 +        --publicurl "http://$SWIFT_PUBLIC_ADDRESS:8080/v1/AUTH_\$(tenant_id)s" \
   231 +        --publicurl \
   173 +        --adminurl "http://$SWIFT_ADMIN_ADDRESS:8080/v1" \
   232 +            "http://$SWIFT_PUBLIC_ADDRESS:8080/v1/AUTH_\$(tenant_id)s" \
   174 +        --internalurl "http://$SWIFT_INTERNAL_ADDRESS:8080/v1/AUTH_\$(tenant_id)s"
   233 +        --adminurl    "http://$SWIFT_ADMIN_ADDRESS:8080/v1" \
       
   234 +        --internalurl \
       
   235 +            "http://$SWIFT_INTERNAL_ADDRESS:8080/v1/AUTH_\$(tenant_id)s" \
       
   236          swift
       
   237  fi
       
   238  
       
   239 @@ -248,12 +329,48 @@ openstack service create --name=neutron
       
   240                           network
       
   241  if [[ -z "$DISABLE_ENDPOINTS" ]]; then
       
   242      openstack endpoint create --region RegionOne \
       
   243 -        --publicurl   "http://$CONTROLLER_PUBLIC_ADDRESS:9696" \
       
   244 -        --adminurl    "http://$CONTROLLER_ADMIN_ADDRESS:9696" \
       
   245 -        --internalurl "http://$CONTROLLER_INTERNAL_ADDRESS:9696" \
       
   246 +        --publicurl   "http://$NEUTRON_PUBLIC_ADDRESS:9696" \
       
   247 +        --adminurl    "http://$NEUTRON_ADMIN_ADDRESS:9696" \
       
   248 +        --internalurl "http://$NEUTRON_INTERNAL_ADDRESS:9696" \
       
   249          neutron
       
   250  fi
       
   251  
       
   252 +#
       
   253 +# Heat service
       
   254 +#
       
   255 +openstack service create --name=heat-cfn \
       
   256 +                         --description="Heat CloudFormation API" \
       
   257 +                         cloudformation
       
   258 +openstack service create --name=heat \
       
   259 +                         --description="Heat API" \
       
   260 +                         orchestration
       
   261 +if [[ -z "$DISABLE_ENDPOINTS" ]]; then
       
   262 +    openstack endpoint create --region RegionOne \
       
   263 +        --publicurl   "http://$HEAT_CFN_PUBLIC_ADDRESS:8000/v1" \
       
   264 +        --adminurl    "http://$HEAT_CFN_ADMIN_ADDRESS:8000/v1" \
       
   265 +        --internalurl "http://$HEAT_CFN_INTERNAL_ADDRESS:8000/v1" \
       
   266 +        heat-cfn
       
   267 +    openstack endpoint create --region RegionOne \
       
   268 +        --publicurl   "http://$HEAT_PUBLIC_ADDRESS:8004/v1/\$(tenant_id)s" \
       
   269 +        --adminurl    "http://$HEAT_ADMIN_ADDRESS:8004/v1/\$(tenant_id)s" \
       
   270 +        --internalurl "http://$HEAT_INTERNAL_ADDRESS:8004/v1/\$(tenant_id)s" \
       
   271 +        heat
   175 +fi
   272 +fi
   176 +
   273 +
   177 +#
   274 +#
   178 +# Neutron service
   275 +# Ironic service
   179 +#
   276 +#
   180 +NEUTRON_SERVICE=$(get_id \
   277 +openstack service create --name=ironic \
   181 +keystone service-create --name=neutron \
   278 +    --description="Ironic Bare Metal Provisioning Service" \
   182 +                        --type=network \
   279 +    baremetal
   183 +                        --description="Neutron Network Service")
       
   184 +if [[ -z "$DISABLE_ENDPOINTS" ]]; then
   280 +if [[ -z "$DISABLE_ENDPOINTS" ]]; then
   185 +    keystone endpoint-create --region RegionOne --service-id $NEUTRON_SERVICE \
   281 +    openstack endpoint create --region RegionOne \
   186 +        --publicurl "http://$NEUTRON_PUBLIC_ADDRESS:9696/" \
   282 +        --publicurl   "http://$IRONIC_PUBLIC_ADDRESS:6385" \
   187 +        --adminurl "http://$NEUTRON_ADMIN_ADDRESS:9696/" \
   283 +        --adminurl    "http://$IRONIC_ADMIN_ADDRESS:6385" \
   188 +        --internalurl "http://$NEUTRON_INTERNAL_ADDRESS:9696/"
   284 +        --internalurl "http://$IRONIC_INTERNAL_ADDRESS:6385" \
   189  fi
   285 +        ironic
   190  
   286 +fi
       
   287 +
   191  # create ec2 creds and parse the secret and access key returned
   288  # create ec2 creds and parse the secret and access key returned
   192 +unset SERVICE_ENDPOINT SERVICE_TOKEN
   289  ADMIN_USER=$(get_id openstack user show admin)
   193 +export OS_AUTH_URL=http://localhost:5000/v2.0
   290  RESULT=$(openstack ec2 credentials create --project service --user $ADMIN_USER)
   194 +export OS_PASSWORD="${ADMIN_PASSWORD}"
       
   195 +export OS_TENANT_NAME=demo
       
   196 +export OS_USERNAME=admin
       
   197  RESULT=$(keystone ec2-credentials-create --tenant-id=$SERVICE_TENANT --user-id=$ADMIN_USER)
       
   198  ADMIN_ACCESS=`echo "$RESULT" | grep access | awk '{print $4}'`
       
   199  ADMIN_SECRET=`echo "$RESULT" | grep secret | awk '{print $4}'`