Tiny multi-server automation tool.
Project description
😽 kitten
Tiny multi-server automation tool.
It's designed to be as simple as possible and play nice with Unix tools.
Install
pip install kitten
Prerequisites
Kitten can get IP addresses from AWS resources for you. For that you'll need to have your AWS credentials set up. You can do that using awscli
:
pip install awscli
Then:
aws configure
Examples
Get IP addresses from AWS resources
Use kitten ip
with either id
, asg
or elb
:
$ kitten ip id i-04703bf3e6fab1926 i-07f234d0f29113ef2
18.135.117.17
24.129.235.48
$ kitten ip asg my-asg-name
18.105.107.20
34.229.135.48
You can change region using --region
.
By default private IP addresses are printed. Use --public
if you prefer public IPs.
Run command on servers
$ kitten run uptime ubuntu 18.105.107.20 34.229.135.48
18.105.107.20 run uptime
34.229.135.48 run uptime
18.105.107.20 ok
34.229.135.48 ok
18.105.107.20 17:11:48 up 1 day, 6:02, 0 users, load average: 0.91, 2.99, 3.49
34.229.135.48 17:11:48 up 5 days, 11:19, 0 users, load average: 6.34, 5.94, 5.72
Replace ubuntu
with the user used to log in on the servers.
Commands are always run in parallel. Use --threads
to specify the maximum number of concurrent connections (defaults to 10).
Use --sudo
to run commands via sudo
.
Use -i
to specify a private key.
Get IP addresses and run command in one step
Just pipe kitten ip
to xargs
:
kitten ip asg big-prod-asg-name | xargs kitten run 'rm -rf /tmp' root
Download files
kitten ip elb big-prod-elb | xargs kitten get -i ~/.ssh/key.pem /tmp/system.log ubuntu
Upload file
kitten ip --region ap-northeast-2 elb big-prod-elb | xargs kitten put cat.jpg /root/cat.jpg root
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for kitten-0.2.8-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f93636895bc2a134d8d1e982fb963f01ef54e7305bf684353cd50c2b25a41eb9 |
|
MD5 | 69b9f39252c905df9997afb92afca8dd |
|
BLAKE2b-256 | 837368628e5a3395f77630684b514d1da1a177e8d04971f13e904c167b6741ed |