Adds network/cidr mapping into a new service property
[apex-tripleo-heat-templates.git] / docker / services / gnocchi-metricd.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack containerized Gnocchi Metricd service
5
6 parameters:
7   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerGnocchiMetricdImage:
12     description: image
13     default: 'centos-binary-gnocchi-metricd:latest'
14     type: string
15   DockerGnocchiConfigImage:
16     description: The container image to use for the gnocchi config_volume
17     default: 'centos-binary-gnocchi-api:latest'
18     type: string
19   EndpointMap:
20     default: {}
21     description: Mapping of service endpoint -> protocol. Typically set
22                  via parameter_defaults in the resource registry.
23     type: json
24   ServiceData:
25     default: {}
26     description: Dictionary packing service data
27     type: json
28   ServiceNetMap:
29     default: {}
30     description: Mapping of service_name -> network name. Typically set
31                  via parameter_defaults in the resource registry.  This
32                  mapping overrides those in ServiceNetMapDefaults.
33     type: json
34   DefaultPasswords:
35     default: {}
36     type: json
37   RoleName:
38     default: ''
39     description: Role name on which the service is applied
40     type: string
41   RoleParameters:
42     default: {}
43     description: Parameters specific to the role
44     type: json
45
46 resources:
47
48   ContainersCommon:
49     type: ./containers-common.yaml
50
51   GnocchiMetricdBase:
52     type: ../../puppet/services/gnocchi-metricd.yaml
53     properties:
54       EndpointMap: {get_param: EndpointMap}
55       ServiceData: {get_param: ServiceData}
56       ServiceNetMap: {get_param: ServiceNetMap}
57       DefaultPasswords: {get_param: DefaultPasswords}
58       RoleName: {get_param: RoleName}
59       RoleParameters: {get_param: RoleParameters}
60
61 outputs:
62   role_data:
63     description: Role data for the Gnocchi API role.
64     value:
65       service_name: {get_attr: [GnocchiMetricdBase, role_data, service_name]}
66       config_settings: {get_attr: [GnocchiMetricdBase, role_data, config_settings]}
67       step_config: &step_config
68         get_attr: [GnocchiMetricdBase, role_data, step_config]
69       service_config_settings: {get_attr: [GnocchiMetricdBase, role_data, service_config_settings]}
70       # BEGIN DOCKER SETTINGS
71       puppet_config:
72         config_volume: gnocchi
73         puppet_tags: gnocchi_config
74         step_config: *step_config
75         config_image:
76           list_join:
77             - '/'
78             - [ {get_param: DockerNamespace}, {get_param: DockerGnocchiConfigImage} ]
79       kolla_config:
80         /var/lib/kolla/config_files/gnocchi_metricd.json:
81           command: /usr/bin/gnocchi-metricd
82           config_files:
83             - source: "/var/lib/kolla/config_files/src/*"
84               dest: "/"
85               merge: true
86               preserve_properties: true
87           permissions:
88             - path: /var/log/gnocchi
89               owner: gnocchi:gnocchi
90               recurse: true
91       docker_config:
92         step_4:
93           gnocchi_metricd:
94             image:
95               list_join:
96                 - '/'
97                 - [ {get_param: DockerNamespace}, {get_param: DockerGnocchiMetricdImage} ]
98             net: host
99             privileged: false
100             restart: always
101             volumes:
102               list_concat:
103                 - {get_attr: [ContainersCommon, volumes]}
104                 -
105                   - /var/lib/kolla/config_files/gnocchi_metricd.json:/var/lib/kolla/config_files/config.json:ro
106                   - /var/lib/config-data/puppet-generated/gnocchi/:/var/lib/kolla/config_files/src:ro
107                   - /var/log/containers/gnocchi:/var/log/gnocchi
108             environment:
109               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
110       host_prep_tasks:
111         - name: create persistent logs directory
112           file:
113             path: /var/log/containers/gnocchi
114             state: directory
115       upgrade_tasks:
116         - name: Stop and disable openstack-gnocchi-metricd service
117           tags: step2
118           service: name=openstack-gnocchi-metricd.service state=stopped enabled=no