Merge "Ensure httpd is not enabled by puppet on system boot"
[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   DockerComputeImage:
13     type: string
14   DockerComputeDataImage:
15     type: string
16   DockerLibvirtImage:
17     type: string
18   DockerNeutronAgentImage:
19     type: string
20   DockerOpenvswitchImage:
21     type: string
22   DockerOvsVswitchdImage:
23     type: string
24   DockerOpenvswitchDBImage:
25     type: string
26
27 resources:
28
29   ComputePuppetConfig:
30     type: OS::Heat::SoftwareConfig
31     properties:
32       group: puppet
33       options:
34         enable_hiera: True
35         enable_facter: False
36         tags: package,file,concat,file_line,nova_config,neutron_config,neutron_agent_ovs,neutron_plugin_ml2
37       inputs:
38       - name: tripleo::packages::enable_install
39         type: Boolean
40         default: True
41       outputs:
42       - name: result
43       config:
44         get_file: ../puppet/manifests/overcloud_compute.pp
45
46   ComputePuppetDeployment:
47     type: OS::Heat::SoftwareDeployments
48     properties:
49       servers:  {get_param: servers}
50       config: {get_resource: ComputePuppetConfig}
51       input_values:
52         update_identifier: {get_param: NodeConfigIdentifiers}
53         tripleo::packages::enable_install: True
54
55   CopyEtcConfig:
56     type: OS::Heat::SoftwareConfig
57     properties:
58       group: script
59       outputs:
60       - name: result
61       config: {get_file: ./copy-etc.sh}
62
63   CopyEtcDeployment:
64     type: OS::Heat::SoftwareDeployments
65     depends_on: ComputePuppetDeployment
66     properties:
67       config: {get_resource: CopyEtcConfig}
68       servers:  {get_param: servers}
69
70   NovaComputeContainersDeploymentOVS:
71     type: OS::Heat::StructuredDeployments
72     properties:
73       config: {get_resource: NovaComputeContainersConfigOVS}
74       servers: {get_param: servers}
75
76   NovaComputeContainersConfigOVS:
77     type: OS::Heat::StructuredConfig
78     properties:
79       group: docker-compose
80       config:
81         ovsvswitchd:
82           image: {get_param: DockerOvsVswitchdImage}
83           container_name: ovs-vswitchd
84           net: host
85           privileged: true
86           restart: always
87           volumes:
88            - /run:/run
89            - /lib/modules:/lib/modules:ro
90           environment:
91            - KOLLA_CONFIG_STRATEGY=CONFIG_EXTERNAL_COPY_ALWAYS
92
93         openvswitchdb:
94           image: {get_param: DockerOpenvswitchDBImage}
95           container_name: ovs-db-server
96           net: host
97           restart: always
98           volumes:
99            - /run:/run
100           environment:
101            - KOLLA_CONFIG_STRATEGY=CONFIG_EXTERNAL_COPY_ALWAYS
102
103   NovaComputeContainersDeploymentNetconfig:
104     type: OS::Heat::SoftwareDeployments
105     depends_on: NovaComputeContainersDeploymentOVS
106     properties:
107       config: {get_resource: NovaComputeContainersConfigNetconfig}
108       servers: {get_param: servers}
109
110   # We run os-net-config here because we depend on the ovs containers to be up
111   # and running before we configure the network.  This allows explicit timing
112   # of the network configuration.
113   NovaComputeContainersConfigNetconfig:
114     type: OS::Heat::SoftwareConfig
115     properties:
116       group: script
117       outputs:
118       - name: result
119       config: |
120         #!/bin/bash
121         /usr/local/bin/run-os-net-config
122
123   LibvirtContainersDeployment:
124     type: OS::Heat::StructuredDeployments
125     depends_on: [CopyEtcDeployment, ComputePuppetDeployment, NovaComputeContainersDeploymentNetconfig]
126     properties:
127       config: {get_resource: LibvirtContainersConfig}
128       servers: {get_param: servers}
129
130   LibvirtContainersConfig:
131     type: OS::Heat::StructuredConfig
132     properties:
133       group: docker-compose
134       config:
135         computedata:
136           image: {get_param: DockerComputeDataImage}
137           container_name: computedata
138
139         libvirt:
140           image: {get_param: DockerLibvirtImage}
141           container_name: libvirt
142           net: host
143           pid: host
144           privileged: true
145           restart: always
146           volumes:
147            - /run:/run
148            - /lib/modules:/lib/modules:ro
149            - /var/lib/etc-data/libvirt/libvirtd.conf:/opt/kolla/libvirtd/libvirtd.conf
150            - /var/lib/nova/instances:/var/lib/nova/instances
151           environment:
152            - KOLLA_CONFIG_STRATEGY=CONFIG_EXTERNAL_COPY_ALWAYS
153           volumes_from:
154            - computedata
155
156   NovaComputeContainersDeployment:
157     type: OS::Heat::StructuredDeployments
158     depends_on: [CopyEtcDeployment, ComputePuppetDeployment, NovaComputeContainersDeploymentNetconfig, LibvirtContainersDeployment]
159     properties:
160       config: {get_resource: NovaComputeContainersConfig}
161       servers: {get_param: servers}
162
163   NovaComputeContainersConfig:
164     type: OS::Heat::StructuredConfig
165     properties:
166       group: docker-compose
167       config:
168         openvswitch:
169           image: {get_param: DockerOpenvswitchImage}
170           container_name: openvswitch
171           net: host
172           privileged: true
173           restart: always
174           volumes:
175            - /run:/run
176            - /lib/modules:/lib/modules:ro
177            - /var/lib/etc-data/neutron/neutron.conf:/etc/kolla/neutron-openvswitch-agent/:ro
178            - /var/lib/etc-data/neutron/plugins/ml2/ml2_conf.ini:/etc/kolla/neutron-openvswitch-agent/:ro
179           environment:
180            - KOLLA_CONFIG_STRATEGY=CONFIG_EXTERNAL_COPY_ALWAYS
181           volumes_from:
182            - computedata
183            # FIXME: Kolla now uses a JSON model to run custom commands.  We rebuilt a custom container to read in KOLLA_COMMAND_ARGS
184
185         # FIXME: Here we're subjugating kolla's start scripts because we want our custom run command
186         neutronagent:
187           image: {get_param: DockerOpenvswitchImage}
188           container_name: neutronagent
189           net: host
190           pid: host
191           privileged: true
192           restart: always
193           volumes:
194            - /run:/run
195            - /lib/modules:/lib/modules:ro
196            - /var/lib/etc-data/neutron/neutron.conf:/etc/neutron/neutron.conf:ro
197            - /var/lib/etc-data/neutron/plugins/ml2/openvswitch_agent.ini:/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini:ro
198           environment:
199            - KOLLA_CONFIG_STRATEGY=CONFIG_EXTERNAL_COPY_ALWAYS
200            # FIXME: Kolla now uses a JSON model to run custom commands.  We rebuilt a custom container to read in KOLLA_COMMAND_ARGS
201            - KOLLA_COMMAND_ARGS=--config-file /usr/share/neutron/neutron-dist.conf --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini
202           volumes_from:
203            - computedata
204
205         novacompute:
206           image: {get_param: DockerComputeImage}
207           container_name: novacompute
208           net: host
209           privileged: true
210           restart: always
211           volumes:
212            - /run:/run
213            - /sys/fs/cgroup:/sys/fs/cgroup
214            - /lib/modules:/lib/modules:ro
215            - /var/lib/etc-data/:/etc/:ro
216            - /var/lib/nova/instances:/var/lib/nova/instances
217           volumes_from:
218            - computedata
219           # FIXME: this skips the kolla start.sh script and just starts Nova
220           # Ideally we'd have an environment that switched the kolla container
221           # to be externally configured.
222           command: /usr/bin/nova-compute
223
224   ExtraConfig:
225     depends_on: NovaComputeContainersDeployment
226     type: OS::TripleO::NodeExtraConfigPost
227     properties:
228         servers: {get_param: servers}