Merge "Bind mount needed cert for haproxy for HA too"
[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   DockerNovaPlacementConfigImage:
16     description: The container image to use for the nova_placement config_volume
17     default: 'centos-binary-nova-placement-api:latest'
18     type: string
19   EndpointMap:
20     default: {}
21     description: Mapping of service endpoint -> protocol. Typically set
22                  via parameter_defaults in the resource registry.
23     type: json
24   ServiceNetMap:
25     default: {}
26     description: Mapping of service_name -> network name. Typically set
27                  via parameter_defaults in the resource registry.  This
28                  mapping overrides those in ServiceNetMapDefaults.
29     type: json
30   DefaultPasswords:
31     default: {}
32     type: json
33   RoleName:
34     default: ''
35     description: Role name on which the service is applied
36     type: string
37   RoleParameters:
38     default: {}
39     description: Parameters specific to the role
40     type: json
41
42 resources:
43
44   ContainersCommon:
45     type: ./containers-common.yaml
46
47   NovaPlacementBase:
48     type: ../../puppet/services/nova-placement.yaml
49     properties:
50       EndpointMap: {get_param: EndpointMap}
51       ServiceNetMap: {get_param: ServiceNetMap}
52       DefaultPasswords: {get_param: DefaultPasswords}
53       RoleName: {get_param: RoleName}
54       RoleParameters: {get_param: RoleParameters}
55
56 outputs:
57   role_data:
58     description: Role data for the Nova Placement API role.
59     value:
60       service_name: {get_attr: [NovaPlacementBase, role_data, service_name]}
61       config_settings:
62         map_merge:
63           - get_attr: [NovaPlacementBase, role_data, config_settings]
64           - apache::default_vhost: false
65       step_config: &step_config
66         get_attr: [NovaPlacementBase, role_data, step_config]
67       service_config_settings: {get_attr: [NovaPlacementBase, role_data, service_config_settings]}
68       # BEGIN DOCKER SETTINGS
69       puppet_config:
70         config_volume: nova_placement
71         puppet_tags: nova_config
72         step_config: *step_config
73         config_image:
74           list_join:
75           - '/'
76           - [ {get_param: DockerNamespace}, {get_param: DockerNovaPlacementConfigImage} ]
77       kolla_config:
78         /var/lib/kolla/config_files/nova_placement.json:
79           command: /usr/sbin/httpd -DFOREGROUND
80           config_files:
81             - source: "/var/lib/kolla/config_files/src/*"
82               dest: "/"
83               merge: true
84               preserve_properties: true
85           permissions:
86             - path: /var/log/nova
87               owner: nova:nova
88               recurse: true
89       docker_config:
90         # start this early so it is up before computes start reporting
91         step_3:
92           nova_placement:
93             start_order: 1
94             image:
95               list_join:
96               - '/'
97               - [ {get_param: DockerNamespace}, {get_param: DockerNovaPlacementImage} ]
98             net: host
99             user: root
100             restart: always
101             volumes:
102               list_concat:
103                 - {get_attr: [ContainersCommon, volumes]}
104                 -
105                   - /var/lib/kolla/config_files/nova_placement.json:/var/lib/kolla/config_files/config.json:ro
106                   - /var/lib/config-data/puppet-generated/nova_placement/:/var/lib/kolla/config_files/src:ro
107                   - /var/log/containers/nova:/var/log/nova
108             environment:
109               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
110       host_prep_tasks:
111         - name: create persistent logs directory
112           file:
113             path: /var/log/containers/nova
114             state: directory
115       upgrade_tasks:
116         - name: Stop and disable nova_placement service (running under httpd)
117           tags: step2
118           service: name=httpd state=stopped enabled=no