fedora-packages role

This commit is contained in:
Ralph Bean
2014-03-12 18:44:01 +00:00
parent c00ab836f6
commit f0e82d53af
7 changed files with 625 additions and 1 deletions

View File

@@ -65,7 +65,7 @@
roles:
- fedmsg_base
#- packages
- packages
handlers:
- include: "{{ handlers }}/restart_services.yml"

View File

@@ -0,0 +1,24 @@
# Global list of koji tags we care about
tags = ({'name': 'Rawhide', 'tag': 'f21'},
{'name': 'Fedora 20', 'tag': 'f20-updates'},
{'name': 'Fedora 20', 'tag': 'f20'},
{'name': 'Fedora 20 Testing', 'tag': 'f20-updates-testing'},
{'name': 'Fedora 19', 'tag': 'f19-updates'},
{'name': 'Fedora 19', 'tag': 'f19'},
{'name': 'Fedora 19 Testing', 'tag': 'f19-updates-testing'},
{'name': 'EPEL 7', 'tag': 'epel7'},
{'name': 'EPEL 7', 'tag': 'epel7-testing'},
{'name': 'EPEL 6', 'tag': 'dist-6E-epel'},
{'name': 'EPEL 6', 'tag': 'dist-6E-epel-testing'},
{'name': 'EPEL 5', 'tag': 'dist-5E-epel'},
{'name': 'EPEL 5', 'tag': 'dist-5E-epel-testing'},
)
tags_to_name_map = {}
for t in tags:
tags_to_name_map[t['tag']] = t['name']

View File

@@ -0,0 +1,54 @@
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
LoadModule deflate_module modules/mod_deflate.so
ExpiresActive On
#ExpiresDefault "access plus 300 seconds"
ErrorLog logs/fedoracommunity_error_log
CustomLog logs/fedoracommunity_access_log combined
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript text/css application/x-javascript
# This caching may not necessarily be ideal, or even correct.
# However, it was the only I could get firebug to show me 302's for
# my ToscaWidget resources.
<filesmatch ".(gif|jpe?g|png|css|js)$">
Header unset Cache-Control
Header unset Etag
Header add Cache-Control "max-age=2592000"
#ExpiresDefault A2592000
</filesmatch>
# we are deploying the packager app that is part of the new Fedora Community
Alias /packages/css /usr/share/fedoracommunity/public/css
Alias /packages/javascript /usr/share/fedoracommunity/public/javascript
Alias /packages/images/icons /var/cache/fedoracommunity/packages/icons
Alias /packages/images /usr/share/fedoracommunity/public/images
Alias /packages/_res /usr/share/fedoracommunity/public/toscawidgets/resources/
# Temporarily disabled until we can figure out how to get the moksha
# javascript resources pulled in with `python setup.py archive_tw_resources`
#Alias /community/toscawidgets /usr/share/fedoracommunity/public/toscawidgets
WSGIPythonEggs /var/cache/fedoracommunity/.python-eggs
WSGIDaemonProcess fedoracommunity user=apache maximum-requests=50000 display-name=fedoracommunity processes=8 threads=4
WSGISocketPrefix run/wsgi
WSGIRestrictStdout Off
WSGIRestrictSignal Off
WSGIPythonOptimize 1
WSGIScriptAlias /packages /usr/share/fedoracommunity/production/apache/fedoracommunity.wsgi
#<Location /community>
# NSSOptions +StrictRequire
# NSSRequireSSL
# ErrorDocument 403 https://publictest16.fedoraproject.org/community
#</Location>
<Directory /usr/share/fedoracommunity/>
WSGIProcessGroup fedoracommunity
Order deny,allow
Allow from all
</Directory>

View File

