server facts¶
- class reemote.facts.server.get_os.Get_OS(field: str = 'PRETTY_NAME', guard: bool = True, sudo: bool = False, su: bool = False)[source]¶
Bases:
objectA class to obtain information about the OS.
- field¶
The name of the field to operate on.
- Type:
str
- sudo¶
If True, the commands will be executed with sudo privileges.
- Type:
bool
- su¶
If True, the commands will be executed with su privileges.
- Type:
bool
Examples:
yield Get_OS("NAME")
- Usage:
This class is designed to be used in a generator-based workflow where commands are yielded for execution. It supports adding or removing packages based on the present flag and allows privilege escalation via sudo or su.
Notes
Commands are constructed based on the present, sudo, and su flags.
The changed flag is set if the package state changes after execution.
- class reemote.facts.server.get_path.Get_Path[source]¶
Bases:
objectReturns the path environment variable of the current user.
Examples:
yield Get_path()
- class reemote.facts.server.get_date.Get_Date[source]¶
Bases:
objectReturns the current datetime on the server.
Examples:
yield Get_Date()
- class reemote.facts.server.get_arch.Get_Arch[source]¶
Bases:
objectReturns the system architecture according to
uname.Examples:
yield Get_Arch()
- class reemote.facts.server.get_user.Get_User[source]¶
Bases:
objectReturns the name of the current user.
Examples:
yield Get_user()
- class reemote.facts.server.get_kernel.Get_Kernel[source]¶
Bases:
objectReturns the kernel name according to uname -s.
Examples:
yield Get_kernel()
- class reemote.facts.server.get_home.Get_Home[source]¶
Bases:
objectReturns the home directory of the current user.
Examples:
yield Get_home()
- class reemote.facts.server.get_hostname.Get_Hostname[source]¶
Bases:
objectReturns the current hostname of the server.
Examples:
yield Get_hostname()