pyinfra.api.state module

class pyinfra.api.state.State(inventory, config=None)

Bases: object

Manages state for a pyinfra deploy.

active = True
config = None
current_op_hash = None
deploy(name, meta_kwargs)
deploy_dir = None
deploy_kwargs = None
deploy_name = None
fail_hosts(hosts_to_fail)

Flag a set of hosts as failed, error for config.FAIL_PERCENT.

get_temp_filename(hash_key=None)

Generate a temporary filename for this deploy.

in_op = False
inventory = None
is_cli = False
limit(hosts)
limit_hosts = None
pool = None
print_fact_info = False
print_fact_output = False
print_lines = False
print_output = False
ready_host(host)

Flag a host as ready, after which facts will not be gathered for it.