@@ -0,0 +1,205 @@
[main]
cachedir=/var/cache/fedoracommunity/packages/tmp/
installroot=/var/cache/fedoracommunity/packages/tmp/
keepcache=1
debuglevel=2
logfile=yum.log
exactarch=0
obsoletes=1
gpgcheck=1
plugins=0
installonly_limit=3
reposdir=
cacheonly=1
[rawhide-x86_64]
name=Fedora - Rawhide - Developmental packages for the next Fedora release
failovermethod=priority
baseurl=http://download01.phx2.fedoraproject.org/pub/fedora/linux/development/rawhide/x86_64/os/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=rawhide&arch=x86_64
enabled=0
gpgcheck=0
[rawhide-i686]
name=Fedora - Rawhide - Developmental packages for the next Fedora release
failovermethod=priority
baseurl=http://download01.phx2.fedoraproject.org/pub/fedora/linux/development/rawhide/i386/os/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=rawhide&arch=i386
enabled=0
gpgcheck=0
[rawhide-debuginfo-x86_64]
name=Fedora - Rawhide - Debug
failovermethod=priority
baseurl=http://download01.phx2.fedoraproject.org/pub/fedora/linux/development/rawhide/x86_64/debug/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=rawhide-debug&arch=x86_64
enabled=0
gpgcheck=0
[rawhide-source]
name=Fedora - Rawhide - Source
failovermethod=priority
baseurl=http://download01.phx2.fedoraproject.org/pub/fedora/linux/development/rawhide/source/SRPMS/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=rawhide-source&arch=x86_64
enabled=0
gpgcheck=0
[fedora-20-x86_64]
name=Fedora 20
failovermethod=priority
baseurl=http://download01.phx2.fedoraproject.org/pub/fedora/linux/releases/20/Fedora/x86_64/os/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-20&arch=x86_64
enabled=0
gpgcheck=0
[fedora-20-updates-x86_64]
name=Fedora 20 - Updates
failovermethod=priority
baseurl=http://download01.phx2.fedoraproject.org/pub/fedora/linux/updates/20/x86_64/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f20&arch=x86_64
enabled=0
gpgcheck=0
[fedora-20-testing-x86_64]
name=Fedora 20 - Testing
failovermethod=priority
baseurl=http://download01.phx2.fedoraproject.org/pub/fedora/linux/updates/testing/20/x86_64/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-testing-f20&arch=x86_64
enabled=0
gpgcheck=0
[fedora-20-i686]
name=Fedora 20
failovermethod=priority
baseurl=http://download01.phx2.fedoraproject.org/pub/fedora/linux/releases/20/Fedora/i386/os/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-20&arch=i386
enabled=0
gpgcheck=0
[fedora-20-updates-i686]
name=Fedora 20 - Updates
failovermethod=priority
baseurl=http://download01.phx2.fedoraproject.org/pub/fedora/linux/updates/20/i386/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f20&arch=i386
enabled=0
gpgcheck=0
[fedora-20-testing-i686]
name=Fedora 20 - Testing
failovermethod=priority
baseurl=http://download01.phx2.fedoraproject.org/pub/fedora/linux/updates/testing/20/i386/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-testing-f20&arch=i386
enabled=0
gpgcheck=0
[fedora-19-x86_64]
name=Fedora 19
failovermethod=priority
baseurl=http://download01.phx2.fedoraproject.org/pub/fedora/linux/releases/19/Fedora/x86_64/os/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-19&arch=x86_64
enabled=0
gpgcheck=0
[fedora-19-updates-x86_64]
name=Fedora 19 - Updates
failovermethod=priority
baseurl=http://download01.phx2.fedoraproject.org/pub/fedora/linux/updates/19/x86_64/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f19&arch=x86_64
enabled=0
gpgcheck=0
[fedora-19-testing-x86_64]
name=Fedora 19 - Testing
failovermethod=priority
baseurl=http://download01.phx2.fedoraproject.org/pub/fedora/linux/updates/testing/19/x86_64/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-testing-f19&arch=x86_64
enabled=0
gpgcheck=0
[fedora-19-i686]
name=Fedora 19
failovermethod=priority
baseurl=http://download01.phx2.fedoraproject.org/pub/fedora/linux/releases/19/Fedora/i386/os/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-19&arch=i386
enabled=0
gpgcheck=0
[fedora-19-updates-i686]
name=Fedora 19 - Updates
failovermethod=priority
baseurl=http://download01.phx2.fedoraproject.org/pub/fedora/linux/updates/19/i386/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f19&arch=i386
enabled=0
gpgcheck=0
[fedora-19-testing-i686]
name=Fedora 19 - Testing
failovermethod=priority
baseurl=http://download01.phx2.fedoraproject.org/pub/fedora/linux/updates/testing/19/i386/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-testing-f19&arch=i386
enabled=0
gpgcheck=0
[epel-5-x86_64]
name=EPEL 5
failovermethod=priority
baseurl=http://download01.phx2.fedoraproject.org/pub/epel/5/x86_64/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-5&arch=x86_64
enabled=0
gpgcheck=0
[epel-5-testing-x86_64]
name=EPEL 5 - Testing
failovermethod=priority
baseurl=http://download01.phx2.fedoraproject.org/pub/epel/testing/5/x86_64/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-epel5&arch=x86_64
enabled=0
gpgcheck=0
[epel-5-i686]
name=EPEL 5
failovermethod=priority
baseurl=http://download01.phx2.fedoraproject.org/pub/epel/5/i386/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-5&arch=i386
enabled=0
gpgcheck=0
[epel-5-testing-i686]
name=EPEL 5 - Testing
failovermethod=priority
baseurl=http://download01.phx2.fedoraproject.org/pub/epel/testing/5/i386/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-epel5&arch=i386
enabled=0
gpgcheck=0
[epel-6-x86_64]
name=EPEL 6
failovermethod=priority
baseurl=http://download01.phx2.fedoraproject.org/pub/epel/6/x86_64/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=x86_64
enabled=0
gpgcheck=0
[epel-6-testing-x86_64]
name=EPEL 6 - Testing
failovermethod=priority
baseurl=http://download01.phx2.fedoraproject.org/pub/epel/testing/6/x86_64/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-epel6&arch=x86_64
enabled=0
gpgcheck=0
[epel-6-i686]
name=EPEL 6
failovermethod=priority
baseurl=http://download01.phx2.fedoraproject.org/pub/epel/6/i386/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=i386
enabled=0
gpgcheck=0
[epel-6-testing-i686]
name=EPEL 6 - Testing
failovermethod=priority
baseurl=http://download01.phx2.fedoraproject.org/pub/epel/testing/6/i386/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-epel6&arch=i386
enabled=0
gpgcheck=0

