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
43 type: ../../../../puppet/services/database/redis.yaml
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}
54 description: Role data for the Redis API role.
56 service_name: {get_attr: [RedisBase, role_data, service_name]}
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_pcmklatest
67 data: {get_param: DockerRedisImage}
68 expression: $.data.rightSplit(separator => ":", maxSplits => 1)[0]
70 tripleo::profile::pacemaker::database::redis_bundle::control_port: 3124
71 tripleo.redis.firewall_rules:
78 service_config_settings: {get_attr: [RedisBase, role_data, service_config_settings]}
79 # BEGIN DOCKER SETTINGS
81 config_volume: 'redis'
82 # NOTE: we need the exec tag to copy /etc/redis.conf.puppet to
84 # https://github.com/arioch/puppet-redis/commit/1c004143223e660cbd433422ff8194508aab9763
87 get_attr: [RedisBase, role_data, step_config]
88 config_image: &redis_config_image {get_param: DockerRedisConfigImage}
90 /var/lib/kolla/config_files/redis.json:
91 command: /usr/sbin/pacemaker_remoted
93 - dest: /etc/libqb/force-filesystem-sockets
97 - source: "/var/lib/kolla/config_files/src/*"
100 preserve_properties: true
103 - path: /var/run/redis
106 - path: /var/lib/redis
109 - path: /var/log/redis
124 "/usr/bin/docker tag 'REDIS_IMAGE' 'REDIS_IMAGE_PCMKLATEST'"
126 REDIS_IMAGE: {get_param: DockerRedisImage}
127 REDIS_IMAGE_PCMKLATEST: *redis_image_pcmklatest
128 image: {get_param: DockerRedisImage}
130 - /etc/hosts:/etc/hosts:ro
131 - /etc/localtime:/etc/localtime:ro
132 - /dev/shm:/dev/shm:rw
133 - /etc/sysconfig/docker:/etc/sysconfig/docker:ro
134 - /usr/bin:/usr/bin:ro
135 - /var/run/docker.sock:/var/run/docker.sock:rw
142 config_volume: 'redis_init_bundle'
150 - - "cp -a /tmp/puppet-etc/* /etc/puppet; echo '{\"step\": 2}' > /etc/puppet/hieradata/docker.json"
151 - "FACTER_uuid=docker puppet apply --tags file,file_line,concat,augeas,TAGS -v -e 'CONFIG'"
153 TAGS: 'pacemaker::resource::bundle,pacemaker::property,pacemaker::resource::ocf,pacemaker::constraint::order,pacemaker::constraint::colocation'
154 CONFIG: 'include ::tripleo::profile::base::pacemaker;include ::tripleo::profile::pacemaker::database::redis_bundle'
155 image: *redis_config_image
157 - /etc/hosts:/etc/hosts:ro
158 - /etc/localtime:/etc/localtime:ro
159 - /etc/puppet:/tmp/puppet-etc:ro
160 - /usr/share/openstack-puppet/modules:/usr/share/openstack-puppet/modules:ro
161 - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro
162 - /dev/shm:/dev/shm:rw
164 - name: create /var/run/redis
168 - name: create /var/log/redis
172 - name: create /var/lib/redis
177 - name: get bootstrap nodeid
179 command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid
180 register: bootstrap_node
181 - name: set is_bootstrap_node fact
183 set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
184 - name: Disable the redis cluster resource
187 resource: {get_attr: [RedisBase, role_data, service_name]}
189 wait_for_resource: true
190 when: is_bootstrap_node
191 - name: Delete the stopped redis cluster resource.
194 resource: {get_attr: [RedisBase, role_data, service_name]}
196 wait_for_resource: true
197 when: is_bootstrap_node
198 - name: Disable redis service
200 service: name=redis enabled=no