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