From 2a45a268fd07bbb7e505d172e44a06f107c75887 Mon Sep 17 00:00:00 2001 From: Marton Kiss Date: Fri, 19 Dec 2014 09:46:25 +0100 Subject: [PATCH] Enable oauth2 in openstackid configuration Add oauth2_enable and ssl_enable options to openstackid's server.php configuration file. Change-Id: Ib613ffeb550b682940e67273fbeaa8a101796f57 --- modules/openstackid/files/functions | 2 ++ modules/openstackid/manifests/init.pp | 15 +++++++++++++++ modules/openstackid/templates/server.php.erb | 5 +++++ 3 files changed, 22 insertions(+) create mode 100644 modules/openstackid/templates/server.php.erb diff --git a/modules/openstackid/files/functions b/modules/openstackid/files/functions index 7b6de71d41..f05bb203ce 100644 --- a/modules/openstackid/files/functions +++ b/modules/openstackid/files/functions @@ -55,6 +55,7 @@ function site_init { ln -sf /etc/openstackid/recaptcha.php $target_dir/app/config/packages/greggilbert/recaptcha/$LARAVEL_ENV/config.php ln -sf /etc/openstackid/database.php $target_dir/app/config/$LARAVEL_ENV/database.php ln -sf /etc/openstackid/log.php $target_dir/app/config/$LARAVEL_ENV/log.php + ln -sf /etc/openstackid/server.php $target_dir/app/config/$LARAVEL_ENV/server.php # convert app/storage into symlink and set permissions mv $target_dir/app/storage $SITE_ROOT/ chmod 02770 $SITE_ROOT/storage @@ -164,6 +165,7 @@ function site_update { ln -sf /etc/openstackid/recaptcha.php $target_dir/app/config/packages/greggilbert/recaptcha/$LARAVEL_ENV/config.php ln -sf /etc/openstackid/database.php $target_dir/app/config/$LARAVEL_ENV/database.php ln -sf /etc/openstackid/log.php $target_dir/app/config/$LARAVEL_ENV/log.php + ln -sf /etc/openstackid/server.php $target_dir/app/config/$LARAVEL_ENV/server.php # link shared app/storage directory rm -rf $target_dir/app/storage ln -s $SITE_ROOT/storage $target_dir/app diff --git a/modules/openstackid/manifests/init.pp b/modules/openstackid/manifests/init.pp index 4eda7943e1..7d7987ab1c 100644 --- a/modules/openstackid/manifests/init.pp +++ b/modules/openstackid/manifests/init.pp @@ -49,6 +49,8 @@ class openstackid ( $id_recaptcha_private_key = '', $id_recaptcha_template = '', $openstackid_release = 'latest', + $ssl_enable = 'true', + $oauth2_enable = 'true', ) { # php packages needed for openid server @@ -133,6 +135,17 @@ class openstackid ( ] } + file { '/etc/openstackid/server.php': + ensure => present, + content => template('openstackid/server.php.erb'), + owner => 'root', + group => 'www-data', + mode => '0640', + require => [ + File['/etc/openstackid'], + ] + } + $docroot_dirs = [ '/srv/openstackid' ] file { $docroot_dirs: @@ -216,6 +229,7 @@ class openstackid ( File['/etc/openstackid/database.php'], File['/etc/openstackid/log.php'], File['/etc/openstackid/environment.php'], + File['/etc/openstackid/server.php'], Package['curl'], Package[$php5_packages] ], } @@ -232,6 +246,7 @@ class openstackid ( File['/etc/openstackid/database.php'], File['/etc/openstackid/log.php'], File['/etc/openstackid/environment.php'], + File['/etc/openstackid/server.php'], Package[$php5_packages] ], } diff --git a/modules/openstackid/templates/server.php.erb b/modules/openstackid/templates/server.php.erb new file mode 100644 index 0000000000..d215caba82 --- /dev/null +++ b/modules/openstackid/templates/server.php.erb @@ -0,0 +1,5 @@ + <%= @ssl_enable %>, + 'OAuth2_Enable' => <%= @oauth2_enable %>, +); \ No newline at end of file