{ "info": { "author": "Geoff White", "author_email": "geoffw@ambientnetworks.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: System Administrators", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Build Tools" ], "description": "## installtool\nInstalltool is a python based CLI utility for scripting \"one-off\" installs of software packages on Linux based servers.\nIt is more light-weight then your typical CM tool like *Puppet* or *Chef*, but since it is *agentless*, it does borrow from the philosophy of Ansible. Unlike Ansible however, the *programming model* is more like assembly language, on the _retro_ tip.\nThe manifiest or **runbook** as it is called, is rendered in **YAML** and containes 4 basic sections:\n```\nhosts: # Put a list of Hosts that the actions will be applied to\nresources: # These are files and instaln packages that live in BLOBDIR\nactions: # How to do the install\nverify: # verify that the install was successful\n```\n\nThe **hosts** section specifys a list of Host entries. Each entry is a dict with the following fields:\n```\n\n ip : \n user : \n password : OR sshkey : { resource: }\n```\n\nThe **resources** section contains *resource definitions*. It is a dictionary where the key is the resource name, and the value is a dict which contains various key-value pairs depending on the value of the mandatory key, **type**. For example:\n```\n roguekey :\n type : key-object\n filename : \"roguekey.pem\"\n```\nDefines an ssh key resource which is contained in the file named \"roguekey.pem\". All files that are specified in this section are located in the path specified by the **--blobdir** option on the command line. If that option is missing, then the current working directory is assumed.\n\nHere are the operands that will be used by instructions in the **actions** section of the following example:\n```\nresources: # These are files and install packages that live in BLOBDIR\n hello :\n type : file-object\n filename : \"hello.php\"\n user : \"root\"\n mode : \"755\"\n destination : \"/var/www/html/index.php\"\n\n indexhtml :\n type : file-object\n filename : \"index.html\"\n user : \"root\"\n mode : \"755\"\n destination : \"/var/www/html/index.html\"\n\n htaccess :\n type : file-object\n filename : \"htaccess\"\n user : \"root\"\n mode : \"700\"\n destination : \"/var/www/html/.htaccess\"\n\n```\nThe **actions** section consists of an array of arrays. Each individual array element in the actions array is an _instruction_. Instructions have a single operator and can be followed by zero or more _operands_. One way to look at this \nlayout, is as an assembly language or microcode program. \nHere's a snippet of \"code\", that will install Apache, PHP, and load an index.php file into the Web server's html directory.\n```\nactions: # How to do the install\n - [NOP]\n - [XEQ, \"apt-get --yes update\"]\n - [XEQ, \"apt-get --yes install php5-common libapache2-mod-php5 php5-cli\", timeout : 300]\n - [XFER, file-object: hello]\n - [XFER, file-object: htaccess]\n - [XREM, file-object: indexhtml]\n - [XEQ, \"service apache2 restart\"]\n - [END]\n\n```\nThe **XEQ** operator MUST be followed by at least one operand, which is a string containing a bash shell command that will be executed on the remote host. There can also be some optional operands that control certain behavior (like _timeout_ ) or provide resource identifiers which are how files in the BLOBDIR are referenced by the instructions. Here the resource identifiers of the **XFER** instructions, describe various files and where they should be loaded, the resource identifier of the **XREM** instruction, describes the path to a file that needs to be removed.\n\nThe **verify** section contains special instructions to verify the results of the operations performed in the **actions** section on each host specified in the **hosts** section. Currently, the only instruction that is available is a simple \"health check\":\n```\nCRL # operand is an http path, i.e. \"/\" will perform a GET on http:///\n```\nThere are two input components to the overall tool, a configuration file or runbook, composed in YAML and a \"blob dir\"\nwhich contains artifacts that will be transferred to the host to be configured based on descriptions found in the runbook under the _resources_ section. A nifty feature of this tool is that you can provide a YAML **answer-file** to automate the installation of some 3rd party apps that insist on requiring human keyboard interaction.\n\nThis tool requires Python 3, the pexpect, yaml, json and inspect libraries.\n\n```\nusage: installtool.py [-h] [--file FILE] [--blobdir BLOBDIR] [--debug]\n [--quiet] [--verify] [--threads THREADS]\n [--loglevel LOGLEVEL]\n\ninstall a site via remote execution\n\noptional arguments:\n -h, --help show this help message and exit\n --file FILE, -f FILE yaml config file\n --blobdir BLOBDIR, -b BLOBDIR\n If present, directory to get deploy artifacts from\n --debug, -d Enable various debugging output\n --quiet, -q silence all output\n --verify, -v Perform only the verification actions on the host list\n --threads THREADS, -t THREADS\n perform host actions with M concurrent threads\n --loglevel LOGLEVEL, -l LOGLEVEL\n Log Level, default is WARN\n```\n\nThere are currently 5 \"operators\" available for use in the *actions* section :\n```\nNOP # Just send a \\n to the session\nXEQ # followed by a command to execute remotely\nXREM # Remove a file from the remote hosts\nXFER # Transfer a file to the remote host via scp\nEND # Don't expect any more \"instructions\"\n```\n\nTo get a sense of how the tool works, take a look at *phpinstall.yaml* which will install Apache, PHP, and set an index.php file to display \"Hello World!\" when you browse to http:///. The runbook *gainstall.yaml* together with the answer-file in the *resources* directory *ga570-answers.yaml* is an example of using the tool to install a third party app that requires human interaction, in this case, the GoAnywhere MFT. These examples can be found at the github repo.\n\nThe command\n```\ninstalltool.py -df phpinstall.yaml -b resources\n```\nWill perform the runbook *phpinstall.yaml* with verbose output utilizing resources that will be found in the directory *resources*\n\nEnjoy and Deploy!\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://github.com/l0r3zz/public/tree/master/installtool", "keywords": "install automation remote yaml", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "installtool", "package_url": "https://pypi.org/project/installtool/", "platform": "", "project_url": "https://pypi.org/project/installtool/", "project_urls": { "Homepage": "https://github.com/l0r3zz/public/tree/master/installtool" }, "release_url": "https://pypi.org/project/installtool/0.99.7/", "requires_dist": [ "pexpect" ], "requires_python": ">=3", "summary": "Perform remote installs using yaml runbooks", "version": "0.99.7" }, "last_serial": 4236549, "releases": { "0.97.0.0": [ { "comment_text": "", "digests": { "md5": "4e59df28ea3a6ffa2a333a1e78a799c1", "sha256": "e789f48e959a81fda6f6de836e763ee7139230a6749386a0f3d02813d29276a1" }, "downloads": -1, "filename": "installtool-0.97.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "4e59df28ea3a6ffa2a333a1e78a799c1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 10626, "upload_time": "2018-05-29T23:21:32", "url": "https://files.pythonhosted.org/packages/52/2d/477254a78cdb0d405c940697ffd28ac88412dd2950f7f35d53fb01643a5a/installtool-0.97.0.0-py3-none-any.whl" } ], "0.98.0.0": [ { "comment_text": "", "digests": { "md5": "31fc8f2748b00ff5f510f35afaf30439", "sha256": "082442be6b571e02d0ecfcb7414781de5be8c1384234da769cedda4a616f19de" }, "downloads": -1, "filename": "installtool-0.98.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "31fc8f2748b00ff5f510f35afaf30439", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 10685, "upload_time": "2018-06-04T15:23:06", "url": "https://files.pythonhosted.org/packages/69/45/53892cf31d3cf3e2a56a37763249338aa8dc177a8e85e084c6f56cd8f392/installtool-0.98.0.0-py3-none-any.whl" } ], "0.99.7": [ { "comment_text": "", "digests": { "md5": "5d516f40907b32171aacd2e68c2282bd", "sha256": "a6a5407b49d3949058bf317a3931e6311f6589f5ababc1847b26185b9d7b5ffd" }, "downloads": -1, "filename": "installtool-0.99.7-py3-none-any.whl", "has_sig": false, "md5_digest": "5d516f40907b32171aacd2e68c2282bd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 10720, "upload_time": "2018-09-04T06:29:38", "url": "https://files.pythonhosted.org/packages/93/74/3f2a7d5c6626e83b57d850bb963283c3e8c1086b4322a926057c13fc8f5b/installtool-0.99.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c52dce576fb75d23d3ec36a5ea2b698d", "sha256": "ed0438f7190daaafc6518e8636ff67292a339cd31ff9e39d8a8a2a8275223810" }, "downloads": -1, "filename": "installtool-0.99.7.tar.gz", "has_sig": false, "md5_digest": "c52dce576fb75d23d3ec36a5ea2b698d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 10232, "upload_time": "2018-09-04T06:29:39", "url": "https://files.pythonhosted.org/packages/73/1d/4bad6ebffea1ebd4faef67187940e6a8fc0af2fbfe636105d25c0dee7e38/installtool-0.99.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5d516f40907b32171aacd2e68c2282bd", "sha256": "a6a5407b49d3949058bf317a3931e6311f6589f5ababc1847b26185b9d7b5ffd" }, "downloads": -1, "filename": "installtool-0.99.7-py3-none-any.whl", "has_sig": false, "md5_digest": "5d516f40907b32171aacd2e68c2282bd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 10720, "upload_time": "2018-09-04T06:29:38", "url": "https://files.pythonhosted.org/packages/93/74/3f2a7d5c6626e83b57d850bb963283c3e8c1086b4322a926057c13fc8f5b/installtool-0.99.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c52dce576fb75d23d3ec36a5ea2b698d", "sha256": "ed0438f7190daaafc6518e8636ff67292a339cd31ff9e39d8a8a2a8275223810" }, "downloads": -1, "filename": "installtool-0.99.7.tar.gz", "has_sig": false, "md5_digest": "c52dce576fb75d23d3ec36a5ea2b698d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 10232, "upload_time": "2018-09-04T06:29:39", "url": "https://files.pythonhosted.org/packages/73/1d/4bad6ebffea1ebd4faef67187940e6a8fc0af2fbfe636105d25c0dee7e38/installtool-0.99.7.tar.gz" } ] }