Remove DockerNamespace references
[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
40 resources:
41
42   ContainersCommon:
43     type: ./containers-common.yaml
44
45   NovaComputeBase:
46     type: ../../puppet/services/nova-compute.yaml
47     properties:
48       EndpointMap: {get_param: EndpointMap}
49       ServiceData: {get_param: ServiceData}
50       ServiceNetMap: {get_param: ServiceNetMap}
51       DefaultPasswords: {get_param: DefaultPasswords}
52       RoleName: {get_param: RoleName}
53       RoleParameters: {get_param: RoleParameters}
54
55 outputs:
56   role_data:
57     description: Role data for the Nova Compute service.
58     value:
59       service_name: {get_attr: [NovaComputeBase, role_data, service_name]}
60       config_settings:
61         map_merge:
62           - get_attr: [NovaComputeBase, role_data, config_settings]
63           # FIXME: we need to disable migration for now as the
64           # hieradata is common for all services, and this means nova
65           # and nova_placement puppet runs also try to configure
66           # libvirt, and they fail. We can remove this override when
67           # we have hieradata separation between containers.
68           - tripleo::profile::base::nova::manage_migration: false
69       step_config: &step_config
70         get_attr: [NovaComputeBase, role_data, step_config]
71       puppet_config:
72         config_volume: nova_libvirt
73         puppet_tags: nova_config,nova_paste_api_ini
74         step_config: *step_config
75         config_image: {get_param: DockerNovaLibvirtConfigImage}
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           config_files:
80             - source: "/var/lib/kolla/config_files/src/*"
81               dest: "/"
82               merge: true
83               preserve_properties: true
84           permissions:
85             - path: /var/log/nova
86               owner: nova:nova
87               recurse: true
88             - path: /var/lib/nova
89               owner: nova:nova
90               recurse: true
91       docker_config:
92         # FIXME: run discover hosts here
93         step_4:
94           nova_compute:
95             image: &nova_compute_image {get_param: DockerNovaComputeImage}
96             net: host
97             privileged: true
98             user: nova
99             restart: always
100             volumes:
101               list_concat:
102                 - {get_attr: [ContainersCommon, volumes]}
103                 -
104                   - /var/lib/kolla/config_files/nova_compute.json:/var/lib/kolla/config_files/config.json:ro
105                   - /var/lib/config-data/puppet-generated/nova_libvirt/:/var/lib/kolla/config_files/src:ro
106                   - /dev:/dev
107                   - /etc/iscsi:/etc/iscsi
108                   - /lib/modules:/lib/modules:ro
109                   - /run:/run
110                   - /var/lib/nova:/var/lib/nova
111                   - /var/lib/libvirt:/var/lib/libvirt
112                   - /var/log/containers/nova:/var/log/nova
113             environment:
114              - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
115       host_prep_tasks:
116         - name: create persistent directories
117           file:
118             path: "{{ item }}"
119             state: directory
120           with_items:
121             - /var/log/containers/nova
122             - /var/lib/nova
123             - /var/lib/libvirt
124       upgrade_tasks:
125         - name: Stop and disable nova-compute service
126           tags: step2
127           service: name=openstack-nova-compute state=stopped enabled=no