Server

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

date

host.fact.date

Returns the current datetime on the server.

groups

host.fact.groups

Returns a list of groups on the system.

home

host.fact.home

Returns the home directory of the current user.

hostname

host.fact.hostname

Returns the current hostname of the server.

kernel_modules

host.fact.kernel_modules

Returns a dictionary of kernel module name -> info.

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

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_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",
    ...
}

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.

os_version

host.fact.os_version

Returns the OS version according to uname.

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

users

host.fact.users

Returns a dictionary of users -> details.

'user_name': {
    'home': '/home/user_name',
    'shell': '/bin/bash,
    'group': 'main_user_group',
    'groups': [
        'other',
        'groups'
    ]
},
...

which

host.fact.which(name)

Returns the path of a given command, if available.