View File

@@ -0,0 +1,96 @@
---
# Configuration for the fedora-packages webapp
- name: install needed packages
yum: pkg={{ item }} state=installed
with_items:
- fedora-packages
- python-psycopg2
- python-memcached
- python-sqlalchemy0.8
- redis
tags:
- packages
- name: Create some directories
file: path={{ item }} state=directory owner=apache group=apache mode=755
with_items:
- /etc/fedoracommunity
- /etc/fedoracommunity/yum_cache.repos.d
- /var/cache/fedoracommunity # the gluster role usually creates this one
- /var/log/fedoracommunity
- name: Create some more locked down directories
file: path={{ item }} state=directory owner=apache group=apache mode=700
with_items:
- /etc/pki/fedoracommunity
- name: Copy over the app config
template: >
src=packages-app.ini.j2
dest=/etc/fedoracommunity/production.ini
owner=apache group=apache mode=0600
notify:
- restart httpd
- name: Copy over the httpd config
copy: >
src=packages-httpd.conf
dest=/etc/httpd/conf.d/fedora-packages.conf
owner=root group=root
notify:
- restart httpd
- name: Copy over the yum config
copy: >
src=packages-yum.conf
dest=/etc/fedoracommunity/yum-repo.conf
owner=root group=root mode=0644
notify:
- restart httpd
- name: Copy over certs/public-keys, probably for talking with koji.
copy: >
src="{{private}}/files/packages/fedora-ca.cert"
dest="/etc/pki/fedoracommunity/{{item}}"
owner=apache
group=apache
mode=0644
with_items:
- fedora-server-ca.cert
- fedora-upload-ca.cert
- name: selinux httpd_tmp_exec
seboolean: name=httpd_tmp_exec persistent=yes state=yes
- name: set fcontext on /var/cache/fedoracommunity
command: semanage fcontext -a -t httpd_sys_content_t /var/cache/fedoracommunity
- name: Create cache structure
file: >
dest="/var/cache/fedoracommunity/{{item}}"
state=directory
owner=apache
group=apache
mode=0755
with_items:
- packages
- rpm_cache
- git.fedoraproject.org
- packages/icons
- packages/xapian
- packages/tmp
- name: permanently hotfix the distmappings file
copy: >
src=distmappings.py
dest=/usr/lib/python2.6/site-packages/fedoracommunity/search/distmappings.py
owner=root group=root mode=0644
notify:
- restart httpd
- name: start some helper services
service: name="{{item}}" state=started enabled=yes
with_items:
- redis
- fcomm-cache-worker

