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_vcenter_compute_node(*args): """Installs nova compute in all nodes defined in vcenter_compute role.""" for host_string in args: with settings(host_string=host_string): ostype = detect_ostype() pkgs = get_vcenter_compute_pkgs() if ostype == 'ubuntu': apt_install(pkgs) else: yum_install(pkgs) if 'vcenter_compute' in env.roledefs: 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': 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)