Name | rxctl JSON |
Version |
1.0.3
JSON |
| download |
home_page | https://github.com/mihaiush/rxctl |
Summary | Linux remote execution tool |
upload_time | 2023-07-10 10:40:48 |
maintainer | |
docs_url | None |
author | mihaiush |
requires_python | >=3.7,<4.0 |
license | |
keywords |
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# rxctl
Linux remote execution tool.
## What is rxctl ?
It executes tasks (scripts) on remote hosts over SSH and SUDO. The tasks can contain remote and local executed code. Remote code is always executed as root, sudo is used to elevate privileges. It may work on other UNIX-like OS but it was only tested on Linux (Debian) and it relies on /bin/bash for most of its helper tools. It is heavily influenced by fabric (https://www.fabfile.org) and cdis (https://www.cdi.st/manual/latest/index.html):
- tasks and helper tools names start with __,
- tasks are written in shell script (/bin/sh),
- it is not a configuration tool but a scripting one. It doesn’t try to achieve any kind of idempotency, commands are executed in order they appear in task,
The tool itself is not involved in the remote code execution in any way, its job is to prepare a list of hosts and an environment in which external scripts (tasks) are executed on each host (sequential or in parallel). The remote execution is handled by some helper commands (__run, __get, __put, …). It also adds the current directory and the bin directory to the path.
```
rxctl [OPTIONS] [TASKS]...
Options:
-E, --environment PATH Script to generate environment (config & inventory)
[default: ./environment]
-H, --host TEXT Comma separated list of host (can be used multiple
times)
-S, --selector TEXT Inventory selector (can be used multiple times)
--use-ssh-password Ask for ssh password
--use-sudo-password Ask for sudo password
--ssh-opt TEXT SSH options [default: -o ControlMaster=auto -o
ControlPath=/dev/shm/rx-ssh-%h -o ControlPersist=5m
-o ConnectTimeout=1]
--password-envvar TEXT Environment variable used to pass password to sudo
[default: LC_PASSWD]
-u, --user TEXT SSH user [default: ***]
-P, --parallel Run hosts in parallel
--max-parallel INTEGER How many threads to use to run hosts in parallel, 0
- run everything in parralel [default: 0]
-A, --ad-hoc Task list is a remote ad-hoc command
-I, --inventory With -S shows the list of hosts, by itself shows the
inventory summary.
-c, --check-only Show valid inventory
-l, --task-list List tasks in local directory
-t, --task-help TEXT Show help for a task
-w, --warning-only Don't exit if a host fails check, evict host from
inventory
-x, --exclude TEXT Comma separated list of host to exclude from
inventory (can be used multiple times)
-i, --inline-check Don't check hosts before tasks, do it for each host
at the begining of the task list
--set-env TEXT Set environment variable (can be used multiple
times)
-v, --verbosity Verbosity level, up to 3
-V, --version Show the version and exit.
--help Show this message and exit.
```
## Environment script
The environment script (default ```./environment```) is used to overwrite rxctl parameters and to generate the list of host (inventory) on which to run the tasks:
- ```environment check```, should produce a JSON dictionary of parameters you want to overwrite,
- ```environment inventory```, free text which is displayed when you run ```rxctl -I``` without any other parameter,
- ```environment inventory <SELECTOR>```, JSON list of hosts
## Helper tools
### __init
Makes an arbitrary script a task
```
. __init <<EOF
Short help (rxctl -l)
Long help (rxctl -t TASK)
EOF
```
### __run
Run a remote command
```
__run 'COMMAND1 ; COMMAND2 ; ...'
```
or
```
__run <<EOF
COMMAND1
COMMAND2
EOF
```
### __get, __put
Copy files from/to remote host
### __log
Log message
```
__log.LEVEL MESSAGE
```
### __wait
Wait for an event to happen
```
__wait ACTION CHECK TIMEOUT STEP DELAY
ACTION - a label to display in log messages
CHECK - command executed to check the status, if rc 0 exit wait
TIMEOUT - max wait in seconds
STEP - interval to run check
DELAY - initial delay
```
### __ansible
Run ansible module.
It requires ansible, instalation directoty should be passed to rxctl with *set-env*, e.g.:
```
rxctl --set-env RX_ANSIBLE=/usr/lib/python3/dist-packages/ansible
```
Invocation:
```
__ansible MODULE [--PARAM1=VAL1] [--PARAM2=VAL2]
```
or
```
__ansible.PACKAGE [PACKAGE_NAME] [--PARAM1=VAL1] [--PARAM2=VAL2]
__ansible.SERVICE [SERVICE_NAME] [--PARAM1=VAL1] [--PARAM2=VAL2]
__ansible.SETUP [SUBSET] [--PARAM1=VAL1] [--PARAM2=VAL2]
```
or return one fact from subset *distribution,pkg_mgr,service_mgr,virtual*:
```
__ansible.fact FACT
```
Raw data
{
"_id": null,
"home_page": "https://github.com/mihaiush/rxctl",
"name": "rxctl",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "mihaiush",
"author_email": "mihaiush@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/fb/f1/6b4d16cc0d808fb602f2f2f124de26dbad9d65797ca303b2337f7227c1f8/rxctl-1.0.3.tar.gz",
"platform": null,
"description": "# rxctl\nLinux remote execution tool.\n\n## What is rxctl ?\nIt executes tasks (scripts) on remote hosts over SSH and SUDO. The tasks can contain remote and local executed code. Remote code is always executed as root, sudo is used to elevate privileges. It may work on other UNIX-like OS but it was only tested on Linux (Debian) and it relies on /bin/bash for most of its helper tools. It is heavily influenced by fabric (https://www.fabfile.org) and cdis (https://www.cdi.st/manual/latest/index.html):\n- tasks and helper tools names start with __,\n- tasks are written in shell script (/bin/sh),\n- it is not a configuration tool but a scripting one. It doesn\u2019t try to achieve any kind of idempotency, commands are executed in order they appear in task, \n\nThe tool itself is not involved in the remote code execution in any way, its job is to prepare a list of hosts and an environment in which external scripts (tasks) are executed on each host (sequential or in parallel). The remote execution is handled by some helper commands (__run, __get, __put, \u2026). It also adds the current directory and the bin directory to the path. \n\n```\nrxctl [OPTIONS] [TASKS]...\n\nOptions:\n -E, --environment PATH Script to generate environment (config & inventory)\n [default: ./environment]\n -H, --host TEXT Comma separated list of host (can be used multiple\n times)\n -S, --selector TEXT Inventory selector (can be used multiple times)\n --use-ssh-password Ask for ssh password\n --use-sudo-password Ask for sudo password\n --ssh-opt TEXT SSH options [default: -o ControlMaster=auto -o\n ControlPath=/dev/shm/rx-ssh-%h -o ControlPersist=5m\n -o ConnectTimeout=1]\n --password-envvar TEXT Environment variable used to pass password to sudo\n [default: LC_PASSWD]\n -u, --user TEXT SSH user [default: ***]\n -P, --parallel Run hosts in parallel\n --max-parallel INTEGER How many threads to use to run hosts in parallel, 0\n - run everything in parralel [default: 0]\n -A, --ad-hoc Task list is a remote ad-hoc command\n -I, --inventory With -S shows the list of hosts, by itself shows the\n inventory summary.\n -c, --check-only Show valid inventory\n -l, --task-list List tasks in local directory\n -t, --task-help TEXT Show help for a task\n -w, --warning-only Don't exit if a host fails check, evict host from\n inventory\n -x, --exclude TEXT Comma separated list of host to exclude from\n inventory (can be used multiple times)\n -i, --inline-check Don't check hosts before tasks, do it for each host\n at the begining of the task list\n --set-env TEXT Set environment variable (can be used multiple\n times)\n -v, --verbosity Verbosity level, up to 3\n -V, --version Show the version and exit.\n --help Show this message and exit.\n```\n\n## Environment script\nThe environment script (default ```./environment```) is used to overwrite rxctl parameters and to generate the list of host (inventory) on which to run the tasks:\n- ```environment check```, should produce a JSON dictionary of parameters you want to overwrite,\n- ```environment inventory```, free text which is displayed when you run ```rxctl -I``` without any other parameter,\n- ```environment inventory <SELECTOR>```, JSON list of hosts\n\n## Helper tools\n### __init\nMakes an arbitrary script a task\n```\n. __init <<EOF\nShort help (rxctl -l)\n\nLong help (rxctl -t TASK)\nEOF\n```\n### __run\nRun a remote command\n```\n__run 'COMMAND1 ; COMMAND2 ; ...'\n```\nor\n```\n__run <<EOF\nCOMMAND1\nCOMMAND2\nEOF\n```\n### __get, __put\nCopy files from/to remote host\n### __log\nLog message\n```\n__log.LEVEL MESSAGE\n```\n### __wait\nWait for an event to happen\n```\n__wait ACTION CHECK TIMEOUT STEP DELAY\nACTION - a label to display in log messages\nCHECK - command executed to check the status, if rc 0 exit wait\nTIMEOUT - max wait in seconds\nSTEP - interval to run check\nDELAY - initial delay\n```\n### __ansible\nRun ansible module.\nIt requires ansible, instalation directoty should be passed to rxctl with *set-env*, e.g.:\n```\nrxctl --set-env RX_ANSIBLE=/usr/lib/python3/dist-packages/ansible\n```\nInvocation:\n```\n__ansible MODULE [--PARAM1=VAL1] [--PARAM2=VAL2]\n```\nor\n```\n__ansible.PACKAGE [PACKAGE_NAME] [--PARAM1=VAL1] [--PARAM2=VAL2]\n__ansible.SERVICE [SERVICE_NAME] [--PARAM1=VAL1] [--PARAM2=VAL2]\n__ansible.SETUP [SUBSET] [--PARAM1=VAL1] [--PARAM2=VAL2]\n```\nor return one fact from subset *distribution,pkg_mgr,service_mgr,virtual*:\n```\n__ansible.fact FACT\n```\n",
"bugtrack_url": null,
"license": "",
"summary": "Linux remote execution tool",
"version": "1.0.3",
"project_urls": {
"Homepage": "https://github.com/mihaiush/rxctl"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "320a08dff6b841e7a1cb5ba3d7cb349ecf33c12a3bfb2862adb8ba8149cab6fe",
"md5": "5720d63b4e02293022912eeede3bce20",
"sha256": "e07cb6ba8b814fe2ab522ba9b930df57e2fc4aa8741b4dcf9fe1ca1e5635ad4d"
},
"downloads": -1,
"filename": "rxctl-1.0.3-cp37-cp37m-manylinux_2_35_x86_64.whl",
"has_sig": false,
"md5_digest": "5720d63b4e02293022912eeede3bce20",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": ">=3.7,<4.0",
"size": 18026,
"upload_time": "2023-07-10T10:40:47",
"upload_time_iso_8601": "2023-07-10T10:40:47.054825Z",
"url": "https://files.pythonhosted.org/packages/32/0a/08dff6b841e7a1cb5ba3d7cb349ecf33c12a3bfb2862adb8ba8149cab6fe/rxctl-1.0.3-cp37-cp37m-manylinux_2_35_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fbf16b4d16cc0d808fb602f2f2f124de26dbad9d65797ca303b2337f7227c1f8",
"md5": "a5a7ef7c8fa4181ba73cb700ff4d7e9e",
"sha256": "aac628a2f9f5a0560900efdd2668981f8b7da4e1d852f0e6e42d6b4b82e8016f"
},
"downloads": -1,
"filename": "rxctl-1.0.3.tar.gz",
"has_sig": false,
"md5_digest": "a5a7ef7c8fa4181ba73cb700ff4d7e9e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 16441,
"upload_time": "2023-07-10T10:40:48",
"upload_time_iso_8601": "2023-07-10T10:40:48.302477Z",
"url": "https://files.pythonhosted.org/packages/fb/f1/6b4d16cc0d808fb602f2f2f124de26dbad9d65797ca303b2337f7227c1f8/rxctl-1.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-10 10:40:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mihaiush",
"github_project": "rxctl",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "rxctl"
}