{ "info": { "author": "chaostoolkit Team", "author_email": "contact@chaostoolkit.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: Freely Distributable", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation", "Programming Language :: Python :: Implementation :: CPython" ], "description": "# Chaos Toolkit Extension for SaltStack\n\n[![Build Status](https://travis-ci.org/chaostoolkit-incubator/chaostoolkit-saltstack.svg?branch=master)](https://travis-ci.org/chaostoolkit-incubator/chaostoolkit-saltstack)\n[![Python versions](https://img.shields.io/pypi/pyversions/chaostoolkit-saltstack.svg)](https://www.python.org/)\n\nThis project is a collection of [actions][] and [probes][], gathered as an\nextension to the [Chaos Toolkit][chaostoolkit]. \n\n[actions]: http://chaostoolkit.org/reference/api/experiment/#action\n[probes]: http://chaostoolkit.org/reference/api/experiment/#probe\n[chaostoolkit]: http://chaostoolkit.org\n[saltstack]: https://www.saltstack.com/\n\nGenerally [SaltStack][saltstack] runs minion agents in machine level, and minions are under management of one or more SaltMaster machines.\nOn the SaltMaster or via API, SaltMaster can run bulk commands or scripts or other actions on any connected minion.\nThe biggest advantage of SaltSatck is adapting cross cloud solutions on VM level chaos experiments.\nIf you are working on hybrid cloud and have network tunnelled, one SaltMaster could control all VMs across multiple clouds, e.g. Azure, AWS, etc.\n\n## Install\n\nThis package requires Python 3.5+\n\nTo be used from your experiment, this package must be installed in the Python\nenvironment where [chaostoolkit][] already lives.\n\n```\n$ pip install -U chaostoolkit-saltstack\n```\n\n\n## Usage\n\nTo use the probes and actions from this package, add the following to your\nexperiment file:\n\n```json\n{\n \"type\": \"action\",\n \"name\": \"burn_cpu\",\n \"provider\": {\n \"type\": \"python\",\n \"module\": \"chaossaltstack.machines.actions\",\n \"func\": \"burn_cpu\",\n \"secrets\": [\"saltstack\"],\n \"arguments\": {\n \"parameters\": {\n \"execution_duration\": \"300\"\n }\n }\n }\n}\n```\n\nThat's it!\n\nPlease explore the code to see existing probes and actions.\n\n\n\n## Configuration\n\n### Credentials\n 0. Salt Master URL\n * SALTMASTER_HOST\n\n 1. Useranme & Password.\n -d username='salt' -d password='abcd1234' -d eauth='pam'\n Then a token in obrained via /login\n\n 2. Token\n A token directly, same with the backend of 1.\n\n 3. Key, only from Salt Master\n * SALTMASTER_HOST: Salt Master API address\n\n You can authenticate with user / password via:\n * SALTMASTER_USER: the user name\n * SALTMASTER_PASSWORD: the password\n\n Or via a token:\n * SALTMASTER_TOKEN\n\n\nThere are two ways of doing this:\n\n* you can either pass the name of the environment variables to the experiment definition as follows (recommended):\n\n ```json\n {\n \"saltstack\": {\n \"SALTMASTER_HOST\": {\n \"type\": \"env\",\n \"key\": \"SALTMASTER_HOST\"\n },\n \"SALTMASTER_USER\": {\n \"type\": \"env\",\n \"key\": \"SALTMASTER_USER\"\n },\n \"SALTMASTER_PASSWORD\": {\n \"type\": \"env\",\n \"key\": \"SALTMASTER_PASSWORD\"\n }\n }\n }\n ```\n\n ```json\n {\n \"saltstack\": {\n \"SALTMASTER_HOST\": {\n \"type\": \"env\",\n \"key\": \"SALTMASTER_HOST\"\n },\n \"SALTMASTER_TOKEN\": {\n \"type\": \"env\",\n \"key\": \"SALTMASTER_TOKEN\"\n }\n }\n }\n ```\n\n* or you inject the secrets explicitly to the experiment definition:\n\n ```json\n {\n \"saltstack\": {\n \"SALTMASTER_HOST\": \"https://172.10.20.666\",\n \"SALTMASTER_USER\": \"username\",\n \"SALTMASTER_PASSWORD\": \"password\"\n }\n }\n ```\n\n ```json\n {\n \"saltstack\": {\n \"SALTMASTER_HOST\": \"https://172.10.20.666\",\n \"SALTMASTER_TOKEN\": \"abcd1234abcd1234abcd1234\"\n }\n }\n ```\n\n Additionally you may directly use if you are on the SaltMaster\n\n\n### Putting it all together\n\nHere is a full example:\n\n```json\n{\n \"version\": \"1.0.0\",\n \"title\": \"...\",\n \"description\": \"...\",\n \"tags\": [\n \"azure\",\n \"kubernetes\",\n\t\"aks\",\n\t\"node\"\n ],\n \"configuration\": {\n \"saltstack\": {\n \"environment\": \"azure\"\n\t}\n },\n \"secrets\": {\n \"saltstack\": {\n \"SALTMASTER_HOST\": \"https://172.20.1.172:8000\",\n \"SALTMASTER_USER\": \"saltuser\",\n \"SALTMASTER_PASSWORD\": \"asfasfasdfa\"\n }\n },\n \"steady-state-hypothesis\": {\n \"title\": \"Services are all available and healthy\",\n \"probes\": [\n {\n \"type\": \"probe\",\n \"name\": \"check_minions_online\",\n \"provider\": {\n \"type\": \"python\",\n \"module\": \"chaossaltstack.machine.probes\",\n \"func\": \"is_minion_online\",\n \"arguments\": {\n \"instance_ids\": [ \"PABCDEFGS0016\",\"PABCDEFGS0666\" ]\n },\n \"secrets\": [\"saltstack\"]\n }\n }\n ]\n },\n \"method\": [\n {\n \"type\": \"action\",\n \"name\": \"stress_cpu\",\n \"provider\": {\n \"type\": \"python\",\n \"module\": \"chaossaltstack.machine.probes\",\n \"module\": \"saltstack.machine.actions\",\n \"func\": \"stress_cpu\",\n \"arguments\": {\n \"execution_duration\": \"300\",\n \"instance_ids\": [ \"PABCDEFGS0016\",\"PABCDEFGS0666\" ]\n },\n \"secrets\": [\"saltstack\"]\n }\n }\n ],\n \"rollbacks\": [\n\n ]\n}\n```\n\n## Contribute\n\nIf you wish to contribute more functions to this package, you are more than\nwelcome to do so. Please, fork this project, make your changes following the\nusual [PEP 8][pep8] code style, sprinkling with tests and submit a PR for\nreview.\n\n[pep8]: https://pycodestyle.readthedocs.io/en/latest/\n\nThe Chaos Toolkit projects require all contributors must sign a\n[Developer Certificate of Origin][dco] on each commit they would like to merge\ninto the master branch of the repository. Please, make sure you can abide by\nthe rules of the DCO before submitting a PR.\n\n[dco]: https://github.com/probot/dco#how-it-works\n\n### Develop\n\nIf you wish to develop on this project, make sure to install the development\ndependencies. But first, [create a virtual environment][venv] and then install\nthose dependencies.\n\n[venv]: http://chaostoolkit.org/reference/usage/install/#create-a-virtual-environment\n\n```console\n$ pip install -r requirements-dev.txt -r requirements.txt \n```\n\nThen, point your environment to this directory:\n\n```console\n$ pip install -e .\n```\n\nNow, you can edit the files and they will be automatically be seen by your\nenvironment, even when running from the `chaos` command locally.\n\n### Test\n\nTo run the tests for the project execute the following:\n\n```\n$ pytest\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://chaostoolkit.org", "keywords": "", "license": "Apache License Version 2.0", "maintainer": "", "maintainer_email": "", "name": "chaostoolkit-saltstack", "package_url": "https://pypi.org/project/chaostoolkit-saltstack/", "platform": "", "project_url": "https://pypi.org/project/chaostoolkit-saltstack/", "project_urls": { "Homepage": "https://chaostoolkit.org" }, "release_url": "https://pypi.org/project/chaostoolkit-saltstack/0.1.0/", "requires_dist": [ "chaostoolkit-lib (~=1.6)", "logzero (~=1.5)", "requests (~=2.2)" ], "requires_python": ">=3.5.*", "summary": "Chaos Toolkit Extension for SaltStack", "version": "0.1.0" }, "last_serial": 5840798, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "5e12ea22f7107cb1cb51d20fea94b5bc", "sha256": "e1b60cfad8b42f5bdfefba3516e04703ca66d2d3e860ae0d8e3e0eae5ad7689d" }, "downloads": -1, "filename": "chaostoolkit_saltstack-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "5e12ea22f7107cb1cb51d20fea94b5bc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.*", "size": 17813, "upload_time": "2019-09-17T09:58:49", "url": "https://files.pythonhosted.org/packages/5f/d4/ecce2e1bb4e6b5ca04d9af1e7b3a24d108b64d8ea5e2bfc2bd2ad4b5287c/chaostoolkit_saltstack-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "af5c610784ee20a53f00498298c4c352", "sha256": "bcbbba22de15fbe027226e38e2d1932519e8d6b93dcef066aa8cf92a85c2eb5c" }, "downloads": -1, "filename": "chaostoolkit-saltstack-0.1.0.tar.gz", "has_sig": false, "md5_digest": "af5c610784ee20a53f00498298c4c352", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.*", "size": 15949, "upload_time": "2019-09-17T09:58:52", "url": "https://files.pythonhosted.org/packages/2b/ad/bf0fa942fb572966d2045f764603b4c4a6fe4177725c2e5d06fd198e0616/chaostoolkit-saltstack-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5e12ea22f7107cb1cb51d20fea94b5bc", "sha256": "e1b60cfad8b42f5bdfefba3516e04703ca66d2d3e860ae0d8e3e0eae5ad7689d" }, "downloads": -1, "filename": "chaostoolkit_saltstack-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "5e12ea22f7107cb1cb51d20fea94b5bc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.*", "size": 17813, "upload_time": "2019-09-17T09:58:49", "url": "https://files.pythonhosted.org/packages/5f/d4/ecce2e1bb4e6b5ca04d9af1e7b3a24d108b64d8ea5e2bfc2bd2ad4b5287c/chaostoolkit_saltstack-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "af5c610784ee20a53f00498298c4c352", "sha256": "bcbbba22de15fbe027226e38e2d1932519e8d6b93dcef066aa8cf92a85c2eb5c" }, "downloads": -1, "filename": "chaostoolkit-saltstack-0.1.0.tar.gz", "has_sig": false, "md5_digest": "af5c610784ee20a53f00498298c4c352", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.*", "size": 15949, "upload_time": "2019-09-17T09:58:52", "url": "https://files.pythonhosted.org/packages/2b/ad/bf0fa942fb572966d2045f764603b4c4a6fe4177725c2e5d06fd198e0616/chaostoolkit-saltstack-0.1.0.tar.gz" } ] }