~brad-marshall/charms/trusty/thruk-master/add-debug-options

« back to all changes in this revision

Viewing changes to hooks/services.py

  • Committer: Brad Marshall
  • Date: 2015-04-09 06:46:35 UTC
  • Revision ID: brad.marshall@canonical.com-20150409064635-fa1bvvvy81vhpiyx
[bradm] Initial cut of thruk-master charm

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
 
 
3
from charmhelpers.core.services.base import ServiceManager
 
4
from charmhelpers.core.services import helpers
 
5
from charmhelpers.core import hookenv
 
6
 
 
7
import actions
 
8
import thruk_helpers
 
9
 
 
10
 
 
11
def manage():
 
12
    manager = ServiceManager([
 
13
        {
 
14
            'service': 'thruk-master',
 
15
            'ports': [80],  # ports to after start
 
16
            #'provided_data': [
 
17
            #    # context managers for provided relations
 
18
            #    # e.g.: helpers.HttpRelation()
 
19
            #],
 
20
            'required_data': [
 
21
                # data (contexts) required to start the service
 
22
                # e.g.: helpers.RequiredConfig('domain', 'auth_key'),
 
23
                #       helpers.MysqlRelation(),
 
24
                thruk_helpers.ThrukMasterRelation(),
 
25
            ],
 
26
            'data_ready': [
 
27
                helpers.render_template(
 
28
                    source='thruk_local.conf',
 
29
                    target='/etc/thruk/thruk_local.conf'),
 
30
                actions.log_start,
 
31
            ],
 
32
        },
 
33
    ])
 
34
    manager.manage()