{ "info": { "author": "Arnaud Coomans", "author_email": "hello@acoomans.com", "bugtrack_url": null, "classifiers": [], "description": "Prvsn\n=================\n\n`prvsn` is a simple provisioning tool.\n\nIt can provision linux and mac, either locally or remotely. \n\n[![Build](https://travis-ci.org/acoomans/prvsn.svg?branch=master)](https://travis-ci.org/acoomans/prvsn)\n[![Pypi version](http://img.shields.io/pypi/v/prvsn.svg)](https://pypi.python.org/pypi/prvsn)\n[![Pypi license](http://img.shields.io/pypi/l/prvsn.svg)](https://pypi.python.org/pypi/prvsn)\n![Python 2](http://img.shields.io/badge/python-2-blue.svg)\n![Python 3](http://img.shields.io/badge/python-3-blue.svg)\n\n![Screenshot](documentation/screenshot.png)\n\n\n## Motivation\n\nThe motivation for this tool is too keep track of configuration steps and being able to rebuild a small setup (e.g. a raspberry pi) quickly and with minimal effort.\n\n### Goals\n\nEasy for quickly setup a machine for hacking:\n\n- easy to provision a single machine\n- works in python\n- simple way to\n - add a file, possibly a template\n - install package\n - run a command in bash\n- works out of the box:\n - python 2.7 & 3 compatibility\n - no external dependencies\n\n### Non-Goals\n\nLarge scale provisioning:\n\n- provision thousands or more machines\n- strict dependencies, complex dependency graph\n- external recipes & supermarket/store support\n\nIf those are your goals, have a look at Puppet or Chef or others.\n\n\n## Installation\n\n### Install\n\nFrom PyPi:\n\n pip install prvsn\n \nFrom Github:\n\n git clone git@github.com:acoomans/prvsn.git\n cd prvsn\n\tpython setup.py install\n\nOr for development:\n\n\tpython setup.py develop\n\n\n## Usage\n\n### Hierarchy\n\nConfigurations are called `roles` and are grouped into a `runbook`.\n\nThe file hierarchy looks like:\n\n\trunbook\n\t|- roles\n\t |- web\n\t |- ...\n\t |- desktop\n\t |- main.py\n\t |- files\n\n\n- `main.py` is the main python entry point\n- `files` is to contain any files you want to use\n\n### Tasks\n\nA role's `main.py` can contain one or more `tasks` (also called `states` since they're mostly descriptive).\n\nCommon task options include:\n\n- `secure`: no output will be shown on console nor logs.\n\n\n#### Command Tasks\n\n`command(interpreter, cmd)`\n\n`bash(cmd)`:\n\nRuns some code in bash. Hopefully this is never needed.\n\n bash('echo \"hello\"')\n \n\tbash('''\n\t echo \"hello\"\n\t ls\n\t ps\n\t''')\n\n`ruby(cmd)`\n\nRuns some code in ruby.\n\n\n### File Extension Handler Tasks\n\n`file_handler` (mac only)\n\nAssociate an application with a file extension.\n\n file_handler('.txt', 'com.macromates.TextMate')\n\nThe application's identifier can be found with:\n\n mdls -name kMDItemCFBundleIdentifier -r /Applications/TextMate.app\n\n\n\n#### File Tasks\n\n`file(source, file, replacements={})`:\n\n`source` can either be a URL or a file's path relative to the role's `files` directory.\n\n\tfile('asound.conf', '/etc/asound.conf')\n\t\n\tfile(\n\t 'http://example.com/asound.conf', \n\t '/etc/asound.conf'\n\t)\n\nreplacements rules can be specified, so the file acts as a template.\n\n\tfile(\n\t\t'resolv.conf', \n\t\t'/etc/resolv.conf',\n\t\t{\n\t\t 'MYIPADDRESS': '192.168.0.1'\n\t\t}\n\t)\n\n### Hostname tasks\n\n`hostname`:\n\n hostname('my_machine')\n\n#### Kernel Tasks\n\n`module(name)` (linux only):\n\nAdds and loads a module.\n\n\tmodule('v4l')\n\n#### Package Tasks\n\n`package`:\n\nShould automatically detect the package manager in presence. \nIf multiple managers are present, it is possible to explicitly specify which to use:\n\n package('vim')\n\t\n\t[for package(p) in '''\n\tvim\n\temacs\n\t'''.split()]\n\n`homebrew_package` (mac only)\n\n`cask_package` (mac only)\n\n`mac_app_store` (mac only)\n\n mac_app_store('937984704')\n\nApplication identifiers can be found with:\n \n mas search app_name\n\n\n`apt_package`\n\n`yum_package`\n\n\n### Command line\n\n#### init\n\nCreates the hierarchy for a new runbook.\n\n prvsn init -b path/to/runbook\n\n#### provision\n\nDefault command if no host is specified. Provisions the machine `prvsn` runs on.\n\n prvsn provision -b path/to/runbook -r role1,role2\n\nor alternatively, if running from the runbook directory:\n\n prvsn -r role1,role2\n \n`--sudo` can be used to provision as root.\n\n#### package\n\nCreates an executable package with the runbook and the roles. The default package name is `package.pyz`.\n\n prvsn package -b path/to/runbook -r role1,role2 -o mypackage.pyz\n\nThe package can then be run individually:\n\n python mypackage.pyz\n\n#### remote\n\nDefault command if a host is specified. Provision a remote host by:\n\n1. creating a package\n2. sending the package over ssh\n3. running the package over ssh\n\nexample:\n\n prvsn remote -b path/to/runbook -r role1,role2 -n myhostname -u myuser\n\nAdditionally, ssh public key will be installed on the remote host (if no key is present, one is created). To disable this behavior, use '--no-copy-keys'.\n\n`--sudo` can be used to provision as root (on the remote host).", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/acoomans/prvsn", "keywords": "provision", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "prvsn", "package_url": "https://pypi.org/project/prvsn/", "platform": "any", "project_url": "https://pypi.org/project/prvsn/", "project_urls": { "Homepage": "https://github.com/acoomans/prvsn" }, "release_url": "https://pypi.org/project/prvsn/0.3/", "requires_dist": null, "requires_python": "", "summary": "A simple provisioning tool", "version": "0.3" }, "last_serial": 4522394, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "7c5557401e34ba91818b8968659d1282", "sha256": "86ac756b41d8c357e27f3239787f7c8688f81a5b29a4f61679a10157a5051eec" }, "downloads": -1, "filename": "prvsn-0.1.tar.gz", "has_sig": false, "md5_digest": "7c5557401e34ba91818b8968659d1282", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9936, "upload_time": "2018-11-18T08:30:48", "url": "https://files.pythonhosted.org/packages/7e/f1/e89631f19bc55c006afcd5d142a8a1b70b2fc6cc6f09d4a0546253147d7c/prvsn-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "22f8452075c175cc37be3cad36dae302", "sha256": "039df477e38195ba256a2e80ae4ff051ab93342cd2a59f87abf95b080ffb19dc" }, "downloads": -1, "filename": "prvsn-0.2.tar.gz", "has_sig": false, "md5_digest": "22f8452075c175cc37be3cad36dae302", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12198, "upload_time": "2018-11-19T05:10:38", "url": "https://files.pythonhosted.org/packages/c6/89/d3ef2ad6966e1c71fd1e4f79aee0d383ce8a2783543726a7366bfc5385e2/prvsn-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "d7fe0e37f682e267a587fb157f461313", "sha256": "93d20256006798a0068236304ac15db6ac06262d2125217f7b3def8422e23b59" }, "downloads": -1, "filename": "prvsn-0.3.tar.gz", "has_sig": false, "md5_digest": "d7fe0e37f682e267a587fb157f461313", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14064, "upload_time": "2018-11-24T04:21:46", "url": "https://files.pythonhosted.org/packages/29/c6/66ca4f04d29fbfa46c27501c1f5573fc83cb9c0a426058d049c9d90da993/prvsn-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d7fe0e37f682e267a587fb157f461313", "sha256": "93d20256006798a0068236304ac15db6ac06262d2125217f7b3def8422e23b59" }, "downloads": -1, "filename": "prvsn-0.3.tar.gz", "has_sig": false, "md5_digest": "d7fe0e37f682e267a587fb157f461313", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14064, "upload_time": "2018-11-24T04:21:46", "url": "https://files.pythonhosted.org/packages/29/c6/66ca4f04d29fbfa46c27501c1f5573fc83cb9c0a426058d049c9d90da993/prvsn-0.3.tar.gz" } ] }