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