pyinfra.api.facts module

The pyinfra facts API. Facts enable pyinfra to collect remote server state which is used to “diff” with the desired state, producing the final commands required for a deploy.

class pyinfra.api.facts.FactBase

Bases: object

abstract = True
static default()

Set the default attribute to be a type (eg list/dict).

name = 'pyinfra.api.facts.FactBase'
static process(output)
process_pipeline(args, output)
requires_command = None
shell_executable = None
class pyinfra.api.facts.FactNameMeta(name, bases, attrs)

Bases: type

class pyinfra.api.facts.ShortFactBase

Bases: object

fact = None
name = 'pyinfra.api.facts.ShortFactBase'
pyinfra.api.facts.create_host_fact(state, host, cls, data, args=None, kwargs=None)
pyinfra.api.facts.delete_host_fact(state, host, cls, args=None, kwargs=None)
pyinfra.api.facts.get_fact(state, host, cls, args=None, kwargs=None, ensure_hosts=None, apply_failed_hosts=True, fact_hash=None, use_cache=True)
pyinfra.api.facts.get_facts(state, *args, **kwargs)
pyinfra.api.facts.get_host_fact(state, host, cls, args=None, kwargs=None)
pyinfra.api.facts.get_short_facts(state, host, short_fact, **kwargs)
pyinfra.api.facts.reload_host_fact(state, host, cls, args=None, kwargs=None)