Merge "Move glance::api::show_multiple_locations within GlanceApi"
[apex-tripleo-heat-templates.git] / docker / services / cinder-backup.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack containerized Cinder Backup service
5
6 parameters:
7   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerCinderBackupImage:
12     description: image
13     default: 'centos-binary-cinder-backup:latest'
14     type: string
15   DockerCinderConfigImage:
16     description: The container image to use for the cinder config_volume
17     default: 'centos-binary-cinder-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
43 resources:
44
45   ContainersCommon:
46     type: ./containers-common.yaml
47
48   CinderBase:
49     type: ../../puppet/services/cinder-backup.yaml
50     properties:
51       EndpointMap: {get_param: EndpointMap}
52       ServiceNetMap: {get_param: ServiceNetMap}
53       DefaultPasswords: {get_param: DefaultPasswords}
54       RoleName: {get_param: RoleName}
55       RoleParameters: {get_param: RoleParameters}
56
57 outputs:
58   role_data:
59     description: Role data for the Cinder Backup role.
60     value:
61       service_name: {get_attr: [CinderBase, role_data, service_name]}
62       config_settings: {get_attr: [CinderBase, role_data, config_settings]}
63       step_config: &step_config
64         get_attr: [CinderBase, role_data, step_config]
65       service_config_settings: {get_attr: [CinderBase, role_data, service_config_settings]}
66       # BEGIN DOCKER SETTINGS
67       puppet_config:
68         config_volume: cinder
69         puppet_tags: cinder_config,file,concat,file_line
70         step_config: *step_config
71         config_image:
72           list_join:
73             - '/'
74             - [ {get_param: DockerNamespace}, {get_param: DockerCinderConfigImage} ]
75       kolla_config:
76         /var/lib/kolla/config_files/cinder_backup.json:
77           command: /usr/bin/cinder-backup --config-file /usr/share/cinder/cinder-dist.conf --config-file /etc/cinder/cinder.conf
78           permissions:
79             - path: /var/lib/cinder
80               owner: cinder:cinder
81               recurse: true
82             - path: /var/log/cinder
83               owner: cinder:cinder
84               recurse: true
85       docker_config:
86         step_3:
87           cinder_backup_init_logs:
88             start_order: 0
89             image: &cinder_backup_image
90               list_join:
91                 - '/'
92                 - [ {get_param: DockerNamespace}, {get_param: DockerCinderBackupImage} ]
93             privileged: false
94             user: root
95             volumes:
96               - /var/log/containers/cinder:/var/log/cinder
97             command: ['/bin/bash', '-c', 'chown -R cinder:cinder /var/log/cinder']
98         step_4:
99           cinder_backup:
100             image: *cinder_backup_image
101             net: host
102             privileged: false
103             restart: always
104             volumes:
105               list_concat:
106                 - {get_attr: [ContainersCommon, volumes]}
107                 -
108                   - /var/lib/kolla/config_files/cinder_backup.json:/var/lib/kolla/config_files/config.json:ro
109                   - /var/lib/config-data/cinder/etc/cinder/:/etc/cinder/:ro
110                   - /var/lib/config-data/ceph/etc/ceph/:/etc/ceph/:ro #FIXME: we need to generate a ceph.conf with puppet for this
111                   - /dev/:/dev/
112                   - /run/:/run/
113                   - /sys:/sys
114                   - /lib/modules:/lib/modules:ro
115                   - /etc/iscsi:/etc/iscsi
116                   - /var/lib/cinder:/var/lib/cinder
117                   - /var/log/containers/cinder:/var/log/cinder
118             environment:
119               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
120       host_prep_tasks:
121         - name: create persistent directories
122           file:
123             path: "{{ item }}"
124             state: directory
125           with_items:
126             - /var/lib/cinder
127             - /var/log/containers/cinder
128       upgrade_tasks:
129         - name: Stop and disable cinder_backup service
130           tags: step2
131           service: name=openstack-cinder-backup state=stopped enabled=no