Merge "Replace outdated instruction with link to upstream doc"
[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   DockerNovaComputeImage:
8     description: image
9     type: string
10   DockerNovaLibvirtConfigImage:
11     description: The container image to use for the nova_libvirt config_volume
12     type: string
13   ServiceData:
14     default: {}
15     description: Dictionary packing service data
16     type: json
17   ServiceNetMap:
18     default: {}
19     description: Mapping of service_name -> network name. Typically set
20                  via parameter_defaults in the resource registry.  This
21                  mapping overrides those in ServiceNetMapDefaults.
22     type: json
23   DefaultPasswords:
24     default: {}
25     type: json
26   RoleName:
27     default: ''
28     description: Role name on which the service is applied
29     type: string
30   RoleParameters:
31     default: {}
32     description: Parameters specific to the role
33     type: json
34   EndpointMap:
35     default: {}
36     description: Mapping of service endpoint -> protocol. Typically set
37                  via parameter_defaults in the resource registry.
38     type: json
39   DockerNovaMigrationSshdPort:
40     default: 2022
41     description: Port that dockerized nova migration target sshd service
42                  binds to.
43     type: number
44
45 resources:
46
47   ContainersCommon:
48     type: ./containers-common.yaml
49
50   NovaComputeBase:
51     type: ../../puppet/services/nova-compute.yaml
52     properties:
53       EndpointMap: {get_param: EndpointMap}
54       ServiceData: {get_param: ServiceData}
55       ServiceNetMap: {get_param: ServiceNetMap}
56       DefaultPasswords: {get_param: DefaultPasswords}
57       RoleName: {get_param: RoleName}
58       RoleParameters: {get_param: RoleParameters}
59       MigrationSshPort: {get_param: DockerNovaMigrationSshdPort}
60
61 outputs:
62   role_data:
63     description: Role data for the Nova Compute service.
64     value:
65       service_name: {get_attr: [NovaComputeBase, role_data, service_name]}
66       config_settings:
67         get_attr: [NovaComputeBase, role_data, config_settings]
68       step_config: &step_config
69         get_attr: [NovaComputeBase, role_data, step_config]
70       puppet_config:
71         config_volume: nova_libvirt
72         puppet_tags: nova_config,nova_paste_api_ini
73         step_config: *step_config
74         config_image: {get_param: DockerNovaLibvirtConfigImage}
75       kolla_config:
76         /var/lib/kolla/config_files/nova_compute.json:
77           command: /usr/bin/nova-compute --config-file /etc/nova/nova.conf --config-file /etc/nova/rootwrap.conf
78           config_files:
79             - source: "/var/lib/kolla/config_files/src/*"
80               dest: "/"
81               merge: true
82               preserve_properties: true
83             - source: "/var/lib/kolla/config_files/src-iscsid/*"
84               dest: "/"
85               merge: true
86               preserve_properties: true
87           permissions:
88             - path: /var/log/nova
89               owner: nova:nova
90               recurse: true
91             - path: /var/lib/nova
92               owner: nova:nova
93               recurse: true
94       docker_config:
95         # FIXME: run discover hosts here
96         step_4:
97           nova_compute:
98             image: &nova_compute_image {get_param: DockerNovaComputeImage}
99             net: host
100             privileged: true
101             user: nova
102             restart: always
103             volumes:
104               list_concat:
105                 - {get_attr: [ContainersCommon, volumes]}
106                 -
107                   - /var/lib/kolla/config_files/nova_compute.json:/var/lib/kolla/config_files/config.json:ro
108                   - /var/lib/config-data/puppet-generated/nova_libvirt/:/var/lib/kolla/config_files/src:ro
109                   - /var/lib/config-data/puppet-generated/iscsid/:/var/lib/kolla/config_files/src-iscsid:ro
110                   - /dev:/dev
111                   - /lib/modules:/lib/modules:ro
112                   - /run:/run
113                   - /var/lib/nova:/var/lib/nova
114                   - /var/lib/libvirt:/var/lib/libvirt
115                   - /var/log/containers/nova:/var/log/nova
116             environment:
117              - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
118       host_prep_tasks:
119         - name: create persistent directories
120           file:
121             path: "{{ item }}"
122             state: directory
123           with_items:
124             - /var/log/containers/nova
125             - /var/lib/nova
126             - /var/lib/libvirt
127       upgrade_tasks:
128         - name: Stop and disable nova-compute service
129           tags: step2
130           service: name=openstack-nova-compute state=stopped enabled=no