Server Facts

See also: Server Operations.

server.Arch

host.get_fact(Arch)

Returns the system architecture according to uname.

server.Command

host.get_fact(Command, command)

Returns the raw output lines of a given command.

server.Crontab

host.get_fact(Crontab, user=None)

Returns a dictionary of cron command -> execution time.

{
    "/path/to/command": {
        "minute": "*",
        "hour": "*",
        "month": "*",
        "day_of_month": "*",
        "day_of_week": "*",
    },
    "echo another command": {
        "special_time": "@daily",
    },
}

server.Date

host.get_fact(Date)

Returns the current datetime on the server.

server.Groups

host.get_fact(Groups)

Returns a list of groups on the system.

server.HasGui

host.get_fact(HasGui)

Returns a boolean indicating the remote side has GUI capabilities. Linux only.

server.Home

host.get_fact(Home)

Returns the home directory of the current user.

server.Hostname

host.get_fact(Hostname)

Returns the current hostname of the server.

server.Kernel

host.get_fact(Kernel)

Returns the kernel name according to uname.

server.KernelModules

host.get_fact(KernelModules)

Returns a dictionary of kernel module name -> info.

{
    "module_name": {
        "size": 0,
        "instances": 0,
        "state": "Live",
    },
}

server.KernelVersion

host.get_fact(KernelVersion)

Returns the kernel version according to uname.

server.LinuxDistribution

host.get_fact(LinuxDistribution)

Returns a dict of the Linux distribution version. Ubuntu, Debian, CentOS, Fedora & Gentoo currently. Also contains any key/value items located in release files.

{
    "name": "Ubuntu",
    "major": 20,
    "minor": 04,
    "release_meta": {
        "CODENAME": "focal",
        "ID_LIKE": "debian",
        ...
    }
}

server.LinuxGui

host.get_fact(LinuxGui)

Returns a list of available Linux GUIs.

server.LinuxName

host.get_fact(LinuxName)

Returns the name of the Linux distribution. Shortcut for host.get_fact(LinuxDistribution)['name'].

server.Locales

host.get_fact(Locales)

Returns installed locales on the target host.

["C.UTF-8", "en_US.UTF-8"]

server.LsbRelease

host.get_fact(LsbRelease)

Returns a dictionary of release information using lsb_release.

{
    "id": "Ubuntu",
    "description": "Ubuntu 18.04.2 LTS",
    "release": "18.04",
    "codename": "bionic",
    ...
}

server.MacosVersion

host.get_fact(MacosVersion)

Returns the installed MacOS version.

server.Mounts

host.get_fact(Mounts)

Returns a dictionary of mounted filesystems and information.

{
    "/": {
        "device": "/dev/mv2",
        "type": "ext4",
        "options": [
            "rw",
            "relatime"
        ]
    },
}

server.Os

host.get_fact(Os)

Returns the OS name according to uname.

Warning

This fact is deprecated/renamed, please use the server.Kernel fact.

server.OsVersion

host.get_fact(OsVersion)

Returns the OS version according to uname.

Warning

This fact is deprecated/renamed, please use the server.KernelVersion fact.

server.Path

host.get_fact(Path)

Returns the path environment variable of the current user.

server.SecurityLimits

host.get_fact(SecurityLimits)

Returns a list of security limits on the target host.

[
    {
        "domain": "*",
        "limit_type": "soft",
        "item": "nofile",
        "value": "1048576"
    },
    {
        "domain": "*",
        "limit_type": "hard",
        "item": "nofile",
        "value": "1048576"
    },
    {
        "domain": "root",
        "limit_type": "soft",
        "item": "nofile",
        "value": "1048576"
    },
    {
        "domain": "root",
        "limit_type": "hard",
        "item": "nofile",
        "value": "1048576"
    },
    {
        "domain": "*",
        "limit_type": "soft",
        "item": "memlock",
        "value": "unlimited"
    },
    {
        "domain": "*",
        "limit_type": "hard",
        "item": "memlock",
        "value": "unlimited"
    },
    {
        "domain": "root",
        "limit_type": "soft",
        "item": "memlock",
        "value": "unlimited"
    },
    {
        "domain": "root",
        "limit_type": "hard",
        "item": "memlock",
        "value": "unlimited"
    }
]

server.Selinux

host.get_fact(Selinux)

Discovers the SELinux related facts on the target host.

{
    "mode": "enabled",
}

server.Sysctl

host.get_fact(Sysctl)

Returns a dictionary of sysctl settings and values.

{
    "fs.inotify.max_queued_events": 16384,
    "fs.inode-state": [
        44565,
        360,
    ],
}

server.User

host.get_fact(User)

Returns the name of the current user.

server.Users

host.get_fact(Users)

Returns a dictionary of users -> details.

{
    "user_name": {
        "comment": "Full Name",
        "home": "/home/user_name",
        "shell": "/bin/bash,
        "group": "main_user_group",
        "groups": [
            "other",
            "groups"
        ],
        "uid": user_id,
        "gid": main_user_group_id,
        "lastlog": last_login_time,
        "password": encrypted_password,
    },
}

server.Which

host.get_fact(Which, command)

Returns the path of a given command, if available.