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