pyinfra.api.state module

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

Bases: object

Manages state for a pyinfra deploy.


Flag a host as active.

config = None
current_op_file = 0
current_op_hash = None
deploy(name, kwargs, data, line_number, in_deploy=True)

Wraps a group of operations as a deploy, this should not be used directly, instead use pyinfra.api.deploy.deploy.

deploy_data = None
deploy_dir = None
deploy_kwargs = None
deploy_line_numbers = None
deploy_name = None
deploying = False
fail_hosts(hosts_to_fail, activated_count=None)

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

get_temp_filename(hash_key=None, hash_filename=True)

Generate a temporary filename for this deploy.

in_deploy = False
in_op = False
init(inventory, config, initial_limit=None)
initialised = False
inventory = None

Returns a boolean indicating if the host is within the current state limit.

loop_counter = None
loop_line = None
pool = None
print_fact_info = False
print_fact_input = False
print_fact_output = False
print_input = False
print_output = False