Merge "Support Redfish hardware in the overcloud Ironic"
[apex-tripleo-heat-templates.git] / docker / services / nova-compute.yaml
1 heat_template_version: pike
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   RoleName:
25     default: ''
26     description: Role name on which the service is applied
27     type: string
28   RoleParameters:
29     default: {}
30     description: Parameters specific to the role
31     type: json
32   EndpointMap:
33     default: {}
34     description: Mapping of service endpoint -> protocol. Typically set
35                  via parameter_defaults in the resource registry.
36     type: json
37
38 resources:
39
40   ContainersCommon:
41     type: ./containers-common.yaml
42
43   NovaComputeBase:
44     type: ../../puppet/services/nova-compute.yaml
45     properties:
46       EndpointMap: {get_param: EndpointMap}
47       ServiceNetMap: {get_param: ServiceNetMap}
48       DefaultPasswords: {get_param: DefaultPasswords}
49       RoleName: {get_param: RoleName}
50       RoleParameters: {get_param: RoleParameters}
51
52 outputs:
53   role_data:
54     description: Role data for the Nova Compute service.
55     value:
56       service_name: {get_attr: [NovaComputeBase, role_data, service_name]}
57       config_settings:
58         map_merge:
59           - get_attr: [NovaComputeBase, role_data, config_settings]
60           # FIXME: we need to disable migration for now as the
61           # hieradata is common for all services, and this means nova
62           # and nova_placement puppet runs also try to configure
63           # libvirt, and they fail. We can remove this override when
64           # we have hieradata separation between containers.
65           - tripleo::profile::base::nova::manage_migration: false
66       step_config: &step_config
67         get_attr: [NovaComputeBase, role_data, step_config]
68       puppet_config:
69         config_volume: nova_libvirt
70         puppet_tags: nova_config,nova_paste_api_ini
71         step_config: *step_config
72         config_image: &nova_compute_image
73           list_join:
74           - '/'
75           - [ {get_param: DockerNamespace}, {get_param: DockerNovaComputeImage} ]
76       kolla_config:
77         /var/lib/kolla/config_files/nova-compute.json:
78           command: /usr/bin/nova-compute --config-file /etc/nova/nova.conf --config-file /etc/nova/rootwrap.conf
79           permissions:
80             - path: /var/log/nova
81               owner: nova:nova
82               recurse: true
83             - path: /var/lib/nova
84               owner: nova:nova
85               recurse: true
86       docker_config:
87         # FIXME: run discover hosts here
88         step_4:
89           novacompute:
90             image: *nova_compute_image
91             net: host
92             privileged: true
93             user: root
94             restart: always
95             volumes:
96               list_concat:
97                 - {get_attr: [ContainersCommon, volumes]}
98                 -
99                   - /var/lib/kolla/config_files/nova-compute.json:/var/lib/kolla/config_files/config.json:ro
100                   - /var/lib/config-data/nova_libvirt/etc/nova/:/etc/nova/:ro
101                   - /dev:/dev
102                   - /etc/iscsi:/etc/iscsi
103                   - /lib/modules:/lib/modules:ro
104                   - /run:/run
105                   - /var/lib/nova:/var/lib/nova
106                   - /var/lib/libvirt:/var/lib/libvirt
107                   - /var/log/containers/nova:/var/log/nova
108             environment:
109              - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
110       host_prep_tasks:
111         - name: create persistent directories
112           file:
113             path: "{{ item }}"
114             state: directory
115           with_items:
116             - /var/log/containers/nova
117             - /var/lib/nova
118             - /var/lib/libvirt
119       upgrade_tasks:
120         - name: Stop and disable nova-compute service
121           tags: step2
122           service: name=openstack-nova-compute state=stopped enabled=no