314 Commits

Author SHA1 Message Date
Adam Gandelman
c4b067134c Split keystone mod wsgi config from start/stop
We currently cleanup keystone apache config during stop_keystone
when mod wsgi is enabled, but only create it during initial keystone
configuration.  Grenade expects to be able to stop and start the
service without reconfiguring it, using only the respective functions.
This moves cleanup of config from stop_keystone to cleanup_keystone,
and enables/disables the apache vhost during start/stop.

Closes-bug: #1365105

Change-Id: I9e57c9a763fbdb8c5737decfe797ba0e9894150b
2014-09-16 04:36:25 +02:00
Chris Dent
2f27a0ed3c Replace screen_it() with run_process() throughout
run_process will use screen if USE_SCREEN=True (the default),
otherwise it will simply start the requested service. Therefore
wherever screen_it used, run_process can be instead.

Where stop_screen was found it has been replaced with stop_process.

A tail_log function has been added which will tail a logfile in a
screen if USE_SCREEN is True.

lib/template has been updated to reflect the use of the new
functions.

When using sg the quoting in run_process gets very complicated.
To get around this run_process and the functions it calls accepts
an optional third argument. If set it is a group to be used with sg.

Change-Id: Ia3843818014f7c6c7526ef3aa9676bbddb8a85ca
2014-09-11 18:59:39 +01:00
Jenkins
68fd37e029 Merge "Fix another_role variable for swift" 2014-09-09 00:42:50 +00:00
Jenkins
ba842f5374 Merge "Keystone access log in key-access screen" 2014-09-08 16:23:20 +00:00
Masayuki Igawa
d3654058e5 Fix another_role variable for swift
An error occurs because ANOTHER_ROLE variable in lib/swift is not set.
This patch gets and sets the value to another_role variable.

Change-Id: I9d67ce243eb6bb42ed7e3522ef816295847d48fa
Closes-Bug: #1363884
2014-09-08 16:41:41 +02:00
Noboru Iwamatsu
b4495eb410 Use mod_version to clean-up apache version matching
This change uses mod_version (shipped by default on everything we care
about) to set-up version-specific config within apache rather than
within devstack scripts.

Clean up the horizon and keystone config file generation to use the
internal apache matching.

Since I6478db385fda2fa1c75ced12d3e886b2e1152852 the apache matching in
'functions' is actually duplicated.  just leave get_apache_version in
lib/apache as it is used for config-file name matching in there.

Change-Id: I6478db385fda2fa1c75ced12d3e886b2e1152852
2014-09-08 15:59:29 +10:00
Jenkins
61a6e253f2 Merge "Use correct class path for token persistence backend" 2014-09-04 23:40:48 +00:00
Brant Knudson
966463c802 Keystone access log in key-access screen
When Keystone was run in Apache Httpd the access log wasn't in a
screen. A new screen called key-access is now started with
Keystone's access log.

Change-Id: Ie1f4d4b679e1b9c87f0cea37deb25f7b6636fe01
Closes-Bug: #1359995
2014-09-04 18:12:37 -05:00
Morgan Fainberg
947d7468c8 Use correct class path for token persistence backend
Keystone has moved over to using a new location for the token
persistence backends (drivers). The old values will continue to
work, but this will limit the deprecation warnings for an out
of the box devstack install.

Change-Id: I7c437788c8aee0106fa7f3c37617fbd1220291ef
bp: non-persistent-tokens
2014-08-29 13:26:31 -07:00
Morgan Fainberg
d074dc7f7e Use the apache 2.4 ErrorLogFormat directive
Use the new ErrorLogFormat directive to make the Keystone logs
under Apache to look like the standard oslo log format.

Change-Id: Ie823abf2fa06b8ce22027c21bef455808a4a768e
2014-08-28 08:39:50 -07:00
Jenkins
a8f0d966a1 Merge "Change httpd Keystone log to keystone.log" 2014-08-24 21:31:35 +00:00
Brant Knudson
cfc9465ee0 Change httpd Keystone log to keystone.log
The normal extension for log files is .log. Log rotation should
work because the extension is as expected.

