First try at roles for badges-backend.
This commit is contained in:
parent
f0d7f6f296
commit
89470998a5
4 changed files with 48 additions and 1 deletions
|
@ -41,7 +41,9 @@
|
||||||
- include: $tasks/denyhosts.yml
|
- include: $tasks/denyhosts.yml
|
||||||
- include: $tasks/nagios_client.yml
|
- include: $tasks/nagios_client.yml
|
||||||
- include: $tasks/fedmsg_base.yml
|
- include: $tasks/fedmsg_base.yml
|
||||||
- include: $tasks/fedmsg_hub.yml
|
|
||||||
|
|
||||||
handlers:
|
handlers:
|
||||||
- include: $handlers/restart_services.yml
|
- include: $handlers/restart_services.yml
|
||||||
|
|
||||||
|
roles:
|
||||||
|
- include: $roles/badges-backend
|
||||||
|
|
16
roles/badges-backend/tasks/badge-awarder.yml
Normal file
16
roles/badges-backend/tasks/badge-awarder.yml
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
---
|
||||||
|
# Configuration for the fedbadges consumer
|
||||||
|
|
||||||
|
- tasks:
|
||||||
|
- include: $tasks/fedmsg_hub
|
||||||
|
|
||||||
|
- name: copy database configuration
|
||||||
|
template: src=$item /etc/fedmsg.d/$item
|
||||||
|
with_items:
|
||||||
|
- datanommer-db.py
|
||||||
|
- badges-global.py
|
||||||
|
|
||||||
|
tags:
|
||||||
|
- config
|
||||||
|
notify:
|
||||||
|
- fedmsg-hub
|
26
roles/badges-backend/templates/badges-awarder.py
Normal file
26
roles/badges-backend/templates/badges-awarder.py
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
config = {
|
||||||
|
# We need to tell the fedmsg-hub that it should load our consumer on start.
|
||||||
|
"fedmsg.consumers.badges.enabled": True,
|
||||||
|
|
||||||
|
# This tells the consumer where to look for its BadgeRule definitions. It
|
||||||
|
# may be a relative or an absolute path on the file system.
|
||||||
|
"badges.yaml.directory": "/usr/share/badges/rules",
|
||||||
|
|
||||||
|
# This is a dictionary of tahrir-related configuration
|
||||||
|
"badges_global": {
|
||||||
|
|
||||||
|
# This is a sqlalchemy URI that points to the tahrir DB.
|
||||||
|
"database_uri": "postgresql://${tahrirDBUser}:${tahrirDBPassword}@db-tahrir/tahrir",
|
||||||
|
|
||||||
|
# This is a set of data that tells our consumer what Open Badges Issuer
|
||||||
|
# should be kept as the issuer of all the badges we create.
|
||||||
|
"badge_issuer": dict(
|
||||||
|
issuer_id='Fedora Project',
|
||||||
|
issuer_origin='http://apps.fedoraproject.com/badges/',
|
||||||
|
issuer_name='Fedora Project',
|
||||||
|
issuer_org='http://fedoraproject.org',
|
||||||
|
issuer_contact='badges@fedoraproject.org',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
3
roles/badges-backend/templates/datanommmer-db.py
Normal file
3
roles/badges-backend/templates/datanommmer-db.py
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
config = {
|
||||||
|
'datanommer.sqlalchemy.url': 'postgresql://${datanommerDBUser}:${datanommerDBPassword}@db-datanommer/datanommer',
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue