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 {get_param: DockerRedisImage}
66 service_config_settings: {get_attr: [RedisBase, role_data, service_config_settings]}
67 # BEGIN DOCKER SETTINGS
69 config_volume: 'redis'
70 # NOTE: we need the exec tag to copy /etc/redis.conf.puppet to
72 # https://github.com/arioch/puppet-redis/commit/1c004143223e660cbd433422ff8194508aab9763
75 get_attr: [RedisBase, role_data, step_config]
76 config_image: &redis_config_image {get_param: DockerRedisConfigImage}
78 /var/lib/kolla/config_files/redis.json:
79 command: /usr/sbin/pacemaker_remoted
81 - dest: /etc/libqb/force-filesystem-sockets
85 - source: "/var/lib/kolla/config_files/src/*"
88 preserve_properties: true
91 - path: /var/run/redis
94 - path: /var/lib/redis
97 - path: /var/log/redis
107 config_volume: 'redis_init_bundle'
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'"
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
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
129 - name: create /var/run/redis
133 - name: create /var/log/redis
137 - name: create /var/lib/redis
142 - name: get bootstrap nodeid
144 command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid
145 register: bootstrap_node
146 - name: set is_bootstrap_node fact
148 set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
149 - name: Disable the redis cluster resource
152 resource: {get_attr: [RedisBase, role_data, service_name]}
154 wait_for_resource: true
155 when: is_bootstrap_node
156 - name: Delete the stopped redis cluster resource.
159 resource: {get_attr: [RedisBase, role_data, service_name]}
161 wait_for_resource: true
162 when: is_bootstrap_node
163 - name: Disable redis service
165 service: name=redis enabled=no