e579e158e61232ee26d6ba47b6d2178f2c6d0779
[apex-tripleo-heat-templates.git] / docker / services / nova-placement.yaml
1 heat_template_version: ocata
2
3 description: >
4   OpenStack containerized Nova Placement API service
5
6 parameters:
7   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerNovaPlacementImage:
12     description: image
13     default: 'centos-binary-nova-placement-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   NovaPlacementBase:
36     type: ../../puppet/services/nova-placement.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 Nova Placement API role.
45     value:
46       service_name: {get_attr: [NovaPlacementBase, role_data, service_name]}
47       config_settings:
48         map_merge:
49           - get_attr: [NovaPlacementBase, role_data, config_settings]
50           - apache::default_vhost: false
51       step_config: &step_config
52         get_attr: [NovaPlacementBase, role_data, step_config]
53       service_config_settings: {get_attr: [NovaPlacementBase, role_data, service_config_settings]}
54       # BEGIN DOCKER SETTINGS
55       puppet_config:
56         config_volume: nova_placement
57         puppet_tags: nova_config
58         step_config: *step_config
59         config_image: &nova_placement_image
60           list_join:
61           - '/'
62           - [ {get_param: DockerNamespace}, {get_param: DockerNovaPlacementImage} ]
63       kolla_config:
64         /var/lib/kolla/config_files/nova_placement.json:
65           command: /usr/sbin/httpd -DFOREGROUND
66       docker_config:
67         # start this early so it is up before computes start reporting
68         step_3:
69           nova_placement:
70             start_order: 1
71             image: *nova_placement_image
72             net: host
73             user: root
74             restart: always
75             volumes:
76               yaql:
77                 expression: $.data.common.concat($.data.service)
78                 data:
79                   common: {get_attr: [ContainersCommon, volumes]}
80                   service:
81                     - /var/lib/kolla/config_files/nova_placement.json:/var/lib/kolla/config_files/config.json:ro
82                     - /var/lib/config-data/nova_placement/etc/nova/:/etc/nova/:ro
83                     - /var/lib/config-data/nova_placement/etc/httpd/:/etc/httpd/:ro
84                     - /var/lib/config-data/nova_placement/var/www/:/var/www/:ro
85             environment:
86               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
87       upgrade_tasks:
88         - name: Stop and disable nova_placement service (running under httpd)
89           tags: step2
90           service: name=httpd state=stopped enabled=no