Change-Id: Ia5e42ea9d953e8395b86ab58cdef6c2d852efc94
Related-Bug: #1359995
2014-08-22 16:49:02 -05:00
Dean Troyer
c50c983c56 Clean up local variable usage - Keystone
Change-Id: I8e5506e9d29879459158ef796854ce7a67107d89
2014-07-25 15:57:48 -05:00
Sean Dague
4f3b66f538 add is_keystone_enabled
This is missing, and makes logic much harder for the grenade use
case.

Change-Id: Ib6670096d190e69273256b87e6a67e2b46945a0d
2014-07-23 16:45:12 -04:00
Gael Chamoulaud
6dd8a8bee4 Users in service group should not have email addresses
Change-Id: Ieed9dffce5cf1e735e482dd3494ac1e103b50955
Closes-Bug: 1185201
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2014-07-22 17:29:04 +02:00
Jenkins
d727754c92 Merge "Configure rabbitmq credentials in keystone.conf" 2014-07-11 14:33:21 +00:00
Sergey Skripnick
8464a4cba3 Configure rabbitmq credentials in keystone.conf
Rabbitmq credentials in keystone.conf should be updated according
to localrc

This is done mostly to enable keystone notifications.

There are 2 cases where we can use notifications from keystone:
A) Collect audit notifications in ceilometer
B) Collect profiling data

Change-Id: I381d4d670755aa691743caa02df7dc55e05784c2
2014-07-09 03:36:51 +04:00
Morgan Fainberg
e6dd4e665d Enable Keystone under Apache by default
Make the default run mode of Keystone HTTPD + mod_wsgi. This will
enable gating on Keystone under mod_wsgi.

Depends On: https://review.openstack.org/#/c/100764/

Change-Id: I4b664a1d6c9bbb1ff999158f3a8c8ab3bd8d891b
2014-07-08 00:11:20 +00:00
Morgan Fainberg
46455a34d5 Update Apache + mod_wsgi deployment mechanisms
Added a global toggle for enabling HTTPD + mod_wsgi for services
that default deploy to running under Apache. When the variable
``ENABLE_HTTPD_MOD_WSGI_SERVICES`` is set to ``True`` any service
that recommends deploying under HTTPD + mod_wsgi, will be run
under Apache.

If ``ENABLE_HTTPD_MOD_WSGI_SERVICES`` is set to ``False`` the
any service that is defaulted to running under HTTPD + mod_wsgi
will (if capable) be run in an alternate deployment strategy (e.g.
eventlet).

Updated Swift and Keystone to have individual toggles for deploying
under HTTPD + mod_wsgi. This is done to allow for gate to run on
the services under mod_wsgi where appropriate. Toggles are
``KEYSTONE_USE_MOD_WSGI`` and ``SWIFT_USE_MOD_WSGI`` and are both
defaulted to "False" (do not deploy under HTTPD + mod_wsgi).

Change-Id: Id3b121b8f1cde369d184b586e0d875bdbda34813
2014-07-07 08:46:28 -07:00
Jenkins
cfcd8cf2f8 Merge "Adds support for multi-region" 2014-07-04 16:53:01 +00:00
Jenkins
8a88f2728c Merge "Add keystone middleware to devstack" 2014-07-01 19:46:16 +00:00
Bartosz Górski
0abde393c5 Adds support for multi-region
Change-Id: Ib85fe7cb375692b04aca4c46f61ba7e1fbfa501b
Implements: blueprint multi-region
2014-07-01 14:58:35 +00:00
Morgan Fainberg
58936fdbcd Add keystone middleware to devstack
Add the keystonemiddleware repository to devstack to support testing
with tempest and stable branches.

