Merge "Make enabling of controller services configurable."
[apex-tripleo-heat-templates.git] / docker / compute-post.yaml
1 heat_template_version: 2015-04-30
2
3 description: >
4   OpenStack compute node post deployment for Docker.
5
6 parameters:
7   servers:
8     type: json
9   NodeConfigIdentifiers:
10      type: json
11      description: Value which changes if the node configuration may need to be re-applied
12   DockerNamespace:
13     type: string
14     default: tripleoupstream
15   DockerComputeImage:
16     type: string
17   DockerComputeDataImage:
18     type: string
19   DockerLibvirtImage:
20     type: string
21   DockerNeutronAgentImage:
22     type: string
23   DockerOpenvswitchImage:
24     type: string
25   DockerOvsVswitchdImage:
26     type: string
27   DockerOpenvswitchDBImage:
28     type: string
29
30 resources:
31
32   ComputePuppetConfig:
33     type: OS::Heat::SoftwareConfig
34     properties:
35       group: puppet
36       options:
37         enable_hiera: True
38         enable_facter: False
39         tags: package,file,concat,file_line,nova_config,neutron_config,neutron_agent_ovs,neutron_plugin_ml2
40       inputs:
41       - name: tripleo::packages::enable_install
42         type: Boolean
43         default: True
44       outputs:
45       - name: result
46       config:
47         get_file: ../puppet/manifests/overcloud_compute.pp
48
49   ComputePuppetDeployment:
50     type: OS::Heat::SoftwareDeployments
51     properties:
52       servers:  {get_param: servers}
53       config: {get_resource: ComputePuppetConfig}
54       input_values:
55         update_identifier: {get_param: NodeConfigIdentifiers}
56         tripleo::packages::enable_install: True
57
58   CopyEtcConfig:
59     type: OS::Heat::SoftwareConfig
60     properties:
61       group: script
62       outputs:
63       - name: result
64       config: {get_file: ./copy-etc.sh}
65
66   CopyEtcDeployment:
67     type: OS::Heat::SoftwareDeployments
68     depends_on: ComputePuppetDeployment
69     properties:
70       config: {get_resource: CopyEtcConfig}
71       servers:  {get_param: servers}
72
73   CopyJsonConfig:
74     type: OS::Heat::SoftwareConfig
75     properties:
76       group: script
77       outputs:
78       - name: result
79       config: {get_file: ./generate_json_config.sh}
80
81   CopyJsonDeployment:
82     type: OS::Heat::SoftwareDeployments
83     depends_on: CopyEtcDeployment
84     properties:
85       config: {get_resource: CopyJsonConfig}
86       servers:  {get_param: servers}
87
88   NovaComputeContainersDeploymentOVS:
89     type: OS::Heat::StructuredDeployments
90     depends_on: CopyJsonDeployment
91     properties:
92       config: {get_resource: NovaComputeContainersConfigOVS}
93       servers: {get_param: servers}
94
95   NovaComputeContainersConfigOVS:
96     type: OS::Heat::StructuredConfig
97     properties:
98       group: docker-compose
99       config:
100         ovsvswitchd:
101           image:
102             list_join:
103             - '/'
104             - [ {get_param: DockerNamespace}, {get_param: DockerOvsVswitchdImage} ]
105           container_name: ovs-vswitchd
106           net: host
107           privileged: true
108           restart: always
109           volumes:
110            - /run:/run
111            - /lib/modules:/lib/modules:ro
112            - /var/lib/etc-data/json-config/ovs-vswitchd.json:/var/lib/kolla/config_files/config.json
113           environment:
114            - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
115
116         openvswitchdb:
117           image:
118             list_join:
119             - '/'
120             - [ {get_param: DockerNamespace}, {get_param: DockerOpenvswitchDBImage} ]
121           container_name: ovs-db-server
122           net: host
123           restart: always
124           volumes:
125            - /run:/run
126            - /var/lib/etc-data/json-config/ovs-dbserver.json:/var/lib/kolla/config_files/config.json
127           environment:
128            - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
129
130   NovaComputeContainersDeploymentNetconfig:
131     type: OS::Heat::SoftwareDeployments
132     depends_on: NovaComputeContainersDeploymentOVS
133     properties:
134       config: {get_resource: NovaComputeContainersConfigNetconfig}
135       servers: {get_param: servers}
136
137   # We run os-net-config here because we depend on the ovs containers to be up
138   # and running before we configure the network.  This allows explicit timing
139   # of the network configuration.
140   NovaComputeContainersConfigNetconfig:
141     type: OS::Heat::SoftwareConfig
142     properties:
143       group: script
144       outputs:
145       - name: result
146       config: |
147         #!/bin/bash
148         /usr/local/bin/run-os-net-config
149
150   LibvirtContainersDeployment:
151     type: OS::Heat::StructuredDeployments
152     depends_on: [CopyJsonDeployment, CopyEtcDeployment, ComputePuppetDeployment, NovaComputeContainersDeploymentNetconfig]
153     properties:
154       config: {get_resource: LibvirtContainersConfig}
155       servers: {get_param: servers}
156
157   LibvirtContainersConfig:
158     type: OS::Heat::StructuredConfig
159     properties:
160       group: docker-compose
161       config:
162         computedata:
163           image:
164             list_join:
165             - '/'
166             - [ {get_param: DockerNamespace}, {get_param: DockerComputeDataImage} ]
167           container_name: computedata
168           volumes:
169            - /var/lib/nova/instances
170            - /var/lib/libvirt
171
172         libvirt:
173           image:
174             list_join:
175             - '/'
176             - [ {get_param: DockerNamespace}, {get_param: DockerLibvirtImage} ]
177           container_name: libvirt
178           net: host
179           pid: host
180           privileged: true
181           restart: always
182           volumes:
183            - /run:/run
184            - /lib/modules:/lib/modules:ro
185            - /sys/fs/cgroup:/sys/fs/cgroup
186            - /var/lib/etc-data/json-config/nova-libvirt.json:/var/lib/kolla/config_files/config.json
187            - /var/lib/etc-data/libvirt/libvirtd.conf:/var/lib/kolla/config_files/libvirtd.conf
188           environment:
189            - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
190           volumes_from:
191            - computedata
192
193   NovaComputeContainersDeployment:
194     type: OS::Heat::StructuredDeployments
195     depends_on: [CopyJsonDeployment, CopyEtcDeployment, ComputePuppetDeployment, NovaComputeContainersDeploymentNetconfig, LibvirtContainersDeployment]
196     properties:
197       config: {get_resource: NovaComputeContainersConfig}
198       servers: {get_param: servers}
199
200   NovaComputeContainersConfig:
201     type: OS::Heat::StructuredConfig
202     properties:
203       group: docker-compose
204       config:
205         openvswitch:
206           image:
207             list_join:
208             - '/'
209             - [ {get_param: DockerNamespace}, {get_param: DockerOpenvswitchImage} ]
210           container_name: openvswitch
211           net: host
212           privileged: true
213           restart: always
214           volumes:
215            - /run:/run
216            - /lib/modules:/lib/modules:ro
217            - /var/lib/etc-data/json-config/neutron-openvswitch-agent.json:/var/lib/kolla/config_files/config.json
218            - /var/lib/etc-data/neutron/neutron.conf:/etc/kolla/neutron-openvswitch-agent/:ro
219            - /var/lib/etc-data/neutron/plugins/ml2/ml2_conf.ini:/var/lib/kolla/config_files/ml2_conf.ini:ro
220            - /var/lib/etc-data/neutron/neutron.conf:/var/lib/kolla/config_files/neutron.conf:ro
221           environment:
222            - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
223           volumes_from:
224            - computedata
225
226         neutronagent:
227           image:
228             list_join:
229             - '/'
230             - [ {get_param: DockerNamespace}, {get_param: DockerOpenvswitchImage} ]
231           container_name: neutronagent
232           net: host
233           pid: host
234           privileged: true
235           restart: always
236           volumes:
237            - /run:/run
238            - /lib/modules:/lib/modules:ro
239            - /var/lib/etc-data/json-config/neutron-agent.json:/var/lib/kolla/config_files/config.json
240            - /var/lib/etc-data/neutron/plugins/ml2/openvswitch_agent.ini:/var/lib/kolla/config_files/ovs_neutron_plugin.ini:ro
241            - /var/lib/etc-data/neutron/neutron.conf:/var/lib/kolla/config_files/neutron.conf:ro
242           environment:
243            - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
244           volumes_from:
245            - computedata
246
247         novacompute:
248           image:
249             list_join:
250             - '/'
251             - [ {get_param: DockerNamespace}, {get_param: DockerComputeImage} ]
252           container_name: novacompute
253           net: host
254           privileged: true
255           restart: always
256           volumes:
257            - /run:/run
258            - /lib/modules:/lib/modules:ro
259            - /var/lib/etc-data/json-config/nova-compute.json:/var/lib/kolla/config_files/config.json
260            - /var/lib/etc-data/nova/nova.conf:/var/lib/kolla/config_files/nova.conf:ro
261           environment:
262            - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
263           volumes_from:
264            - computedata
265
266   ExtraConfig:
267     depends_on: NovaComputeContainersDeployment
268     type: OS::TripleO::NodeExtraConfigPost
269     properties:
270         servers: {get_param: servers}