Merge "Remove empty metadata_settings from iscsid and multipathd templates"
[apex-tripleo-heat-templates.git] / docker / services / manila-api.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack containerized Manila API service
5
6 parameters:
7   DockerManilaApiImage:
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   ManilaApiPuppetBase:
49     type: ../../puppet/services/manila-api.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 API role.
59     value:
60       service_name: {get_attr: [ManilaApiPuppetBase, role_data, service_name]}
61       config_settings: {get_attr: [ManilaApiPuppetBase, role_data, config_settings]}
62       step_config: &step_config
63         list_join:
64           - "\n"
65           - - {get_attr: [ManilaApiPuppetBase, role_data, step_config]}
66             - {get_attr: [MySQLClient, role_data, step_config]}
67       service_config_settings: {get_attr: [ManilaApiPuppetBase, role_data, service_config_settings]}
68       # BEGIN DOCKER SETTINGS #
69       puppet_config:
70         config_volume: manila
71         puppet_tags: manila_config,manila_api_paste_ini
72         step_config: *step_config
73         config_image: {get_param: DockerManilaConfigImage}
74       kolla_config:
75         /var/lib/kolla/config_files/manila_api.json:
76           command: /usr/bin/manila-api --config-file /usr/share/manila/manila-dist.conf --config-file /etc/manila/manila.conf
77           config_files:
78             - source: "/var/lib/kolla/config_files/src/*"
79               dest: "/"
80               merge: true
81               preserve_properties: true
82           permissions:
83             - path: /var/log/manila
84               owner: manila:manila
85               recurse: true
86       docker_config:
87         step_2:
88           manila_init_logs:
89             image: &manila_api_image {get_param: DockerManilaApiImage}
90             user: root
91             volumes:
92               - /var/log/containers/manila:/var/log/manila
93             command: ['/bin/bash', '-c', 'mkdir -p /var/log/httpd; chown -R manila:manila /var/log/manila']
94         step_3:
95           manila_api_db_sync:
96             user: root
97             image: *manila_api_image
98             net: host
99             detach: false
100             volumes:
101               list_concat:
102                 - {get_attr: [ContainersCommon, volumes]}
103                 -
104                   - /var/lib/config-data/manila/etc/manila/:/etc/manila/:ro
105                   - /var/log/containers/manila:/var/log/manila
106             command: "/usr/bin/bootstrap_host_exec manila_api su manila -s /bin/bash -c '/usr/bin/manila-manage db sync'"
107         step_4:
108           manila_api:
109             image: *manila_api_image
110             net: host
111             restart: always
112             volumes:
113               list_concat:
114                 - {get_attr: [ContainersCommon, volumes]}
115                 -
116                   - /var/lib/kolla/config_files/manila_api.json:/var/lib/kolla/config_files/config.json:ro
117                   - /var/lib/config-data/puppet-generated/manila/:/var/lib/kolla/config_files/src:ro
118                   - /var/log/containers/manila:/var/log/manila
119             environment:
120               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
121       host_prep_tasks:
122         - name: Create persistent manila logs directory
123           file:
124             path: /var/log/containers/manila
125             state: directory
126       upgrade_tasks:
127         - name: Stop and disable manila_api service
128           tags: step2
129           service: name=openstack-manila-api state=stopped enabled=no