Retire this project
OpenDev is no longer running an openstackid instance and the puppet module isn't used by the folks running the current instance. We can go ahead and clean this repo up. Depends-On: https://review.opendev.org/c/openstack/project-config/+/818170 Change-Id: Ifab5aa7a839d8353aee9acacd5fd2eec525cc924
This commit is contained in:
parent
ca788b2a8b
commit
9998655fa9
|
@ -1,3 +0,0 @@
|
|||
Gemfile.lock
|
||||
.bundled_gems/
|
||||
.idea/
|
15
Gemfile
15
Gemfile
|
@ -1,15 +0,0 @@
|
|||
source 'https://rubygems.org'
|
||||
|
||||
if File.exists?('/home/zuul/src/git.openstack.org/openstack-infra/puppet-openstack_infra_spec_helper')
|
||||
gem_checkout_method = {:path => '/home/zuul/src/git.openstack.org/openstack-infra/puppet-openstack_infra_spec_helper'}
|
||||
else
|
||||
gem_checkout_method = {:git => 'https://git.openstack.org/openstack-infra/puppet-openstack_infra_spec_helper'}
|
||||
end
|
||||
gem_checkout_method[:require] = false
|
||||
|
||||
group :development, :test, :system_tests do
|
||||
gem 'puppet-openstack_infra_spec_helper',
|
||||
gem_checkout_method
|
||||
end
|
||||
|
||||
# vim:ft=ruby
|
202
LICENSE
202
LICENSE
|
@ -1,202 +0,0 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
44
README.md
44
README.md
|
@ -1,38 +1,10 @@
|
|||
# OpenStack OpenStackId
|
||||
This project is no longer maintained.
|
||||
|
||||
OpenStackId is a single-sign-on service integrated with
|
||||
openstack.org profile database. Provides openid and oauth2
|
||||
authentication for third party applications.
|
||||
The contents of this repository are still available in the Git
|
||||
source code management system. To see the contents of this
|
||||
repository before it reached its end of life, please check out the
|
||||
previous commit with "git checkout HEAD^1".
|
||||
|
||||
# Quick Start
|
||||
|
||||
class { 'openstackid':
|
||||
site_admin_password => 'adminpass',
|
||||
# openstackid application database
|
||||
id_mysql_host => 'localhost',
|
||||
id_mysql_user => 'openstackid',
|
||||
id_mysql_password => 'password',
|
||||
id_db_name => 'openstackid',
|
||||
# redis settings
|
||||
redis_port => '6378',
|
||||
redis_host => '127.0.0.1',
|
||||
redis_password => 'password',
|
||||
# recaptcha service keys
|
||||
id_recaptcha_public_key => $id_recaptcha_public_key,
|
||||
id_recaptcha_private_key => $id_recaptcha_private_key,
|
||||
id_recaptcha_template => $id_recaptcha_template,
|
||||
# logging
|
||||
id_log_error_to_email => $id_log_error_to_email,
|
||||
id_log_error_from_email => $id_log_error_from_email,
|
||||
# laravel environment settings
|
||||
id_environment => 'dev',
|
||||
# ssl configuration
|
||||
ssl_cert_file => "/etc/ssl/certs/${::fqdn}.pem",
|
||||
ssl_key_file => "/etc/ssl/private/${::fqdn}.key",
|
||||
ssl_chain_file => '/etc/ssl/certs/intermediate.pem',
|
||||
ssl_cert_file_contents => $ssl_cert_file_contents,
|
||||
ssl_key_file_contents => $ssl_key_file_contents,
|
||||
ssl_chain_file_contents => $ssl_chain_file_contents,
|
||||
# release to deploy
|
||||
openstackid_release => '1.0.2',
|
||||
}
|
||||
For any further questions, please email
|
||||
service-discuss@lists.opendev.org or join #opendev on
|
||||
OFTC.
|
||||
|
|
8
Rakefile
8
Rakefile
|
@ -1,8 +0,0 @@
|
|||
require 'rubygems'
|
||||
require 'puppetlabs_spec_helper/rake_tasks'
|
||||
require 'puppet-lint/tasks/puppet-lint'
|
||||
PuppetLint.configuration.fail_on_warnings = true
|
||||
PuppetLint.configuration.send('disable_80chars')
|
||||
PuppetLint.configuration.send('disable_autoloader_layout')
|
||||
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
|
||||
PuppetLint.configuration.send('disable_class_parameter_defaults')
|
11
bindep.txt
11
bindep.txt
|
@ -1,11 +0,0 @@
|
|||
# This is a cross-platform list tracking distribution packages needed by tests;
|
||||
# see http://docs.openstack.org/infra/bindep/ for additional information.
|
||||
|
||||
libxml2-devel [test platform:rpm]
|
||||
libxml2-dev [test platform:dpkg]
|
||||
libxslt-devel [test platform:rpm]
|
||||
libxslt1-dev [test platform:dpkg]
|
||||
ruby-devel [test platform:rpm]
|
||||
ruby-dev [test platform:dpkg]
|
||||
zlib1g-dev [test platform:dpkg]
|
||||
zlib-devel [test platform:rpm]
|
|
@ -1,39 +0,0 @@
|
|||
#!/bin/bash -e
|
||||
#
|
||||
# Site deployment tool
|
||||
#
|
||||
# Commands:
|
||||
# init @sitealias http://example.com/source.tar.gz
|
||||
# status @sitealias
|
||||
# update @sitelias http://example.com/source.tar.gz
|
||||
# rollback @sitealias
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
|
||||
TOP_DIR=$(cd $(dirname "$0") && pwd)
|
||||
source $TOP_DIR/functions
|
||||
|
||||
if [ ! -r $TOP_DIR/deployrc ]; then
|
||||
echo "ERROR: missing deployrc - did you grab more than just deploy.sh?"
|
||||
exit 1
|
||||
fi
|
||||
source $TOP_DIR/deployrc
|
||||
|
||||
command="${1}"
|
||||
case $command in
|
||||
init)
|
||||
site_init ${2}
|
||||
;;
|
||||
status)
|
||||
site_status ${2}
|
||||
;;
|
||||
update)
|
||||
site_update ${2}
|
||||
;;
|
||||
*)
|
||||
print_help
|
||||
exit 1
|
||||
;;
|
||||
esac
|
|
@ -1,8 +0,0 @@
|
|||
CONF_DIR=$TOP_DIR
|
||||
FILE_OWNER=root
|
||||
FILE_GROUP=www-data
|
||||
|
||||
# allow local overrides of env variables
|
||||
if [ -f $TOP_DIR/localrc ]; then
|
||||
. $TOP_DIR/localrc
|
||||
fi
|
293
files/functions
293
files/functions
|
@ -1,293 +0,0 @@
|
|||
function print_help {
|
||||
echo "Usage: `basename $0` command [options]"
|
||||
echo ""
|
||||
echo "Commands:"
|
||||
echo " status [site] return status information about site configurations"
|
||||
echo " init <site> initialize site structure"
|
||||
echo " update <site> update to new version"
|
||||
echo ""
|
||||
}
|
||||
|
||||
function clear_redis_cache {
|
||||
echo "running redis FLUSHDB ..."
|
||||
echo "FLUSHDB" | redis-cli -h 127.0.0.1 -p $REDIS_PORT -a "$REDIS_PASSWORD"
|
||||
echo "running redis FLUSHALL ..."
|
||||
echo "FLUSHALL" | redis-cli -h 127.0.0.1 -p $REDIS_PORT -a "$REDIS_PASSWORD"
|
||||
}
|
||||
|
||||
function clear_orm_cache {
|
||||
echo "clearing doctrine metadata"
|
||||
php artisan doctrine:clear:metadata:cache
|
||||
echo "clearing doctrine query cache"
|
||||
php artisan doctrine:clear:query:cache
|
||||
echo "clearing doctrine result cache"
|
||||
php artisan doctrine:clear:result:cache
|
||||
echo "generating doctrine proxies"
|
||||
php artisan doctrine:generate:proxies
|
||||
}
|
||||
|
||||
function clear_laravel_cache {
|
||||
php artisan route:clear
|
||||
php artisan route:cache
|
||||
php artisan config:cache
|
||||
php artisan view:clear
|
||||
php artisan view:cache
|
||||
}
|
||||
|
||||
function check_laravel_storage_structure {
|
||||
# check for new storage structure ( LV 5.x)
|
||||
if [[ ! -d $SITE_ROOT/storage/framework ]]; then
|
||||
mkdir -p $SITE_ROOT/storage/framework
|
||||
mkdir -p $SITE_ROOT/storage/framework/cache
|
||||
mkdir -p $SITE_ROOT/storage/framework/views
|
||||
mkdir -p $SITE_ROOT/storage/framework/sessions
|
||||
fi
|
||||
if [[ ! -d $SITE_ROOT/storage/app ]]; then
|
||||
mkdir -p $SITE_ROOT/storage/app
|
||||
mkdir -p $SITE_ROOT/storage/app/public
|
||||
fi
|
||||
if [[ ! -d $SITE_ROOT/storage/logs ]]; then
|
||||
mkdir -p $SITE_ROOT/storage/logs
|
||||
fi
|
||||
}
|
||||
|
||||
function set_laravel_storage_permissions {
|
||||
chown -R $FILE_OWNER:$FILE_GROUP $SITE_ROOT/storage
|
||||
chmod 02770 $SITE_ROOT/storage;
|
||||
find $SITE_ROOT/storage/ -type d -exec chmod 0775 {} \;
|
||||
find $SITE_ROOT/storage/ -type f -exec chmod 0664 {} \;
|
||||
# set html purifier cache permission
|
||||
chmod 0770 vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer
|
||||
}
|
||||
|
||||
function set_python_venv {
|
||||
chmod 0775 $target_dir/app/Console/Commands/SpammerProcess
|
||||
chown :www-data $target_dir/app/Console/Commands/SpammerProcess
|
||||
cd $target_dir/app/Console/Commands/SpammerProcess
|
||||
python3 -m venv env
|
||||
source env/bin/activate
|
||||
pip install "pip==20.3.4"
|
||||
pip install --upgrade setuptools
|
||||
pip install wheel
|
||||
pip install -r requirements.txt
|
||||
deactivate
|
||||
cd $target_dir
|
||||
}
|
||||
|
||||
function site_init {
|
||||
if [ ! $1 ]; then
|
||||
echo "ERROR: site parameter mandatory"
|
||||
exit 1
|
||||
fi
|
||||
CONF_PATH="$CONF_DIR/conf.d/$1.conf"
|
||||
if [ ! -f $CONF_PATH ]; then
|
||||
echo "Site configuration not found: " $1
|
||||
exit 1
|
||||
fi
|
||||
source $CONF_PATH
|
||||
if [ -f "$SITE_ROOT/w/public/index.php" ]; then
|
||||
echo "Cannot override an existing deployment: $SITE_ROOT/w"
|
||||
exit 1
|
||||
fi
|
||||
# cleanup previous broken deployment
|
||||
rm -rf $SITE_ROOT/slot0
|
||||
# create directory structure
|
||||
for dir in slot0 slot1; do
|
||||
mkdir -p $SITE_ROOT/$dir
|
||||
chown $FILE_OWNER:$FILE_GROUP $SITE_ROOT/$dir
|
||||
done
|
||||
target_dir="$SITE_ROOT/slot0"
|
||||
# fetch catalog and write actual version
|
||||
fetch_catalog
|
||||
RELEASE_VERSION=`catalog_get_version`
|
||||
echo $RELEASE_VERSION > $SITE_ROOT/slot0/release
|
||||
# fetch and extract release tarball
|
||||
umask 0027
|
||||
if [[ $SOURCE_TARBALL == http* ]]; then
|
||||
echo "Download from http!"
|
||||
curl $SOURCE_TARBALL | tar -xzv -C $target_dir --strip-components 1 --no-same-permissions
|
||||
else
|
||||
echo "extract from local file system"
|
||||
if [ ! -f $SOURCE_TARBALL ]; then
|
||||
echo "Source tarball not found: $SOURCE_TARBALL"
|
||||
exit 1
|
||||
fi
|
||||
tar -xzvf $SOURCE_TARBALL -C $target_dir --strip-components 1 --no-same-permissions
|
||||
fi
|
||||
chown -R $FILE_OWNER:$FILE_GROUP $target_dir
|
||||
umask 0022
|
||||
# link configuration files managed by puppet
|
||||
|
||||
ln -sf /etc/openstackid/.env $target_dir/.env
|
||||
|
||||
# convert app/storage into symlink and set permissions
|
||||
mv $target_dir/storage $SITE_ROOT/
|
||||
|
||||
# link shared app/storage directory
|
||||
rm -rf $target_dir/storage
|
||||
ln -s $SITE_ROOT/storage $target_dir
|
||||
check_laravel_storage_structure
|
||||
|
||||
# set artisan execution permissions
|
||||
cd $target_dir && chmod 0770 artisan
|
||||
|
||||
clear_redis_cache
|
||||
|
||||
clear_orm_cache
|
||||
|
||||
clear_laravel_cache
|
||||
|
||||
echo "running db migrations";
|
||||
php artisan doctrine:migrations:migrate --connection=model --force --env=$LARAVEL_ENV
|
||||
|
||||
if [[ $USE_DB_SEEDING -eq 1 ]]; then
|
||||
php artisan db:seed --env=$LARAVEL_ENV --force
|
||||
fi
|
||||
|
||||
sudo npm install
|
||||
sudo npm run build
|
||||
|
||||
set_laravel_storage_permissions
|
||||
|
||||
set_python_venv
|
||||
|
||||
# activate site
|
||||
rm -rf $SITE_ROOT/w
|
||||
ln -s $SITE_ROOT/slot0 $SITE_ROOT/w
|
||||
|
||||
echo "Restarting laravel queue worker ..."
|
||||
php artisan queue:restart
|
||||
|
||||
echo "supervisorctl reload"
|
||||
supervisorctl reload
|
||||
|
||||
}
|
||||
|
||||
function site_status {
|
||||
if [ ! $1 ]; then
|
||||
echo "ERROR: site parameter mandatory"
|
||||
exit 1
|
||||
fi
|
||||
CONF_PATH="$CONF_DIR/conf.d/$1.conf"
|
||||
if [ ! -f $CONF_PATH ]; then
|
||||
echo "Site configuration not found: $1"
|
||||
exit 0
|
||||
fi
|
||||
source $CONF_PATH
|
||||
if [ ! -f "$SITE_ROOT/w/public/index.php" ]; then
|
||||
if [ -d "$SITE_ROOT/slot0" ]; then
|
||||
echo "PENDING"
|
||||
else
|
||||
echo "N/A"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
fetch_catalog
|
||||
REMOTE_VERSION=`catalog_get_version`
|
||||
RELEASE_VERSION=$(head -n 1 $SITE_ROOT/w/release)
|
||||
if [ "$REMOTE_VERSION" == "$RELEASE_VERSION" ]; then
|
||||
echo "INSTALLED [$RELEASE_VERSION]"
|
||||
else
|
||||
echo "UPDATE AVAILABLE [$RELEASE_VERSION-$REMOTE_VERSION]"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function fetch_catalog {
|
||||
curl --silent $SOURCE_ROOT > $SITE_ROOT/releases.lst
|
||||
grep -q "^<!DOCTYPE HTML PUBLIC" $SITE_ROOT/releases.lst
|
||||
}
|
||||
|
||||
function catalog_get_version {
|
||||
RAW_LINE=`cat $SITE_ROOT/releases.lst | grep "$RELEASE_NAME" | sed "s/<[^>]\+>//g" | sed -r "s/^$RELEASE_NAME//"`
|
||||
RELEASE_DATE=`echo $RAW_LINE | awk '{ print $1 " " $2}'`
|
||||
echo $RELEASE_DATE
|
||||
}
|
||||
|
||||
function site_update {
|
||||
if [ ! $1 ]; then
|
||||
echo "ERROR: missing site parameter"
|
||||
exit 1
|
||||
fi
|
||||
CONF_PATH="$CONF_DIR/conf.d/$1.conf"
|
||||
if [ ! -f $CONF_PATH ]; then
|
||||
echo "Site configuration not found: $1"
|
||||
exit 0
|
||||
fi
|
||||
source $CONF_PATH
|
||||
SITE_LINK=`readlink -f $SITE_ROOT/w`
|
||||
ACTIVE_SLOT=`basename $SITE_LINK`
|
||||
case $ACTIVE_SLOT in
|
||||
slot0)
|
||||
TARGET_SLOT='slot1'
|
||||
;;
|
||||
slot1)
|
||||
TARGET_SLOT='slot0'
|
||||
;;
|
||||
*)
|
||||
echo "Invalid active slot"
|
||||
exit 1
|
||||
esac
|
||||
echo "Target slot: $TARGET_SLOT"
|
||||
target_dir="$SITE_ROOT/$TARGET_SLOT"
|
||||
rm -rf $target_dir
|
||||
mkdir $target_dir
|
||||
# fetch catalog and write actual version
|
||||
fetch_catalog
|
||||
RELEASE_VERSION=`catalog_get_version`
|
||||
echo $RELEASE_VERSION > $target_dir/release
|
||||
# fetch and extract release tarball
|
||||
umask 0027
|
||||
if [[ $SOURCE_TARBALL == http* ]]; then
|
||||
echo "Download from http!"
|
||||
curl $SOURCE_TARBALL | tar -xzv -C $target_dir --strip-components 1 --no-same-permissions
|
||||
else
|
||||
echo "extract from local file system"
|
||||
if [ ! -f $SOURCE_TARBALL ]; then
|
||||
echo "Source tarball not found: $SOURCE_TARBALL"
|
||||
exit 1
|
||||
fi
|
||||
tar -xzvf $SOURCE_TARBALL -C $target_dir --strip-components 1 --no-same-permissions
|
||||
fi
|
||||
|
||||
chown -R $FILE_OWNER:$FILE_GROUP $target_dir
|
||||
umask 0022
|
||||
|
||||
# link configuration files managed by puppet
|
||||
ln -sf /etc/openstackid/.env $target_dir/.env
|
||||
# link shared app/storage directory
|
||||
rm -rf $target_dir/storage
|
||||
ln -s $SITE_ROOT/storage $target_dir
|
||||
check_laravel_storage_structure
|
||||
# set artisan exec permissions
|
||||
cd $target_dir
|
||||
chmod 0770 artisan
|
||||
|
||||
clear_redis_cache
|
||||
|
||||
clear_orm_cache
|
||||
|
||||
clear_laravel_cache
|
||||
|
||||
echo "running db migrations"
|
||||
php artisan doctrine:migrations:migrate --connection=model --force --env=$LARAVEL_ENV
|
||||
|
||||
sudo npm install
|
||||
sudo npm run build
|
||||
|
||||
set_laravel_storage_permissions
|
||||
|
||||
set_python_venv
|
||||
|
||||
# activate site
|
||||
rm -rf $SITE_ROOT/w
|
||||
ln -s $target_dir $SITE_ROOT/w
|
||||
# to reset op cache
|
||||
/usr/sbin/service $PHP_SERVICE_NAME restart
|
||||
|
||||
echo "Restarting laravel queue worker ..."
|
||||
php artisan queue:restart
|
||||
|
||||
echo "supervisorctl reload"
|
||||
supervisorctl reload
|
||||
}
|
|
@ -1,129 +0,0 @@
|
|||
;;;;;;;;;;;;;;;;;;;;;
|
||||
; FPM Configuration ;
|
||||
;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
; All relative paths in this configuration file are relative to PHP's install
|
||||
; prefix (/usr). This prefix can be dynamically changed by using the
|
||||
; '-p' argument from the command line.
|
||||
|
||||
; Include one or more files. If glob(3) exists, it is used to include a bunch of
|
||||
; files from a glob(3) pattern. This directive can be used everywhere in the
|
||||
; file.
|
||||
; Relative path can also be used. They will be prefixed by:
|
||||
; - the global prefix if it's been set (-p argument)
|
||||
; - /usr otherwise
|
||||
;include=/etc/php5/fpm/*.conf
|
||||
|
||||
;;;;;;;;;;;;;;;;;;
|
||||
; Global Options ;
|
||||
;;;;;;;;;;;;;;;;;;
|
||||
|
||||
[global]
|
||||
; Pid file
|
||||
; Note: the default prefix is /var
|
||||
; Default Value: none
|
||||
pid = /var/run/php5-fpm.pid
|
||||
|
||||
; Error log file
|
||||
; If it's set to "syslog", log is sent to syslogd instead of being written
|
||||
; in a local file.
|
||||
; Note: the default prefix is /var
|
||||
; Default Value: log/php-fpm.log
|
||||
error_log = /var/log/php5-fpm.log
|
||||
|
||||
; syslog_facility is used to specify what type of program is logging the
|
||||
; message. This lets syslogd specify that messages from different facilities
|
||||
; will be handled differently.
|
||||
; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON)
|
||||
; Default Value: daemon
|
||||
;syslog.facility = daemon
|
||||
|
||||
; syslog_ident is prepended to every message. If you have multiple FPM
|
||||
; instances running on the same server, you can change the default value
|
||||
; which must suit common needs.
|
||||
; Default Value: php-fpm
|
||||
;syslog.ident = php-fpm
|
||||
|
||||
; Log level
|
||||
; Possible Values: alert, error, warning, notice, debug
|
||||
; Default Value: notice
|
||||
;log_level = notice
|
||||
|
||||
; If this number of child processes exit with SIGSEGV or SIGBUS within the time
|
||||
; interval set by emergency_restart_interval then FPM will restart. A value
|
||||
; of '0' means 'Off'.
|
||||
; Default Value: 0
|
||||
emergency_restart_threshold = 10
|
||||
|
||||
; Interval of time used by emergency_restart_interval to determine when
|
||||
; a graceful restart will be initiated. This can be useful to work around
|
||||
; accidental corruptions in an accelerator's shared memory.
|
||||
; Available Units: s(econds), m(inutes), h(ours), or d(ays)
|
||||
; Default Unit: seconds
|
||||
; Default Value: 0
|
||||
emergency_restart_interval = 1m
|
||||
|
||||
; Time limit for child processes to wait for a reaction on signals from master.
|
||||
; Available units: s(econds), m(inutes), h(ours), or d(ays)
|
||||
; Default Unit: seconds
|
||||
; Default Value: 0
|
||||
process_control_timeout = 10s
|
||||
|
||||
; The maximum number of processes FPM will fork. This has been design to control
|
||||
; the global number of processes when using dynamic PM within a lot of pools.
|
||||
; Use it with caution.
|
||||
; Note: A value of 0 indicates no limit
|
||||
; Default Value: 0
|
||||
; process.max = 128
|
||||
|
||||
; Specify the nice(2) priority to apply to the master process (only if set)
|
||||
; The value can vary from -19 (highest priority) to 20 (lower priority)
|
||||
; Note: - It will only work if the FPM master process is launched as root
|
||||
; - The pool process will inherit the master process priority
|
||||
; unless it specified otherwise
|
||||
; Default Value: no set
|
||||
; process.priority = -19
|
||||
|
||||
; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
|
||||
; Default Value: yes
|
||||
;daemonize = yes
|
||||
|
||||
; Set open file descriptor rlimit for the master process.
|
||||
; Default Value: system defined value
|
||||
;rlimit_files = 1024
|
||||
|
||||
; Set max core size rlimit for the master process.
|
||||
; Possible Values: 'unlimited' or an integer greater or equal to 0
|
||||
; Default Value: system defined value
|
||||
;rlimit_core = 0
|
||||
|
||||
; Specify the event mechanism FPM will use. The following is available:
|
||||
; - select (any POSIX os)
|
||||
; - poll (any POSIX os)
|
||||
; - epoll (linux >= 2.5.44)
|
||||
; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0)
|
||||
; - /dev/poll (Solaris >= 7)
|
||||
; - port (Solaris >= 10)
|
||||
; Default Value: not set (auto detection)
|
||||
;events.mechanism = epoll
|
||||
|
||||
; When FPM is build with systemd integration, specify the interval,
|
||||
; in second, between health report notification to systemd.
|
||||
; Set to 0 to disable.
|
||||
; Available Units: s(econds), m(inutes), h(ours)
|
||||
; Default Unit: seconds
|
||||
; Default value: 10
|
||||
;systemd_interval = 10
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;
|
||||
; Pool Definitions ;
|
||||
;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
; Multiple pools of child processes may be started with different listening
|
||||
; ports and different management options. The name of the pool will be
|
||||
; used in logs and stats. There is no limitation on the number of pools which
|
||||
; FPM can handle. Your system will tell you anyway :)
|
||||
|
||||
; To configure the pools it is recommended to have one .conf file per
|
||||
; pool in the following directory:
|
||||
include=/etc/php5/fpm/pool.d/*.conf
|
1930
files/php5/php.ini
1930
files/php5/php.ini
File diff suppressed because it is too large
Load Diff
|
@ -1,33 +0,0 @@
|
|||
[www]
|
||||
|
||||
user = www-data
|
||||
group = www-data
|
||||
listen = 127.0.0.1:9000
|
||||
|
||||
listen.owner = www-data
|
||||
listen.group = www-data
|
||||
|
||||
pm = dynamic
|
||||
# the maximum number of children that can be alive at the same time.
|
||||
pm.max_children = 800
|
||||
# the number of children created on startup.
|
||||
# pm.start_servers = min_spare_servers + (max_spare_servers - min_spare_servers) / 2
|
||||
pm.start_servers = 300
|
||||
# the minimum number of children in 'idle'
|
||||
# state (waiting to process). If the number
|
||||
# of 'idle' processes is less than this
|
||||
# number then some children will be created.
|
||||
pm.min_spare_servers = 256
|
||||
# the maximum number of children in 'idle'
|
||||
# state (waiting to process). If the number
|
||||
# of 'idle' processes is greater than this
|
||||
# number then some children will be killed.
|
||||
pm.max_spare_servers = 600
|
||||
pm.max_requests = 5000
|
||||
|
||||
|
||||
listen.backlog = -1
|
||||
request_terminate_timeout = 300s
|
||||
|
||||
chdir = /
|
||||
|
|
@ -1,125 +0,0 @@
|
|||
;;;;;;;;;;;;;;;;;;;;;
|
||||
; FPM Configuration ;
|
||||
;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
; All relative paths in this configuration file are relative to PHP's install
|
||||
; prefix (/usr). This prefix can be dynamically changed by using the
|
||||
; '-p' argument from the command line.
|
||||
|
||||
;;;;;;;;;;;;;;;;;;
|
||||
; Global Options ;
|
||||
;;;;;;;;;;;;;;;;;;
|
||||
|
||||
[global]
|
||||
; Pid file
|
||||
; Note: the default prefix is /var
|
||||
; Default Value: none
|
||||
pid = /run/php/php7.2-fpm.pid
|
||||
|
||||
; Error log file
|
||||
; If it's set to "syslog", log is sent to syslogd instead of being written
|
||||
; into a local file.
|
||||
; Note: the default prefix is /var
|
||||
; Default Value: log/php-fpm.log
|
||||
error_log = /var/log/php7.2-fpm.log
|
||||
|
||||
; syslog_facility is used to specify what type of program is logging the
|
||||
; message. This lets syslogd specify that messages from different facilities
|
||||
; will be handled differently.
|
||||
; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON)
|
||||
; Default Value: daemon
|
||||
;syslog.facility = daemon
|
||||
|
||||
; syslog_ident is prepended to every message. If you have multiple FPM
|
||||
; instances running on the same server, you can change the default value
|
||||
; which must suit common needs.
|
||||
; Default Value: php-fpm
|
||||
;syslog.ident = php-fpm
|
||||
|
||||
; Log level
|
||||
; Possible Values: alert, error, warning, notice, debug
|
||||
; Default Value: notice
|
||||
;log_level = notice
|
||||
|
||||
; If this number of child processes exit with SIGSEGV or SIGBUS within the time
|
||||
; interval set by emergency_restart_interval then FPM will restart. A value
|
||||
; of '0' means 'Off'.
|
||||
; Default Value: 0
|
||||
;emergency_restart_threshold = 0
|
||||
|
||||
; Interval of time used by emergency_restart_interval to determine when
|
||||
; a graceful restart will be initiated. This can be useful to work around
|
||||
; accidental corruptions in an accelerator's shared memory.
|
||||
; Available Units: s(econds), m(inutes), h(ours), or d(ays)
|
||||
; Default Unit: seconds
|
||||
; Default Value: 0
|
||||
;emergency_restart_interval = 0
|
||||
|
||||
; Time limit for child processes to wait for a reaction on signals from master.
|
||||
; Available units: s(econds), m(inutes), h(ours), or d(ays)
|
||||
; Default Unit: seconds
|
||||
; Default Value: 0
|
||||
;process_control_timeout = 0
|
||||
|
||||
; The maximum number of processes FPM will fork. This has been designed to control
|
||||
; the global number of processes when using dynamic PM within a lot of pools.
|
||||
; Use it with caution.
|
||||
; Note: A value of 0 indicates no limit
|
||||
; Default Value: 0
|
||||
; process.max = 128
|
||||
|
||||
; Specify the nice(2) priority to apply to the master process (only if set)
|
||||
; The value can vary from -19 (highest priority) to 20 (lowest priority)
|
||||
; Note: - It will only work if the FPM master process is launched as root
|
||||
; - The pool process will inherit the master process priority
|
||||
; unless specified otherwise
|
||||
; Default Value: no set
|
||||
; process.priority = -19
|
||||
|
||||
; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
|
||||
; Default Value: yes
|
||||
;daemonize = yes
|
||||
|
||||
; Set open file descriptor rlimit for the master process.
|
||||
; Default Value: system defined value
|
||||
;rlimit_files = 1024
|
||||
|
||||
; Set max core size rlimit for the master process.
|
||||
; Possible Values: 'unlimited' or an integer greater or equal to 0
|
||||
; Default Value: system defined value
|
||||
;rlimit_core = 0
|
||||
|
||||
; Specify the event mechanism FPM will use. The following is available:
|
||||
; - select (any POSIX os)
|
||||
; - poll (any POSIX os)
|
||||
; - epoll (linux >= 2.5.44)
|
||||
; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0)
|
||||
; - /dev/poll (Solaris >= 7)
|
||||
; - port (Solaris >= 10)
|
||||
; Default Value: not set (auto detection)
|
||||
;events.mechanism = epoll
|
||||
|
||||
; When FPM is built with systemd integration, specify the interval,
|
||||
; in seconds, between health report notification to systemd.
|
||||
; Set to 0 to disable.
|
||||
; Available Units: s(econds), m(inutes), h(ours)
|
||||
; Default Unit: seconds
|
||||
; Default value: 10
|
||||
;systemd_interval = 10
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;
|
||||
; Pool Definitions ;
|
||||
;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
; Multiple pools of child processes may be started with different listening
|
||||
; ports and different management options. The name of the pool will be
|
||||
; used in logs and stats. There is no limitation on the number of pools which
|
||||
; FPM can handle. Your system will tell you anyway :)
|
||||
|
||||
; Include one or more files. If glob(3) exists, it is used to include a bunch of
|
||||
; files from a glob(3) pattern. This directive can be used everywhere in the
|
||||
; file.
|
||||
; Relative path can also be used. They will be prefixed by:
|
||||
; - the global prefix if it's been set (-p argument)
|
||||
; - /usr otherwise
|
||||
include=/etc/php/7.2/fpm/pool.d/*.conf
|
1920
files/php7/php.ini
1920
files/php7/php.ini
File diff suppressed because it is too large
Load Diff
|
@ -1,22 +0,0 @@
|
|||
[www]
|
||||
|
||||
; linux socket
|
||||
; listen = /var/run/php7.2-fpm.sock
|
||||
; TCP socket
|
||||
listen = 127.0.0.1:9000
|
||||
|
||||
user = www-data
|
||||
group = www-data
|
||||
listen.owner = www-data
|
||||
listen.group = www-data
|
||||
|
||||
; request_slowlog_timeout = 5s
|
||||
; slowlog = /var/log/php-fpm/slowlog-site.log
|
||||
|
||||
; child processes
|
||||
pm = dynamic
|
||||
pm.max_children = 400
|
||||
pm.start_servers = 10
|
||||
pm.min_spare_servers = 5
|
||||
pm.max_spare_servers = 10
|
||||
pm.max_requests = 500
|
|
@ -1,53 +0,0 @@
|
|||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
# == Define: deploy
|
||||
#
|
||||
# deployment tool for laravel framework/php site management
|
||||
#
|
||||
define openstackid::deploy (
|
||||
) {
|
||||
$deploy_dirs = [ '/opt/deploy', '/opt/deploy/conf.d' ]
|
||||
|
||||
file { $deploy_dirs:
|
||||
ensure => directory,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
}
|
||||
|
||||
file { '/opt/deploy/deploy.sh':
|
||||
source => 'puppet:///modules/openstackid/deploy.sh',
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
require => File[$deploy_dirs],
|
||||
}
|
||||
|
||||
file { '/opt/deploy/functions':
|
||||
source => 'puppet:///modules/openstackid/functions',
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
require => File[$deploy_dirs],
|
||||
}
|
||||
|
||||
file { '/opt/deploy/deployrc':
|
||||
source => 'puppet:///modules/openstackid/deployrc',
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
require => File[$deploy_dirs],
|
||||
}
|
||||
}
|
|
@ -1,672 +0,0 @@
|
|||
# Copyright 2013 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
# openstackid idp(sso-openid)
|
||||
#
|
||||
# == Class: openstackid
|
||||
#
|
||||
class openstackid (
|
||||
$git_source_repo = 'https://git.openstack.org/openstack-infra/openstackid',
|
||||
$site_admin_password = '',
|
||||
$id_mysql_host = '',
|
||||
$id_mysql_user = '',
|
||||
$id_mysql_password = '',
|
||||
$id_db_name = '',
|
||||
$redis_port = '',
|
||||
$redis_host = '',
|
||||
$redis_db = 0,
|
||||
$redis_password = '',
|
||||
$vhost_name = $::fqdn,
|
||||
$robots_txt_source = '',
|
||||
$serveradmin = "webmaster@${::fqdn}",
|
||||
$canonicalweburl = "https://${::fqdn}/",
|
||||
$ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem',
|
||||
$ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key',
|
||||
$ssl_chain_file = '',
|
||||
$ssl_cert_file_contents = '', # If left empty puppet will not create file.
|
||||
$ssl_key_file_contents = '', # If left empty puppet will not create file.
|
||||
$ssl_chain_file_contents = '', # If left empty puppet will not create file.
|
||||
$httpd_acceptorthreads = '',
|
||||
$id_log_error_to_email = '',
|
||||
$id_log_error_from_email = '',
|
||||
$id_environment = 'dev',
|
||||
$id_hostname = $::hostname,
|
||||
$id_recaptcha_public_key = '',
|
||||
$id_recaptcha_private_key = '',
|
||||
$id_recaptcha_template = '',
|
||||
$openstackid_release = 'latest',
|
||||
$ssl_enable = true,
|
||||
$oauth2_enable = true,
|
||||
$app_url = '',
|
||||
$app_key = '',
|
||||
$app_version = '',
|
||||
$app_timezone = 'UTC',
|
||||
$email_driver = 'mail',
|
||||
$email_send_grid_api_key = '',
|
||||
$email_smtp_server = 'smtp.mailgun.org',
|
||||
$email_smtp_server_port = 587,
|
||||
$email_smtp_server_user = '',
|
||||
$email_smtp_server_password = '',
|
||||
$use_db_seeding = false,
|
||||
$projectroot = '/srv/openstackid/w',
|
||||
$docroot = '/srv/openstackid/w/public',
|
||||
$laravel_version = 4,
|
||||
$app_log_level = 'error',
|
||||
$app_log_email_level = 'error',
|
||||
$db_log_enabled = false,
|
||||
$banning_enabled = true,
|
||||
$app_debug = false,
|
||||
$app_locale = 'en',
|
||||
$curl_verify_ssl_cert = true,
|
||||
$curl_allow_redirect = false,
|
||||
$curl_timeout = 60,
|
||||
$assets_base_url = 'https://www.openstack.org/',
|
||||
$cache_driver = 'redis',
|
||||
$session_driver = 'redis',
|
||||
# on minutes
|
||||
$session_lifetime = 1440,
|
||||
$session_encrypt = true,
|
||||
$session_expire_on_close = false,
|
||||
$session_cookie_name = 'openstackid_s',
|
||||
$session_cookie_path = '/',
|
||||
$session_cookie_domain = $::fqdn,
|
||||
$session_cookie_secure = true,
|
||||
$session_cookie_http_only = true,
|
||||
$mysql_ssl_enabled = false,
|
||||
$mysql_ssl_ca_file = '/etc/mysql-client-ssl/ca-cert.pem',
|
||||
$mysql_ssl_ca_file_contents = '',
|
||||
$mysql_ssl_client_key_file = '/etc/mysql-client-ssl/client-key.pem',
|
||||
$mysql_ssl_client_key_file_contents = '',
|
||||
$mysql_ssl_client_cert_file = '/etc/mysql-client-ssl/client-cert.pem',
|
||||
$mysql_ssl_client_cert_file_contents = '',
|
||||
$mysql_ssl_cypher = 'DHE-RSA-AES256-SHA',
|
||||
$php_version = 5,
|
||||
$queue_driver = 'redis',
|
||||
$queue_conn = 'openstackid',
|
||||
$mail_from_email = 'no-reply@openstack.org',
|
||||
$mail_from_name = 'no-reply@openstack.org',
|
||||
$support_email = 'support@openstack.org',
|
||||
$user_spam_processor_to = '',
|
||||
$message_broker_exchange_name = 'message-broker',
|
||||
$message_broker_host = '',
|
||||
$message_broker_port = 5672,
|
||||
$message_broker_vhost = 'databus',
|
||||
$message_broker_login = '',
|
||||
$message_broker_password = '',
|
||||
$message_broker_ssl_enabled = false,
|
||||
$message_broker_ssl_ca_file = '/etc/rabbitmq-client-ssl/ca-cert.pem',
|
||||
$message_broker_ssl_ca_file_contents = '',
|
||||
$message_broker_ssl_client_cert_file = '/etc/rabbitmq-client-ssl/client-cert.pem',
|
||||
$message_broker_ssl_client_cert_file_contents = '',
|
||||
$message_broker_ssl_client_key_file = '/etc/rabbitmq-client-ssl/client-key.pem',
|
||||
$message_broker_ssl_client_key_file_contents = '',
|
||||
$message_broker_enabled = false,
|
||||
$cloud_storage_base_url = '',
|
||||
$cloud_storage_auth_url = '',
|
||||
$cloud_storage_app_credential_id = '',
|
||||
$cloud_storage_app_credential_secret = '',
|
||||
$cloud_storage_project_name = '',
|
||||
$cloud_storage_region = '',
|
||||
$cloud_storage_container = '',
|
||||
) {
|
||||
|
||||
# php5 packages needed for openid server
|
||||
$php5_packages = [
|
||||
'php5-common',
|
||||
'php5-curl',
|
||||
'php5-cli',
|
||||
'php5-mcrypt',
|
||||
'php5-mysqlnd',
|
||||
'php5-fpm',
|
||||
'php5-json',
|
||||
'php5-gmp',
|
||||
]
|
||||
|
||||
# php7 packages needed for openid server
|
||||
|
||||
$php7_packages = [
|
||||
'php7.2-common',
|
||||
'php7.2-curl',
|
||||
'php7.2-cli',
|
||||
'php7.2-mysqlnd',
|
||||
'php7.2-fpm',
|
||||
'php7.2-json',
|
||||
'php7.2-gmp',
|
||||
'php7.2-xml',
|
||||
'php7.2-zip',
|
||||
'php7.2-mbstring',
|
||||
]
|
||||
|
||||
if($php_version == 7 ){
|
||||
$php_service_name = 'php7.2-fpm'
|
||||
$php_packages = $php7_packages
|
||||
}
|
||||
else{
|
||||
$php_service_name = 'php5-fpm'
|
||||
$php_packages = $php5_packages
|
||||
}
|
||||
|
||||
$main_packages = [
|
||||
'curl',
|
||||
'wget',
|
||||
'build-essential',
|
||||
'software-properties-common',
|
||||
'python-software-properties',
|
||||
'supervisor',
|
||||
'python3-pip',
|
||||
'python3-dev',
|
||||
'libssl-dev',
|
||||
'libffi-dev',
|
||||
'python3-setuptools',
|
||||
'python3-venv',
|
||||
'libmysqlclient-dev',
|
||||
]
|
||||
|
||||
package { $main_packages:
|
||||
ensure => present,
|
||||
}
|
||||
|
||||
if ($php_version == 7) {
|
||||
|
||||
if ($::lsbdistcodename == 'xenial') {
|
||||
|
||||
apt::ppa { 'ppa:ondrej/php':
|
||||
require => [
|
||||
Package[$main_packages],
|
||||
],
|
||||
notify => Exec['apt_update'],
|
||||
}
|
||||
|
||||
$php7_requires = [
|
||||
Class['apt::update'],
|
||||
Apt::Ppa['ppa:ondrej/php'],
|
||||
]
|
||||
|
||||
}
|
||||
else{
|
||||
|
||||
$php7_requires = [
|
||||
Class['apt::update'],
|
||||
Package[$main_packages],
|
||||
]
|
||||
}
|
||||
|
||||
package { $php7_packages:
|
||||
ensure => present,
|
||||
provider => 'apt',
|
||||
require => [
|
||||
$php7_requires,
|
||||
]
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
package { $php5_packages:
|
||||
ensure => present,
|
||||
require => [
|
||||
Package[$main_packages],
|
||||
],
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($php_version == 7) {
|
||||
|
||||
# php7-fpm configuration
|
||||
|
||||
file { '/etc/php/7.2/fpm/php-fpm.conf':
|
||||
ensure => present,
|
||||
owner => 'root',
|
||||
group => 'www-data',
|
||||
mode => '0640',
|
||||
source => 'puppet:///modules/openstackid/php7/php-fpm.conf',
|
||||
require => [
|
||||
Package[$php_service_name],
|
||||
],
|
||||
notify => Service[$php_service_name],
|
||||
}
|
||||
|
||||
file { '/etc/php/7.2/fpm/php.ini':
|
||||
ensure => present,
|
||||
owner => 'root',
|
||||
group => 'www-data',
|
||||
mode => '0640',
|
||||
source => 'puppet:///modules/openstackid/php7/php.ini',
|
||||
require => [
|
||||
Package[$php_service_name],
|
||||
],
|
||||
notify => Service[$php_service_name],
|
||||
}
|
||||
|
||||
file { '/etc/php/7.2/fpm/pool.d/www.conf':
|
||||
ensure => present,
|
||||
owner => 'root',
|
||||
group => 'www-data',
|
||||
mode => '0640',
|
||||
source => 'puppet:///modules/openstackid/php7/www.conf',
|
||||
require => [
|
||||
Package[$php_service_name],
|
||||
],
|
||||
notify => Service[$php_service_name],
|
||||
}
|
||||
|
||||
service { $php_service_name:
|
||||
ensure => 'running',
|
||||
enable => true,
|
||||
require => Package[$php_service_name],
|
||||
}
|
||||
}
|
||||
else{
|
||||
|
||||
# php5-fpm configuration
|
||||
|
||||
exec { 'enable_php5-mbcrypt':
|
||||
command => '/usr/sbin/php5enmod mcrypt',
|
||||
timeout => 0,
|
||||
require => [
|
||||
Package[$php_service_name],
|
||||
],
|
||||
notify => Service[$php_service_name],
|
||||
}
|
||||
|
||||
file { '/etc/php5/fpm/php-fpm.conf':
|
||||
ensure => present,
|
||||
owner => 'root',
|
||||
group => 'www-data',
|
||||
mode => '0640',
|
||||
source => 'puppet:///modules/openstackid/php-fpm.conf',
|
||||
require => [
|
||||
Package[$php_service_name],
|
||||
],
|
||||
notify => Service[$php_service_name],
|
||||
}
|
||||
|
||||
file { '/etc/php5/fpm/php.ini':
|
||||
ensure => present,
|
||||
owner => 'root',
|
||||
group => 'www-data',
|
||||
mode => '0640',
|
||||
source => 'puppet:///modules/openstackid/php.ini',
|
||||
require => [
|
||||
Package[$php_service_name],
|
||||
],
|
||||
notify => Service[$php_service_name],
|
||||
}
|
||||
|
||||
file { '/etc/php5/fpm/pool.d/www.conf':
|
||||
ensure => present,
|
||||
owner => 'root',
|
||||
group => 'www-data',
|
||||
mode => '0640',
|
||||
source => 'puppet:///modules/openstackid/www.conf',
|
||||
require => [
|
||||
Package[$php_service_name],
|
||||
],
|
||||
notify => Service[$php_service_name],
|
||||
}
|
||||
|
||||
service { $php_service_name:
|
||||
ensure => 'running',
|
||||
enable => true,
|
||||
require => Package[$php_service_name],
|
||||
}
|
||||
}
|
||||
|
||||
# the deploy scripts use the curl CLI
|
||||
if !defined(Package['curl']) {
|
||||
package { 'curl':
|
||||
ensure => present,
|
||||
}
|
||||
}
|
||||
|
||||
# force 10.x version
|
||||
class { 'nodejs':
|
||||
repo_url_suffix => '10.x',
|
||||
legacy_debian_symlinks => false,
|
||||
}
|
||||
|
||||
group { 'openstackid':
|
||||
ensure => present,
|
||||
}
|
||||
|
||||
user { 'openstackid':
|
||||
ensure => present,
|
||||
managehome => true,
|
||||
comment => 'OpenStackID User',
|
||||
shell => '/bin/bash',
|
||||
gid => 'openstackid',
|
||||
require => Group['openstackid'],
|
||||
}
|
||||
|
||||
file { '/etc/openstackid':
|
||||
ensure => directory,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
}
|
||||
|
||||
file { '/etc/scripts':
|
||||
ensure => directory,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
}
|
||||
|
||||
file { '/etc/scripts/supervisor_watchdog.sh':
|
||||
ensure => present,
|
||||
content => template('openstackid/supervisor_watchdog.sh.erb'),
|
||||
owner => 'root',
|
||||
group => 'www-data',
|
||||
mode => '0770',
|
||||
require => [
|
||||
Package['supervisor'],
|
||||
File['/etc/scripts'],
|
||||
]
|
||||
}
|
||||
|
||||
file { '/etc/supervisor/conf.d/supervisor.conf':
|
||||
ensure => present,
|
||||
content => template('openstackid/supervisor.conf.erb'),
|
||||
owner => 'root',
|
||||
group => 'www-data',
|
||||
mode => '0640',
|
||||
require => [
|
||||
Package['supervisor'],
|
||||
]
|
||||
}
|
||||
|
||||
file { '/etc/openstackid/.env':
|
||||
ensure => present,
|
||||
content => template('openstackid/.env.erb'),
|
||||
owner => 'root',
|
||||
group => 'www-data',
|
||||
mode => '0640',
|
||||
require => [
|
||||
File['/etc/openstackid'],
|
||||
]
|
||||
}
|
||||
|
||||
# mysql ssl connection configuration
|
||||
if($mysql_ssl_enabled) {
|
||||
|
||||
file { '/etc/mysql-client-ssl':
|
||||
ensure => 'directory',
|
||||
owner => 'root',
|
||||
group => 'www-data',
|
||||
mode => '0775',
|
||||
}
|
||||
|
||||
if $mysql_ssl_ca_file_contents != '' {
|
||||
file { $mysql_ssl_ca_file:
|
||||
ensure => file,
|
||||
owner => 'root',
|
||||
group => 'www-data',
|
||||
mode => '0640',
|
||||
content => $mysql_ssl_ca_file_contents,
|
||||
notify => Class['apache::service'],
|
||||
before => Apache::Vhost::Custom[$vhost_name],
|
||||
require => File['/etc/mysql-client-ssl'],
|
||||
}
|
||||
}
|
||||
|
||||
if $mysql_ssl_client_key_file_contents != '' {
|
||||
file { $mysql_ssl_client_key_file:
|
||||
ensure => file,
|
||||
owner => 'root',
|
||||
group => 'www-data',
|
||||
mode => '0640',
|
||||
content => $mysql_ssl_client_key_file_contents,
|
||||
notify => Class['apache::service'],
|
||||
before => Apache::Vhost::Custom[$vhost_name],
|
||||
require => File['/etc/mysql-client-ssl'],
|
||||
}
|
||||
}
|
||||
|
||||
if $mysql_ssl_client_cert_file_contents != '' {
|
||||
file { $mysql_ssl_client_cert_file:
|
||||
ensure => file,
|
||||
owner => 'root',
|
||||
group => 'www-data',
|
||||
mode => '0640',
|
||||
content => $mysql_ssl_client_cert_file_contents,
|
||||
notify => Class['apache::service'],
|
||||
before => Apache::Vhost::Custom[$vhost_name],
|
||||
require => File['/etc/mysql-client-ssl'],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# rabbitmq ssl connection config
|
||||
if($message_broker_ssl_enabled and $message_broker_enabled){
|
||||
file { '/etc/rabbitmq-client-ssl':
|
||||
ensure => 'directory',
|
||||
owner => 'root',
|
||||
group => 'www-data',
|
||||
mode => '0775',
|
||||
}
|
||||
|
||||
if $message_broker_ssl_ca_file_contents != '' {
|
||||
file { $message_broker_ssl_ca_file:
|
||||
ensure => file,
|
||||
owner => 'root',
|
||||
group => 'www-data',
|
||||
mode => '0640',
|
||||
content => $message_broker_ssl_ca_file_contents,
|
||||
notify => Class['apache::service'],
|
||||
before => Apache::Vhost::Custom[$vhost_name],
|
||||
require => File['/etc/rabbitmq-client-ssl'],
|
||||
}
|
||||
}
|
||||
|
||||
if $message_broker_ssl_client_cert_file_contents != '' {
|
||||
file { $message_broker_ssl_client_cert_file:
|
||||
ensure => file,
|
||||
owner => 'root',
|
||||
group => 'www-data',
|
||||
mode => '0640',
|
||||
content => $message_broker_ssl_client_cert_file_contents,
|
||||
notify => Class['apache::service'],
|
||||
before => Apache::Vhost::Custom[$vhost_name],
|
||||
require => File['/etc/rabbitmq-client-ssl'],
|
||||
}
|
||||
}
|
||||
|
||||
if $message_broker_ssl_client_key_file_contents != '' {
|
||||
file { $message_broker_ssl_client_key_file:
|
||||
ensure => file,
|
||||
owner => 'root',
|
||||
group => 'www-data',
|
||||
mode => '0640',
|
||||
content => $message_broker_ssl_client_key_file_contents,
|
||||
notify => Class['apache::service'],
|
||||
before => Apache::Vhost::Custom[$vhost_name],
|
||||
require => File['/etc/rabbitmq-client-ssl'],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$docroot_dirs = [ '/srv/openstackid' ]
|
||||
|
||||
file { $docroot_dirs:
|
||||
ensure => directory,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
}
|
||||
|
||||
class { 'apache':
|
||||
default_vhost => false,
|
||||
mpm_module => false,
|
||||
}
|
||||
|
||||
# apache mpm event connection tweaking
|
||||
class {'apache::mod::event':
|
||||
serverlimit => 16,
|
||||
startservers => 3,
|
||||
threadlimit => 256,
|
||||
threadsperchild => 256,
|
||||
maxclients => 4096,
|
||||
maxrequestsperchild => 5000,
|
||||
maxrequestworkers => 4096,
|
||||
}
|
||||
|
||||
apache::listen { '80': }
|
||||
apache::listen { '443': }
|
||||
|
||||
apache::vhost::custom { $vhost_name:
|
||||
priority => '50',
|
||||
content => template('openstackid/vhost.erb'),
|
||||
require => File[$docroot_dirs],
|
||||
}
|
||||
|
||||
class { 'apache::mod::ssl': }
|
||||
class { 'apache::mod::rewrite': }
|
||||
class { 'apache::mod::proxy': }
|
||||
class { 'apache::mod::headers': }
|
||||
|
||||
apache::mod { 'proxy_fcgi': }
|
||||
|
||||
if $ssl_cert_file_contents != '' {
|
||||
file { $ssl_cert_file:
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0640',
|
||||
content => $ssl_cert_file_contents,
|
||||
notify => Class['apache::service'],
|
||||
before => Apache::Vhost::Custom[$vhost_name],
|
||||
}
|
||||
}
|
||||
|
||||
if $ssl_key_file_contents != '' {
|
||||
file { $ssl_key_file:
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0640',
|
||||
content => $ssl_key_file_contents,
|
||||
notify => Class['apache::service'],
|
||||
before => Apache::Vhost::Custom[$vhost_name],
|
||||
}
|
||||
}
|
||||
|
||||
if $ssl_chain_file_contents != '' {
|
||||
file { $ssl_chain_file:
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0640',
|
||||
content => $ssl_chain_file_contents,
|
||||
notify => Class['apache::service'],
|
||||
before => Apache::Vhost::Custom[$vhost_name],
|
||||
}
|
||||
}
|
||||
|
||||
file { '/etc/apache2':
|
||||
ensure => directory,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
}
|
||||
|
||||
openstackid::deploy { 'deploytool':
|
||||
}
|
||||
|
||||
file { '/opt/deploy/conf.d/openstackid.conf':
|
||||
content => template('openstackid/openstackid.conf.erb'),
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
require => Openstackid::Deploy['deploytool'],
|
||||
}
|
||||
|
||||
$deploy_site_requires = [
|
||||
File['/opt/deploy/conf.d/openstackid.conf'],
|
||||
Apache::Vhost::Custom[$vhost_name],
|
||||
File['/etc/openstackid/.env'],
|
||||
Package['curl'],
|
||||
Package[$php_packages] ,
|
||||
Class['nodejs'],
|
||||
]
|
||||
|
||||
$update_site_requires = [
|
||||
File['/opt/deploy/conf.d/openstackid.conf'],
|
||||
Apache::Vhost::Custom[$vhost_name],
|
||||
File['/etc/openstackid/.env'],
|
||||
Package[$php_packages] ,
|
||||
Class['nodejs'],
|
||||
]
|
||||
|
||||
exec { 'deploy-site':
|
||||
path => '/usr/local/bin:/usr/bin:/bin',
|
||||
command => '/opt/deploy/deploy.sh init openstackid',
|
||||
onlyif => '/opt/deploy/deploy.sh status openstackid | grep N/A',
|
||||
logoutput => on_failure,
|
||||
require => $deploy_site_requires,
|
||||
}
|
||||
|
||||
exec { 'update-site':
|
||||
path => '/usr/local/bin:/usr/bin:/bin',
|
||||
command => '/opt/deploy/deploy.sh update openstackid',
|
||||
onlyif => '/opt/deploy/deploy.sh status openstackid | grep UPDATE',
|
||||
logoutput => on_failure,
|
||||
require => $update_site_requires,
|
||||
}
|
||||
|
||||
# system configuration tweaking
|
||||
$my_sysctl_settings = {
|
||||
# redis : http://redis.io/topics/admin
|
||||
'vm.overcommit_memory' => { value => 1 },
|
||||
'net.core.rmem_default' => { value => 31457280 },
|
||||
'net.core.rmem_max' => { value => 12582912 },
|
||||
'net.core.wmem_default' => { value => 31457280 },
|
||||
'net.core.wmem_max' => { value => 12582912 },
|
||||
# Defines the size of the kernel queue for accepting new connections.
|
||||
# Increase number of incoming connections
|
||||
'net.core.somaxconn' => { value => 4096 },
|
||||
# Increase number of incoming connections backlog
|
||||
'net.core.netdev_max_backlog' => { value => 65536 },
|
||||
'net.core.optmem_max' => { value => 25165824 },
|
||||
# Defines the range of usable ports on your system.
|
||||
'net.ipv4.ip_local_port_range' => { value => "10000\t65535"},
|
||||
'net.ipv4.tcp_mem' => { value => "65536\t131072\t262144" },
|
||||
'net.ipv4.udp_mem' => { value => "65536\t131072\t262144" },
|
||||
'net.ipv4.tcp_rmem' => { value => "8192\t87380\t16777216" },
|
||||
'net.ipv4.udp_rmem_min' => { value => 16384 },
|
||||
'net.ipv4.tcp_wmem' => { value => "8192\t65536\t16777216" },
|
||||
'net.ipv4.udp_wmem_min' => { value => 16384 },
|
||||
'net.ipv4.tcp_max_tw_buckets' => { value => 1440000 },
|
||||
# Increase the tcp-time-wait buckets pool size to prevent simple DOS attacks
|
||||
'net.ipv4.tcp_tw_recycle' => { value => 1 },
|
||||
'net.ipv4.tcp_tw_reuse' => { value => 1 },
|
||||
}
|
||||
|
||||
$my_sysctl_defaults = {
|
||||
}
|
||||
|
||||
create_resources(sysctl::value,$my_sysctl_settings,$my_sysctl_defaults)
|
||||
|
||||
cron { 'InstallLaravelSchedule':
|
||||
ensure => 'present',
|
||||
command => "/usr/bin/php ${projectroot}/artisan schedule:run >> /dev/null 2>&1",
|
||||
user => 'www-data',
|
||||
minute => '*',
|
||||
}
|
||||
|
||||
cron { 'InstallSupervisorWatchdog':
|
||||
ensure => 'present',
|
||||
command => '/etc/scripts/supervisor_watchdog.sh >> /var/log/supervisor_watchdog.log 2>&1',
|
||||
user => 'root',
|
||||
minute => '*/5',
|
||||
}
|
||||
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
{
|
||||
"name": "openstackinfra-openstackid",
|
||||
"version": "0.0.1",
|
||||
"author": "Openstack CI",
|
||||
"summary": "Puppet module for openstackid",
|
||||
"license": "Apache 2.0",
|
||||
"source": "https://git.openstack.org/openstack-infra/puppet-openstackid.git",
|
||||
"project_page": "http://docs.openstack.org/infra/system-config/",
|
||||
"issues_url": "https://storyboard.openstack.org/#!/project/761",
|
||||
"operatingsystem_support": [
|
||||
{ "operatingsystem": "Ubuntu", "operatingsystemrelease": ["12.04"] }
|
||||
],
|
||||
"requirements": [
|
||||
{ "name": "pe", "version_requirement": ">= 3.2.0 < 3.4.0" },
|
||||
{ "name": "puppet", "version_requirement": "3.x" }
|
||||
],
|
||||
"dependencies": [
|
||||
{ "name": "puppetlabs/stdlib", "version_requirement": ">= 3.2.0" },
|
||||
{ "name": "puppetlabs/mysql", "version_requirement": ">= 0.6.1" },
|
||||
{ "name": "puppetlabs/apache", "version_requirement": "= 1.8.1" },
|
||||
{ "name": "openstackinfra/redis", "version_requirement": ">= 0.0.1" },
|
||||
{ "name": "duritong/puppet-sysctl", "version_requirement": "= v0.0.11" }
|
||||
]
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
HOSTS:
|
||||
ubuntu-server-1404-x64:
|
||||
roles:
|
||||
- master
|
||||
platform: ubuntu-14.04-amd64
|
||||
box: puppetlabs/ubuntu-14.04-64-nocm
|
||||
box_url: https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-nocm
|
||||
hypervisor: vagrant
|
||||
CONFIG:
|
||||
log_level: debug
|
||||
type: git
|
|
@ -1,10 +0,0 @@
|
|||
HOSTS:
|
||||
centos-70-x64:
|
||||
roles:
|
||||
- master
|
||||
platform: el-7-x86_64
|
||||
hypervisor: none
|
||||
ip: 127.0.0.1
|
||||
CONFIG:
|
||||
type: foss
|
||||
set_env: false
|
|
@ -1,10 +0,0 @@
|
|||
HOSTS:
|
||||
ubuntu-14.04-amd64:
|
||||
roles:
|
||||
- master
|
||||
platform: ubuntu-14.04-amd64
|
||||
hypervisor: none
|
||||
ip: 127.0.0.1
|
||||
CONFIG:
|
||||
type: foss
|
||||
set_env: false
|
|
@ -1,10 +0,0 @@
|
|||
HOSTS:
|
||||
ubuntu-16.04-amd64:
|
||||
roles:
|
||||
- master
|
||||
platform: ubuntu-16.04-amd64
|
||||
hypervisor: none
|
||||
ip: 127.0.0.1
|
||||
CONFIG:
|
||||
type: foss
|
||||
set_env: false
|
|
@ -1,97 +0,0 @@
|
|||
APP_ENV="<%= @id_environment %>"
|
||||
APP_DEBUG=<%= @app_debug %>
|
||||
APP_KEY="<%= @app_key %>"
|
||||
APP_URL="<%= @app_url %>"
|
||||
APP_LOG=daily
|
||||
APP_TIMEZONE="<%= @app_timezone %>"
|
||||
APP_LOCALE="<%= @app_locale %>"
|
||||
APP_VERSION="<%= @app_version %>"
|
||||
|
||||
DB_HOST="<%= @id_mysql_host %>"
|
||||
DB_DATABASE="<%= @id_db_name %>"
|
||||
DB_USERNAME="<%= @id_mysql_user %>"
|
||||
DB_PASSWORD="<%= @id_mysql_password %>"
|
||||
|
||||
DB_USE_SSL=<%= @mysql_ssl_enabled %>
|
||||
DB_MYSQL_ATTR_SSL_CA="<%= @mysql_ssl_ca_file %>"
|
||||
DB_MYSQL_ATTR_SSL_KEY="<%= @mysql_ssl_client_key_file %>"
|
||||
DB_MYSQL_ATTR_SSL_CERT="<%= @mysql_ssl_client_cert_file %>"
|
||||
DB_MYSQL_ATTR_SSL_CIPHER="<%= @mysql_ssl_cypher %>"
|
||||
|
||||
REDIS_HOST="<%= @redis_host %>"
|
||||
REDIS_PORT=<%= @redis_port %>
|
||||
REDIS_DB=<%= @redis_db %>
|
||||
REDIS_PASSWORD="<%= @redis_password %>"
|
||||
|
||||
QUEUE_DRIVER="<%= @queue_driver %>"
|
||||
QUEUE_CONN="<%= @queue_conn %>"
|
||||
QUEUE_DATABASE="<%= @id_db_name %>"
|
||||
|
||||
CACHE_DRIVER="<%= @cache_driver %>"
|
||||
|
||||
SESSION_DRIVER="<%= @session_driver %>"
|
||||
SESSION_LIFETIME=<%= @session_lifetime %>
|
||||
SESSION_ENCRYPT=<%= @session_encrypt %>
|
||||
SESSION_EXPIRE_ON_CLOSE=<%= @session_expire_on_close %>
|
||||
SESSION_COOKIE_NAME=<%= @session_cookie_name %>
|
||||
SESSION_COOKIE_PATH=<%= @session_cookie_path %>
|
||||
SESSION_COOKIE_DOMAIN=<%= @session_cookie_domain %>
|
||||
SESSION_COOKIE_SECURE=<%= @session_cookie_secure %>
|
||||
SESSION_COOKIE_HTTP_ONLY=<%= @session_cookie_http_only %>
|
||||
|
||||
MAIL_DRIVER="<%= @email_driver %>"
|
||||
SENDGRID_API_KEY="<%= @email_send_grid_api_key %>"
|
||||
|
||||
CORS_ALLOWED_HEADERS="origin, content-type, accept, authorization, x-requested-with"
|
||||
CORS_ALLOWED_METHODS="GET, POST, OPTIONS, PUT, DELETE"
|
||||
CORS_USE_PRE_FLIGHT_CACHING=false
|
||||
CORS_MAX_AGE=3200
|
||||
CORS_EXPOSED_HEADERS=
|
||||
|
||||
CURL_TIMEOUT=<%= @curl_timeout %>
|
||||
CURL_ALLOWS_REDIRECT=<%= @curl_allow_redirect %>
|
||||
CURL_VERIFY_SSL_CERT=<%= @curl_verify_ssl_cert %>
|
||||
|
||||
ASSETS_BASE_URL="<%= @assets_base_url %>"
|
||||
SSL_ENABLED=<%= @ssl_enable %>
|
||||
DB_LOG_ENABLED=<%= @db_log_enabled %>
|
||||
|
||||
BANNING_ENABLE=<%= @banning_enabled %>
|
||||
|
||||
LOG_EMAIL_TO="<%= @id_log_error_to_email %>"
|
||||
LOG_EMAIL_FROM="<%= @id_log_error_from_email %>"
|
||||
LOG_LEVEL="<%= @app_log_level %>"
|
||||
LOG_EMAIL_LEVEL="<%= @app_log_email_level %>"
|
||||
|
||||
RECAPTCHA_PUBLIC_KEY="<%= @id_recaptcha_public_key %>"
|
||||
RECAPTCHA_PRIVATE_KEY="<%= @id_recaptcha_private_key %>"
|
||||
RECAPTCHA_TEMPLATE="<%= @id_recaptcha_template %>"
|
||||
|
||||
MAIL_FROM_EMAIL="<%= @mail_from_email %>"
|
||||
MAIL_FROM_NAME="<%= @mail_from_name %>"
|
||||
|
||||
SUPPORT_EMAIL="<%= @support_email %>"
|
||||
USER_SPAM_PROCESSOR_TO="<%= @user_spam_processor_to %>"
|
||||
|
||||
## RABBIT MQ
|
||||
RABBITMQ_EXCHANGE_NAME="<%= @message_broker_exchange_name %>"
|
||||
RABBITMQ_HOST="<%= @message_broker_host %>"
|
||||
RABBITMQ_PORT=<%= @message_broker_port %>
|
||||
RABBITMQ_VHOST="<%= @message_broker_vhost %>"
|
||||
RABBITMQ_LOGIN="<%= @message_broker_login %>"
|
||||
RABBITMQ_PASSWORD="<%= @message_broker_password %>"
|
||||
RABBITMQ_SSL=<%= @message_broker_ssl_enabled %>
|
||||
RABBITMQ_SSL_CAFILE=<%= @message_broker_ssl_ca_file %>
|
||||
RABBITMQ_SSL_LOCALCERT=<%= @message_broker_ssl_client_cert_file %>
|
||||
RABBITMQ_SSL_LOCALKEY=<%= @message_broker_ssl_client_key_file %>
|
||||
ENABLE_MESSAGE_BROKER=<%= @message_broker_enabled %>
|
||||
|
||||
# CLOUD STORAGE
|
||||
|
||||
CLOUD_STORAGE_BASE_URL=<%= @cloud_storage_base_url %>
|
||||
CLOUD_STORAGE_AUTH_URL=<%= @cloud_storage_auth_url %>
|
||||
CLOUD_STORAGE_APP_CREDENTIAL_ID=<%= @cloud_storage_app_credential_id %>
|
||||
CLOUD_STORAGE_APP_CREDENTIAL_SECRET=<%= @cloud_storage_app_credential_secret %>
|
||||
CLOUD_STORAGE_PROJECT_NAME=<%= @cloud_storage_project_name %>
|
||||
CLOUD_STORAGE_REGION=<%= @cloud_storage_region %>
|
||||
CLOUD_STORAGE_CONTAINER=<%= @cloud_storage_container %>
|
|
@ -1,10 +0,0 @@
|
|||
SITE_ROOT=/srv/openstackid
|
||||
SOURCE_TARBALL=https://tarballs.opendev.org/osf/openstackid/openstackid-<%= @openstackid_release %>.tar.gz
|
||||
LARAVEL_ENV=<%= @id_environment %>
|
||||
RELEASE_NAME=openstackid-<%= @openstackid_release %>.tar.gz
|
||||
SOURCE_ROOT=https://tarballs.opendev.org/osf/openstackid/
|
||||
USE_DB_SEEDING=<%= @use_db_seeding?1:0 %>
|
||||
LARAVEL_VERSION=<%= @laravel_version %>
|
||||
PHP_SERVICE_NAME=<%= @php_service_name %>
|
||||
REDIS_PORT=<%= @redis_port %>
|
||||
REDIS_PASSWORD=<%= @redis_password %>
|
|
@ -1,15 +0,0 @@
|
|||
[supervisord]
|
||||
nodaemon=true
|
||||
pidfile=/run/supervisord.pid
|
||||
user=root
|
||||
|
||||
[program:laravel-worker]
|
||||
process_name=%(program_name)s_%(process_num)02d
|
||||
command=php <%= @projectroot %>/artisan queue:work
|
||||
autostart=true
|
||||
autorestart=true
|
||||
numprocs=8
|
||||
user=www-data
|
||||
stderr_logfile=/var/log/supervisor_laravel_worker.err.log
|
||||
stdout_logfile=/var/log/supervisor_laravel_worker.out.log
|
||||
logfile_maxbytes=10MB
|
|
@ -1,12 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
dt=`date '+%d/%m/%Y %H:%M:%S'`
|
||||
output=$(supervisorctl status | grep -i "FATAL")
|
||||
|
||||
if test -z "$output"
|
||||
then
|
||||
echo "[$dt] - everything running just fine"
|
||||
else
|
||||
echo "[$dt] - some process has stopped, reloading supervisor"
|
||||
echo "$output"
|
||||
supervisorctl reload
|
||||
fi
|
|
@ -1,87 +0,0 @@
|
|||
<VirtualHost *:80>
|
||||
ServerName www.<%= scope.lookupvar("openstackid::vhost_name") %>
|
||||
ServerAdmin <%= scope.lookupvar("openstackid::serveradmin") %>
|
||||
|
||||
ErrorLog ${APACHE_LOG_DIR}/openstackid-error.log
|
||||
LogLevel warn
|
||||
Redirect / https://<%= scope.lookupvar("openstackid::vhost_name") %>/
|
||||
|
||||
</VirtualHost>
|
||||
|
||||
|
||||
<VirtualHost *:80>
|
||||
ServerName <%= scope.lookupvar("openstackid::vhost_name") %>
|
||||
ServerAdmin <%= scope.lookupvar("openstackid::serveradmin") %>
|
||||
|
||||
ErrorLog ${APACHE_LOG_DIR}/openstackid-error.log
|
||||
LogLevel warn
|
||||
Redirect / https://<%= scope.lookupvar("openstackid::vhost_name") %>/
|
||||
|
||||
</VirtualHost>
|
||||
|
||||
<IfModule mod_ssl.c>
|
||||
|
||||
<VirtualHost *:443>
|
||||
ServerName www.<%= scope.lookupvar("openstackid::vhost_name") %>
|
||||
ServerAdmin <%= scope.lookupvar("openstackid::serveradmin") %>
|
||||
|
||||
ErrorLog ${APACHE_LOG_DIR}/openstackid-error.log
|
||||
LogLevel warn
|
||||
|
||||
SSLEngine on
|
||||
SSLProtocol All -SSLv2 -SSLv3
|
||||
# Once the machine is using something to terminate TLS that supports ECDHE
|
||||
# then this should be edited to remove the RSA+AESGCM:RSA+AES so that PFS
|
||||
# only is guarenteed.
|
||||
SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:RSA+AESGCM:RSA+AES:!AES256:!aNULL:!eNULL:!MD5:!DSS:!PSK:!SRP
|
||||
SSLHonorCipherOrder on
|
||||
SSLCertificateFile <%= scope.lookupvar("openstackid::ssl_cert_file") %>
|
||||
SSLCertificateKeyFile <%= scope.lookupvar("openstackid::ssl_key_file") %>
|
||||
<% if scope.lookupvar("openstackid::ssl_chain_file") != "" %>
|
||||
SSLCertificateChainFile <%= scope.lookupvar("openstackid::ssl_chain_file") %>
|
||||
<% end %>
|
||||
|
||||
Redirect / https://<%= scope.lookupvar("openstackid::vhost_name") %>/
|
||||
</VirtualHost>
|
||||
|
||||
<VirtualHost *:443>
|
||||
ServerName <%= scope.lookupvar("openstackid::vhost_name") %>
|
||||
ServerAdmin <%= scope.lookupvar("openstackid::serveradmin") %>
|
||||
|
||||
ErrorLog ${APACHE_LOG_DIR}/openstackid-ssl-error.log
|
||||
LogLevel warn
|
||||
|
||||
SSLEngine on
|
||||
SSLProtocol All -SSLv2 -SSLv3
|
||||
# Once the machine is using something to terminate TLS that supports ECDHE
|
||||
# then this should be edited to remove the RSA+AESGCM:RSA+AES so that PFS
|
||||
# only is guarenteed.
|
||||
SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:RSA+AESGCM:RSA+AES:!AES256:!aNULL:!eNULL:!MD5:!DSS:!PSK:!SRP
|
||||
SSLHonorCipherOrder on
|
||||
SSLCertificateFile <%= scope.lookupvar("openstackid::ssl_cert_file") %>
|
||||
SSLCertificateKeyFile <%= scope.lookupvar("openstackid::ssl_key_file") %>
|
||||
<% if scope.lookupvar("openstackid::ssl_chain_file") != "" %>
|
||||
SSLCertificateChainFile <%= scope.lookupvar("openstackid::ssl_chain_file") %>
|
||||
<% end %>
|
||||
|
||||
RewriteEngine on
|
||||
|
||||
RewriteCond %{HTTP_HOST} !<%= scope.lookupvar("openstackid::vhost_name") %>
|
||||
RewriteRule ^.*$ <%= scope.lookupvar("openstackid::canonicalweburl") %>
|
||||
|
||||
# send basic auth header
|
||||
RewriteCond %{HTTP:Authorization} ^(.*)
|
||||
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
|
||||
|
||||
DocumentRoot <%= @docroot %>
|
||||
<Directory <%= @docroot %>/>
|
||||
Options -Indexes +FollowSymLinks +MultiViews
|
||||
AllowOverride All
|
||||
</Directory>
|
||||
|
||||
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000<%= @docroot %>/$1 retry=0 timeout=1800
|
||||
|
||||
Header always set Strict-Transport-Security "max-age=31536000; includeSubdomains; preload"
|
||||
|
||||
</VirtualHost>
|
||||
</IfModule>
|
Loading…
Reference in New Issue