Merge "Change neutron-metadata number of workers determination method"
[apex-tripleo-heat-templates.git] / docker / services / ironic-api.yaml
1 heat_template_version: pike
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   RoleName:
34     default: ''
35     description: Role name on which the service is applied
36     type: string
37   RoleParameters:
38     default: {}
39     description: Parameters specific to the role
40
41 resources:
42
43   ContainersCommon:
44     type: ./containers-common.yaml
45
46   IronicApiBase:
47     type: ../../puppet/services/ironic-api.yaml
48     properties:
49       EndpointMap: {get_param: EndpointMap}
50       ServiceNetMap: {get_param: ServiceNetMap}
51       DefaultPasswords: {get_param: DefaultPasswords}
52       RoleName: {get_param: RoleName}
53       RoleParameters: {get_param: RoleParameters}
54
55 outputs:
56   role_data:
57     description: Role data for the Ironic API role.
58     value:
59       service_name: {get_attr: [IronicApiBase, role_data, service_name]}
60       config_settings:
61         map_merge:
62           - get_attr: [IronicApiBase, role_data, config_settings]
63       step_config: &step_config
64         get_attr: [IronicApiBase, role_data, step_config]
65       service_config_settings: {get_attr: [IronicApiBase, role_data, service_config_settings]}
66       # BEGIN DOCKER SETTINGS
67       puppet_config:
68         config_volume: ironic
69         puppet_tags: ironic_config
70         step_config: *step_config
71         config_image:
72           list_join:
73             - '/'
74             - [ {get_param: DockerNamespace}, {get_param: DockerIronicConfigImage} ]
75       kolla_config:
76         /var/lib/kolla/config_files/ironic_api.json:
77           command: /usr/bin/ironic-api
78           permissions:
79             - path: /var/log/ironic
80               owner: ironic:ironic
81               recurse: true
82       docker_config:
83         # db sync runs before permissions set by kolla_config
84         step_3:
85           ironic_init_logs:
86             start_order: 0
87             image: &ironic_image
88               list_join:
89                 - '/'
90                 - [ {get_param: DockerNamespace}, {get_param: DockerIronicApiImage} ]
91             privileged: false
92             user: root
93             volumes:
94               - /var/log/containers/ironic:/var/log/ironic
95             command: ['/bin/bash', '-c', 'chown -R ironic:ironic /var/log/ironic']
96           ironic_db_sync:
97             start_order: 1
98             image: *ironic_image
99             net: host
100             privileged: false
101             detach: false
102             volumes:
103               list_concat:
104                 - {get_attr: [ContainersCommon, volumes]}
105                 -
106                   - /var/lib/config-data/ironic/etc/:/etc/:ro
107                   - /var/log/containers/ironic:/var/log/ironic
108             command: ['ironic-dbsync', '--config-file', '/etc/ironic/ironic.conf']
109         step_4:
110           ironic_api:
111             start_order: 10
112             image: *ironic_image
113             net: host
114             privileged: false
115             restart: always
116             volumes:
117               list_concat:
118                 - {get_attr: [ContainersCommon, volumes]}
119                 -
120                   - /var/lib/kolla/config_files/ironic_api.json:/var/lib/kolla/config_files/config.json:ro
121                   - /var/lib/config-data/ironic/etc/:/etc/:ro
122                   - /var/log/containers/ironic:/var/log/ironic
123             environment:
124               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
125       host_prep_tasks:
126         - name: create persistent logs directory
127           file:
128             path: /var/log/containers/ironic
129             state: directory
130       upgrade_tasks:
131         - name: Stop and disable ironic_api service
132           tags: step2
133           service: name=openstack-ironic-api state=stopped enabled=no