Increase default RabbitMQ/Erlang TCP timeout from 5 to 15 seconds
[apex-tripleo-heat-templates.git] / docker / services / pacemaker / database / redis.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack containerized Redis services
5
6 parameters:
7   DockerRedisImage:
8     description: image
9     type: string
10   DockerRedisConfigImage:
11     description: The container image to use for the redis 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   RedisBase:
43     type: ../../../../puppet/services/database/redis.yaml
44     properties:
45       EndpointMap: {get_param: EndpointMap}
46       ServiceData: {get_param: ServiceData}
47       ServiceNetMap: {get_param: ServiceNetMap}
48       DefaultPasswords: {get_param: DefaultPasswords}
49       RoleName: {get_param: RoleName}
50       RoleParameters: {get_param: RoleParameters}
51
52 outputs:
53   role_data:
54     description: Role data for the Redis API role.
55     value:
56       service_name: {get_attr: [RedisBase, role_data, service_name]}
57       config_settings:
58         map_merge:
59           - {get_attr: [RedisBase, role_data, config_settings]}
60           - redis::service_manage: false
61             redis::notify_service: false
62             redis::managed_by_cluster_manager: true
63             tripleo::profile::pacemaker::database::redis_bundle::redis_docker_image: &redis_image {get_param: DockerRedisImage}
64
65       step_config: ""
66       service_config_settings: {get_attr: [RedisBase, role_data, service_config_settings]}
67       # BEGIN DOCKER SETTINGS
68       puppet_config:
69         config_volume: 'redis'
70         # NOTE: we need the exec tag to copy /etc/redis.conf.puppet to
71         # /etc/redis.conf
72         # https://github.com/arioch/puppet-redis/commit/1c004143223e660cbd433422ff8194508aab9763
73         puppet_tags: 'exec'
74         step_config:
75           get_attr: [RedisBase, role_data, step_config]
76         config_image: &redis_config_image {get_param: DockerRedisConfigImage}
77       kolla_config:
78         /var/lib/kolla/config_files/redis.json:
79           command: /usr/sbin/pacemaker_remoted
80           config_files:
81             - dest: /etc/libqb/force-filesystem-sockets
82               source: /dev/null
83               owner: root
84               perm: '0644'
85             - source: "/var/lib/kolla/config_files/src/*"
86               dest: "/"
87               merge: true
88               preserve_properties: true
89               optional: true
90           permissions:
91             - path: /var/run/redis
92               owner: redis:redis
93               recurse: true
94             - path: /var/lib/redis
95               owner: redis:redis
96               recurse: true
97             - path: /var/log/redis
98               owner: redis:redis
99               recurse: true
100       docker_config:
101         step_2:
102           redis_init_bundle:
103             start_order: 2
104             detach: false
105             net: host
106             user: root
107             config_volume: 'redis_init_bundle'
108             command:
109               - '/bin/bash'
110               - '-c'
111               - str_replace:
112                   template:
113                     list_join:
114                       - '; '
115                       - - "cp -a /tmp/puppet-etc/* /etc/puppet; echo '{\"step\": 2}' > /etc/puppet/hieradata/docker.json"
116                         - "FACTER_uuid=docker puppet apply --tags file,file_line,concat,augeas,TAGS -v -e 'CONFIG'"
117                   params:
118                     TAGS: 'pacemaker::resource::bundle,pacemaker::property,pacemaker::resource::ocf,pacemaker::constraint::order,pacemaker::constraint::colocation'
119                     CONFIG: 'include ::tripleo::profile::base::pacemaker;include ::tripleo::profile::pacemaker::database::redis_bundle'
120             image: *redis_config_image
121             volumes:
122               - /etc/hosts:/etc/hosts:ro
123               - /etc/localtime:/etc/localtime:ro
124               - /etc/puppet:/tmp/puppet-etc:ro
125               - /usr/share/openstack-puppet/modules:/usr/share/openstack-puppet/modules:ro
126               - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro
127               - /dev/shm:/dev/shm:rw
128       host_prep_tasks:
129         - name: create /var/run/redis
130           file:
131             path: /var/run/redis
132             state: directory
133         - name: create /var/log/redis
134           file:
135             path: /var/log/redis
136             state: directory
137         - name: create /var/lib/redis
138           file:
139             path: /var/lib/redis
140             state: directory
141       upgrade_tasks:
142         - name: Stop and disable redis service
143           tags: step2
144           service: name=redis state=stopped enabled=no