def uninstall_only_vrouter_node(manage_nova_compute='yes', *args): """Uninstalls only vrouter pkgs in one or list of nodes. USAGE:fab uninstall_vrouter_node:[email protected],[email protected] If manage_nova_compute = no, User has to uninstall nova-compute in the compute node. """ for host_string in args: ostype = detect_ostype() with settings(host_string=host_string): manage_nova_compute = 'no' if is_package_installed('contrail-openstack-vrouter'): manage_nova_compute = 'yes' pkgs = get_compute_pkgs(manage_nova_compute) if ostype == 'ubuntu': if is_ceilometer_compute_install_supported(): pkgs.append('ceilometer-agent-compute') apt_uninstall(pkgs) sudo("sed -i 's/inet manual/inet dhcp/g' /etc/network/interfaces") else: pkgs = get_pkg_list() yum_uninstall(pkgs) with cd('/etc/'): sudo('sudo rm -rf libvirt') with settings(warn_only=True): cmds = ['find ./contrail/*' '! -iname "contrail_ifrename.sh"', '! -iname "debs_list.txt"', '! -iname "rpm_list.txt"', '-delete', ] sudo(' '.join(cmds)) with cd('/var/'): sudo('sudo rm -rf crashes') sudo('sudo rm -rf tmp') with cd('/var/log'): sudo('sudo rm -rf contrail/*') undo_setup_hugepages()
def uninstall_only_vrouter_node(manage_nova_compute="yes", *args): """Uninstalls only vrouter pkgs in one or list of nodes. USAGE:fab uninstall_vrouter_node:[email protected],[email protected] If manage_nova_compute = no, User has to uninstall nova-compute in the compute node. """ for host_string in args: ostype = detect_ostype() with settings(host_string=host_string): manage_nova_compute = "no" if is_package_installed("contrail-openstack-vrouter"): manage_nova_compute = "yes" pkgs = get_compute_pkgs(manage_nova_compute) if ostype == "ubuntu": if is_ceilometer_compute_install_supported(): pkgs.append("ceilometer-agent-compute") apt_uninstall(pkgs) sudo("sed -i 's/inet manual/inet dhcp/g' /etc/network/interfaces") else: pkgs = get_pkg_list() yum_uninstall(pkgs) with cd("/etc/"): sudo("sudo rm -rf libvirt") with settings(warn_only=True): cmds = [ "find ./contrail/*" '! -iname "contrail_ifrename.sh"', '! -iname "debs_list.txt"', '! -iname "rpm_list.txt"', "-delete", ] sudo(" ".join(cmds)) with cd("/var/"): sudo("sudo rm -rf crashes") sudo("sudo rm -rf tmp") with cd("/var/log"): sudo("sudo rm -rf contrail/*")
def install_ceilometer_compute_node(*args): """Installs ceilometer compute pkgs in one or list of nodes. USAGE:fab install_ceilometer_compute_node:[email protected],[email protected]""" for host_string in args: with settings(host_string=host_string): if not is_ceilometer_compute_install_supported(): continue pkgs = get_compute_ceilometer_pkgs() if pkgs: pkg_install(pkgs) else: act_os_type = detect_ostype() raise RuntimeError('Unspported OS type (%s)' % (act_os_type))
def install_ceilometer_compute_node(*args): """Installs ceilometer compute pkgs in one or list of nodes. USAGE:fab install_ceilometer_compute_node:[email protected],[email protected]""" for host_string in args: with settings(host_string=host_string): if not is_ceilometer_compute_install_supported(): continue #Ceilometer not needed on vcenter ContraiVM if get_mode(env.host_string) == 'vcenter': continue pkgs = get_compute_ceilometer_pkgs() if pkgs: pkg_install(pkgs) else: act_os_type = detect_ostype() raise RuntimeError('Unspported OS type (%s)' % (act_os_type))
def install_ceilometer_compute_node(*args): """Installs ceilometer compute pkgs in one or list of nodes. USAGE:fab install_ceilometer_compute_node:[email protected],[email protected]""" for host_string in args: with settings(host_string=host_string): if not is_ceilometer_compute_install_supported(): continue pkg_ubuntu = ['ceilometer-agent-compute'] pkg_redhat = ['openstack-ceilometer-compute'] act_os_type = detect_ostype() if act_os_type == 'ubuntu': apt_install(pkg_ubuntu) elif act_os_type in ['redhat']: yum_install(pkg_redhat) else: raise RuntimeError('Unspported OS type (%s)' % (act_os_type))
def uninstall_only_vrouter_node(manage_nova_compute='yes', *args): """Uninstalls only vrouter pkgs in one or list of nodes. USAGE:fab uninstall_vrouter_node:[email protected],[email protected] If manage_nova_compute = no, User has to uninstall nova-compute in the compute node. """ for host_string in args: ostype = detect_ostype() with settings(host_string=host_string): manage_nova_compute = 'no' if is_package_installed('contrail-openstack-vrouter'): manage_nova_compute = 'yes' pkgs = get_compute_pkgs(manage_nova_compute) if ostype == 'ubuntu': if is_ceilometer_compute_install_supported(): pkgs.append('ceilometer-agent-compute') apt_uninstall(pkgs) sudo( "sed -i 's/inet manual/inet dhcp/g' /etc/network/interfaces" ) # Delete vhost0 interface sudo("""sed -ri.bak ' /^auto vhost0/ d /^iface vhost0/,/^(\w|$)/ { /iface vhost0/ d /^\s/ d } ' /etc/network/interfaces""") # Remove SR-IOV configuration sudo("sed -i.bak '/sriov_numvfs/ d' /etc/rc.local") else: pkgs = get_pkg_list() yum_uninstall(pkgs) with cd('/etc/'): sudo('sudo rm -rf libvirt') with settings(warn_only=True): cmds = [ 'find ./contrail/*' '! -iname "contrail_ifrename.sh"', '! -iname "debs_list.txt"', '! -iname "rpm_list.txt"', '-delete', ] sudo(' '.join(cmds)) with cd('/var/'): sudo('sudo rm -rf crashes') sudo('sudo rm -rf tmp') with cd('/var/log'): sudo('sudo rm -rf contrail/*') undo_setup_hugepages()