Last active
August 29, 2015 14:06
-
-
Save johnsca/23d339b15c9e701edfb7 to your computer and use it in GitHub Desktop.
Chamilo charm services block
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def manage(): | |
manager = ServiceManager([ | |
{ | |
'service': 'apache2', | |
'ports': [80], | |
'provided_data': [helpers.HttpRelation()], # interfaces provided by this charm | |
'required_data': [ # requirements for this charm to be started | |
helpers.RequiredConfig('domain', 'pass'), | |
helpers.MysqlRelation(), | |
helpers.StoredContext('chamilo-secret.json', { | |
'key': host.pwgen(7), | |
'version': CHAMILO_VERSION, | |
}), | |
], | |
'data_ready': [ # actions to take to start / update this charm | |
helpers.render_template(source='configuration.php.j2', | |
target="/var/www/main/inc/conf/" | |
"configuration.php"), | |
helpers.render_template(source='apache-site.j2', | |
target="/etc/apache2/sites-available/" | |
"default"), | |
actions.init_database, | |
actions.update_admin_account, | |
], | |
}, | |
]) | |
manager.manage() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment