Merge "Remove non-containerized pacemaker resources on upgrade"
[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   DockerNovaComputeIronicImage:
8     description: image
9     type: string
10   DockerNovaConfigImage:
11     description: The container image to use for the nova 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   NovaIronicBase:
46     type: ../../puppet/services/nova-ironic.yaml
47     properties:
48       ServiceData: {get_param: ServiceData}
49       ServiceNetMap: {get_param: ServiceNetMap}
50       DefaultPasswords: {get_param: DefaultPasswords}
51       EndpointMap: {get_param: EndpointMap}
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: [NovaIronicBase, role_data, service_name]}
60       config_settings: {get_attr: [NovaIronicBase, role_data, config_settings]}
61       step_config: &step_config
62         get_attr: [NovaIronicBase, role_data, step_config]
63       puppet_config:
64         config_volume: nova
65         puppet_tags: nova_config,nova_paste_api_ini
66         step_config: *step_config
67         config_image: {get_param: DockerNovaConfigImage}
68       kolla_config:
69         /var/lib/kolla/config_files/nova_ironic.json:
70           command: /usr/bin/nova-compute --config-file /etc/nova/nova.conf --config-file /etc/nova/rootwrap.conf
71           config_files:
72             - source: "/var/lib/kolla/config_files/src/*"
73               dest: "/"
74               merge: true
75               preserve_properties: true
76             - source: "/var/lib/kolla/config_files/src-iscsid/*"
77               dest: "/"
78               merge: true
79               preserve_properties: true
80           permissions:
81             - path: /var/log/nova
82               owner: nova:nova
83               recurse: true
84             - path: /var/lib/nova
85               owner: nova:nova
86               recurse: true
87       docker_config:
88         step_5:
89           nova_compute:
90             image: {get_param: DockerNovaComputeIronicImage}
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_ironic.json:/var/lib/kolla/config_files/config.json:ro
100                   - /var/lib/config-data/puppet-generated/nova/:/var/lib/kolla/config_files/src:ro
101                   - /var/lib/config-data/puppet-generated/iscsid/:/var/lib/kolla/config_files/src-iscsid:ro
102                   - /run:/run
103                   - /dev:/dev
104                   - /var/lib/nova/:/var/lib/nova
105                   - /var/log/containers/nova:/var/log/nova
106             environment:
107              - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
108       host_prep_tasks:
109         - name: create persistent directories
110           file:
111             path: "{{ item }}"
112             state: directory
113           with_items:
114             - /var/log/containers/nova
115             - /var/lib/nova
116       upgrade_tasks:
117         - name: Stop and disable nova-compute service
118           tags: step2
119           service: name=openstack-nova-compute state=stopped enabled=no