Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var PkgInstall = map[string]string{
"debian": "apt-get install ",
"centos": "yum install ",
"fedora": "dnf install ",
"opensuse": "zypper install ",
"arch": "pacman -S ",
"rhel": "yum install ",
"sles": "zypper install ",
"ubuntu": "apt-get install ",
}
PkgInstall map of Pkgs for every OS. Installation flags differ from dist
var PkgRefresh = map[string]string{
"debian": "apt-get update",
"centos": "yum check-update",
"fedora": "dnf check-update",
"opensuse": "zypper refresh",
"arch": "pacman -Sy",
"rhel": "yum update",
"sles": "zypper refresh",
"ubuntu": "apt-get update",
}
PkgRefresh refresh/update of packages before update
var PkgUninstall = map[string]string{
"debian": "apt-get remove ",
"centos": "yum remove ",
"fedora": "dnf remove ",
"opensuse": "zypper remove ",
"arch": "pacman -R ",
"rhel": "yum remove ",
"sles": "zypper remove ",
"ubuntu": "apt-get remove ",
}
PkgUninstall map of Pkgs for every OS. Installation flags differ from dist
var PkgUpdate = map[string]string{
"debian": "apt-get upgrade -y",
"centos": "yum update -y",
"fedora": "dnf upgrade -y",
"opensuse": "zypper update -y",
"arch": "pacman -Syu",
"rhel": "yum update -y",
"sles": "zypper update -y",
"ubuntu": "apt-get upgrade -y",
}
PkgUpdate map of Pkgs with update flags for every dist. Updates take different flags and arguments
var PkgUpdateOS = map[string]string{
"debian": "apt-get dist-upgrade -y",
"centos": "yum update -y",
"fedora": "dnf system-upgrade download --refresh --releasever=$(awk -v s=1 '{print $3+s}' /etc/fedora-release) -y",
"opensuse": "zypper dup -y",
"arch": "pacman -Syyu",
"rhel": "yum update -y",
"sles": "zypper dup -y",
"ubuntu": "apt-get dist-upgrade -y",
}
PkgUpdateOS map of Pkgs with update flags for every dist. Updates take different flags and arguments
Functions ¶
func Install ¶
Install this will install any packages specified on the servers, creating the correct command for each major distribution and/or package manager
func Uninstall ¶
Uninstall this will install any packages specified on the servers, creating the correct command for each major distribution and/or package manager
func Update ¶
Update this function is for updating all packages and services. It will check if the user is a user or if it is root (if root, no sudo, if !root then add sudo), before it will check the oslib for the correct OS, to create the correct command
func UpdateOS ¶
UpdateOS same as the Update function, but will run any OS/distribution related upgrade/update parameters to upgrade all packages including the OS some OS's does not have this functionality and updates the OS during a normal update. So if the OS does have a separate upgrade option (eg. debian dist-upgrade), then this function is redundant
Types ¶
This section is empty.