Add first work on the pkgdb2 playbook and role
This commit is contained in:
parent
e851ba528e
commit
fc2e48c4c9
8 changed files with 393 additions and 0 deletions
51
roles/pkgdb2/templates/alembic.ini
Normal file
51
roles/pkgdb2/templates/alembic.ini
Normal file
|
@ -0,0 +1,51 @@
|
|||
# A generic, single database configuration.
|
||||
|
||||
[alembic]
|
||||
# path to migration scripts
|
||||
script_location = /usr/share/pkgdb/alembic
|
||||
|
||||
# template used to generate migration files
|
||||
# file_template = %%(rev)s_%%(slug)s
|
||||
|
||||
# set to 'true' to run the environment during
|
||||
# the 'revision' command, regardless of autogenerate
|
||||
# revision_environment = false
|
||||
|
||||
#sqlalchemy.url = postgresql://<%= pkgdb_app %>:<%= pkgdb_appPassword %>@db-pkgdb/pkgdb
|
||||
sqlalchemy.url = postgresql://{{ pkgdb_db_admin_user }}:{{ pkgdb_db_admin_pass }}@{{ pkgdb_db_host }}/{{ pkgdb_db_name }}
|
||||
|
||||
|
||||
# Logging configuration
|
||||
[loggers]
|
||||
keys = root,sqlalchemy,alembic
|
||||
|
||||
[handlers]
|
||||
keys = console
|
||||
|
||||
[formatters]
|
||||
keys = generic
|
||||
|
||||
[logger_root]
|
||||
level = WARN
|
||||
handlers = console
|
||||
qualname =
|
||||
|
||||
[logger_sqlalchemy]
|
||||
level = WARN
|
||||
handlers =
|
||||
qualname = sqlalchemy.engine
|
||||
|
||||
[logger_alembic]
|
||||
level = INFO
|
||||
handlers =
|
||||
qualname = alembic
|
||||
|
||||
[handler_console]
|
||||
class = StreamHandler
|
||||
args = (sys.stderr,)
|
||||
level = NOTSET
|
||||
formatter = generic
|
||||
|
||||
[formatter_generic]
|
||||
format = %(levelname)-5.5s [%(name)s] %(message)s
|
||||
datefmt = %H:%M:%S
|
7
roles/pkgdb2/templates/pkgdb2-proxy.conf
Normal file
7
roles/pkgdb2/templates/pkgdb2-proxy.conf
Normal file
|
@ -0,0 +1,7 @@
|
|||
RewriteEngine On
|
||||
|
||||
ProxyPass <%= path %> <%= proxyurl %>/pkgdb
|
||||
ProxyPassReverse <%= path %> <%= proxyurl %>/pkgdb
|
||||
|
||||
RequestHeader set X-Forwarded-Scheme https early
|
||||
|
74
roles/pkgdb2/templates/pkgdb2.cfg
Normal file
74
roles/pkgdb2/templates/pkgdb2.cfg
Normal file
|
@ -0,0 +1,74 @@
|
|||
# Beware that the quotes around the values are mandatory
|
||||
|
||||
### Secret key for the Flask application
|
||||
SECRET_KEY='{{ pkgdb2_secret_key }}'
|
||||
|
||||
### url to the database server:
|
||||
#DB_URL=mysql://user:pass@host/db_name
|
||||
#DB_URL=postgres://user:pass@host/db_name
|
||||
DB_URL='postgresql://{{ pkgdb2_db_user }}:{{ pkgdb2_db_pass }}@{{ pkgdb2_db_host }}/{{ pkgdb2_db_name }}'
|
||||
|
||||
### the number of items (packages, packagers..) to display on the search
|
||||
### pages
|
||||
ITEMS_PER_PAGE = 50
|
||||
|
||||
|
||||
### List the ACL which are automatically approved (don't need reviewing)
|
||||
AUTO_APPROVE = ['watchcommits', 'watchbugzilla']
|
||||
|
||||
#### FAS group for the pkgdb admins
|
||||
ADMIN_GROUP = ['sysadmin-main', 'sysadmin-cvs']
|
||||
|
||||
### The default backend for dogpile
|
||||
### Options are listed at:
|
||||
### http://dogpilecache.readthedocs.org/en/latest/api.html (backend section)
|
||||
PKGDB2_CACHE_BACKEND = 'dogpile.cache.memcached'
|
||||
PKGDB2_CACHE_KWARGS = {
|
||||
'arguments': {
|
||||
'url': "127.0.0.1:11211",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
### Bugzilla information
|
||||
|
||||
## Upon changes in pkgdb, update bugzilla
|
||||
PKGDB2_BUGZILLA_NOTIFICATION = False
|
||||
## URL to the bugzilla instance to update
|
||||
PKGDB2_BUGZILLA_URL = 'https://bugzilla.redhat.com'
|
||||
## name of the user the pkgdb application can log in to bugzilla with
|
||||
PKGDB2_BUGZILLA_USER = None
|
||||
## password of the user the pkgdb application can log in to bugzilla with
|
||||
PKGDB2_BUGZILLA_PASSWORD = None
|
||||
|
||||
|
||||
### FAS information
|
||||
|
||||
## URL to the FAS instance to query
|
||||
PKGDB2_FAS_URL = 'https://admin.fedoraproject.org/accounts'
|
||||
## name of the user the pkgdb application can log in to FAS with
|
||||
PKGDB2_FAS_USER = '{{ pkgdb_fas_user }}'
|
||||
## password of the user the pkgdb application can log in to FAS with
|
||||
PKGDB2_FAS_PASSWORD = '{{ pkgdb_fas_password }}'
|
||||
|
||||
|
||||
### pkgdb notifications
|
||||
|
||||
## Pkgdb broadcasts its notifications via fedmsg
|
||||
PKGDB2_FEDMSG_NOTIFICATION = True
|
||||
## Pkgdb sends its notifications by email
|
||||
PKGDB2_EMAIL_NOTIFICATION = False
|
||||
## Template to build the email address pkgdb sends its notifications to
|
||||
PKGDB2_EMAIL_TO = '{pkg_name}-owner@fedoraproject.org'
|
||||
## The From address email notifications are sent with
|
||||
PKGDB2_EMAIL_FROM = 'nobody@fedoraproject.org'
|
||||
## The SMTP server to use to send email notifications
|
||||
PKGDB2_EMAIL_SMTP_SERVER = 'localhost'
|
||||
|
||||
|
||||
### Email stacktrace
|
||||
|
||||
## pkgdb sends email when it faces an exception (trying to add an existing
|
||||
## package or something alike. These emails are sent to the address set
|
||||
## here:
|
||||
MAIL_ADMIN = 'pingou@fedoraproject.org'
|
23
roles/pkgdb2/templates/pkgdb2.conf
Normal file
23
roles/pkgdb2/templates/pkgdb2.conf
Normal file
|
@ -0,0 +1,23 @@
|
|||
|
||||
Alias /pkgdb/static /usr/lib/python2.6/site-packages/pkgdb2/static/default/
|
||||
|
||||
WSGIDaemonProcess pkgdb user=apache maximum-requests=1000 display-name=pkgdb processes=2 threads=1
|
||||
WSGISocketPrefix run/wsgi
|
||||
WSGIRestrictStdout On
|
||||
WSGIRestrictSignal Off
|
||||
WSGIPythonOptimize 1
|
||||
|
||||
WSGIScriptAlias /pkgdb /var/www/pkgdb2.wsgi
|
||||
|
||||
<Location />
|
||||
WSGIProcessGroup pkgdb
|
||||
<IfModule mod_authz_core.c>
|
||||
# Apache 2.4
|
||||
Require all granted
|
||||
</IfModule>
|
||||
<IfModule !mod_authz_core.c>
|
||||
# Apache 2.2
|
||||
Order deny,allow
|
||||
Allow from all
|
||||
</IfModule>
|
||||
</Location>
|
22
roles/pkgdb2/templates/pkgdb2.wsgi
Normal file
22
roles/pkgdb2/templates/pkgdb2.wsgi
Normal file
|
@ -0,0 +1,22 @@
|
|||
#-*- coding: UTF-8 -*-
|
||||
|
||||
# The three lines below are required to run on EL6 as EL6 has
|
||||
# two possible version of python-sqlalchemy and python-jinja2
|
||||
# These lines make sure the application uses the correct version.
|
||||
import __main__
|
||||
__main__.__requires__ = ['SQLAlchemy >= 0.7', 'jinja2 >= 2.4']
|
||||
import pkg_resources
|
||||
|
||||
import os
|
||||
## Set the environment variable pointing to the configuration file
|
||||
os.environ['PKGDB2_CONFIG'] = '/etc/pkgdb2/pkgdb2.cfg'
|
||||
|
||||
## The following is only needed if you did not install pkgdb
|
||||
## as a python module (for example if you run it from a git clone).
|
||||
#import sys
|
||||
#sys.path.insert(0, '/path/to/pkgdb/')
|
||||
|
||||
|
||||
## The most import line to make the wsgi working
|
||||
from pkgdb2 import APP as application
|
||||
|
74
roles/pkgdb2/templates/pkgdb2_admin.cfg
Normal file
74
roles/pkgdb2/templates/pkgdb2_admin.cfg
Normal file
|
@ -0,0 +1,74 @@
|
|||
# Beware that the quotes around the values are mandatory
|
||||
|
||||
### Secret key for the Flask application
|
||||
SECRET_KEY='{{ pkgdb2_secret_key }}'
|
||||
|
||||
### url to the database server:
|
||||
#DB_URL=mysql://user:pass@host/db_name
|
||||
#DB_URL=postgres://user:pass@host/db_name
|
||||
DB_URL='postgresql://{{ pkgdb2_db_admin_user }}:{{ pkgdb2_db_admin_pass }}@{{ pkgdb2_db_host }}/{{ pkgdb2_db_name }}'
|
||||
|
||||
### the number of items (packages, packagers..) to display on the search
|
||||
### pages
|
||||
ITEMS_PER_PAGE = 50
|
||||
|
||||
|
||||
### List the ACL which are automatically approved (don't need reviewing)
|
||||
AUTO_APPROVE = ['watchcommits', 'watchbugzilla']
|
||||
|
||||
#### FAS group for the pkgdb admins
|
||||
ADMIN_GROUP = ['sysadmin-main', 'sysadmin-cvs']
|
||||
|
||||
### The default backend for dogpile
|
||||
### Options are listed at:
|
||||
### http://dogpilecache.readthedocs.org/en/latest/api.html (backend section)
|
||||
PKGDB2_CACHE_BACKEND = 'dogpile.cache.memcached'
|
||||
PKGDB2_CACHE_KWARGS = {
|
||||
'arguments': {
|
||||
'url': "127.0.0.1:11211",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
### Bugzilla information
|
||||
|
||||
## Upon changes in pkgdb, update bugzilla
|
||||
PKGDB2_BUGZILLA_NOTIFICATION = False
|
||||
## URL to the bugzilla instance to update
|
||||
PKGDB2_BUGZILLA_URL = 'https://bugzilla.redhat.com'
|
||||
## name of the user the pkgdb application can log in to bugzilla with
|
||||
PKGDB2_BUGZILLA_USER = None
|
||||
## password of the user the pkgdb application can log in to bugzilla with
|
||||
PKGDB2_BUGZILLA_PASSWORD = None
|
||||
|
||||
|
||||
### FAS information
|
||||
|
||||
## URL to the FAS instance to query
|
||||
PKGDB2_FAS_URL = 'https://admin.fedoraproject.org/accounts'
|
||||
## name of the user the pkgdb application can log in to FAS with
|
||||
PKGDB2_FAS_USER = '{{ pkgdb_fas_user }}'
|
||||
## password of the user the pkgdb application can log in to FAS with
|
||||
PKGDB2_FAS_PASSWORD = '{{ pkgdb_fas_password }}'
|
||||
|
||||
|
||||
### pkgdb notifications
|
||||
|
||||
## Pkgdb broadcasts its notifications via fedmsg
|
||||
PKGDB2_FEDMSG_NOTIFICATION = True
|
||||
## Pkgdb sends its notifications by email
|
||||
PKGDB2_EMAIL_NOTIFICATION = False
|
||||
## Template to build the email address pkgdb sends its notifications to
|
||||
PKGDB2_EMAIL_TO = '{pkg_name}-owner@fedoraproject.org'
|
||||
## The From address email notifications are sent with
|
||||
PKGDB2_EMAIL_FROM = 'nobody@fedoraproject.org'
|
||||
## The SMTP server to use to send email notifications
|
||||
PKGDB2_EMAIL_SMTP_SERVER = 'localhost'
|
||||
|
||||
|
||||
### Email stacktrace
|
||||
|
||||
## pkgdb sends email when it faces an exception (trying to add an existing
|
||||
## package or something alike. These emails are sent to the address set
|
||||
## here:
|
||||
MAIL_ADMIN = 'pingou@fedoraproject.org'
|
Loading…
Add table
Add a link
Reference in a new issue