Use a single configuration file for specifying docker containers.
[apex-tripleo-heat-templates.git] / docker / services / mistral-executor.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack containerized Mistral Executor service
5
6 parameters:
7   DockerMistralExecutorImage:
8     description: image
9     type: string
10   DockerMistralConfigImage:
11     description: The container image to use for the mistral 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
37 resources:
38
39   ContainersCommon:
40     type: ./containers-common.yaml
41
42   MistralBase:
43     type: ../../puppet/services/mistral-executor.yaml
44     properties:
45       EndpointMap: {get_param: EndpointMap}
46       ServiceNetMap: {get_param: ServiceNetMap}
47       DefaultPasswords: {get_param: DefaultPasswords}
48       RoleName: {get_param: RoleName}
49       RoleParameters: {get_param: RoleParameters}
50
51 outputs:
52   role_data:
53     description: Role data for the Mistral Executor role.
54     value:
55       service_name: {get_attr: [MistralBase, role_data, service_name]}
56       config_settings:
57         map_merge:
58           - get_attr: [MistralBase, role_data, config_settings]
59       step_config: &step_config
60         get_attr: [MistralBase, role_data, step_config]
61       service_config_settings: {get_attr: [MistralBase, role_data, service_config_settings]}
62       # BEGIN DOCKER SETTINGS
63       puppet_config:
64         config_volume: mistral
65         puppet_tags: mistral_config
66         step_config: *step_config
67         config_image: {get_param: DockerMistralConfigImage}
68       kolla_config:
69         /var/lib/kolla/config_files/mistral_executor.json:
70           command: /usr/bin/mistral-server --config-file=/etc/mistral/mistral.conf --log-file=/var/log/mistral/executor.log --server=executor
71           config_files:
72             - source: "/var/lib/kolla/config_files/src/*"
73               dest: "/"
74               merge: true
75               preserve_properties: true
76           permissions:
77             - path: /var/log/mistral
78               owner: mistral:mistral
79               recurse: true
80       docker_config:
81         step_4:
82           mistral_executor:
83             image: {get_param: DockerMistralExecutorImage}
84             net: host
85             privileged: false
86             restart: always
87             volumes:
88               list_concat:
89                 - {get_attr: [ContainersCommon, volumes]}
90                 -
91                   - /var/lib/kolla/config_files/mistral_executor.json:/var/lib/kolla/config_files/config.json:ro
92                   - /var/lib/config-data/puppet-generated/mistral/:/var/lib/kolla/config_files/src:ro
93                   - /run:/run
94                   # FIXME: this is required in order for Nova cells
95                   # initialization workflows on the Undercloud. Need to
96                   # exclude this on the overcloud for security reasons.
97                   - /var/lib/config-data/nova/etc/nova:/etc/nova:ro
98                   - /var/log/containers/mistral:/var/log/mistral
99             environment:
100               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
101       host_prep_tasks:
102         - name: create persistent logs directory
103           file:
104             path: /var/log/containers/mistral
105             state: directory
106       upgrade_tasks:
107         - name: Stop and disable mistral_executor service
108           tags: step2
109           service: name=openstack-mistral-executor state=stopped enabled=no