Posts

Showing posts from July, 2019

Redis user permissions (ACL) and python connection

 Recently, I was working on setting up a redis cluster along with separate users for readwrite and readonly. I setup the readonly user using the below privileges (ACLs):   user redisreadonly on >mySuperSecretPassword ~* resetchannels -@all +@read +ping +asking   Once this is setup, I wrote a simple program in python to connect to the redis cluster using the readonly credentials and print the number of keys.   #!/usr/bin/env python3 """ pip3 install redis """ from redis.cluster import RedisCluster, ClusterNode # ─────── Cluster connection ─────── startup_nodes = [ ClusterNode("redis_host_1", 6379), ClusterNode("redis_host_2", 6379), ClusterNode("redis_host_3", 6379) ] rc = RedisCluster(startup_nodes=startup_nodes,decode_responses=True,username='redisreadonly',password='mySuperSecretPassw...

Ansible 2.7 and OEL/RHEL 5 - not mutually exclusive!

It's been quite sometime since I blogged. So, I thought, well, it should be something that helps all the folks and not just Oracle DBAs. I have been dabbling a bit with Ansible, Python and Oracle database for a few automation tasks. During this process, I did face issues with making Ansible 2.7 work with OEL/RHEL 5. As you all know, with the release of Ansible 2.4, the minimum version of Python required on the remote nodes is >= 2.6. However, with OEL/RHEL 5, the default version of Python is 2.4. So, if you are still wondering how to make the two to tango , here goes: 1. Download the latest version of Python 2.7 from here . NOTE : At the time of writing this blog, Python 2.7.16 was the latest Python 2.7 version downloadable from here . 2. E nsure rpms zlib and zlib-devel are installed on the target node. # rpm -qa | grep zlib NOTE : If zlib-devel isn't installed, we'll get the below error: myserver.domain.com | FAILED! =...

Popular posts from this blog