Adds network/cidr mapping into a new service property
[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   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerMistralExecutorImage:
12     description: image
13     default: 'centos-binary-mistral-executor:latest'
14     type: string
15   DockerMistralConfigImage:
16     description: The container image to use for the mistral config_volume
17     default: 'centos-binary-mistral-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
47 resources:
48
49   ContainersCommon:
50     type: ./containers-common.yaml
51
52   MistralBase:
53     type: ../../puppet/services/mistral-executor.yaml
54     properties:
55       EndpointMap: {get_param: EndpointMap}
56       ServiceData: {get_param: ServiceData}
57       ServiceNetMap: {get_param: ServiceNetMap}
58       DefaultPasswords: {get_param: DefaultPasswords}
59       RoleName: {get_param: RoleName}
60       RoleParameters: {get_param: RoleParameters}
61
62 outputs:
63   role_data:
64     description: Role data for the Mistral Executor role.
65     value:
66       service_name: {get_attr: [MistralBase, role_data, service_name]}
67       config_settings:
68         map_merge:
69           - get_attr: [MistralBase, role_data, config_settings]
70       step_config: &step_config
71         get_attr: [MistralBase, role_data, step_config]
72       service_config_settings: {get_attr: [MistralBase, role_data, service_config_settings]}
73       # BEGIN DOCKER SETTINGS
74       puppet_config:
75         config_volume: mistral
76         puppet_tags: mistral_config
77         step_config: *step_config
78         config_image:
79           list_join:
80             - '/'
81             - [ {get_param: DockerNamespace}, {get_param: DockerMistralConfigImage} ]
82       kolla_config:
83         /var/lib/kolla/config_files/mistral_executor.json:
84           command: /usr/bin/mistral-server --config-file=/etc/mistral/mistral.conf --log-file=/var/log/mistral/executor.log --server=executor
85           config_files:
86             - source: "/var/lib/kolla/config_files/src/*"
87               dest: "/"
88               merge: true
89               preserve_properties: true
90           permissions:
91             - path: /var/log/mistral
92               owner: mistral:mistral
93               recurse: true
94       docker_config:
95         step_4:
96           mistral_executor:
97             image:
98               list_join:
99                 - '/'
100                 - [ {get_param: DockerNamespace}, {get_param: DockerMistralExecutorImage} ]
101             net: host
102             privileged: false
103             restart: always
104             volumes:
105               list_concat:
106                 - {get_attr: [ContainersCommon, volumes]}
107                 -
108                   - /var/lib/kolla/config_files/mistral_executor.json:/var/lib/kolla/config_files/config.json:ro
109                   - /var/lib/config-data/puppet-generated/mistral/:/var/lib/kolla/config_files/src:ro
110                   - /run:/run
111                   # FIXME: this is required in order for Nova cells
112                   # initialization workflows on the Undercloud. Need to
113                   # exclude this on the overcloud for security reasons.
114                   - /var/lib/config-data/nova/etc/nova:/etc/nova:ro
115                   - /var/log/containers/mistral:/var/log/mistral
116             environment:
117               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
118       host_prep_tasks:
119         - name: create persistent logs directory
120           file:
121             path: /var/log/containers/mistral
122             state: directory
123       upgrade_tasks:
124         - name: Stop and disable mistral_executor service
125           tags: step2
126           service: name=openstack-mistral-executor state=stopped enabled=no