Change-Id: Ib635465e6568d9cd51d6e432ec8b8633a27d19ce
2014-06-30 09:29:45 -07:00
Jenkins
945ccecb68 Merge "Always check keystone using http" 2014-06-25 21:14:35 +00:00
Stanislaw Pitucha
be4c953e5a Always check keystone using http
The check to $service_port must be done using http. It's
$KEYSTONE_SERVICE_PORT that may use either the http or https protocol.

partial blueprint devstack-https
Change-Id: I8ae081e9710c54396b765210336a7de331947086
2014-06-25 16:17:17 +00:00
Julien Vey
00da58a0da Add an environment variable to enable extensions in keystone
Following https://review.openstack.org/#/c/44401/3

Change-Id: I8e0391cd68e29e6d57c0f35517bf4155110861c7
Closes-Bug: #1218733
Co-Authored-By: Yong Sheng Gong <gongysh@unitedstack.com>
2014-06-24 10:09:08 +02:00
Jenkins
399a2640bc Merge "Use Keystone's default token format if not set" 2014-06-23 13:43:30 +00:00
Jenkins
056b7c1193 Merge "PKIZ is the default token provider" 2014-06-19 23:00:13 +00:00
Brant Knudson
1e1fce856d Use Keystone's default token format if not set
Devstack was setting its own default for Keystone's token format, so
when Keystone's default token format changed then devstack needed to
be updated. With this change, devstack will only override Keystone's
token format if KEYSTONE_TOKEN_FORMAT is set explicitly. PKI setup
is assumed to be needed unless the KEYSTONE_TOKEN_FORMAT is set to
UUID.

Change-Id: Idfa78e93abd80273dadcf37007a024bb6a783a48
2014-06-19 16:59:09 -05:00
Jenkins
da2fe19e24 Merge "Use identity_uri instead of auth fragments" 2014-06-17 16:06:48 +00:00
Jenkins
f04abfe865 Merge "Support option for Keystone PKIZ token provider" 2014-06-17 06:14:29 +00:00
Jamie Lennox
3561d7f9ed Use identity_uri instead of auth fragments
auth_token middleware now accepts a standard URL string as the parameter
identity_uri instead of specifying protocol etc individually. Change the
services over to use this.

Also changes over some other places in which the auth fragments are used
individually to the new variables and fixes up some misconfigurations of
auth_token.

identity_uri option was release in keystoneclient 0.8.0

Change-Id: Iac13bc3d08c524a6a0f39cdfbc1009e2f5c45c2a
2014-06-16 15:16:48 +10:00
Morgan Fainberg
970ee9083e Use apache2ctl after apache is installed.
Ensure that apache2ctl is only called if apache2 is being used when
setting up Keystone. This patch corrects a case where apache2ctl
is being called at the time lib/keystone is being sourced. This
error breaks attempts to deploy Keystone under apache unless
apache is already installed at the time stack.sh is run.

Change-Id: I02d426438fa1246effd68c6bb3c3358910ed4c05
2014-06-09 12:09:33 -07:00
Brant Knudson
0b0cbd1378 PKIZ is the default token provider
Keystone changed the default token provider to PKIZ from PKI.

Change-Id: I56b975383ded450308a8fe01908b6e5549e7cd74
2014-06-06 10:55:42 -05:00
Brant Knudson
754c4408b3 Support option for Keystone PKIZ token provider
Keystone added support for a compressed token provider, PKIZ. This
change adds support to devstack. Set the KEYSTONE_TOKEN_FORMAT
option to "PKIZ" to configure Keystone to use it.

Change-Id: I123eef661c85cc805e950f1179b48e885078d40f
2014-06-04 09:07:32 -05:00
Gabriel Assis Bezerra
a688bc6510 Fix the way Apache site configuration files are used, to improve OS portability
On Ubuntu 14.04, the site configuration file must have a .conf suffix for a2ensite and a2dissite to
recognise it. a2ensite and a2dissite ignore the .conf suffix used as parameter. The default sites'
files are 000-default.conf and default-ssl.conf.

