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: object

A 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: object

Returns the path environment variable of the current user.

Examples:

yield Get_path()
class reemote.facts.server.get_date.Get_Date[source]

Bases: object

Returns the current datetime on the server.

Examples:

yield Get_Date()
class reemote.facts.server.get_arch.Get_Arch[source]

Bases: object

Returns the system architecture according to uname.

Examples:

yield Get_Arch()
class reemote.facts.server.get_user.Get_User[source]

Bases: object

Returns the name of the current user.

Examples:

yield Get_user()
class reemote.facts.server.get_kernel.Get_Kernel[source]

Bases: object

Returns the kernel name according to uname -s.

Examples:

yield Get_kernel()
class reemote.facts.server.get_home.Get_Home[source]

Bases: object

Returns the home directory of the current user.

Examples:

yield Get_home()
class reemote.facts.server.get_hostname.Get_Hostname[source]

Bases: object

Returns the current hostname of the server.

Examples:

yield Get_hostname()
class reemote.facts.server.get_kernelversion.Get_KernelVersion[source]

Bases: object

Returns the kernel name according to uname -r.

Examples:

yield Get_kernelversion()
class reemote.facts.server.get_tempdir.Get_TmpDir[source]

Bases: object

Returns the temporary directory of the current server, if configured.

Examples:

yield Get_tmpdir()