anchor.diff:       | .[\"identity:list_projects\"]=\"rule:cloud_admin or rule:admin_and_matching_domain_id or rule:cloud_service\" \
        | .cloud_admin=\"rule:admin_required and domain_id:'\${ID_ADMIN_DOMAIN}'\"                      \
        | .cloud_service=\"rule:service_role and domain_id:'\${ID_ADMIN_DOMAIN}'\"'                     \
  -  | tee /etc/keystone/policy.json  ">> /opt/keystone/postlaunchconfig.sh
  -
  -RUN chmod 755 /opt/keystone/postlaunchconfig.sh
  +  | tee /etc/keystone/policy.json  ">> /opt/keystone/postlaunchconfig.sh && \
  +
  +  chmod 755 /opt/keystone/postlaunchconfig.sh
   
   WORKDIR /opt/keystone
   
  
positive.code:                                                                           \
  /usr/bin/keystone-manage db_sync keystone                                 \
  /usr/bin/keystone-manage db_sync --extension spassword                    \
  /usr/bin/keystone-all & " >> /opt/keystone/postlaunchconfig.sh
  
  # Create Services
  # I'm not sure if exporting works, so I just specify these environment
  # variables on each command, but it might be cleaner to test this
  
  RUN echo " \
  export OS_SERVICE_TOKEN=ADMIN                                                 \
  export OS_SERVICE_ENDPOINT=http://localhost:35357/v2.0                        \
  readonly KEYSTONE_HOST=\"localhost:5001\"                                     \
  
negative.code:     curl -s --insecure -L "${url_spassword}" | tar zxvf - -C ${dir} && \
      cd ${dir}/${repo_spassword}-${tag} && \
      source ./${pack_spassword} && \
      find . -name "*.rpm" -exec rpm -Uvh {} \; && \
      mkdir -p /opt/keystone
  
  COPY keystone-entrypoint.sh /opt/keystone
  
  # The following sections build a script that will be executed on launch via ENTRYPOINT
  #https://allthingsopen.com/2014/07/09/docker-all-the-things-openstack-keystone-and-ceilometer-automated-builds-on-docker-hub/
  
  ## Start Keystone
  RUN echo "#!/bin/bash" > /opt/keystone/postlaunchconfig.sh && \
      echo " \
  DB_HOST_ARG=\${1}                                                         \
  DB_HOST_VALUE=\${2}                                                       \
  if [ \"\$DB_HOST_ARG\" == \"-dbhost\" ]; then                             \
  