Merge "Add NeutronDnsDomain heat option, undercloud fix"
[apex-tripleo-heat-templates.git] / docker / services / nova-compute.yaml
1 heat_template_version: ocata
2
3 description: >
4   OpenStack containerized Nova Compute service
5
6 parameters:
7   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerNovaComputeImage:
12     description: image
13     default: 'centos-binary-nova-compute:latest'
14     type: string
15   ServiceNetMap:
16     default: {}
17     description: Mapping of service_name -> network name. Typically set
18                  via parameter_defaults in the resource registry.  This
19                  mapping overrides those in ServiceNetMapDefaults.
20     type: json
21   DefaultPasswords:
22     default: {}
23     type: json
24   EndpointMap:
25     default: {}
26     description: Mapping of service endpoint -> protocol. Typically set
27                  via parameter_defaults in the resource registry.
28     type: json
29
30 resources:
31
32   ContainersCommon:
33     type: ./containers-common.yaml
34
35   NovaComputeBase:
36     type: ../../puppet/services/nova-compute.yaml
37     properties:
38       EndpointMap: {get_param: EndpointMap}
39       ServiceNetMap: {get_param: ServiceNetMap}
40       DefaultPasswords: {get_param: DefaultPasswords}
41
42 outputs:
43   role_data:
44     description: Role data for the Nova Compute service.
45     value:
46       service_name: {get_attr: [NovaComputeBase, role_data, service_name]}
47       config_settings: {get_attr: [NovaComputeBase, role_data, config_settings]}
48       step_config: &step_config
49         get_attr: [NovaComputeBase, role_data, step_config]
50       puppet_config:
51         config_volume: nova_libvirt
52         puppet_tags: nova_config,nova_paste_api_ini
53         step_config: *step_config
54         config_image: &nova_compute_image
55           list_join:
56           - '/'
57           - [ {get_param: DockerNamespace}, {get_param: DockerNovaComputeImage} ]
58       kolla_config:
59         /var/lib/kolla/config_files/nova-compute.json:
60           command: /usr/bin/nova-compute --config-file /etc/nova/nova.conf --config-file /etc/nova/rootwrap.conf
61       docker_config:
62         # FIXME: run discover hosts here
63         step_4:
64           novacompute:
65             image: *nova_compute_image
66             net: host
67             privileged: true
68             user: root
69             restart: always
70             volumes:
71               yaql:
72                 expression: $.data.common.concat($.data.service)
73                 data:
74                   common: {get_attr: [ContainersCommon, volumes]}
75                   service:
76                     - /var/lib/kolla/config_files/nova-compute.json:/var/lib/kolla/config_files/config.json:ro
77                     - /var/lib/config-data/nova_libvirt/etc/nova/:/etc/nova/:ro
78                     - /dev:/dev
79                     - /etc/iscsi:/etc/iscsi
80                     - /lib/modules:/lib/modules:ro
81                     - /run:/run
82                     - /var/lib/nova:/var/lib/nova
83                     - /var/lib/libvirt:/var/lib/libvirt
84             environment:
85              - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
86       host_prep_tasks:
87         - name: create /var/lib/libvirt
88           file:
89             path: /var/lib/libvirt
90             state: directory
91       upgrade_tasks:
92         - name: Stop and disable nova-compute service
93           tags: step2
94           service: name=openstack-nova-compute state=stopped enabled=no