Server Facts¶
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',
},
}
has_gui
¶
host.fact.has_gui
Returns a boolean indicating the remote side has GUI capabilities. Linux only.
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
.
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,
],
}
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,
},
}