To execute a command on a group of hosts matching a given regular expression:
pypsh cmd <hostregex> <cmd-to-execute>
E.g.:
pypsh cmd "role\d+\.customer\.your\.domain" "uptime"
Or to copy a given file to a group of hosts:
pypsh copy /tmp/here/myfile.txt "my\.domains\d+\.com" /tmp/remote/file.txt
The command or file copy operation will be executed on any host that is in the known_hosts file and matches the given regular expression.
Installation
Pypsh can be installed using pip:
pip install pypsh
Development
To work on pypsh checkout the git repository, create a virtual environment and install the dependencies:
git clone https://github.com/mfussenegger/pypsh.git cd pypsh mkvirtualenv pypsh pip install -r requirements.txt
Sometimes it is useful to point the pypsh command to the local development branch:
pip install --upgrade --force-reinstall --editable .
But usually it is sufficient to invoke it like this:
python pypsh/main.py {cmd,copy} ...
Metadata
Release files for pypsh 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pypsh-0.4.0.tar.gz | 3.3 kB | Details |
Release files / pypsh-0.4.0.tar.gz
| Download URL | pypsh-0.4.0.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
54ee7c406162f4fe36dc4a302daa72cce14c4a37dcf566ad7f0ae8429a51e99b
|
|
BLAKE2b-256 checksum How to use checksums |
ec323a55a17795327436e0bd1267313cd1a44af486d83915127c3e10b395f027
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |