Skip to content

Commit

Permalink
This commit adds changes needed for redis authentication. The pass
Browse files Browse the repository at this point in the history
word field is specified in testbed.py file. In fab we update the
redis conf file if we have specified the password and in setup_
collector call we pass redis_password as an argumenta
The changes here are only for configuring analytics daemon and redis
Webui changes are to be taken care of separately
Partial-Bug: 1392113

Change-Id: I5db2d5b614e06c205293657f54906d767a04e0b8
  • Loading branch information
arvindvis committed Jan 27, 2015
1 parent 04c7ea0 commit 9e0df17
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions fabfile/tasks/provision.py
Expand Up @@ -815,6 +815,9 @@ def setup_collector_node(*args):
if detect_ostype() == 'ubuntu':
run("service redis-server stop")
run("sed -i -e '/^[ ]*bind/s/^/#/' /etc/redis/redis.conf")
#If redis passwd sepcified add that to the conf file
if get_redis_password():
run("sed -i '/^# requirepass/ c\ requirepass "+ get_redis_password()+"' /etc/redis/redis.conf")
run("service redis-server start")
#check if the redis-server is running, if not, issue start again
count = 1
Expand All @@ -827,6 +830,9 @@ def setup_collector_node(*args):
else:
sudo("service redis stop")
sudo("sed -i -e '/^[ ]*bind/s/^/#/' /etc/redis.conf")
#If redis passwd sepcified add that to the conf file
if get_redis_password():
run("sed -i '/^# requirepass/ c\ requirepass "+ get_redis_password()+"' /etc/redis/redis.conf")
sudo("chkconfig redis on")
sudo("service redis start")

Expand Down Expand Up @@ -863,6 +869,9 @@ def setup_collector_node(*args):
else:
#if nothing is provided we default to 48h
cmd += "--analytics_data_ttl 48 "
analytics_redis_password = get_redis_password()
if analytics_redis_password is not None:
cmd += "--redis_password %s" % analytics_redis_password
internal_vip = get_contrail_internal_vip()
if internal_vip:
# Highly Available setup
Expand Down
3 changes: 3 additions & 0 deletions fabfile/utils/analytics.py
Expand Up @@ -26,4 +26,7 @@ def get_analytics_data_dir():

def get_ssd_data_dir():
return getattr(testbed, 'ssd_data_dir', None)

def get_redis_password():
return getattr(testbed, 'redis_password', None)
#end get_database_dir

0 comments on commit 9e0df17

Please sign in to comment.