Server Facts

arch

host.fact.arch

Returns the system architecture according to uname.

command

host.fact.command(command)

Returns the raw output lines of a given command.

crontab

host.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',
    },
}

date

host.fact.date

Returns the current datetime on the server.

groups

host.fact.groups

Returns a list of groups on the system.

has_gui

host.fact.has_gui

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

home

host.fact.home

Returns the home directory of the current user.

hostname

host.fact.hostname

Returns the current hostname of the server.

kernel

host.fact.kernel

Returns the kernel name according to uname.

kernel_modules

host.fact.kernel_modules

Returns a dictionary of kernel module name -> info.

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

kernel_version

host.fact.kernel_version

Returns the kernel version according to uname.

linux_distribution

host.fact.linux_distribution

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',
        ...
    }
}

linux_gui

host.fact.linux_gui

Returns a list of available Linux GUIs.

linux_name

host.fact.linux_name

Returns the name of the Linux distribution. Shortcut for host.fact.linux_distribution['name'].

lsb_release

host.fact.lsb_release

Returns a dictionary of release information using lsb_release.

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

macos_version

host.fact.macos_version

Returns the installed MacOS version.

mounts

host.fact.mounts

Returns a dictionary of mounted filesystems and information.

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

os

host.fact.os

Returns the OS name according to uname.

Warning

This fact is deprecated/renamed, please use the kernel fact.

os_version

host.fact.os_version

Returns the OS version according to uname.

Warning

This fact is deprecated/renamed, please use the kernel_version fact.

selinux

host.fact.selinux

Discovers the SELinux related facts on the target host.

{
    'mode': 'enabled',
}

sysctl

host.fact.sysctl

Returns a dictionary of sysctl settings and values.

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

user

host.fact.user

Returns the name of the current user.

users

host.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,
    },
}

which

host.fact.which(name)

Returns the path of a given command, if available.