Merge "Use httpd in Zaqar docker service"
[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   IronicApiBase:
37     type: ../../puppet/services/ironic-api.yaml
38     properties:
39       EndpointMap: {get_param: EndpointMap}
40       ServiceNetMap: {get_param: ServiceNetMap}
41       DefaultPasswords: {get_param: DefaultPasswords}
42
43 outputs:
44   role_data:
45     description: Role data for the Ironic API role.
46     value:
47       service_name: {get_attr: [IronicApiBase, role_data, service_name]}
48       config_settings:
49         map_merge:
50           - get_attr: [IronicApiBase, role_data, config_settings]
51       step_config: &step_config
52         get_attr: [IronicApiBase, role_data, step_config]
53       service_config_settings: {get_attr: [IronicApiBase, role_data, service_config_settings]}
54       # BEGIN DOCKER SETTINGS
55       puppet_config:
56         config_volume: ironic
57         puppet_tags: ironic_config
58         step_config: *step_config
59         config_image:
60           list_join:
61             - '/'
62             - [ {get_param: DockerNamespace}, {get_param: DockerIronicConfigImage} ]
63       kolla_config:
64         /var/lib/kolla/config_files/ironic_api.json:
65           command: /usr/bin/ironic-api
66       docker_config:
67         step_3:
68           ironic_db_sync:
69             image: &ironic_image
70               list_join:
71                 - '/'
72                 - [ {get_param: DockerNamespace}, {get_param: DockerIronicApiImage} ]
73             net: host
74             privileged: false
75             detach: false
76             volumes:
77               - /var/lib/config-data/ironic/etc/:/etc/:ro
78               - /etc/hosts:/etc/hosts:ro
79               - /etc/localtime:/etc/localtime:ro
80             command: ['ironic-dbsync', '--config-file', '/etc/ironic/ironic.conf']
81         step_4:
82           ironic_api:
83             start_order: 10
84             image: *ironic_image
85             net: host
86             privileged: false
87             restart: always
88             volumes:
89               - /var/lib/kolla/config_files/ironic_api.json:/var/lib/kolla/config_files/config.json:ro
90               - /var/lib/config-data/ironic/etc/:/etc/:ro
91               - /etc/hosts:/etc/hosts:ro
92               - /etc/localtime:/etc/localtime:ro
93             environment:
94               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
95       upgrade_tasks:
96         - name: Stop and disable ironic_api service
97           tags: step2
98           service: name=openstack-ironic-api state=stopped enabled=no