On Ubuntu 12.04, the site configuration file may have any format, as long as it is in
/etc/apache2/sites-available/. a2ensite and a2dissite need the entire file name to work. The default
sites' files are default and default-ssl.

On Fedora, any file in /etc/httpd/conf.d/ whose name ends with .conf is enabled.

On RHEL and CentOS, things should hopefully work as in Fedora.

This change puts all distribution-related site configuration file name differences in lib/apache and
the other services gets the file name for its sites using the new exported function
apache_site_config_for <sitename>.

It also makes Fedora disabled sites use the .conf.disabled suffix instead of removing the .conf from
the file name.

The table below summarizes what should happen on each distribution:
+----------------------+--------------------+--------------------------+--------------------------+
| Distribution         | File name          | Site enabling command    | Site disabling command   |
+----------------------+--------------------+--------------------------+--------------------------+
| Ubuntu 12.04         | site               | a2ensite site            | a2dissite site           |
| Ubuntu 14.04         | site.conf          | a2ensite site            | a2dissite site           |
| Fedora, RHEL, CentOS | site.conf.disabled | mv site.conf{.disabled,} | mv site.conf{,.disabled} |
+----------------------+--------------------+--------------------------+--------------------------+

Change-Id: Ia2ba3cb7caccb6e9b65380f9d51d9d21180b894e
Closes-bug: #1313765
2014-05-30 12:07:24 +00:00
Jenkins
1bb05a9631 Merge "Fix logging for keystone under mod_wsgi" 2014-05-06 11:36:02 +00:00
Morgan Fainberg
c11d6e0b09 Cleanup WSGI config for keystone on stop
Ensure that the VHOST and the scripts used to enable keystone under
mod_wsgi are properly cleaned up.

Change-Id: I76a748b0fd5f1a5182d10e425202857c5621e25a
2014-05-01 22:57:06 -07:00
Morgan Fainberg
2c2b1cccc9 Fix logging for keystone under mod_wsgi
When Keystone is configured under mod_wsgi, Keystone configuration 
requires debugging to be enabled as the debug flag cannot be passed
via cli arguments.

Because Apache 2.2 (default for a number of distributions) does not 
support passing an explicit format to the ErrorLog, Keystone under 
mod_wsgi ends up with duplicated timestamps in the Keystone log. 
This patchset eliminates the %(asctime) and %(msecs) substitution 
targets from the log format options when Keystone is configured 
under mod_wsgi.

Change-Id: I0bf32db6e53cb653921162cb1957eb988b819815
2014-05-02 05:12:21 +00:00
Dean Troyer
42a59c2bfa Complete moving Keystone setup out of keystone_data.sh
* Move remaining role creation to create_keystone_accounts()
* Move glance creation to create_glance_accounts()
* Move nova/ec2/s3 creation to create_nova_accounts()
* Move ceilometer creation to create_ceilometer_accounts()
* Move tempest creation to create_tempest_accounts()
* Convert moved code to use OpenStackClient for setup
* files/keystone_data.sh is removed

Note that the SERVICE_TENANT and ADMIN_ROLE lookups in the other service
implementations are not necessary with OSC, all operations can be done
using names rather than requiring IDs.