View File

@@ -0,0 +1,244 @@
##
## Fedora Community Production configuration
##
## $Id: fedoracommunity-prod.ini.erb,v 1.0 2009/05/03 23:38:07 johnp Exp $
##
[DEFAULT]
profile = false
debug = false
profile.connectors = false
profile.dir = /var/log/fedoracommunity/profile
# This is required to avoid a 404 error on, e.g. /packages/python-webob1.2
disable_request_extensions = True
email_to = lmacken@redhat.com rbean@redhat.com
smtp_server = gateway
error_email_from = fedoracommunity@fedoraproject.org
fedoracommunity.extensions_dir = {{ pythonsitelib }}/fedoracommunity/plugins/extensions
fedoracommunity.connector.kojihub.baseurl = http://koji.fedoraproject.org/kojihub
fedoracommunity.connector.bugzilla.baseurl = https://bugzilla.redhat.com/xmlrpc.cgi
fedoracommunity.connector.bugzilla.cookiefile = /var/cache/fedoracommunity/bugzillacookies
fedoracommunity.connector.fas.baseurl = https://admin.fedoraproject.org/accounts/
fedoracommunity.connector.bodhi.baseurl = https://admin.fedoraproject.org/updates
fedoracommunity.connector.pkgdb.baseurl = https://admin.fedoraproject.org/pkgdb
fedoracommunity.rpm_cache = /var/cache/fedoracommunity/rpm_cache/
fedoracommunity.connector.xapian.package-search.db = /var/cache/fedoracommunity/packages/xapian/search
fedoracommunity.connector.xapian.versionmap.db = /var/cache/fedoracommunity/packages/xapian/versionmap
fedoracommunity.resource_path_prefix = /packages/_res/
fedoracommunity.connector.yum.conf = /etc/fedoracommunity/yum-repo.conf
yumlock = /var/cache/fedoracommunity/fedora-packages-yum
# Git settings
git_repo_path = /var/cache/fedoracommunity/git.fedoraproject.org
# FAS is locked down so we need a minimal user inorder to get public user info
# to unauthenticated users. You need to get a locked down account for this
# and fill in the user info here. Never check this file into git with
# this information filled in
fedoracommunity.connector.fas.minimal_user_name={{ fcommFasUser }}
fedoracommunity.connector.fas.minimal_user_password={{ fcommFasPassword }}
# This is insecure, use only for testing
fedora.clients.check_certs = True
# URL for getting message history
datagrepper_url = https://apps.fedoraproject.org/datagrepper/raw
##
## Moksha-specific configuration options
##
# Where to store the feed caches.
#
{% if env == "staging" %}
feed_cache = postgres://fedoracommunity:{{ fcommFeedCacheDBPassword }}@db-community.stg/fedoracommunity_feed_cache
stats_cache = postgres://fedoracommunity:{{ fcommFeedCacheDBPassword }}@db-community.stg/fedoracommunity_stats_cache
{% else %}
feed_cache = postgres://fedoracommunity:{{ fcommFeedCacheDBPassword }}@db-community/fedoracommunity_feed_cache
stats_cache = postgres://fedoracommunity:{{ fcommFeedCacheDBPassword }}@db-community/fedoracommunity_stats_cache
{% endif %}
#
# Feed Streamer settings
#
# Max age (in seconds) of each feed in the cache
feed.max_age = 900
# Timeout in seconds for the web request
feed.timeout = 30
# The number of simultaneous connections
feed.deferred_groups = 10
# Where to initialize and store our application databases. %s is the app name.
app_db = sqlite:///%s.db
# The location of our Orbited server
orbited_host = localhost
orbited_port = 9000
# Stomp broker configuration.
stomp_broker = localhost
stomp_port = 61613
stomp_user = guest
stomp_pass = guest
# Optional AMQP Broker.
#amqp_broker = guest/guest@localhost
# Documentation directory
docs_dir = /srv/moksha/docs
# Moksha chat configuration
# Use a built-in IRC server
#chat.backend = irc://localhost:9999
#chat.builtin = true
#chat.backend = irc://irc.freenode.net:6667
#chat.rooms = default
#chat.default.staticRoomName = moksha
#chat.default.roomAssignmentMode = static
#chat.default.display.greeting = Moksha Chat
#chat.default.display.floating = true
#chat.default.display.floatingToggle = false
#chat.default.display.width = 400
#chat.default.display.height = 300
#chat.default.display.theme = simple
#chat.default.display.resizable = true
moksha.extensionpoints=True
moksha.csrf_protection = False
moksha.csrf.login_handler = /login_handler
moksha.csrf.trusted_domains = admin.fedoraproject.org
moksha.use_tw2 = True
moksha.livesocket = False
cache.bugzilla.backend=dogpile.cache.memcached
cache.bugzilla.expiration_time=300
cache.bugzilla.arguments.url=memcached03:11211
cache.bugzilla.arguments.distributed_lock=True
cache.connectors.backend=dogpile.cache.memcached
cache.connectors.expiration_time=300
cache.connectors.arguments.url=memcached04:11211
cache.connectors.arguments.distributed_lock=True
# For the cache worker daemon
cache-worker.pidfile = /var/run/fedoracommunity/fcomm-cache-worker.pid
cache-worker.logfile = /var/log/fedoracommunity/fcomm-cache-worker.log
# We can have no more than 1 thread until the following is resolved
# https://github.com/kushaldas/retask/issues/2
cache-worker.threads = 1
[server:main]
use = egg:Paste#http
host = 0.0.0.0
port = 8080
[app:main]
use = egg:fedoracommunity
full_stack = true
#lang = ru
#cache_dir = /var/cache/fedoracommunity/data
beaker.session.key = fedoracommunity
beaker.session.secret = {{ fcommBeakerSessionSecret }}
beaker.cache.type = ext:memcached
beaker.cache.url = memcached03:11211;memcached04:11211
beaker.cache.lock_dir = /var/cache/fedoracommunity/beaker
# If you'd like to fine-tune the individual locations of the cache data dirs
# for the Cache data, or the Session saves, un-comment the desired settings
# here:
#beaker.cache.data_dir = %(here)s/data/cache
#beaker.session.data_dir = %(here)s/data/sessions
# pick the form for your database
# %(here) may include a ':' character on Windows environments; this can
# invalidate the URI when specifying a SQLite db via path name
sqlalchemy.url=postgres://moksha:m0ksh4@localhost/moksha
# sqlalchemy.url=mysql://username:password@hostname:port/databasename
# If you have sqlite, here's a simple default to get you started
# in development
#sqlalchemy.url = sqlite:///%(here)s/devdata.db
sqlalchemy.echo = true
sqlalchemy.echo_pool = false
sqlalchemy.pool_recycle = 3600
sqlalchemy.pool_size=1
sqlalchemy.max_overflow=2
# WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT*
# Debug mode will enable the interactive debugging tool, allowing ANYONE to
# execute malicious code after an exception is raised.
set debug = false
# Logging configuration
# Add additional loggers, handlers, formatters here
# Uses python's logging config file format
# http://docs.python.org/lib/logging-config-fileformat.html
[loggers]
keys = root, moksha, sqlalchemy, tg, auth, pylons
[handlers]
keys = console
[formatters]
keys = generic
# If you create additional loggers, add them as a key to [loggers]
[logger_root]
level = WARN
handlers = console
[logger_moksha]
level = WARN
handlers =
qualname = moksha
[logger_tg]
level = WARN
handlers =
qualname = tg
# repoze.who is noisy by default
[logger_auth]
level = WARN
handlers =
qualname = auth
[logger_pylons]
level = WARN
handlers =
qualname = pylons
[logger_sqlalchemy]
level = WARN
handlers =
qualname = sqlalchemy.engine
# "level = INFO" logs SQL queries.
# "level = DEBUG" logs SQL queries and results.
# "level = WARN" logs neither. (Recommended for production systems.)
# If you create additional handlers, add them as a key to [handlers]
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
# If you create additional formatters, add them as a key to [formatters]
[formatter_generic]
format = %(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
datefmt = %H:%M:%S

View File

@@ -0,0 +1 @@
pythonsitelib: /usr/lib/python2.6/site-packages