Merge "Make containerized galera use mysql_network everywhere" into stable/pike
[apex-tripleo-heat-templates.git] / docker / services / manila-scheduler.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack containerized Manila Scheduler service
5
6 parameters:
7   DockerManilaSchedulerImage:
8     description: image
9     type: string
10   DockerManilaConfigImage:
11     description: The container image to use for the manila 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   MySQLClient:
46     type: ../../puppet/services/database/mysql-client.yaml
47
48   ManilaSchedulerPuppetBase:
49     type: ../../puppet/services/manila-scheduler.yaml
50     properties:
51       EndpointMap: {get_param: EndpointMap}
52       ServiceData: {get_param: ServiceData}
53       ServiceNetMap: {get_param: ServiceNetMap}
54       DefaultPasswords: {get_param: DefaultPasswords}
55
56 outputs:
57   role_data:
58     description: Role data for the Manila Scheduler role.
59     value:
60       service_name: {get_attr: [ManilaSchedulerPuppetBase, role_data, service_name]}
61       config_settings: {get_attr: [ManilaSchedulerPuppetBase, role_data, config_settings]}
62       logging_source: {get_attr: [ManilaSchedulerPuppetBase, role_data, logging_source]}
63       logging_groups: {get_attr: [ManilaSchedulerPuppetBase, role_data, logging_groups]}
64       step_config: &step_config
65         list_join:
66           - "\n"
67           - - {get_attr: [ManilaSchedulerPuppetBase, role_data, step_config]}
68             - {get_attr: [MySQLClient, role_data, step_config]}
69       service_config_settings: {get_attr: [ManilaSchedulerPuppetBase, role_data, service_config_settings]}
70       # BEGIN DOCKER SETTINGS #
71       puppet_config:
72         config_volume: manila
73         puppet_tags: manila_config,manila_scheduler_paste_ini
74         step_config: *step_config
75         config_image: {get_param: DockerManilaConfigImage}
76       kolla_config:
77         /var/lib/kolla/config_files/manila_scheduler.json:
78           command: /usr/bin/manila-scheduler --config-file /usr/share/manila/manila-dist.conf --config-file /etc/manila/manila.conf
79           config_files:
80             - source: "/var/lib/kolla/config_files/src/*"
81               dest: "/"
82               merge: true
83               preserve_properties: true
84           permissions:
85             - path: /var/log/manila
86               owner: manila:manila
87               recurse: true
88       docker_config:
89         step_4:
90           manila_scheduler:
91             image: {get_param: DockerManilaSchedulerImage}
92             net: host
93             restart: always
94             volumes:
95               list_concat:
96                 - {get_attr: [ContainersCommon, volumes]}
97                 -
98                   - /var/lib/kolla/config_files/manila_scheduler.json:/var/lib/kolla/config_files/config.json:ro
99                   - /var/lib/config-data/puppet-generated/manila/:/var/lib/kolla/config_files/src:ro
100                   - /var/log/containers/manila:/var/log/manila
101             environment:
102               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
103       host_prep_tasks:
104         - name: Create persistent manila logs directory
105           file:
106             path: /var/log/containers/manila
107             state: directory
108       upgrade_tasks:
109         - name: Stop and disable manila_scheduler service
110           tags: step2
111           service: name=openstack-manila-scheduler state=stopped enabled=no