pyinfra.api.host module

class pyinfra.api.host.Host(name, inventory, groups, executor=<module 'pyinfra.connectors.ssh' from '/Users/nick/Dropbox/_dev/Webroot/pyinfra/src/pyinfra/connectors/ssh.py'>)

Bases: object

Represents a target host. Thin class that links up to facts and host/group data.

check_can_rsync()
connect(reason=None, show_errors=True, raise_exceptions=False)
property connected
connection = None
create_fact(name_or_cls, data=None, kwargs=None)
current_deploy_data = None
current_deploy_kwargs = None
current_deploy_name = None
current_deploy_op_order = None
current_op_global_kwargs = None
current_op_hash = None
delete_fact(name_or_cls, kwargs=None)
deploy(name, kwargs, data, in_deploy=True, deploy_op_order=None)

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

disconnect()
executing_op_hash = None
get_deploy_data()
get_fact(name_or_cls, *args, **kwargs)
get_file(*args, **kwargs)
property group_data
property host_data
in_deploy = False
in_op = False
nested_executing_op_hash = None
noop(description)

Log a description for a noop operation.

property print_prefix
put_file(*args, **kwargs)
reload_fact(name_or_cls, *args, **kwargs)
rsync(*args, **kwargs)
run_shell_command(*args, **kwargs)
state = None
style_print_prefix(*args, **kwargs)
class pyinfra.api.host.HostData(host, *datas)

Bases: object

Combines multiple AttrData’s to search for attributes.

dict()
get(key, default=None)
override_datas = None
pyinfra.api.host.extract_callable_datas(datas)