Merge "Add network_data.yaml to encapsulate list of networks for j2"
[apex-tripleo-heat-templates.git] / docker / services / ironic-api.yaml
1 heat_template_version: ocata
2
3 description: >
4   OpenStack containerized Ironic API service
5
6 parameters:
7   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerIronicApiImage:
12     description: image
13     default: 'centos-binary-ironic-api:latest'
14     type: string
15   DockerIronicConfigImage:
16     description: image
17     default: 'centos-binary-ironic-pxe:latest'
18     type: string
19   EndpointMap:
20     default: {}
21     description: Mapping of service endpoint -> protocol. Typically set
22                  via parameter_defaults in the resource registry.
23     type: json
24   ServiceNetMap:
25     default: {}
26     description: Mapping of service_name -> network name. Typically set
27                  via parameter_defaults in the resource registry.  This
28                  mapping overrides those in ServiceNetMapDefaults.
29     type: json
30   DefaultPasswords:
31     default: {}
32     type: json
33
34 resources:
35
36   ContainersCommon:
37     type: ./containers-common.yaml
38
39   IronicApiBase:
40     type: ../../puppet/services/ironic-api.yaml
41     properties:
42       EndpointMap: {get_param: EndpointMap}
43       ServiceNetMap: {get_param: ServiceNetMap}
44       DefaultPasswords: {get_param: DefaultPasswords}
45
46 outputs:
47   role_data:
48     description: Role data for the Ironic API role.
49     value:
50       service_name: {get_attr: [IronicApiBase, role_data, service_name]}
51       config_settings:
52         map_merge:
53           - get_attr: [IronicApiBase, role_data, config_settings]
54       step_config: &step_config
55         get_attr: [IronicApiBase, role_data, step_config]
56       service_config_settings: {get_attr: [IronicApiBase, role_data, service_config_settings]}
57       # BEGIN DOCKER SETTINGS
58       puppet_config:
59         config_volume: ironic
60         puppet_tags: ironic_config
61         step_config: *step_config
62         config_image:
63           list_join:
64             - '/'
65             - [ {get_param: DockerNamespace}, {get_param: DockerIronicConfigImage} ]
66       kolla_config:
67         /var/lib/kolla/config_files/ironic_api.json:
68           command: /usr/bin/ironic-api
69       docker_config:
70         step_3:
71           ironic_db_sync:
72             image: &ironic_image
73               list_join:
74                 - '/'
75                 - [ {get_param: DockerNamespace}, {get_param: DockerIronicApiImage} ]
76             net: host
77             privileged: false
78             detach: false
79             volumes:
80               yaql:
81                 expression: $.data.common.concat($.data.service)
82                 data:
83                   common: {get_attr: [ContainersCommon, volumes]}
84                   service:
85                     - /var/lib/config-data/ironic/etc/:/etc/:ro
86             command: ['ironic-dbsync', '--config-file', '/etc/ironic/ironic.conf']
87         step_4:
88           ironic_api:
89             start_order: 10
90             image: *ironic_image
91             net: host
92             privileged: false
93             restart: always
94             volumes:
95               yaql:
96                 expression: $.data.common.concat($.data.service)
97                 data:
98                   common: {get_attr: [ContainersCommon, volumes]}
99                   service:
100                     - /var/lib/kolla/config_files/ironic_api.json:/var/lib/kolla/config_files/config.json:ro
101                     - /var/lib/config-data/ironic/etc/:/etc/:ro
102             environment:
103               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
104       upgrade_tasks:
105         - name: Stop and disable ironic_api service
106           tags: step2
107           service: name=openstack-ironic-api state=stopped enabled=no