Skip to content

Commit

Permalink
Executing prov_<role>_node tasks from cfgm, as vnc_api_lib.ini,
Browse files Browse the repository at this point in the history
will not be present in all the role nodes, and it is not necessary to
create vnc_api_lib.ini in all the role nodes.

Change-Id: I8b042958c7bcff6ce279ce5ff1f8506cee82947c
Closes-Bug: 1449589
  • Loading branch information
cijohnson committed Apr 28, 2015
1 parent 073aaf2 commit e9161d6
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions fabfile/tasks/provision.py
Expand Up @@ -1239,11 +1239,14 @@ def prov_config_node():
@EXECUTE_TASK
@roles('database')
def prov_database_node():
cfgm_ip = hstr_to_ip(get_control_host_string(env.roledefs['cfgm'][0]))
cfgm_host = get_control_host_string(env.roledefs['cfgm'][0])
cfgm_ip = hstr_to_ip(cfgm_host)
cfgm_host_password = get_env_passwords(env.roledefs['cfgm'][0])
tgt_ip = hstr_to_ip(get_control_host_string(env.host_string))
tgt_hostname = sudo("hostname")

with cd(UTILS_DIR):
with settings(cd(UTILS_DIR), host_string=cfgm_host,
password=cfgm_host_password):
cmd = "python provision_database_node.py"
cmd += " --api_server_ip %s" % cfgm_ip
cmd += " --host_name %s" % tgt_hostname
Expand All @@ -1257,11 +1260,14 @@ def prov_database_node():
@EXECUTE_TASK
@roles('collector')
def prov_analytics_node():
cfgm_ip = hstr_to_ip(get_control_host_string(env.roledefs['cfgm'][0]))
cfgm_host = get_control_host_string(env.roledefs['cfgm'][0])
cfgm_ip = hstr_to_ip(cfgm_host)
cfgm_host_password = get_env_passwords(env.roledefs['cfgm'][0])
tgt_ip = hstr_to_ip(get_control_host_string(env.host_string))
tgt_hostname = sudo("hostname")

with cd(UTILS_DIR):
with settings(cd(UTILS_DIR), host_string=cfgm_host,
password=cfgm_host_password):
cmd = "python provision_analytics_node.py"
cmd += " --api_server_ip %s" % cfgm_ip
cmd += " --host_name %s" % tgt_hostname
Expand All @@ -1275,11 +1281,14 @@ def prov_analytics_node():
@EXECUTE_TASK
@roles('control')
def prov_control_bgp():
cfgm_ip = hstr_to_ip(get_control_host_string(env.roledefs['cfgm'][0]))
cfgm_host = get_control_host_string(env.roledefs['cfgm'][0])
cfgm_ip = hstr_to_ip(cfgm_host)
cfgm_host_password = get_env_passwords(env.roledefs['cfgm'][0])
tgt_ip = hstr_to_ip(get_control_host_string(env.host_string))
tgt_hostname = sudo("hostname")

with cd(UTILS_DIR):
with settings(cd(UTILS_DIR), host_string=cfgm_host,
password=cfgm_host_password):
print "Configuring global system config with the ASN"
cmd = "python provision_control.py"
cmd += " --api_server_ip %s" % cfgm_ip
Expand Down

0 comments on commit e9161d6

Please sign in to comment.