Merge "Providing parameters specific to a workflow via plan-environment"
[apex-tripleo-heat-templates.git] / docker / services / nova-placement.yaml
1 heat_template_version: pike
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   RoleName:
30     default: ''
31     description: Role name on which the service is applied
32     type: string
33   RoleParameters:
34     default: {}
35     description: Parameters specific to the role
36     type: json
37
38 resources:
39
40   ContainersCommon:
41     type: ./containers-common.yaml
42
43   NovaPlacementBase:
44     type: ../../puppet/services/nova-placement.yaml
45     properties:
46       EndpointMap: {get_param: EndpointMap}
47       ServiceNetMap: {get_param: ServiceNetMap}
48       DefaultPasswords: {get_param: DefaultPasswords}
49       RoleName: {get_param: RoleName}
50       RoleParameters: {get_param: RoleParameters}
51
52 outputs:
53   role_data:
54     description: Role data for the Nova Placement API role.
55     value:
56       service_name: {get_attr: [NovaPlacementBase, role_data, service_name]}
57       config_settings:
58         map_merge:
59           - get_attr: [NovaPlacementBase, role_data, config_settings]
60           - apache::default_vhost: false
61       step_config: &step_config
62         get_attr: [NovaPlacementBase, role_data, step_config]
63       service_config_settings: {get_attr: [NovaPlacementBase, role_data, service_config_settings]}
64       # BEGIN DOCKER SETTINGS
65       puppet_config:
66         config_volume: nova_placement
67         puppet_tags: nova_config
68         step_config: *step_config
69         config_image: &nova_placement_image
70           list_join:
71           - '/'
72           - [ {get_param: DockerNamespace}, {get_param: DockerNovaPlacementImage} ]
73       kolla_config:
74         /var/lib/kolla/config_files/nova_placement.json:
75           command: /usr/sbin/httpd -DFOREGROUND
76           permissions:
77             - path: /var/log/nova
78               owner: nova:nova
79               recurse: true
80       docker_config:
81         # start this early so it is up before computes start reporting
82         step_3:
83           nova_placement:
84             start_order: 1
85             image: *nova_placement_image
86             net: host
87             user: root
88             restart: always
89             volumes:
90               list_concat:
91                 - {get_attr: [ContainersCommon, volumes]}
92                 -
93                   - /var/lib/kolla/config_files/nova_placement.json:/var/lib/kolla/config_files/config.json:ro
94                   - /var/lib/config-data/nova_placement/etc/nova/:/etc/nova/:ro
95                   - /var/lib/config-data/nova_placement/etc/httpd/conf/:/etc/httpd/conf/:ro
96                   - /var/lib/config-data/nova_placement/etc/httpd/conf.d/:/etc/httpd/conf.d/:ro
97                   - /var/lib/config-data/nova_placement/etc/httpd/conf.modules.d/:/etc/httpd/conf.modules.d/:ro
98                   - /var/lib/config-data/nova_placement/var/www/:/var/www/:ro
99                   - /var/log/containers/nova:/var/log/nova
100             environment:
101               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
102       host_prep_tasks:
103         - name: create persistent logs directory
104           file:
105             path: /var/log/containers/nova
106             state: directory
107       upgrade_tasks:
108         - name: Stop and disable nova_placement service (running under httpd)
109           tags: step2
110           service: name=httpd state=stopped enabled=no