HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

pyinfra — Automates infrastructure at a large scale. More information: <https://docs.pyinfra.com/en/3.x/cli.ht

Submitted by: @import:tldr-pages··
0
Viewed 0 times
automatescommandinfrastructurelargescaleclimorepyinfra

Problem

How to use the pyinfra command: Automates infrastructure at a large scale. More information: <https://docs.pyinfra.com/en/3.x/cli.html>.

Solution

pyinfra — Automates infrastructure at a large scale. More information: <https://docs.pyinfra.com/en/3.x/cli.html>.

Execute a command over SSH:
pyinfra {{target_ip_address}} exec -- {{command_name_and_arguments}}


Execute contents of a deploy file on a list of targets:
pyinfra {{path/to/target_list.py}} {{path/to/deploy.py}}


Execute commands on locally:
pyinfra @local {{path/to/deploy.py}}


Execute commands over Docker:
pyinfra @docker/{{container}} {{path/to/deploy.py}}

Code Snippets

Execute a command over SSH

pyinfra {{target_ip_address}} exec -- {{command_name_and_arguments}}

Execute contents of a deploy file on a list of targets

pyinfra {{path/to/target_list.py}} {{path/to/deploy.py}}

Execute commands on locally

pyinfra @local {{path/to/deploy.py}}

Execute commands over Docker

pyinfra @docker/{{container}} {{path/to/deploy.py}}

Context

tldr-pages: common/pyinfra

Revisions (0)

No revisions yet.