1 heat_template_version: pike
4 OpenStack containerized Redis services
10 DockerRedisConfigImage:
11 description: The container image to use for the redis config_volume
15 description: Mapping of service endpoint -> protocol. Typically set
16 via parameter_defaults in the resource registry.
20 description: Dictionary packing service data
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.
33 description: Role name on which the service is applied
37 description: Parameters specific to the role
45 internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]}
50 type: ../../containers-common.yaml
53 type: ../../../../puppet/services/database/redis.yaml
55 EndpointMap: {get_param: EndpointMap}
56 ServiceData: {get_param: ServiceData}
57 ServiceNetMap: {get_param: ServiceNetMap}
58 DefaultPasswords: {get_param: DefaultPasswords}
59 RoleName: {get_param: RoleName}
60 RoleParameters: {get_param: RoleParameters}
64 description: Role data for the Redis API role.
66 service_name: {get_attr: [RedisBase, role_data, service_name]}
69 - {get_attr: [RedisBase, role_data, config_settings]}
70 - redis::service_manage: false
71 redis::notify_service: false
72 redis::managed_by_cluster_manager: true
73 tripleo::profile::pacemaker::database::redis_bundle::redis_docker_image: &redis_image_pcmklatest
77 data: {get_param: DockerRedisImage}
78 expression: $.data.rightSplit(separator => ":", maxSplits => 1)[0]
80 tripleo::profile::pacemaker::database::redis_bundle::control_port: 3124
81 tripleo.redis.firewall_rules:
87 tripleo::stunnel::manage_service: false
88 tripleo::stunnel::foreground: 'yes'
89 logging_source: {get_attr: [RedisBase, role_data, logging_source]}
90 logging_groups: {get_attr: [RedisBase, role_data, logging_groups]}
92 service_config_settings: {get_attr: [RedisBase, role_data, service_config_settings]}
93 # BEGIN DOCKER SETTINGS
95 config_volume: 'redis'
96 # NOTE: we need the exec tag to copy /etc/redis.conf.puppet to
98 # https://github.com/arioch/puppet-redis/commit/1c004143223e660cbd433422ff8194508aab9763
101 get_attr: [RedisBase, role_data, step_config]
102 config_image: &redis_config_image {get_param: DockerRedisConfigImage}
104 /var/lib/kolla/config_files/redis.json:
105 command: /usr/sbin/pacemaker_remoted
107 - dest: /etc/libqb/force-filesystem-sockets
111 - source: "/var/lib/kolla/config_files/src/*"
114 preserve_properties: true
117 - path: /var/run/redis
120 - path: /var/lib/redis
123 - path: /var/log/redis
126 /var/lib/kolla/config_files/redis_tls_proxy.json:
127 command: stunnel /etc/stunnel/stunnel.conf
129 - source: "/var/lib/kolla/config_files/src/*"
132 preserve_properties: true
145 "/usr/bin/docker tag 'REDIS_IMAGE' 'REDIS_IMAGE_PCMKLATEST'"
147 REDIS_IMAGE: {get_param: DockerRedisImage}
148 REDIS_IMAGE_PCMKLATEST: *redis_image_pcmklatest
149 image: {get_param: DockerRedisImage}
151 - /etc/hosts:/etc/hosts:ro
152 - /etc/localtime:/etc/localtime:ro
153 - /dev/shm:/dev/shm:rw
154 - /etc/sysconfig/docker:/etc/sysconfig/docker:ro
155 - /usr/bin:/usr/bin:ro
156 - /var/run/docker.sock:/var/run/docker.sock:rw
164 config_volume: 'redis_init_bundle'
172 - - "cp -a /tmp/puppet-etc/* /etc/puppet; echo '{\"step\": 2}' > /etc/puppet/hieradata/docker.json"
173 - "FACTER_uuid=docker puppet apply --tags file,file_line,concat,augeas,TAGS -v -e 'CONFIG'"
175 TAGS: 'pacemaker::resource::bundle,pacemaker::property,pacemaker::resource::ocf,pacemaker::constraint::order,pacemaker::constraint::colocation'
176 CONFIG: 'include ::tripleo::profile::base::pacemaker;include ::tripleo::profile::pacemaker::database::redis_bundle'
177 image: *redis_config_image
179 - /etc/hosts:/etc/hosts:ro
180 - /etc/localtime:/etc/localtime:ro
181 - /etc/puppet:/tmp/puppet-etc:ro
182 - /usr/share/openstack-puppet/modules:/usr/share/openstack-puppet/modules:ro
183 - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro
184 - /dev/shm:/dev/shm:rw
186 - internal_tls_enabled
189 image: *redis_image_pcmklatest
195 - {get_attr: [ContainersCommon, volumes]}
197 - /var/lib/kolla/config_files/redis_tls_proxy.json:/var/lib/kolla/config_files/config.json:ro
198 - /var/lib/config-data/puppet-generated/redis/:/var/lib/kolla/config_files/src:ro
199 - /etc/pki/tls/certs/redis.crt:/etc/pki/tls/certs/redis.crt:ro
200 - /etc/pki/tls/private/redis.key:/etc/pki/tls/private/redis.key:ro
202 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
205 get_attr: [RedisBase, role_data, metadata_settings]
207 - name: create /var/run/redis
211 - name: create /var/log/redis
215 - name: create /var/lib/redis
220 - name: get bootstrap nodeid
222 command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid
223 register: bootstrap_node
224 - name: set is_bootstrap_node fact
226 set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
227 - name: Check cluster resource status
230 resource: {get_attr: [RedisBase, role_data, service_name]}
235 - name: Disable the redis cluster resource
238 resource: {get_attr: [RedisBase, role_data, service_name]}
240 wait_for_resource: true
243 until: output.rc == 0
244 when: is_bootstrap_node and redis_res|succeeded
245 - name: Delete the stopped redis cluster resource.
248 resource: {get_attr: [RedisBase, role_data, service_name]}
250 wait_for_resource: true
253 until: output.rc == 0
254 when: is_bootstrap_node and redis_res|succeeded
255 - name: Disable redis service
257 service: name=redis enabled=no