1 Commits
1.1.0 ... 1.0.9

Author SHA1 Message Date
1eb9c5c17d Added multiple -e 2023-09-07 17:40:37 +03:00
4 changed files with 55 additions and 56 deletions

View File

@ -96,22 +96,3 @@ jobs:
artifacts: "${{ steps.download_binary.outputs.download-path }}/*,${{ steps.download_pkg.outputs.download-path }}/*" artifacts: "${{ steps.download_binary.outputs.download-path }}/*,${{ steps.download_pkg.outputs.download-path }}/*"
allowUpdates: true allowUpdates: true
body: Static musl build for x86_64-linux and Arch Linux package body: Static musl build for x86_64-linux and Arch Linux package
dispatch:
name: Notify my Arch Repo
needs:
- build
- build_arch
- release
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Dispatch to workflows
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.ACTIONS_KEY }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/house-of-vanity/arch_repo/dispatches \
-d '{"event_type":"new_package","client_payload":{}}'

View File

@ -1,15 +0,0 @@
name: Dispatcher
on: ["push"]
jobs:
dispatch:
name: Dispatch
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Dispatch to workflows
run: |
curl -H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.ACTIONS_KEY }}" \
--request POST \
--data '{"event_type": "some_event", "client_payload": { "foo": "bar" }}' https://api.github.com/repos/house-of-vanity/arch_repo/dispatches

View File

@ -1,6 +1,6 @@
[package] [package]
name = "rexec" name = "rexec"
version = "1.1.0" version = "1.0.9"
readme = "https://github.com/house-of-vanity/rexec#readme" readme = "https://github.com/house-of-vanity/rexec#readme"
edition = "2021" edition = "2021"
description = "Parallel SSH executor" description = "Parallel SSH executor"
@ -22,6 +22,7 @@ lazy-st = "0.2.2"
regex = "1" regex = "1"
clap = { version = "4.3.4", features = ["derive"] } clap = { version = "4.3.4", features = ["derive"] }
colored = "2.0.0" colored = "2.0.0"
#dialoguer = "0.10.4"
itertools = "0.10.5" itertools = "0.10.5"
brace-expand = "0.1.0" brace-expand = "0.1.0"
question = "0.2.2" question = "0.2.2"

View File

@ -32,31 +32,63 @@ Options:
``` ```
--- ---
![image](https://github.com/house-of-vanity/rexec/assets/4666566/4c52915d-2bc1-46b9-9833-b0d7c0527f2d)
## Examples ## Examples
```shell ```shell
$ rexec -f \ [ab@test]$ rexec -e 'cassandra-gce-sc-[1:3].bbs-prod.*' -u ab -c 'df -h /srv/cassandra'
-e 'cassandra-gce-or-[1:2]' \
-u ab \
-c 'uname -r; date'
[INFO ] Using string expansion to build server list. [INFO ] Using string expansion to build server list.
[INFO ] Matched hosts: [INFO ] Matched hosts:
[INFO ] cassandra-gce-or-1.prod.example.com [2.22.123.79] [INFO ] cassandra-gce-sc-1.bbs-prod.* [35.221.18.35]
[INFO ] cassandra-gce-or-2.prod.example.com [2.22.123.158] [INFO ] cassandra-gce-sc-2.bbs-prod.* [35.212.13.174]
Continue on following 2 servers? y [INFO ] cassandra-gce-sc-3.bbs-prod.* [35.211.213.123]
[INFO ] Run command on 2 servers. Continue on following 3 servers? y
[INFO ]
[INFO ] Run command on 3 servers.
[INFO ]
[INFO ] cassandra-gce-sc-2.bbs-prod.*
Code 0
STDOUT:
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/storage-cassandra 1.0T 613G 411G 60% /srv/cassandra
cassandra-gce-or-1.prod.example.com [INFO ] cassandra-gce-sc-1.bbs-prod.*
Exit code [0] / stdout 45 bytes / stderr 0 bytes Code 0
STDOUT STDOUT:
║ 5.15.0-1040-gcp Filesystem Size Used Avail Use% Mounted on
║ Thu Sep 7 13:44:40 UTC 2023 /dev/mapper/storage-cassandra 1.0T 594G 430G 59% /srv/cassandra
cassandra-gce-or-2.prod.example.com [INFO ] cassandra-gce-sc-3.bbs-prod.*
Exit code [0] / stdout 45 bytes / stderr 0 bytes Code 0
STDOUT STDOUT:
║ 5.15.0-1040-gcp Filesystem Size Used Avail Use% Mounted on
║ Thu Sep 7 13:44:40 UTC 2023 /dev/mapper/storage-cassandra 1.0T 523G 502G 52% /srv/cassandra
```
---
```shell
[ab@test]$ ./rexec -u ab -k -c uptime -e admin.* -f
[INFO ] Matched hosts:
[INFO ] admin-gce-sc-1.lca-prod.** [35.211.27.195]
[INFO ] admin-gce-sc-1.mmk-prod.** [35.211.79.202]
[ERROR] admin-gce-sc-1.led-prod.** couldn't be resolved.
[INFO ] admin-gce-sc-1.msq-dev.** [35.211.0.24]
[ERROR] admin-gce-sc-1.hui-dev.** couldn't be resolved.
[INFO ] Run command on 3 servers.
[INFO ] admin.gnb-prod.**
Code 0
STDOUT:
23:31:21 up 294 days, 14:14, 0 users, load average: 0.53, 0.64, 0.52
[INFO ] admin.abe-prod.**
Code 0
STDOUT:
23:31:22 up 154 days, 9:24, 0 users, load average: 0.31, 0.25, 0.18
[INFO ] admin-gce-be-1.toy-prod.**
Code 0
STDOUT:
23:31:22 up 98 days, 6:20, 0 users, load average: 0.88, 0.74, 0.80
``` ```