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