b0952b1d2ddd8ffded6f227c8e86cc66827aa186
[apex-tripleo-heat-templates.git] / docker / services / nova-ironic.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack containerized Nova Ironic 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-ironic:latest'
14     type: string
15   DockerNovaConfigImage:
16     description: image
17     default: 'centos-binary-nova-base:latest'
18     type: string
19   ServiceNetMap:
20     default: {}
21     description: Mapping of service_name -> network name. Typically set
22                  via parameter_defaults in the resource registry.  This
23                  mapping overrides those in ServiceNetMapDefaults.
24     type: json
25   DefaultPasswords:
26     default: {}
27     type: json
28   EndpointMap:
29     default: {}
30     description: Mapping of service endpoint -> protocol. Typically set
31                  via parameter_defaults in the resource registry.
32     type: json
33
34 resources:
35
36   ContainersCommon:
37     type: ./containers-common.yaml
38
39   NovaIronicBase:
40     type: ../../puppet/services/nova-ironic.yaml
41     properties:
42       EndpointMap: {get_param: EndpointMap}
43
44 outputs:
45   role_data:
46     description: Role data for the Nova Compute service.
47     value:
48       service_name: {get_attr: [NovaIronicBase, role_data, service_name]}
49       config_settings: {get_attr: [NovaIronicBase, role_data, config_settings]}
50       step_config: &step_config
51         get_attr: [NovaIronicBase, role_data, step_config]
52       puppet_config:
53         config_volume: nova
54         puppet_tags: nova_config,nova_paste_api_ini
55         step_config: *step_config
56         config_image:
57           list_join:
58           - '/'
59           - [ {get_param: DockerNamespace}, {get_param: DockerNovaConfigImage} ]
60       kolla_config:
61         /var/lib/kolla/config_files/nova_ironic.json:
62           command: /usr/bin/nova-compute --config-file /etc/nova/nova.conf --config-file /etc/nova/rootwrap.conf
63           permissions:
64             - path: /var/log/nova
65               owner: nova:nova
66               recurse: true
67             - path: /var/lib/nova
68               owner: nova:nova
69               recurse: true
70       docker_config:
71         step_5:
72           novacompute:
73             image:
74               list_join:
75               - '/'
76               - [ {get_param: DockerNamespace}, {get_param: DockerNovaComputeImage} ]
77             net: host
78             privileged: true
79             user: root
80             restart: always
81             volumes:
82               list_concat:
83                 - {get_attr: [ContainersCommon, volumes]}
84                 -
85                   - /var/lib/kolla/config_files/nova_ironic.json:/var/lib/kolla/config_files/config.json:ro
86                   - /var/lib/config-data/nova/etc/nova/:/etc/nova/:ro
87                   - /run:/run
88                   - /dev:/dev
89                   - /etc/iscsi:/etc/iscsi
90                   - /var/lib/nova/:/var/lib/nova
91                   - /var/log/containers/nova:/var/log/nova
92             environment:
93              - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
94       host_prep_tasks:
95         - name: create persistent directories
96           file:
97             path: "{{ item }}"
98             state: directory
99           with_items:
100             - /var/log/containers/nova
101             - /var/lib/nova
102       upgrade_tasks:
103         - name: Stop and disable nova-compute service
104           tags: step2
105           service: name=openstack-nova-compute state=stopped enabled=no