def deploy_chef(gems="no", ask="yes"): """Install chef-solo on a node""" if not env.host_string: abort('no node specified\nUsage: cook node:MYNODE deploy_chef') distro_type, distro = solo.check_distro() message = '\nAre you sure you want to install Chef at the node {0}'.format( env.host_string) if gems == "yes": message += ', using gems for "{0}"?'.format(distro) else: message += ', using "{0}" packages?'.format(distro) if ask != "no" and not confirm(message): abort('Aborted by user') if distro_type == "debian": if gems == "yes": solo.gem_apt_install() else: solo.apt_install(distro) elif distro_type == "rpm": if gems == "yes": solo.gem_rpm_install() else: solo.rpm_install() elif distro_type == "gentoo": solo.emerge_install() else: abort('wrong distro type: {0}'.format(distro_type)) solo.configure_chef_solo(node_work_path, cookbook_paths)
def deploy_chef(gems="no", ask="yes"): """Install chef-solo on a node""" if not env.host_string: abort('no node specified\nUsage: cook node:MYNODE deploy_chef') distro_type, distro = solo.check_distro() message = '\nAre you sure you want to install Chef at the node {0}'.format( env.host_string) if gems == "yes": message += ', using gems for "{0}"?'.format(distro) else: message += ', using "{0}" packages?'.format(distro) if ask != "no" and not confirm(message): abort('Aborted by user') solo.install(distro_type, distro, gems) solo.configure()