Merge "Enable composable upgrades for docker service templates"
[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
33   NovaComputeBase:
34     type: ../../puppet/services/nova-compute.yaml
35     properties:
36       EndpointMap: {get_param: EndpointMap}
37       ServiceNetMap: {get_param: ServiceNetMap}
38       DefaultPasswords: {get_param: DefaultPasswords}
39
40 outputs:
41   role_data:
42     description: Role data for the Nova Compute service.
43     value:
44       service_name: {get_attr: [NovaComputeBase, role_data, service_name]}
45       config_settings: {get_attr: [NovaComputeBase, role_data, config_settings]}
46       step_config: &step_config
47         get_attr: [NovaComputeBase, role_data, step_config]
48       docker_image: &nova_compute_image
49         list_join:
50         - '/'
51         - [ {get_param: DockerNamespace}, {get_param: DockerNovaComputeImage} ]
52       puppet_config:
53         config_volume: nova_libvirt
54         puppet_tags: nova_config,nova_paste_api_ini
55         step_config: *step_config
56         config_image: *nova_compute_image
57       kolla_config:
58         /var/lib/kolla/config_files/nova-compute.json:
59            command: /usr/bin/nova-compute --config-file /etc/nova/nova.conf --config-file /etc/nova/rootwrap.conf
60            config_files:
61            - dest: /etc/nova/nova.conf
62              owner: nova
63              perm: '0600'
64              source: /var/lib/kolla/config_files/src/etc/nova/nova.conf
65            - dest: /etc/nova/rootwrap.conf
66              owner: nova
67              perm: '0600'
68              source: /var/lib/kolla/config_files/src/etc/nova/rootwrap.conf
69       docker_config:
70         # FIXME: run discover hosts here
71         step_4:
72           novacompute:
73             image: *nova_compute_image
74             net: host
75             privileged: true
76             user: root
77             restart: always
78             volumes:
79               - /var/lib/kolla/config_files/nova-compute.json:/var/lib/kolla/config_files/config.json:ro
80               - /var/lib/config-data/nova_libvirt:/var/lib/kolla/config_files/src:ro
81               - /dev:/dev
82               - /etc/iscsi:/etc/iscsi
83               - /etc/localtime:/etc/localtime:ro
84               - /lib/modules:/lib/modules:ro
85               - /run:/run
86               - /var/lib/nova:/var/lib/nova
87               - libvirtd:/var/lib/libvirt
88             environment:
89              - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS