Merge "Add params to tweak memory limit on mongodb"
[apex-tripleo-heat-templates.git] / puppet / services / database / mongodb.yaml
1 heat_template_version: ocata
2
3 description: >
4   MongoDb service deployment using puppet
5
6 parameters:
7   #Parameters not used EndpointMap
8   ServiceNetMap:
9     default: {}
10     description: Mapping of service_name -> network name. Typically set
11                  via parameter_defaults in the resource registry.  This
12                  mapping overrides those in ServiceNetMapDefaults.
13     type: json
14   DefaultPasswords:
15     default: {}
16     type: json
17   EndpointMap:
18     default: {}
19     description: Mapping of service endpoint -> protocol. Typically set
20                  via parameter_defaults in the resource registry.
21     type: json
22   MongodbMemoryLimit:
23     default: '20G'
24     description: Limit the amount of memory mongodb uses with systemd.
25     type: string
26   MongoDbLoggingSource:
27     type: json
28     description: Fluentd logging configuration for mongodb.
29     default:
30       tag: database.mongodb
31       path: /var/log/mongodb/mongodb.log
32       format: >-
33         /(?<time>\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d+\+\d{4})
34         (?<message>.*)$/
35
36 resources:
37   MongoDbBase:
38     type: ./mongodb-base.yaml
39     properties:
40       ServiceNetMap: {get_param: ServiceNetMap}
41       DefaultPasswords: {get_param: DefaultPasswords}
42       EndpointMap: {get_param: EndpointMap}
43
44 outputs:
45   role_data:
46     description: Service mongodb using composable services.
47     value:
48       service_name: mongodb
49       logging_groups:
50         - mongodb
51       logging_source: {get_param: MongoDbLoggingSource}
52       config_settings:
53         map_merge:
54           - get_attr: [MongoDbBase, role_data, config_settings]
55           - tripleo::profile::base::database::mongodb::mongodb_replset: {get_attr: [MongoDbBase, aux_parameters, rplset_name]}
56             tripleo::profile::base::database::mongodb::memory_limit: {get_param: MongodbMemoryLimit}
57             mongodb::server::service_manage: True
58             tripleo.mongodb.firewall_rules:
59               '101 mongodb_config':
60                 dport: 27019
61               '102 mongodb_sharding':
62                 dport: 27018
63               '103 mongod':
64                 dport: 27017
65             # NOTE: bind IP is found in Heat replacing the network name with the
66             # local node IP for the given network; replacement examples
67             # (eg. for internal_api):
68             # internal_api -> IP
69             # internal_api_uri -> [IP]
70             # internal_api_subnet - > IP/CIDR
71             mongodb::server::bind_ip: {get_param: [ServiceNetMap, MongodbNetwork]}
72       step_config: |
73         include ::tripleo::profile::base::database::mongodb
74       upgrade_tasks:
75         - name: Stop mongodb service
76           tags: step2
77           service: name=mongod state=stopped
78         - name: Start mongodb service
79           tags: step4
80           service: name=mongod state=started