pyinfra.local module

pyinfra.local.include(filename, hosts=False, when=True)

Executes a local python file within the pyinfra.pseudo_state.deploy_dir directory.

  • hosts (string, list) – group name or list of hosts to limit this include to

  • when (bool) – indicate whether to trigger operations in this include, splitlines=False, ignore_errors=False)

Subprocess based implementation of pyinfra/api/’s run_shell_command.

  • commands (string, list) – command or list of commands to execute

  • spltlines (bool) – optionally have the output split by lines

  • ignore_errors (bool) – ignore errors when executing these commands