Merge "Fix up pacemaker_status test in yum_update.sh"
[apex-tripleo-heat-templates.git] / docker / services / glance-api.yaml
1 heat_template_version: pike
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         # Kolla_bootstrap/db_sync runs before permissions set by kolla_config
68         step_3:
69           glance_init_logs:
70             start_order: 0
71             image: *glance_image
72             privileged: false
73             user: root
74             volumes:
75               - /var/log/containers/glance:/var/log/glance
76             command: ['/bin/bash', '-c', 'chown -R glance:glance /var/log/glance']
77           glance_api_db_sync:
78             start_order: 1
79             image: *glance_image
80             net: host
81             privileged: false
82             detach: false
83             volumes: &glance_volumes
84               list_concat:
85                 - {get_attr: [ContainersCommon, volumes]}
86                 -
87                   - /var/lib/kolla/config_files/glance-api.json:/var/lib/kolla/config_files/config.json
88                   - /var/lib/config-data/glance_api/etc/glance/:/etc/glance/:ro
89                   - /var/log/containers/glance:/var/log/glance
90             environment:
91               - KOLLA_BOOTSTRAP=True
92               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
93         step_4:
94           glance_api:
95             start_order: 2
96             image: *glance_image
97             net: host
98             privileged: false
99             restart: always
100             volumes: *glance_volumes
101             environment:
102               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
103       host_prep_tasks:
104         - name: create persistent logs directory
105           file:
106             path: /var/log/containers/glance
107             state: directory
108       upgrade_tasks:
109         - name: Stop and disable glance_api service
110           tags: step2
111           service: name=openstack-glance-api state=stopped enabled=no