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
, elb
or opsworks
:
$ kitten ip asg my-tiny-asg
18.135.117.17
24.129.235.48
- By default only private IP addresses are returned. Use
--public
if you prefer public IPs. - You can change region using
--region
.
If you're in a hurry, you can just paste any text that contains instance IDs:
$ kitten ip id prod-mongo-0901bc21990109ed4-eu my-hostname-06a2fc734534ef6d9
17.136.127.18
23.119.136.38
Run command on servers
Use kitten run
:
$ 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 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. - Use
-i
to specify a private key. Otherwise, behavior is similar tossh
. - Commands are always run in parallel. Use
--threads
to specify the maximum number of concurrent connections (defaults to 10).
Just pipe kitten ip
to xargs
to do everything in one step.
Download files from servers
Use kitten get
:
kitten ip opsworks a283c671-d4c1-4dfa-a7c2-823b7f7b2c2c | xargs kitten get /tmp/system.log ubuntu
Upload file to servers
Use kitten put
:
kitten ip asg big-prod-asg | xargs kitten put -i ~/.ssh/key.pem 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
kitten-0.3.0.tar.gz
(5.9 kB
view hashes)
Built Distribution
Close
Hashes for kitten-0.3.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbf71c2ba927ed3216c2b3db2f3ff97d1d1ef63d7f1c722781ad43be99177d8c |
|
MD5 | 03b6bbefc1e72bd4aea87fea353eb1da |
|
BLAKE2b-256 | 8ae12aebddc7fe7f5834e7764ad8927137c93012b25da8ef8f850293ddb8d082 |