Merge "Don't assume default network names in net_ip*map"
[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   GlanceApiPuppetBase:
33     type: ../../puppet/services/glance-api.yaml
34     properties:
35       EndpointMap: {get_param: EndpointMap}
36       ServiceNetMap: {get_param: ServiceNetMap}
37       DefaultPasswords: {get_param: DefaultPasswords}
38
39 outputs:
40   role_data:
41     description: Role data for the Glance API role.
42     value:
43       service_name: {get_attr: [GlanceApiPuppetBase, role_data, service_name]}
44       config_settings:
45         map_merge:
46           - get_attr: [GlanceApiPuppetBase, role_data, config_settings]
47           - glance::api::sync_db: false
48       step_config: {get_attr: [GlanceApiPuppetBase, role_data, step_config]}
49       service_config_settings: {get_attr: [GlanceApiPuppetBase, role_data, service_config_settings]}
50       # BEGIN DOCKER SETTINGS #
51       docker_image: &glance_image
52         list_join:
53           - '/'
54           - [ {get_param: DockerNamespace}, {get_param: DockerGlanceApiImage} ]
55       puppet_tags: glance_api_config,glance_api_paste_ini,glance_swift_config,glance_cache_config
56       config_volume: glance_api
57       config_image: *glance_image
58       kolla_config:
59          /var/lib/kolla/config_files/glance-api.json:
60            command: /usr/bin/glance-api --config-file /usr/share/glance/glance-api-dist.conf --config-file /etc/glance/glance-api.conf
61            config_files:
62            - dest: /etc/glance/glance-api.conf
63              owner: glance
64              perm: '0600'
65              source: /var/lib/kolla/config_files/src/etc/glance/glance-api.conf
66            - dest: /etc/glance/glance-swift.conf
67              owner: glance
68              perm: '0600'
69              source: /var/lib/kolla/config_files/src/etc/glance/glance-swift.conf
70       docker_config:
71         step_3:
72           glance_api_db_sync:
73             image: *glance_image
74             net: host
75             privileged: false
76             detach: false
77             volumes: &glance_volumes
78               - /var/lib/kolla/config_files/glance-api.json:/var/lib/kolla/config_files/config.json
79               - /etc/localtime:/etc/localtime:ro
80               - /lib/modules:/lib/modules:ro
81               - /var/lib/config-data/glance_api/:/var/lib/kolla/config_files/src:ro
82               - /run:/run
83               - /dev:/dev
84               - /etc/hosts:/etc/hosts:ro
85             environment:
86               - KOLLA_BOOTSTRAP=True
87               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
88         step_4:
89           glance_api:
90             image: *glance_image
91             net: host
92             privileged: false
93             restart: always
94             volumes: *glance_volumes
95             environment:
96               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS