forked from redhat-openstack/openstack-puppet-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
setup keystone using apache mod_wsgi
Allow keystone to be set up to use apache mod_wsgi as the server instead of a standalone eventlet service. There is a new keystone class parameter: service_name. The default is 'keystone', which will set up the standalone eventlet service. If 'httpd' is used, the keystone class will skip creating the keystone service, which also means no 'openstack-keystone' service. The class 'keystone::wsgi::apache' is then used to configure apache mod_wsgi to serve keystone. Had to remove the File resource default in the keystone class. When using wsgi::apache, the apache class and other classes are included. Since puppet uses dynamic scoping, this overrides the file resources in those classes as well. keystone now explicitly sets all of the parameters in files/directory resources. Closes-Bug: #1348728 (cherry picked from commit 879f872) Conflicts: manifests/init.pp manifests/params.pp spec/classes/keystone_spec.rb Change-Id: Ia228cb3c582c2890f35e1f0ee11e0fef69179523
- Loading branch information
Showing
5 changed files
with
244 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,6 +131,22 @@ | |
# Tested versions include 0.9 and 2.2 | ||
# Default to '0.9' | ||
# | ||
# [*service_name*] | ||
# (optional) Name of the service that will be providing the | ||
# server functionality of keystone. For example, the default | ||
# is just 'keystone', which means keystone will be run as a | ||
# standalone eventlet service, and will able to be managed | ||
# separately by the operating system's service manager. For | ||
# example, you will be able to use | ||
# service openstack-keystone restart | ||
# to restart the service. | ||
# If the value is 'httpd', this means keystone will be a web | ||
# service, and you must use another class to configure that | ||
# web service. For example, after calling class {'keystone'...} | ||
# use class { 'keystone::wsgi::apache'...} to make keystone be | ||
# a web app using apache mod_wsgi. | ||
# Defaults to 'keystone' | ||
# | ||
# == Dependencies | ||
# None | ||
# | ||
|
@@ -141,6 +157,17 @@ | |
# admin_token => 'my_special_token', | ||
# } | ||
# | ||
# OR | ||
# | ||
# class { 'keystone': | ||
# ... | ||
# service_name => 'httpd', | ||
# ... | ||
# } | ||
# class { 'keystone::wsgi::apache': | ||
# ... | ||
# } | ||
# | ||
# == Authors | ||
# | ||
# Dan Bode [email protected] | ||
|
@@ -195,6 +222,7 @@ | |
$notification_driver = false, | ||
$notification_topics = false, | ||
$control_exchange = false, | ||
$service_name = 'keystone', | ||
# DEPRECATED PARAMETERS | ||
$sql_connection = undef, | ||
$idle_timeout = undef, | ||
|
@@ -218,19 +246,10 @@ | |
$database_idle_timeout_real = $database_idle_timeout | ||
} | ||
|
||
File['/etc/keystone/keystone.conf'] -> Keystone_config<||> ~> Service['keystone'] | ||
File['/etc/keystone/keystone.conf'] -> Keystone_config<||> ~> Service[$service_name] | ||
Keystone_config<||> ~> Exec<| title == 'keystone-manage db_sync'|> | ||
Keystone_config<||> ~> Exec<| title == 'keystone-manage pki_setup'|> | ||
|
||
include keystone::params | ||
|
||
File { | ||
ensure => present, | ||
owner => 'keystone', | ||
group => 'keystone', | ||
require => Package['keystone'], | ||
notify => Service['keystone'], | ||
} | ||
include ::keystone::params | ||
|
||
package { 'keystone': | ||
ensure => $package_ensure, | ||
|
@@ -253,10 +272,19 @@ | |
file { ['/etc/keystone', '/var/log/keystone', '/var/lib/keystone']: | ||
ensure => directory, | ||
mode => '0750', | ||
owner => 'keystone', | ||
group => 'keystone', | ||
require => Package['keystone'], | ||
notify => Service[$service_name], | ||
} | ||
|
||
file { '/etc/keystone/keystone.conf': | ||
ensure => present, | ||
mode => '0600', | ||
owner => 'keystone', | ||
group => 'keystone', | ||
require => Package['keystone'], | ||
notify => Service[$service_name], | ||
} | ||
|
||
if $bind_host { | ||
|
@@ -390,7 +418,7 @@ | |
user => 'keystone', | ||
refreshonly => true, | ||
creates => '/etc/keystone/ssl/private/signing_key.pem', | ||
notify => Service['keystone'], | ||
notify => Service[$service_name], | ||
subscribe => Package['keystone'], | ||
require => User['keystone'], | ||
} | ||
|
@@ -439,18 +467,20 @@ | |
$service_ensure = 'stopped' | ||
} | ||
|
||
service { 'keystone': | ||
ensure => $service_ensure, | ||
name => $::keystone::params::service_name, | ||
enable => $enabled, | ||
hasstatus => true, | ||
hasrestart => true, | ||
provider => $::keystone::params::service_provider, | ||
if $service_name == 'keystone' { | ||
service { 'keystone': | ||
ensure => $service_ensure, | ||
name => $::keystone::params::service_name, | ||
enable => $enabled, | ||
hasstatus => true, | ||
hasrestart => true, | ||
provider => $::keystone::params::service_provider, | ||
} | ||
} | ||
|
||
if $enabled { | ||
include keystone::db::sync | ||
Class['keystone::db::sync'] ~> Service['keystone'] | ||
include ::keystone::db::sync | ||
Class['::keystone::db::sync'] ~> Service[$service_name] | ||
} | ||
|
||
# Syslog configuration | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.