Skip to content

Commit

Permalink
Skip provisioning rabbitmq on CFGM when using external servers
Browse files Browse the repository at this point in the history
as defined env.cfgm in testbed

Change-Id: Ie76e44f7e3a0861b614c7d29cd55f83ed2e057ce
Partial-Bug: 1571043
  • Loading branch information
npchandran committed Apr 15, 2016
1 parent 099a5d2 commit 06e8801
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions fabfile/config.py
Expand Up @@ -27,8 +27,8 @@
for key in env.passwords.keys():
env.passwords.update({key+':22' : env.passwords[key]})

# Set default rabbit role as cfgm.
env.roledefs['rabbit'] = env.roledefs['cfgm']
# Set default rabbit role
env.roledefs['rabbit'] = []

# Set default openstack role to empty list,
# If env.roledefs['openstack'] is not set in the testbed.py
Expand Down
11 changes: 8 additions & 3 deletions fabfile/tasks/rabbitmq.py
Expand Up @@ -345,15 +345,20 @@ def join_rabbitmq_cluster(new_ctrl_host):
@roles('build')
def setup_rabbitmq_cluster(force=False):
"""Task to cluster the rabbit servers."""
amqp_roles = []
rabbit_servers = get_from_testbed_dict('cfgm', 'amqp_hosts', None)
if rabbit_servers:
print "Using external rabbitmq servers %s" % rabbit_servers
return
# Provision rabbitmq cluster in cfgm role nodes.
amqp_roles = ['cfgm']
else:
# Provision rabbitmq cluster in cfgm role nodes.
print "Provisioning rabbitq in cfgm nodes"
amqp_roles = ['cfgm']

# Provision rabbitmq cluster in openstack on request
if get_from_testbed_dict('openstack', 'manage_amqp', 'no') == 'yes':
# Provision rabbitmq cluster in openstack role nodes aswell.
amqp_roles.append('openstack')

for role in amqp_roles:
env.roledefs['rabbit'] = env.roledefs[role]

Expand Down

0 comments on commit 06e8801

Please sign in to comment.