Merge "Mount hostpath logs on /var/log"
[apex-tripleo-heat-templates.git] / docker / services / nova-scheduler.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack containerized Nova Scheduler service
5
6 parameters:
7   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerNovaSchedulerImage:
12     description: image
13     default: 'centos-binary-nova-scheduler:latest'
14     type: string
15   DockerNovaConfigImage:
16     description: image
17     default: 'centos-binary-nova-base: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
34 resources:
35
36   ContainersCommon:
37     type: ./containers-common.yaml
38
39   NovaSchedulerBase:
40     type: ../../puppet/services/nova-scheduler.yaml
41     properties:
42       EndpointMap: {get_param: EndpointMap}
43       ServiceNetMap: {get_param: ServiceNetMap}
44       DefaultPasswords: {get_param: DefaultPasswords}
45
46 outputs:
47   role_data:
48     description: Role data for the Nova Scheduler service.
49     value:
50       service_name: {get_attr: [NovaSchedulerBase, role_data, service_name]}
51       config_settings: {get_attr: [NovaSchedulerBase, role_data, config_settings]}
52       step_config: &step_config
53         get_attr: [NovaSchedulerBase, role_data, step_config]
54       service_config_settings: {get_attr: [NovaSchedulerBase, role_data, service_config_settings]}
55       # BEGIN DOCKER SETTINGS
56       puppet_config:
57         config_volume: nova
58         puppet_tags: nova_config
59         step_config: *step_config
60         config_image:
61           list_join:
62           - '/'
63           - [ {get_param: DockerNamespace}, {get_param: DockerNovaConfigImage} ]
64       kolla_config:
65         /var/lib/kolla/config_files/nova_scheduler.json:
66           command: /usr/bin/nova-scheduler
67           permissions:
68             - path: /var/log/nova
69               owner: nova:nova
70               recurse: true
71       docker_config:
72         step_4:
73           nova_scheduler:
74             image:
75               list_join:
76                 - '/'
77                 - [ {get_param: DockerNamespace}, {get_param: DockerNovaSchedulerImage} ]
78             net: host
79             privileged: false
80             restart: always
81             volumes:
82               list_concat:
83                 - {get_attr: [ContainersCommon, volumes]}
84                 -
85                   - /var/lib/kolla/config_files/nova_scheduler.json:/var/lib/kolla/config_files/config.json:ro
86                   - /var/lib/config-data/nova/etc/nova/:/etc/nova/:ro
87                   - /run:/run
88                   - /var/log/containers/nova:/var/log/nova
89             environment:
90               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
91       host_prep_tasks:
92         - name: create persistent logs directory
93           file:
94             path: /var/log/containers/nova
95             state: directory
96       upgrade_tasks:
97         - name: Stop and disable nova_scheduler service
98           tags: step2
99           service: name=openstack-nova-scheduler state=stopped enabled=no