def nopackage(pkg_name, options=None): """ Require a rpm package to be uninstalled. Example:: from fabtools import require require.rpm.nopackage('emacs') """ if is_installed(pkg_name): uninstall(pkg_name, options)
def package(pkg_name, repos=None, yes=None, options=None): """ Require a rpm package to be installed. Example:: from fabtools import require require.rpm.package('emacs') """ if not is_installed(pkg_name): install(pkg_name, repos, yes, options)
def nopackage(pkg_name, options=None): """ Require an RPM package to be uninstalled. Example:: from fabtools import require require.rpm.nopackage('emacs') """ if is_installed(pkg_name): uninstall(pkg_name, options)
def package(pkg_name, repos=None, yes=None, options=None): """ Require an RPM package to be installed. Example:: from fabtools import require require.rpm.package('emacs') """ if not is_installed(pkg_name): install(pkg_name, repos, yes, options)
def install_system_packages(distro): """ Install system packages based on the Linux distribution of the remote node """ if distro in ["Debian", "Ubuntu"]: require.deb.uptodate_index(max_age={'day': 7}) return require.deb.packages(fsettings.DEBIAN_PKGS) elif distro in ["CentOS", "RHEL"]: if not is_installed(fsettings.CENTOS_EPEL[0]): fsettings.CENTOS_PKGS.append(fsettings.CENTOS_EPEL[1]) return require.rpm.packages(fsettings.CENTOS_PKGS) elif distro in ["Fedora"]: return require.rpm.packages(fsettings.FEDORA_PKGS) raise RuntimeError("ERROR: Unrecognized OS!")
def nopackages(pkg_list, options=None): """ Require several rpm packages to be uninstalled. Example:: from fabtools import require require.rpm.nopackages([ 'unzip', 'vim', 'emacs', ]) """ pkg_list = [pkg for pkg in pkg_list if is_installed(pkg)] if pkg_list: uninstall(pkg_list, options)
def packages(pkg_list, repos=None, yes=None, options=None): """ Require several rpm packages to be installed. Example:: from fabtools import require require.rpm.packages([ 'nano', 'unzip', 'vim', ]) """ pkg_list = [pkg for pkg in pkg_list if not is_installed(pkg)] if pkg_list: install(pkg_list, repos, yes, options)
def nopackages(pkg_list, options=None): """ Require several RPM packages to be uninstalled. Example:: from fabtools import require require.rpm.nopackages([ 'unzip', 'vim', 'emacs', ]) """ pkg_list = [pkg for pkg in pkg_list if is_installed(pkg)] if pkg_list: uninstall(pkg_list, options)
def packages(pkg_list, repos=None, yes=None, options=None): """ Require several RPM packages to be installed. Example:: from fabtools import require require.rpm.packages([ 'nano', 'unzip', 'vim', ]) """ pkg_list = [pkg for pkg in pkg_list if not is_installed(pkg)] if pkg_list: install(pkg_list, repos, yes, options)