Files Facts

directory

host.fact.directory(path)

file

host.fact.file(path)

find_directories

host.fact.find_directories(name)

Returns a list of directories from a start point, recursively using find.

find_files

host.fact.find_files(name)

Returns a list of files from a start point, recursively using find.

find_in_file

host.fact.find_in_file(name, pattern)

Checks for the existence of text in a file using grep. Returns a list of matching lines if the file exists, and None if the file does not.

md5_file

host.fact.md5_file(name)

Returns an MD5 hash of a file.

sha1_file

host.fact.sha1_file(name)

Returns a SHA1 hash of a file. Works with both sha1sum and sha1.

sha256_file

host.fact.sha256_file(name)

Returns a SHA256 hash of a file.

socket

host.fact.socket(path)