Merge "Open ports 443 and 80 on haproxy's firewall when horizon is standalone"
[apex-tripleo-heat-templates.git] / puppet / services / database / mongodb.yaml
1 heat_template_version: pike
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   RoleName:
18     default: ''
19     description: Role name on which the service is applied
20     type: string
21   RoleParameters:
22     default: {}
23     description: Parameters specific to the role
24     type: json
25   EndpointMap:
26     default: {}
27     description: Mapping of service endpoint -> protocol. Typically set
28                  via parameter_defaults in the resource registry.
29     type: json
30   MongodbMemoryLimit:
31     default: '20G'
32     description: Limit the amount of memory mongodb uses with systemd.
33     type: string
34   MongoDbLoggingSource:
35     type: json
36     description: Fluentd logging configuration for mongodb.
37     default:
38       tag: database.mongodb
39       path: /var/log/mongodb/mongodb.log
40       format: >-
41         /(?<time>\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d+\+\d{4})
42         (?<message>.*)$/
43
44 resources:
45   MongoDbBase:
46     type: ./mongodb-base.yaml
47     properties:
48       ServiceNetMap: {get_param: ServiceNetMap}
49       DefaultPasswords: {get_param: DefaultPasswords}
50       EndpointMap: {get_param: EndpointMap}
51       RoleName: {get_param: RoleName}
52       RoleParameters: {get_param: RoleParameters}
53
54 outputs:
55   role_data:
56     description: Service mongodb using composable services.
57     value:
58       service_name: mongodb
59       logging_groups:
60         - mongodb
61       logging_source: {get_param: MongoDbLoggingSource}
62       config_settings:
63         map_merge:
64           - get_attr: [MongoDbBase, role_data, config_settings]
65           - tripleo::profile::base::database::mongodb::mongodb_replset: {get_attr: [MongoDbBase, aux_parameters, rplset_name]}
66             tripleo::profile::base::database::mongodb::memory_limit: {get_param: MongodbMemoryLimit}
67             mongodb::server::service_manage: True
68             tripleo.mongodb.firewall_rules:
69               '101 mongodb_config':
70                 dport: 27019
71               '102 mongodb_sharding':
72                 dport: 27018
73               '103 mongod':
74                 dport: 27017
75             # NOTE: bind IP is found in Heat replacing the network name with the
76             # local node IP for the given network; replacement examples
77             # (eg. for internal_api):
78             # internal_api -> IP
79             # internal_api_uri -> [IP]
80             # internal_api_subnet - > IP/CIDR
81             mongodb::server::bind_ip: {get_param: [ServiceNetMap, MongodbNetwork]}
82       step_config: |
83         include ::tripleo::profile::base::database::mongodb
84       upgrade_tasks:
85         - name: Stop mongodb service
86           tags: step2
87           service: name=mongod state=stopped
88         - name: Start mongodb service
89           tags: step4
90           service: name=mongod state=started