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