Merge "Containerize Cinder-volume for HA"
[apex-tripleo-heat-templates.git] / docker / services / collectd.yaml
1 heat_template_version: pike
2
3 description: >
4   Containerized collectd service
5
6 parameters:
7   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerCollectdImage:
12     description: image
13     default: 'centos-binary-collectd:latest'
14     type: string
15   EndpointMap:
16     default: {}
17     description: Mapping of service endpoint -> protocol. Typically set
18                  via parameter_defaults in the resource registry.
19     type: json
20   ServiceNetMap:
21     default: {}
22     description: Mapping of service_name -> network name. Typically set
23                  via parameter_defaults in the resource registry.  This
24                  mapping overrides those in ServiceNetMapDefaults.
25     type: json
26   DefaultPasswords:
27     default: {}
28     type: json
29   RoleName:
30     default: ''
31     description: Role name on which the service is applied
32     type: string
33   RoleParameters:
34     default: {}
35     description: Parameters specific to the role
36     type: json
37
38
39 resources:
40
41   ContainersCommon:
42     type: ./containers-common.yaml
43
44   CollectdBase:
45     type: ../../puppet/services/metrics/collectd.yaml
46     properties:
47       EndpointMap: {get_param: EndpointMap}
48       ServiceNetMap: {get_param: ServiceNetMap}
49       DefaultPasswords: {get_param: DefaultPasswords}
50       RoleName: {get_param: RoleName}
51       RoleParameters: {get_param: RoleParameters}
52
53 outputs:
54   role_data:
55     description: Role data for the collectd role.
56     value:
57       service_name: {get_attr: [CollectdBase, role_data, service_name]}
58       config_settings: {get_attr: [CollectdBase, role_data, config_settings]}
59       step_config: &step_config
60         get_attr: [CollectdBase, role_data, step_config]
61       service_config_settings: {get_attr: [CollectdBase, role_data, service_config_settings]}
62       # BEGIN DOCKER SETTINGS
63       puppet_config:
64         config_volume: collectd
65         puppet_tags:  collectd_client_config
66         step_config: *step_config
67         config_image: &collectd_image
68           list_join:
69             - '/'
70             - [ {get_param: DockerNamespace}, {get_param: DockerCollectdImage} ]
71       kolla_config:
72         /var/lib/kolla/config_files/collectd.json:
73           command: /usr/sbin/collectd -f
74       docker_config:
75         step_3:
76           collectd:
77             image: *collectd_image
78             net: host
79             privileged: true
80             restart: always
81             volumes:
82               list_concat:
83                 - {get_attr: [ContainersCommon, volumes]}
84                 -
85                   - /var/run/docker.sock:/var/run/docker.sock:rw
86                   - /var/lib/kolla/config_files/collectd.json:/var/lib/kolla/config_files/config.json:ro
87                   - /var/lib/config-data/collectd/etc/collectd/:/etc/collectd/:ro
88             environment:
89               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
90       upgrade_tasks:
91         - name: Stop and disable collectd service
92           tags: step2
93           service: name=collectd.service state=stopped enabled=no
94