pyinfra.local module

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

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

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

  • when (bool) – indicate whether to trigger operations in this include

pyinfra.local.shell(commands, splitlines=False, ignore_errors=False)

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

Parameters
  • 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