Change-Id: I4283ca0036ae39fd44ed2eed834b69d78e4f8257
2014-03-10 15:17:30 -05:00
Jenkins
dad6e4114d Merge "Enforce function declaration format in bash8" 2014-02-28 06:32:20 +00:00
Jenkins
3ac259c685 Merge "Make admin_bind_host configurable" 2014-02-27 23:41:11 +00:00
Ian Wienand
aee18c749b Enforce function declaration format in bash8
Check that function calls look like ^function foo {$ in bash8, and fix
all existing failures of that check.  Add a note to HACKING.rst

Change-Id: Ic19eecb39e0b20273d1bcd551a42fe400d54e938
2014-02-28 07:59:03 +11:00
Jamie Lennox
06ba5193be Insecure check if keystone is up
If we start keystone with an SSL endpoint then the curl check to see if
it is running will fail because it cannot create a secure connection.
This check can be done insecurely as all we care about is that the
service has started.

Change-Id: I826753d4d46e9956f443110029346bc70282951a
2014-02-26 13:46:56 +10:00
David Kranz
041fa71247 Make admin_bind_host configurable
The use case is running devstack inside an OpenStack vm and running tempest
from some other machine. To make the catalog export urls that can be accessed
from off the devstack machine, you need to set KEYSTONE_SERVICE_HOST to an
external IP. But devstack uses that address in its setup of keystone in
addition to exporting in the catalog. Because OpenStack has an issue where
a vm cannot access itself through its own floating ip, devstack fails. There
is no way to have this use case by providing an ip address. The workaround
is to use the hostname of the devstack machine. That worked until recently
when a change was made to set admin_bind_host to the value of
KEYSTONE_SERVICE_HOST. The result is that port 35357 is only opened locally.
This change allows the devstack user to restore the original behavior
allowing this use case.

Change-Id: I97b938b305b7dd878397e7e64462650064e59cd2
Closes-Bug: #1283803
2014-02-24 13:43:23 -05:00
Jenkins
d85e1ea669 Merge "Use database connection for keystone" 2014-02-17 01:52:49 +00:00
Steve Martinelli
19685428e3 Change most keystoneclient commands to openstacklient in libs
migrated most keystoneclient commands from the following libs:
 ceilometer
 cinder
 ironic
 keystone
 marconi
 neutron
 nova
 savanna
 swift
 trove

Also need to set and unset openstackclient specific environment
variables from stack.sh

Change-Id: I725f30bc08e1df5a4c5770576c19ad1ddaeb843a
2014-02-14 21:30:57 -06:00
Brant Knudson
16d3ad057d Use database connection for keystone
The keystone configuration used the 'connection' option in the
'sql' section of the keystone.conf file. This option is deprecated
in favor of 'connection' in the 'database' section.

The keystone setup code is changed to use the option in the new
section rather than the deprecated one.

Change-Id: I62fd2f50ded3b8848e9e5225e88c80ed8fed3bff
2014-02-13 18:59:50 -06:00
Clark Boylan
6c57fbab26 Set keystone admin_bind_host to KEYSTONE_SERVICE_HOST
On Linux ports 32768-61000 can be used by just about
anything needing a socket. Keystone's IANA assigned port is 35357.
Occasionally something else will be using port 35357 first because Linux
allows this. Workaround is to bind to port 127.0.0.1 instead of 0.0.0.0.
$KEYSTONE_SERVICE_HOST gets its value from $SERVICE_HOST which is set to
127.0.0.1 in the gate.

"Ephemeral (client) ports will *never* be sourced from 0.0.0.0, and are
uniquely identified by the full connection five-tuple (proto, src IP,
src port, dst IP, dst port) anyway, allowing them to overlap src IP/src
port as long as proto/dst IP/dst port are different. Thus it is up to
keystone/devstack to bind more appropriately and not use wildcard bind
addresses unless explicitly necessary for some reason. For example, in
the log output, the URLs are configured with dst IPs of 127.0.0.1
anyway, so binding explicitly to localhost would change nothing, while
skirting this particular edge case nicely." ~Evan Callicoat

This doesn't fix bug 1253482 it works around it while a better solution
is prepared (running keystone behind apache in devstack).

Co-Authored-By: Joe Gordon <joe.gordon0@gmail.com>
Change-Id: I112309661dadf8b753c3311182f82464d9d3595e
Related-bug: #1253482
2014-01-29 17:48:28 -08:00
Jenkins
00eb27bb5a Merge "Keystone use common logging setup" 2014-01-25 18:40:53 +00:00