{ "info": { "author": "", "author_email": "", "bugtrack_url": null, "classifiers": [], "description": "## Store remote execution batches in a human-readable YAML file.\n\nHave you ever had to ssh into many machines and run the same command, and wait for it to finish before moving to the\nnext machine? If this is something you find yourself doing often, you have probably found yourself using a custom\nscript or something like fab to get the job done. This can be error-prone and difficult to generalize for different\nserver groups.\n\nShelli attempts to create a human-readable way to intelligently define groups of machines to execute shell commands\nwith, while allowing simple configuration for authentication, file/script transport, and more. The only configuration\nyou need it a simple YAML file.\n\nExample yaml:\n\n``` yaml \nhosts:\n - ns1.mydomain.org\n - ns2.mydomain.org\n - fiat.mydomain.org:\n auth_method: key\n key: /root/.ssh/id_rsa-fiat \nhostgroups:\n - dns:\n hosts:\n - ns1.mydomain.org\n - ns2.mydomain.org \n options: \n auth_method: key\n username: bind \n key: /root/.ssh/id_rsa_dns\n - fiat: \n hosts:\n - fiat\ntargets:\n - temp_fix: \n hostgroups:\n - fiat \n commands:\n - systemctl restart openvpn\n - run_scripts:\n hostgroups:\n - dns \n transports:\n - /home/kindlehl/my_script1:/tmp/my_script1\n - /home/kindlehl/my_script2:/tmp/my_script2 \n commands:\n - /tmp/my_script1\n - /tmp/my_script2 \n```\n### Scenario\n\nSay you've got two nameservers named `ns1.mydomain.org` and `ns2.mydomain.org`, and vpn server named `fiat`. These\nnames have to be resolvable by your OS's stub resolver, so you don't need to use the FQDN of the server. You have to\nlogin to your nameservers and run some scripts to update your zones. You should probably automate the updates, but you\ndecide to use Shelli instead. You also frequently have issues with openvpn tunnels connecting to your cloud infra, and\nyou think the best solution is to just restart openvpn each time an issue comes up. You could define the above YAML\nfile. \n\nThis creates three hosts: ns1.mydomain.org, ns2.mydomain.org, and fiat. Fiat uses password auth and needs to log in with root.\n\nIt also creates two hostgroups, one for fiat by itself, and one for your DNS servers. Even if you only want to run your\ncommands on one host, you still need to define the hostgroup.\n\nThis YAML also creates two targets, temp\\_fix and run\\_scripts. run\\_scripts will transport two scripts to /tmp before running.\nthem. It will only prompt you once for credentials since the hostgroup shares authentication parameters. If one of the\nnameservers required login as a different user, then you'd be prompted twice.\n\nWhen commander is run on the temp\\_fix target, it will login to fiat as root (while prompting you for your password),\nand it will restart the openvpn service.\n\nWhen commander runs the my\\_scripts target, it will login to the DNS servers, copy `/home/kindlehl/my\\_script{1,2}` to\n`ns1.mydomain.org:/tmp/my_script{1,2}` and `ns2.mydomain.org:/tmp/my\\_script{1,2}`. It will then run `/tmp/my_script1` and `/tmp/my_script2`,\non each host, then delete the scripts.\n\nSay you create a new nameserver, ns3, and you want to run the same commands as the others. Just go right on and add \n`ns3` to your hosts and your dns hostgroup.\n\nCurrently, commands are run on hosts in serial. Options for parallelism are in the future.\n\n### Configuration\n\nAll configuration for Shelli is done with a single YAML file. The path for the default YAML file is ~/.shelli.yml. You\ncan tell Shelli to use a custom config with the -c flag.\n\nThere are three top-level hashes in the YAML file:\n\n- hosts\n- hostgroups\n- targets\n\n### Terminology\n\n- host: A server along with the parameters needed to login.\n- hostgroup: A group of hosts, with optional defaults for authentication.\n- command: A command that gets ran by the shell on a host.\n- transport: A file that is transported to the host before command execution. It is removed after all commands finish\n running.\n- target: A list of commands, transports, and hostgroups to apply them to.\n\n#### Hosts\n\nA YAML hash containing a YAML list. The values in here can be a string or a hash. If a string is used, it will create a\nhost with default authentication parameters. If a hash is given, the name of key is the hostname, and the contents of\nthe hash define authentication options. \n\nDefault authentication is root login with a password over port 22.\n\nPossible authentication options:\n\n- auth\\_method: < key | password >\n- username: < login name >\n- key: < path/to/ssh/key > # Required if `auth_method` is 'key'.\n- password: < user password | keypair password > # Very insecure for obvious reasons. You will be prompted for\n credentials without this option.\n- port: < ssh port number >\n\n#### Hostgroups\n\nA YAML hash containing a YAML list. The values in here are hashes. The key of each hash defines the name of the\nhostgroup and can contain two hashes inside.\n\n##### Options\n\n- hosts: A YAML list of hosts, as defined in the hosts section.\n- options: A hash of authentication options identical to those set for individual hosts. This sets the default\n authentication for the entire group of hosts. Any hosts in the hostgroups that define their own authentication will\n override this group-wide default.\n\n#### Targets\n\nA YAML hash containing a YAML list. The values in here are hashes. The key of each hash defines the name of the target\nand can contains a list of commands and hostgroups. Optionally, transports can be defined.\n\n##### Options\n\n- hostgroups: The hostgroups to apply the transports and commands on.\n- commands: List of shell commands to run in order on the hosts in the hostgroups hash that is supplied.\n- transport: Optional list of files in the form : that get copied to each host before commands\n are run. They are removed afterwards.\n\nIssues\n------\n\nFeel free to submit issues and enhancement requests.\n\nContributing\n------------\n\n 1. **Fork** the repo on GitHub\n 2. **Clone** the project to your own machine\n 3. **Environment** Create virtualenv and install the packages in requirements.txt\n 3. **Lint** Run `pylint shelli` from the base of the project. Make sure the score is 10/10.\n 3. **Test** Run `python -m unittest discover -s test -v` from the base of the project. Add your own tests and\n\t\tmake sure your changes don't break other tests.\n 3. **Commit** changes to your own branch\n 4. **Push** your work back up to your fork\n 5. Submit a **Pull request** so that we can review your changes\n\nNOTE: Be sure to merge the latest from \"upstream\" before making a pull request!\n\nHome-page: https://github.com/kindlehl/shelli\nAuthor: Hunter Lannon\nAuthor-email: hunter.d.lannon@gmail.com\nLicense: GPLv3\nDescription: UNKNOWN\nPlatform: UNKNOWN\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "Shelli", "package_url": "https://pypi.org/project/Shelli/", "platform": "", "project_url": "https://pypi.org/project/Shelli/", "project_urls": null, "release_url": "https://pypi.org/project/Shelli/0.3/", "requires_dist": [ "fabric (>=2.4.0)", "cryptography (==2.3)", "PyYAML (>=5.1)" ], "requires_python": "", "summary": "# Shelli", "version": "0.3" }, "last_serial": 5011683, "releases": { "0.0": [ { "comment_text": "", "digests": { "md5": "ad6361369c8a728af5b150851a144281", "sha256": "a4e16473fa7231514a6c00c4199e915e691b7c4cb651044f892d829bde243da4" }, "downloads": -1, "filename": "Shelli-0.0-py2-none-any.whl", "has_sig": false, "md5_digest": "ad6361369c8a728af5b150851a144281", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 19380, "upload_time": "2019-03-30T05:02:46", "url": "https://files.pythonhosted.org/packages/90/a8/ea2829ec91e1bb1c6c4e042de663a0c124560b1e1fe4faf57d5bd3dab139/Shelli-0.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6822552d9b885c9b6ac88149587ebf85", "sha256": "0aca5d13385fe364248725eae9d01055bc76ff82c1794d37aec15be259bf4cba" }, "downloads": -1, "filename": "Shelli-0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "6822552d9b885c9b6ac88149587ebf85", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 22967, "upload_time": "2019-04-01T02:16:18", "url": "https://files.pythonhosted.org/packages/1b/05/46a67db7fdd5a263da36d3da34963574e2785b6bfb148e6d6ab5a3c6a52c/Shelli-0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0516f85f1a0b53ed7002d0c475123c0c", "sha256": "35a4a5d75b0b847a63b9ec5494e3f450c97309e28556dd85c4f8242a05eb2b9a" }, "downloads": -1, "filename": "Shelli-0.0.tar.gz", "has_sig": false, "md5_digest": "0516f85f1a0b53ed7002d0c475123c0c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5492, "upload_time": "2019-03-30T05:02:48", "url": "https://files.pythonhosted.org/packages/8c/14/5ee024000d29abe49d114d1c2034c0fc4e0fa0c16133cc33aedda7d35158/Shelli-0.0.tar.gz" } ], "0.1": [ { "comment_text": "", "digests": { "md5": "02f067d6d3ae875dc03baadab5a45255", "sha256": "edff5a7a784feb07b072dba05925eb12bc978997296b84531cbd86e2332de6c8" }, "downloads": -1, "filename": "Shelli-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "02f067d6d3ae875dc03baadab5a45255", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 22965, "upload_time": "2019-04-01T02:18:21", "url": "https://files.pythonhosted.org/packages/99/13/d476d8575c0efbacc011b76552ef6c0353e9aace5df20bd573347609f29f/Shelli-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2bc8dc7ef5821a26964e4167e7912571", "sha256": "e26c1280c62609a394a4b1d0e806795fb34af97a8498ab78c144233bc6389872" }, "downloads": -1, "filename": "Shelli-0.1.tar.gz", "has_sig": false, "md5_digest": "2bc8dc7ef5821a26964e4167e7912571", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11290, "upload_time": "2019-04-01T02:23:10", "url": "https://files.pythonhosted.org/packages/a5/4d/2d6d3d46ca3b3aefc12900d8b7e28246945082dbcc16af6d0c41b20feb4a/Shelli-0.1.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "869fdf41ccc726ae3a544ac9fe32e870", "sha256": "afd267d6ebb60f2e78bf597c41dcb5a35b3d43a252b33f8bd6e8349393ac35de" }, "downloads": -1, "filename": "Shelli-0.3-py2-none-any.whl", "has_sig": false, "md5_digest": "869fdf41ccc726ae3a544ac9fe32e870", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 23640, "upload_time": "2019-04-01T06:58:05", "url": "https://files.pythonhosted.org/packages/8e/b4/8bdf26a9929666e323048e9bd1bd44be7d4458e3ba5e5007f6a0e86ab625/Shelli-0.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d117b069890cd38190c73fad03d4492a", "sha256": "fb75e5f3ba6d23318dc58157fd25c3eeeb147de9120002ecdfc3ec3eb0868ae9" }, "downloads": -1, "filename": "Shelli-0.3.tar.gz", "has_sig": false, "md5_digest": "d117b069890cd38190c73fad03d4492a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12544, "upload_time": "2019-04-01T06:58:07", "url": "https://files.pythonhosted.org/packages/7b/f4/1a0ba66e13158fe3e0fb5c144afc4382be72a981e6fa4952a9d2f128f448/Shelli-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "869fdf41ccc726ae3a544ac9fe32e870", "sha256": "afd267d6ebb60f2e78bf597c41dcb5a35b3d43a252b33f8bd6e8349393ac35de" }, "downloads": -1, "filename": "Shelli-0.3-py2-none-any.whl", "has_sig": false, "md5_digest": "869fdf41ccc726ae3a544ac9fe32e870", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 23640, "upload_time": "2019-04-01T06:58:05", "url": "https://files.pythonhosted.org/packages/8e/b4/8bdf26a9929666e323048e9bd1bd44be7d4458e3ba5e5007f6a0e86ab625/Shelli-0.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d117b069890cd38190c73fad03d4492a", "sha256": "fb75e5f3ba6d23318dc58157fd25c3eeeb147de9120002ecdfc3ec3eb0868ae9" }, "downloads": -1, "filename": "Shelli-0.3.tar.gz", "has_sig": false, "md5_digest": "d117b069890cd38190c73fad03d4492a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12544, "upload_time": "2019-04-01T06:58:07", "url": "https://files.pythonhosted.org/packages/7b/f4/1a0ba66e13158fe3e0fb5c144afc4382be72a981e6fa4952a9d2f128f448/Shelli-0.3.tar.gz" } ] }