A library for mass execution of ssh commands on remote machines fleet.
More docs: https://subatiq.github.io/kornet/
pip install kornet
kornet run <strategy_file.yml> <fleet_file.yml> <group>
strategy file - yaml strategy file described above
fleet file - yaml fleet file described above
group - group to run the strategy on
$ kornet run strategy.yml fleet.yml office
...
Lots of output with results
...
$ kornet recon CPU user@192.168.0.2 --port 5022
Results:
cpu:
arch: x86_64
cores: 8
model: Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz
You need to specify hosts and their groups. Groups so far can store only simple SSH configurations (username, password and port). Each host can override these values by specifying certain fields.
hosts:
- ip: 192.168.0.2
groups:
- office
- ip: 192.168.0.3
ssh:
username: user # overrides group value
groups:
- office
groups:
office:
ssh:
username: root
password: toor
port: 22
Strategy is a set of orders to execute via SSH. The format is pretty simple:
recon:
- CPU
- OS
orders:
- name: List all directories
command: ls
- name: Current path
command: pwd
recon
field is responsible for specifing steps of gathering information about the target host.
orders
is a list of commands that need to be executed on the target host.