def upgrade_config_node(from_rel, pkg, *args): """Upgrades config pkgs in one or list of nodes. USAGE:fab upgrade_config_node:[email protected],[email protected]""" for host_string in args: with settings(host_string=host_string): execute('install_pkg_node', pkg, host_string) execute('create_install_repo_node', host_string) pkg_install(['contrail-setup']) if get_orchestrator() is 'vcenter': pkg = get_vcenter_plugin_pkg() install_contrail_vcenter_plugin(pkg) #Downgrading keepalived as we are packaging lower version of keepalivd in R2.20 if (LooseVersion(from_rel) == LooseVersion('2.20') and LooseVersion(get_release()) >= LooseVersion('2.20')): dist, version, extra = get_linux_distro() if version == '14.04': cmd = 'DEBIAN_FRONTEND=noninteractive apt-get -y --force-yes' cmd += ' -o Dpkg::Options::="--force-overwrite"' cmd += ' -o Dpkg::Options::="--force-confold" install keepalived=1.2.13-0~276~ubuntu14.04.1' sudo(cmd) pkgs = get_config_pkgs() cmd = frame_vnc_config_cmd(host_string, 'upgrade-vnc-config') cmd += ' -P %s' % ' '.join(pkgs) cmd += ' -F %s' % from_rel cmd += ' -T %s' % get_release() sudo(cmd)
def install_cfgm_node(*args): """Installs config pkgs in one or list of nodes. USAGE:fab install_cfgm_node:[email protected],[email protected]""" for host_string in args: with settings(host_string=host_string): pkg = get_config_pkgs() if detect_ostype() == 'ubuntu': sudo('echo "manual" >> /etc/init/supervisor-config.override') sudo('echo "manual" >> /etc/init/neutron-server.override') apt_install(pkg) else: yum_install(pkg)
def install_cfgm_node(*args): """Installs config pkgs in one or list of nodes. USAGE:fab install_cfgm_node:[email protected],[email protected]""" for host_string in args: with settings(host_string=host_string): pkg = get_config_pkgs() if detect_ostype() == 'ubuntu': sudo('echo "manual" >> /etc/init/supervisor-config.override') sudo('echo "manual" >> /etc/init/neutron-server.override') apt_install(pkg) else: yum_install(pkg) if get_orchestrator() is 'vcenter': pkg = get_vcenter_plugin_pkg() install_contrail_vcenter_plugin(pkg)
def install_cfgm_node(*args): """Installs config pkgs in one or list of nodes. USAGE:fab install_cfgm_node:[email protected],[email protected]""" for host_string in args: with settings(host_string=host_string): pkg = get_config_pkgs() if detect_ostype() == 'ubuntu': if not is_xenial_or_above(): sudo('echo "manual" >> /etc/init/supervisor-config.override') sudo('echo "manual" >> /etc/init/neutron-server.override') apt_install(pkg) else: yum_install(pkg) if get_orchestrator() is 'vcenter': pkg = get_vcenter_plugin_pkg() install_contrail_vcenter_plugin(pkg)
def uninstall_cfgm_node(*args): """Uninstalls config pkgs in one or list of nodes. USAGE:fab uninstall_cfgm_node:[email protected],[email protected]""" for host_string in args: with settings(host_string=host_string): pkg = get_config_pkgs() if detect_ostype() == 'ubuntu': apt_uninstall(pkg) else: pkgs = get_pkg_list() yum_uninstall(pkgs) with cd('/etc/'): sudo('sudo rm -rf irond haproxy keepalived') with cd('/var/lib/'): sudo('sudo rm -rf haproxy') sudo('sudo rm -rf /var/crashes') with cd('/usr/share'): sudo('sudo rm -rf irond') with cd('/var/log'): sudo('sudo rm -rf contrail/*')