From 5a7f08428e224791037a65455387860a40f7d7c2 Mon Sep 17 00:00:00 2001 From: Suresh Akula Date: Mon, 22 Sep 2014 11:28:28 -0700 Subject: [PATCH] Bug #1366210 Installs storage webui pkgs in all nodes defined in webui role Change-Id: I7ea3f4ea17a22bc5d0975df08fbd07f66776e2ff --- fabfile/tasks/storage/install.py | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/fabfile/tasks/storage/install.py b/fabfile/tasks/storage/install.py index face4fb60..6821b1734 100644 --- a/fabfile/tasks/storage/install.py +++ b/fabfile/tasks/storage/install.py @@ -47,12 +47,35 @@ def install_storage_master_node(*args): """Installs storage pkgs in one or list of nodes. USAGE:fab install_openstack_storage_node:user@1.1.1.1,user@2.2.2.2""" for host_string in args: with settings(host_string=host_string): - pkg = ['contrail-storage','contrail-web-storage'] + pkg = ['contrail-storage'] + if detect_ostype() == 'Ubuntu': + apt_install(pkg) + else: + yum_install(pkg) + +@task +@EXECUTE_TASK +@roles('webui') +def install_storage_webui(): + """Installs storage webui pkgs in all nodes defined in webui role.""" + if env.roledefs['webui']: + execute("install_storage_webui_node", env.host_string) + + +@task +def install_storage_webui_node(*args): + """Installs storage pkgs in one or list of nodes. USAGE:fab install_storage_webui:user@1.1.1.1,user@2.2.2.2""" + for host_string in args: + with settings(host_string=host_string): + pkg = ['contrail-web-storage'] if detect_ostype() == 'Ubuntu': apt_install(pkg) else: yum_install(pkg) + + + @task @EXECUTE_TASK @roles('storage-compute') @@ -91,3 +114,4 @@ def install_storage(): execute(create_storage_repo) execute(install_storage_master) execute(install_storage_compute) + execute(install_storage_webui)